@guren/server 1.0.0-rc.25 → 1.0.0-rc.26

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.
package/dist/index.d.ts CHANGED
@@ -1,16 +1,19 @@
1
- import { E as ErrorResponse, S as ServiceProvider, C as Container, c as ServiceBindings, Q as QueueManager, N as NotificationManager } from './Application-Hlryz3ln.js';
2
- export { A as Application, d as ApplicationListenOptions, e as AuthPayload, f as CSRF_FORM_FIELD, g as CSRF_HEADER_NAME, h as CSRF_TOKEN_KEY, P as ContainerProvider, i as ContextualBinding, j as ContextualBindingBuilder, k as ContextualNeedsBuilder, m as Controller, n as ControllerInertiaProps, o as CsrfOptions, p as DatabaseChannelOptions, q as DatabaseNotification, r as ExceptionClass, t as ExceptionHandler, u as ExceptionHandlerOptions, v as ExceptionRenderer, w as ExceptionReporter, F as FailedJob, H as HostAuthorizationOptions, x as HstsOptions, I as InertiaOptions, y as InertiaPagePayload, z as InertiaResponse, B as InertiaSharedProps, J as InertiaSsrContext, K as InertiaSsrOptions, L as InertiaSsrRenderer, M as InertiaSsrResult, O as InferInertiaProps, R as Job, T as JobClass, U as JobFailureHandler, V as JobHandler, W as JobOptions, X as Notifiable, Y as Notification, Z as NotificationAttachment, _ as NotificationChannel, $ as NotificationChannelFactory, a0 as NotificationClass, a1 as NotificationMailMessage, a2 as NotificationManagerOptions, a3 as ProviderManager, a4 as QueueConfig, a5 as QueueDriver, a6 as QueueDriverFactory, a7 as QueuedJob, a8 as RendererRegistration, a9 as ResolvedSharedInertiaProps, aa as ResourceRouteOptions, ab as RouteBuilder, ac as RouteContractOptions, ad as RouteDefinition, ae as RouteOpenApiMetadata, af as RouteResourceAction, ag as Router, ah as SecurityHeadersOptions, ai as SentNotification, aj as ServiceBinding, ak as ServiceClass, al as ServiceFactory, am as ServiceProviderClass, an as ServiceProviderConstructor, ao as ServiceProviderOptions, ap as SharedInertiaPropsResolver, aq as SlackAttachment, ar as SlackBlock, as as SlackMessage, at as VALIDATED_DATA_KEY, au as ValidateRequestOptions, av as ValidationSchema, aw as WorkerOptions, ax as abort, ay as abortIf, az as abortUnless, aA as clearJobRegistry, aB as createApp, aC as createContainer, aD as createCsrfMiddleware, aE as createExceptionHandler, aF as createHostAuthorizationMiddleware, aG as createNotificationManager, aH as createQueueManager, aI as createSecurityHeaders, aJ as csrfField, aK as formatValidationErrors, aL as getContainer, aM as getCsrfToken, aN as getExceptionHandler, aO as getInertiaSharedPropsResolver, aP as getJob, aQ as getNotificationManager, aR as getQueueDriver, aS as getRegisteredJobs, aT as getValidatedData, aU as inertia, aV as parseRequestPayload, aW as registerJob, aX as resolve, aY as setContainer, aZ as setExceptionHandler, a_ as setInertiaSharedProps, a$ as setNotificationManager, b0 as setQueueDriver, b1 as shareInertiaProps, b2 as validate, b3 as validateRequest, b4 as validateRequestWith, b5 as validateSafe, b6 as verifyCsrfToken } from './Application-Hlryz3ln.js';
1
+ import { E as ErrorResponse, S as ServiceProvider, C as Container, c as ServiceBindings, Q as QueueManager, N as NotificationManager } from './Application-BnsyCKXY.js';
2
+ export { A as Application, d as ApplicationListenOptions, e as ApplicationOptions, f as AuthPayload, g as AuthPluginOptions, h as CSRF_FORM_FIELD, i as CSRF_HEADER_NAME, j as CSRF_TOKEN_KEY, P as ContainerProvider, k as ContextualBinding, m as ContextualBindingBuilder, n as ContextualNeedsBuilder, o as Controller, p as ControllerInertiaProps, q as CsrfOptions, r as DatabaseChannelOptions, t as DatabaseNotification, u as ExceptionClass, v as ExceptionHandler, w as ExceptionHandlerOptions, x as ExceptionRenderer, y as ExceptionReporter, F as FailedJob, H as HostAuthorizationOptions, z as HstsOptions, I as InertiaOptions, B as InertiaPagePayload, J as InertiaResponse, K as InertiaSharedProps, L as InertiaSsrContext, M as InertiaSsrOptions, O as InertiaSsrRenderer, R as InertiaSsrResult, T as InferInertiaProps, U as Job, V as JobClass, W as JobFailureHandler, X as JobHandler, Y as JobOptions, Z as Notifiable, _ as Notification, $ as NotificationAttachment, a0 as NotificationChannel, a1 as NotificationChannelFactory, a2 as NotificationClass, a3 as NotificationMailMessage, a4 as NotificationManagerOptions, a5 as ProviderManager, a6 as QueueConfig, a7 as QueueDriver, a8 as QueueDriverFactory, a9 as QueuedJob, aa as RendererRegistration, ab as ResolvedSharedInertiaProps, ac as ResourceRouteOptions, ad as RouteBuilder, ae as RouteContractOptions, af as RouteDefinition, ag as RouteOpenApiMetadata, ah as RouteResourceAction, ai as Router, aj as SecurityHeadersOptions, ak as SentNotification, al as ServiceBinding, am as ServiceClass, an as ServiceFactory, ao as ServiceProviderClass, ap as ServiceProviderConstructor, aq as ServiceProviderOptions, ar as SharedInertiaPropsResolver, as as SlackAttachment, at as SlackBlock, au as SlackMessage, av as VALIDATED_DATA_KEY, aw as ValidateRequestOptions, ax as ValidationSchema, ay as WorkerOptions, az as abort, aA as abortIf, aB as abortUnless, aC as clearJobRegistry, aD as createApp, aE as createContainer, aF as createCsrfMiddleware, aG as createExceptionHandler, aH as createHostAuthorizationMiddleware, aI as createNotificationManager, aJ as createQueueManager, aK as createSecurityHeaders, aL as csrfField, aM as formatValidationErrors, aN as getContainer, aO as getCsrfToken, aP as getExceptionHandler, aQ as getInertiaSharedPropsResolver, aR as getJob, aS as getNotificationManager, aT as getQueueDriver, aU as getRegisteredJobs, aV as getValidatedData, aW as inertia, aX as parseRequestPayload, aY as registerJob, aZ as resolve, a_ as setContainer, a$ as setExceptionHandler, b0 as setInertiaSharedProps, b1 as setNotificationManager, b2 as setQueueDriver, b3 as shareInertiaProps, b4 as validate, b5 as validateRequest, b6 as validateRequestWith, b7 as validateSafe, b8 as verifyCsrfToken } from './Application-BnsyCKXY.js';
3
3
  import * as hono from 'hono';
