@guren/server 2.1.1 → 2.3.0
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/{DocsViewerServiceProvider-D7RGJPGM.js → DocsViewerServiceProvider-RUYDFBMW.js} +2 -2
- package/dist/McpServiceProvider-FRJ5O7LT.js +8 -0
- package/dist/auth/AuthManager.d.ts +30 -0
- package/dist/auth/AuthenticatableModel.d.ts +25 -0
- package/dist/auth/RequestAuthContext.d.ts +24 -0
- package/dist/auth/SessionGuard.d.ts +31 -0
- package/dist/auth/api-token.d.ts +299 -0
- package/dist/auth/email-verification.d.ts +203 -0
- package/dist/auth/index.d.ts +18 -110
- package/dist/auth/index.js +4 -1
- package/dist/auth/oauth/index.d.ts +239 -0
- package/dist/auth/password/DefaultHasher.d.ts +13 -0
- package/dist/auth/password/NodeHasher.d.ts +22 -0
- package/dist/auth/password/PasswordHasher.d.ts +5 -0
- package/dist/auth/password/ScryptHasher.d.ts +26 -0
- package/dist/auth/password-reset.d.ts +91 -0
- package/dist/auth/providers/ModelUserProvider.d.ts +36 -0
- package/dist/auth/providers/UserProvider.d.ts +9 -0
- package/dist/auth/types.d.ts +102 -0
- package/dist/auth/utils.d.ts +39 -0
- package/dist/{Gate-CynjZCtS.d.ts → authorization/Gate.d.ts} +30 -111
- package/dist/authorization/Policy.d.ts +77 -0
- package/dist/authorization/index.d.ts +5 -129
- package/dist/authorization/index.js +3 -1
- package/dist/authorization/middleware.d.ts +49 -0
- package/dist/authorization/types.d.ts +108 -0
- package/dist/broadcasting/BroadcastManager.d.ts +205 -0
- package/dist/broadcasting/channels/Channel.d.ts +28 -0
- package/dist/broadcasting/channels/PresenceChannel.d.ts +72 -0
- package/dist/broadcasting/channels/PrivateChannel.d.ts +32 -0
- package/dist/broadcasting/channels/index.d.ts +3 -0
- package/dist/broadcasting/drivers/MemoryDriver.d.ts +93 -0
- package/dist/broadcasting/drivers/RedisDriver.d.ts +112 -0
- package/dist/broadcasting/drivers/index.d.ts +2 -0
- package/dist/broadcasting/index.d.ts +6 -233
- package/dist/broadcasting/index.js +1 -1
- package/dist/broadcasting/typed.d.ts +23 -0
- package/dist/broadcasting/types.d.ts +155 -0
- package/dist/cache/CacheManager.d.ts +87 -0
- package/dist/cache/TaggedCache.d.ts +62 -0
- package/dist/cache/index.d.ts +6 -233
- package/dist/cache/index.js +1 -1
- package/dist/cache/stores/FileStore.d.ts +64 -0
- package/dist/cache/stores/MemoryStore.d.ts +52 -0
- package/dist/cache/stores/RedisStore.d.ts +53 -0
- package/dist/{CacheManager-BmDzUKrF.d.ts → cache/types.d.ts} +26 -99
- package/dist/chunk-3KV5X2FL.js +31 -0
- package/dist/{chunk-TVY72CLV.js → chunk-4VE3LYOM.js} +3 -2
- package/dist/{chunk-DSDX3ASM.js → chunk-5WL2FTC4.js} +67 -85
- package/dist/{chunk-5SZTEZ22.js → chunk-6IGN233M.js} +15 -8
- package/dist/{chunk-FZD2AKJI.js → chunk-7OB2YXRE.js} +56 -28
- package/dist/{chunk-WIXGT4TN.js → chunk-A5JJ7XTH.js} +8 -2
- package/dist/{chunk-CWI4AJ47.js → chunk-HPET6XY5.js} +13 -9
- package/dist/{chunk-A3ISJVEV.js → chunk-HR2KZ3WL.js} +23 -5
- package/dist/{chunk-BZMZEFRG.js → chunk-LHR6OHI7.js} +11 -0
- package/dist/{chunk-JBG4AR24.js → chunk-Q2P6YLRR.js} +8 -2
- package/dist/{chunk-J6ETA476.js → chunk-TVV5YNEC.js} +101 -9
- package/dist/console/Command.d.ts +179 -0
- package/dist/{ConsoleKernel-CJg975mp.d.ts → console/ConsoleKernel.d.ts} +4 -6
- package/dist/console/Input.d.ts +140 -0
- package/dist/console/Output.d.ts +161 -0
- package/dist/console/index.d.ts +5 -0
- package/dist/console/types.d.ts +106 -0
- package/dist/container/Container.d.ts +148 -0
- package/dist/container/ServiceProvider.d.ts +103 -0
- package/dist/container/bindings.d.ts +55 -0
- package/dist/container/defineModule.d.ts +88 -0
- package/dist/container/definePlugin.d.ts +62 -0
- package/dist/container/index.d.ts +8 -0
- package/dist/container/types.d.ts +73 -0
- package/dist/database/Factory.d.ts +82 -0
- package/dist/database/Seeder.d.ts +35 -0
- package/dist/database/SeederRunner.d.ts +41 -0
- package/dist/database/index.d.ts +4 -0
- package/dist/database/types.d.ts +49 -0
- package/dist/discovery/AutoDiscovery.d.ts +113 -0
- package/dist/discovery/index.d.ts +2 -0
- package/dist/docs-viewer/DocsViewerServiceProvider.d.ts +12 -0
- package/dist/docs-viewer/endpoint.d.ts +29 -0
- package/dist/encryption/Encrypter.d.ts +96 -0
- package/dist/encryption/Hash.d.ts +69 -0
- package/dist/encryption/MessageSigner.d.ts +21 -0
- package/dist/encryption/Random.d.ts +119 -0
- package/dist/encryption/app-key.d.ts +12 -0
- package/dist/encryption/index.d.ts +10 -222
- package/dist/encryption/signed-url.d.ts +9 -0
- package/dist/encryption/types.d.ts +103 -0
- package/dist/errors/ExceptionHandler.d.ts +118 -0
- package/dist/errors/HttpException.d.ts +106 -0
- package/dist/errors/debug-page.d.ts +22 -0
- package/dist/errors/error-page.d.ts +1 -0
- package/dist/errors/exceptions/AuthenticationException.d.ts +32 -0
- package/dist/errors/exceptions/AuthorizationException.d.ts +32 -0
- package/dist/errors/exceptions/MethodNotAllowedException.d.ts +31 -0
- package/dist/errors/exceptions/NotFoundHttpException.d.ts +36 -0
- package/dist/errors/exceptions/ValidationException.d.ts +60 -0
- package/dist/errors/exceptions/index.d.ts +5 -0
- package/dist/errors/index.d.ts +5 -0
- package/dist/errors/types.d.ts +43 -0
- package/dist/events/Event.d.ts +33 -0
- package/dist/{EventManager-CmIoLt7r.d.ts → events/EventManager.d.ts} +4 -86
- package/dist/events/Listener.d.ts +79 -0
- package/dist/events/builtin.d.ts +73 -0
- package/dist/events/index.d.ts +6 -155
- package/dist/events/types.d.ts +48 -0
- package/dist/facades/index.d.ts +31 -0
- package/dist/health/HealthCheck.d.ts +34 -0
- package/dist/health/HealthManager.d.ts +53 -0
- package/dist/health/checks/CacheCheck.d.ts +35 -0
- package/dist/health/checks/CustomCheck.d.ts +23 -0
- package/dist/health/checks/DatabaseCheck.d.ts +33 -0
- package/dist/health/checks/MemoryCheck.d.ts +32 -0
- package/dist/health/checks/RedisCheck.d.ts +27 -0
- package/dist/health/checks/StorageCheck.d.ts +35 -0
- package/dist/health/checks/index.d.ts +12 -0
- package/dist/health/index.d.ts +5 -185
- package/dist/health/types.d.ts +52 -0
- package/dist/hot-reload/hot-disposables.d.ts +96 -0
- package/dist/hot-reload/testing.d.ts +14 -0
- package/dist/http/Application.d.ts +199 -0
- package/dist/http/FormRequest.d.ts +73 -0
- package/dist/http/dev-assets.d.ts +62 -0
- package/dist/http/dev-banner.d.ts +7 -0
- package/dist/http/inertia-assets.d.ts +31 -0
- package/dist/http/middleware/auth.d.ts +13 -0
- package/dist/http/middleware/capabilities.d.ts +22 -0
- package/dist/http/middleware/cors.d.ts +40 -0
- package/dist/http/middleware/csp.d.ts +59 -0
- package/dist/http/middleware/csrf.d.ts +121 -0
- package/dist/http/middleware/detect-locale.d.ts +65 -0
- package/dist/http/middleware/force-https.d.ts +34 -0
- package/dist/http/middleware/host-authorization.d.ts +24 -0
- package/dist/http/middleware/index.d.ts +19 -0
- package/dist/http/middleware/loopback-guard.d.ts +51 -0
- package/dist/{rate-limit-D9J2b4S1.d.ts → http/middleware/rate-limit.d.ts} +22 -50
- package/dist/http/middleware/redirect-safety.d.ts +29 -0
- package/dist/http/middleware/request-id.d.ts +19 -0
- package/dist/http/middleware/request-logging.d.ts +16 -0
- package/dist/http/middleware/response-headers.d.ts +18 -0
- package/dist/http/middleware/security-headers.d.ts +49 -0
- package/dist/http/middleware/session.d.ts +93 -0
- package/dist/http/middleware/validation.d.ts +94 -0
- package/dist/http/public-assets.d.ts +15 -0
- package/dist/http/request.d.ts +24 -0
- package/dist/http/resources/CursorPaginator.d.ts +106 -0
- package/dist/http/resources/Paginator.d.ts +130 -0
- package/dist/http/resources/Resource.d.ts +67 -0
- package/dist/http/resources/ResourceCollection.d.ts +60 -0
- package/dist/http/resources/index.d.ts +6 -0
- package/dist/http/resources/types.d.ts +91 -0
- package/dist/http/validation/Validator.d.ts +128 -0
- package/dist/http/validation/index.d.ts +3 -0
- package/dist/http/validation/rules.d.ts +196 -0
- package/dist/http/validation/types.d.ts +96 -0
- package/dist/http/vite-dev-server.d.ts +27 -0
- package/dist/i18n/I18nManager.d.ts +114 -0
- package/dist/i18n/Translator.d.ts +80 -0
- package/dist/i18n/index.d.ts +6 -101
- package/dist/i18n/index.js +5 -3
- package/dist/i18n/loaders/JsonLoader.d.ts +47 -0
- package/dist/i18n/loaders/MemoryLoader.d.ts +37 -0
- package/dist/i18n/pluralization.d.ts +19 -0
- package/dist/i18n/types.d.ts +106 -0
- package/dist/index.d.ts +69 -2605
- package/dist/index.js +405 -180
- package/dist/lambda/index.d.ts +17 -37
- package/dist/logging/LogManager.d.ts +83 -0
- package/dist/logging/Logger.d.ts +76 -0
- package/dist/logging/channels/ConsoleChannel.d.ts +11 -0
- package/dist/logging/channels/DailyFileChannel.d.ts +20 -0
- package/dist/logging/channels/FileChannel.d.ts +15 -0
- package/dist/logging/index.d.ts +8 -50
- package/dist/logging/types.d.ts +96 -0
- package/dist/mail/Mail.d.ts +138 -0
- package/dist/mail/MailManager.d.ts +79 -0
- package/dist/mail/address.d.ts +8 -0
- package/dist/mail/index.d.ts +7 -316
- package/dist/mail/transports/LogTransport.d.ts +19 -0
- package/dist/mail/transports/MemoryTransport.d.ts +84 -0
- package/dist/mail/transports/ResendTransport.d.ts +32 -0
- package/dist/mail/transports/SmtpTransport.d.ts +40 -0
- package/dist/{MailManager-DpMvYiP9.d.ts → mail/types.d.ts} +11 -92
- package/dist/mcp/McpServiceProvider.d.ts +17 -0
- package/dist/mcp/create-mcp-server.d.ts +152 -0
- package/dist/mcp/endpoint.d.ts +47 -0
- package/dist/mcp/index.d.ts +3 -185
- package/dist/mcp/index.js +3 -3
- package/dist/mvc/Controller.d.ts +326 -0
- package/dist/mvc/Router.d.ts +239 -0
- package/dist/mvc/ViewEngine.d.ts +11 -0
- package/dist/mvc/inertia/InertiaEngine.d.ts +114 -0
- package/dist/mvc/inertia/shared.d.ts +90 -0
- package/dist/mvc/mount-route.d.ts +10 -0
- package/dist/notifications/Notification.d.ts +99 -0
- package/dist/notifications/NotificationManager.d.ts +150 -0
- package/dist/notifications/channels/DatabaseChannel.d.ts +55 -0
- package/dist/notifications/channels/MailChannel.d.ts +45 -0
- package/dist/notifications/channels/MemoryChannel.d.ts +85 -0
- package/dist/notifications/channels/SlackChannel.d.ts +73 -0
- package/dist/notifications/channels/index.d.ts +4 -0
- package/dist/notifications/index.d.ts +6 -322
- package/dist/notifications/notifiable-type.d.ts +10 -0
- package/dist/notifications/registry.d.ts +39 -0
- package/dist/notifications/types.d.ts +162 -0
- package/dist/providers/AuthServiceProvider.d.ts +7 -0
- package/dist/providers/AuthorizationServiceProvider.d.ts +9 -0
- package/dist/providers/BroadcastServiceProvider.d.ts +7 -0
- package/dist/providers/CacheServiceProvider.d.ts +7 -0
- package/dist/providers/EncryptionServiceProvider.d.ts +7 -0
- package/dist/providers/ErrorServiceProvider.d.ts +9 -0
- package/dist/providers/EventServiceProvider.d.ts +7 -0
- package/dist/providers/HealthServiceProvider.d.ts +7 -0
- package/dist/providers/I18nServiceProvider.d.ts +27 -0
- package/dist/providers/InertiaServiceProvider.d.ts +20 -0
- package/dist/providers/LogServiceProvider.d.ts +7 -0
- package/dist/providers/MailServiceProvider.d.ts +7 -0
- package/dist/providers/NotificationServiceProvider.d.ts +8 -0
- package/dist/providers/OAuthServiceProvider.d.ts +7 -0
- package/dist/providers/QueueServiceProvider.d.ts +7 -0
- package/dist/providers/SchedulingServiceProvider.d.ts +7 -0
- package/dist/providers/StorageServiceProvider.d.ts +7 -0
- package/dist/providers/index.d.ts +17 -0
- package/dist/queue/FailedJobReporter.d.ts +40 -0
- package/dist/queue/Job.d.ts +140 -0
- package/dist/queue/QueueManager.d.ts +79 -0
- package/dist/queue/Worker.d.ts +99 -0
- package/dist/queue/drivers/MemoryDriver.d.ts +60 -0
- package/dist/queue/drivers/RedisDriver.d.ts +96 -0
- package/dist/queue/drivers/SqsDriver.d.ts +108 -0
- package/dist/queue/drivers/SyncDriver.d.ts +28 -0
- package/dist/queue/index.d.ts +9 -453
- package/dist/queue/types.d.ts +171 -0
- package/dist/redis/RedisApiTokenStore.d.ts +78 -0
- package/dist/redis/RedisEmailVerificationStore.d.ts +54 -0
- package/dist/redis/RedisOAuthStateStore.d.ts +26 -0
- package/dist/redis/RedisPasswordResetStore.d.ts +57 -0
- package/dist/redis/RedisRateLimitStore.d.ts +77 -0
- package/dist/redis/RedisSessionStore.d.ts +61 -0
- package/dist/redis/client.d.ts +41 -0
- package/dist/redis/index.d.ts +14 -356
- package/dist/redis/index.js +45 -9
- package/dist/redis/redis-values.d.ts +17 -0
- package/dist/redis/scan-keys.d.ts +6 -0
- package/dist/runtime/index.d.ts +8 -95
- package/dist/runtime/index.js +101 -68
- package/dist/scheduling/CronParser.d.ts +37 -0
- package/dist/scheduling/Schedule.d.ts +229 -0
- package/dist/scheduling/ScheduledTask.d.ts +47 -0
- package/dist/scheduling/Scheduler.d.ts +99 -0
- package/dist/scheduling/index.d.ts +5 -41
- package/dist/scheduling/types.d.ts +97 -0
- package/dist/storage/StorageManager.d.ts +65 -0
- package/dist/storage/drivers/LocalDriver.d.ts +55 -0
- package/dist/storage/drivers/MemoryDriver.d.ts +66 -0
- package/dist/storage/drivers/S3Driver.d.ts +72 -0
- package/dist/storage/index.d.ts +5 -197
- package/dist/{StorageManager-oZTHqaza.d.ts → storage/types.d.ts} +10 -77
- package/dist/support/contained-path.d.ts +26 -0
- package/dist/support/error-polyfill.d.ts +9 -0
- package/dist/support/expiry.d.ts +47 -0
- package/dist/support/expiry.js +12 -0
- package/dist/support/import-map.d.ts +13 -0
- package/dist/support/redirect-target.d.ts +11 -0
- package/dist/support/stack-frames.d.ts +56 -0
- package/dist/support/trim-slashes.d.ts +11 -0
- package/dist/vite/index.d.ts +2 -35
- package/dist/vite/index.js +0 -3
- package/dist/vite/plugin.d.ts +34 -0
- package/package.json +7 -3
- package/dist/AuthManager-DBP4KYsx.d.ts +0 -79
- package/dist/BroadcastManager-D8KoJxiV.d.ts +0 -492
- package/dist/HealthManager-DUyMIzsZ.d.ts +0 -141
- package/dist/I18nManager-BiSoczfV.d.ts +0 -275
- package/dist/LogManager-7mxnkaPM.d.ts +0 -256
- package/dist/McpServiceProvider-7BB5FPF3.js +0 -8
- package/dist/Scheduler-pZiT8i57.d.ts +0 -471
- package/dist/api-token-D24VPr_E.d.ts +0 -663
- package/dist/app-key-CsBfRC_Q.d.ts +0 -214
- package/dist/email-verification-Dx426KLn.d.ts +0 -336
- package/dist/index-9_Jzj5jo.d.ts +0 -7
- package/dist/validation-yAL53e1S.d.ts +0 -2610
package/dist/redis/index.d.ts
CHANGED
|
@@ -1,356 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* @default 'session:'
|
|
16
|
-
*/
|
|
17
|
-
prefix?: string;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Redis-backed session store.
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```ts
|
|
24
|
-
* import { createRedisClient } from '@guren/server/redis'
|
|
25
|
-
*
|
|
26
|
-
* const redis = createRedisClient({ url: process.env.REDIS_URL })
|
|
27
|
-
* const store = new RedisSessionStore(redis)
|
|
28
|
-
*
|
|
29
|
-
* app.use(createSessionMiddleware({ store }))
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
declare class RedisSessionStore implements SessionStore {
|
|
33
|
-
private readonly redis;
|
|
34
|
-
private readonly prefix;
|
|
35
|
-
constructor(redis: Redis, options?: RedisSessionStoreOptions);
|
|
36
|
-
/**
|
|
37
|
-
* Read session data from Redis.
|
|
38
|
-
*/
|
|
39
|
-
read(id: string): Promise<SessionData | undefined>;
|
|
40
|
-
/**
|
|
41
|
-
* Write session data to Redis with TTL.
|
|
42
|
-
*/
|
|
43
|
-
write(id: string, data: SessionData, ttlSeconds: number): Promise<void>;
|
|
44
|
-
/**
|
|
45
|
-
* Delete a session from Redis.
|
|
46
|
-
*/
|
|
47
|
-
destroy(id: string): Promise<void>;
|
|
48
|
-
/**
|
|
49
|
-
* Refresh an existing session's TTL without rewriting its data.
|
|
50
|
-
* EXPIRE on a missing key is a no-op, never a resurrection.
|
|
51
|
-
*/
|
|
52
|
-
touch(id: string, ttlSeconds: number): Promise<void>;
|
|
53
|
-
/**
|
|
54
|
-
* Get all session keys (for debugging/admin purposes).
|
|
55
|
-
* Note: This uses SCAN to avoid blocking Redis.
|
|
56
|
-
*/
|
|
57
|
-
keys(): Promise<string[]>;
|
|
58
|
-
/**
|
|
59
|
-
* Get the count of sessions (for monitoring).
|
|
60
|
-
*/
|
|
61
|
-
size(): Promise<number>;
|
|
62
|
-
/**
|
|
63
|
-
* Clear all sessions.
|
|
64
|
-
* Use with caution in production!
|
|
65
|
-
*/
|
|
66
|
-
clear(): Promise<void>;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Options for RedisRateLimitStore.
|
|
71
|
-
*/
|
|
72
|
-
interface RedisRateLimitStoreOptions {
|
|
73
|
-
/**
|
|
74
|
-
* Key prefix for rate limit keys.
|
|
75
|
-
* @default 'ratelimit:'
|
|
76
|
-
*/
|
|
77
|
-
prefix?: string;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Redis-backed rate limit store using fixed window algorithm.
|
|
81
|
-
* Uses Lua script for atomic increment operations.
|
|
82
|
-
*
|
|
83
|
-
* @example
|
|
84
|
-
* ```ts
|
|
85
|
-
* import { createRedisClient } from '@guren/server/redis'
|
|
86
|
-
*
|
|
87
|
-
* const redis = createRedisClient({ url: process.env.REDIS_URL })
|
|
88
|
-
* const store = new RedisRateLimitStore(redis)
|
|
89
|
-
*
|
|
90
|
-
* app.use(createRateLimitMiddleware({ store, limit: 100 }))
|
|
91
|
-
* ```
|
|
92
|
-
*/
|
|
93
|
-
declare class RedisRateLimitStore implements RateLimitStore {
|
|
94
|
-
private readonly redis;
|
|
95
|
-
private readonly prefix;
|
|
96
|
-
constructor(redis: Redis, options?: RedisRateLimitStoreOptions);
|
|
97
|
-
/**
|
|
98
|
-
* Get current rate limit entry for a key.
|
|
99
|
-
*/
|
|
100
|
-
get(key: string): Promise<RateLimitEntry | null>;
|
|
101
|
-
/**
|
|
102
|
-
* Increment the rate limit counter atomically.
|
|
103
|
-
*/
|
|
104
|
-
increment(key: string, windowMs: number): Promise<RateLimitEntry>;
|
|
105
|
-
/**
|
|
106
|
-
* Reset the rate limit for a key.
|
|
107
|
-
*/
|
|
108
|
-
reset(key: string): Promise<void>;
|
|
109
|
-
/**
|
|
110
|
-
* Get all rate limit keys (for debugging/admin purposes).
|
|
111
|
-
*/
|
|
112
|
-
keys(): Promise<string[]>;
|
|
113
|
-
/**
|
|
114
|
-
* Clear all rate limits.
|
|
115
|
-
*/
|
|
116
|
-
clear(): Promise<void>;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Redis-backed rate limit store using sliding window algorithm.
|
|
120
|
-
* More accurate than fixed window but slightly more expensive.
|
|
121
|
-
*/
|
|
122
|
-
declare class RedisSlidingWindowRateLimitStore implements RateLimitStore {
|
|
123
|
-
private readonly redis;
|
|
124
|
-
private readonly prefix;
|
|
125
|
-
constructor(redis: Redis, options?: RedisRateLimitStoreOptions);
|
|
126
|
-
/**
|
|
127
|
-
* Get current rate limit entry for a key.
|
|
128
|
-
*/
|
|
129
|
-
get(key: string): Promise<RateLimitEntry | null>;
|
|
130
|
-
/**
|
|
131
|
-
* Increment the rate limit counter using sorted set.
|
|
132
|
-
* Each request is stored with its timestamp as score.
|
|
133
|
-
*/
|
|
134
|
-
increment(key: string, windowMs: number): Promise<RateLimitEntry>;
|
|
135
|
-
/**
|
|
136
|
-
* Reset the rate limit for a key.
|
|
137
|
-
*/
|
|
138
|
-
reset(key: string): Promise<void>;
|
|
139
|
-
/**
|
|
140
|
-
* Clear all rate limits.
|
|
141
|
-
*/
|
|
142
|
-
clear(): Promise<void>;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Options for RedisApiTokenStore.
|
|
147
|
-
*/
|
|
148
|
-
interface RedisApiTokenStoreOptions {
|
|
149
|
-
/**
|
|
150
|
-
* Key prefix for token keys.
|
|
151
|
-
* @default 'apitoken:'
|
|
152
|
-
*/
|
|
153
|
-
prefix?: string;
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Redis-backed API token store.
|
|
157
|
-
*
|
|
158
|
-
* Uses the following key structure:
|
|
159
|
-
* - `apitoken:{id}` - Token data (hash)
|
|
160
|
-
* - `apitoken:hash:{hashedToken}` - Maps hash to token ID
|
|
161
|
-
* - `apitoken:user:{userId}` - Set of token IDs for a user
|
|
162
|
-
*
|
|
163
|
-
* @example
|
|
164
|
-
* ```ts
|
|
165
|
-
* import { createRedisClient } from '@guren/server/redis'
|
|
166
|
-
*
|
|
167
|
-
* const redis = createRedisClient({ url: process.env.REDIS_URL })
|
|
168
|
-
* const store = new RedisApiTokenStore(redis)
|
|
169
|
-
*
|
|
170
|
-
* const { plainTextToken } = await createApiToken(store, {
|
|
171
|
-
* name: 'API Token',
|
|
172
|
-
* userId: user.id,
|
|
173
|
-
* })
|
|
174
|
-
* ```
|
|
175
|
-
*/
|
|
176
|
-
declare class RedisApiTokenStore implements ApiTokenStore {
|
|
177
|
-
private readonly redis;
|
|
178
|
-
private readonly prefix;
|
|
179
|
-
constructor(redis: Redis, options?: RedisApiTokenStoreOptions);
|
|
180
|
-
/**
|
|
181
|
-
* Store a new API token.
|
|
182
|
-
*/
|
|
183
|
-
store(token: ApiToken): Promise<void>;
|
|
184
|
-
/**
|
|
185
|
-
* Find a token by its hashed value.
|
|
186
|
-
*/
|
|
187
|
-
findByHashedToken(hashedToken: string): Promise<ApiToken | null>;
|
|
188
|
-
/**
|
|
189
|
-
* Find all tokens for a user.
|
|
190
|
-
*/
|
|
191
|
-
findByUserId(userId: string | number): Promise<ApiToken[]>;
|
|
192
|
-
/**
|
|
193
|
-
* Delete a token by its ID.
|
|
194
|
-
*/
|
|
195
|
-
delete(id: string): Promise<void>;
|
|
196
|
-
/**
|
|
197
|
-
* Delete all tokens for a user.
|
|
198
|
-
*/
|
|
199
|
-
deleteForUser(userId: string | number): Promise<void>;
|
|
200
|
-
/**
|
|
201
|
-
* Update the last used timestamp.
|
|
202
|
-
*/
|
|
203
|
-
updateLastUsed(id: string, timestamp: Date): Promise<void>;
|
|
204
|
-
/**
|
|
205
|
-
* Find a token by its ID.
|
|
206
|
-
*/
|
|
207
|
-
private findById;
|
|
208
|
-
/**
|
|
209
|
-
* Serialize a token for Redis storage.
|
|
210
|
-
*/
|
|
211
|
-
private serializeToken;
|
|
212
|
-
/**
|
|
213
|
-
* Deserialize a token from Redis storage.
|
|
214
|
-
*/
|
|
215
|
-
private deserializeToken;
|
|
216
|
-
/**
|
|
217
|
-
* Clear all tokens (for testing).
|
|
218
|
-
*/
|
|
219
|
-
clear(): Promise<void>;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* Options for RedisPasswordResetStore.
|
|
224
|
-
*/
|
|
225
|
-
interface RedisPasswordResetStoreOptions {
|
|
226
|
-
/**
|
|
227
|
-
* Key prefix for password reset keys.
|
|
228
|
-
* @default 'pwreset:'
|
|
229
|
-
*/
|
|
230
|
-
prefix?: string;
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Redis-backed password reset token store.
|
|
234
|
-
*
|
|
235
|
-
* Uses the following key structure:
|
|
236
|
-
* - `pwreset:{tokenId}` - Token data (JSON with email and expiresAt)
|
|
237
|
-
* - `pwreset:email:{email}` - Set of token IDs for an email
|
|
238
|
-
*
|
|
239
|
-
* @example
|
|
240
|
-
* ```ts
|
|
241
|
-
* import { createRedisClient } from '@guren/server/redis'
|
|
242
|
-
*
|
|
243
|
-
* const redis = createRedisClient({ url: process.env.REDIS_URL })
|
|
244
|
-
* const store = new RedisPasswordResetStore(redis)
|
|
245
|
-
*
|
|
246
|
-
* const { token } = await createPasswordResetToken(email, store, { expiresIn: 3600000 })
|
|
247
|
-
* ```
|
|
248
|
-
*/
|
|
249
|
-
declare class RedisPasswordResetStore implements PasswordResetTokenStore {
|
|
250
|
-
private readonly redis;
|
|
251
|
-
private readonly prefix;
|
|
252
|
-
constructor(redis: Redis, options?: RedisPasswordResetStoreOptions);
|
|
253
|
-
/**
|
|
254
|
-
* Store a password reset token.
|
|
255
|
-
*/
|
|
256
|
-
store(tokenId: string, email: string, expiresAt: Date): Promise<void>;
|
|
257
|
-
/**
|
|
258
|
-
* Find a token by its hash.
|
|
259
|
-
*/
|
|
260
|
-
find(tokenId: string): Promise<{
|
|
261
|
-
email: string;
|
|
262
|
-
expiresAt: Date;
|
|
263
|
-
} | null>;
|
|
264
|
-
/**
|
|
265
|
-
* Delete a token by its hash.
|
|
266
|
-
*/
|
|
267
|
-
delete(tokenId: string): Promise<void>;
|
|
268
|
-
/**
|
|
269
|
-
* Delete all tokens for an email.
|
|
270
|
-
*/
|
|
271
|
-
deleteForEmail(email: string): Promise<void>;
|
|
272
|
-
/**
|
|
273
|
-
* Clear all tokens (for testing).
|
|
274
|
-
*/
|
|
275
|
-
clear(): Promise<void>;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* Options for RedisEmailVerificationStore.
|
|
280
|
-
*/
|
|
281
|
-
interface RedisEmailVerificationStoreOptions {
|
|
282
|
-
/**
|
|
283
|
-
* Key prefix for email verification keys.
|
|
284
|
-
* @default 'emailverify:'
|
|
285
|
-
*/
|
|
286
|
-
prefix?: string;
|
|
287
|
-
}
|
|
288
|
-
/**
|
|
289
|
-
* Redis-backed email verification token store.
|
|
290
|
-
*
|
|
291
|
-
* Uses the following key structure:
|
|
292
|
-
* - `emailverify:{tokenId}` - Token data (JSON)
|
|
293
|
-
* - `emailverify:email:{email}` - Set of token IDs for an email
|
|
294
|
-
*
|
|
295
|
-
* @example
|
|
296
|
-
* ```ts
|
|
297
|
-
* import { createRedisClient } from '@guren/server/redis'
|
|
298
|
-
*
|
|
299
|
-
* const redis = createRedisClient({ url: process.env.REDIS_URL })
|
|
300
|
-
* const store = new RedisEmailVerificationStore(redis)
|
|
301
|
-
*
|
|
302
|
-
* const { token } = await createEmailVerificationToken(email, store, { expiresIn: 86400000 })
|
|
303
|
-
* ```
|
|
304
|
-
*/
|
|
305
|
-
declare class RedisEmailVerificationStore implements EmailVerificationTokenStore {
|
|
306
|
-
private readonly redis;
|
|
307
|
-
private readonly prefix;
|
|
308
|
-
constructor(redis: Redis, options?: RedisEmailVerificationStoreOptions);
|
|
309
|
-
/**
|
|
310
|
-
* Store an email verification token.
|
|
311
|
-
*/
|
|
312
|
-
store(token: EmailVerificationToken): Promise<void>;
|
|
313
|
-
/**
|
|
314
|
-
* Find a token by its hash.
|
|
315
|
-
*/
|
|
316
|
-
findByTokenId(tokenId: string): Promise<EmailVerificationToken | null>;
|
|
317
|
-
/**
|
|
318
|
-
* Delete a token by its hash.
|
|
319
|
-
*/
|
|
320
|
-
delete(tokenId: string): Promise<void>;
|
|
321
|
-
/**
|
|
322
|
-
* Delete all tokens for an email.
|
|
323
|
-
*/
|
|
324
|
-
deleteForEmail(email: string): Promise<void>;
|
|
325
|
-
/**
|
|
326
|
-
* Clear all tokens (for testing).
|
|
327
|
-
*/
|
|
328
|
-
clear(): Promise<void>;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* Options for RedisOAuthStateStore.
|
|
333
|
-
*/
|
|
334
|
-
interface RedisOAuthStateStoreOptions {
|
|
335
|
-
/**
|
|
336
|
-
* Key prefix for OAuth state keys.
|
|
337
|
-
* @default 'oauthstate:'
|
|
338
|
-
*/
|
|
339
|
-
prefix?: string;
|
|
340
|
-
}
|
|
341
|
-
declare class RedisOAuthStateStore implements OAuthStateStore {
|
|
342
|
-
private readonly redis;
|
|
343
|
-
private readonly prefix;
|
|
344
|
-
constructor(redis: Redis, options?: RedisOAuthStateStoreOptions);
|
|
345
|
-
store(stateHash: string, payload: OAuthStatePayload): Promise<void>;
|
|
346
|
-
find(stateHash: string): Promise<OAuthStatePayload | null>;
|
|
347
|
-
consume(stateHash: string): Promise<OAuthStatePayload | null>;
|
|
348
|
-
private parsePayload;
|
|
349
|
-
delete(stateHash: string): Promise<void>;
|
|
350
|
-
/**
|
|
351
|
-
* Clear all states (for testing).
|
|
352
|
-
*/
|
|
353
|
-
clear(): Promise<void>;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
export { RedisApiTokenStore, type RedisApiTokenStoreOptions, RedisEmailVerificationStore, type RedisEmailVerificationStoreOptions, RedisOAuthStateStore, type RedisOAuthStateStoreOptions, RedisPasswordResetStore, type RedisPasswordResetStoreOptions, RedisRateLimitStore, type RedisRateLimitStoreOptions, RedisSessionStore, type RedisSessionStoreOptions, RedisSlidingWindowRateLimitStore };
|
|
1
|
+
export { createRedisClient, Redis } from './client.js';
|
|
2
|
+
export type { RedisClientOptions, RedisOptions } from './client.js';
|
|
3
|
+
export { RedisSessionStore } from './RedisSessionStore.js';
|
|
4
|
+
export type { RedisSessionStoreOptions } from './RedisSessionStore.js';
|
|
5
|
+
export { RedisRateLimitStore, RedisSlidingWindowRateLimitStore } from './RedisRateLimitStore.js';
|
|
6
|
+
export type { RedisRateLimitStoreOptions } from './RedisRateLimitStore.js';
|
|
7
|
+
export { RedisApiTokenStore } from './RedisApiTokenStore.js';
|
|
8
|
+
export type { RedisApiTokenStoreOptions } from './RedisApiTokenStore.js';
|
|
9
|
+
export { RedisPasswordResetStore } from './RedisPasswordResetStore.js';
|
|
10
|
+
export type { RedisPasswordResetStoreOptions } from './RedisPasswordResetStore.js';
|
|
11
|
+
export { RedisEmailVerificationStore } from './RedisEmailVerificationStore.js';
|
|
12
|
+
export type { RedisEmailVerificationStoreOptions } from './RedisEmailVerificationStore.js';
|
|
13
|
+
export { RedisOAuthStateStore } from './RedisOAuthStateStore.js';
|
|
14
|
+
export type { RedisOAuthStateStoreOptions } from './RedisOAuthStateStore.js';
|
package/dist/redis/index.js
CHANGED
|
@@ -2,6 +2,10 @@ import {
|
|
|
2
2
|
Redis,
|
|
3
3
|
createRedisClient
|
|
4
4
|
} from "../chunk-UY3AZSYL.js";
|
|
5
|
+
import {
|
|
6
|
+
toDate,
|
|
7
|
+
toOptionalExpiry
|
|
8
|
+
} from "../chunk-3KV5X2FL.js";
|
|
5
9
|
|
|
6
10
|
// src/redis/scan-keys.ts
|
|
7
11
|
async function scanKeys(redis, pattern) {
|
|
@@ -230,6 +234,20 @@ var RedisSlidingWindowRateLimitStore = class {
|
|
|
230
234
|
}
|
|
231
235
|
};
|
|
232
236
|
|
|
237
|
+
// src/redis/redis-values.ts
|
|
238
|
+
function decodeAbilities(value) {
|
|
239
|
+
if (value == null || value === "") return [];
|
|
240
|
+
let parsed = value;
|
|
241
|
+
if (typeof value === "string") {
|
|
242
|
+
try {
|
|
243
|
+
parsed = JSON.parse(value);
|
|
244
|
+
} catch {
|
|
245
|
+
return [];
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return Array.isArray(parsed) ? parsed.filter((ability) => typeof ability === "string") : [];
|
|
249
|
+
}
|
|
250
|
+
|
|
233
251
|
// src/redis/RedisApiTokenStore.ts
|
|
234
252
|
var RedisApiTokenStore = class {
|
|
235
253
|
constructor(redis, options = {}) {
|
|
@@ -353,10 +371,13 @@ var RedisApiTokenStore = class {
|
|
|
353
371
|
name: data.name,
|
|
354
372
|
hashedToken: data.hashedToken,
|
|
355
373
|
userId: data.userId,
|
|
356
|
-
abilities:
|
|
357
|
-
lastUsedAt:
|
|
358
|
-
|
|
359
|
-
|
|
374
|
+
abilities: decodeAbilities(data.abilities),
|
|
375
|
+
lastUsedAt: toDate(data.lastUsedAt),
|
|
376
|
+
// Absent means "never expires"; present-but-unparseable means a corrupt
|
|
377
|
+
// record, which must not read as immortal — `verifyApiToken` skips its
|
|
378
|
+
// expiry check entirely when this is null.
|
|
379
|
+
expiresAt: toOptionalExpiry(data.expiresAt),
|
|
380
|
+
createdAt: toDate(data.createdAt) ?? /* @__PURE__ */ new Date(0)
|
|
360
381
|
};
|
|
361
382
|
}
|
|
362
383
|
/**
|
|
@@ -406,9 +427,13 @@ var RedisPasswordResetStore = class {
|
|
|
406
427
|
}
|
|
407
428
|
try {
|
|
408
429
|
const parsed = JSON.parse(data);
|
|
430
|
+
const expiresAt = toDate(parsed.expiresAt);
|
|
431
|
+
if (expiresAt === null) {
|
|
432
|
+
return null;
|
|
433
|
+
}
|
|
409
434
|
return {
|
|
410
435
|
email: parsed.email,
|
|
411
|
-
expiresAt
|
|
436
|
+
expiresAt
|
|
412
437
|
};
|
|
413
438
|
} catch {
|
|
414
439
|
return null;
|
|
@@ -495,11 +520,15 @@ var RedisEmailVerificationStore = class {
|
|
|
495
520
|
}
|
|
496
521
|
try {
|
|
497
522
|
const parsed = JSON.parse(data);
|
|
523
|
+
const expiresAt = toDate(parsed.expiresAt);
|
|
524
|
+
if (expiresAt === null) {
|
|
525
|
+
return null;
|
|
526
|
+
}
|
|
498
527
|
return {
|
|
499
528
|
tokenId: parsed.tokenId,
|
|
500
529
|
email: parsed.email,
|
|
501
|
-
expiresAt
|
|
502
|
-
createdAt:
|
|
530
|
+
expiresAt,
|
|
531
|
+
createdAt: toDate(parsed.createdAt) ?? /* @__PURE__ */ new Date(0)
|
|
503
532
|
};
|
|
504
533
|
} catch {
|
|
505
534
|
return null;
|
|
@@ -568,7 +597,9 @@ var RedisOAuthStateStore = class {
|
|
|
568
597
|
const data = JSON.stringify({
|
|
569
598
|
provider: payload.provider,
|
|
570
599
|
redirectTo: payload.redirectTo,
|
|
571
|
-
expiresAt: payload.expiresAt.toISOString()
|
|
600
|
+
expiresAt: payload.expiresAt.toISOString(),
|
|
601
|
+
// Persisted, not derived: an unbound state verifies for any browser.
|
|
602
|
+
binding: payload.binding
|
|
572
603
|
});
|
|
573
604
|
await this.redis.psetex(`${this.prefix}${stateHash}`, ttlMs, data);
|
|
574
605
|
}
|
|
@@ -605,10 +636,15 @@ var RedisOAuthStateStore = class {
|
|
|
605
636
|
parsePayload(data) {
|
|
606
637
|
try {
|
|
607
638
|
const parsed = JSON.parse(data);
|
|
639
|
+
const expiresAt = toDate(parsed.expiresAt);
|
|
640
|
+
if (expiresAt === null) {
|
|
641
|
+
return null;
|
|
642
|
+
}
|
|
608
643
|
return {
|
|
609
644
|
provider: parsed.provider,
|
|
610
645
|
redirectTo: parsed.redirectTo,
|
|
611
|
-
expiresAt
|
|
646
|
+
expiresAt,
|
|
647
|
+
binding: parsed.binding
|
|
612
648
|
};
|
|
613
649
|
} catch {
|
|
614
650
|
return null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decoding rules shared by the Redis-backed stores.
|
|
3
|
+
*
|
|
4
|
+
* Expiry coercion lives in `../support/expiry` — every store reads its expiry
|
|
5
|
+
* through `toDate`/`toOptionalExpiry`/`isExpired` there, so there is one rule
|
|
6
|
+
* rather than one per store.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Decode a JSON-encoded ability list.
|
|
10
|
+
*
|
|
11
|
+
* Corrupt text degrades to no abilities (deny-by-default) instead of throwing
|
|
12
|
+
* on every verification of the affected token. A value that decodes to
|
|
13
|
+
* something other than a list of strings degrades the same way: `tokenCan`
|
|
14
|
+
* would otherwise run `String.prototype.includes` on it, so a stored `'"*"'`
|
|
15
|
+
* would grant every ability.
|
|
16
|
+
*/
|
|
17
|
+
export declare function decodeAbilities(value: unknown): string[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Redis } from 'ioredis';
|
|
2
|
+
/**
|
|
3
|
+
* Scan Redis keys matching a pattern without blocking the server.
|
|
4
|
+
* Uses SCAN with cursor-based iteration to avoid the O(N) KEYS command.
|
|
5
|
+
*/
|
|
6
|
+
export declare function scanKeys(redis: Redis, pattern: string): Promise<string[]>;
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1,95 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import '../CacheManager-BmDzUKrF.js';
|
|
10
|
-
import '../MailManager-DpMvYiP9.js';
|
|
11
|
-
import '../LogManager-7mxnkaPM.js';
|
|
12
|
-
import '../I18nManager-BiSoczfV.js';
|
|
13
|
-
import '../BroadcastManager-D8KoJxiV.js';
|
|
14
|
-
import '../index-9_Jzj5jo.js';
|
|
15
|
-
import '../app-key-CsBfRC_Q.js';
|
|
16
|
-
import '../StorageManager-oZTHqaza.js';
|
|
17
|
-
import '../HealthManager-DUyMIzsZ.js';
|
|
18
|
-
import '../Scheduler-pZiT8i57.js';
|
|
19
|
-
import '../Gate-CynjZCtS.js';
|
|
20
|
-
|
|
21
|
-
type RootPublicAssetsConfig = boolean | RootPublicAssetsOptions;
|
|
22
|
-
interface RootPublicAssetsOptions {
|
|
23
|
-
/** Enable or disable root-level public asset serving. Defaults to true. */
|
|
24
|
-
enabled?: boolean;
|
|
25
|
-
/** List of file extensions to expose from the public directory. */
|
|
26
|
-
extensions?: string[];
|
|
27
|
-
/** Cache-Control header applied to served files. */
|
|
28
|
-
cacheControlHeader?: string;
|
|
29
|
-
/** Optional prefix filter (e.g. `/assets`). Defaults to all paths. */
|
|
30
|
-
routePrefix?: string;
|
|
31
|
-
/** Override content types per extension. */
|
|
32
|
-
contentTypeMap?: Record<string, string>;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
interface DevAssetsOptions {
|
|
36
|
-
/** Absolute path to the resources directory (e.g. `/app/resources`). */
|
|
37
|
-
resourcesDir?: string;
|
|
38
|
-
/** Base import meta used to resolve relative paths. */
|
|
39
|
-
importMeta?: ImportMeta;
|
|
40
|
-
/** Relative path from `importMeta` to the resources directory. Defaults to `../resources`. */
|
|
41
|
-
resourcesPath?: string;
|
|
42
|
-
/** Path prefix to mount transpiled JS assets. Defaults to `/resources/js`. */
|
|
43
|
-
prefix?: string;
|
|
44
|
-
/** Route pattern used to serve raw CSS assets. Defaults to `/resources/css/*`. */
|
|
45
|
-
cssRoute?: string;
|
|
46
|
-
/** Absolute path to the CSS directory. Defaults to `<resourcesDir>/../css`. */
|
|
47
|
-
cssDir?: string;
|
|
48
|
-
/** Enables serving the bundled inertia client. Defaults to true. */
|
|
49
|
-
inertiaClient?: boolean;
|
|
50
|
-
/** Path to the inertia client source. Defaults to the version bundled with Guren. */
|
|
51
|
-
inertiaClientSource?: string;
|
|
52
|
-
/** Public URL for the inertia client. Defaults to `/vendor/inertia-client.tsx`. */
|
|
53
|
-
inertiaClientPath?: string;
|
|
54
|
-
/** Override the remote JSX runtime URL. */
|
|
55
|
-
jsxRuntimeUrl?: string;
|
|
56
|
-
/** Absolute path to a directory with static assets (e.g. `/app/public`). */
|
|
57
|
-
publicDir?: string;
|
|
58
|
-
/** Relative path from `importMeta` to the static assets directory. Defaults to `../public`. */
|
|
59
|
-
publicPath?: string | false;
|
|
60
|
-
/** Route pattern used when serving static assets. Defaults to `/public/*`. */
|
|
61
|
-
publicRoute?: string;
|
|
62
|
-
/** Whether to register a no-op favicon route. Defaults to true when static assets are served. */
|
|
63
|
-
favicon?: boolean;
|
|
64
|
-
/** Serve selected files from the public directory without the `/public` prefix. */
|
|
65
|
-
rootPublicAssets?: RootPublicAssetsConfig;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Registers development asset serving middleware.
|
|
69
|
-
* @param app
|
|
70
|
-
* @param options
|
|
71
|
-
*/
|
|
72
|
-
declare function registerDevAssets(app: Application, options: DevAssetsOptions): void;
|
|
73
|
-
|
|
74
|
-
interface InertiaAssetsOptions extends DevAssetsOptions {
|
|
75
|
-
/** Default stylesheet entry embedded into Inertia responses. */
|
|
76
|
-
stylesEntry?: string;
|
|
77
|
-
/** Default script entry embedded into Inertia responses (production). */
|
|
78
|
-
scriptEntry?: string;
|
|
79
|
-
/** Path to the SSR bundle entry consumed by the Inertia engine. */
|
|
80
|
-
ssrEntry?: string;
|
|
81
|
-
/** Path to the SSR manifest file generated by the build. */
|
|
82
|
-
ssrManifest?: string;
|
|
83
|
-
}
|
|
84
|
-
interface AutoConfigureInertiaOptions extends InertiaAssetsOptions {
|
|
85
|
-
/** Dev server URL used when NODE_ENV !== 'production'. */
|
|
86
|
-
devServerUrl?: string;
|
|
87
|
-
/** Output directory for Vite SSR bundles (relative to project root). */
|
|
88
|
-
ssrOutDir?: string;
|
|
89
|
-
/** Enables SSR auto-wiring (defaults to true). */
|
|
90
|
-
enableSsr?: boolean;
|
|
91
|
-
}
|
|
92
|
-
declare function configureInertiaAssets(app: Application, options: InertiaAssetsOptions): void;
|
|
93
|
-
declare function autoConfigureInertiaAssets(app: Application, options: AutoConfigureInertiaOptions): void;
|
|
94
|
-
|
|
95
|
-
export { type AutoConfigureInertiaOptions, type DevAssetsOptions, type InertiaAssetsOptions, autoConfigureInertiaAssets, configureInertiaAssets, registerDevAssets };
|
|
1
|
+
export { registerDevAssets } from '../http/dev-assets.js';
|
|
2
|
+
export type { DevAssetsOptions } from '../http/dev-assets.js';
|
|
3
|
+
export { configureInertiaAssets, autoConfigureInertiaAssets } from '../http/inertia-assets.js';
|
|
4
|
+
export type { InertiaAssetsOptions, AutoConfigureInertiaOptions } from '../http/inertia-assets.js';
|
|
5
|
+
export { logDevServerBanner, GUREN_ASCII_ART } from '../http/dev-banner.js';
|
|
6
|
+
export type { DevBannerOptions } from '../http/dev-banner.js';
|
|
7
|
+
export { startViteDevServer } from '../http/vite-dev-server.js';
|
|
8
|
+
export type { StartViteDevServerOptions, StartedViteDevServer } from '../http/vite-dev-server.js';
|