stratal 0.0.18 → 0.0.19
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/README.md +8 -8
- package/dist/{base-email.provider-Cuw4OAB0.mjs → base-email.provider-mjynzewK.mjs} +1 -1
- package/dist/{base-email.provider-Cuw4OAB0.mjs.map → base-email.provider-mjynzewK.mjs.map} +1 -1
- package/dist/bin/cloudflare-workers-loader.mjs.map +1 -1
- package/dist/bin/quarry.mjs +21 -36
- package/dist/bin/quarry.mjs.map +1 -1
- package/dist/cache/index.d.mts +3 -2
- package/dist/cache/index.d.mts.map +1 -1
- package/dist/cache/index.mjs +3 -3
- package/dist/{colors-BTAnQRGU.mjs → colors-DJaRDXoS.mjs} +1 -1
- package/dist/{colors-BTAnQRGU.mjs.map → colors-DJaRDXoS.mjs.map} +1 -1
- package/dist/{command-DjGqCYHv.mjs → command-BgSlsS4M.mjs} +2 -2
- package/dist/{command-DjGqCYHv.mjs.map → command-BgSlsS4M.mjs.map} +1 -1
- package/dist/{command-B1YuV-UZ.d.mts → command-DsQq56Lp.d.mts} +2 -2
- package/dist/{command-B1YuV-UZ.d.mts.map → command-DsQq56Lp.d.mts.map} +1 -1
- package/dist/config/index.d.mts +81 -37
- package/dist/config/index.d.mts.map +1 -1
- package/dist/config/index.mjs +126 -45
- package/dist/config/index.mjs.map +1 -1
- package/dist/{consumer-registry-BkuHXR_u.d.mts → consumer-registry-Doom7BEh.d.mts} +1 -1
- package/dist/{consumer-registry-BkuHXR_u.d.mts.map → consumer-registry-Doom7BEh.d.mts.map} +1 -1
- package/dist/controller.decorator-LZY9aHYG.mjs +66 -0
- package/dist/controller.decorator-LZY9aHYG.mjs.map +1 -0
- package/dist/cron/index.d.mts +4 -3
- package/dist/cron/index.d.mts.map +1 -1
- package/dist/cron/index.mjs +1 -1
- package/dist/{cron-manager-1KnZvojs.mjs → cron-manager-C30t9UZM.mjs} +29 -19
- package/dist/cron-manager-C30t9UZM.mjs.map +1 -0
- package/dist/{cron-manager-BnEZquBL.d.mts → cron-manager-RuPtFVLy.d.mts} +27 -13
- package/dist/cron-manager-RuPtFVLy.d.mts.map +1 -0
- package/dist/di/index.d.mts +1 -1
- package/dist/di/index.mjs +2 -2
- package/dist/email/index.d.mts +3 -3
- package/dist/email/index.mjs +87 -10
- package/dist/email/index.mjs.map +1 -1
- package/dist/{en-3QnZwP-u.mjs → en-rHmW6vD9.mjs} +5 -31
- package/dist/en-rHmW6vD9.mjs.map +1 -0
- package/dist/env-CamWD-U1.d.mts +25 -0
- package/dist/env-CamWD-U1.d.mts.map +1 -0
- package/dist/errors/index.d.mts +1 -1
- package/dist/errors/index.mjs +1 -1
- package/dist/{errors--RBIvDXr.mjs → errors-B4pYgYON.mjs} +161 -7
- package/dist/errors-B4pYgYON.mjs.map +1 -0
- package/dist/{errors-B7hCnXgB.mjs → errors-BUyUfr2Z.mjs} +14 -7
- package/dist/errors-BUyUfr2Z.mjs.map +1 -0
- package/dist/events/index.d.mts +2 -2
- package/dist/events/index.mjs +1 -1
- package/dist/{events-UTJliZhl.mjs → events-COKixqnG.mjs} +2 -2
- package/dist/{events-UTJliZhl.mjs.map → events-COKixqnG.mjs.map} +1 -1
- package/dist/{gateway-context-BdBFoQd8.mjs → gateway-context-cqZ8wMoi.mjs} +4 -65
- package/dist/gateway-context-cqZ8wMoi.mjs.map +1 -0
- package/dist/guards/index.d.mts +14 -5
- package/dist/guards/index.d.mts.map +1 -1
- package/dist/guards/index.mjs +1 -1
- package/dist/{guards-MtDgcHnF.mjs → guards-DMbsAxSX.mjs} +1 -1
- package/dist/guards-DMbsAxSX.mjs.map +1 -0
- package/dist/http-method.decorator-BT3ufnz8.mjs +96 -0
- package/dist/http-method.decorator-BT3ufnz8.mjs.map +1 -0
- package/dist/i18n/index.d.mts +3 -3
- package/dist/i18n/index.mjs +2 -2
- package/dist/i18n/messages/en/index.d.mts +1 -1
- package/dist/i18n/messages/en/index.mjs +1 -1
- package/dist/i18n/utils/index.mjs +1 -1
- package/dist/i18n/validation/index.d.mts +1 -1
- package/dist/i18n/validation/index.mjs +1 -1
- package/dist/{i18n.module-BpLLLCTg.mjs → i18n.module-CI_prYFD.mjs} +74 -196
- package/dist/i18n.module-CI_prYFD.mjs.map +1 -0
- package/dist/{index-Dfpd_ypO.d.mts → index-B437eK7p.d.mts} +26 -12
- package/dist/index-B437eK7p.d.mts.map +1 -0
- package/dist/{index-BR23zDMy.d.mts → index-CWRS7Ri3.d.mts} +1 -1
- package/dist/{index-BR23zDMy.d.mts.map → index-CWRS7Ri3.d.mts.map} +1 -1
- package/dist/{index-BDh9J2KD.d.mts → index-DFhEeFfC.d.mts} +4 -30
- package/dist/{index-BDh9J2KD.d.mts.map → index-DFhEeFfC.d.mts.map} +1 -1
- package/dist/{index-BrmS34sa.d.mts → index-DPFqRs8L.d.mts} +70 -39
- package/dist/index-DPFqRs8L.d.mts.map +1 -0
- package/dist/{index-DPxmo6AY.d.mts → index-Dnqm9ZB6.d.mts} +5 -4
- package/dist/index-Dnqm9ZB6.d.mts.map +1 -0
- package/dist/index-SHx31sBJ.d.mts +101 -0
- package/dist/index-SHx31sBJ.d.mts.map +1 -0
- package/dist/index.d.mts +3 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{is-command-PvULqiTa.mjs → is-command-C6a7WTPw.mjs} +2 -2
- package/dist/{is-command-PvULqiTa.mjs.map → is-command-C6a7WTPw.mjs.map} +1 -1
- package/dist/{is-seeder-BN9Ej1r7.mjs → is-seeder-CebjZCDn.mjs} +1 -1
- package/dist/{is-seeder-BN9Ej1r7.mjs.map → is-seeder-CebjZCDn.mjs.map} +1 -1
- package/dist/logger/index.d.mts +1 -1
- package/dist/logger/index.mjs +1 -1
- package/dist/{logger-c0ftIK4G.mjs → logger-V6Ms3QnQ.mjs} +38 -20
- package/dist/{logger-c0ftIK4G.mjs.map → logger-V6Ms3QnQ.mjs.map} +1 -1
- package/dist/macroable/index.d.mts +2 -0
- package/dist/macroable/index.mjs +2 -0
- package/dist/macroable-BmufBshB.mjs +122 -0
- package/dist/macroable-BmufBshB.mjs.map +1 -0
- package/dist/module/index.d.mts +2 -2
- package/dist/module/index.mjs +1 -1
- package/dist/{module-C3YZ-kZN.mjs → module-qGE_1duv.mjs} +31 -18
- package/dist/module-qGE_1duv.mjs.map +1 -0
- package/dist/openapi/index.d.mts +3 -3
- package/dist/openapi/index.mjs +2 -2
- package/dist/{openapi-tools.service-B77QXD56.mjs → openapi-tools.service-CYWGuhue.mjs} +4 -1
- package/dist/{openapi-tools.service-B77QXD56.mjs.map → openapi-tools.service-CYWGuhue.mjs.map} +1 -1
- package/dist/{openapi.service-6yj0BUY4.d.mts → openapi.service-Bv_NioM9.d.mts} +3 -3
- package/dist/{openapi.service-6yj0BUY4.d.mts.map → openapi.service-Bv_NioM9.d.mts.map} +1 -1
- package/dist/quarry/index.d.mts +7 -7
- package/dist/quarry/index.d.mts.map +1 -1
- package/dist/quarry/index.mjs +4 -4
- package/dist/{quarry-registry-CQCIlYTO.mjs → quarry-registry-DFfRRkA7.mjs} +17 -15
- package/dist/quarry-registry-DFfRRkA7.mjs.map +1 -0
- package/dist/queue/index.d.mts +2 -2
- package/dist/queue/index.mjs +2 -2
- package/dist/{queue.module-DIjD6nr-.mjs → queue.module-P-G-nCYz.mjs} +4 -4
- package/dist/{queue.module-DIjD6nr-.mjs.map → queue.module-P-G-nCYz.mjs.map} +1 -1
- package/dist/r2-storage.provider-LdzK9tfG.mjs +244 -0
- package/dist/r2-storage.provider-LdzK9tfG.mjs.map +1 -0
- package/dist/{resend.provider-Bvw36rQy.mjs → resend.provider-bwILp0WI.mjs} +2 -2
- package/dist/{resend.provider-Bvw36rQy.mjs.map → resend.provider-bwILp0WI.mjs.map} +1 -1
- package/dist/router/index.d.mts +2 -2
- package/dist/router/index.mjs +7 -5
- package/dist/seeder/index.d.mts +3 -3
- package/dist/seeder/index.mjs +2 -2
- package/dist/{seeder-D7VXULXB.mjs → seeder-BcqIFa2X.mjs} +5 -5
- package/dist/{seeder-D7VXULXB.mjs.map → seeder-BcqIFa2X.mjs.map} +1 -1
- package/dist/{setup-BRIN-iYT.mjs → setup-CtekcwuO.mjs} +1 -1
- package/dist/{setup-BRIN-iYT.mjs.map → setup-CtekcwuO.mjs.map} +1 -1
- package/dist/signed-url-COX7cCWR.mjs +74 -0
- package/dist/signed-url-COX7cCWR.mjs.map +1 -0
- package/dist/{smtp.provider-CAwpvzvD.mjs → smtp.provider-B07yuARi.mjs} +2 -2
- package/dist/{smtp.provider-CAwpvzvD.mjs.map → smtp.provider-B07yuARi.mjs.map} +1 -1
- package/dist/storage/index.d.mts +39 -17
- package/dist/storage/index.d.mts.map +1 -1
- package/dist/storage/index.mjs +3 -3
- package/dist/storage/providers/index.d.mts +30 -70
- package/dist/storage/providers/index.d.mts.map +1 -1
- package/dist/storage/providers/index.mjs +2 -2
- package/dist/{storage-CJ-QOwNv.mjs → storage-P6X4h9So.mjs} +101 -27
- package/dist/storage-P6X4h9So.mjs.map +1 -0
- package/dist/{storage-provider.interface-YRtyYBxV.d.mts → storage-provider.interface-CC1nniHk.d.mts} +20 -21
- package/dist/storage-provider.interface-CC1nniHk.d.mts.map +1 -0
- package/dist/{stratal-B7G4i9-N.mjs → stratal-BCiwCFN9.mjs} +57 -26
- package/dist/stratal-BCiwCFN9.mjs.map +1 -0
- package/dist/{types-CN0zONAZ.d.mts → types-DIWemRad.d.mts} +1 -1
- package/dist/types-DIWemRad.d.mts.map +1 -0
- package/dist/{usage-generator-Cl1HPlUp.mjs → usage-generator-MBcRo0Q2.mjs} +2 -2
- package/dist/{usage-generator-Cl1HPlUp.mjs.map → usage-generator-MBcRo0Q2.mjs.map} +1 -1
- package/dist/{validation-B4bePOa_.mjs → validation-Dbg3ehdP.mjs} +1 -1
- package/dist/{validation-B4bePOa_.mjs.map → validation-Dbg3ehdP.mjs.map} +1 -1
- package/dist/websocket/index.d.mts +3 -3
- package/dist/websocket/index.mjs +1 -1
- package/dist/workers/index.d.mts +2 -1
- package/dist/workers/index.d.mts.map +1 -1
- package/dist/workers/index.mjs +2 -2
- package/package.json +27 -39
- package/dist/cron-manager-1KnZvojs.mjs.map +0 -1
- package/dist/cron-manager-BnEZquBL.d.mts.map +0 -1
- package/dist/en-3QnZwP-u.mjs.map +0 -1
- package/dist/errors--RBIvDXr.mjs.map +0 -1
- package/dist/errors-B7hCnXgB.mjs.map +0 -1
- package/dist/gateway-context-BdBFoQd8.mjs.map +0 -1
- package/dist/guards-MtDgcHnF.mjs.map +0 -1
- package/dist/i18n.module-BpLLLCTg.mjs.map +0 -1
- package/dist/index-BrmS34sa.d.mts.map +0 -1
- package/dist/index-DPxmo6AY.d.mts.map +0 -1
- package/dist/index-Dfpd_ypO.d.mts.map +0 -1
- package/dist/module-C3YZ-kZN.mjs.map +0 -1
- package/dist/quarry-registry-CQCIlYTO.mjs.map +0 -1
- package/dist/s3-storage.provider-BAhHDMI3.mjs +0 -343
- package/dist/s3-storage.provider-BAhHDMI3.mjs.map +0 -1
- package/dist/storage-CJ-QOwNv.mjs.map +0 -1
- package/dist/storage-provider.interface-YRtyYBxV.d.mts.map +0 -1
- package/dist/stratal-B7G4i9-N.mjs.map +0 -1
- package/dist/types-CN0zONAZ.d.mts.map +0 -1
|
@@ -38,6 +38,7 @@ const errors = {
|
|
|
38
38
|
routeNameNotFound: "Route \"{name}\" not found in registry.",
|
|
39
39
|
missingRouteParam: "Missing required parameter \"{param}\" for route \"{name}\" (path: {path}).",
|
|
40
40
|
routerUseScopeViolation: "router.use() can only be called on the root Router, not inside group() callbacks. Use router.middleware() for scoped middleware.",
|
|
41
|
+
middlewareNextCalledMultipleTimes: "next() was called multiple times in \"{middlewareName}\" middleware. Ensure each middleware calls next() at most once.",
|
|
41
42
|
missingEnvironmentVariable: "Environment variable \"{variable}\" is required but not set.",
|
|
42
43
|
websocketBodyNotAvailable: "body() is not available in WebSocket gateways. Use WebSocket messages instead.",
|
|
43
44
|
websocketDuplicateEventHandler: "@{decorator}() is already applied to '{existingMethod}'. Only one method per gateway can handle this event.",
|
|
@@ -95,8 +96,9 @@ const errors = {
|
|
|
95
96
|
fileTooLarge: "File size {size} exceeds maximum allowed size of {maxSize}",
|
|
96
97
|
presignedUrlInvalidExpiry: "Expiry must be between {min} and {max} seconds",
|
|
97
98
|
diskNotConfigured: "Disk \"{disk}\" is not configured",
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
responseBodyMissing: "No body in storage response for path: {path}",
|
|
100
|
+
r2BindingNotFound: "R2 binding \"{binding}\" was not found in the environment",
|
|
101
|
+
r2PresignedUrlSecretMissing: "APP_SECRET environment variable is required for presigned URLs"
|
|
100
102
|
},
|
|
101
103
|
cache: {
|
|
102
104
|
getFailed: "Failed to retrieve value from cache for key '{key}'",
|
|
@@ -104,34 +106,6 @@ const errors = {
|
|
|
104
106
|
deleteFailed: "Failed to delete value from cache for key '{key}'",
|
|
105
107
|
listFailed: "Failed to list cache keys"
|
|
106
108
|
},
|
|
107
|
-
auth: {
|
|
108
|
-
tokenRequired: "Verification token is required",
|
|
109
|
-
invalidToken: "Invalid or expired verification token",
|
|
110
|
-
verificationFailed: "Verification failed. Please try again.",
|
|
111
|
-
userNotFound: "User not found. Please check your credentials.",
|
|
112
|
-
invalidCredentials: "Invalid email or password",
|
|
113
|
-
invalidPassword: "Invalid password",
|
|
114
|
-
invalidEmail: "Invalid email address",
|
|
115
|
-
sessionExpired: "Your session has expired. Please sign in again.",
|
|
116
|
-
emailNotVerified: "Please verify your email address before signing in",
|
|
117
|
-
passwordTooShort: "Password must be at least {minLength} characters",
|
|
118
|
-
passwordTooLong: "Password must be at most {maxLength} characters",
|
|
119
|
-
accountAlreadyExists: "An account with this email already exists",
|
|
120
|
-
failedToCreateUser: "Failed to create user account. Please try again.",
|
|
121
|
-
failedToCreateSession: "Failed to create session. Please try again.",
|
|
122
|
-
failedToGetSession: "Failed to retrieve session. Please try again.",
|
|
123
|
-
failedToUpdateUser: "Failed to update user information. Please try again.",
|
|
124
|
-
failedToGetUserInfo: "Failed to retrieve user information. Please try again.",
|
|
125
|
-
socialAccountLinked: "This social account is already linked to another user",
|
|
126
|
-
providerNotFound: "Authentication provider not found",
|
|
127
|
-
userEmailNotFound: "User email address not found",
|
|
128
|
-
accountNotFound: "Account not found",
|
|
129
|
-
credentialAccountNotFound: "Credential account not found",
|
|
130
|
-
cannotUnlinkLastAccount: "Cannot unlink your last account",
|
|
131
|
-
userAlreadyHasPassword: "User already has a password set",
|
|
132
|
-
emailCannotBeUpdated: "Email address cannot be updated at this time",
|
|
133
|
-
tokenExpired: "The verification token has expired. Please request a new verification email."
|
|
134
|
-
},
|
|
135
109
|
seederNameCollision: "Seeder name collision: \"{name}\" is already registered. Use distinct class names for each seeder.",
|
|
136
110
|
seederNotRegistered: "Seeder \"{name}\" is not registered",
|
|
137
111
|
migration: {
|
|
@@ -325,4 +299,4 @@ var en_exports = /* @__PURE__ */ __exportAll({
|
|
|
325
299
|
//#endregion
|
|
326
300
|
export { errors as a, emails as i, zodI18n as n, common as o, validation as r, en_exports as t };
|
|
327
301
|
|
|
328
|
-
//# sourceMappingURL=en-
|
|
302
|
+
//# sourceMappingURL=en-rHmW6vD9.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en-rHmW6vD9.mjs","names":[],"sources":["../src/i18n/messages/en/common.ts","../src/i18n/messages/en/errors.ts","../src/i18n/messages/en/emails.ts","../src/i18n/messages/en/validation.ts","../src/i18n/messages/en/zod.ts","../src/i18n/messages/en/index.ts"],"sourcesContent":["/**\n * System Common Messages - English\n *\n * Common messages used by packages/modules infrastructure.\n * These are automatically merged with application-specific messages.\n */\n\nexport const common = {\n api: {\n title: 'Stratal API',\n description: 'Platform API',\n serverDescription: 'API server',\n security: {\n bearerAuth: 'JWT Bearer token authentication',\n apiKey: 'API key for service authentication',\n sessionCookie: 'Session cookie for browser authentication'\n }\n }\n} as const\n","/**\n * System Error Messages - English\n *\n * Error messages used by packages/modules infrastructure.\n * These are automatically merged with application-specific messages.\n */\n\nexport const errors = {\n // Generic errors\n internalError: 'An internal error occurred',\n notFound: 'Resource not found',\n unauthorized: 'Unauthorized. Please sign in.',\n forbidden: 'Access denied',\n\n // Router errors\n honoAppAlreadyConfigured: 'HonoApp has already been configured and can only be configured once',\n routeNotFound: 'Route not found: {method} {path}',\n routeAccessDenied: 'Resource not found',\n controllerMethodNotFound: 'Method {methodName} not found on {controllerName}',\n controllerRegistration: 'Failed to register controller {controllerName}: {reason}',\n duplicateRouteName: 'Duplicate route name \"{name}\". Already registered by {existingHandler}, cannot register {newHandler}.',\n routeNameNotFound: 'Route \"{name}\" not found in registry.',\n missingRouteParam: 'Missing required parameter \"{param}\" for route \"{name}\" (path: {path}).',\n routerUseScopeViolation: 'router.use() can only be called on the root Router, not inside group() callbacks. Use router.middleware() for scoped middleware.',\n middlewareNextCalledMultipleTimes: 'next() was called multiple times in \"{middlewareName}\" middleware. Ensure each middleware calls next() at most once.',\n missingEnvironmentVariable: 'Environment variable \"{variable}\" is required but not set.',\n\n // WebSocket errors\n websocketBodyNotAvailable: 'body() is not available in WebSocket gateways. Use WebSocket messages instead.',\n websocketDuplicateEventHandler: '@{decorator}() is already applied to \\'{existingMethod}\\'. Only one method per gateway can handle this event.',\n\n // Context errors\n contextNotInitialized: 'Context has not been initialized',\n userNotAuthenticated: 'User is not authenticated',\n insufficientPermissions: 'Insufficient permissions to perform this action',\n requestContainerNotInitialized: 'Request container has not been initialized',\n requestScopeOperationNotAllowed: '{methodName}() cannot be called on this container scope. Check if you are calling it on the correct container (global vs request-scoped).',\n conditionalBindingFallback: 'Conditional binding predicate returned false for token \"{token}\" but no fallback was provided and no existing registration exists.',\n\n // Configuration errors\n configNotInitialized: 'Configuration service has not been initialized',\n configModuleNotInitialized: 'ConfigModule.forRoot() was not called before module initialization',\n stratalNotInitialized: 'Stratal has not been instantiated. Ensure you export a Stratal instance as the default export.',\n\n // Module errors\n moduleAlreadyRegistered: 'Module {moduleName} is already registered',\n moduleDependencyNotFound: 'Module dependency {dependency} not found for module {moduleName}',\n moduleCircularDependency: 'Circular dependency detected: {cycle}',\n invalidModuleProvider: 'Invalid module provider configuration: {provider}',\n\n // Database errors\n databaseGeneric: 'Database error occurred',\n databaseRecordNotFound: 'Record not found in database',\n databaseUniqueConstraint: 'Record already exists',\n databaseForeignKeyConstraint: 'Related record not found',\n databaseConnectionFailed: 'Failed to connect to database',\n databaseTimeout: 'Database query timeout',\n databaseNullConstraint: 'Required field is missing',\n databaseTooManyConnections: 'Too many database connections',\n databaseTransactionConflict: 'Transaction conflict or deadlock',\n databaseConstraintFailed: 'A database constraint was violated',\n databaseTableNotFound: 'The specified table does not exist in the database',\n databaseColumnNotFound: 'The specified column does not exist in the table',\n databaseInvalidQuery: 'The database query is invalid or malformed',\n invalidErrorCodeRange: 'Invalid error code range: {code}',\n\n // Queue errors\n queueBindingNotFound: 'Queue binding {queueName} not found in environment',\n queueProviderNotSupported: 'Queue provider \"{provider}\" is not supported. Valid providers: cloudflare, sync',\n\n // Cron errors\n cronExecutionFailed: '{count} cron job(s) failed for schedule \"{schedule}\": {jobs}',\n\n // i18n errors\n localeNotSupported: \"Locale '{locale}' is not supported. Supported locales: {supportedLocales}\",\n translationMissing: \"Translation missing for key '{key}' in locale '{locale}'\",\n\n // Container errors\n containerNotInitialized: 'Application container has not been initialized. Ensure Application.initialize() has been called.',\n\n // Domain routing errors\n domainMismatch: 'The requested domain does not match any configured route',\n\n // Signature errors\n invalidSignature: 'The URL signature is invalid or has expired',\n\n // Schema validation errors\n schemaValidation: 'Schema validation failed',\n responseValidation: 'Response validation failed',\n\n // OpenAPI errors\n openapiValidation: 'OpenAPI validation failed: {details}',\n openapiRouteRegistration: 'Failed to register OpenAPI route {path}: {reason}',\n\n // Email errors\n email: {\n resendApiKeyMissing: 'Resend API key not configured. Set RESEND_EMAIL_API_KEY environment variable.',\n smtpConfigurationMissing: 'SMTP configuration missing. Set SMTP_URL environment variable.',\n smtpHostMissing: 'SMTP host not configured. Check SMTP_URL format (smtp://user:pass@host:port).',\n smtpConnectionFailed: 'Failed to connect to SMTP server {smtpHost}:{smtpPort}',\n resendApiFailed: 'Resend API error',\n providerNotSupported: 'Unsupported email provider: {provider}. Supported providers: resend, smtp'\n },\n\n // Storage errors\n storage: {\n fileNotFound: 'File at path \"{path}\" was not found',\n invalidDisk: 'Storage disk \"{disk}\" is not configured',\n invalidFileType: 'File type \"{mimeType}\" is not allowed',\n fileTooLarge: 'File size {size} exceeds maximum allowed size of {maxSize}',\n presignedUrlInvalidExpiry: 'Expiry must be between {min} and {max} seconds',\n diskNotConfigured: 'Disk \"{disk}\" is not configured',\n responseBodyMissing: 'No body in storage response for path: {path}',\n r2BindingNotFound: 'R2 binding \"{binding}\" was not found in the environment',\n r2PresignedUrlSecretMissing: 'APP_SECRET environment variable is required for presigned URLs',\n },\n\n // Cache errors\n cache: {\n getFailed: \"Failed to retrieve value from cache for key '{key}'\",\n putFailed: \"Failed to store value in cache for key '{key}'\",\n deleteFailed: \"Failed to delete value from cache for key '{key}'\",\n listFailed: 'Failed to list cache keys'\n },\n\n // Seeder errors\n seederNameCollision: 'Seeder name collision: \"{name}\" is already registered. Use distinct class names for each seeder.',\n seederNotRegistered: 'Seeder \"{name}\" is not registered',\n\n // Migration errors\n migration: {\n failed: 'Migration {migrationName} failed: {error}',\n checksumMismatch: 'Migration {migrationName} checksum mismatch (expected: {expected}, actual: {actual})',\n alreadyApplied: 'Migration {migrationName} has already been applied',\n notFound: 'Migration {migrationName} not found',\n },\n} as const\n","/**\n * System Email Messages - English\n *\n * Email-related messages used by packages/modules infrastructure.\n * These are automatically merged with application-specific messages.\n */\n\nexport const emails = {\n magicLink: {\n subject: 'Your sign-in link'\n }\n} as const\n","/**\n * Form validation messages - English\n */\n\nexport const validation = {\n required: 'This field is required',\n email: 'Invalid email address',\n minLength: 'Must be at least {min} characters',\n maxLength: 'Must not exceed {max} characters',\n min: 'Must be at least {min}',\n max: 'Must not exceed {max}',\n pattern: 'Invalid format',\n numeric: 'Must be a number',\n url: 'Invalid URL',\n date: 'Invalid date',\n passwordStrength: 'Password must contain at least one uppercase letter, one lowercase letter, and one number',\n passwordMatch: 'Passwords do not match',\n unique: 'This value already exists',\n phone: 'Invalid phone number',\n fileRequired: 'Please upload a file',\n fileTooLarge: 'File must be smaller than {max}',\n invalidFileType: 'Please upload a PDF, JPG, or PNG file',\n schoolTypes: {\n required: 'School type is required',\n atLeastOne: 'Please select at least one school type',\n invalidCode: 'Invalid school type: {code}',\n notAvailableInCountry: '{schoolType} is not available in {country}',\n countryNotSupported: 'Country {country} is not supported'\n },\n timezone: {\n required: 'Timezone is required',\n invalid: 'Invalid timezone. Please select a valid IANA timezone.'\n },\n locale: {\n required: 'Language is required',\n invalid: 'Invalid language. Supported languages: {locales}'\n }\n} as const\n","/**\n * Zod validation error messages - English\n *\n * Comprehensive messages for all Zod validation error codes\n * Structured to match Zod's issue types and validation contexts\n */\n\nexport const zodI18n = {\n errors: {\n // General errors\n required: 'Required',\n invalid_type: 'Expected {expected}, received {received}',\n invalid_literal: 'Invalid literal value, expected {expected}',\n custom: {\n default: 'Invalid value',\n // Email validation\n emailOrTextRequired: 'Either html or text content must be provided',\n invalidFromEmail: 'Invalid from email address',\n // Storage validation\n fileInstanceRequired: 'File must be a File instance',\n filePathRequired: 'File path is required',\n diskNameRequired: 'Disk name is required',\n endpointRequired: 'Endpoint URL is required for S3',\n bucketNameRequired: 'Bucket name is required',\n accessKeyRequired: 'Access key ID is required',\n secretKeyRequired: 'Secret access key is required',\n storageDiskRequired: 'At least one storage disk is required',\n // Database validation\n databaseUrlRequired: 'Database URL is required',\n // Domain validation\n domainRequired: 'Domain is required',\n domainTooLong: 'Domain too long',\n invalidDomainFormat: 'Invalid domain format',\n },\n invalid_union: 'Invalid input',\n invalid_union_discriminator: 'Invalid discriminator value. Expected {options}',\n invalid_enum_value: 'Invalid enum value. Expected {options}, received {received}',\n unrecognized_keys: 'Unrecognized key(s) in object: {keys}',\n invalid_arguments: 'Invalid function arguments',\n invalid_return_type: 'Invalid function return type',\n invalid_date: 'Invalid date',\n invalid_intersection_types: 'Intersection results could not be merged',\n not_multiple_of: 'Number must be a multiple of {multipleOf}',\n not_finite: 'Number must be finite',\n\n // String-specific validation errors\n invalid_string: {\n email: 'Invalid email address',\n url: 'Invalid URL',\n uuid: 'Invalid UUID',\n cuid: 'Invalid CUID',\n cuid2: 'Invalid CUID2',\n ulid: 'Invalid ULID',\n regex: 'Invalid format',\n datetime: 'Invalid datetime',\n ip: 'Invalid IP address',\n emoji: 'Invalid emoji',\n startsWith: 'Must start with \"{startsWith}\"',\n endsWith: 'Must end with \"{endsWith}\"',\n includes: 'Must include \"{includes}\"',\n base64: 'Invalid Base64',\n nanoid: 'Invalid NanoID',\n cidr: 'Invalid CIDR',\n jwt: 'Invalid JWT',\n time: 'Invalid time',\n },\n\n // Size validation errors (strings, arrays, numbers)\n too_small: {\n string: {\n exact: 'Must be exactly {minimum} characters',\n inclusive: 'Must be at least {minimum} characters',\n not_inclusive: 'Must be more than {minimum} characters',\n },\n number: {\n exact: 'Must be exactly {minimum}',\n inclusive: 'Must be at least {minimum}',\n not_inclusive: 'Must be greater than {minimum}',\n },\n array: {\n exact: 'Must contain exactly {minimum} item(s)',\n inclusive: 'Must contain at least {minimum} item(s)',\n not_inclusive: 'Must contain more than {minimum} item(s)',\n },\n set: {\n exact: 'Must contain exactly {minimum} item(s)',\n inclusive: 'Must contain at least {minimum} item(s)',\n not_inclusive: 'Must contain more than {minimum} item(s)',\n },\n date: {\n exact: 'Date must be {minimum}',\n inclusive: 'Date must be {minimum} or later',\n not_inclusive: 'Date must be after {minimum}',\n },\n bigint: {\n exact: 'Must be exactly {minimum}',\n inclusive: 'Must be at least {minimum}',\n not_inclusive: 'Must be greater than {minimum}',\n },\n },\n\n too_big: {\n string: {\n exact: 'Must be exactly {maximum} characters',\n inclusive: 'Must be at most {maximum} characters',\n not_inclusive: 'Must be less than {maximum} characters',\n },\n number: {\n exact: 'Must be exactly {maximum}',\n inclusive: 'Must be at most {maximum}',\n not_inclusive: 'Must be less than {maximum}',\n },\n array: {\n exact: 'Must contain exactly {maximum} item(s)',\n inclusive: 'Must contain at most {maximum} item(s)',\n not_inclusive: 'Must contain less than {maximum} item(s)',\n },\n set: {\n exact: 'Must contain exactly {maximum} item(s)',\n inclusive: 'Must contain at most {maximum} item(s)',\n not_inclusive: 'Must contain less than {maximum} item(s)',\n },\n date: {\n exact: 'Date must be {maximum}',\n inclusive: 'Date must be {maximum} or earlier',\n not_inclusive: 'Date must be before {maximum}',\n },\n bigint: {\n exact: 'Must be exactly {maximum}',\n inclusive: 'Must be at most {maximum}',\n not_inclusive: 'Must be less than {maximum}',\n },\n },\n },\n} as const\n","/**\n * System Messages - English\n *\n * Re-exports all system message categories.\n * These messages are used by packages/modules infrastructure\n * and are automatically merged with application-specific messages.\n */\n\nexport { common } from './common'\nexport { errors } from './errors'\nexport { emails } from './emails'\nexport { validation } from './validation'\nexport { zodI18n } from './zod'\n"],"mappings":"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"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/env.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Cloudflare Worker Environment Bindings
|
|
4
|
+
*
|
|
5
|
+
* This interface defines the base environment bindings required by Stratal.
|
|
6
|
+
* Use TypeScript module augmentation to add your own application-specific bindings.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* declare module 'stratal' {
|
|
11
|
+
* interface StratalEnv {
|
|
12
|
+
* DATABASE: D1Database
|
|
13
|
+
* NOTIFICATIONS_QUEUE: Queue
|
|
14
|
+
* }
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
interface StratalEnv {
|
|
19
|
+
ENVIRONMENT: string;
|
|
20
|
+
CACHE: KVNamespace;
|
|
21
|
+
APP_SECRET?: string;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { StratalEnv as t };
|
|
25
|
+
//# sourceMappingURL=env-CamWD-U1.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-CamWD-U1.d.mts","names":[],"sources":["../src/env.ts"],"mappings":";;AAgBA;;;;;;;;;;;;;;;UAAiB,UAAA;EACf,WAAA;EACA,KAAA,EAAO,WAAA;EACP,UAAA;AAAA"}
|
package/dist/errors/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { An as
|
|
1
|
+
import { An as ContextCallback, F as QueueExceptionContext, Fn as RespondCallback, Hr as ErrorResponse, I as createCliExceptionContext, L as createCronExceptionContext, M as CronExceptionContext, Mn as RenderableCallback, N as ExceptionContext, Nn as Reportable, On as ExceptionHandler, P as HttpExceptionContext, Pn as ReportableCallback, R as createHttpExceptionContext, Ur as isErrorResponse, Vr as Environment, a as InternalError, c as getHttpStatus, d as ApplicationError, f as ERROR_CODES, i as isApplicationError, j as CliExceptionContext, jn as LogSeverity, kn as ApplicationErrorConstructor, l as resolveHttpStatus, n as RequestContainerNotInitializedError, o as HttpException, p as ErrorCode, r as ContainerNotInitializedError, s as abort, t as StratalNotInitializedError, u as DefaultExceptionHandler, z as createQueueExceptionContext } from "../index-DPFqRs8L.mjs";
|
|
2
2
|
export { ApplicationError, ApplicationErrorConstructor, CliExceptionContext, ContainerNotInitializedError, ContextCallback, CronExceptionContext, DefaultExceptionHandler, ERROR_CODES, Environment, ErrorCode, ErrorResponse, ExceptionContext, ExceptionHandler, HttpException, HttpExceptionContext, InternalError, LogSeverity, QueueExceptionContext, RenderableCallback, Reportable, ReportableCallback, RequestContainerNotInitializedError, RespondCallback, StratalNotInitializedError, abort, createCliExceptionContext, createCronExceptionContext, createHttpExceptionContext, createQueueExceptionContext, getHttpStatus, isApplicationError, isErrorResponse, resolveHttpStatus };
|
package/dist/errors/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as abort, H as ApplicationError, O as ContainerNotInitializedError, S as HttpException, _ as ExceptionHandler, a as createHttpExceptionContext, b as getHttpStatus, g as DefaultExceptionHandler, h as isErrorResponse, i as createCronExceptionContext, k as ERROR_CODES, n as RequestContainerNotInitializedError, o as createQueueExceptionContext, r as createCliExceptionContext, t as StratalNotInitializedError, v as isApplicationError, x as resolveHttpStatus, y as InternalError } from "../errors
|
|
1
|
+
import { C as abort, H as ApplicationError, O as ContainerNotInitializedError, S as HttpException, _ as ExceptionHandler, a as createHttpExceptionContext, b as getHttpStatus, g as DefaultExceptionHandler, h as isErrorResponse, i as createCronExceptionContext, k as ERROR_CODES, n as RequestContainerNotInitializedError, o as createQueueExceptionContext, r as createCliExceptionContext, t as StratalNotInitializedError, v as isApplicationError, x as resolveHttpStatus, y as InternalError } from "../errors-B4pYgYON.mjs";
|
|
2
2
|
export { ApplicationError, ContainerNotInitializedError, DefaultExceptionHandler, ERROR_CODES, ExceptionHandler, HttpException, InternalError, RequestContainerNotInitializedError, StratalNotInitializedError, abort, createCliExceptionContext, createCronExceptionContext, createHttpExceptionContext, createQueueExceptionContext, getHttpStatus, isApplicationError, isErrorResponse, resolveHttpStatus };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { a as __decorate, d as CONTAINER_TOKEN, f as DI_TOKENS, o as __decorateParam, p as Transient, s as __decorateMetadata, u as LOGGER_TOKENS } from "./logger-
|
|
1
|
+
import { a as __decorate, d as CONTAINER_TOKEN, f as DI_TOKENS, o as __decorateParam, p as Transient, s as __decorateMetadata, u as LOGGER_TOKENS } from "./logger-V6Ms3QnQ.mjs";
|
|
2
|
+
import { t as Macroable } from "./macroable-BmufBshB.mjs";
|
|
2
3
|
import { Lifecycle, container as container$1, delay, inject, inject as inject$1, injectable as injectable$1, instancePerContainerCachingFactory as instancePerContainerCachingFactory$1, predicateAwareClassFactory, singleton } from "tsyringe";
|
|
3
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
5
|
import { stream, streamSSE, streamText } from "hono/streaming";
|
|
@@ -130,12 +131,40 @@ var ApplicationError = class ApplicationError extends Error {
|
|
|
130
131
|
* Dependency injection tokens for the router system
|
|
131
132
|
*/
|
|
132
133
|
const ROUTER_TOKENS = {
|
|
134
|
+
/**
|
|
135
|
+
* Token for RouterContext (request-scoped)
|
|
136
|
+
* Contains Hono context wrapper with helper methods
|
|
137
|
+
*/
|
|
133
138
|
RouterContext: Symbol.for("stratal:router:context"),
|
|
139
|
+
/**
|
|
140
|
+
* Token for RouteRegistry (singleton)
|
|
141
|
+
* Central registry of all application routes — source of truth for route:list, route:types, URL generation
|
|
142
|
+
*/
|
|
134
143
|
RouteRegistry: Symbol.for("stratal:router:route-registry"),
|
|
144
|
+
/**
|
|
145
|
+
* Token for VersioningService (singleton)
|
|
146
|
+
* Resolves version prefixes for route paths
|
|
147
|
+
*/
|
|
135
148
|
VersioningService: Symbol.for("stratal:router:versioning-service"),
|
|
149
|
+
/**
|
|
150
|
+
* Token for LocalePathService (singleton)
|
|
151
|
+
* Resolves locale path variants and computes LocalePathConfig
|
|
152
|
+
*/
|
|
136
153
|
LocalePathService: Symbol.for("stratal:router:locale-path-service"),
|
|
154
|
+
/**
|
|
155
|
+
* Token for RouterResolver (singleton, may be null)
|
|
156
|
+
* Internal resolver that computes effective Router config per controller
|
|
157
|
+
*/
|
|
137
158
|
RouterResolver: Symbol.for("stratal:router:router-resolver"),
|
|
159
|
+
/**
|
|
160
|
+
* Token for HonoApp (singleton)
|
|
161
|
+
* The Hono application instance with Stratal-specific setup
|
|
162
|
+
*/
|
|
138
163
|
HonoApp: Symbol.for("stratal:router:hono-app"),
|
|
164
|
+
/**
|
|
165
|
+
* Token for Uri (request-scoped)
|
|
166
|
+
* URL generation service — route URLs, signed URLs, current/previous URL access
|
|
167
|
+
*/
|
|
139
168
|
Uri: Symbol.for("stratal:router:uri")
|
|
140
169
|
};
|
|
141
170
|
//#endregion
|
|
@@ -428,87 +457,200 @@ let Scope = /* @__PURE__ */ function(Scope) {
|
|
|
428
457
|
* - 9300-9399: I18n errors
|
|
429
458
|
*/
|
|
430
459
|
const ERROR_CODES = {
|
|
460
|
+
/**
|
|
461
|
+
* Database Errors (2000-2999)
|
|
462
|
+
* Generic database errors thrown by Prisma client extensions
|
|
463
|
+
*/
|
|
431
464
|
DATABASE: {
|
|
465
|
+
/** Generic database error */
|
|
432
466
|
GENERIC: 2e3,
|
|
467
|
+
/** Record not found in database */
|
|
433
468
|
RECORD_NOT_FOUND: 2001,
|
|
469
|
+
/** Unique constraint violation */
|
|
434
470
|
UNIQUE_CONSTRAINT: 2002,
|
|
471
|
+
/** Foreign key constraint violation */
|
|
435
472
|
FOREIGN_KEY_CONSTRAINT: 2003,
|
|
473
|
+
/** Database connection failed */
|
|
436
474
|
CONNECTION_FAILED: 2004,
|
|
475
|
+
/** Database timeout */
|
|
437
476
|
TIMEOUT: 2005,
|
|
477
|
+
/** Null constraint violation */
|
|
438
478
|
NULL_CONSTRAINT: 2006,
|
|
479
|
+
/** Too many database connections */
|
|
439
480
|
TOO_MANY_CONNECTIONS: 2007,
|
|
481
|
+
/** Transaction conflict or deadlock */
|
|
440
482
|
TRANSACTION_CONFLICT: 2008
|
|
441
483
|
},
|
|
484
|
+
/**
|
|
485
|
+
* Authentication Errors (3000-3099)
|
|
486
|
+
* Authentication-related failures
|
|
487
|
+
*/
|
|
442
488
|
AUTH: {
|
|
489
|
+
/** Invalid credentials provided */
|
|
443
490
|
INVALID_CREDENTIALS: 3e3,
|
|
491
|
+
/** Session expired or invalid */
|
|
444
492
|
SESSION_EXPIRED: 3001,
|
|
493
|
+
/** Account locked or disabled */
|
|
445
494
|
ACCOUNT_LOCKED: 3002,
|
|
495
|
+
/** Invalid or expired token */
|
|
446
496
|
INVALID_TOKEN: 3003,
|
|
497
|
+
/** Context not initialized */
|
|
447
498
|
CONTEXT_NOT_INITIALIZED: 3004,
|
|
499
|
+
/** User not authenticated */
|
|
448
500
|
USER_NOT_AUTHENTICATED: 3005,
|
|
501
|
+
/** Email verification required before login */
|
|
449
502
|
EMAIL_NOT_VERIFIED: 3007,
|
|
503
|
+
/** Password doesn't meet minimum length */
|
|
450
504
|
PASSWORD_TOO_SHORT: 3008,
|
|
505
|
+
/** Password exceeds maximum length */
|
|
451
506
|
PASSWORD_TOO_LONG: 3009,
|
|
507
|
+
/** Account with email already exists */
|
|
452
508
|
ACCOUNT_ALREADY_EXISTS: 3010,
|
|
509
|
+
/** User creation failed */
|
|
453
510
|
FAILED_TO_CREATE_USER: 3011,
|
|
511
|
+
/** Session creation failed */
|
|
454
512
|
FAILED_TO_CREATE_SESSION: 3012,
|
|
513
|
+
/** User update failed */
|
|
455
514
|
FAILED_TO_UPDATE_USER: 3013,
|
|
515
|
+
/** Social account already linked */
|
|
456
516
|
SOCIAL_ACCOUNT_LINKED: 3014,
|
|
457
|
-
|
|
517
|
+
/** Last account cannot be unlinked */
|
|
518
|
+
CANNOT_UNLINK_LAST_ACCOUNT: 3015,
|
|
519
|
+
/** Organization not found */
|
|
520
|
+
ORGANIZATION_NOT_FOUND: 3020,
|
|
521
|
+
/** Organization member not found */
|
|
522
|
+
MEMBER_NOT_FOUND: 3021,
|
|
523
|
+
/** Organization invitation not found */
|
|
524
|
+
INVITATION_NOT_FOUND: 3022,
|
|
525
|
+
/** Invitation recipient mismatch */
|
|
526
|
+
INVITATION_RECIPIENT_MISMATCH: 3023,
|
|
527
|
+
/** Organization limit reached */
|
|
528
|
+
ORGANIZATION_LIMIT_REACHED: 3024,
|
|
529
|
+
/** Organization membership constraint violation */
|
|
530
|
+
ORGANIZATION_MEMBERSHIP_REQUIRED: 3025
|
|
458
531
|
},
|
|
532
|
+
/**
|
|
533
|
+
* Authorization Errors (3100-3199)
|
|
534
|
+
* Permission and access control failures
|
|
535
|
+
*/
|
|
459
536
|
AUTHZ: {
|
|
537
|
+
/** Insufficient permissions */
|
|
460
538
|
FORBIDDEN: 3100,
|
|
539
|
+
/** Resource access denied */
|
|
461
540
|
ACCESS_DENIED: 3101,
|
|
541
|
+
/** User lacks required role */
|
|
462
542
|
INSUFFICIENT_PERMISSIONS: 3102
|
|
463
543
|
},
|
|
544
|
+
/**
|
|
545
|
+
* Resource Errors (4000-4999)
|
|
546
|
+
* Generic resource-related errors
|
|
547
|
+
*/
|
|
464
548
|
RESOURCE: {
|
|
549
|
+
/** Generic resource not found */
|
|
465
550
|
NOT_FOUND: 4e3,
|
|
551
|
+
/** Route/endpoint not found */
|
|
466
552
|
ROUTE_NOT_FOUND: 4004,
|
|
553
|
+
/** Resource conflict or duplicate */
|
|
467
554
|
CONFLICT: 4100,
|
|
555
|
+
/** Resource already exists */
|
|
468
556
|
ALREADY_EXISTS: 4101
|
|
469
557
|
},
|
|
558
|
+
/**
|
|
559
|
+
* Validation Errors (1000-1999)
|
|
560
|
+
* Input validation failures
|
|
561
|
+
*/
|
|
470
562
|
VALIDATION: {
|
|
563
|
+
/** Generic validation error */
|
|
471
564
|
GENERIC: 1e3,
|
|
565
|
+
/** Required field missing */
|
|
472
566
|
REQUIRED_FIELD: 1001,
|
|
567
|
+
/** Invalid format */
|
|
473
568
|
INVALID_FORMAT: 1002,
|
|
569
|
+
/** Schema validation failed */
|
|
474
570
|
SCHEMA_VALIDATION: 1003,
|
|
571
|
+
/** Request validation failed (OpenAPI, etc.) */
|
|
475
572
|
REQUEST_VALIDATION: 1004,
|
|
573
|
+
/** Response validation failed (response body doesn't match declared schema) */
|
|
476
574
|
RESPONSE_VALIDATION: 1005
|
|
477
575
|
},
|
|
576
|
+
/**
|
|
577
|
+
* Router Errors (9000-9099)
|
|
578
|
+
* Router and controller-related INTERNAL errors
|
|
579
|
+
*/
|
|
478
580
|
ROUTER: {
|
|
581
|
+
/** Controller registration error */
|
|
479
582
|
CONTROLLER_REGISTRATION_ERROR: 9005,
|
|
583
|
+
/** Controller method not found */
|
|
480
584
|
CONTROLLER_METHOD_NOT_FOUND: 9006,
|
|
585
|
+
/** OpenAPI route registration failed */
|
|
481
586
|
OPENAPI_ROUTE_REGISTRATION: 9008,
|
|
587
|
+
/** Duplicate route name in RouteRegistry */
|
|
482
588
|
DUPLICATE_ROUTE_NAME: 9010,
|
|
589
|
+
/** Named route not found in RouteRegistry */
|
|
483
590
|
ROUTE_NAME_NOT_FOUND: 9011,
|
|
591
|
+
/** Required route parameter missing during URL generation */
|
|
484
592
|
MISSING_ROUTE_PARAM: 9012,
|
|
485
|
-
|
|
593
|
+
/** router.use() called inside group() callback */
|
|
594
|
+
USE_SCOPE_VIOLATION: 9013,
|
|
595
|
+
/** next() called more than once in a middleware */
|
|
596
|
+
MIDDLEWARE_NEXT_CALLED_MULTIPLE_TIMES: 9014
|
|
486
597
|
},
|
|
598
|
+
/**
|
|
599
|
+
* I18n Errors (9300-9399)
|
|
600
|
+
* Internationalization and localization errors
|
|
601
|
+
*/
|
|
487
602
|
I18N: {
|
|
603
|
+
/** Translation key missing from all locales */
|
|
488
604
|
TRANSLATION_MISSING: 9300,
|
|
605
|
+
/** Requested locale not supported */
|
|
489
606
|
LOCALE_NOT_SUPPORTED: 9301
|
|
490
607
|
},
|
|
608
|
+
/**
|
|
609
|
+
* System Errors (9000-9999)
|
|
610
|
+
* Internal system errors and unexpected failures
|
|
611
|
+
*/
|
|
491
612
|
SYSTEM: {
|
|
613
|
+
/** Internal server error */
|
|
492
614
|
INTERNAL_ERROR: 9e3,
|
|
615
|
+
/** Generic configuration error */
|
|
493
616
|
CONFIGURATION_ERROR: 9100,
|
|
617
|
+
/** ConfigService not initialized */
|
|
494
618
|
CONFIG_NOT_INITIALIZED: 9101,
|
|
619
|
+
/** Module already registered */
|
|
495
620
|
MODULE_ALREADY_REGISTERED: 9102,
|
|
621
|
+
/** Circular module dependency detected */
|
|
496
622
|
MODULE_CIRCULAR_DEPENDENCY: 9103,
|
|
623
|
+
/** Module dependency not found */
|
|
497
624
|
MODULE_DEPENDENCY_NOT_FOUND: 9104,
|
|
625
|
+
/** Invalid error code range */
|
|
498
626
|
INVALID_ERROR_CODE_RANGE: 9105,
|
|
627
|
+
/** Invalid module provider configuration */
|
|
499
628
|
INVALID_MODULE_PROVIDER: 9106,
|
|
629
|
+
/** ConfigModule.forRoot() was not called */
|
|
500
630
|
CONFIG_MODULE_NOT_INITIALIZED: 9107,
|
|
631
|
+
/** Generic infrastructure error */
|
|
501
632
|
INFRASTRUCTURE_ERROR: 9200,
|
|
633
|
+
/** Execution context not initialized */
|
|
502
634
|
EXECUTION_CONTEXT_NOT_INITIALIZED: 9201,
|
|
635
|
+
/** Request container not initialized */
|
|
503
636
|
REQUEST_CONTAINER_NOT_INITIALIZED: 9202,
|
|
637
|
+
/** Queue binding not found */
|
|
504
638
|
QUEUE_BINDING_NOT_FOUND: 9203,
|
|
639
|
+
/** Cron job execution failed */
|
|
505
640
|
CRON_EXECUTION_FAILED: 9204,
|
|
641
|
+
/** Queue provider not supported */
|
|
506
642
|
QUEUE_PROVIDER_NOT_SUPPORTED: 9205,
|
|
643
|
+
/** body() called on WebSocket gateway context */
|
|
507
644
|
WEBSOCKET_BODY_NOT_AVAILABLE: 9206,
|
|
645
|
+
/** Duplicate WebSocket event decorator on a gateway */
|
|
508
646
|
WEBSOCKET_DUPLICATE_EVENT_HANDLER: 9207,
|
|
647
|
+
/** Seeder name collision — two seeders share the same class name */
|
|
509
648
|
SEEDER_NAME_COLLISION: 9208,
|
|
649
|
+
/** Seeder not registered in the SeederRegistry */
|
|
510
650
|
SEEDER_NOT_REGISTERED: 9209,
|
|
651
|
+
/** Application container not initialized (AsyncLocalStorage) */
|
|
511
652
|
CONTAINER_NOT_INITIALIZED: 9210,
|
|
653
|
+
/** Required environment variable not set */
|
|
512
654
|
MISSING_ENVIRONMENT_VARIABLE: 9211
|
|
513
655
|
}
|
|
514
656
|
};
|
|
@@ -564,9 +706,13 @@ function runWithContainer(container, fn) {
|
|
|
564
706
|
* Symbol-based tokens to avoid string collisions
|
|
565
707
|
*/
|
|
566
708
|
const I18N_TOKENS = {
|
|
709
|
+
/** MessageLoaderService - loads and caches locale messages */
|
|
567
710
|
MessageLoader: Symbol.for("stratal:i18n:message:loader"),
|
|
711
|
+
/** I18nService - request-scoped translation service */
|
|
568
712
|
I18nService: Symbol.for("stratal:i18n:service"),
|
|
713
|
+
/** I18nModuleOptions - configuration options from forRoot() */
|
|
569
714
|
Options: Symbol.for("stratal:i18n:options"),
|
|
715
|
+
/** MessageRegistry - singleton accumulator for registerMessages() contributions */
|
|
570
716
|
MessageRegistry: Symbol.for("stratal:i18n:message:registry")
|
|
571
717
|
};
|
|
572
718
|
//#endregion
|
|
@@ -735,13 +881,20 @@ var InternalError = class extends ApplicationError {
|
|
|
735
881
|
//#endregion
|
|
736
882
|
//#region src/errors/is-application-error.ts
|
|
737
883
|
/**
|
|
738
|
-
* Type guard to check if an error is an ApplicationError
|
|
884
|
+
* Type guard to check if an error is an ApplicationError.
|
|
885
|
+
*
|
|
886
|
+
* Uses `instanceof` first, then falls back to a structural check
|
|
887
|
+
* for the `code` and `timestamp` properties that all ApplicationError
|
|
888
|
+
* instances have. This handles cross-module boundary cases where
|
|
889
|
+
* `instanceof` fails due to duplicate class identities (e.g., Vite's
|
|
890
|
+
* module graph in workerd).
|
|
739
891
|
*
|
|
740
892
|
* @param error - The error to check
|
|
741
893
|
* @returns True if the error is an ApplicationError instance
|
|
742
894
|
*/
|
|
743
895
|
function isApplicationError(error) {
|
|
744
|
-
|
|
896
|
+
if (error instanceof ApplicationError) return true;
|
|
897
|
+
return error instanceof Error && typeof error.code === "number" && typeof error.timestamp === "string";
|
|
745
898
|
}
|
|
746
899
|
//#endregion
|
|
747
900
|
//#region src/errors/exception-handler.ts
|
|
@@ -1283,12 +1436,13 @@ const DEFAULT_CONTENT_TYPE = "application/json";
|
|
|
1283
1436
|
* }
|
|
1284
1437
|
* ```
|
|
1285
1438
|
*/
|
|
1286
|
-
var RouterContext = class {
|
|
1439
|
+
var RouterContext = class extends Macroable {
|
|
1287
1440
|
/**
|
|
1288
1441
|
* Native Hono context
|
|
1289
1442
|
* Access for advanced use cases not covered by helper methods
|
|
1290
1443
|
*/
|
|
1291
1444
|
constructor(c) {
|
|
1445
|
+
super();
|
|
1292
1446
|
this.c = c;
|
|
1293
1447
|
}
|
|
1294
1448
|
/**
|
|
@@ -1557,4 +1711,4 @@ var StratalNotInitializedError = class extends ApplicationError {
|
|
|
1557
1711
|
//#endregion
|
|
1558
1712
|
export { Scope as A, ConditionalBindingFallbackError as B, abort as C, runWithContainer as D, getContainer as E, injectable$1 as F, ApplicationError as H, instancePerContainerCachingFactory$1 as I, singleton as L, container$1 as M, delay as N, ContainerNotInitializedError as O, inject$1 as P, ConditionalBindingBuilderImpl as R, HttpException as S, containerStorage as T, ROUTER_TOKENS as V, ExceptionHandler as _, createHttpExceptionContext as a, getHttpStatus as b, DEFAULT_CONTENT_TYPE as c, ROUTER_CONTEXT_KEYS as d, ROUTE_METADATA_KEYS as f, DefaultExceptionHandler as g, isErrorResponse as h, createCronExceptionContext as i, Container as j, ERROR_CODES as k, HTTP_METHODS as l, VERSION_NEUTRAL as m, RequestContainerNotInitializedError as n, createQueueExceptionContext as o, SECURITY_SCHEMES as p, createCliExceptionContext as r, RouterContext as s, StratalNotInitializedError as t, METHOD_STATUS_CODES as u, isApplicationError as v, I18N_TOKENS as w, resolveHttpStatus as x, InternalError as y, RequestScopeOperationNotAllowedError as z };
|
|
1559
1713
|
|
|
1560
|
-
//# sourceMappingURL=errors
|
|
1714
|
+
//# sourceMappingURL=errors-B4pYgYON.mjs.map
|