4
4
  import { Context, MiddlewareHandler } from 'hono';
5
5
  export { Context } from 'hono';
6
- import { a as AuthContext } from './api-token-ChekhpB7.js';
7
- export { c as API_TOKEN_KEY, b as ApiToken, d as ApiTokenStore, e as AuthCredentials, A as AuthManager, f as AuthManagerOptions, g as Authenticatable, B as BaseUserProvider, h as BearerTokenMiddlewareOptions, i as CreateApiTokenOptions, j as CreateApiTokenResult, G as Guard, k as GuardContext, l as GuardFactory, M as MemoryApiTokenStore, m as MemoryOAuthStateStore, n as MemorySessionStore, o as ModelUserProvider, p as OAuthAuthorizeOptions, q as OAuthCallbackPayload, O as OAuthManager, r as OAuthManagerOptions, s as OAuthProviderConfig, t as OAuthProviderFactoryInput, u as OAuthStateConfig, v as OAuthStatePayload, w as OAuthStateStore, x as OAuthTokenResult, y as OAuthUserProfile, P as ProviderFactory, S as Session, z as SessionData, D as SessionStore, U as UserProvider, E as buildOAuthAuthorizeUrl, F as buildOAuthRedirectUrl, H as createApiToken, I as createBearerTokenMiddleware, J as createDiscordOAuthProviderConfig, K as createGitHubOAuthProviderConfig, L as createGoogleOAuthProviderConfig, N as createOAuthManager, Q as createOAuthState, R as createSessionMiddleware, T as exchangeOAuthCode, V as fetchOAuthUserProfile, W as getApiToken, X as getApiTokenOrFail, Y as getSessionFromContext, Z as getUserApiTokens, _ as parseApiToken, $ as parseOAuthRedirectUrl, a0 as revokeAllApiTokens, a1 as revokeApiToken, a2 as tokenCan, a3 as tokenCanAll, a4 as tokenCanAny, a5 as verifyApiToken, a6 as verifyOAuthState } from './api-token-ChekhpB7.js';
8
- export { AuthenticatableModel, EmailVerificationConfig, EmailVerificationToken, EmailVerificationTokenResult, EmailVerificationTokenStore, ScryptHasher as Hash, MemoryEmailVerificationStore, MemoryPasswordResetStore, NodeHasher, PasswordResetConfig, PasswordResetTokenResult, PasswordResetTokenStore, ScryptHasher, SessionGuard, buildPasswordResetUrl, buildVerificationUrl, completeEmailVerification, completePasswordReset, createEmailVerificationToken, createPasswordResetToken, isEmailVerified, parsePasswordResetUrl, parseVerificationUrl, requireVerifiedEmail, verifyEmailToken, verifyPasswordResetToken } from './auth/index.js';
6
+ import { P as PasswordHasher } from './AuthManager-SfhCNkAU.js';
7
+ export { A as AuthManager, B as BaseUserProvider, M as ModelUserProvider } from './AuthManager-SfhCNkAU.js';
8
+ export { AuthenticatableModel, NodeHasher, ScryptHasher, SessionGuard } from './auth/index.js';
9
+ export { b as EmailVerificationConfig, a as EmailVerificationToken, c as EmailVerificationTokenResult, E as EmailVerificationTokenStore, M as MemoryEmailVerificationStore, d as MemoryPasswordResetStore, e as PasswordResetConfig, f as PasswordResetTokenResult, P as PasswordResetTokenStore, g as buildPasswordResetUrl, h as buildVerificationUrl, i as completeEmailVerification, j as completePasswordReset, k as createEmailVerificationToken, l as createPasswordResetToken, m as isEmailVerified, p as parsePasswordResetUrl, n as parseVerificationUrl, r as requireVerifiedEmail, v as verifyEmailToken, o as verifyPasswordResetToken } from './email-verification-CAeArjui.js';
10
+ import { g as AuthContext } from './api-token-BSSCLlFW.js';
11
+ export { m as API_TOKEN_KEY, j as ApiToken, i as ApiTokenStore, a as AuthCredentials, c as AuthManagerOptions, A as Authenticatable, B as BearerTokenMiddlewareOptions, n as CreateApiTokenOptions, o as CreateApiTokenResult, e as Guard, d as GuardContext, G as GuardFactory, M as MemoryApiTokenStore, p as MemoryOAuthStateStore, q as MemorySessionStore, r as OAuthAuthorizeOptions, s as OAuthCallbackPayload, l as OAuthManager, t as OAuthManagerOptions, u as OAuthProviderConfig, v as OAuthProviderFactoryInput, w as OAuthStateConfig, k as OAuthStatePayload, O as OAuthStateStore, x as OAuthTokenResult, y as OAuthUserProfile, P as ProviderFactory, z as Session, h as SessionData, S as SessionStore, U as UserProvider, D as buildOAuthAuthorizeUrl, E as buildOAuthRedirectUrl, F as createApiToken, H as createBearerTokenMiddleware, I as createDiscordOAuthProviderConfig, J as createGitHubOAuthProviderConfig, K as createGoogleOAuthProviderConfig, L as createOAuthManager, N as createOAuthState, Q as createSessionMiddleware, R as exchangeOAuthCode, T as fetchOAuthUserProfile, V as getApiToken, W as getApiTokenOrFail, X as getSessionFromContext, Y as getUserApiTokens, Z as parseApiToken, _ as parseOAuthRedirectUrl, $ as revokeAllApiTokens, a0 as revokeApiToken, a1 as tokenCan, a2 as tokenCanAll, a3 as tokenCanAny, a4 as verifyApiToken, a5 as verifyOAuthState } from './api-token-BSSCLlFW.js';
9
12
  export { M as Middleware, d as defineMiddleware, j as jsonResponse } from './index-9_Jzj5jo.js';
