@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/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
logDevServerBanner,
|
|
3
3
|
parseImportMap,
|
|
4
4
|
startViteDevServer
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-6IGN233M.js";
|
|
6
6
|
import {
|
|
7
7
|
PendingSchedule,
|
|
8
8
|
Schedule,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
} from "./chunk-AZOYI43J.js";
|
|
30
30
|
import {
|
|
31
31
|
isDocsViewerEnabled
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-A5JJ7XTH.js";
|
|
33
33
|
import {
|
|
34
34
|
I18nManager,
|
|
35
35
|
JsonLoader,
|
|
@@ -42,8 +42,9 @@ import {
|
|
|
42
42
|
selectPluralForm,
|
|
43
43
|
setI18n,
|
|
44
44
|
t,
|
|
45
|
-
tc
|
|
46
|
-
|
|
45
|
+
tc,
|
|
46
|
+
tryGetI18n
|
|
47
|
+
} from "./chunk-HR2KZ3WL.js";
|
|
47
48
|
import {
|
|
48
49
|
ConsoleChannel,
|
|
49
50
|
DailyFileChannel,
|
|
@@ -71,11 +72,11 @@ import {
|
|
|
71
72
|
import {
|
|
72
73
|
MCP_ENDPOINT_PATH,
|
|
73
74
|
isMcpEndpointEnabled
|
|
74
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-Q2P6YLRR.js";
|
|
75
76
|
import {
|
|
76
77
|
ProviderManager,
|
|
77
78
|
ServiceProvider
|
|
78
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-LHR6OHI7.js";
|
|
79
80
|
import {
|
|
80
81
|
DatabaseChannel,
|
|
81
82
|
MailChannel,
|
|
@@ -134,6 +135,7 @@ import {
|
|
|
134
135
|
MemorySessionStore,
|
|
135
136
|
ModelUserProvider,
|
|
136
137
|
NodeHasher,
|
|
138
|
+
OAUTH_SESSION_BINDING_KEY,
|
|
137
139
|
OAuthManager,
|
|
138
140
|
ScryptHasher,
|
|
139
141
|
SessionGuard,
|
|
@@ -178,7 +180,8 @@ import {
|
|
|
178
180
|
verifyEmailToken,
|
|
179
181
|
verifyOAuthState,
|
|
180
182
|
verifyPasswordResetToken
|
|
181
|
-
} from "./chunk-
|
|
183
|
+
} from "./chunk-TVV5YNEC.js";
|
|
184
|
+
import "./chunk-3KV5X2FL.js";
|
|
182
185
|
import {
|
|
183
186
|
Gate,
|
|
184
187
|
Policy,
|
|
@@ -195,7 +198,7 @@ import {
|
|
|
195
198
|
getGate,
|
|
196
199
|
setGate,
|
|
197
200
|
withAuthorization
|
|
198
|
-
} from "./chunk-
|
|
201
|
+
} from "./chunk-7OB2YXRE.js";
|
|
199
202
|
import {
|
|
200
203
|
AuthorizationException,
|
|
201
204
|
ExceptionHandler,
|
|
@@ -228,7 +231,7 @@ import {
|
|
|
228
231
|
getBroadcastManager,
|
|
229
232
|
parseRequestPayload,
|
|
230
233
|
setBroadcastManager
|
|
231
|
-
} from "./chunk-
|
|
234
|
+
} from "./chunk-4VE3LYOM.js";
|
|
232
235
|
import {
|
|
233
236
|
CacheManager,
|
|
234
237
|
FileStore,
|
|
@@ -236,7 +239,7 @@ import {
|
|
|
236
239
|
RedisStore,
|
|
237
240
|
TaggedCache,
|
|
238
241
|
createCacheManager
|
|
239
|
-
} from "./chunk-
|
|
242
|
+
} from "./chunk-HPET6XY5.js";
|
|
240
243
|
import {
|
|
241
244
|
claimHotDisposable,
|
|
242
245
|
isHotReloadRuntime,
|
|
@@ -904,11 +907,11 @@ async function resolveModelBindings(c, modelBindings, path) {
|
|
|
904
907
|
const params = c.req.param();
|
|
905
908
|
const pathParams = path?.match(/:([a-zA-Z0-9_-]+)/g)?.map((p) => p.slice(1)) ?? [];
|
|
906
909
|
for (const param of pathParams) {
|
|
907
|
-
const
|
|
908
|
-
if (!
|
|
910
|
+
const resolver = modelBindings.get(param);
|
|
911
|
+
if (!resolver) continue;
|
|
909
912
|
const value = params[param];
|
|
910
913
|
if (value !== void 0) {
|
|
911
|
-
const model = await
|
|
914
|
+
const model = await resolver(value);
|
|
912
915
|
resolved.push(model);
|
|
913
916
|
}
|
|
914
917
|
}
|
|
@@ -1032,7 +1035,10 @@ function randomNonce() {
|
|
|
1032
1035
|
return Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
1033
1036
|
}
|
|
1034
1037
|
function bindableSessionId(session) {
|
|
1035
|
-
|
|
1038
|
+
if (!session) {
|
|
1039
|
+
return void 0;
|
|
1040
|
+
}
|
|
1041
|
+
return session.willPersist?.() ?? !session.isNew ? session.id : void 0;
|
|
1036
1042
|
}
|
|
1037
1043
|
function mintCsrfToken(sessionId) {
|
|
1038
1044
|
const signer = createCsrfSigner();
|
|
@@ -1042,7 +1048,10 @@ function verifiedClaims(token) {
|
|
|
1042
1048
|
return createCsrfSigner().verify(token, { purpose: CSRF_PURPOSE });
|
|
1043
1049
|
}
|
|
1044
1050
|
function claimsUsableFor(claims, boundId) {
|
|
1045
|
-
|
|
1051
|
+
if (claims.sid === void 0) {
|
|
1052
|
+
return boundId === void 0;
|
|
1053
|
+
}
|
|
1054
|
+
return boundId !== void 0 && secureCompare(claims.sid, boundId);
|
|
1046
1055
|
}
|
|
1047
1056
|
function matchesPattern(path, pattern) {
|
|
1048
1057
|
if (pattern.endsWith("/*")) {
|
|
@@ -1058,21 +1067,23 @@ function isMcpEndpointRequest(path) {
|
|
|
1058
1067
|
return path === MCP_ENDPOINT_PATH && isMcpEndpointEnabled();
|
|
1059
1068
|
}
|
|
1060
1069
|
function getCsrfToken(ctx) {
|
|
1061
|
-
const pending = ctx.get(CSRF_CONTEXT_KEY);
|
|
1062
|
-
if (pending) {
|
|
1063
|
-
return pending;
|
|
1064
|
-
}
|
|
1065
1070
|
const boundId = bindableSessionId(getSessionFromContext(ctx));
|
|
1071
|
+
const issued = ctx.get(CSRF_CONTEXT_KEY);
|
|
1072
|
+
if (issued && issued.boundId === boundId) {
|
|
1073
|
+
return issued.token;
|
|
1074
|
+
}
|
|
1075
|
+
return remember(ctx, reusableCookieToken(ctx, boundId) ?? mintCsrfToken(boundId), boundId);
|
|
1076
|
+
}
|
|
1077
|
+
function reusableCookieToken(ctx, boundId) {
|
|
1066
1078
|
const cookieToken = getCookie(ctx, XSRF_COOKIE_NAME);
|
|
1067
|
-
if (cookieToken) {
|
|
1068
|
-
|
|
1069
|
-
if (claims && claimsUsableFor(claims, boundId)) {
|
|
1070
|
-
ctx.set(CSRF_CONTEXT_KEY, cookieToken);
|
|
1071
|
-
return cookieToken;
|
|
1072
|
-
}
|
|
1079
|
+
if (!cookieToken) {
|
|
1080
|
+
return void 0;
|
|
1073
1081
|
}
|
|
1074
|
-
const
|
|
1075
|
-
|
|
1082
|
+
const claims = verifiedClaims(cookieToken);
|
|
1083
|
+
return claims && claimsUsableFor(claims, boundId) ? cookieToken : void 0;
|
|
1084
|
+
}
|
|
1085
|
+
function remember(ctx, token, boundId) {
|
|
1086
|
+
ctx.set(CSRF_CONTEXT_KEY, { token, boundId });
|
|
1076
1087
|
return token;
|
|
1077
1088
|
}
|
|
1078
1089
|
function csrfField(ctx) {
|
|
@@ -1084,17 +1095,13 @@ function verifyCsrfToken(ctx, token) {
|
|
|
1084
1095
|
return false;
|
|
1085
1096
|
}
|
|
1086
1097
|
const claims = verifiedClaims(token);
|
|
1087
|
-
if (claims) {
|
|
1098
|
+
if (claims && claimsUsableFor(claims, bindableSessionId(getSessionFromContext(ctx)))) {
|
|
1088
1099
|
if (claims.sid !== void 0) {
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
const cookieToken = getCookie(ctx, XSRF_COOKIE_NAME);
|
|
1095
|
-
if (cookieToken && secureCompare(token, cookieToken)) {
|
|
1096
|
-
return true;
|
|
1097
|
-
}
|
|
1100
|
+
return true;
|
|
1101
|
+
}
|
|
1102
|
+
const cookieToken = getCookie(ctx, XSRF_COOKIE_NAME);
|
|
1103
|
+
if (cookieToken && secureCompare(token, cookieToken)) {
|
|
1104
|
+
return true;
|
|
1098
1105
|
}
|
|
1099
1106
|
}
|
|
1100
1107
|
const sessionToken = getSessionFromContext(ctx)?.get(CSRF_TOKEN_KEY);
|
|
@@ -1143,19 +1150,22 @@ function createCsrfMiddleware(options = {}) {
|
|
|
1143
1150
|
cookieOptions = {}
|
|
1144
1151
|
} = options;
|
|
1145
1152
|
const protectedMethods = new Set(methods.map((m) => m.toUpperCase()));
|
|
1153
|
+
const settleCookie = (ctx) => {
|
|
1154
|
+
if (enableCookie) {
|
|
1155
|
+
setXsrfCookie(ctx, getCsrfToken(ctx), cookieOptions);
|
|
1156
|
+
}
|
|
1157
|
+
};
|
|
1146
1158
|
return async (ctx, next) => {
|
|
1147
1159
|
const method = ctx.req.method.toUpperCase();
|
|
1148
1160
|
const path = new URL(ctx.req.url).pathname;
|
|
1149
1161
|
if (!protectedMethods.has(method)) {
|
|
1150
|
-
const token = getCsrfToken(ctx);
|
|
1151
1162
|
await next();
|
|
1152
|
-
|
|
1153
|
-
setXsrfCookie(ctx, token, cookieOptions);
|
|
1154
|
-
}
|
|
1163
|
+
settleCookie(ctx);
|
|
1155
1164
|
return;
|
|
1156
1165
|
}
|
|
1157
1166
|
if (isExcluded(path, exclude) || isMcpEndpointRequest(path)) {
|
|
1158
1167
|
await next();
|
|
1168
|
+
settleCookie(ctx);
|
|
1159
1169
|
return;
|
|
1160
1170
|
}
|
|
1161
1171
|
const requestToken = await getTokenFromRequest(ctx);
|
|
@@ -1167,9 +1177,7 @@ function createCsrfMiddleware(options = {}) {
|
|
|
1167
1177
|
return jsonResponse({ message: "CSRF token mismatch" }, 403);
|
|
1168
1178
|
}
|
|
1169
1179
|
await next();
|
|
1170
|
-
|
|
1171
|
-
setXsrfCookie(ctx, getCsrfToken(ctx), cookieOptions);
|
|
1172
|
-
}
|
|
1180
|
+
settleCookie(ctx);
|
|
1173
1181
|
};
|
|
1174
1182
|
}
|
|
1175
1183
|
function setXsrfCookie(ctx, token, options = {}) {
|
|
@@ -1232,15 +1240,8 @@ function validateSafe(schema, data) {
|
|
|
1232
1240
|
|
|
1233
1241
|
// src/http/middleware/rate-limit.ts
|
|
1234
1242
|
var BaseMemoryStore = class {
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
* This store's claim on its hot-reload slot, if it holds one.
|
|
1238
|
-
*
|
|
1239
|
-
* Unlike the cache sweep, this interval is not `unref()`ed, so a leaked one
|
|
1240
|
-
* both duplicates work and keeps the process alive on its own.
|
|
1241
|
-
*/
|
|
1242
|
-
hotReloadClaim;
|
|
1243
|
-
constructor(cleanupIntervalMs = 6e4) {
|
|
1243
|
+
constructor(cleanupIntervalMs = 6e4, now = () => Date.now()) {
|
|
1244
|
+
this.now = now;
|
|
1244
1245
|
if (cleanupIntervalMs <= 0) {
|
|
1245
1246
|
return;
|
|
1246
1247
|
}
|
|
@@ -1252,6 +1253,15 @@ var BaseMemoryStore = class {
|
|
|
1252
1253
|
() => this.destroy()
|
|
1253
1254
|
);
|
|
1254
1255
|
}
|
|
1256
|
+
now;
|
|
1257
|
+
cleanupInterval;
|
|
1258
|
+
/**
|
|
1259
|
+
* This store's claim on its hot-reload slot, if it holds one.
|
|
1260
|
+
*
|
|
1261
|
+
* Unlike the cache sweep, this interval is not `unref()`ed, so a leaked one
|
|
1262
|
+
* both duplicates work and keeps the process alive on its own.
|
|
1263
|
+
*/
|
|
1264
|
+
hotReloadClaim;
|
|
1255
1265
|
destroy() {
|
|
1256
1266
|
if (this.cleanupInterval) {
|
|
1257
1267
|
clearInterval(this.cleanupInterval);
|
|
@@ -1265,14 +1275,14 @@ var MemoryRateLimitStore = class extends BaseMemoryStore {
|
|
|
1265
1275
|
async get(key) {
|
|
1266
1276
|
const entry = this.entries.get(key);
|
|
1267
1277
|
if (!entry) return null;
|
|
1268
|
-
if (
|
|
1278
|
+
if (this.now() >= entry.resetAt) {
|
|
1269
1279
|
this.entries.delete(key);
|
|
1270
1280
|
return null;
|
|
1271
1281
|
}
|
|
1272
1282
|
return entry;
|
|
1273
1283
|
}
|
|
1274
1284
|
async increment(key, windowMs) {
|
|
1275
|
-
const now =
|
|
1285
|
+
const now = this.now();
|
|
1276
1286
|
const existing = this.entries.get(key);
|
|
1277
1287
|
if (existing && now < existing.resetAt) {
|
|
1278
1288
|
existing.count++;
|
|
@@ -1286,7 +1296,7 @@ var MemoryRateLimitStore = class extends BaseMemoryStore {
|
|
|
1286
1296
|
this.entries.delete(key);
|
|
1287
1297
|
}
|
|
1288
1298
|
cleanup() {
|
|
1289
|
-
const now =
|
|
1299
|
+
const now = this.now();
|
|
1290
1300
|
for (const [key, entry] of this.entries.entries()) {
|
|
1291
1301
|
if (now >= entry.resetAt) {
|
|
1292
1302
|
this.entries.delete(key);
|
|
@@ -1353,13 +1363,19 @@ function createRateLimitMiddleware(options = {}) {
|
|
|
1353
1363
|
windowMs = 6e4,
|
|
1354
1364
|
trustProxy = false,
|
|
1355
1365
|
keyGenerator = trustProxy ? proxyAwareKeyGenerator : defaultKeyGenerator,
|
|
1356
|
-
store
|
|
1366
|
+
// An injected clock must drive the default store too, or expiry would run
|
|
1367
|
+
// on real time while Retry-After runs on the fake clock. The shared default
|
|
1368
|
+
// store stays on real time, so build a dedicated store instead — without
|
|
1369
|
+
// auto-cleanup, since a real-time sweep is meaningless on a fake clock and
|
|
1370
|
+
// its interval would outlive tests.
|
|
1371
|
+
store = options.now ? new MemoryRateLimitStore(0, options.now) : getDefaultStore(),
|
|
1357
1372
|
skip,
|
|
1358
1373
|
onRateLimited,
|
|
1359
1374
|
headers = true,
|
|
1360
1375
|
message = "Too many requests, please try again later.",
|
|
1361
1376
|
statusCode = 429,
|
|
1362
|
-
keyPrefix = "rl:"
|
|
1377
|
+
keyPrefix = "rl:",
|
|
1378
|
+
now = () => Date.now()
|
|
1363
1379
|
} = options;
|
|
1364
1380
|
return async (ctx, next) => {
|
|
1365
1381
|
if (skip && await skip(ctx)) {
|
|
@@ -1369,7 +1385,7 @@ function createRateLimitMiddleware(options = {}) {
|
|
|
1369
1385
|
const key = `${keyPrefix}${baseKey}`;
|
|
1370
1386
|
const entry = await store.increment(key, windowMs);
|
|
1371
1387
|
const remaining = Math.max(0, limit - entry.count);
|
|
1372
|
-
const resetSeconds = Math.ceil((entry.resetAt -
|
|
1388
|
+
const resetSeconds = Math.max(0, Math.ceil((entry.resetAt - now()) / 1e3));
|
|
1373
1389
|
if (headers) {
|
|
1374
1390
|
ctx.header("X-RateLimit-Limit", limit.toString());
|
|
1375
1391
|
ctx.header("X-RateLimit-Remaining", remaining.toString());
|
|
@@ -1416,7 +1432,7 @@ var SlidingWindowRateLimitStore = class extends BaseMemoryStore {
|
|
|
1416
1432
|
async get(key) {
|
|
1417
1433
|
const entry = this.requests.get(key);
|
|
1418
1434
|
if (!entry || entry.timestamps.length === 0) return null;
|
|
1419
|
-
const now =
|
|
1435
|
+
const now = this.now();
|
|
1420
1436
|
const windowStart = now - entry.windowMs;
|
|
1421
1437
|
const timestamps = entry.timestamps.filter((t2) => t2 > windowStart);
|
|
1422
1438
|
if (timestamps.length === 0) {
|
|
@@ -1429,7 +1445,7 @@ var SlidingWindowRateLimitStore = class extends BaseMemoryStore {
|
|
|
1429
1445
|
return { count: timestamps.length, resetAt: timestamps[0] + entry.windowMs };
|
|
1430
1446
|
}
|
|
1431
1447
|
async increment(key, windowMs) {
|
|
1432
|
-
const now =
|
|
1448
|
+
const now = this.now();
|
|
1433
1449
|
const windowStart = now - windowMs;
|
|
1434
1450
|
const entry = this.requests.get(key);
|
|
1435
1451
|
let timestamps = entry ? entry.timestamps.filter((t2) => t2 > windowStart) : [];
|
|
@@ -1441,7 +1457,7 @@ var SlidingWindowRateLimitStore = class extends BaseMemoryStore {
|
|
|
1441
1457
|
this.requests.delete(key);
|
|
1442
1458
|
}
|
|
1443
1459
|
cleanup() {
|
|
1444
|
-
const now =
|
|
1460
|
+
const now = this.now();
|
|
1445
1461
|
for (const [key, entry] of this.requests.entries()) {
|
|
1446
1462
|
const windowStart = now - entry.windowMs;
|
|
1447
1463
|
const valid = entry.timestamps.filter((t2) => t2 > windowStart);
|
|
@@ -1460,6 +1476,31 @@ var SlidingWindowRateLimitStore = class extends BaseMemoryStore {
|
|
|
1460
1476
|
}
|
|
1461
1477
|
};
|
|
1462
1478
|
|
|
1479
|
+
// src/http/middleware/response-headers.ts
|
|
1480
|
+
function applyResponseHeaders(ctx, headers) {
|
|
1481
|
+
const response = ctx.res;
|
|
1482
|
+
try {
|
|
1483
|
+
for (const [name, value] of headers) {
|
|
1484
|
+
if (!response.headers.has(name)) response.headers.set(name, value);
|
|
1485
|
+
}
|
|
1486
|
+
return;
|
|
1487
|
+
} catch (error) {
|
|
1488
|
+
if (!isImmutableHeadersError(error)) throw error;
|
|
1489
|
+
}
|
|
1490
|
+
const merged = new Headers(response.headers);
|
|
1491
|
+
for (const [name, value] of headers) {
|
|
1492
|
+
if (!merged.has(name)) merged.set(name, value);
|
|
1493
|
+
}
|
|
1494
|
+
ctx.res = new Response(response.body, {
|
|
1495
|
+
status: response.status,
|
|
1496
|
+
statusText: response.statusText,
|
|
1497
|
+
headers: merged
|
|
1498
|
+
});
|
|
1499
|
+
}
|
|
1500
|
+
function isImmutableHeadersError(error) {
|
|
1501
|
+
return error instanceof TypeError && /immutable/i.test(error.message);
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1463
1504
|
// src/http/middleware/security-headers.ts
|
|
1464
1505
|
function createSecurityHeaders(options = {}) {
|
|
1465
1506
|
const {
|
|
@@ -1471,26 +1512,21 @@ function createSecurityHeaders(options = {}) {
|
|
|
1471
1512
|
hsts = process.env.NODE_ENV === "production" ? { maxAge: 31536e3 } : false
|
|
1472
1513
|
} = options;
|
|
1473
1514
|
const hstsValue = hsts !== false ? buildHstsValue(hsts) : null;
|
|
1515
|
+
const headers = [];
|
|
1516
|
+
if (frameOptions !== false) headers.push(["X-Frame-Options", frameOptions]);
|
|
1517
|
+
if (contentTypeOptions !== false) headers.push(["X-Content-Type-Options", contentTypeOptions]);
|
|
1518
|
+
if (xssProtection !== false) headers.push(["X-XSS-Protection", xssProtection]);
|
|
1519
|
+
if (referrerPolicy !== false) headers.push(["Referrer-Policy", referrerPolicy]);
|
|
1520
|
+
if (crossDomainPolicies !== false) {
|
|
1521
|
+
headers.push(["X-Permitted-Cross-Domain-Policies", crossDomainPolicies]);
|
|
1522
|
+
}
|
|
1523
|
+
if (hstsValue) headers.push(["Strict-Transport-Security", hstsValue]);
|
|
1474
1524
|
return async (ctx, next) => {
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
}
|
|
1478
|
-
|
|
1479
|
-
ctx.header("X-Content-Type-Options", contentTypeOptions);
|
|
1480
|
-
}
|
|
1481
|
-
if (xssProtection !== false) {
|
|
1482
|
-
ctx.header("X-XSS-Protection", xssProtection);
|
|
1483
|
-
}
|
|
1484
|
-
if (referrerPolicy !== false) {
|
|
1485
|
-
ctx.header("Referrer-Policy", referrerPolicy);
|
|
1486
|
-
}
|
|
1487
|
-
if (crossDomainPolicies !== false) {
|
|
1488
|
-
ctx.header("X-Permitted-Cross-Domain-Policies", crossDomainPolicies);
|
|
1489
|
-
}
|
|
1490
|
-
if (hstsValue) {
|
|
1491
|
-
ctx.header("Strict-Transport-Security", hstsValue);
|
|
1525
|
+
try {
|
|
1526
|
+
await next();
|
|
1527
|
+
} finally {
|
|
1528
|
+
applyResponseHeaders(ctx, headers);
|
|
1492
1529
|
}
|
|
1493
|
-
await next();
|
|
1494
1530
|
};
|
|
1495
1531
|
}
|
|
1496
1532
|
function buildHstsValue(options) {
|
|
@@ -1527,10 +1563,11 @@ function createCspMiddleware(options = {}) {
|
|
|
1527
1563
|
ctx.set(CSP_NONCE_KEY, nonce);
|
|
1528
1564
|
}
|
|
1529
1565
|
const headerValue = buildCspHeader(directives, nonce, reportUri);
|
|
1530
|
-
|
|
1531
|
-
|
|
1566
|
+
try {
|
|
1567
|
+
await next();
|
|
1568
|
+
} finally {
|
|
1569
|
+
if (headerValue) applyResponseHeaders(ctx, [[headerName, headerValue]]);
|
|
1532
1570
|
}
|
|
1533
|
-
await next();
|
|
1534
1571
|
};
|
|
1535
1572
|
}
|
|
1536
1573
|
function camelToKebab(str) {
|
|
@@ -1710,8 +1747,11 @@ function createForceHttpsMiddleware(options = {}) {
|
|
|
1710
1747
|
url2.protocol = "https:";
|
|
1711
1748
|
return ctx.redirect(url2.toString(), 301);
|
|
1712
1749
|
}
|
|
1713
|
-
|
|
1714
|
-
|
|
1750
|
+
try {
|
|
1751
|
+
await next();
|
|
1752
|
+
} finally {
|
|
1753
|
+
applyResponseHeaders(ctx, [["Strict-Transport-Security", hstsValue]]);
|
|
1754
|
+
}
|
|
1715
1755
|
};
|
|
1716
1756
|
}
|
|
1717
1757
|
|
|
@@ -1754,6 +1794,16 @@ import { createMiddleware as createMiddleware3 } from "hono/factory";
|
|
|
1754
1794
|
import { getCookie as getCookie2 } from "hono/cookie";
|
|
1755
1795
|
import { parseAccept } from "hono/utils/accept";
|
|
1756
1796
|
var LOCALE_CONTEXT_KEY = "locale";
|
|
1797
|
+
function getRequestLocale(c) {
|
|
1798
|
+
const locale = c.var?.[LOCALE_CONTEXT_KEY];
|
|
1799
|
+
return typeof locale === "string" && locale.length > 0 ? locale : void 0;
|
|
1800
|
+
}
|
|
1801
|
+
function getRequestTranslator(c) {
|
|
1802
|
+
const vars = c.var;
|
|
1803
|
+
const t2 = vars?.["t"];
|
|
1804
|
+
const tc2 = vars?.["tc"];
|
|
1805
|
+
return typeof t2 === "function" && typeof tc2 === "function" ? { t: t2, tc: tc2 } : void 0;
|
|
1806
|
+
}
|
|
1757
1807
|
var DEFAULT_SOURCES = ["query", "cookie", "header"];
|
|
1758
1808
|
function detectLocaleMiddleware(options) {
|
|
1759
1809
|
const supported = options.supported.map((locale) => locale.trim()).filter(Boolean);
|
|
@@ -1788,26 +1838,20 @@ function detectLocaleMiddleware(options) {
|
|
|
1788
1838
|
return void 0;
|
|
1789
1839
|
};
|
|
1790
1840
|
const translators = /* @__PURE__ */ new Map();
|
|
1791
|
-
const
|
|
1792
|
-
|
|
1793
|
-
return void 0;
|
|
1794
|
-
}
|
|
1841
|
+
const supportedSet = new Set(supported);
|
|
1842
|
+
const bindingFor = (locale, i18n) => {
|
|
1795
1843
|
const cached = translators.get(locale);
|
|
1796
1844
|
if (cached) {
|
|
1797
1845
|
return cached;
|
|
1798
1846
|
}
|
|
1799
|
-
const i18n = options.i18n ?? tryGlobalI18n();
|
|
1800
|
-
if (!i18n) {
|
|
1801
|
-
return void 0;
|
|
1802
|
-
}
|
|
1803
|
-
await i18n.loadLocale(locale).catch(() => {
|
|
1804
|
-
});
|
|
1805
1847
|
const translator = i18n.forLocale(locale);
|
|
1806
1848
|
const binding = {
|
|
1807
1849
|
t: translator.t.bind(translator),
|
|
1808
1850
|
tc: translator.tc.bind(translator)
|
|
1809
1851
|
};
|
|
1810
|
-
|
|
1852
|
+
if (supportedSet.has(locale) && i18n.isLocaleLoaded(locale)) {
|
|
1853
|
+
translators.set(locale, binding);
|
|
1854
|
+
}
|
|
1811
1855
|
return binding;
|
|
1812
1856
|
};
|
|
1813
1857
|
return createMiddleware3(async (c, next) => {
|
|
@@ -1825,21 +1869,17 @@ function detectLocaleMiddleware(options) {
|
|
|
1825
1869
|
}
|
|
1826
1870
|
}
|
|
1827
1871
|
c.set(LOCALE_CONTEXT_KEY, resolved);
|
|
1828
|
-
const
|
|
1829
|
-
if (
|
|
1830
|
-
|
|
1831
|
-
|
|
1872
|
+
const i18n = options.i18n === false ? void 0 : options.i18n ?? tryGetI18n();
|
|
1873
|
+
if (i18n) {
|
|
1874
|
+
await i18n.loadLocale(resolved).catch(() => {
|
|
1875
|
+
});
|
|
1876
|
+
const current = () => bindingFor(getRequestLocale(c) ?? resolved, i18n);
|
|
1877
|
+
c.set("t", (key, replacements) => current().t(key, replacements));
|
|
1878
|
+
c.set("tc", (key, count, replacements) => current().tc(key, count, replacements));
|
|
1832
1879
|
}
|
|
1833
1880
|
await next();
|
|
1834
1881
|
});
|
|
1835
1882
|
}
|
|
1836
|
-
function tryGlobalI18n() {
|
|
1837
|
-
try {
|
|
1838
|
-
return getI18n();
|
|
1839
|
-
} catch {
|
|
1840
|
-
return void 0;
|
|
1841
|
-
}
|
|
1842
|
-
}
|
|
1843
1883
|
|
|
1844
1884
|
// src/http/middleware/index.ts
|
|
1845
1885
|
function defineMiddleware(handler) {
|
|
@@ -2009,6 +2049,163 @@ var ErrorServiceProvider = class extends ServiceProvider {
|
|
|
2009
2049
|
}
|
|
2010
2050
|
};
|
|
2011
2051
|
|
|
2052
|
+
// src/mvc/inertia/shared.ts
|
|
2053
|
+
var INERTIA_SHARED_PROPS_BINDING = "inertia.sharedProps";
|
|
2054
|
+
var registrationSequence = 0;
|
|
2055
|
+
var SharedInertiaPropsRegistry = class {
|
|
2056
|
+
resolvers = [];
|
|
2057
|
+
/** Replace every resolver registered in this scope. */
|
|
2058
|
+
set(resolverFn) {
|
|
2059
|
+
this.resolvers = resolverFn ? [orderedResolver(resolverFn)] : [];
|
|
2060
|
+
}
|
|
2061
|
+
/**
|
|
2062
|
+
* Register additional shared props without replacing resolvers registered
|
|
2063
|
+
* earlier — the new resolver's props are merged over the previous ones.
|
|
2064
|
+
*/
|
|
2065
|
+
share(resolverFn) {
|
|
2066
|
+
this.resolvers.push(orderedResolver(resolverFn));
|
|
2067
|
+
}
|
|
2068
|
+
/** The resolvers registered in this scope, ordered by registration. */
|
|
2069
|
+
entries() {
|
|
2070
|
+
return this.resolvers;
|
|
2071
|
+
}
|
|
2072
|
+
/**
|
|
2073
|
+
* The scope's registrations composed into one resolver, or null when empty.
|
|
2074
|
+
* The composition is a snapshot: resolvers registered later are not picked up.
|
|
2075
|
+
*/
|
|
2076
|
+
get() {
|
|
2077
|
+
if (this.resolvers.length === 0) return null;
|
|
2078
|
+
if (this.resolvers.length === 1) return this.resolvers[0].resolve;
|
|
2079
|
+
const snapshot = [...this.resolvers];
|
|
2080
|
+
return (ctx) => applyResolvers(snapshot, ctx);
|
|
2081
|
+
}
|
|
2082
|
+
async resolve(ctx) {
|
|
2083
|
+
return applyResolvers(this.resolvers, ctx);
|
|
2084
|
+
}
|
|
2085
|
+
};
|
|
2086
|
+
function orderedResolver(resolverFn) {
|
|
2087
|
+
return {
|
|
2088
|
+
seq: registrationSequence++,
|
|
2089
|
+
resolve: resolverFn
|
|
2090
|
+
};
|
|
2091
|
+
}
|
|
2092
|
+
async function applyResolvers(entries, ctx) {
|
|
2093
|
+
const merged = {};
|
|
2094
|
+
for (const entry of entries) {
|
|
2095
|
+
const props = await entry.resolve(ctx);
|
|
2096
|
+
if (props && typeof props === "object") {
|
|
2097
|
+
Object.assign(merged, props);
|
|
2098
|
+
}
|
|
2099
|
+
}
|
|
2100
|
+
return merged;
|
|
2101
|
+
}
|
|
2102
|
+
var globalRegistry = new SharedInertiaPropsRegistry();
|
|
2103
|
+
function scopedRegistry(container) {
|
|
2104
|
+
if (!container?.has?.(INERTIA_SHARED_PROPS_BINDING)) return null;
|
|
2105
|
+
return container.make(INERTIA_SHARED_PROPS_BINDING);
|
|
2106
|
+
}
|
|
2107
|
+
function ensureSharedInertiaPropsRegistry(container) {
|
|
2108
|
+
const existing = scopedRegistry(container);
|
|
2109
|
+
if (existing) return existing;
|
|
2110
|
+
const registry = new SharedInertiaPropsRegistry();
|
|
2111
|
+
container.instance(INERTIA_SHARED_PROPS_BINDING, registry);
|
|
2112
|
+
return registry;
|
|
2113
|
+
}
|
|
2114
|
+
function setInertiaSharedProps(resolverFn) {
|
|
2115
|
+
globalRegistry.set(resolverFn);
|
|
2116
|
+
}
|
|
2117
|
+
function getInertiaSharedPropsResolver() {
|
|
2118
|
+
return globalRegistry.get();
|
|
2119
|
+
}
|
|
2120
|
+
function shareInertiaProps(resolverFn, container) {
|
|
2121
|
+
const registry = container ? ensureSharedInertiaPropsRegistry(container) : globalRegistry;
|
|
2122
|
+
registry.share(resolverFn);
|
|
2123
|
+
}
|
|
2124
|
+
async function resolveSharedInertiaProps(ctx, container) {
|
|
2125
|
+
const scoped = scopedRegistry(container);
|
|
2126
|
+
if (!scoped) return globalRegistry.resolve(ctx);
|
|
2127
|
+
const globalEntries = globalRegistry.entries();
|
|
2128
|
+
if (globalEntries.length === 0) return scoped.resolve(ctx);
|
|
2129
|
+
const ordered = [...globalEntries, ...scoped.entries()].sort((a, b) => a.seq - b.seq);
|
|
2130
|
+
return applyResolvers(ordered, ctx);
|
|
2131
|
+
}
|
|
2132
|
+
|
|
2133
|
+
// src/providers/I18nServiceProvider.ts
|
|
2134
|
+
var I18nServiceProvider = class extends ServiceProvider {
|
|
2135
|
+
register() {
|
|
2136
|
+
const app = this.application();
|
|
2137
|
+
const options = app?.i18nOptions;
|
|
2138
|
+
if (options) {
|
|
2139
|
+
if (options.supported.length === 0) {
|
|
2140
|
+
throw new Error("createApp({ i18n }) requires at least one supported locale.");
|
|
2141
|
+
}
|
|
2142
|
+
if (options.fallback && !options.supported.includes(options.fallback)) {
|
|
2143
|
+
throw new Error(
|
|
2144
|
+
`createApp({ i18n }): fallback locale '${options.fallback}' must be one of the supported locales (${options.supported.join(", ")}).`
|
|
2145
|
+
);
|
|
2146
|
+
}
|
|
2147
|
+
}
|
|
2148
|
+
this.container.singleton("i18n", () => {
|
|
2149
|
+
if (!options) {
|
|
2150
|
+
return createI18n({ locale: "en" });
|
|
2151
|
+
}
|
|
2152
|
+
const fallback = options.fallback ?? options.supported[0];
|
|
2153
|
+
return createI18n({
|
|
2154
|
+
locale: fallback,
|
|
2155
|
+
fallbackLocale: fallback,
|
|
2156
|
+
path: options.loader ? void 0 : options.path ?? "lang",
|
|
2157
|
+
loader: options.loader
|
|
2158
|
+
});
|
|
2159
|
+
});
|
|
2160
|
+
if (app && options && options.detect !== false) {
|
|
2161
|
+
const manager = this.container.make("i18n");
|
|
2162
|
+
app.use("*", detectLocaleMiddleware({
|
|
2163
|
+
...options.detect,
|
|
2164
|
+
supported: options.supported,
|
|
2165
|
+
fallback: manager.getLocale(),
|
|
2166
|
+
i18n: manager
|
|
2167
|
+
}));
|
|
2168
|
+
}
|
|
2169
|
+
}
|
|
2170
|
+
async boot() {
|
|
2171
|
+
const options = this.application()?.i18nOptions;
|
|
2172
|
+
if (!options) return;
|
|
2173
|
+
const manager = this.container.make("i18n");
|
|
2174
|
+
await manager.loadLocales([...options.supported]);
|
|
2175
|
+
for (const locale of options.supported) {
|
|
2176
|
+
if (Object.keys(manager.getMessages(locale)).length === 0) {
|
|
2177
|
+
console.warn(
|
|
2178
|
+
`[guren] i18n: no translations loaded for locale '${locale}'` + (options.loader ? "." : ` \u2014 expected ${options.path ?? "lang"}/${locale}/*.json.`)
|
|
2179
|
+
);
|
|
2180
|
+
}
|
|
2181
|
+
}
|
|
2182
|
+
if (options.share !== false) {
|
|
2183
|
+
const fallback = manager.getFallbackLocale() ?? manager.getLocale();
|
|
2184
|
+
const supported = new Set(options.supported);
|
|
2185
|
+
const propsByLocale = /* @__PURE__ */ new Map();
|
|
2186
|
+
shareInertiaProps((ctx) => {
|
|
2187
|
+
const locale = getRequestLocale(ctx) ?? fallback;
|
|
2188
|
+
let i18nProps = propsByLocale.get(locale);
|
|
2189
|
+
if (!i18nProps) {
|
|
2190
|
+
i18nProps = {
|
|
2191
|
+
locale,
|
|
2192
|
+
fallbackLocale: fallback,
|
|
2193
|
+
messages: manager.messagesForLocale(locale)
|
|
2194
|
+
};
|
|
2195
|
+
if (supported.has(locale)) {
|
|
2196
|
+
propsByLocale.set(locale, i18nProps);
|
|
2197
|
+
}
|
|
2198
|
+
}
|
|
2199
|
+
return { _i18n: i18nProps };
|
|
2200
|
+
}, this.container);
|
|
2201
|
+
}
|
|
2202
|
+
}
|
|
2203
|
+
/** The provider works standalone on a bare container (no `app` binding). */
|
|
2204
|
+
application() {
|
|
2205
|
+
return this.container.has("app") ? this.container.make("app") : void 0;
|
|
2206
|
+
}
|
|
2207
|
+
};
|
|
2208
|
+
|
|
2012
2209
|
// src/mvc/inertia/InertiaEngine.ts
|
|
2013
2210
|
import { isAbsolute, resolve as resolvePath } from "path";
|
|
2014
2211
|
import { pathToFileURL } from "url";
|
|
@@ -2317,31 +2514,6 @@ var ViewEngine = class {
|
|
|
2317
2514
|
}
|
|
2318
2515
|
};
|
|
2319
2516
|
|
|
2320
|
-
// src/mvc/inertia/shared.ts
|
|
2321
|
-
var resolver = null;
|
|
2322
|
-
function setInertiaSharedProps(resolverFn) {
|
|
2323
|
-
resolver = resolverFn;
|
|
2324
|
-
}
|
|
2325
|
-
function getInertiaSharedPropsResolver() {
|
|
2326
|
-
return resolver;
|
|
2327
|
-
}
|
|
2328
|
-
function shareInertiaProps(resolverFn) {
|
|
2329
|
-
const previous = resolver;
|
|
2330
|
-
resolver = async (ctx) => {
|
|
2331
|
-
const prev = previous ? await previous(ctx) : {};
|
|
2332
|
-
const next = await resolverFn(ctx);
|
|
2333
|
-
return { ...prev, ...next };
|
|
2334
|
-
};
|
|
2335
|
-
}
|
|
2336
|
-
async function resolveSharedInertiaProps(ctx) {
|
|
2337
|
-
if (!resolver) return {};
|
|
2338
|
-
const shared = await resolver(ctx);
|
|
2339
|
-
if (shared && typeof shared === "object") {
|
|
2340
|
-
return shared;
|
|
2341
|
-
}
|
|
2342
|
-
return {};
|
|
2343
|
-
}
|
|
2344
|
-
|
|
2345
2517
|
// src/providers/InertiaServiceProvider.ts
|
|
2346
2518
|
var InertiaServiceProvider = class extends ServiceProvider {
|
|
2347
2519
|
register() {
|
|
@@ -2391,19 +2563,16 @@ var InertiaServiceProvider = class extends ServiceProvider {
|
|
|
2391
2563
|
});
|
|
2392
2564
|
}
|
|
2393
2565
|
/**
|
|
2394
|
-
*
|
|
2566
|
+
* Auto-inject flashed `errors` into shared props. Scoped to this app's
|
|
2567
|
+
* container so a second Application booted in the same process keeps its
|
|
2568
|
+
* own registrations.
|
|
2395
2569
|
*/
|
|
2396
2570
|
registerSharedErrors() {
|
|
2397
|
-
|
|
2398
|
-
setInertiaSharedProps(async (ctx) => {
|
|
2399
|
-
const prev = previous ? await previous(ctx) : {};
|
|
2571
|
+
shareInertiaProps(async (ctx) => {
|
|
2400
2572
|
const session = getSessionFromContext(ctx);
|
|
2401
2573
|
const errors = session?.getFlash("errors");
|
|
2402
|
-
return {
|
|
2403
|
-
|
|
2404
|
-
...errors && Object.keys(errors).length > 0 ? { errors } : {}
|
|
2405
|
-
};
|
|
2406
|
-
});
|
|
2574
|
+
return errors && Object.keys(errors).length > 0 ? { errors } : {};
|
|
2575
|
+
}, this.container);
|
|
2407
2576
|
}
|
|
2408
2577
|
};
|
|
2409
2578
|
|
|
@@ -2481,6 +2650,7 @@ var Application = class {
|
|
|
2481
2650
|
this.router = new Router();
|
|
2482
2651
|
this.authManager = new AuthManager();
|
|
2483
2652
|
this.providerManager = new ProviderManager(this.container);
|
|
2653
|
+
this.mountSecurityDefaults();
|
|
2484
2654
|
this.container.instance("app", this);
|
|
2485
2655
|
this.container.instance("hono", this.hono);
|
|
2486
2656
|
this.container.instance("auth", this.authManager);
|
|
@@ -2508,19 +2678,17 @@ var Application = class {
|
|
|
2508
2678
|
...Array.isArray(this.options.providers) ? this.options.providers : [],
|
|
2509
2679
|
...moduleProviders
|
|
2510
2680
|
];
|
|
2511
|
-
const
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2681
|
+
const hasUserProviderOf = (base) => userProviders.some((provider) => provider === base || provider.prototype instanceof base);
|
|
2682
|
+
if (this.options.i18n && !hasUserProviderOf(I18nServiceProvider)) {
|
|
2683
|
+
this.providerManager.register(I18nServiceProvider);
|
|
2684
|
+
}
|
|
2685
|
+
if (!hasUserProviderOf(ErrorServiceProvider)) {
|
|
2515
2686
|
this.providerManager.register(ErrorServiceProvider);
|
|
2516
2687
|
}
|
|
2517
2688
|
if (userProviders.length > 0) {
|
|
2518
2689
|
this.providerManager.registerMany(userProviders);
|
|
2519
2690
|
}
|
|
2520
|
-
|
|
2521
|
-
(provider) => provider === InertiaServiceProvider || provider.prototype instanceof InertiaServiceProvider
|
|
2522
|
-
);
|
|
2523
|
-
if (!hasUserInertiaProvider) {
|
|
2691
|
+
if (!hasUserProviderOf(InertiaServiceProvider)) {
|
|
2524
2692
|
this.providerManager.register(InertiaServiceProvider);
|
|
2525
2693
|
}
|
|
2526
2694
|
}
|
|
@@ -2536,12 +2704,16 @@ var Application = class {
|
|
|
2536
2704
|
bunTeardownRegistered = false;
|
|
2537
2705
|
autoSessionAttached = false;
|
|
2538
2706
|
routesRegistered = false;
|
|
2707
|
+
bootPromise;
|
|
2539
2708
|
get auth() {
|
|
2540
2709
|
return this.authManager;
|
|
2541
2710
|
}
|
|
2542
2711
|
get authOptions() {
|
|
2543
2712
|
return this.options.auth;
|
|
2544
2713
|
}
|
|
2714
|
+
get i18nOptions() {
|
|
2715
|
+
return this.options.i18n;
|
|
2716
|
+
}
|
|
2545
2717
|
markAutoSessionAttached() {
|
|
2546
2718
|
this.autoSessionAttached = true;
|
|
2547
2719
|
}
|
|
@@ -2571,26 +2743,44 @@ var Application = class {
|
|
|
2571
2743
|
}
|
|
2572
2744
|
/**
|
|
2573
2745
|
* Executes provider registration, boot callback, mounts routes, and boots providers.
|
|
2746
|
+
*
|
|
2747
|
+
* Booting twice is a no-op: the first call's promise is reused, so providers
|
|
2748
|
+
* and routes are never mounted a second time — including when two callers
|
|
2749
|
+
* boot concurrently, before the first has finished. A boot that throws is not
|
|
2750
|
+
* remembered, so a later call attempts boot again (it resumes on a partially
|
|
2751
|
+
* mounted app rather than starting clean). The security defaults are mounted
|
|
2752
|
+
* by the constructor and so are outside this entirely.
|
|
2574
2753
|
*/
|
|
2575
2754
|
async boot() {
|
|
2576
|
-
this.
|
|
2755
|
+
this.bootPromise ??= this.bootOnce();
|
|
2756
|
+
try {
|
|
2757
|
+
await this.bootPromise;
|
|
2758
|
+
} catch (error) {
|
|
2759
|
+
this.bootPromise = void 0;
|
|
2760
|
+
throw error;
|
|
2761
|
+
}
|
|
2762
|
+
}
|
|
2763
|
+
async bootOnce() {
|
|
2577
2764
|
await this.providerManager.registerAll();
|
|
2578
2765
|
await this.options.boot?.(this.hono);
|
|
2579
2766
|
await this.mountRoutes();
|
|
2580
2767
|
await this.mountDevEndpoint(
|
|
2581
2768
|
isMcpEndpointEnabled(),
|
|
2582
|
-
async () => (await import("./McpServiceProvider-
|
|
2769
|
+
async () => (await import("./McpServiceProvider-FRJ5O7LT.js")).McpServiceProvider,
|
|
2583
2770
|
"GUREN_MCP=1 but the MCP endpoint could not load \u2014 is @modelcontextprotocol/sdk installed?"
|
|
2584
2771
|
);
|
|
2585
2772
|
await this.mountDevEndpoint(
|
|
2586
2773
|
isDocsViewerEnabled(),
|
|
2587
|
-
async () => (await import("./DocsViewerServiceProvider-
|
|
2774
|
+
async () => (await import("./DocsViewerServiceProvider-RUYDFBMW.js")).DocsViewerServiceProvider,
|
|
2588
2775
|
"GUREN_DOCS=1 but the docs viewer could not load \u2014 is @guren/cli resolvable from this app?"
|
|
2589
2776
|
);
|
|
2590
2777
|
await this.providerManager.bootAll();
|
|
2591
2778
|
}
|
|
2592
2779
|
/**
|
|
2593
2780
|
* Registers default security middleware (headers + host authorization).
|
|
2781
|
+
*
|
|
2782
|
+
* Called once, from the constructor — see the note there for why it does
|
|
2783
|
+
* not belong in boot().
|
|
2594
2784
|
*/
|
|
2595
2785
|
mountSecurityDefaults() {
|
|
2596
2786
|
const { securityHeaders } = this.options;
|
|
@@ -2653,7 +2843,7 @@ var Application = class {
|
|
|
2653
2843
|
const { server: server2, localUrl } = await startViteDevServer({
|
|
2654
2844
|
root: viteOptions?.root ?? process.cwd(),
|
|
2655
2845
|
config: viteOptions?.config,
|
|
2656
|
-
host: viteOptions?.host
|
|
2846
|
+
host: viteOptions?.host,
|
|
2657
2847
|
port: viteOptions?.port
|
|
2658
2848
|
});
|
|
2659
2849
|
this.viteDevServer = server2;
|
|
@@ -2930,11 +3120,13 @@ var Controller = class {
|
|
|
2930
3120
|
const { url: overrideUrl, ...rest } = options;
|
|
2931
3121
|
const url2 = overrideUrl ?? ctx.req.path ?? ctx.req.url ?? "";
|
|
2932
3122
|
const component = typeof componentOrPage === "string" ? componentOrPage : componentOrPage.component ?? componentOrPage.id;
|
|
2933
|
-
const sharedProps = await resolveSharedInertiaProps(ctx);
|
|
3123
|
+
const sharedProps = await resolveSharedInertiaProps(ctx, this._container);
|
|
2934
3124
|
const propsWithShared = { ...sharedProps, ...props };
|
|
2935
3125
|
const response = await inertia(component, propsWithShared, {
|
|
2936
3126
|
...rest,
|
|
2937
|
-
|
|
3127
|
+
// No 'en' fallback here (unlike the locale getter): unconfigured apps
|
|
3128
|
+
// keep the Inertia engine's own default lang.
|
|
3129
|
+
lang: rest.lang ?? this.#resolveLocale(),
|
|
2938
3130
|
url: url2,
|
|
2939
3131
|
request: ctx.req.raw
|
|
2940
3132
|
});
|
|
@@ -2945,29 +3137,65 @@ var Controller = class {
|
|
|
2945
3137
|
return response;
|
|
2946
3138
|
}
|
|
2947
3139
|
/**
|
|
2948
|
-
*
|
|
2949
|
-
*
|
|
2950
|
-
*
|
|
2951
|
-
*
|
|
3140
|
+
* Locale resolved for the current request: the request-scoped `locale`
|
|
3141
|
+
* context variable (set by locale middleware) wins over the app-wide i18n
|
|
3142
|
+
* locale (the router-injected container binding, then the `setI18n()`
|
|
3143
|
+
* global). Falls back to `'en'` when no i18n is configured.
|
|
3144
|
+
*/
|
|
3145
|
+
get locale() {
|
|
3146
|
+
return this.#resolveLocale() ?? "en";
|
|
3147
|
+
}
|
|
3148
|
+
/**
|
|
3149
|
+
* Translate a key for the current request locale.
|
|
3150
|
+
*
|
|
3151
|
+
* Uses the request-scoped translator bound by the locale detection
|
|
3152
|
+
* middleware when present, falling back to a translator scoped to
|
|
3153
|
+
* `this.locale` from the container's `i18n` binding (then the `setI18n()`
|
|
3154
|
+
* global).
|
|
3155
|
+
*
|
|
3156
|
+
* @example
|
|
3157
|
+
* ```typescript
|
|
3158
|
+
* this.t('posts.created')
|
|
3159
|
+
* this.t('posts.greeting', { name: user.name })
|
|
3160
|
+
* ```
|
|
2952
3161
|
*/
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
3162
|
+
t(key, replacements) {
|
|
3163
|
+
return this.#requestTranslator().t(key, replacements);
|
|
3164
|
+
}
|
|
3165
|
+
/**
|
|
3166
|
+
* Translate a key with a count for pluralization, using the same locale
|
|
3167
|
+
* resolution as {@link Controller.t}.
|
|
3168
|
+
*/
|
|
3169
|
+
tc(key, count, replacements) {
|
|
3170
|
+
return this.#requestTranslator().tc(key, count, replacements);
|
|
3171
|
+
}
|
|
3172
|
+
#requestTranslator() {
|
|
3173
|
+
const bound = getRequestTranslator(this.ctx);
|
|
3174
|
+
if (bound) {
|
|
3175
|
+
return bound;
|
|
3176
|
+
}
|
|
3177
|
+
const i18n = this.#resolveI18n();
|
|
3178
|
+
if (!i18n) {
|
|
3179
|
+
throw new Error(
|
|
3180
|
+
"Controller i18n helpers require i18n to be configured. Pass createApp({ i18n }) or register an I18nManager."
|
|
3181
|
+
);
|
|
3182
|
+
}
|
|
3183
|
+
const locale = getRequestLocale(this.ctx);
|
|
3184
|
+
return locale && locale !== i18n.getLocale() ? i18n.forLocale(locale) : i18n;
|
|
3185
|
+
}
|
|
3186
|
+
#resolveLocale() {
|
|
3187
|
+
const requestLocale = getRequestLocale(this.ctx);
|
|
3188
|
+
if (requestLocale) {
|
|
2957
3189
|
return requestLocale;
|
|
2958
3190
|
}
|
|
2959
|
-
|
|
3191
|
+
const locale = this.#resolveI18n()?.getLocale();
|
|
3192
|
+
return typeof locale === "string" && locale.length > 0 ? locale : void 0;
|
|
3193
|
+
}
|
|
3194
|
+
#resolveI18n() {
|
|
2960
3195
|
if (this._container?.has?.("i18n")) {
|
|
2961
|
-
|
|
2962
|
-
} else {
|
|
2963
|
-
try {
|
|
2964
|
-
i18n = getI18n();
|
|
2965
|
-
} catch {
|
|
2966
|
-
i18n = void 0;
|
|
2967
|
-
}
|
|
3196
|
+
return this._container.make("i18n");
|
|
2968
3197
|
}
|
|
2969
|
-
|
|
2970
|
-
return typeof locale === "string" && locale.length > 0 ? locale : void 0;
|
|
3198
|
+
return tryGetI18n();
|
|
2971
3199
|
}
|
|
2972
3200
|
json(data, init = {}) {
|
|
2973
3201
|
return new Response(JSON.stringify(data), {
|
|
@@ -3239,13 +3467,6 @@ var LogServiceProvider = class extends ServiceProvider {
|
|
|
3239
3467
|
}
|
|
3240
3468
|
};
|
|
3241
3469
|
|
|
3242
|
-
// src/providers/I18nServiceProvider.ts
|
|
3243
|
-
var I18nServiceProvider = class extends ServiceProvider {
|
|
3244
|
-
register() {
|
|
3245
|
-
this.container.singleton("i18n", () => createI18n({ locale: "en" }));
|
|
3246
|
-
}
|
|
3247
|
-
};
|
|
3248
|
-
|
|
3249
3470
|
// src/providers/NotificationServiceProvider.ts
|
|
3250
3471
|
var NotificationServiceProvider = class extends ServiceProvider {
|
|
3251
3472
|
register() {
|
|
@@ -6833,6 +7054,7 @@ export {
|
|
|
6833
7054
|
Notification,
|
|
6834
7055
|
NotificationManager,
|
|
6835
7056
|
NotificationServiceProvider,
|
|
7057
|
+
OAUTH_SESSION_BINDING_KEY,
|
|
6836
7058
|
OAuthManager,
|
|
6837
7059
|
OAuthServiceProvider,
|
|
6838
7060
|
Output,
|
|
@@ -7013,6 +7235,8 @@ export {
|
|
|
7013
7235
|
getQueueDriver,
|
|
7014
7236
|
getRateLimitInfo,
|
|
7015
7237
|
getRegisteredJobs,
|
|
7238
|
+
getRequestLocale,
|
|
7239
|
+
getRequestTranslator,
|
|
7016
7240
|
getSessionFromContext,
|
|
7017
7241
|
getUserApiTokens,
|
|
7018
7242
|
getValidatedData,
|
|
@@ -7122,6 +7346,7 @@ export {
|
|
|
7122
7346
|
tokenCan,
|
|
7123
7347
|
tokenCanAll,
|
|
7124
7348
|
tokenCanAny,
|
|
7349
|
+
tryGetI18n,
|
|
7125
7350
|
unique,
|
|
7126
7351
|
url as urlRule,
|
|
7127
7352
|
urlSafeToken,
|