10
13
  import { E as EventManager } from './EventManager-CmIoLt7r.js';
11
14
  export { a as Event, b as EventClass, c as EventListener, d as EventSubscription, L as ListenerOptions, R as RegisteredListener, e as createEventManager } from './EventManager-CmIoLt7r.js';
12
15
  export { ApplicationShutdown, ApplicationStarted, JobFailed, JobProcessed, Listener, ListenerClass, RequestFinished, RequestReceived, UserAuthenticated, UserLoggedOut } from './events/index.js';
13
- export { FailedJobHandler, FailedJobInfo, FailedJobReporter, MemoryDriver, RedisDriver, RedisDriverOptions, SqsDriver, SyncDriver, Worker, WorkerEvents, createSqsAdapter, processJob } from './queue/index.js';
16
+ export { FailedJobHandler, FailedJobInfo, FailedJobReporter, MemoryDriver, MemoryDriver as MemoryQueueDriver, RedisDriver, RedisDriverOptions, RedisDriver as RedisQueueDriver, SqsDriver, SyncDriver, SyncDriver as SyncQueueDriver, Worker, WorkerEvents, createSqsAdapter, processJob } from './queue/index.js';
14
17
  import { M as MailManager } from './MailManager-DpMvYiP9.js';
15
18
  export { a as MailAddress, b as MailAttachment, c as MailConfig, d as MailMessage, e as MailTransport, f as MailTransportConfig, g as MailTransportFactory, h as MemoryTransportOptions, R as ResendTransportOptions, S as SendResult, i as SmtpTransportOptions, j as createMailManager } from './MailManager-DpMvYiP9.js';
16
19
  export { LogTransport, Mail, MemoryTransport, ResendTransport, SmtpTransport, getMailManager, mail, setMailManager } from './mail/index.js';
@@ -35,16 +38,17 @@ export { DatabaseChannel, MailChannel, MailChannelOptions, MemoryChannel, SlackC
35
38
  import { B as BroadcastManager } from './BroadcastManager-CGWl9rUO.js';
36
39
  export { A as AuthMiddlewareOptions, a as BroadcastDriver, b as BroadcastDriverFactory, c as BroadcastEvent, d as BroadcastManagerOptions, e as BroadcastableEvent, C as Channel, f as ChannelAuthorizer, g as ChannelRegistration, P as PresenceBroadcastDriver, h as PresenceChannel, i as PresenceChannelAuthorizer, j as PresenceMember, k as PrivateChannel, S as SSEClient, l as SSEMiddlewareOptions, W as WebSocketClient, m as createBroadcastManager, n as getBroadcastManager, s as setBroadcastManager } from './BroadcastManager-CGWl9rUO.js';
37
40
  export { RedisClient as BroadcastRedisClient, RedisDriverOptions as BroadcastRedisDriverOptions, MemoryDriver as MemoryBroadcastDriver, RedisDriver as RedisBroadcastDriver, createTypedBroadcaster } from './broadcasting/index.js';
38
- import { I as InputInterface, P as ParsedSignature, O as OptionDefinition, a as CommandInstance, b as OutputInterface } from './ConsoleKernel-CVvaK-I6.js';
39
- export { A as ArgumentDefinition, c as CommandClass, C as ConsoleKernel, d as ConsoleKernelOptions, e as ProgressInterface, f as PromptInterface, S as ScheduledCommand, g as createConsoleKernel } from './ConsoleKernel-CVvaK-I6.js';
41
+ import { I as InputInterface, P as ParsedSignature, O as OptionDefinition, a as CommandInstance, b as OutputInterface } from './ConsoleKernel-BDtBETjm.js';
42
+ export { A as ArgumentDefinition, c as CommandClass, C as ConsoleKernel, d as ConsoleKernelOptions, e as ProgressInterface, f as PromptInterface, S as ScheduledCommand, g as createConsoleKernel } from './ConsoleKernel-BDtBETjm.js';
40
43
  import * as readline from 'readline';
41
44
  export { R as AuthResponse, A as AuthUser, a as AuthorizationResponse, b as AuthorizeOptions, G as Gate, c as GateCallback, d as GateDefinition, e as GateOptions, P as PolicyClass, f as PolicyInterface, g as PolicyMethod, h as PolicyRegistration, i as ResourceAction, j as ResponseBuilder, k as authorizeAbility, l as can, m as cannot, n as createGate, o as defineGate, p as getGate, s as setGate } from './Gate-CynjZCtS.js';
42
45
  export { AuthorizedContext, Policy, authorizeAllMiddleware, authorizeMiddleware, authorizeResourceMiddleware, definePolicy, withAuthorization } from './authorization/index.js';
43
46
  export { A as AppKeyring, D as DecryptOptions, a as EncryptOptions, b as EncryptedPayload, E as Encrypter, c as EncrypterConfig, H as HashAlgorithm, d as HmacOptions, P as PasswordHashOptions, R as RandomStringOptions, e as createEncrypter, f as decrypt, g as deriveAppKey, h as deriveAppKeyring, i as encrypt, j as generateAppKey, k as generateKey, l as getAppKeyringFromEnv, m as getEncrypter, n as normalizeAppKey, p as parseAppKey, o as parsePreviousAppKeys, s as setEncrypter } from './app-key-CsBfRC_Q.js';
44
47
  export { MessageSigner, SignMessageOptions, SignedMessageClaims, SignedUrlOptions, VerifySignedMessageOptions, VerifySignedUrlOptions, check as checkHash, generateOtp, generatePassword, generateSlug, hash, hashPassword, hmac, md5, needsRehash, pick, random, randomBase64, randomBase64Url, randomHex, randomInt, randomString, sample, secureCompare, sha256, sha512, shuffle, signUrl, urlSafeToken, uuid, verifyHmac, verifyPassword, verifySignedUrl } from './encryption/index.js';
45
- import Redis, { RedisOptions } from 'ioredis';
48
+ export { M as MemoryRateLimitStore, a as RateLimitEntry, d as RateLimitInfo, e as RateLimitOptions, R as RateLimitStore, S as SlidingWindowRateLimitStore, f as createRateLimitMiddleware, c as createRedisClient, g as getRateLimitInfo, r as resetRateLimit } from './client-CKXJLsTe.js';
46
49
  import 'vite';
47
50
  import '@guren/orm';
51
+ import 'ioredis';
48
52
 
49
53
  interface RequireAuthOptions {
50
54
  redirectTo?: string;
@@ -56,199 +60,6 @@ declare function attachAuthContext(contextFactory: (ctx: Context) => AuthContext
56
60
  declare function requireAuthenticated(options?: RequireAuthOptions): MiddlewareHandler;
57
61
  declare function requireGuest(options?: RequireAuthOptions): MiddlewareHandler;
58
62
 
59
- /**
60
- * Rate limit entry stored in the backing store.
61
- */
62
- interface RateLimitEntry {
63
- count: number;
64
- resetAt: number;
65
- }
66
- /**
67
- * Store interface for rate limit data.
68
- * Implement this for Redis or database-backed storage.
69
- */
70
- interface RateLimitStore {
71
- /**
72
- * Get the current rate limit entry for a key.
73
- */
74
- get(key: string): Promise<RateLimitEntry | null>;
75
- /**
76
- * Increment the count for a key and return the new entry.
77
- * If the key doesn't exist, create it with count=1.
78
- */
79
- increment(key: string, windowMs: number): Promise<RateLimitEntry>;
80
- /**
81
- * Reset the count for a key.
82
- */
83
- reset(key: string): Promise<void>;
84
- }
85
- /**
86
- * Base class for in-memory rate limit stores with automatic cleanup.
87
- */
88
- declare abstract class BaseMemoryStore implements RateLimitStore {
89
- protected cleanupInterval?: ReturnType<typeof setInterval>;
90
- constructor(cleanupIntervalMs?: number);
91
- abstract get(key: string): Promise<RateLimitEntry | null>;
92
- abstract increment(key: string, windowMs: number): Promise<RateLimitEntry>;
93
- abstract reset(key: string): Promise<void>;
94
- abstract cleanup(): void;
95
- abstract clear(): void;
96
- abstract get size(): number;
97
- destroy(): void;
98
- }
99
- /**
100
- * In-memory rate limit store.
101
- * Suitable for single-process development, not for production clusters.
102
- */
103
- declare class MemoryRateLimitStore extends BaseMemoryStore {
104
- private entries;
105
- get(key: string): Promise<RateLimitEntry | null>;
106
- increment(key: string, windowMs: number): Promise<RateLimitEntry>;
107
- reset(key: string): Promise<void>;
108
- cleanup(): void;
109
- clear(): void;
110
- get size(): number;
111
- }
112
- /**
113
- * Configuration options for rate limiting.
114
- */
115
- interface RateLimitOptions {
116
- /**
117
- * Maximum number of requests allowed in the time window.
118
- * @default 100
119
- */
120
- limit?: number;
121
- /**
122
- * Time window in milliseconds.
123
- * @default 60000 (1 minute)
124
- */
125
- windowMs?: number;
126
- /**
127
- * Function to extract the rate limit key from the request.
128
- * Defaults to using the client IP address.
129
- */
130
- keyGenerator?: (ctx: Context) => string | Promise<string>;
131
- /**
132
- * Rate limit store implementation.
133
- * Defaults to in-memory store.
134
- */
135
- store?: RateLimitStore;
136
- /**
137
- * Whether to skip rate limiting for certain requests.
138
- */
139
- skip?: (ctx: Context) => boolean | Promise<boolean>;
140
- /**
141
- * Custom handler when rate limit is exceeded.
142
- */
143
- onRateLimited?: (ctx: Context, retryAfter: number) => Response | Promise<Response>;
144
- /**
145
- * Whether to add rate limit headers to all responses.
146
- * @default true
147
- */
148
- headers?: boolean;
149
- /**
150
- * Custom message when rate limit is exceeded.
151
- * @default 'Too many requests, please try again later.'
152
- */
153
- message?: string;
154
- /**
155
- * HTTP status code when rate limit is exceeded.
156
- * @default 429
157
- */
158
- statusCode?: number;
159
- /**
160
- * Prefix for rate limit keys.
161
- * @default 'rl:'
162
- */
163
- keyPrefix?: string;
164
- /**
165
- * Trust reverse-proxy headers for client IP resolution, checked in order:
166
- * `CF-Connecting-IP`, `True-Client-IP`, `X-Real-IP`, then the first entry
167
- * of `X-Forwarded-For`. Falls back to `server.requestIP()` when none are set.
168
- *
169
- * Enable ONLY when every request passes through a proxy that sets or strips
170
- * these headers — on direct deployments clients can spoof them to bypass
171
- * per-client limits. Ignored when a custom `keyGenerator` is supplied.
172
- * @default false
173
- */
174
- trustProxy?: boolean;
175
- }
176
- /**
177
- * Create a rate limiting middleware.
178
- *
179
- * @example
180
- * ```ts
181
- * // Basic usage - 100 requests per minute per IP
182
- * app.use('*', createRateLimitMiddleware())
183
- *
184
- * // Stricter limit for login endpoint
185
- * router.post('/login', [AuthController, 'login'],
186
- * createRateLimitMiddleware({
187
- * limit: 5,
188
- * windowMs: 15 * 60 * 1000, // 15 minutes
189
- * })
190
- * )
191
- *
192
- * // Custom key based on authenticated user
193
- * app.use('/api/*', createRateLimitMiddleware({
194
- * limit: 1000,
195
- * windowMs: 60 * 60 * 1000, // 1 hour
196
- * keyGenerator: async (ctx) => {
197
- * const user = await ctx.get('user')
198
- * return user?.id?.toString() ?? defaultKeyGenerator(ctx)
199
- * },
200
- * }))
201
- * ```
202
- */
203
- declare function createRateLimitMiddleware(options?: RateLimitOptions): MiddlewareHandler;
204
- /**
205
- * Rate limit result information.
206
- */
207
- interface RateLimitInfo {
208
- limit: number;
209
- remaining: number;
210
- resetAt: Date;
211
- isLimited: boolean;
212
- }
213
- /**
214
- * Get rate limit information for a key without incrementing.
215
- *
216
- * @example
217
- * ```ts
218
- * const info = await getRateLimitInfo('user:123', store, { limit: 100 })
219
- * console.log(`${info.remaining} requests remaining`)
220
- * ```
221
- */
222
- declare function getRateLimitInfo(key: string, store: RateLimitStore, options?: {
223
- limit: number;
224
- keyPrefix?: string;
225
- }): Promise<RateLimitInfo>;
226
- /**
227
- * Reset rate limit for a specific key.
228
- *
229
- * @example
230
- * ```ts
231
- * // Reset rate limit after successful captcha
232
- * await resetRateLimit(clientIp, store)
233
- * ```
234
- */
235
- declare function resetRateLimit(key: string, store: RateLimitStore, options?: {
236
- keyPrefix?: string;
237
- }): Promise<void>;
238
- /**
239
- * Sliding window rate limit store.
240
- * More accurate than fixed window but uses more memory.
241
- */
242
- declare class SlidingWindowRateLimitStore extends BaseMemoryStore {
243
- private requests;
244
- get(key: string): Promise<RateLimitEntry | null>;
245
- increment(key: string, windowMs: number): Promise<RateLimitEntry>;
246
- reset(key: string): Promise<void>;
247
- cleanup(): void;
248
- clear(): void;
249
- get size(): number;
250
- }
251
-
252
63
  interface CspDirectives {
253
64
  defaultSrc?: string[];
254
65
  scriptSrc?: string[];
@@ -1023,6 +834,10 @@ interface FileLike {
1023
834
  * // data is typed as StorePostData
1024
835
  * ```
1025
836
  */
837
+ /**
838
+ * @deprecated Legacy compatibility layer — prefer schema-first validation
839
+ * via `this.validateBody()` / `validateQuery()` / `validateParams()`.
840
+ */
1026
841
  declare abstract class FormRequest<T = Record<string, unknown>> {
1027
842
  protected ctx: Context;
1028
843
  /**
@@ -2302,10 +2117,6 @@ declare abstract class Command implements CommandInstance {
2302
2117
  * Call another command.
2303
2118
  */
2304
2119
  call(command: string, args?: string[]): Promise<number>;
2305
- /**
2306
- * Call another command silently.
2307
- */
2308
- callSilent(command: string, args?: string[]): Promise<number>;
2309
2120
  /**
2310
2121
  * Resolve a service from the container.
2311
2122
  */
@@ -2651,38 +2462,16 @@ declare function renderDebugPage(error: Error, request?: Request): string;
2651
2462
  declare function debugErrorMiddleware(): MiddlewareHandler;
2652
2463
 
2653
2464
  /**
2654
- * Options for creating a Redis client.
2465
+ * Runtime-detecting password hasher: uses Bun's native scrypt implementation
2466
+ * when running on Bun, and the Node.js crypto implementation otherwise
2467
+ * (e.g. AWS Lambda on the Node runtime). This is the hasher behind the
2468
+ * `Hash` export, so code written against `Hash` runs on both runtimes.
2655
2469
  */
2656
- interface RedisClientOptions extends RedisOptions {
2657
- /**
2658
- * Redis connection URL (e.g., 'redis://localhost:6379').
2659
- * If provided, overrides host/port/password.
2660
- */
2661
- url?: string;
2662
- /**
2663
- * Key prefix for all operations.
2664
- * @default ''
2665
- */
2666
- keyPrefix?: string;
2470
+ declare class DefaultHasher implements PasswordHasher {
2471
+ private readonly delegate;
2472
+ constructor();
2473
+ hash(plain: string): Promise<string>;
2474
+ verify(hashed: string, plain: string): Promise<boolean>;
2667
2475
  }
2668
- /**
2669
- * Create a Redis client with the given options.
2670
- *
2671
- * @example
2672
- * ```ts
2673
- * // Using URL
2674
- * const redis = createRedisClient({ url: 'redis://localhost:6379' })
2675
- *
2676
- * // Using host/port
2677
- * const redis = createRedisClient({ host: 'localhost', port: 6379 })
2678
- *
2679
- * // With key prefix
2680
- * const redis = createRedisClient({
2681
- * url: process.env.REDIS_URL,
2682
- * keyPrefix: 'myapp:',
2683
- * })
2684
- * ```
2685
- */
2686
- declare function createRedisClient(options?: RedisClientOptions): Redis;
2687
2476
 
2688
- export { AUTH_CONTEXT_KEY, AuthContext, AuthContext as AuthRuntimeContext, AuthServiceProvider, AuthenticationException, AuthorizationException, AuthorizationServiceProvider, AutoDiscovery, BaseFactory, type BaseResource, BaseSeeder, BroadcastManager, BroadcastServiceProvider, BufferedOutput, CSP_NONCE_KEY, CacheManager, CacheServiceProvider, Command, CommandInstance, Container, type CorsOptions, type CspDirectives, type CspOptions, type CursorPaginatedResponse, type CursorPaginationMeta, CursorPaginator, type CursorPaginatorOptions, type DiscoveryOptions, type DiscoveryResult, EncryptionServiceProvider, ErrorResponse, ErrorServiceProvider, EventManager, EventServiceProvider, BaseFactory as Factory, type FactoryClass, type Factory as FactoryInterface, FieldValidator, type FileLike, type FileValidationOptions, type ForceHttpsOptions, FormRequest, HealthServiceProvider, HttpException, I18nManager, I18nServiceProvider, type ImageValidationOptions, InertiaServiceProvider, type InferResourceData, Input, InputInterface, JsonResource, LogManager, LogServiceProvider, MailManager, MailServiceProvider, MemoryRateLimitStore, MethodNotAllowedException, NotFoundHttpException, NotificationManager, NotificationServiceProvider, OAuthServiceProvider, OptionDefinition, Output, OutputInterface, type PaginatedPageProps, type PaginatedResponse, type PaginatedResultLike, type PaginationLinks, type PaginationMeta, type PaginationPageLink, Paginator, type PaginatorOptions, ParsedSignature, QueueManager, QueueServiceProvider, type RateLimitEntry, type RateLimitInfo, type RateLimitOptions, type RateLimitStore, type RedirectSafetyOptions, type RequireAuthOptions, Resource, type ResourceClass, ResourceCollection, type ResourceData, type RuleDefinition, Scheduler, SchedulingServiceProvider, BaseSeeder as Seeder, type SeederClass, type Seeder as SeederInterface, SeederRunner, type SeederRunnerOptions, ServiceBindings, ServiceProvider, SlidingWindowRateLimitStore, StorageManager, StorageServiceProvider, type ValidationErrors, ValidationException, type ValidationResult, type ValidationRule, Validator, type ValidatorOptions, ViewEngine, after, afterOrEqual, alpha, alphaDash, alphaNum, array as arrayRule, attachAuthContext, before, beforeOrEqual, between, boolean as booleanRule, collect, confirmed, createCorsMiddleware, createCspMiddleware, createFacade, createFacades, createForceHttpsMiddleware, createRateLimitMiddleware, createRedirectSafetyMiddleware, createRedisClient, createSeederRunner, createValidator, cursorPaginate, custom, dateFormat, date as dateRule, debugErrorMiddleware, decodeCursor, defineFactory, different, email as emailRule, encodeCursor, endsWith, exists, file as fileRule, getCspNonce, getRateLimitInfo, image as imageRule, inValues, integer, ip, ipv4, ipv6, isSafeRedirectUrl, json as jsonRule, max, maxFileSize, mimes, min, minFileSize, notIn, nullable, numeric, object as objectRule, paginate, parseSignature, quickValidate, quickValidateOrThrow, regex, renderDebugPage, renderErrorPage, requestIdMiddleware, requestLoggingMiddleware, requireAuthenticated, requireGuest, required, requiredIf, requiredUnless, requiredWith, requiredWithout, resetCalledSeeders, resetRateLimit, same, size, startsWith, string as stringRule, unique, url as urlRule, uuid as uuidRule };
2477
+ export { AUTH_CONTEXT_KEY, AuthContext, AuthContext as AuthRuntimeContext, AuthServiceProvider, AuthenticationException, AuthorizationException, AuthorizationServiceProvider, AutoDiscovery, BaseFactory, type BaseResource, BaseSeeder, BroadcastManager, BroadcastServiceProvider, BufferedOutput, CSP_NONCE_KEY, CacheManager, CacheServiceProvider, Command, CommandInstance, Container, type CorsOptions, type CspDirectives, type CspOptions, type CursorPaginatedResponse, type CursorPaginationMeta, CursorPaginator, type CursorPaginatorOptions, DefaultHasher, type DiscoveryOptions, type DiscoveryResult, EncryptionServiceProvider, ErrorResponse, ErrorServiceProvider, EventManager, EventServiceProvider, BaseFactory as Factory, type FactoryClass, type Factory as FactoryInterface, FieldValidator, type FileLike, type FileValidationOptions, type ForceHttpsOptions, FormRequest, DefaultHasher as Hash, HealthServiceProvider, HttpException, I18nManager, I18nServiceProvider, type ImageValidationOptions, InertiaServiceProvider, type InferResourceData, Input, InputInterface, JsonResource, LogManager, LogServiceProvider, MailManager, MailServiceProvider, MethodNotAllowedException, NotFoundHttpException, NotificationManager, NotificationServiceProvider, OAuthServiceProvider, OptionDefinition, Output, OutputInterface, type PaginatedPageProps, type PaginatedResponse, type PaginatedResultLike, type PaginationLinks, type PaginationMeta, type PaginationPageLink, Paginator, type PaginatorOptions, ParsedSignature, QueueManager, QueueServiceProvider, type RedirectSafetyOptions, type RequireAuthOptions, Resource, type ResourceClass, ResourceCollection, type ResourceData, type RuleDefinition, Scheduler, SchedulingServiceProvider, BaseSeeder as Seeder, type SeederClass, type Seeder as SeederInterface, SeederRunner, type SeederRunnerOptions, ServiceBindings, ServiceProvider, StorageManager, StorageServiceProvider, type ValidationErrors, ValidationException, type ValidationResult, type ValidationRule, Validator, type ValidatorOptions, ViewEngine, after, afterOrEqual, alpha, alphaDash, alphaNum, array as arrayRule, attachAuthContext, before, beforeOrEqual, between, boolean as booleanRule, collect, confirmed, createCorsMiddleware, createCspMiddleware, createFacade, createFacades, createForceHttpsMiddleware, createRedirectSafetyMiddleware, createSeederRunner, createValidator, cursorPaginate, custom, dateFormat, date as dateRule, debugErrorMiddleware, decodeCursor, defineFactory, different, email as emailRule, encodeCursor, endsWith, exists, file as fileRule, getCspNonce, image as imageRule, inValues, integer, ip, ipv4, ipv6, isSafeRedirectUrl, json as jsonRule, max, maxFileSize, mimes, min, minFileSize, notIn, nullable, numeric, object as objectRule, paginate, parseSignature, quickValidate, quickValidateOrThrow, regex, renderDebugPage, renderErrorPage, requestIdMiddleware, requestLoggingMiddleware, requireAuthenticated, requireGuest, required, requiredIf, requiredUnless, requiredWith, requiredWithout, resetCalledSeeders, same, size, startsWith, string as stringRule, unique, url as urlRule, uuid as uuidRule };
package/dist/index.js CHANGED
@@ -1,3 +1,8 @@
1
+ import {
2
+ logDevServerBanner,
3
+ parseImportMap,
4
+ startViteDevServer
5
+ } from "./chunk-NRLZJILN.js";
1
6
  import {
2
7
  PendingSchedule,
3
8
  Schedule,
@@ -99,10 +104,8 @@ import {
99
104
  setQueueDriver
100
105
  } from "./chunk-R2TCP7D7.js";
101
106
  import {
102
- logDevServerBanner,
103
- parseImportMap,
104
- startViteDevServer
105
- } from "./chunk-X4E2I4Z5.js";
107
+ createRedisClient
108
+ } from "./chunk-UY3AZSYL.js";
106
109
  import {
107
110
  API_TOKEN_KEY,
108
111
  AuthManager,
@@ -155,7 +158,7 @@ import {
155
158
  verifyEmailToken,
156
159
  verifyOAuthState,
157
160
  verifyPasswordResetToken
158
- } from "./chunk-J2ZAO6TV.js";
161
+ } from "./chunk-2T6JN4VR.js";
159
162
  import {
160
163
  Gate,
161
164
  Policy,
@@ -5238,12 +5241,6 @@ var Command = class {
5238
5241
  }
5239
5242
  return this.kernel.handle([command, ...args]);
5240
5243
  }
5241
- /**
5242
- * Call another command silently.
5243
- */
5244
- async callSilent(command, args = []) {
5245
- return this.call(command, args);
5246
- }
5247
5244
  // ==================
5248
5245
  // Utility Methods
5249
5246
  // ==================
@@ -6242,15 +6239,19 @@ function renderEnvironmentSection() {
6242
6239
  </section>`;
6243
6240
  }
6244
6241
 
6245
- // src/redis/client.ts
6246
- import Redis from "ioredis";
6247
- function createRedisClient(options = {}) {
6248
- const { url: url2, ...redisOptions } = options;
6249
- if (url2) {
6250
- return new Redis(url2, redisOptions);
6242
+ // src/auth/password/DefaultHasher.ts
6243
+ var DefaultHasher = class {
6244
+ delegate;
6245
+ constructor() {
6246
+ this.delegate = typeof Bun !== "undefined" ? new ScryptHasher() : new NodeHasher();
6251
6247
  }
6252
- return new Redis(redisOptions);
6253
- }
6248
+ hash(plain) {
6249
+ return this.delegate.hash(plain);
6250
+ }
6251
+ verify(hashed, plain) {
6252
+ return this.delegate.verify(hashed, plain);
6253
+ }
6254
+ };
6254
6255
 
6255
6256
  // src/index.ts
6256
6257
  ensureErrorStackTracePolyfill();
@@ -6292,6 +6293,7 @@ export {
6292
6293
  DailyFileChannel,
6293
6294
  DatabaseChannel,
6294
6295
  DatabaseCheck,
6296
+ DefaultHasher,
6295
6297
  Encrypter,
6296
6298
  EncryptionServiceProvider,
6297
6299
  ErrorServiceProvider,
@@ -6306,7 +6308,7 @@ export {
6306
6308
  FileChannel,
6307
6309
  FormRequest,
6308
6310
  Gate,
6309
- ScryptHasher as Hash,
6311
+ DefaultHasher as Hash,
6310
6312
  HealthCheck,
6311
6313
  HealthManager,
6312
6314
  HealthServiceProvider,
@@ -6341,6 +6343,7 @@ export {
6341
6343
  MemoryLoader,
6342
6344
  MemoryOAuthStateStore,
6343
6345
  MemoryPasswordResetStore,
6346
+ MemoryDriver as MemoryQueueDriver,
6344
6347
  MemoryRateLimitStore,
6345
6348
  MemorySessionStore,
6346
6349
  MemoryDriver3 as MemoryStorageDriver,
@@ -6368,6 +6371,7 @@ export {
6368
6371
  RedisStore as RedisCacheStore,
6369
6372
  RedisCheck,
6370
6373
  RedisDriver,
6374
+ RedisDriver as RedisQueueDriver,
6371
6375
  RequestFinished,
6372
6376
  RequestReceived,
6373
6377
  ResendTransport,
@@ -6392,6 +6396,7 @@ export {
6392
6396
  StorageManager,
6393
6397
  StorageServiceProvider,
6394
6398
  SyncDriver,
6399
+ SyncDriver as SyncQueueDriver,
6395
6400
  TaggedCache,
6396
6401
  Translator,
6397
6402
  UserAuthenticated,
@@ -1,10 +1,11 @@
1
1
  import * as hono_aws_lambda from 'hono/aws-lambda';
2
2
  export { APIGatewayProxyResult, LambdaEvent } from 'hono/aws-lambda';
3
- import { A as Application } from '../Application-Hlryz3ln.js';
3
+ import { A as Application } from '../Application-BnsyCKXY.js';
4
4
  import { S as Scheduler } from '../Scheduler-BstvSca7.js';
5
- import { C as ConsoleKernel } from '../ConsoleKernel-CVvaK-I6.js';
5
+ import { C as ConsoleKernel } from '../ConsoleKernel-BDtBETjm.js';
6
6
  import 'hono';
7
- import '../api-token-ChekhpB7.js';
7
+ import '../api-token-BSSCLlFW.js';
8
+ import '../AuthManager-SfhCNkAU.js';
8
9
  import '@guren/orm';
9
10
  import 'vite';
10
11
  import '../EventManager-CmIoLt7r.js';
@@ -1,7 +1,8 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- import { S as ServiceProvider } from '../Application-Hlryz3ln.js';
2
+ import { S as ServiceProvider } from '../Application-BnsyCKXY.js';
3
3
  import 'hono';
4
- import '../api-token-ChekhpB7.js';
4
+ import '../api-token-BSSCLlFW.js';
5
+ import '../AuthManager-SfhCNkAU.js';
5
6
  import '@guren/orm';
6
7
  import 'vite';
7
8
  import '../EventManager-CmIoLt7r.js';
@@ -1,8 +1,9 @@
1
- import { _ as NotificationChannel, X as Notifiable, Y as Notification, q as DatabaseNotification, p as DatabaseChannelOptions, as as SlackMessage, ai as SentNotification } from '../Application-Hlryz3ln.js';
2
- export { Z as NotificationAttachment, $ as NotificationChannelFactory, a0 as NotificationClass, a1 as NotificationMailMessage, N as NotificationManager, a2 as NotificationManagerOptions, aq as SlackAttachment, ar as SlackBlock, aG as createNotificationManager, aQ as getNotificationManager, a$ as setNotificationManager } from '../Application-Hlryz3ln.js';
1
+ import { a0 as NotificationChannel, Z as Notifiable, _ as Notification, t as DatabaseNotification, r as DatabaseChannelOptions, au as SlackMessage, ak as SentNotification } from '../Application-BnsyCKXY.js';
2
+ export { $ as NotificationAttachment, a1 as NotificationChannelFactory, a2 as NotificationClass, a3 as NotificationMailMessage, N as NotificationManager, a4 as NotificationManagerOptions, as as SlackAttachment, at as SlackBlock, aI as createNotificationManager, aS as getNotificationManager, b1 as setNotificationManager } from '../Application-BnsyCKXY.js';
3
3
  import { M as MailManager } from '../MailManager-DpMvYiP9.js';
4
4
  import 'hono';
5
- import '../api-token-ChekhpB7.js';
5
+ import '../api-token-BSSCLlFW.js';
6
+ import '../AuthManager-SfhCNkAU.js';
6
7
  import '@guren/orm';
7
8
  import 'vite';
8
9
  import '../EventManager-CmIoLt7r.js';
@@ -1,8 +1,9 @@
1
- import { a5 as QueueDriver, a7 as QueuedJob, F as FailedJob, aw as WorkerOptions } from '../Application-Hlryz3ln.js';
2
- export { R as Job, T as JobClass, U as JobFailureHandler, V as JobHandler, W as JobOptions, a4 as QueueConfig, a6 as QueueDriverFactory, Q as QueueManager, aA as clearJobRegistry, aH as createQueueManager, aP as getJob, aR as getQueueDriver, aS as getRegisteredJobs, aW as registerJob, b0 as setQueueDriver } from '../Application-Hlryz3ln.js';
1
+ import { a7 as QueueDriver, a9 as QueuedJob, F as FailedJob, ay as WorkerOptions } from '../Application-BnsyCKXY.js';
2
+ export { U as Job, V as JobClass, W as JobFailureHandler, X as JobHandler, Y as JobOptions, a6 as QueueConfig, a8 as QueueDriverFactory, Q as QueueManager, aC as clearJobRegistry, aJ as createQueueManager, aR as getJob, aT as getQueueDriver, aU as getRegisteredJobs, aY as registerJob, b2 as setQueueDriver } from '../Application-BnsyCKXY.js';
3
3
  import { Redis } from 'ioredis';
4
4
  import 'hono';
5
- import '../api-token-ChekhpB7.js';
5
+ import '../api-token-BSSCLlFW.js';
6
+ import '../AuthManager-SfhCNkAU.js';
6
7
  import '@guren/orm';
7
8
  import 'vite';
8
9
  import '../EventManager-CmIoLt7r.js';