stratal 0.0.13 → 0.0.15
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/application-Du0d8O_e.d.mts +116 -0
- package/dist/application-Du0d8O_e.d.mts.map +1 -0
- package/dist/base-email.provider-CNwsPbwm.mjs +42 -0
- package/dist/base-email.provider-CNwsPbwm.mjs.map +1 -0
- package/dist/bin/cloudflare-workers-loader.mjs +34 -0
- package/dist/bin/cloudflare-workers-loader.mjs.map +1 -0
- package/dist/bin/quarry.mjs +164 -0
- package/dist/bin/quarry.mjs.map +1 -0
- package/dist/cache/index.d.mts +219 -0
- package/dist/cache/index.d.mts.map +1 -0
- package/dist/cache/index.mjs +251 -0
- package/dist/cache/index.mjs.map +1 -0
- package/dist/chunk-D1SwGrFN.mjs +27 -0
- package/dist/command-DG_u5ob2.mjs +192 -0
- package/dist/command-DG_u5ob2.mjs.map +1 -0
- package/dist/command-DcebcSrL.d.mts +120 -0
- package/dist/command-DcebcSrL.d.mts.map +1 -0
- package/dist/config/index.d.mts +273 -0
- package/dist/config/index.d.mts.map +1 -0
- package/dist/config/index.mjs +239 -0
- package/dist/config/index.mjs.map +1 -0
- package/dist/cron/index.d.mts +128 -0
- package/dist/cron/index.d.mts.map +1 -0
- package/dist/cron/index.mjs +5 -0
- package/dist/cron-manager-BRh86QCS.mjs +107 -0
- package/dist/cron-manager-BRh86QCS.mjs.map +1 -0
- package/dist/decorate-D5j-d9_z.mjs +171 -0
- package/dist/decorate-D5j-d9_z.mjs.map +1 -0
- package/dist/di/index.d.mts +2 -0
- package/dist/di/index.mjs +4 -0
- package/dist/email/index.d.mts +532 -0
- package/dist/email/index.d.mts.map +1 -0
- package/dist/email/index.mjs +480 -0
- package/dist/email/index.mjs.map +1 -0
- package/dist/en-uVIaxFXR.mjs +319 -0
- package/dist/en-uVIaxFXR.mjs.map +1 -0
- package/dist/errors/index.d.mts +2 -0
- package/dist/errors/index.mjs +4 -0
- package/dist/errors-CtCi1wn6.mjs +707 -0
- package/dist/errors-CtCi1wn6.mjs.map +1 -0
- package/dist/events/index.d.mts +210 -0
- package/dist/events/index.d.mts.map +1 -0
- package/dist/events/index.mjs +4 -0
- package/dist/events-CXl-o1Ad.mjs +191 -0
- package/dist/events-CXl-o1Ad.mjs.map +1 -0
- package/dist/gateway-context-90CQEQDR.mjs +226 -0
- package/dist/gateway-context-90CQEQDR.mjs.map +1 -0
- package/dist/guards/index.d.mts +172 -0
- package/dist/guards/index.d.mts.map +1 -0
- package/dist/guards/index.mjs +2 -0
- package/dist/guards-DMbsAxSX.mjs +151 -0
- package/dist/guards-DMbsAxSX.mjs.map +1 -0
- package/dist/i18n/index.d.mts +3 -0
- package/dist/i18n/index.mjs +15 -0
- package/dist/i18n/messages/en/index.d.mts +2 -0
- package/dist/i18n/messages/en/index.mjs +2 -0
- package/dist/i18n/validation/index.d.mts +4 -0
- package/dist/i18n/validation/index.mjs +3 -0
- package/dist/i18n.module-qNrpIVts.mjs +1791 -0
- package/dist/i18n.module-qNrpIVts.mjs.map +1 -0
- package/dist/index-CSuHOJc3.d.mts +319 -0
- package/dist/index-CSuHOJc3.d.mts.map +1 -0
- package/dist/index-Cfkie8JM.d.mts +263 -0
- package/dist/index-Cfkie8JM.d.mts.map +1 -0
- package/dist/index-CpAN9ENH.d.mts +185 -0
- package/dist/index-CpAN9ENH.d.mts.map +1 -0
- package/dist/index-D69rxo8H.d.mts +2616 -0
- package/dist/index-D69rxo8H.d.mts.map +1 -0
- package/dist/index-H-Su81aK.d.mts +632 -0
- package/dist/index-H-Su81aK.d.mts.map +1 -0
- package/dist/index.d.mts +41 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +20 -0
- package/dist/is-command-MZDCH-0T.mjs +14 -0
- package/dist/is-command-MZDCH-0T.mjs.map +1 -0
- package/dist/is-seeder-BN9Ej1r7.mjs +28 -0
- package/dist/is-seeder-BN9Ej1r7.mjs.map +1 -0
- package/dist/logger/index.d.mts +2 -0
- package/dist/logger/index.mjs +3 -0
- package/dist/logger-BR1-s1Um.mjs +252 -0
- package/dist/logger-BR1-s1Um.mjs.map +1 -0
- package/dist/middleware/index.d.mts +2 -0
- package/dist/middleware/index.mjs +6 -0
- package/dist/middleware-iRhNjsPH.mjs +362 -0
- package/dist/middleware-iRhNjsPH.mjs.map +1 -0
- package/dist/module/index.d.mts +148 -0
- package/dist/module/index.d.mts.map +1 -0
- package/dist/module/index.mjs +11 -0
- package/dist/module-BH7t7BGG.mjs +370 -0
- package/dist/module-BH7t7BGG.mjs.map +1 -0
- package/dist/openapi/index.d.mts +202 -0
- package/dist/openapi/index.d.mts.map +1 -0
- package/dist/openapi/index.mjs +15 -0
- package/dist/quarry/index.d.mts +112 -0
- package/dist/quarry/index.d.mts.map +1 -0
- package/dist/quarry/index.mjs +6 -0
- package/dist/quarry-registry-BPmKVjhG.mjs +302 -0
- package/dist/quarry-registry-BPmKVjhG.mjs.map +1 -0
- package/dist/queue/index.d.mts +2 -0
- package/dist/queue/index.mjs +84 -0
- package/dist/queue/index.mjs.map +1 -0
- package/dist/queue.module-BdXWUvIM.mjs +403 -0
- package/dist/queue.module-BdXWUvIM.mjs.map +1 -0
- package/dist/resend.provider-CQT5be5E.mjs +70 -0
- package/dist/resend.provider-CQT5be5E.mjs.map +1 -0
- package/dist/router/index.d.mts +2 -0
- package/dist/router/index.mjs +15 -0
- package/dist/router-context-BLn4PrRG.mjs +264 -0
- package/dist/router-context-BLn4PrRG.mjs.map +1 -0
- package/dist/seeder/index.d.mts +77 -0
- package/dist/seeder/index.d.mts.map +1 -0
- package/dist/seeder/index.mjs +7 -0
- package/dist/seeder-DatfjJvU.mjs +132 -0
- package/dist/seeder-DatfjJvU.mjs.map +1 -0
- package/dist/smtp.provider-Cj7BUFbJ.mjs +78 -0
- package/dist/smtp.provider-Cj7BUFbJ.mjs.map +1 -0
- package/dist/storage/index.d.mts +743 -0
- package/dist/storage/index.d.mts.map +1 -0
- package/dist/storage/index.mjs +13 -0
- package/dist/storage-BtcfgibD.mjs +787 -0
- package/dist/storage-BtcfgibD.mjs.map +1 -0
- package/dist/stratal-Cm0Yy8v4.mjs +305 -0
- package/dist/stratal-Cm0Yy8v4.mjs.map +1 -0
- package/dist/{types.d.ts → types-Cu4jkeiH.d.mts} +5 -2
- package/dist/types-Cu4jkeiH.d.mts.map +1 -0
- package/dist/types-N84Ak6YT.d.mts +64 -0
- package/dist/types-N84Ak6YT.d.mts.map +1 -0
- package/dist/usage-generator-BTZDk5zx.mjs +75 -0
- package/dist/usage-generator-BTZDk5zx.mjs.map +1 -0
- package/dist/validation-Dbt-snjx.mjs +194 -0
- package/dist/validation-Dbt-snjx.mjs.map +1 -0
- package/dist/websocket/index.d.mts +168 -0
- package/dist/websocket/index.d.mts.map +1 -0
- package/dist/websocket/index.mjs +6 -0
- package/dist/workers/index.d.mts +90 -0
- package/dist/workers/index.d.mts.map +1 -0
- package/dist/workers/index.mjs +122 -0
- package/dist/workers/index.mjs.map +1 -0
- package/package.json +98 -28
- package/dist/application.d.ts +0 -101
- package/dist/application.d.ts.map +0 -1
- package/dist/application.js +0 -230
- package/dist/application.js.map +0 -1
- package/dist/cache/cache.module.d.ts +0 -14
- package/dist/cache/cache.module.d.ts.map +0 -1
- package/dist/cache/cache.module.js +0 -32
- package/dist/cache/cache.module.js.map +0 -1
- package/dist/cache/cache.tokens.d.ts +0 -5
- package/dist/cache/cache.tokens.d.ts.map +0 -1
- package/dist/cache/cache.tokens.js +0 -4
- package/dist/cache/cache.tokens.js.map +0 -1
- package/dist/cache/errors/cache-delete.error.d.ts +0 -11
- package/dist/cache/errors/cache-delete.error.d.ts.map +0 -1
- package/dist/cache/errors/cache-delete.error.js +0 -14
- package/dist/cache/errors/cache-delete.error.js.map +0 -1
- package/dist/cache/errors/cache-get.error.d.ts +0 -11
- package/dist/cache/errors/cache-get.error.d.ts.map +0 -1
- package/dist/cache/errors/cache-get.error.js +0 -14
- package/dist/cache/errors/cache-get.error.js.map +0 -1
- package/dist/cache/errors/cache-list.error.d.ts +0 -10
- package/dist/cache/errors/cache-list.error.d.ts.map +0 -1
- package/dist/cache/errors/cache-list.error.js +0 -13
- package/dist/cache/errors/cache-list.error.js.map +0 -1
- package/dist/cache/errors/cache-put.error.d.ts +0 -11
- package/dist/cache/errors/cache-put.error.d.ts.map +0 -1
- package/dist/cache/errors/cache-put.error.js +0 -14
- package/dist/cache/errors/cache-put.error.js.map +0 -1
- package/dist/cache/errors/index.d.ts +0 -5
- package/dist/cache/errors/index.d.ts.map +0 -1
- package/dist/cache/errors/index.js +0 -5
- package/dist/cache/errors/index.js.map +0 -1
- package/dist/cache/index.d.ts +0 -5
- package/dist/cache/index.d.ts.map +0 -1
- package/dist/cache/index.js +0 -5
- package/dist/cache/index.js.map +0 -1
- package/dist/cache/services/cache.service.d.ts +0 -152
- package/dist/cache/services/cache.service.d.ts.map +0 -1
- package/dist/cache/services/cache.service.js +0 -223
- package/dist/cache/services/cache.service.js.map +0 -1
- package/dist/cache/services/index.d.ts +0 -2
- package/dist/cache/services/index.d.ts.map +0 -1
- package/dist/cache/services/index.js +0 -2
- package/dist/cache/services/index.js.map +0 -1
- package/dist/config/config.module.d.ts +0 -79
- package/dist/config/config.module.d.ts.map +0 -1
- package/dist/config/config.module.js +0 -121
- package/dist/config/config.module.js.map +0 -1
- package/dist/config/config.tokens.d.ts +0 -4
- package/dist/config/config.tokens.d.ts.map +0 -1
- package/dist/config/config.tokens.js +0 -4
- package/dist/config/config.tokens.js.map +0 -1
- package/dist/config/config.types.d.ts +0 -68
- package/dist/config/config.types.d.ts.map +0 -1
- package/dist/config/config.types.js +0 -9
- package/dist/config/config.types.js.map +0 -1
- package/dist/config/errors/config-module-not-initialized.error.d.ts +0 -10
- package/dist/config/errors/config-module-not-initialized.error.d.ts.map +0 -1
- package/dist/config/errors/config-module-not-initialized.error.js +0 -12
- package/dist/config/errors/config-module-not-initialized.error.js.map +0 -1
- package/dist/config/errors/config-not-initialized.error.d.ts +0 -12
- package/dist/config/errors/config-not-initialized.error.d.ts.map +0 -1
- package/dist/config/errors/config-not-initialized.error.js +0 -15
- package/dist/config/errors/config-not-initialized.error.js.map +0 -1
- package/dist/config/errors/index.d.ts +0 -3
- package/dist/config/errors/index.d.ts.map +0 -1
- package/dist/config/errors/index.js +0 -3
- package/dist/config/errors/index.js.map +0 -1
- package/dist/config/index.d.ts +0 -7
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js +0 -9
- package/dist/config/index.js.map +0 -1
- package/dist/config/register-as.d.ts +0 -62
- package/dist/config/register-as.d.ts.map +0 -1
- package/dist/config/register-as.js +0 -48
- package/dist/config/register-as.js.map +0 -1
- package/dist/config/services/config.service.d.ts +0 -59
- package/dist/config/services/config.service.d.ts.map +0 -1
- package/dist/config/services/config.service.js +0 -140
- package/dist/config/services/config.service.js.map +0 -1
- package/dist/cron/cron-job.d.ts +0 -54
- package/dist/cron/cron-job.d.ts.map +0 -1
- package/dist/cron/cron-job.js +0 -2
- package/dist/cron/cron-job.js.map +0 -1
- package/dist/cron/cron-manager.d.ts +0 -60
- package/dist/cron/cron-manager.d.ts.map +0 -1
- package/dist/cron/cron-manager.js +0 -120
- package/dist/cron/cron-manager.js.map +0 -1
- package/dist/cron/errors/cron-execution.error.d.ts +0 -10
- package/dist/cron/errors/cron-execution.error.d.ts.map +0 -1
- package/dist/cron/errors/cron-execution.error.js +0 -17
- package/dist/cron/errors/cron-execution.error.js.map +0 -1
- package/dist/cron/index.d.ts +0 -4
- package/dist/cron/index.d.ts.map +0 -1
- package/dist/cron/index.js +0 -3
- package/dist/cron/index.js.map +0 -1
- package/dist/di/conditional-binding-builder.d.ts +0 -93
- package/dist/di/conditional-binding-builder.d.ts.map +0 -1
- package/dist/di/conditional-binding-builder.js +0 -115
- package/dist/di/conditional-binding-builder.js.map +0 -1
- package/dist/di/container.d.ts +0 -131
- package/dist/di/container.d.ts.map +0 -1
- package/dist/di/container.js +0 -177
- package/dist/di/container.js.map +0 -1
- package/dist/di/decorators/inject-param.decorator.d.ts +0 -67
- package/dist/di/decorators/inject-param.decorator.d.ts.map +0 -1
- package/dist/di/decorators/inject-param.decorator.js +0 -53
- package/dist/di/decorators/inject-param.decorator.js.map +0 -1
- package/dist/di/decorators.d.ts +0 -57
- package/dist/di/decorators.d.ts.map +0 -1
- package/dist/di/decorators.js +0 -74
- package/dist/di/decorators.js.map +0 -1
- package/dist/di/errors/conditional-binding-fallback.error.d.ts +0 -16
- package/dist/di/errors/conditional-binding-fallback.error.d.ts.map +0 -1
- package/dist/di/errors/conditional-binding-fallback.error.js +0 -19
- package/dist/di/errors/conditional-binding-fallback.error.js.map +0 -1
- package/dist/di/errors/index.d.ts +0 -3
- package/dist/di/errors/index.d.ts.map +0 -1
- package/dist/di/errors/index.js +0 -3
- package/dist/di/errors/index.js.map +0 -1
- package/dist/di/errors/request-scope-operation-not-allowed.error.d.ts +0 -11
- package/dist/di/errors/request-scope-operation-not-allowed.error.d.ts.map +0 -1
- package/dist/di/errors/request-scope-operation-not-allowed.error.js +0 -14
- package/dist/di/errors/request-scope-operation-not-allowed.error.js.map +0 -1
- package/dist/di/index.d.ts +0 -12
- package/dist/di/index.d.ts.map +0 -1
- package/dist/di/index.js +0 -10
- package/dist/di/index.js.map +0 -1
- package/dist/di/tokens.d.ts +0 -26
- package/dist/di/tokens.d.ts.map +0 -1
- package/dist/di/tokens.js +0 -29
- package/dist/di/tokens.js.map +0 -1
- package/dist/di/types.d.ts +0 -56
- package/dist/di/types.d.ts.map +0 -1
- package/dist/di/types.js +0 -34
- package/dist/di/types.js.map +0 -1
- package/dist/email/consumers/email.consumer.d.ts +0 -43
- package/dist/email/consumers/email.consumer.d.ts.map +0 -1
- package/dist/email/consumers/email.consumer.js +0 -129
- package/dist/email/consumers/email.consumer.js.map +0 -1
- package/dist/email/consumers/index.d.ts +0 -2
- package/dist/email/consumers/index.d.ts.map +0 -1
- package/dist/email/consumers/index.js +0 -2
- package/dist/email/consumers/index.js.map +0 -1
- package/dist/email/contracts/email-attachment.d.ts +0 -61
- package/dist/email/contracts/email-attachment.d.ts.map +0 -1
- package/dist/email/contracts/email-attachment.js +0 -58
- package/dist/email/contracts/email-attachment.js.map +0 -1
- package/dist/email/contracts/email-message.contract.d.ts +0 -58
- package/dist/email/contracts/email-message.contract.d.ts.map +0 -1
- package/dist/email/contracts/email-message.contract.js +0 -62
- package/dist/email/contracts/email-message.contract.js.map +0 -1
- package/dist/email/contracts/index.d.ts +0 -4
- package/dist/email/contracts/index.d.ts.map +0 -1
- package/dist/email/contracts/index.js +0 -4
- package/dist/email/contracts/index.js.map +0 -1
- package/dist/email/contracts/send-email.input.d.ts +0 -72
- package/dist/email/contracts/send-email.input.d.ts.map +0 -1
- package/dist/email/contracts/send-email.input.js +0 -28
- package/dist/email/contracts/send-email.input.js.map +0 -1
- package/dist/email/email.module.d.ts +0 -122
- package/dist/email/email.module.d.ts.map +0 -1
- package/dist/email/email.module.js +0 -129
- package/dist/email/email.module.js.map +0 -1
- package/dist/email/email.tokens.d.ts +0 -33
- package/dist/email/email.tokens.d.ts.map +0 -1
- package/dist/email/email.tokens.js +0 -33
- package/dist/email/email.tokens.js.map +0 -1
- package/dist/email/errors/email-provider-not-supported.error.d.ts +0 -13
- package/dist/email/errors/email-provider-not-supported.error.d.ts.map +0 -1
- package/dist/email/errors/email-provider-not-supported.error.js +0 -15
- package/dist/email/errors/email-provider-not-supported.error.js.map +0 -1
- package/dist/email/errors/email-resend-api-failed.error.d.ts +0 -13
- package/dist/email/errors/email-resend-api-failed.error.d.ts.map +0 -1
- package/dist/email/errors/email-resend-api-failed.error.js +0 -15
- package/dist/email/errors/email-resend-api-failed.error.js.map +0 -1
- package/dist/email/errors/email-smtp-connection-failed.error.d.ts +0 -13
- package/dist/email/errors/email-smtp-connection-failed.error.d.ts.map +0 -1
- package/dist/email/errors/email-smtp-connection-failed.error.js +0 -15
- package/dist/email/errors/email-smtp-connection-failed.error.js.map +0 -1
- package/dist/email/errors/index.d.ts +0 -7
- package/dist/email/errors/index.d.ts.map +0 -1
- package/dist/email/errors/index.js +0 -7
- package/dist/email/errors/index.js.map +0 -1
- package/dist/email/errors/resend-api-key-missing.error.d.ts +0 -13
- package/dist/email/errors/resend-api-key-missing.error.d.ts.map +0 -1
- package/dist/email/errors/resend-api-key-missing.error.js +0 -15
- package/dist/email/errors/resend-api-key-missing.error.js.map +0 -1
- package/dist/email/errors/smtp-configuration-missing.error.d.ts +0 -13
- package/dist/email/errors/smtp-configuration-missing.error.d.ts.map +0 -1
- package/dist/email/errors/smtp-configuration-missing.error.js +0 -15
- package/dist/email/errors/smtp-configuration-missing.error.js.map +0 -1
- package/dist/email/errors/smtp-host-missing.error.d.ts +0 -13
- package/dist/email/errors/smtp-host-missing.error.d.ts.map +0 -1
- package/dist/email/errors/smtp-host-missing.error.js +0 -15
- package/dist/email/errors/smtp-host-missing.error.js.map +0 -1
- package/dist/email/index.d.ts +0 -6
- package/dist/email/index.d.ts.map +0 -1
- package/dist/email/index.js +0 -8
- package/dist/email/index.js.map +0 -1
- package/dist/email/providers/base-email.provider.d.ts +0 -22
- package/dist/email/providers/base-email.provider.d.ts.map +0 -1
- package/dist/email/providers/base-email.provider.js +0 -43
- package/dist/email/providers/base-email.provider.js.map +0 -1
- package/dist/email/providers/email-provider.interface.d.ts +0 -66
- package/dist/email/providers/email-provider.interface.d.ts.map +0 -1
- package/dist/email/providers/email-provider.interface.js +0 -2
- package/dist/email/providers/email-provider.interface.js.map +0 -1
- package/dist/email/providers/index.d.ts +0 -5
- package/dist/email/providers/index.d.ts.map +0 -1
- package/dist/email/providers/index.js +0 -5
- package/dist/email/providers/index.js.map +0 -1
- package/dist/email/providers/resend.provider.d.ts +0 -26
- package/dist/email/providers/resend.provider.d.ts.map +0 -1
- package/dist/email/providers/resend.provider.js +0 -84
- package/dist/email/providers/resend.provider.js.map +0 -1
- package/dist/email/providers/smtp.provider.d.ts +0 -25
- package/dist/email/providers/smtp.provider.d.ts.map +0 -1
- package/dist/email/providers/smtp.provider.js +0 -86
- package/dist/email/providers/smtp.provider.js.map +0 -1
- package/dist/email/services/email-provider-factory.d.ts +0 -24
- package/dist/email/services/email-provider-factory.d.ts.map +0 -1
- package/dist/email/services/email-provider-factory.js +0 -59
- package/dist/email/services/email-provider-factory.js.map +0 -1
- package/dist/email/services/email.service.d.ts +0 -51
- package/dist/email/services/email.service.d.ts.map +0 -1
- package/dist/email/services/email.service.js +0 -75
- package/dist/email/services/email.service.js.map +0 -1
- package/dist/email/services/index.d.ts +0 -3
- package/dist/email/services/index.d.ts.map +0 -1
- package/dist/email/services/index.js +0 -3
- package/dist/email/services/index.js.map +0 -1
- package/dist/env.d.ts +0 -21
- package/dist/env.d.ts.map +0 -1
- package/dist/env.js +0 -2
- package/dist/env.js.map +0 -1
- package/dist/errors/application-error.d.ts +0 -87
- package/dist/errors/application-error.d.ts.map +0 -1
- package/dist/errors/application-error.js +0 -130
- package/dist/errors/application-error.js.map +0 -1
- package/dist/errors/error-codes.d.ts +0 -202
- package/dist/errors/error-codes.d.ts.map +0 -1
- package/dist/errors/error-codes.js +0 -184
- package/dist/errors/error-codes.js.map +0 -1
- package/dist/errors/error-response.d.ts +0 -32
- package/dist/errors/error-response.d.ts.map +0 -1
- package/dist/errors/error-response.js +0 -14
- package/dist/errors/error-response.js.map +0 -1
- package/dist/errors/get-http-status.d.ts +0 -12
- package/dist/errors/get-http-status.d.ts.map +0 -1
- package/dist/errors/get-http-status.js +0 -62
- package/dist/errors/get-http-status.js.map +0 -1
- package/dist/errors/global-error-handler.d.ts +0 -81
- package/dist/errors/global-error-handler.d.ts.map +0 -1
- package/dist/errors/global-error-handler.js +0 -176
- package/dist/errors/global-error-handler.js.map +0 -1
- package/dist/errors/index.d.ts +0 -10
- package/dist/errors/index.d.ts.map +0 -1
- package/dist/errors/index.js +0 -10
- package/dist/errors/index.js.map +0 -1
- package/dist/errors/internal-error.d.ts +0 -16
- package/dist/errors/internal-error.d.ts.map +0 -1
- package/dist/errors/internal-error.js +0 -19
- package/dist/errors/internal-error.js.map +0 -1
- package/dist/errors/is-application-error.d.ts +0 -9
- package/dist/errors/is-application-error.d.ts.map +0 -1
- package/dist/errors/is-application-error.js +0 -11
- package/dist/errors/is-application-error.js.map +0 -1
- package/dist/errors/request-container-not-initialized.error.d.ts +0 -12
- package/dist/errors/request-container-not-initialized.error.d.ts.map +0 -1
- package/dist/errors/request-container-not-initialized.error.js +0 -15
- package/dist/errors/request-container-not-initialized.error.js.map +0 -1
- package/dist/errors/stratal-not-initialized.error.d.ts +0 -11
- package/dist/errors/stratal-not-initialized.error.d.ts.map +0 -1
- package/dist/errors/stratal-not-initialized.error.js +0 -14
- package/dist/errors/stratal-not-initialized.error.js.map +0 -1
- package/dist/events/constants.d.ts +0 -11
- package/dist/events/constants.d.ts.map +0 -1
- package/dist/events/constants.js +0 -11
- package/dist/events/constants.js.map +0 -1
- package/dist/events/decorators/index.d.ts +0 -3
- package/dist/events/decorators/index.d.ts.map +0 -1
- package/dist/events/decorators/index.js +0 -3
- package/dist/events/decorators/index.js.map +0 -1
- package/dist/events/decorators/listener.decorator.d.ts +0 -24
- package/dist/events/decorators/listener.decorator.d.ts.map +0 -1
- package/dist/events/decorators/listener.decorator.js +0 -33
- package/dist/events/decorators/listener.decorator.js.map +0 -1
- package/dist/events/decorators/on.decorator.d.ts +0 -28
- package/dist/events/decorators/on.decorator.d.ts.map +0 -1
- package/dist/events/decorators/on.decorator.js +0 -41
- package/dist/events/decorators/on.decorator.js.map +0 -1
- package/dist/events/event-registry.d.ts +0 -26
- package/dist/events/event-registry.d.ts.map +0 -1
- package/dist/events/event-registry.js +0 -156
- package/dist/events/event-registry.js.map +0 -1
- package/dist/events/index.d.ts +0 -5
- package/dist/events/index.d.ts.map +0 -1
- package/dist/events/index.js +0 -4
- package/dist/events/index.js.map +0 -1
- package/dist/events/types.d.ts +0 -116
- package/dist/events/types.d.ts.map +0 -1
- package/dist/events/types.js +0 -23
- package/dist/events/types.js.map +0 -1
- package/dist/execution-context.d.ts +0 -4
- package/dist/execution-context.d.ts.map +0 -1
- package/dist/execution-context.js +0 -2
- package/dist/execution-context.js.map +0 -1
- package/dist/guards/guard-execution.service.d.ts +0 -37
- package/dist/guards/guard-execution.service.d.ts.map +0 -1
- package/dist/guards/guard-execution.service.js +0 -74
- package/dist/guards/guard-execution.service.js.map +0 -1
- package/dist/guards/index.d.ts +0 -12
- package/dist/guards/index.d.ts.map +0 -1
- package/dist/guards/index.js +0 -12
- package/dist/guards/index.js.map +0 -1
- package/dist/guards/types.d.ts +0 -60
- package/dist/guards/types.d.ts.map +0 -1
- package/dist/guards/types.js +0 -5
- package/dist/guards/types.js.map +0 -1
- package/dist/guards/use-guards.decorator.d.ts +0 -73
- package/dist/guards/use-guards.decorator.d.ts.map +0 -1
- package/dist/guards/use-guards.decorator.js +0 -89
- package/dist/guards/use-guards.decorator.js.map +0 -1
- package/dist/i18n/errors/index.d.ts +0 -6
- package/dist/i18n/errors/index.d.ts.map +0 -1
- package/dist/i18n/errors/index.js +0 -6
- package/dist/i18n/errors/index.js.map +0 -1
- package/dist/i18n/errors/locale-not-supported.error.d.ts +0 -12
- package/dist/i18n/errors/locale-not-supported.error.d.ts.map +0 -1
- package/dist/i18n/errors/locale-not-supported.error.js +0 -15
- package/dist/i18n/errors/locale-not-supported.error.js.map +0 -1
- package/dist/i18n/errors/translation-missing.error.d.ts +0 -12
- package/dist/i18n/errors/translation-missing.error.d.ts.map +0 -1
- package/dist/i18n/errors/translation-missing.error.js +0 -14
- package/dist/i18n/errors/translation-missing.error.js.map +0 -1
- package/dist/i18n/i18n.module.d.ts +0 -60
- package/dist/i18n/i18n.module.d.ts.map +0 -1
- package/dist/i18n/i18n.module.js +0 -103
- package/dist/i18n/i18n.module.js.map +0 -1
- package/dist/i18n/i18n.options.d.ts +0 -60
- package/dist/i18n/i18n.options.d.ts.map +0 -1
- package/dist/i18n/i18n.options.js +0 -18
- package/dist/i18n/i18n.options.js.map +0 -1
- package/dist/i18n/i18n.tokens.d.ts +0 -13
- package/dist/i18n/i18n.tokens.d.ts.map +0 -1
- package/dist/i18n/i18n.tokens.js +0 -13
- package/dist/i18n/i18n.tokens.js.map +0 -1
- package/dist/i18n/i18n.types.d.ts +0 -78
- package/dist/i18n/i18n.types.d.ts.map +0 -1
- package/dist/i18n/i18n.types.js +0 -8
- package/dist/i18n/i18n.types.js.map +0 -1
- package/dist/i18n/index.d.ts +0 -12
- package/dist/i18n/index.d.ts.map +0 -1
- package/dist/i18n/index.js +0 -12
- package/dist/i18n/index.js.map +0 -1
- package/dist/i18n/messages/en/common.d.ts +0 -19
- package/dist/i18n/messages/en/common.d.ts.map +0 -1
- package/dist/i18n/messages/en/common.js +0 -19
- package/dist/i18n/messages/en/common.js.map +0 -1
- package/dist/i18n/messages/en/emails.d.ts +0 -12
- package/dist/i18n/messages/en/emails.d.ts.map +0 -1
- package/dist/i18n/messages/en/emails.js +0 -12
- package/dist/i18n/messages/en/emails.js.map +0 -1
- package/dist/i18n/messages/en/errors.d.ts +0 -113
- package/dist/i18n/messages/en/errors.d.ts.map +0 -1
- package/dist/i18n/messages/en/errors.js +0 -130
- package/dist/i18n/messages/en/errors.js.map +0 -1
- package/dist/i18n/messages/en/index.d.ts +0 -13
- package/dist/i18n/messages/en/index.d.ts.map +0 -1
- package/dist/i18n/messages/en/index.js +0 -13
- package/dist/i18n/messages/en/index.js.map +0 -1
- package/dist/i18n/messages/en/validation.d.ts +0 -38
- package/dist/i18n/messages/en/validation.d.ts.map +0 -1
- package/dist/i18n/messages/en/validation.js +0 -38
- package/dist/i18n/messages/en/validation.js.map +0 -1
- package/dist/i18n/messages/en/zod.d.ts +0 -125
- package/dist/i18n/messages/en/zod.d.ts.map +0 -1
- package/dist/i18n/messages/en/zod.js +0 -132
- package/dist/i18n/messages/en/zod.js.map +0 -1
- package/dist/i18n/messages/index.d.ts +0 -27
- package/dist/i18n/messages/index.d.ts.map +0 -1
- package/dist/i18n/messages/index.js +0 -25
- package/dist/i18n/messages/index.js.map +0 -1
- package/dist/i18n/middleware/i18n-context.middleware.d.ts +0 -15
- package/dist/i18n/middleware/i18n-context.middleware.d.ts.map +0 -1
- package/dist/i18n/middleware/i18n-context.middleware.js +0 -42
- package/dist/i18n/middleware/i18n-context.middleware.js.map +0 -1
- package/dist/i18n/middleware/index.d.ts +0 -6
- package/dist/i18n/middleware/index.d.ts.map +0 -1
- package/dist/i18n/middleware/index.js +0 -6
- package/dist/i18n/middleware/index.js.map +0 -1
- package/dist/i18n/middleware/locale-extraction.middleware.d.ts +0 -19
- package/dist/i18n/middleware/locale-extraction.middleware.d.ts.map +0 -1
- package/dist/i18n/middleware/locale-extraction.middleware.js +0 -49
- package/dist/i18n/middleware/locale-extraction.middleware.js.map +0 -1
- package/dist/i18n/services/i18n.service.d.ts +0 -50
- package/dist/i18n/services/i18n.service.d.ts.map +0 -1
- package/dist/i18n/services/i18n.service.js +0 -82
- package/dist/i18n/services/i18n.service.js.map +0 -1
- package/dist/i18n/services/message-loader.service.d.ts +0 -65
- package/dist/i18n/services/message-loader.service.d.ts.map +0 -1
- package/dist/i18n/services/message-loader.service.js +0 -175
- package/dist/i18n/services/message-loader.service.js.map +0 -1
- package/dist/i18n/setup.d.ts +0 -27
- package/dist/i18n/setup.d.ts.map +0 -1
- package/dist/i18n/setup.js +0 -40
- package/dist/i18n/setup.js.map +0 -1
- package/dist/i18n/validation/index.d.ts +0 -9
- package/dist/i18n/validation/index.d.ts.map +0 -1
- package/dist/i18n/validation/index.js +0 -10
- package/dist/i18n/validation/index.js.map +0 -1
- package/dist/i18n/validation/validation.context.d.ts +0 -34
- package/dist/i18n/validation/validation.context.d.ts.map +0 -1
- package/dist/i18n/validation/validation.context.js +0 -42
- package/dist/i18n/validation/validation.context.js.map +0 -1
- package/dist/i18n/validation/validation.error-map.d.ts +0 -8
- package/dist/i18n/validation/validation.error-map.d.ts.map +0 -1
- package/dist/i18n/validation/validation.error-map.js +0 -158
- package/dist/i18n/validation/validation.error-map.js.map +0 -1
- package/dist/i18n/validation/validation.types.d.ts +0 -44
- package/dist/i18n/validation/validation.types.d.ts.map +0 -1
- package/dist/i18n/validation/validation.types.js +0 -2
- package/dist/i18n/validation/validation.types.js.map +0 -1
- package/dist/i18n/validation/with-i18n.d.ts +0 -29
- package/dist/i18n/validation/with-i18n.d.ts.map +0 -1
- package/dist/i18n/validation/with-i18n.js +0 -40
- package/dist/i18n/validation/with-i18n.js.map +0 -1
- package/dist/index.d.ts +0 -6
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -6
- package/dist/index.js.map +0 -1
- package/dist/logger/contracts/index.d.ts +0 -4
- package/dist/logger/contracts/index.d.ts.map +0 -1
- package/dist/logger/contracts/index.js +0 -4
- package/dist/logger/contracts/index.js.map +0 -1
- package/dist/logger/contracts/log-context.d.ts +0 -14
- package/dist/logger/contracts/log-context.d.ts.map +0 -1
- package/dist/logger/contracts/log-context.js +0 -2
- package/dist/logger/contracts/log-context.js.map +0 -1
- package/dist/logger/contracts/log-entry.d.ts +0 -17
- package/dist/logger/contracts/log-entry.d.ts.map +0 -1
- package/dist/logger/contracts/log-entry.js +0 -2
- package/dist/logger/contracts/log-entry.js.map +0 -1
- package/dist/logger/contracts/log-level.d.ts +0 -16
- package/dist/logger/contracts/log-level.d.ts.map +0 -1
- package/dist/logger/contracts/log-level.js +0 -22
- package/dist/logger/contracts/log-level.js.map +0 -1
- package/dist/logger/formatters/formatter.interface.d.ts +0 -14
- package/dist/logger/formatters/formatter.interface.d.ts.map +0 -1
- package/dist/logger/formatters/formatter.interface.js +0 -2
- package/dist/logger/formatters/formatter.interface.js.map +0 -1
- package/dist/logger/formatters/index.d.ts +0 -4
- package/dist/logger/formatters/index.d.ts.map +0 -1
- package/dist/logger/formatters/index.js +0 -4
- package/dist/logger/formatters/index.js.map +0 -1
- package/dist/logger/formatters/json-formatter.d.ts +0 -21
- package/dist/logger/formatters/json-formatter.d.ts.map +0 -1
- package/dist/logger/formatters/json-formatter.js +0 -27
- package/dist/logger/formatters/json-formatter.js.map +0 -1
- package/dist/logger/formatters/pretty-formatter.d.ts +0 -18
- package/dist/logger/formatters/pretty-formatter.d.ts.map +0 -1
- package/dist/logger/formatters/pretty-formatter.js +0 -41
- package/dist/logger/formatters/pretty-formatter.js.map +0 -1
- package/dist/logger/index.d.ts +0 -7
- package/dist/logger/index.d.ts.map +0 -1
- package/dist/logger/index.js +0 -10
- package/dist/logger/index.js.map +0 -1
- package/dist/logger/logger.tokens.d.ts +0 -29
- package/dist/logger/logger.tokens.d.ts.map +0 -1
- package/dist/logger/logger.tokens.js +0 -29
- package/dist/logger/logger.tokens.js.map +0 -1
- package/dist/logger/services/index.d.ts +0 -2
- package/dist/logger/services/index.d.ts.map +0 -1
- package/dist/logger/services/index.js +0 -2
- package/dist/logger/services/index.js.map +0 -1
- package/dist/logger/services/logger.service.d.ts +0 -73
- package/dist/logger/services/logger.service.d.ts.map +0 -1
- package/dist/logger/services/logger.service.js +0 -156
- package/dist/logger/services/logger.service.js.map +0 -1
- package/dist/logger/transports/base-transport.d.ts +0 -24
- package/dist/logger/transports/base-transport.d.ts.map +0 -1
- package/dist/logger/transports/base-transport.js +0 -23
- package/dist/logger/transports/base-transport.js.map +0 -1
- package/dist/logger/transports/console-transport.d.ts +0 -19
- package/dist/logger/transports/console-transport.d.ts.map +0 -1
- package/dist/logger/transports/console-transport.js +0 -53
- package/dist/logger/transports/console-transport.js.map +0 -1
- package/dist/logger/transports/index.d.ts +0 -4
- package/dist/logger/transports/index.d.ts.map +0 -1
- package/dist/logger/transports/index.js +0 -4
- package/dist/logger/transports/index.js.map +0 -1
- package/dist/logger/transports/transport.interface.d.ts +0 -21
- package/dist/logger/transports/transport.interface.d.ts.map +0 -1
- package/dist/logger/transports/transport.interface.js +0 -2
- package/dist/logger/transports/transport.interface.js.map +0 -1
- package/dist/middleware/index.d.ts +0 -24
- package/dist/middleware/index.d.ts.map +0 -1
- package/dist/middleware/index.js +0 -23
- package/dist/middleware/index.js.map +0 -1
- package/dist/middleware/middleware-configuration.service.d.ts +0 -70
- package/dist/middleware/middleware-configuration.service.d.ts.map +0 -1
- package/dist/middleware/middleware-configuration.service.js +0 -239
- package/dist/middleware/middleware-configuration.service.js.map +0 -1
- package/dist/middleware/middleware-consumer.d.ts +0 -57
- package/dist/middleware/middleware-consumer.d.ts.map +0 -1
- package/dist/middleware/middleware-consumer.js +0 -130
- package/dist/middleware/middleware-consumer.js.map +0 -1
- package/dist/middleware/types.d.ts +0 -96
- package/dist/middleware/types.d.ts.map +0 -1
- package/dist/middleware/types.js +0 -2
- package/dist/middleware/types.js.map +0 -1
- package/dist/module/errors/index.d.ts +0 -5
- package/dist/module/errors/index.d.ts.map +0 -1
- package/dist/module/errors/index.js +0 -5
- package/dist/module/errors/index.js.map +0 -1
- package/dist/module/errors/invalid-module-provider.error.d.ts +0 -11
- package/dist/module/errors/invalid-module-provider.error.d.ts.map +0 -1
- package/dist/module/errors/invalid-module-provider.error.js +0 -13
- package/dist/module/errors/invalid-module-provider.error.js.map +0 -1
- package/dist/module/errors/module-already-registered.error.d.ts +0 -11
- package/dist/module/errors/module-already-registered.error.d.ts.map +0 -1
- package/dist/module/errors/module-already-registered.error.js +0 -13
- package/dist/module/errors/module-already-registered.error.js.map +0 -1
- package/dist/module/errors/module-circular-dependency.error.d.ts +0 -11
- package/dist/module/errors/module-circular-dependency.error.d.ts.map +0 -1
- package/dist/module/errors/module-circular-dependency.error.js +0 -14
- package/dist/module/errors/module-circular-dependency.error.js.map +0 -1
- package/dist/module/errors/module-dependency-not-found.error.d.ts +0 -11
- package/dist/module/errors/module-dependency-not-found.error.d.ts.map +0 -1
- package/dist/module/errors/module-dependency-not-found.error.js +0 -13
- package/dist/module/errors/module-dependency-not-found.error.js.map +0 -1
- package/dist/module/index.d.ts +0 -4
- package/dist/module/index.d.ts.map +0 -1
- package/dist/module/index.js +0 -7
- package/dist/module/index.js.map +0 -1
- package/dist/module/module-registry.d.ts +0 -110
- package/dist/module/module-registry.d.ts.map +0 -1
- package/dist/module/module-registry.js +0 -299
- package/dist/module/module-registry.js.map +0 -1
- package/dist/module/module.decorator.d.ts +0 -34
- package/dist/module/module.decorator.d.ts.map +0 -1
- package/dist/module/module.decorator.js +0 -107
- package/dist/module/module.decorator.js.map +0 -1
- package/dist/module/types.d.ts +0 -240
- package/dist/module/types.d.ts.map +0 -1
- package/dist/module/types.js +0 -8
- package/dist/module/types.js.map +0 -1
- package/dist/openapi/index.d.ts +0 -5
- package/dist/openapi/index.d.ts.map +0 -1
- package/dist/openapi/index.js +0 -7
- package/dist/openapi/index.js.map +0 -1
- package/dist/openapi/openapi.module.d.ts +0 -52
- package/dist/openapi/openapi.module.d.ts.map +0 -1
- package/dist/openapi/openapi.module.js +0 -109
- package/dist/openapi/openapi.module.js.map +0 -1
- package/dist/openapi/openapi.tokens.d.ts +0 -12
- package/dist/openapi/openapi.tokens.d.ts.map +0 -1
- package/dist/openapi/openapi.tokens.js +0 -12
- package/dist/openapi/openapi.tokens.js.map +0 -1
- package/dist/openapi/services/index.d.ts +0 -3
- package/dist/openapi/services/index.d.ts.map +0 -1
- package/dist/openapi/services/index.js +0 -3
- package/dist/openapi/services/index.js.map +0 -1
- package/dist/openapi/services/openapi-config.service.d.ts +0 -43
- package/dist/openapi/services/openapi-config.service.d.ts.map +0 -1
- package/dist/openapi/services/openapi-config.service.js +0 -98
- package/dist/openapi/services/openapi-config.service.js.map +0 -1
- package/dist/openapi/services/openapi.service.d.ts +0 -52
- package/dist/openapi/services/openapi.service.d.ts.map +0 -1
- package/dist/openapi/services/openapi.service.js +0 -231
- package/dist/openapi/services/openapi.service.js.map +0 -1
- package/dist/openapi/types.d.ts +0 -84
- package/dist/openapi/types.d.ts.map +0 -1
- package/dist/openapi/types.js +0 -2
- package/dist/openapi/types.js.map +0 -1
- package/dist/queue/consumer-registry.d.ts +0 -77
- package/dist/queue/consumer-registry.d.ts.map +0 -1
- package/dist/queue/consumer-registry.js +0 -110
- package/dist/queue/consumer-registry.js.map +0 -1
- package/dist/queue/decorators/index.d.ts +0 -2
- package/dist/queue/decorators/index.d.ts.map +0 -1
- package/dist/queue/decorators/index.js +0 -2
- package/dist/queue/decorators/index.js.map +0 -1
- package/dist/queue/decorators/inject-queue.decorator.d.ts +0 -31
- package/dist/queue/decorators/inject-queue.decorator.d.ts.map +0 -1
- package/dist/queue/decorators/inject-queue.decorator.js +0 -33
- package/dist/queue/decorators/inject-queue.decorator.js.map +0 -1
- package/dist/queue/errors/index.d.ts +0 -3
- package/dist/queue/errors/index.d.ts.map +0 -1
- package/dist/queue/errors/index.js +0 -3
- package/dist/queue/errors/index.js.map +0 -1
- package/dist/queue/errors/queue-binding-not-found.error.d.ts +0 -12
- package/dist/queue/errors/queue-binding-not-found.error.d.ts.map +0 -1
- package/dist/queue/errors/queue-binding-not-found.error.js +0 -14
- package/dist/queue/errors/queue-binding-not-found.error.js.map +0 -1
- package/dist/queue/errors/queue-provider-not-supported.error.d.ts +0 -13
- package/dist/queue/errors/queue-provider-not-supported.error.d.ts.map +0 -1
- package/dist/queue/errors/queue-provider-not-supported.error.js +0 -15
- package/dist/queue/errors/queue-provider-not-supported.error.js.map +0 -1
- package/dist/queue/index.d.ts +0 -14
- package/dist/queue/index.d.ts.map +0 -1
- package/dist/queue/index.js +0 -21
- package/dist/queue/index.js.map +0 -1
- package/dist/queue/providers/cloudflare-queue.provider.d.ts +0 -42
- package/dist/queue/providers/cloudflare-queue.provider.d.ts.map +0 -1
- package/dist/queue/providers/cloudflare-queue.provider.js +0 -73
- package/dist/queue/providers/cloudflare-queue.provider.js.map +0 -1
- package/dist/queue/providers/index.d.ts +0 -4
- package/dist/queue/providers/index.d.ts.map +0 -1
- package/dist/queue/providers/index.js +0 -4
- package/dist/queue/providers/index.js.map +0 -1
- package/dist/queue/providers/queue-provider.interface.d.ts +0 -34
- package/dist/queue/providers/queue-provider.interface.d.ts.map +0 -1
- package/dist/queue/providers/queue-provider.interface.js +0 -2
- package/dist/queue/providers/queue-provider.interface.js.map +0 -1
- package/dist/queue/providers/sync-queue.provider.d.ts +0 -48
- package/dist/queue/providers/sync-queue.provider.d.ts.map +0 -1
- package/dist/queue/providers/sync-queue.provider.js +0 -89
- package/dist/queue/providers/sync-queue.provider.js.map +0 -1
- package/dist/queue/queue-consumer.d.ts +0 -62
- package/dist/queue/queue-consumer.d.ts.map +0 -1
- package/dist/queue/queue-consumer.js +0 -2
- package/dist/queue/queue-consumer.js.map +0 -1
- package/dist/queue/queue-manager.d.ts +0 -36
- package/dist/queue/queue-manager.d.ts.map +0 -1
- package/dist/queue/queue-manager.js +0 -80
- package/dist/queue/queue-manager.js.map +0 -1
- package/dist/queue/queue-name.d.ts +0 -50
- package/dist/queue/queue-name.d.ts.map +0 -1
- package/dist/queue/queue-name.js +0 -21
- package/dist/queue/queue-name.js.map +0 -1
- package/dist/queue/queue-registry.d.ts +0 -46
- package/dist/queue/queue-registry.d.ts.map +0 -1
- package/dist/queue/queue-registry.js +0 -78
- package/dist/queue/queue-registry.js.map +0 -1
- package/dist/queue/queue-sender.d.ts +0 -38
- package/dist/queue/queue-sender.d.ts.map +0 -1
- package/dist/queue/queue-sender.interface.d.ts +0 -46
- package/dist/queue/queue-sender.interface.d.ts.map +0 -1
- package/dist/queue/queue-sender.interface.js +0 -2
- package/dist/queue/queue-sender.interface.js.map +0 -1
- package/dist/queue/queue-sender.js +0 -54
- package/dist/queue/queue-sender.js.map +0 -1
- package/dist/queue/queue.module.d.ts +0 -80
- package/dist/queue/queue.module.d.ts.map +0 -1
- package/dist/queue/queue.module.js +0 -113
- package/dist/queue/queue.module.js.map +0 -1
- package/dist/queue/queue.tokens.d.ts +0 -7
- package/dist/queue/queue.tokens.d.ts.map +0 -1
- package/dist/queue/queue.tokens.js +0 -6
- package/dist/queue/queue.tokens.js.map +0 -1
- package/dist/queue/services/index.d.ts +0 -2
- package/dist/queue/services/index.d.ts.map +0 -1
- package/dist/queue/services/index.js +0 -2
- package/dist/queue/services/index.js.map +0 -1
- package/dist/queue/services/queue-provider-factory.d.ts +0 -41
- package/dist/queue/services/queue-provider-factory.d.ts.map +0 -1
- package/dist/queue/services/queue-provider-factory.js +0 -78
- package/dist/queue/services/queue-provider-factory.js.map +0 -1
- package/dist/router/constants.d.ts +0 -87
- package/dist/router/constants.d.ts.map +0 -1
- package/dist/router/constants.js +0 -69
- package/dist/router/constants.js.map +0 -1
- package/dist/router/controller.d.ts +0 -56
- package/dist/router/controller.d.ts.map +0 -1
- package/dist/router/controller.js +0 -2
- package/dist/router/controller.js.map +0 -1
- package/dist/router/decorators/controller.decorator.d.ts +0 -46
- package/dist/router/decorators/controller.decorator.d.ts.map +0 -1
- package/dist/router/decorators/controller.decorator.js +0 -70
- package/dist/router/decorators/controller.decorator.js.map +0 -1
- package/dist/router/decorators/http-method.decorator.d.ts +0 -83
- package/dist/router/decorators/http-method.decorator.d.ts.map +0 -1
- package/dist/router/decorators/http-method.decorator.js +0 -113
- package/dist/router/decorators/http-method.decorator.js.map +0 -1
- package/dist/router/decorators/index.d.ts +0 -4
- package/dist/router/decorators/index.d.ts.map +0 -1
- package/dist/router/decorators/index.js +0 -6
- package/dist/router/decorators/index.js.map +0 -1
- package/dist/router/decorators/route.decorator.d.ts +0 -90
- package/dist/router/decorators/route.decorator.d.ts.map +0 -1
- package/dist/router/decorators/route.decorator.js +0 -102
- package/dist/router/decorators/route.decorator.js.map +0 -1
- package/dist/router/errors/controller-method-not-found.error.d.ts +0 -11
- package/dist/router/errors/controller-method-not-found.error.d.ts.map +0 -1
- package/dist/router/errors/controller-method-not-found.error.js +0 -13
- package/dist/router/errors/controller-method-not-found.error.js.map +0 -1
- package/dist/router/errors/controller-registration.error.d.ts +0 -15
- package/dist/router/errors/controller-registration.error.d.ts.map +0 -1
- package/dist/router/errors/controller-registration.error.js +0 -20
- package/dist/router/errors/controller-registration.error.js.map +0 -1
- package/dist/router/errors/hono-app-already-configured.error.d.ts +0 -10
- package/dist/router/errors/hono-app-already-configured.error.d.ts.map +0 -1
- package/dist/router/errors/hono-app-already-configured.error.js +0 -12
- package/dist/router/errors/hono-app-already-configured.error.js.map +0 -1
- package/dist/router/errors/index.d.ts +0 -8
- package/dist/router/errors/index.d.ts.map +0 -1
- package/dist/router/errors/index.js +0 -8
- package/dist/router/errors/index.js.map +0 -1
- package/dist/router/errors/openapi-route-registration.error.d.ts +0 -17
- package/dist/router/errors/openapi-route-registration.error.d.ts.map +0 -1
- package/dist/router/errors/openapi-route-registration.error.js +0 -19
- package/dist/router/errors/openapi-route-registration.error.js.map +0 -1
- package/dist/router/errors/openapi-validation.error.d.ts +0 -19
- package/dist/router/errors/openapi-validation.error.d.ts.map +0 -1
- package/dist/router/errors/openapi-validation.error.js +0 -21
- package/dist/router/errors/openapi-validation.error.js.map +0 -1
- package/dist/router/errors/route-not-found.error.d.ts +0 -11
- package/dist/router/errors/route-not-found.error.d.ts.map +0 -1
- package/dist/router/errors/route-not-found.error.js +0 -13
- package/dist/router/errors/route-not-found.error.js.map +0 -1
- package/dist/router/errors/schema-validation.error.d.ts +0 -11
- package/dist/router/errors/schema-validation.error.d.ts.map +0 -1
- package/dist/router/errors/schema-validation.error.js +0 -17
- package/dist/router/errors/schema-validation.error.js.map +0 -1
- package/dist/router/hono-app.d.ts +0 -38
- package/dist/router/hono-app.d.ts.map +0 -1
- package/dist/router/hono-app.js +0 -126
- package/dist/router/hono-app.js.map +0 -1
- package/dist/router/index.d.ts +0 -16
- package/dist/router/index.d.ts.map +0 -1
- package/dist/router/index.js +0 -21
- package/dist/router/index.js.map +0 -1
- package/dist/router/middleware/index.d.ts +0 -2
- package/dist/router/middleware/index.d.ts.map +0 -1
- package/dist/router/middleware/index.js +0 -4
- package/dist/router/middleware/index.js.map +0 -1
- package/dist/router/middleware/logger.middleware.d.ts +0 -19
- package/dist/router/middleware/logger.middleware.d.ts.map +0 -1
- package/dist/router/middleware/logger.middleware.js +0 -32
- package/dist/router/middleware/logger.middleware.js.map +0 -1
- package/dist/router/middleware.interface.d.ts +0 -38
- package/dist/router/middleware.interface.d.ts.map +0 -1
- package/dist/router/middleware.interface.js +0 -2
- package/dist/router/middleware.interface.js.map +0 -1
- package/dist/router/router-context.d.ts +0 -143
- package/dist/router/router-context.d.ts.map +0 -1
- package/dist/router/router-context.js +0 -179
- package/dist/router/router-context.js.map +0 -1
- package/dist/router/router.tokens.d.ts +0 -11
- package/dist/router/router.tokens.d.ts.map +0 -1
- package/dist/router/router.tokens.js +0 -11
- package/dist/router/router.tokens.js.map +0 -1
- package/dist/router/schemas/common.schemas.d.ts +0 -148
- package/dist/router/schemas/common.schemas.d.ts.map +0 -1
- package/dist/router/schemas/common.schemas.js +0 -88
- package/dist/router/schemas/common.schemas.js.map +0 -1
- package/dist/router/schemas/index.d.ts +0 -2
- package/dist/router/schemas/index.d.ts.map +0 -1
- package/dist/router/schemas/index.js +0 -2
- package/dist/router/schemas/index.js.map +0 -1
- package/dist/router/services/index.d.ts +0 -6
- package/dist/router/services/index.d.ts.map +0 -1
- package/dist/router/services/index.js +0 -6
- package/dist/router/services/index.js.map +0 -1
- package/dist/router/services/route-registration.service.d.ts +0 -129
- package/dist/router/services/route-registration.service.d.ts.map +0 -1
- package/dist/router/services/route-registration.service.js +0 -700
- package/dist/router/services/route-registration.service.js.map +0 -1
- package/dist/router/types.d.ts +0 -187
- package/dist/router/types.d.ts.map +0 -1
- package/dist/router/types.js +0 -2
- package/dist/router/types.js.map +0 -1
- package/dist/storage/contracts/delete-file.input.d.ts +0 -7
- package/dist/storage/contracts/delete-file.input.d.ts.map +0 -1
- package/dist/storage/contracts/delete-file.input.js +0 -6
- package/dist/storage/contracts/delete-file.input.js.map +0 -1
- package/dist/storage/contracts/download-result.d.ts +0 -28
- package/dist/storage/contracts/download-result.d.ts.map +0 -1
- package/dist/storage/contracts/download-result.js +0 -2
- package/dist/storage/contracts/download-result.js.map +0 -1
- package/dist/storage/contracts/file-exists.input.d.ts +0 -7
- package/dist/storage/contracts/file-exists.input.d.ts.map +0 -1
- package/dist/storage/contracts/file-exists.input.js +0 -6
- package/dist/storage/contracts/file-exists.input.js.map +0 -1
- package/dist/storage/contracts/get-presigned-url.input.d.ts +0 -26
- package/dist/storage/contracts/get-presigned-url.input.d.ts.map +0 -1
- package/dist/storage/contracts/get-presigned-url.input.js +0 -14
- package/dist/storage/contracts/get-presigned-url.input.js.map +0 -1
- package/dist/storage/contracts/index.d.ts +0 -6
- package/dist/storage/contracts/index.d.ts.map +0 -1
- package/dist/storage/contracts/index.js +0 -6
- package/dist/storage/contracts/index.js.map +0 -1
- package/dist/storage/contracts/upload-file.input.d.ts +0 -34
- package/dist/storage/contracts/upload-file.input.d.ts.map +0 -1
- package/dist/storage/contracts/upload-file.input.js +0 -10
- package/dist/storage/contracts/upload-file.input.js.map +0 -1
- package/dist/storage/dom.polyfill.d.ts +0 -2
- package/dist/storage/dom.polyfill.d.ts.map +0 -1
- package/dist/storage/dom.polyfill.js +0 -30
- package/dist/storage/dom.polyfill.js.map +0 -1
- package/dist/storage/errors/disk-not-configured.error.d.ts +0 -5
- package/dist/storage/errors/disk-not-configured.error.d.ts.map +0 -1
- package/dist/storage/errors/disk-not-configured.error.js +0 -7
- package/dist/storage/errors/disk-not-configured.error.js.map +0 -1
- package/dist/storage/errors/file-not-found.error.d.ts +0 -5
- package/dist/storage/errors/file-not-found.error.d.ts.map +0 -1
- package/dist/storage/errors/file-not-found.error.js +0 -8
- package/dist/storage/errors/file-not-found.error.js.map +0 -1
- package/dist/storage/errors/file-too-large.error.d.ts +0 -5
- package/dist/storage/errors/file-too-large.error.d.ts.map +0 -1
- package/dist/storage/errors/file-too-large.error.js +0 -11
- package/dist/storage/errors/file-too-large.error.js.map +0 -1
- package/dist/storage/errors/index.d.ts +0 -9
- package/dist/storage/errors/index.d.ts.map +0 -1
- package/dist/storage/errors/index.js +0 -9
- package/dist/storage/errors/index.js.map +0 -1
- package/dist/storage/errors/invalid-disk.error.d.ts +0 -5
- package/dist/storage/errors/invalid-disk.error.d.ts.map +0 -1
- package/dist/storage/errors/invalid-disk.error.js +0 -8
- package/dist/storage/errors/invalid-disk.error.js.map +0 -1
- package/dist/storage/errors/invalid-file-type.error.d.ts +0 -5
- package/dist/storage/errors/invalid-file-type.error.d.ts.map +0 -1
- package/dist/storage/errors/invalid-file-type.error.js +0 -10
- package/dist/storage/errors/invalid-file-type.error.js.map +0 -1
- package/dist/storage/errors/presigned-url-invalid-expiry.error.d.ts +0 -5
- package/dist/storage/errors/presigned-url-invalid-expiry.error.d.ts.map +0 -1
- package/dist/storage/errors/presigned-url-invalid-expiry.error.js +0 -12
- package/dist/storage/errors/presigned-url-invalid-expiry.error.js.map +0 -1
- package/dist/storage/errors/storage-provider-not-supported.error.d.ts +0 -5
- package/dist/storage/errors/storage-provider-not-supported.error.d.ts.map +0 -1
- package/dist/storage/errors/storage-provider-not-supported.error.js +0 -8
- package/dist/storage/errors/storage-provider-not-supported.error.js.map +0 -1
- package/dist/storage/errors/storage-response-body-missing.error.d.ts +0 -5
- package/dist/storage/errors/storage-response-body-missing.error.d.ts.map +0 -1
- package/dist/storage/errors/storage-response-body-missing.error.js +0 -8
- package/dist/storage/errors/storage-response-body-missing.error.js.map +0 -1
- package/dist/storage/index.d.ts +0 -15
- package/dist/storage/index.d.ts.map +0 -1
- package/dist/storage/index.js +0 -18
- package/dist/storage/index.js.map +0 -1
- package/dist/storage/providers/s3-multipart-provider.interface.d.ts +0 -194
- package/dist/storage/providers/s3-multipart-provider.interface.d.ts.map +0 -1
- package/dist/storage/providers/s3-multipart-provider.interface.js +0 -2
- package/dist/storage/providers/s3-multipart-provider.interface.js.map +0 -1
- package/dist/storage/providers/s3-storage.provider.d.ts +0 -77
- package/dist/storage/providers/s3-storage.provider.d.ts.map +0 -1
- package/dist/storage/providers/s3-storage.provider.js +0 -310
- package/dist/storage/providers/s3-storage.provider.js.map +0 -1
- package/dist/storage/providers/storage-provider.interface.d.ts +0 -58
- package/dist/storage/providers/storage-provider.interface.d.ts.map +0 -1
- package/dist/storage/providers/storage-provider.interface.js +0 -2
- package/dist/storage/providers/storage-provider.interface.js.map +0 -1
- package/dist/storage/services/storage-manager.service.d.ts +0 -48
- package/dist/storage/services/storage-manager.service.d.ts.map +0 -1
- package/dist/storage/services/storage-manager.service.js +0 -111
- package/dist/storage/services/storage-manager.service.js.map +0 -1
- package/dist/storage/services/storage.service.d.ts +0 -137
- package/dist/storage/services/storage.service.d.ts.map +0 -1
- package/dist/storage/services/storage.service.js +0 -229
- package/dist/storage/services/storage.service.js.map +0 -1
- package/dist/storage/storage.module.d.ts +0 -52
- package/dist/storage/storage.module.d.ts.map +0 -1
- package/dist/storage/storage.module.js +0 -81
- package/dist/storage/storage.module.js.map +0 -1
- package/dist/storage/storage.tokens.d.ts +0 -10
- package/dist/storage/storage.tokens.d.ts.map +0 -1
- package/dist/storage/storage.tokens.js +0 -10
- package/dist/storage/storage.tokens.js.map +0 -1
- package/dist/storage/types.d.ts +0 -31
- package/dist/storage/types.d.ts.map +0 -1
- package/dist/storage/types.js +0 -2
- package/dist/storage/types.js.map +0 -1
- package/dist/stratal.d.ts +0 -39
- package/dist/stratal.d.ts.map +0 -1
- package/dist/stratal.js +0 -77
- package/dist/stratal.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/websocket/decorators/gateway.decorator.d.ts +0 -39
- package/dist/websocket/decorators/gateway.decorator.d.ts.map +0 -1
- package/dist/websocket/decorators/gateway.decorator.js +0 -55
- package/dist/websocket/decorators/gateway.decorator.js.map +0 -1
- package/dist/websocket/decorators/index.d.ts +0 -3
- package/dist/websocket/decorators/index.d.ts.map +0 -1
- package/dist/websocket/decorators/index.js +0 -3
- package/dist/websocket/decorators/index.js.map +0 -1
- package/dist/websocket/decorators/ws-event.decorator.d.ts +0 -59
- package/dist/websocket/decorators/ws-event.decorator.d.ts.map +0 -1
- package/dist/websocket/decorators/ws-event.decorator.js +0 -94
- package/dist/websocket/decorators/ws-event.decorator.js.map +0 -1
- package/dist/websocket/errors/websocket-body-not-available.error.d.ts +0 -5
- package/dist/websocket/errors/websocket-body-not-available.error.d.ts.map +0 -1
- package/dist/websocket/errors/websocket-body-not-available.error.js +0 -7
- package/dist/websocket/errors/websocket-body-not-available.error.js.map +0 -1
- package/dist/websocket/errors/websocket-duplicate-event-handler.error.d.ts +0 -5
- package/dist/websocket/errors/websocket-duplicate-event-handler.error.d.ts.map +0 -1
- package/dist/websocket/errors/websocket-duplicate-event-handler.error.js +0 -7
- package/dist/websocket/errors/websocket-duplicate-event-handler.error.js.map +0 -1
- package/dist/websocket/gateway-context.d.ts +0 -51
- package/dist/websocket/gateway-context.d.ts.map +0 -1
- package/dist/websocket/gateway-context.js +0 -66
- package/dist/websocket/gateway-context.js.map +0 -1
- package/dist/websocket/index.d.ts +0 -7
- package/dist/websocket/index.d.ts.map +0 -1
- package/dist/websocket/index.js +0 -5
- package/dist/websocket/index.js.map +0 -1
- package/dist/websocket/types.d.ts +0 -7
- package/dist/websocket/types.d.ts.map +0 -1
- package/dist/websocket/types.js +0 -2
- package/dist/websocket/types.js.map +0 -1
- package/dist/workers/index.d.ts +0 -5
- package/dist/workers/index.d.ts.map +0 -1
- package/dist/workers/index.js +0 -5
- package/dist/workers/index.js.map +0 -1
- package/dist/workers/run-in-scope.d.ts +0 -9
- package/dist/workers/run-in-scope.d.ts.map +0 -1
- package/dist/workers/run-in-scope.js +0 -13
- package/dist/workers/run-in-scope.js.map +0 -1
- package/dist/workers/stratal-durable-object.d.ts +0 -28
- package/dist/workers/stratal-durable-object.d.ts.map +0 -1
- package/dist/workers/stratal-durable-object.js +0 -34
- package/dist/workers/stratal-durable-object.js.map +0 -1
- package/dist/workers/stratal-worker-entrypoint.d.ts +0 -27
- package/dist/workers/stratal-worker-entrypoint.d.ts.map +0 -1
- package/dist/workers/stratal-worker-entrypoint.js +0 -28
- package/dist/workers/stratal-worker-entrypoint.js.map +0 -1
- package/dist/workers/stratal-workflow.d.ts +0 -27
- package/dist/workers/stratal-workflow.d.ts.map +0 -1
- package/dist/workers/stratal-workflow.js +0 -28
- package/dist/workers/stratal-workflow.js.map +0 -1
|
@@ -0,0 +1,2616 @@
|
|
|
1
|
+
import { t as index_d_exports } from "./index-CSuHOJc3.mjs";
|
|
2
|
+
import { t as Constructor } from "./types-Cu4jkeiH.mjs";
|
|
3
|
+
import { _ as II18nService, a as index_d_exports$1, o as z, t as OpenAPIHono, v as MessageKeys, y as MessageParams } from "./index-CpAN9ENH.mjs";
|
|
4
|
+
import { i as LoggerService } from "./index-Cfkie8JM.mjs";
|
|
5
|
+
import { DependencyContainer, DependencyContainer as DependencyContainer$1, container as container$1, delay, inject as inject$1, injectable as injectable$1, instancePerContainerCachingFactory as instancePerContainerCachingFactory$1, singleton } from "tsyringe";
|
|
6
|
+
import { SSEMessage, SSEStreamingApi, SSEStreamingApi as SSEStreamingApi$1 } from "hono/streaming";
|
|
7
|
+
import { CoreContext } from "@intlify/core-base";
|
|
8
|
+
import { Context } from "hono";
|
|
9
|
+
import { ContentfulStatusCode, RedirectStatusCode } from "hono/utils/http-status";
|
|
10
|
+
import { StreamingApi, StreamingApi as StreamingApi$1 } from "hono/utils/stream";
|
|
11
|
+
import InjectionToken$1, { default as InjectionToken$2 } from "tsyringe/dist/typings/providers/injection-token";
|
|
12
|
+
|
|
13
|
+
//#region src/errors/error-response.d.ts
|
|
14
|
+
type Environment = 'development' | 'staging' | 'production';
|
|
15
|
+
interface ErrorResponse {
|
|
16
|
+
/**
|
|
17
|
+
* Numeric error code for identification and escalation
|
|
18
|
+
* See error-codes.ts for the complete registry
|
|
19
|
+
*/
|
|
20
|
+
code: number;
|
|
21
|
+
/**
|
|
22
|
+
* Human-readable error message
|
|
23
|
+
* Fixed per error type, not customizable
|
|
24
|
+
*/
|
|
25
|
+
message: string;
|
|
26
|
+
/**
|
|
27
|
+
* ISO timestamp when the error occurred
|
|
28
|
+
*/
|
|
29
|
+
timestamp: string;
|
|
30
|
+
/**
|
|
31
|
+
* Additional structured data about the error
|
|
32
|
+
* Only included in development environment
|
|
33
|
+
*/
|
|
34
|
+
metadata?: Record<string, unknown>;
|
|
35
|
+
/**
|
|
36
|
+
* Stack trace for debugging
|
|
37
|
+
* Only included in development environment
|
|
38
|
+
*/
|
|
39
|
+
stack?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Type guard to check if an object is an ErrorResponse
|
|
43
|
+
*/
|
|
44
|
+
declare function isErrorResponse(obj: unknown): obj is ErrorResponse;
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/i18n/messages/index.d.ts
|
|
47
|
+
/**
|
|
48
|
+
* All locale messages
|
|
49
|
+
* Explicitly import and export (no filesystem scanning - Cloudflare Workers compatible)
|
|
50
|
+
*/
|
|
51
|
+
declare const messages: {
|
|
52
|
+
readonly en: typeof index_d_exports;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Type for all messages
|
|
56
|
+
*/
|
|
57
|
+
type Messages = typeof messages;
|
|
58
|
+
/**
|
|
59
|
+
* Get messages for all locales
|
|
60
|
+
*/
|
|
61
|
+
declare function getMessages(): Record<string, Record<string, unknown>>;
|
|
62
|
+
/**
|
|
63
|
+
* Get available locales
|
|
64
|
+
*/
|
|
65
|
+
declare function getLocales(): string[];
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/di/types.d.ts
|
|
68
|
+
/**
|
|
69
|
+
* Service scope for DI registration
|
|
70
|
+
*
|
|
71
|
+
* Maps directly to tsyringe's Lifecycle enum.
|
|
72
|
+
* Scope is specified at registration time via provider configuration,
|
|
73
|
+
* not at class decoration time.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```typescript
|
|
77
|
+
* // In module providers:
|
|
78
|
+
* { provide: MY_TOKEN, useClass: MyService, scope: Scope.Singleton }
|
|
79
|
+
*
|
|
80
|
+
* // In Application.ts:
|
|
81
|
+
* container.register(MY_TOKEN, MyService, Scope.Request)
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
declare enum Scope {
|
|
85
|
+
/** New instance per resolution (default) */
|
|
86
|
+
Transient = 0,
|
|
87
|
+
/** Single instance shared globally */
|
|
88
|
+
Singleton = 1,
|
|
89
|
+
/** New instance per child container (per request) */
|
|
90
|
+
Request = 3
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Options for conditional binding with `when()` method
|
|
94
|
+
*/
|
|
95
|
+
interface WhenOptions {
|
|
96
|
+
/**
|
|
97
|
+
* Cache predicate result after first evaluation.
|
|
98
|
+
* When true, the predicate is evaluated once and the result is reused.
|
|
99
|
+
* When false (default), predicate is evaluated on each resolution.
|
|
100
|
+
*/
|
|
101
|
+
cache?: boolean;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Decorator function type for extend() method
|
|
105
|
+
*
|
|
106
|
+
* @template T The service type being decorated
|
|
107
|
+
*/
|
|
108
|
+
type ExtensionDecorator<T> = (service: T, container: ContainerLike) => T;
|
|
109
|
+
/**
|
|
110
|
+
* Minimal container interface for decorator functions
|
|
111
|
+
* Avoids circular dependency with Container class
|
|
112
|
+
*/
|
|
113
|
+
interface ContainerLike {
|
|
114
|
+
resolve<T>(token: InjectionToken$1<T>): T;
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region src/di/conditional-binding-builder.d.ts
|
|
118
|
+
/**
|
|
119
|
+
* Container interface for predicate functions
|
|
120
|
+
* Using a minimal interface to avoid circular imports
|
|
121
|
+
*/
|
|
122
|
+
interface PredicateContainer {
|
|
123
|
+
resolve<T>(token: InjectionToken$1<T>): T;
|
|
124
|
+
isRegistered<T>(token: InjectionToken$1<T>): boolean;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Initial builder returned by container.when()
|
|
128
|
+
*/
|
|
129
|
+
interface ConditionalBindingBuilder {
|
|
130
|
+
/**
|
|
131
|
+
* Specify the token to conditionally bind
|
|
132
|
+
*
|
|
133
|
+
* @param token - DI token for the service
|
|
134
|
+
* @returns Builder for specifying implementations
|
|
135
|
+
*/
|
|
136
|
+
use<T extends object>(token: InjectionToken$1<T>): ConditionalBindingUse<T>;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Builder after specifying token with use()
|
|
140
|
+
*/
|
|
141
|
+
interface ConditionalBindingUse<T extends object> {
|
|
142
|
+
/**
|
|
143
|
+
* Specify the implementation when predicate returns true.
|
|
144
|
+
* Registration is completed immediately.
|
|
145
|
+
*
|
|
146
|
+
* If predicate is false at resolution time:
|
|
147
|
+
* - Uses `otherwise()` implementation if provided
|
|
148
|
+
* - Falls back to existing registration if available
|
|
149
|
+
* - Throws error if no fallback exists
|
|
150
|
+
*
|
|
151
|
+
* @param implementation - Service class to use when predicate is true
|
|
152
|
+
* @returns Builder for optional fallback specification
|
|
153
|
+
*/
|
|
154
|
+
give(implementation: Constructor<T>): ConditionalBindingGive<T>;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Builder after specifying true implementation with give()
|
|
158
|
+
* Registration is already complete at this point.
|
|
159
|
+
*/
|
|
160
|
+
interface ConditionalBindingGive<T extends object> {
|
|
161
|
+
/**
|
|
162
|
+
* Optionally specify a fallback implementation when predicate returns false.
|
|
163
|
+
* This re-registers with the explicit fallback instead of existing registration.
|
|
164
|
+
*
|
|
165
|
+
* @param implementation - Service class to use when predicate is false
|
|
166
|
+
*/
|
|
167
|
+
otherwise(implementation: Constructor<T>): void;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Implementation of ConditionalBindingBuilder
|
|
171
|
+
*
|
|
172
|
+
* @internal
|
|
173
|
+
*/
|
|
174
|
+
declare class ConditionalBindingBuilderImpl implements ConditionalBindingBuilder {
|
|
175
|
+
private readonly tsyringeContainer;
|
|
176
|
+
private readonly predicateContainer;
|
|
177
|
+
private readonly predicate;
|
|
178
|
+
private readonly options;
|
|
179
|
+
constructor(tsyringeContainer: DependencyContainer, predicateContainer: PredicateContainer, predicate: (container: PredicateContainer) => boolean, options: WhenOptions);
|
|
180
|
+
use<T extends object>(token: InjectionToken$1<T>): ConditionalBindingUse<T>;
|
|
181
|
+
}
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region src/di/container.d.ts
|
|
184
|
+
/**
|
|
185
|
+
* Options for creating a Container instance
|
|
186
|
+
*/
|
|
187
|
+
interface ContainerOptions {
|
|
188
|
+
/** Pre-created DependencyContainer */
|
|
189
|
+
container: DependencyContainer;
|
|
190
|
+
/** Whether this is a request-scoped container */
|
|
191
|
+
isRequestScoped?: boolean;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Unified Container for DI management
|
|
195
|
+
*
|
|
196
|
+
* Manages the two-tier container hierarchy:
|
|
197
|
+
* - Global scope: Singletons, base instances of request-scoped services
|
|
198
|
+
* - Request scope: Context-enriched instances per HTTP request
|
|
199
|
+
*
|
|
200
|
+
* @example Basic registration
|
|
201
|
+
* ```typescript
|
|
202
|
+
* import { container as tsyringeRootContainer } from 'tsyringe'
|
|
203
|
+
*
|
|
204
|
+
* const container = new Container({
|
|
205
|
+
* container: tsyringeRootContainer.createChildContainer()
|
|
206
|
+
* })
|
|
207
|
+
*
|
|
208
|
+
* container.register(I18nService)
|
|
209
|
+
* container.register(MY_TOKEN, MyService)
|
|
210
|
+
* container.registerSingleton(ConfigService)
|
|
211
|
+
* container.registerValue(MY_TOKEN, myInstance)
|
|
212
|
+
* ```
|
|
213
|
+
*
|
|
214
|
+
* @example Request scope (automatic lifecycle)
|
|
215
|
+
* ```typescript
|
|
216
|
+
* await container.runInRequestScope(routerContext, async (requestContainer) => {
|
|
217
|
+
* const i18n = requestContainer.resolve(I18N_TOKEN)
|
|
218
|
+
* })
|
|
219
|
+
* ```
|
|
220
|
+
*/
|
|
221
|
+
declare class Container {
|
|
222
|
+
private readonly container;
|
|
223
|
+
private readonly isRequestScoped;
|
|
224
|
+
constructor(options: ContainerOptions);
|
|
225
|
+
/**
|
|
226
|
+
* Register a service with optional explicit token and scope
|
|
227
|
+
*/
|
|
228
|
+
register<T extends object>(serviceClass: Constructor<T>, scope?: Scope): void;
|
|
229
|
+
register<T extends object>(token: InjectionToken$1<T>, serviceClass: Constructor<T>, scope?: Scope): void;
|
|
230
|
+
/**
|
|
231
|
+
* Register a service as singleton
|
|
232
|
+
*/
|
|
233
|
+
registerSingleton<T extends object>(serviceClass: Constructor<T>): void;
|
|
234
|
+
registerSingleton<T extends object>(token: InjectionToken$1<T>, serviceClass: Constructor<T>): void;
|
|
235
|
+
/**
|
|
236
|
+
* Register a value (instance) directly
|
|
237
|
+
*/
|
|
238
|
+
registerValue<T>(token: InjectionToken$1<T>, value: T): void;
|
|
239
|
+
/**
|
|
240
|
+
* Register with factory function
|
|
241
|
+
*/
|
|
242
|
+
registerFactory<T>(token: InjectionToken$1<T>, factory: (container: Container) => T): void;
|
|
243
|
+
/**
|
|
244
|
+
* Register an alias to an existing token
|
|
245
|
+
*/
|
|
246
|
+
registerExisting<T>(alias: InjectionToken$1<T>, target: InjectionToken$1<T>): void;
|
|
247
|
+
/**
|
|
248
|
+
* Resolve a service from the container
|
|
249
|
+
*/
|
|
250
|
+
resolve<T>(token: InjectionToken$1<T>): T;
|
|
251
|
+
/**
|
|
252
|
+
* Check if a token is registered
|
|
253
|
+
*/
|
|
254
|
+
isRegistered<T>(token: InjectionToken$1<T>): boolean;
|
|
255
|
+
/**
|
|
256
|
+
* Start a conditional binding with predicate evaluation
|
|
257
|
+
*/
|
|
258
|
+
when(predicate: (container: PredicateContainer) => boolean, options?: WhenOptions): ConditionalBindingBuilder;
|
|
259
|
+
/**
|
|
260
|
+
* Replace a service registration with a decorated version
|
|
261
|
+
*/
|
|
262
|
+
extend<T>(token: InjectionToken$1<T>, decorator: ExtensionDecorator<T>): void;
|
|
263
|
+
/**
|
|
264
|
+
* Run callback within request scope
|
|
265
|
+
*
|
|
266
|
+
* Creates a child container with fresh instances for services registered with `scope: Scope.Request`.
|
|
267
|
+
* Callback receives the request-scoped container as argument.
|
|
268
|
+
*
|
|
269
|
+
* Can only be called on global container (not request-scoped).
|
|
270
|
+
*/
|
|
271
|
+
runInRequestScope<T>(routerContext: RouterContext, callback: (requestContainer: Container) => T | Promise<T>): Promise<T>;
|
|
272
|
+
/**
|
|
273
|
+
* Create request scope container
|
|
274
|
+
*
|
|
275
|
+
* Can only be called on global container (not request-scoped).
|
|
276
|
+
*/
|
|
277
|
+
createRequestScope(routerContext: RouterContext): Container;
|
|
278
|
+
/**
|
|
279
|
+
* Get underlying tsyringe container
|
|
280
|
+
*/
|
|
281
|
+
getTsyringeContainer(): DependencyContainer;
|
|
282
|
+
dispose(): void | Promise<void>;
|
|
283
|
+
}
|
|
284
|
+
//#endregion
|
|
285
|
+
//#region src/di/tokens.d.ts
|
|
286
|
+
/**
|
|
287
|
+
* Token for the Container instance
|
|
288
|
+
* Used for injecting the Container into services that need dynamic resolution
|
|
289
|
+
*/
|
|
290
|
+
declare const CONTAINER_TOKEN: unique symbol;
|
|
291
|
+
declare const DI_TOKENS: {
|
|
292
|
+
readonly CloudflareEnv: symbol;
|
|
293
|
+
readonly ExecutionContext: symbol;
|
|
294
|
+
readonly Container: typeof CONTAINER_TOKEN;
|
|
295
|
+
readonly Application: symbol;
|
|
296
|
+
readonly ModuleRegistry: symbol;
|
|
297
|
+
readonly ErrorHandler: symbol;
|
|
298
|
+
readonly Database: symbol;
|
|
299
|
+
readonly Queue: symbol;
|
|
300
|
+
readonly ConsumerRegistry: symbol;
|
|
301
|
+
readonly Cron: symbol;
|
|
302
|
+
readonly EventRegistry: symbol;
|
|
303
|
+
readonly Quarry: symbol;
|
|
304
|
+
/**
|
|
305
|
+
* AuthContext: Use for services that need user authentication (userId).
|
|
306
|
+
*/
|
|
307
|
+
readonly AuthContext: symbol;
|
|
308
|
+
readonly DurableObjectState: symbol;
|
|
309
|
+
readonly DurableObjectId: symbol;
|
|
310
|
+
};
|
|
311
|
+
type DIToken = typeof DI_TOKENS[keyof typeof DI_TOKENS];
|
|
312
|
+
//#endregion
|
|
313
|
+
//#region src/di/decorators/inject-param.decorator.d.ts
|
|
314
|
+
/**
|
|
315
|
+
* Metadata key for storing parameter injection information
|
|
316
|
+
*/
|
|
317
|
+
declare const INJECT_PARAM_METADATA_KEY: unique symbol;
|
|
318
|
+
/**
|
|
319
|
+
* Describes a parameter injection
|
|
320
|
+
*/
|
|
321
|
+
interface ParamInjection {
|
|
322
|
+
/** Parameter index in the method signature (0-based) */
|
|
323
|
+
index: number;
|
|
324
|
+
/** DI token to resolve */
|
|
325
|
+
token: InjectionToken$1;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Mark a method parameter for DI injection
|
|
329
|
+
*
|
|
330
|
+
* The parameter will be resolved from the request-scoped container
|
|
331
|
+
* when the controller method is invoked.
|
|
332
|
+
*
|
|
333
|
+
* @param token - DI token to resolve (class or symbol)
|
|
334
|
+
*
|
|
335
|
+
* @example With class token
|
|
336
|
+
* ```typescript
|
|
337
|
+
* async show(
|
|
338
|
+
* ctx: RouterContext,
|
|
339
|
+
* @InjectParam(UserService) userService: UserService
|
|
340
|
+
* ) { }
|
|
341
|
+
* ```
|
|
342
|
+
*
|
|
343
|
+
* @example With symbol token
|
|
344
|
+
* ```typescript
|
|
345
|
+
* async show(
|
|
346
|
+
* ctx: RouterContext,
|
|
347
|
+
* @InjectParam(DI_TOKENS.Cache) cache: ICacheService
|
|
348
|
+
* ) { }
|
|
349
|
+
* ```
|
|
350
|
+
*/
|
|
351
|
+
declare function InjectParam<T>(token: InjectionToken$1<T>): ParameterDecorator;
|
|
352
|
+
/**
|
|
353
|
+
* Get method parameter injections
|
|
354
|
+
*
|
|
355
|
+
* @param target - Controller prototype
|
|
356
|
+
* @param propertyKey - Method name
|
|
357
|
+
* @returns Array of parameter injections sorted by index
|
|
358
|
+
*/
|
|
359
|
+
declare function getMethodInjections(target: object, propertyKey: string | symbol): ParamInjection[];
|
|
360
|
+
//#endregion
|
|
361
|
+
//#region src/di/decorators.d.ts
|
|
362
|
+
/**
|
|
363
|
+
* Mark a class as injectable
|
|
364
|
+
*
|
|
365
|
+
* This decorator wraps tsyringe's `@injectable` decorator and optionally
|
|
366
|
+
* associates a token with the class. The actual lifecycle (Singleton, Request,
|
|
367
|
+
* Transient) is determined at registration time, not decoration time.
|
|
368
|
+
*
|
|
369
|
+
* **Lifecycle Control:**
|
|
370
|
+
* - Use `scope: Scope.Singleton` in module providers for singleton
|
|
371
|
+
* - Use `scope: Scope.Request` in module providers for request-scoped
|
|
372
|
+
* - Default is Transient (new instance per resolution)
|
|
373
|
+
*
|
|
374
|
+
* @param token - Optional DI token for service resolution
|
|
375
|
+
*
|
|
376
|
+
* @example Basic usage (no token)
|
|
377
|
+
* ```typescript
|
|
378
|
+
* @Transient()
|
|
379
|
+
* export class UserService {
|
|
380
|
+
* constructor(@inject(DI_TOKENS.Database) private db: DatabaseService) {}
|
|
381
|
+
* }
|
|
382
|
+
*
|
|
383
|
+
* // In module:
|
|
384
|
+
* @Module({
|
|
385
|
+
* providers: [UserService] // Transient by default
|
|
386
|
+
* })
|
|
387
|
+
* ```
|
|
388
|
+
*
|
|
389
|
+
* @example With token
|
|
390
|
+
* ```typescript
|
|
391
|
+
* @Transient(DI_TOKENS.ConnectionManager)
|
|
392
|
+
* export class ConnectionManager implements Disposable {
|
|
393
|
+
* // ...
|
|
394
|
+
* }
|
|
395
|
+
*
|
|
396
|
+
* // In Application.ts:
|
|
397
|
+
* container.register(DI_TOKENS.ConnectionManager, ConnectionManager, Scope.Request)
|
|
398
|
+
* ```
|
|
399
|
+
*
|
|
400
|
+
* @example Singleton via provider scope
|
|
401
|
+
* ```typescript
|
|
402
|
+
* @Transient()
|
|
403
|
+
* export class ConsumerRegistry {
|
|
404
|
+
* // ...
|
|
405
|
+
* }
|
|
406
|
+
*
|
|
407
|
+
* // In module:
|
|
408
|
+
* @Module({
|
|
409
|
+
* providers: [
|
|
410
|
+
* { provide: DI_TOKENS.ConsumerRegistry, useClass: ConsumerRegistry, scope: Scope.Singleton }
|
|
411
|
+
* ]
|
|
412
|
+
* })
|
|
413
|
+
* ```
|
|
414
|
+
*/
|
|
415
|
+
declare function Transient<T>(token?: InjectionToken$1<T>): <TFunction extends abstract new (...args: never[]) => unknown>(target: TFunction) => TFunction;
|
|
416
|
+
//#endregion
|
|
417
|
+
//#region src/di/errors/conditional-binding-fallback.error.d.ts
|
|
418
|
+
/**
|
|
419
|
+
* ConditionalBindingFallbackError
|
|
420
|
+
*
|
|
421
|
+
* Thrown when a conditional binding predicate returns false but no fallback
|
|
422
|
+
* implementation was provided and no existing registration exists for the token.
|
|
423
|
+
*
|
|
424
|
+
* This typically indicates a misconfiguration in the DI setup where:
|
|
425
|
+
* - A `when().use().give()` chain was used without `otherwise()`
|
|
426
|
+
* - AND the token wasn't previously registered
|
|
427
|
+
* - AND the predicate evaluated to false at resolution time
|
|
428
|
+
*/
|
|
429
|
+
declare class ConditionalBindingFallbackError extends ApplicationError {
|
|
430
|
+
constructor(token: string);
|
|
431
|
+
}
|
|
432
|
+
//#endregion
|
|
433
|
+
//#region src/di/errors/request-scope-operation-not-allowed.error.d.ts
|
|
434
|
+
/**
|
|
435
|
+
* RequestScopeOperationNotAllowedError
|
|
436
|
+
*
|
|
437
|
+
* Thrown when attempting to call a method that is not allowed on the current container scope.
|
|
438
|
+
* - `createRequestScope()` and `runInRequestScope()` can only be called on global containers
|
|
439
|
+
*/
|
|
440
|
+
declare class RequestScopeOperationNotAllowedError extends ApplicationError {
|
|
441
|
+
constructor(methodName: string);
|
|
442
|
+
}
|
|
443
|
+
//#endregion
|
|
444
|
+
//#region src/env.d.ts
|
|
445
|
+
/**
|
|
446
|
+
* Cloudflare Worker Environment Bindings
|
|
447
|
+
*
|
|
448
|
+
* This interface defines the base environment bindings required by Stratal.
|
|
449
|
+
* Use TypeScript module augmentation to add your own application-specific bindings.
|
|
450
|
+
*
|
|
451
|
+
* @example
|
|
452
|
+
* ```typescript
|
|
453
|
+
* declare module 'stratal' {
|
|
454
|
+
* interface StratalEnv {
|
|
455
|
+
* DATABASE: D1Database
|
|
456
|
+
* NOTIFICATIONS_QUEUE: Queue
|
|
457
|
+
* }
|
|
458
|
+
* }
|
|
459
|
+
* ```
|
|
460
|
+
*/
|
|
461
|
+
interface StratalEnv {
|
|
462
|
+
ENVIRONMENT: string;
|
|
463
|
+
CACHE: KVNamespace;
|
|
464
|
+
}
|
|
465
|
+
//#endregion
|
|
466
|
+
//#region src/router/constants.d.ts
|
|
467
|
+
/**
|
|
468
|
+
* Type-safe context keys for Hono router variables
|
|
469
|
+
* Using symbols to avoid string collisions
|
|
470
|
+
*/
|
|
471
|
+
declare const ROUTER_CONTEXT_KEYS: {
|
|
472
|
+
readonly REQUEST_CONTAINER: "requestContainer";
|
|
473
|
+
readonly LOCALE: "locale";
|
|
474
|
+
};
|
|
475
|
+
/**
|
|
476
|
+
* Metadata keys for storing route and controller configuration
|
|
477
|
+
* Using symbols to avoid collisions with other decorators
|
|
478
|
+
*/
|
|
479
|
+
declare const ROUTE_METADATA_KEYS: {
|
|
480
|
+
readonly CONTROLLER_ROUTE: symbol;
|
|
481
|
+
readonly CONTROLLER_OPTIONS: symbol;
|
|
482
|
+
readonly CONTROLLER_MIDDLEWARES: symbol;
|
|
483
|
+
readonly ROUTE_CONFIG: symbol;
|
|
484
|
+
readonly DECORATED_METHODS: symbol;
|
|
485
|
+
readonly HTTP_ROUTE_CONFIG: symbol;
|
|
486
|
+
readonly HTTP_DECORATED_METHODS: symbol;
|
|
487
|
+
readonly AUTH_GUARD: symbol;
|
|
488
|
+
readonly GATEWAY_MARKER: symbol;
|
|
489
|
+
readonly WS_ON_MESSAGE: symbol;
|
|
490
|
+
readonly WS_ON_CLOSE: symbol;
|
|
491
|
+
readonly WS_ON_ERROR: symbol;
|
|
492
|
+
};
|
|
493
|
+
/**
|
|
494
|
+
* Security scheme identifiers for OpenAPI
|
|
495
|
+
* These reference the security scheme definitions in security.schemas.ts
|
|
496
|
+
*/
|
|
497
|
+
declare const SECURITY_SCHEMES: {
|
|
498
|
+
readonly BEARER_AUTH: "bearerAuth";
|
|
499
|
+
readonly API_KEY: "apiKey";
|
|
500
|
+
readonly SESSION_COOKIE: "sessionCookie";
|
|
501
|
+
};
|
|
502
|
+
/**
|
|
503
|
+
* HTTP method mapping for RESTful controller methods
|
|
504
|
+
* Maps controller method names to HTTP verbs and path patterns
|
|
505
|
+
*/
|
|
506
|
+
declare const HTTP_METHODS: {
|
|
507
|
+
readonly index: {
|
|
508
|
+
readonly method: "get";
|
|
509
|
+
readonly path: "";
|
|
510
|
+
};
|
|
511
|
+
readonly show: {
|
|
512
|
+
readonly method: "get";
|
|
513
|
+
readonly path: "/:id";
|
|
514
|
+
};
|
|
515
|
+
readonly create: {
|
|
516
|
+
readonly method: "post";
|
|
517
|
+
readonly path: "";
|
|
518
|
+
};
|
|
519
|
+
readonly update: {
|
|
520
|
+
readonly method: "put";
|
|
521
|
+
readonly path: "/:id";
|
|
522
|
+
};
|
|
523
|
+
readonly patch: {
|
|
524
|
+
readonly method: "patch";
|
|
525
|
+
readonly path: "/:id";
|
|
526
|
+
};
|
|
527
|
+
readonly destroy: {
|
|
528
|
+
readonly method: "delete";
|
|
529
|
+
readonly path: "/:id";
|
|
530
|
+
};
|
|
531
|
+
};
|
|
532
|
+
/**
|
|
533
|
+
* Sentinel symbol to opt a controller out of versioning.
|
|
534
|
+
* When used as the version, no prefix is applied even when defaultVersion is set.
|
|
535
|
+
*/
|
|
536
|
+
declare const VERSION_NEUTRAL: unique symbol;
|
|
537
|
+
//#endregion
|
|
538
|
+
//#region src/router/types.d.ts
|
|
539
|
+
/**
|
|
540
|
+
* Route parameter type for OpenAPI
|
|
541
|
+
* ZodObject or ZodPipe (piped validation)
|
|
542
|
+
*/
|
|
543
|
+
type ZodObjectWithEffect = index_d_exports$1.ZodObject<any> | index_d_exports$1.ZodPipe<any, any>;
|
|
544
|
+
type RouteParameter = ZodObjectWithEffect | undefined;
|
|
545
|
+
/**
|
|
546
|
+
* Hono context variables with type-safe keys
|
|
547
|
+
*/
|
|
548
|
+
interface RouterVariables {
|
|
549
|
+
[ROUTER_CONTEXT_KEYS.REQUEST_CONTAINER]: Container;
|
|
550
|
+
[ROUTER_CONTEXT_KEYS.LOCALE]?: string;
|
|
551
|
+
}
|
|
552
|
+
/**
|
|
553
|
+
* Hono environment type for router
|
|
554
|
+
*/
|
|
555
|
+
interface RouterEnv {
|
|
556
|
+
Bindings: StratalEnv;
|
|
557
|
+
Variables: RouterVariables;
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* Security scheme identifier type
|
|
561
|
+
* Matches the keys in SECURITY_SCHEMES constant
|
|
562
|
+
*/
|
|
563
|
+
type SecurityScheme = typeof SECURITY_SCHEMES[keyof typeof SECURITY_SCHEMES];
|
|
564
|
+
/**
|
|
565
|
+
* HTTP method type from OpenAPI spec
|
|
566
|
+
*/
|
|
567
|
+
type HttpMethod = 'get' | 'post' | 'put' | 'delete' | 'patch' | 'head' | 'options' | 'trace' | 'all';
|
|
568
|
+
/**
|
|
569
|
+
* Object form for request body with optional content type
|
|
570
|
+
*/
|
|
571
|
+
interface RouteBodyObject {
|
|
572
|
+
schema: index_d_exports$1.ZodType;
|
|
573
|
+
contentType?: string;
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* Request body definition for @Route() decorator
|
|
577
|
+
* Bare ZodType defaults to application/json
|
|
578
|
+
*/
|
|
579
|
+
type RouteBody = index_d_exports$1.ZodType | RouteBodyObject;
|
|
580
|
+
/**
|
|
581
|
+
* Object form for response with optional description and content type
|
|
582
|
+
*/
|
|
583
|
+
interface RouteResponseObject {
|
|
584
|
+
schema: index_d_exports$1.ZodType;
|
|
585
|
+
description?: string;
|
|
586
|
+
contentType?: string;
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* Single response definition for @Route() decorator
|
|
590
|
+
* Status code is auto-derived from method name (create->201, others->200)
|
|
591
|
+
*/
|
|
592
|
+
type RouteResponse = index_d_exports$1.ZodType | RouteResponseObject;
|
|
593
|
+
/**
|
|
594
|
+
* Route configuration for @Route() decorator
|
|
595
|
+
* Defines OpenAPI metadata for a controller method
|
|
596
|
+
*/
|
|
597
|
+
interface RouteConfig {
|
|
598
|
+
/**
|
|
599
|
+
* Request body schema (for POST, PUT, PATCH)
|
|
600
|
+
* @example z.object({}) or { schema: z.object({}), contentType: 'multipart/form-data' }
|
|
601
|
+
*/
|
|
602
|
+
body?: RouteBody;
|
|
603
|
+
/**
|
|
604
|
+
* URL parameters schema (e.g., { id: z.string().uuid() })
|
|
605
|
+
* Must be ZodObject or ZodPipe for OpenAPI compatibility
|
|
606
|
+
*/
|
|
607
|
+
params?: RouteParameter;
|
|
608
|
+
/**
|
|
609
|
+
* Query parameters schema (e.g., pagination, filters)
|
|
610
|
+
* Must be ZodObject or ZodPipe for OpenAPI compatibility
|
|
611
|
+
*/
|
|
612
|
+
query?: RouteParameter;
|
|
613
|
+
/**
|
|
614
|
+
* Response schema for success case
|
|
615
|
+
* Status code auto-derived: create()->201, others->200
|
|
616
|
+
* @example userSchema or { schema: userSchema, description: 'User details' }
|
|
617
|
+
*/
|
|
618
|
+
response: RouteResponse;
|
|
619
|
+
/**
|
|
620
|
+
* OpenAPI tags for grouping endpoints
|
|
621
|
+
* Merged with controller-level tags
|
|
622
|
+
*/
|
|
623
|
+
tags?: string[];
|
|
624
|
+
/**
|
|
625
|
+
* Security schemes required for this route
|
|
626
|
+
* Merged with controller-level security
|
|
627
|
+
* Empty array = public route (no auth)
|
|
628
|
+
*/
|
|
629
|
+
security?: SecurityScheme[];
|
|
630
|
+
/**
|
|
631
|
+
* Human-readable description for OpenAPI docs
|
|
632
|
+
*/
|
|
633
|
+
description?: string;
|
|
634
|
+
/**
|
|
635
|
+
* Detailed summary for OpenAPI docs
|
|
636
|
+
*/
|
|
637
|
+
summary?: string;
|
|
638
|
+
/**
|
|
639
|
+
* Hide this route from OpenAPI documentation
|
|
640
|
+
* Route remains functional but won't appear in /api/docs or /api/openapi.json
|
|
641
|
+
* Useful for internal-only endpoints, debug routes, or work-in-progress features
|
|
642
|
+
*/
|
|
643
|
+
hideFromDocs?: boolean;
|
|
644
|
+
/**
|
|
645
|
+
* HTTP success status code for the response
|
|
646
|
+
* Used by HTTP method decorators (@Get, @Post, etc.) to set the success status
|
|
647
|
+
* For @Route() decorator, status code is auto-derived from method name
|
|
648
|
+
*/
|
|
649
|
+
statusCode?: number;
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* Metadata stored by HTTP method decorators (@Get, @Post, etc.)
|
|
653
|
+
* Contains the explicit HTTP method, path, and route configuration
|
|
654
|
+
*/
|
|
655
|
+
interface HttpRouteMetadata {
|
|
656
|
+
method: HttpMethod;
|
|
657
|
+
path: string;
|
|
658
|
+
config: RouteConfig;
|
|
659
|
+
}
|
|
660
|
+
/**
|
|
661
|
+
* Controller options for @Controller() decorator
|
|
662
|
+
* Provides default configuration for all routes in the controller
|
|
663
|
+
*/
|
|
664
|
+
interface ControllerOptions {
|
|
665
|
+
/**
|
|
666
|
+
* Default tags applied to all routes in this controller
|
|
667
|
+
* Routes can append additional tags
|
|
668
|
+
*/
|
|
669
|
+
tags?: string[];
|
|
670
|
+
/**
|
|
671
|
+
* Default security schemes applied to all routes
|
|
672
|
+
* Routes can add more schemes or override with empty array
|
|
673
|
+
*/
|
|
674
|
+
security?: SecurityScheme[];
|
|
675
|
+
/**
|
|
676
|
+
* Hide all routes in this controller from OpenAPI documentation
|
|
677
|
+
* Routes remain functional but won't appear in /api/docs or /api/openapi.json
|
|
678
|
+
* Can be overridden at route level with hideFromDocs: false
|
|
679
|
+
* Useful for internal-only controllers, debug endpoints, or utilities
|
|
680
|
+
*/
|
|
681
|
+
hideFromDocs?: boolean;
|
|
682
|
+
/**
|
|
683
|
+
* API version(s) for this controller.
|
|
684
|
+
* When versioning is enabled, routes are prefixed with the version (e.g., /v1/users).
|
|
685
|
+
* Use VERSION_NEUTRAL to opt out of versioning (no prefix applied).
|
|
686
|
+
* Can be a single version string, array of versions, or VERSION_NEUTRAL symbol.
|
|
687
|
+
*/
|
|
688
|
+
version?: string | string[] | typeof VERSION_NEUTRAL;
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* Versioning configuration for the application.
|
|
692
|
+
* Enables URI-based API versioning when provided to Stratal config.
|
|
693
|
+
*/
|
|
694
|
+
interface VersioningOptions {
|
|
695
|
+
/**
|
|
696
|
+
* Prefix for version segments in the URL.
|
|
697
|
+
* @default 'v'
|
|
698
|
+
* @example 'v' produces /v1, /v2; 'api/v' produces /api/v1, /api/v2
|
|
699
|
+
*/
|
|
700
|
+
prefix?: string;
|
|
701
|
+
/**
|
|
702
|
+
* Default version applied to controllers without explicit version.
|
|
703
|
+
* Controllers with VERSION_NEUTRAL are not affected.
|
|
704
|
+
*/
|
|
705
|
+
defaultVersion?: string | string[];
|
|
706
|
+
}
|
|
707
|
+
//#endregion
|
|
708
|
+
//#region src/router/router-context.d.ts
|
|
709
|
+
type ContextQueryResult<R extends Record<string, unknown> | undefined, K extends string | undefined> = K extends string ? string : R extends undefined ? Record<string, unknown> : R;
|
|
710
|
+
/**
|
|
711
|
+
* Router context wrapper with helper methods
|
|
712
|
+
*
|
|
713
|
+
* Provides convenient access to Hono's context and common request/response operations.
|
|
714
|
+
* The native Hono context is available via the `c` property for advanced use cases.
|
|
715
|
+
*
|
|
716
|
+
* @example
|
|
717
|
+
* ```typescript
|
|
718
|
+
* async index(ctx: RouterContext): Promise<Response> {
|
|
719
|
+
* // Use helper methods
|
|
720
|
+
* const users = await this.service.findAll()
|
|
721
|
+
* return ctx.json(users)
|
|
722
|
+
* }
|
|
723
|
+
*
|
|
724
|
+
* async show(ctx: RouterContext): Promise<Response> {
|
|
725
|
+
* // Access route params
|
|
726
|
+
* const id = ctx.param('id')
|
|
727
|
+
* const user = await this.service.findById(id)
|
|
728
|
+
* return ctx.json(user)
|
|
729
|
+
* }
|
|
730
|
+
*
|
|
731
|
+
* async create(ctx: RouterContext): Promise<Response> {
|
|
732
|
+
* // Parse request body
|
|
733
|
+
* const body = await ctx.body<CreateUserInput>()
|
|
734
|
+
* const user = await this.service.create(body)
|
|
735
|
+
* return ctx.json(user, 201)
|
|
736
|
+
* }
|
|
737
|
+
* ```
|
|
738
|
+
*/
|
|
739
|
+
declare class RouterContext<T extends RouterEnv = RouterEnv> {
|
|
740
|
+
readonly c: Context<T>;
|
|
741
|
+
/**
|
|
742
|
+
* Native Hono context
|
|
743
|
+
* Access for advanced use cases not covered by helper methods
|
|
744
|
+
*/
|
|
745
|
+
constructor(c: Context<T>);
|
|
746
|
+
/**
|
|
747
|
+
* Get request-scoped DI container
|
|
748
|
+
* Contains request-specific services and context (AuthContext)
|
|
749
|
+
*
|
|
750
|
+
* @throws Error if container not initialized
|
|
751
|
+
*/
|
|
752
|
+
getContainer(): Container;
|
|
753
|
+
/**
|
|
754
|
+
* Set locale for the current request
|
|
755
|
+
* Locale is determined by X-Locale header or defaults to config
|
|
756
|
+
*
|
|
757
|
+
* @param locale - Locale code (e.g., 'en', 'fr')
|
|
758
|
+
*/
|
|
759
|
+
setLocale(locale: string): void;
|
|
760
|
+
/**
|
|
761
|
+
* Get locale for the current request
|
|
762
|
+
*
|
|
763
|
+
* @returns Current locale code
|
|
764
|
+
*/
|
|
765
|
+
getLocale(): string;
|
|
766
|
+
/**
|
|
767
|
+
* Return JSON response
|
|
768
|
+
*
|
|
769
|
+
* @param data - Data to serialize as JSON
|
|
770
|
+
* @param status - HTTP status code (default: 200)
|
|
771
|
+
*/
|
|
772
|
+
json(data: object, status?: ContentfulStatusCode): Response;
|
|
773
|
+
/**
|
|
774
|
+
* Get route parameter value
|
|
775
|
+
*
|
|
776
|
+
* @param key - Parameter name (e.g., 'id' for /users/:id)
|
|
777
|
+
*/
|
|
778
|
+
param(key: string): string;
|
|
779
|
+
/**
|
|
780
|
+
* Get query parameter value
|
|
781
|
+
*
|
|
782
|
+
* @param key - Query parameter name
|
|
783
|
+
*/
|
|
784
|
+
query<R extends Record<string, unknown> | undefined = undefined, K extends string | undefined = undefined>(key?: K): ContextQueryResult<R, K>;
|
|
785
|
+
/**
|
|
786
|
+
* Get request header value
|
|
787
|
+
*
|
|
788
|
+
* @param name - Header name (case-insensitive)
|
|
789
|
+
*/
|
|
790
|
+
header(name: string): string | undefined;
|
|
791
|
+
/**
|
|
792
|
+
* Get validated request body from OpenAPI route
|
|
793
|
+
* Returns pre-validated data that has passed schema validation
|
|
794
|
+
*
|
|
795
|
+
* @returns Validated JSON body
|
|
796
|
+
*/
|
|
797
|
+
body<T>(): Promise<T>;
|
|
798
|
+
/**
|
|
799
|
+
* Return text response
|
|
800
|
+
*
|
|
801
|
+
* @param text - Text content
|
|
802
|
+
* @param status - HTTP status code (default: 200)
|
|
803
|
+
*/
|
|
804
|
+
text(text: string, status?: ContentfulStatusCode): Response;
|
|
805
|
+
/**
|
|
806
|
+
* Return HTML response
|
|
807
|
+
*
|
|
808
|
+
* @param html - HTML content
|
|
809
|
+
* @param status - HTTP status code (default: 200)
|
|
810
|
+
*/
|
|
811
|
+
html(html: string, status?: ContentfulStatusCode): Response;
|
|
812
|
+
/**
|
|
813
|
+
* Redirect to another URL
|
|
814
|
+
*
|
|
815
|
+
* @param url - Target URL
|
|
816
|
+
* @param status - HTTP status code (default: 302)
|
|
817
|
+
*/
|
|
818
|
+
redirect(url: string, status?: RedirectStatusCode): Response;
|
|
819
|
+
/**
|
|
820
|
+
* Return a streaming response (binary/generic)
|
|
821
|
+
*
|
|
822
|
+
* @param callback - Async function that writes to the stream
|
|
823
|
+
* @param onError - Optional error handler called if an error occurs during streaming
|
|
824
|
+
*/
|
|
825
|
+
stream(callback: (stream: StreamingApi) => Promise<void>, onError?: (err: Error, stream: StreamingApi) => Promise<void>): Response;
|
|
826
|
+
/**
|
|
827
|
+
* Return a streaming text response
|
|
828
|
+
*
|
|
829
|
+
* Automatically sets `Content-Encoding: Identity` for Cloudflare Workers compatibility.
|
|
830
|
+
*
|
|
831
|
+
* @param callback - Async function that writes text to the stream
|
|
832
|
+
* @param onError - Optional error handler called if an error occurs during streaming
|
|
833
|
+
*/
|
|
834
|
+
streamText(callback: (stream: StreamingApi) => Promise<void>, onError?: (err: Error, stream: StreamingApi) => Promise<void>): Response;
|
|
835
|
+
/**
|
|
836
|
+
* Return a Server-Sent Events (SSE) streaming response
|
|
837
|
+
*
|
|
838
|
+
* Automatically sets `Content-Encoding: Identity` for Cloudflare Workers compatibility.
|
|
839
|
+
*
|
|
840
|
+
* @param callback - Async function that writes SSE events to the stream
|
|
841
|
+
* @param onError - Optional error handler called if an error occurs during streaming
|
|
842
|
+
*/
|
|
843
|
+
streamSSE(callback: (stream: SSEStreamingApi) => Promise<void>, onError?: (err: Error, stream: SSEStreamingApi) => Promise<void>): Response;
|
|
844
|
+
}
|
|
845
|
+
//#endregion
|
|
846
|
+
//#region src/router/controller.d.ts
|
|
847
|
+
/**
|
|
848
|
+
* Controller interface for handling HTTP requests
|
|
849
|
+
*
|
|
850
|
+
* Controllers can implement RESTful methods or a custom handle() method.
|
|
851
|
+
* The route for the controller is set via the `@Controller` decorator.
|
|
852
|
+
*
|
|
853
|
+
* RESTful methods auto-map to HTTP verbs:
|
|
854
|
+
* - index() → GET /route
|
|
855
|
+
* - show() → GET /route/:id
|
|
856
|
+
* - create() → POST /route
|
|
857
|
+
* - update() → PUT /route/:id
|
|
858
|
+
* - patch() → PATCH /route/:id
|
|
859
|
+
* - destroy() → DELETE /route/:id
|
|
860
|
+
*
|
|
861
|
+
* For non-RESTful routes (wildcards, custom patterns), implement handle()
|
|
862
|
+
*/
|
|
863
|
+
interface IController {
|
|
864
|
+
/**
|
|
865
|
+
* GET /route
|
|
866
|
+
* List all resources
|
|
867
|
+
*/
|
|
868
|
+
index?(ctx: RouterContext): Promise<Response> | Response;
|
|
869
|
+
/**
|
|
870
|
+
* GET /route/:id
|
|
871
|
+
* Show a specific resource
|
|
872
|
+
*/
|
|
873
|
+
show?(ctx: RouterContext): Promise<Response> | Response;
|
|
874
|
+
/**
|
|
875
|
+
* POST /route
|
|
876
|
+
* Create a new resource
|
|
877
|
+
*/
|
|
878
|
+
create?(ctx: RouterContext): Promise<Response> | Response;
|
|
879
|
+
/**
|
|
880
|
+
* PUT /route/:id
|
|
881
|
+
* Update a resource (full replacement)
|
|
882
|
+
*/
|
|
883
|
+
update?(ctx: RouterContext): Promise<Response> | Response;
|
|
884
|
+
/**
|
|
885
|
+
* PATCH /route/:id
|
|
886
|
+
* Patch a resource (partial update)
|
|
887
|
+
*/
|
|
888
|
+
patch?(ctx: RouterContext): Promise<Response> | Response;
|
|
889
|
+
/**
|
|
890
|
+
* DELETE /route/:id
|
|
891
|
+
* Delete a resource
|
|
892
|
+
*/
|
|
893
|
+
destroy?(ctx: RouterContext): Promise<Response> | Response;
|
|
894
|
+
/**
|
|
895
|
+
* Custom handler for non-RESTful routes
|
|
896
|
+
* Use this for wildcards (e.g., /api/v1/auth/*) or custom patterns
|
|
897
|
+
* Takes precedence over RESTful methods if defined
|
|
898
|
+
*/
|
|
899
|
+
handle?(ctx: RouterContext): Promise<Response> | Response;
|
|
900
|
+
}
|
|
901
|
+
//#endregion
|
|
902
|
+
//#region src/router/middleware.interface.d.ts
|
|
903
|
+
/**
|
|
904
|
+
* Middleware interface for request processing
|
|
905
|
+
*
|
|
906
|
+
* Middlewares use the `@Transient()` decorator and are registered via
|
|
907
|
+
* the `configure(consumer)` method in modules implementing `MiddlewareConfigurable`.
|
|
908
|
+
*
|
|
909
|
+
* @example
|
|
910
|
+
* ```typescript
|
|
911
|
+
* @Transient()
|
|
912
|
+
* export class LoggingMiddleware implements Middleware {
|
|
913
|
+
* async handle(ctx: RouterContext, next: () => Promise<void>): Promise<void> {
|
|
914
|
+
* const start = Date.now()
|
|
915
|
+
* await next()
|
|
916
|
+
* console.log(`Request took ${Date.now() - start}ms`)
|
|
917
|
+
* }
|
|
918
|
+
* }
|
|
919
|
+
*
|
|
920
|
+
* // Register in module:
|
|
921
|
+
* @Module({ providers: [...] })
|
|
922
|
+
* export class AppModule implements MiddlewareConfigurable {
|
|
923
|
+
* configure(consumer: MiddlewareConsumer): void {
|
|
924
|
+
* consumer.apply(LoggingMiddleware).forRoutes('*')
|
|
925
|
+
* }
|
|
926
|
+
* }
|
|
927
|
+
* ```
|
|
928
|
+
*/
|
|
929
|
+
interface Middleware {
|
|
930
|
+
/**
|
|
931
|
+
* Handle middleware logic
|
|
932
|
+
* Call next() to continue the middleware chain
|
|
933
|
+
*
|
|
934
|
+
* @param ctx - Router context with request/response helpers
|
|
935
|
+
* @param next - Function to call the next middleware or route handler
|
|
936
|
+
*/
|
|
937
|
+
handle(ctx: RouterContext, next: () => Promise<void>): Promise<void>;
|
|
938
|
+
}
|
|
939
|
+
//#endregion
|
|
940
|
+
//#region src/middleware/types.d.ts
|
|
941
|
+
/**
|
|
942
|
+
* Route information for middleware targeting
|
|
943
|
+
*/
|
|
944
|
+
interface RouteInfo {
|
|
945
|
+
/** Route path pattern (e.g., '/api/v1/users', '/health') */
|
|
946
|
+
path: string;
|
|
947
|
+
/** HTTP method(s) to match. If omitted, matches all methods */
|
|
948
|
+
method?: HttpMethod | HttpMethod[];
|
|
949
|
+
/** API version(s) to target. When versioning is enabled, resolves to versioned path. */
|
|
950
|
+
version?: string | string[];
|
|
951
|
+
}
|
|
952
|
+
/**
|
|
953
|
+
* Internal configuration entry for middleware registration
|
|
954
|
+
*/
|
|
955
|
+
interface MiddlewareConfigEntry {
|
|
956
|
+
/** Middleware classes to apply */
|
|
957
|
+
middlewares: Constructor<Middleware>[];
|
|
958
|
+
/** Routes to exclude from middleware */
|
|
959
|
+
excludes: RouteInfo[];
|
|
960
|
+
/** Target routes for middleware */
|
|
961
|
+
routes: MiddlewareRouteTarget[];
|
|
962
|
+
}
|
|
963
|
+
/**
|
|
964
|
+
* Valid targets for middleware routes
|
|
965
|
+
* - Controller class: Apply to all routes in that controller
|
|
966
|
+
* - RouteInfo: Apply to specific path/method combination
|
|
967
|
+
* - '*': Apply to all routes (global middleware)
|
|
968
|
+
*/
|
|
969
|
+
type MiddlewareRouteTarget = Constructor<IController> | RouteInfo | '*';
|
|
970
|
+
/**
|
|
971
|
+
* Interface for modules that configure middleware
|
|
972
|
+
*
|
|
973
|
+
* Implement this interface in your module class to configure
|
|
974
|
+
* middleware using the consumer pattern.
|
|
975
|
+
*
|
|
976
|
+
* @example
|
|
977
|
+
* ```typescript
|
|
978
|
+
* @Module({ providers: [...] })
|
|
979
|
+
* export class AppModule implements MiddlewareConfigurable {
|
|
980
|
+
* configure(consumer: MiddlewareConsumer): void {
|
|
981
|
+
* consumer
|
|
982
|
+
* .apply(LoggingMiddleware, CorsMiddleware)
|
|
983
|
+
* .exclude({ path: '/health', method: 'get' })
|
|
984
|
+
* .forRoutes('*')
|
|
985
|
+
*
|
|
986
|
+
* consumer
|
|
987
|
+
* .apply(CorsMiddleware)
|
|
988
|
+
* .forRoutes(ApiController, WebhooksController)
|
|
989
|
+
* }
|
|
990
|
+
* }
|
|
991
|
+
* ```
|
|
992
|
+
*/
|
|
993
|
+
interface MiddlewareConfigurable {
|
|
994
|
+
/**
|
|
995
|
+
* Configure middleware for this module
|
|
996
|
+
* @param consumer - Middleware consumer for fluent configuration
|
|
997
|
+
*/
|
|
998
|
+
configure(consumer: MiddlewareConsumer): void;
|
|
999
|
+
}
|
|
1000
|
+
/**
|
|
1001
|
+
* Forward declaration for MiddlewareConsumer
|
|
1002
|
+
* Implementation in middleware-consumer.ts
|
|
1003
|
+
*/
|
|
1004
|
+
interface MiddlewareConsumer {
|
|
1005
|
+
/**
|
|
1006
|
+
* Specify middleware(s) to apply
|
|
1007
|
+
* @param middlewares - Middleware classes to apply
|
|
1008
|
+
* @returns Builder for configuring routes
|
|
1009
|
+
*/
|
|
1010
|
+
apply(...middlewares: Constructor<Middleware>[]): MiddlewareBuilder;
|
|
1011
|
+
/**
|
|
1012
|
+
* Get all configured middleware entries
|
|
1013
|
+
*/
|
|
1014
|
+
getEntries(): MiddlewareConfigEntry[];
|
|
1015
|
+
}
|
|
1016
|
+
/**
|
|
1017
|
+
* Forward declaration for MiddlewareBuilder
|
|
1018
|
+
* Implementation in middleware-consumer.ts
|
|
1019
|
+
*/
|
|
1020
|
+
interface MiddlewareBuilder {
|
|
1021
|
+
/**
|
|
1022
|
+
* Exclude routes from middleware
|
|
1023
|
+
* @param routes - Routes to exclude (path strings or RouteInfo objects)
|
|
1024
|
+
*/
|
|
1025
|
+
exclude(...routes: (string | RouteInfo)[]): this;
|
|
1026
|
+
/**
|
|
1027
|
+
* Apply middleware to specified routes
|
|
1028
|
+
* @param targets - Controller classes, route patterns, or '*' for global
|
|
1029
|
+
*/
|
|
1030
|
+
forRoutes(...targets: MiddlewareRouteTarget[]): void;
|
|
1031
|
+
}
|
|
1032
|
+
//#endregion
|
|
1033
|
+
//#region src/module/types.d.ts
|
|
1034
|
+
/**
|
|
1035
|
+
* Provider that uses a class constructor
|
|
1036
|
+
*
|
|
1037
|
+
* @example Transient (default)
|
|
1038
|
+
* ```typescript
|
|
1039
|
+
* { provide: UserService, useClass: UserService }
|
|
1040
|
+
* ```
|
|
1041
|
+
*
|
|
1042
|
+
* @example Singleton
|
|
1043
|
+
* ```typescript
|
|
1044
|
+
* { provide: DI_TOKENS.ConsumerRegistry, useClass: ConsumerRegistry, scope: Scope.Singleton }
|
|
1045
|
+
* ```
|
|
1046
|
+
*
|
|
1047
|
+
* @example Request-scoped
|
|
1048
|
+
* ```typescript
|
|
1049
|
+
* { provide: DI_TOKENS.ConnectionManager, useClass: ConnectionManager, scope: Scope.Request }
|
|
1050
|
+
* ```
|
|
1051
|
+
*/
|
|
1052
|
+
interface ClassProvider<T extends object = object> {
|
|
1053
|
+
provide: InjectionToken$2<T>;
|
|
1054
|
+
useClass: Constructor<T>;
|
|
1055
|
+
/** Lifecycle scope - defaults to Transient if not specified */
|
|
1056
|
+
scope?: Scope;
|
|
1057
|
+
}
|
|
1058
|
+
/**
|
|
1059
|
+
* Provider that uses a pre-created value
|
|
1060
|
+
*
|
|
1061
|
+
* Note: Values are inherently singleton-like (same instance always returned).
|
|
1062
|
+
* No scope option needed.
|
|
1063
|
+
*/
|
|
1064
|
+
interface ValueProvider<T extends object = object> {
|
|
1065
|
+
provide: InjectionToken$2<T>;
|
|
1066
|
+
useValue: T;
|
|
1067
|
+
}
|
|
1068
|
+
/**
|
|
1069
|
+
* Provider that uses a factory function with auto-injection support
|
|
1070
|
+
*
|
|
1071
|
+
* Note: Factory providers do not support scope/lifecycle in tsyringe.
|
|
1072
|
+
* Factories are always called fresh on each resolution (transient-like behavior).
|
|
1073
|
+
*
|
|
1074
|
+
* @example Factory with dependencies
|
|
1075
|
+
* ```typescript
|
|
1076
|
+
* {
|
|
1077
|
+
* provide: LOGGER_TOKENS.Transports,
|
|
1078
|
+
* useFactory: (console) => [console],
|
|
1079
|
+
* inject: [LOGGER_TOKENS.ConsoleTransport]
|
|
1080
|
+
* }
|
|
1081
|
+
* ```
|
|
1082
|
+
*/
|
|
1083
|
+
interface FactoryProvider<T extends object = object> {
|
|
1084
|
+
provide: InjectionToken$2<T>;
|
|
1085
|
+
useFactory: (...deps: any[]) => T | Promise<T>;
|
|
1086
|
+
inject?: InjectionToken$2<unknown>[];
|
|
1087
|
+
}
|
|
1088
|
+
/**
|
|
1089
|
+
* Provider that creates an alias to an existing token
|
|
1090
|
+
*
|
|
1091
|
+
* When the `provide` token is resolved, the container resolves `useExisting` instead.
|
|
1092
|
+
* Both tokens return the same instance (for singleton/request-scoped services).
|
|
1093
|
+
*
|
|
1094
|
+
* Use cases:
|
|
1095
|
+
* - Creating interface tokens that alias concrete implementations
|
|
1096
|
+
* - Multiple tokens resolving to the same service
|
|
1097
|
+
*
|
|
1098
|
+
* @example Basic alias
|
|
1099
|
+
* ```typescript
|
|
1100
|
+
* {
|
|
1101
|
+
* provide: 'IUserService',
|
|
1102
|
+
* useExisting: UserService
|
|
1103
|
+
* }
|
|
1104
|
+
* // Resolving 'IUserService' returns the UserService instance
|
|
1105
|
+
* ```
|
|
1106
|
+
*
|
|
1107
|
+
* @example Interface abstraction
|
|
1108
|
+
* ```typescript
|
|
1109
|
+
* providers: [
|
|
1110
|
+
* UserService,
|
|
1111
|
+
* { provide: I_USER_SERVICE, useExisting: UserService }
|
|
1112
|
+
* ]
|
|
1113
|
+
* // Both UserService and I_USER_SERVICE resolve to the same instance
|
|
1114
|
+
* ```
|
|
1115
|
+
*/
|
|
1116
|
+
interface ExistingProvider<T extends object = object> {
|
|
1117
|
+
provide: InjectionToken$2<T>;
|
|
1118
|
+
useExisting: InjectionToken$2<T>;
|
|
1119
|
+
}
|
|
1120
|
+
/**
|
|
1121
|
+
* Union type for all provider types
|
|
1122
|
+
*/
|
|
1123
|
+
type Provider<T extends object = object> = Constructor<T> | ClassProvider<T> | ValueProvider<T> | FactoryProvider<T> | ExistingProvider<T>;
|
|
1124
|
+
/**
|
|
1125
|
+
* Module class type (decorated with @Module)
|
|
1126
|
+
*
|
|
1127
|
+
* Static methods for dynamic module configuration:
|
|
1128
|
+
* - forRoot: Synchronous configuration (like NestJS forRoot)
|
|
1129
|
+
* - forRootAsync: Async configuration with factory (like NestJS forRootAsync)
|
|
1130
|
+
*/
|
|
1131
|
+
interface ModuleClass<T extends object = object> extends Constructor<T> {
|
|
1132
|
+
/**
|
|
1133
|
+
* Synchronous module configuration
|
|
1134
|
+
*
|
|
1135
|
+
* Use for global singleton modules with static configuration
|
|
1136
|
+
*
|
|
1137
|
+
* @example
|
|
1138
|
+
* ```typescript
|
|
1139
|
+
* @Module({ providers: [] })
|
|
1140
|
+
* export class ConfigModule {
|
|
1141
|
+
* static forRoot(options: ConfigOptions): DynamicModule {
|
|
1142
|
+
* return {
|
|
1143
|
+
* providers: [
|
|
1144
|
+
* { provide: CONFIG_TOKEN, useValue: options }
|
|
1145
|
+
* ]
|
|
1146
|
+
* }
|
|
1147
|
+
* }
|
|
1148
|
+
* }
|
|
1149
|
+
*
|
|
1150
|
+
* // Usage in AppModule
|
|
1151
|
+
* @Module({ imports: [ConfigModule.forRoot({ apiKey: '...' })] })
|
|
1152
|
+
* ```
|
|
1153
|
+
*/
|
|
1154
|
+
forRoot?: (...args: unknown[]) => DynamicModule;
|
|
1155
|
+
/**
|
|
1156
|
+
* Async module configuration with dependency injection
|
|
1157
|
+
*
|
|
1158
|
+
* Use when configuration depends on other services
|
|
1159
|
+
*
|
|
1160
|
+
* @example
|
|
1161
|
+
* ```typescript
|
|
1162
|
+
* @Module({ providers: [] })
|
|
1163
|
+
* export class DatabaseModule {
|
|
1164
|
+
* static forRootAsync<T>(options: AsyncModuleOptions<T>): DynamicModule {
|
|
1165
|
+
* return {
|
|
1166
|
+
* providers: [
|
|
1167
|
+
* {
|
|
1168
|
+
* provide: DB_TOKEN,
|
|
1169
|
+
* useFactory: options.useFactory,
|
|
1170
|
+
* inject: options.inject
|
|
1171
|
+
* }
|
|
1172
|
+
* ]
|
|
1173
|
+
* }
|
|
1174
|
+
* }
|
|
1175
|
+
* }
|
|
1176
|
+
*
|
|
1177
|
+
* // Usage in AppModule
|
|
1178
|
+
* @Module({
|
|
1179
|
+
* imports: [
|
|
1180
|
+
* DatabaseModule.forRootAsync({
|
|
1181
|
+
* inject: [CONFIG_TOKEN],
|
|
1182
|
+
* useFactory: (config) => ({ url: config.databaseUrl })
|
|
1183
|
+
* })
|
|
1184
|
+
* ]
|
|
1185
|
+
* })
|
|
1186
|
+
* ```
|
|
1187
|
+
*/
|
|
1188
|
+
forRootAsync?: <TOptions>(options: AsyncModuleOptions<TOptions>) => DynamicModule;
|
|
1189
|
+
}
|
|
1190
|
+
/**
|
|
1191
|
+
* Module options for `@Module` decorator
|
|
1192
|
+
*
|
|
1193
|
+
* Note: Middlewares are configured via the MiddlewareConfigurable interface's
|
|
1194
|
+
* configure() method, not via this options object. See middleware/types.ts.
|
|
1195
|
+
*/
|
|
1196
|
+
interface ModuleOptions {
|
|
1197
|
+
imports?: (ModuleClass | DynamicModule)[];
|
|
1198
|
+
providers?: Provider[];
|
|
1199
|
+
controllers?: Constructor[];
|
|
1200
|
+
consumers?: Constructor[];
|
|
1201
|
+
jobs?: Constructor[];
|
|
1202
|
+
}
|
|
1203
|
+
/**
|
|
1204
|
+
* Dynamic module returned by forRoot/forRootAsync
|
|
1205
|
+
*
|
|
1206
|
+
* Contains additional providers, controllers, consumers, and jobs
|
|
1207
|
+
* that are added to the module when configured dynamically.
|
|
1208
|
+
*/
|
|
1209
|
+
interface DynamicModule extends Omit<ModuleOptions, 'imports'> {
|
|
1210
|
+
/**
|
|
1211
|
+
* Reference to the module class that created this dynamic module
|
|
1212
|
+
*
|
|
1213
|
+
* Required for dynamic modules to support lifecycle methods (configure, onInitialize, onShutdown).
|
|
1214
|
+
* ModuleRegistry uses this to instantiate the actual module class instead of an anonymous wrapper.
|
|
1215
|
+
*
|
|
1216
|
+
* Note: This is NOT for provider scoping (tsyringe is always global).
|
|
1217
|
+
* It's purely for preserving the class reference for lifecycle method calls.
|
|
1218
|
+
*/
|
|
1219
|
+
module: Constructor;
|
|
1220
|
+
}
|
|
1221
|
+
/**
|
|
1222
|
+
* Async configuration options for forRootAsync
|
|
1223
|
+
*/
|
|
1224
|
+
interface AsyncModuleOptions<TOptions> {
|
|
1225
|
+
inject?: InjectionToken$2<unknown>[];
|
|
1226
|
+
useFactory: (...deps: any[]) => TOptions | Promise<TOptions>;
|
|
1227
|
+
}
|
|
1228
|
+
/**
|
|
1229
|
+
* Context passed to lifecycle hooks
|
|
1230
|
+
*/
|
|
1231
|
+
interface ModuleContext {
|
|
1232
|
+
container: Container;
|
|
1233
|
+
logger: LoggerService;
|
|
1234
|
+
}
|
|
1235
|
+
/**
|
|
1236
|
+
* Lifecycle hook: called after all providers are registered
|
|
1237
|
+
*/
|
|
1238
|
+
interface OnInitialize {
|
|
1239
|
+
onInitialize(context: ModuleContext): void | Promise<void>;
|
|
1240
|
+
}
|
|
1241
|
+
/**
|
|
1242
|
+
* Lifecycle hook: called during application shutdown
|
|
1243
|
+
*/
|
|
1244
|
+
interface OnShutdown {
|
|
1245
|
+
onShutdown(context: ModuleContext): void | Promise<void>;
|
|
1246
|
+
}
|
|
1247
|
+
/**
|
|
1248
|
+
* Tsyringe registry entry type (for internal use)
|
|
1249
|
+
*
|
|
1250
|
+
* Note: useFactory receives DependencyContainer from tsyringe,
|
|
1251
|
+
* but we resolve our Container via CONTAINER_TOKEN for consistency.
|
|
1252
|
+
*/
|
|
1253
|
+
interface RegistryEntry<T extends object = object> {
|
|
1254
|
+
token: InjectionToken$2<T>;
|
|
1255
|
+
useClass?: Constructor<T>;
|
|
1256
|
+
useValue?: T;
|
|
1257
|
+
useFactory?: (dependencyContainer: DependencyContainer) => T;
|
|
1258
|
+
useToken?: InjectionToken$2<T>;
|
|
1259
|
+
}
|
|
1260
|
+
//#endregion
|
|
1261
|
+
//#region src/i18n/i18n.options.d.ts
|
|
1262
|
+
/**
|
|
1263
|
+
* I18n Module Options
|
|
1264
|
+
*
|
|
1265
|
+
* Configuration options for the I18n dynamic module.
|
|
1266
|
+
* Use with I18nModule.forRoot() to configure i18n for your application.
|
|
1267
|
+
*/
|
|
1268
|
+
/**
|
|
1269
|
+
* Options for configuring the I18n module
|
|
1270
|
+
*
|
|
1271
|
+
* @example
|
|
1272
|
+
* ```typescript
|
|
1273
|
+
* I18nModule.forRoot({
|
|
1274
|
+
* defaultLocale: 'en',
|
|
1275
|
+
* fallbackLocale: 'en',
|
|
1276
|
+
* locales: ['en', 'fr'],
|
|
1277
|
+
* messages: {
|
|
1278
|
+
* en: { common: { hello: 'Hello' } },
|
|
1279
|
+
* fr: { common: { hello: 'Bonjour' } }
|
|
1280
|
+
* }
|
|
1281
|
+
* })
|
|
1282
|
+
* ```
|
|
1283
|
+
*/
|
|
1284
|
+
interface I18nModuleOptions {
|
|
1285
|
+
/**
|
|
1286
|
+
* Default locale for the application
|
|
1287
|
+
* Used when no locale is specified in request headers
|
|
1288
|
+
* @default 'en'
|
|
1289
|
+
*/
|
|
1290
|
+
defaultLocale?: string;
|
|
1291
|
+
/**
|
|
1292
|
+
* Fallback locale when translation is missing
|
|
1293
|
+
* @default 'en'
|
|
1294
|
+
*/
|
|
1295
|
+
fallbackLocale?: string;
|
|
1296
|
+
/**
|
|
1297
|
+
* List of supported locales
|
|
1298
|
+
* Request locales not in this list will fall back to defaultLocale
|
|
1299
|
+
*/
|
|
1300
|
+
locales?: string[];
|
|
1301
|
+
/**
|
|
1302
|
+
* Application-specific messages to merge with system messages
|
|
1303
|
+
* Keys are locale codes, values are message objects
|
|
1304
|
+
*/
|
|
1305
|
+
messages?: Record<string, Record<string, unknown>>;
|
|
1306
|
+
}
|
|
1307
|
+
/**
|
|
1308
|
+
* Resolved options with all defaults applied
|
|
1309
|
+
* Used internally by I18n services
|
|
1310
|
+
*/
|
|
1311
|
+
interface ResolvedI18nOptions {
|
|
1312
|
+
defaultLocale: string;
|
|
1313
|
+
fallbackLocale: string;
|
|
1314
|
+
locales: string[];
|
|
1315
|
+
messages: Record<string, Record<string, unknown>>;
|
|
1316
|
+
}
|
|
1317
|
+
/**
|
|
1318
|
+
* Resolve I18n options with defaults
|
|
1319
|
+
*/
|
|
1320
|
+
declare function resolveI18nOptions(options?: I18nModuleOptions): ResolvedI18nOptions;
|
|
1321
|
+
//#endregion
|
|
1322
|
+
//#region src/i18n/i18n.module.d.ts
|
|
1323
|
+
declare class I18nModule implements MiddlewareConfigurable {
|
|
1324
|
+
/**
|
|
1325
|
+
* Configure I18n with app-specific options
|
|
1326
|
+
*
|
|
1327
|
+
* Use this method in AppModule to provide custom locale configuration
|
|
1328
|
+
* and app-specific messages that merge with system messages.
|
|
1329
|
+
*
|
|
1330
|
+
* @param options - I18n configuration options
|
|
1331
|
+
* @returns Dynamic module with options provider
|
|
1332
|
+
*
|
|
1333
|
+
* @example
|
|
1334
|
+
* ```typescript
|
|
1335
|
+
* // apps/backend/src/i18n/index.ts
|
|
1336
|
+
* export const i18nConfig: I18nModuleOptions = {
|
|
1337
|
+
* defaultLocale: 'en',
|
|
1338
|
+
* fallbackLocale: 'en',
|
|
1339
|
+
* locales: ['en', 'fr'],
|
|
1340
|
+
* messages: appMessages
|
|
1341
|
+
* }
|
|
1342
|
+
*
|
|
1343
|
+
* // apps/backend/src/app.module.ts
|
|
1344
|
+
* @Module({
|
|
1345
|
+
* imports: [I18nModule.forRoot(i18nConfig)],
|
|
1346
|
+
* })
|
|
1347
|
+
* export class AppModule {}
|
|
1348
|
+
* ```
|
|
1349
|
+
*/
|
|
1350
|
+
static forRoot(options?: I18nModuleOptions): DynamicModule;
|
|
1351
|
+
/**
|
|
1352
|
+
* Configure middleware for locale extraction and i18n context
|
|
1353
|
+
*/
|
|
1354
|
+
configure(consumer: MiddlewareConsumer): void;
|
|
1355
|
+
}
|
|
1356
|
+
//#endregion
|
|
1357
|
+
//#region src/i18n/i18n.tokens.d.ts
|
|
1358
|
+
/**
|
|
1359
|
+
* I18n Module DI Tokens
|
|
1360
|
+
* Symbol-based tokens to avoid string collisions
|
|
1361
|
+
*/
|
|
1362
|
+
declare const I18N_TOKENS: {
|
|
1363
|
+
/** MessageLoaderService - loads and caches locale messages */readonly MessageLoader: symbol; /** I18nService - request-scoped translation service */
|
|
1364
|
+
readonly I18nService: symbol; /** I18nModuleOptions - configuration options from forRoot() */
|
|
1365
|
+
readonly Options: symbol;
|
|
1366
|
+
};
|
|
1367
|
+
//#endregion
|
|
1368
|
+
//#region src/i18n/setup.d.ts
|
|
1369
|
+
/**
|
|
1370
|
+
* I18n Setup - Message Compiler Registration
|
|
1371
|
+
*
|
|
1372
|
+
* Registers a JIT (Just-In-Time) message compiler for @intlify/core-base
|
|
1373
|
+
* that works in Cloudflare Workers edge runtime.
|
|
1374
|
+
*
|
|
1375
|
+
* This must be called ONCE at application startup, before any I18nService instances are created.
|
|
1376
|
+
*/
|
|
1377
|
+
/**
|
|
1378
|
+
* Setup JIT message compiler for i18n
|
|
1379
|
+
*
|
|
1380
|
+
* Registers a message compiler that uses JIT compilation mode.
|
|
1381
|
+
* In @intlify/core-base v10+, JIT mode is enabled by default, which generates
|
|
1382
|
+
* AST (Abstract Syntax Tree) instead of JavaScript code, making it compatible
|
|
1383
|
+
* with CSP-restricted environments like Cloudflare Workers.
|
|
1384
|
+
*
|
|
1385
|
+
* **IMPORTANT:** Call this function once at application startup before creating
|
|
1386
|
+
* any I18nService instances. Safe to call multiple times (only registers once).
|
|
1387
|
+
*
|
|
1388
|
+
* @example
|
|
1389
|
+
* ```typescript
|
|
1390
|
+
* // In application entry point (before app.initialize())
|
|
1391
|
+
* setupI18nCompiler()
|
|
1392
|
+
* ```
|
|
1393
|
+
*/
|
|
1394
|
+
declare function setupI18nCompiler(): void;
|
|
1395
|
+
//#endregion
|
|
1396
|
+
//#region src/i18n/errors/locale-not-supported.error.d.ts
|
|
1397
|
+
declare class LocaleNotSupportedError extends ApplicationError {
|
|
1398
|
+
constructor(locale: string, supportedLocales: string[]);
|
|
1399
|
+
}
|
|
1400
|
+
//#endregion
|
|
1401
|
+
//#region src/i18n/errors/translation-missing.error.d.ts
|
|
1402
|
+
declare class TranslationMissingError extends ApplicationError {
|
|
1403
|
+
constructor(key: string, locale: string);
|
|
1404
|
+
}
|
|
1405
|
+
//#endregion
|
|
1406
|
+
//#region src/i18n/services/message-loader.service.d.ts
|
|
1407
|
+
declare class MessageLoaderService {
|
|
1408
|
+
private readonly options?;
|
|
1409
|
+
private readonly cache;
|
|
1410
|
+
private readonly contextCache;
|
|
1411
|
+
private readonly locales;
|
|
1412
|
+
private readonly defaultLocale;
|
|
1413
|
+
constructor(options?: I18nModuleOptions | undefined);
|
|
1414
|
+
/**
|
|
1415
|
+
* Get CoreContext for a locale (lazily built and cached on first access)
|
|
1416
|
+
* Falls back to default locale if locale not found
|
|
1417
|
+
*
|
|
1418
|
+
* @param locale - Locale code
|
|
1419
|
+
* @returns Cached CoreContext ready for translation
|
|
1420
|
+
*/
|
|
1421
|
+
getCoreContext(locale: string): CoreContext;
|
|
1422
|
+
/**
|
|
1423
|
+
* Get messages for a specific locale
|
|
1424
|
+
* Falls back to default locale if locale not found
|
|
1425
|
+
*
|
|
1426
|
+
* @param locale - Locale code
|
|
1427
|
+
* @returns Message object for the locale
|
|
1428
|
+
*/
|
|
1429
|
+
getMessages(locale: string): Record<string, unknown>;
|
|
1430
|
+
/**
|
|
1431
|
+
* Get list of available locale codes
|
|
1432
|
+
*
|
|
1433
|
+
* @returns Array of locale codes
|
|
1434
|
+
*/
|
|
1435
|
+
getAvailableLocales(): string[];
|
|
1436
|
+
/**
|
|
1437
|
+
* Check if a locale is supported
|
|
1438
|
+
*
|
|
1439
|
+
* @param locale - Locale code to check
|
|
1440
|
+
* @returns true if locale is supported
|
|
1441
|
+
*/
|
|
1442
|
+
isLocaleSupported(locale: string): boolean;
|
|
1443
|
+
/**
|
|
1444
|
+
* Get default locale
|
|
1445
|
+
*
|
|
1446
|
+
* @returns Default locale code
|
|
1447
|
+
*/
|
|
1448
|
+
getDefaultLocale(): string;
|
|
1449
|
+
/**
|
|
1450
|
+
* Flatten nested messages to dot-notation
|
|
1451
|
+
*
|
|
1452
|
+
* Converts { auth: { login: { title: 'Sign In' } } }
|
|
1453
|
+
* to { 'auth.login.title': 'Sign In' }
|
|
1454
|
+
*/
|
|
1455
|
+
private flattenMessages;
|
|
1456
|
+
/**
|
|
1457
|
+
* Deep merge two objects
|
|
1458
|
+
* App messages override core messages at leaf level
|
|
1459
|
+
*/
|
|
1460
|
+
private deepMerge;
|
|
1461
|
+
}
|
|
1462
|
+
//#endregion
|
|
1463
|
+
//#region src/i18n/middleware/locale-extraction.middleware.d.ts
|
|
1464
|
+
declare class LocaleExtractionMiddleware implements Middleware {
|
|
1465
|
+
private readonly loader;
|
|
1466
|
+
constructor(loader: MessageLoaderService);
|
|
1467
|
+
handle(ctx: RouterContext, next: () => Promise<void>): Promise<void>;
|
|
1468
|
+
/**
|
|
1469
|
+
* Extract and validate locale from X-Locale header
|
|
1470
|
+
*/
|
|
1471
|
+
private extractLocale;
|
|
1472
|
+
}
|
|
1473
|
+
//#endregion
|
|
1474
|
+
//#region src/middleware/middleware-consumer.d.ts
|
|
1475
|
+
/**
|
|
1476
|
+
* Consumer for configuring middleware in modules
|
|
1477
|
+
*
|
|
1478
|
+
* Provides fluent API for registering middleware with route targeting.
|
|
1479
|
+
* Used by modules implementing MiddlewareConfigurable interface.
|
|
1480
|
+
*
|
|
1481
|
+
* @example
|
|
1482
|
+
* ```typescript
|
|
1483
|
+
* @Module({ providers: [...] })
|
|
1484
|
+
* export class AppModule implements MiddlewareConfigurable {
|
|
1485
|
+
* configure(consumer: MiddlewareConsumer): void {
|
|
1486
|
+
* // Global logging middleware (excludes health check)
|
|
1487
|
+
* consumer
|
|
1488
|
+
* .apply(LoggingMiddleware)
|
|
1489
|
+
* .exclude('/health')
|
|
1490
|
+
* .forRoutes('*')
|
|
1491
|
+
*
|
|
1492
|
+
* // CORS middleware for specific controllers
|
|
1493
|
+
* consumer
|
|
1494
|
+
* .apply(CorsMiddleware)
|
|
1495
|
+
* .forRoutes(ApiController, WebhooksController)
|
|
1496
|
+
*
|
|
1497
|
+
* // Rate limiting for auth endpoints
|
|
1498
|
+
* consumer
|
|
1499
|
+
* .apply(RateLimitMiddleware)
|
|
1500
|
+
* .forRoutes({ path: '/api/v1/auth/*', method: 'post' })
|
|
1501
|
+
* }
|
|
1502
|
+
* }
|
|
1503
|
+
* ```
|
|
1504
|
+
*/
|
|
1505
|
+
declare class MiddlewareConsumerImpl implements MiddlewareConsumer {
|
|
1506
|
+
private entries;
|
|
1507
|
+
/**
|
|
1508
|
+
* Start configuring middleware
|
|
1509
|
+
*
|
|
1510
|
+
* @param middlewares - Middleware classes to apply
|
|
1511
|
+
* @returns Builder for configuring routes and exclusions
|
|
1512
|
+
*/
|
|
1513
|
+
apply(...middlewares: Constructor<Middleware>[]): MiddlewareBuilder;
|
|
1514
|
+
/**
|
|
1515
|
+
* Add a configuration entry (called by builder)
|
|
1516
|
+
* @internal
|
|
1517
|
+
*/
|
|
1518
|
+
addEntry(entry: MiddlewareConfigEntry): void;
|
|
1519
|
+
/**
|
|
1520
|
+
* Get all configured middleware entries
|
|
1521
|
+
*/
|
|
1522
|
+
getEntries(): MiddlewareConfigEntry[];
|
|
1523
|
+
}
|
|
1524
|
+
/**
|
|
1525
|
+
* Create a new middleware consumer instance
|
|
1526
|
+
*/
|
|
1527
|
+
declare function createMiddlewareConsumer(): MiddlewareConsumer;
|
|
1528
|
+
//#endregion
|
|
1529
|
+
//#region src/middleware/middleware-configuration.service.d.ts
|
|
1530
|
+
/**
|
|
1531
|
+
* Service for applying middleware configurations to Hono app
|
|
1532
|
+
*
|
|
1533
|
+
* Processes MiddlewareConfigEntry[] from modules and registers
|
|
1534
|
+
* appropriate middleware handlers with route matching.
|
|
1535
|
+
*/
|
|
1536
|
+
declare class MiddlewareConfigurationService {
|
|
1537
|
+
private readonly logger;
|
|
1538
|
+
private readonly versioningOptions;
|
|
1539
|
+
constructor(logger: LoggerService, versioningOptions?: VersioningOptions | null);
|
|
1540
|
+
/**
|
|
1541
|
+
* Apply middleware configurations to the Hono app
|
|
1542
|
+
*
|
|
1543
|
+
* @param app - Hono application instance
|
|
1544
|
+
* @param configs - Middleware configuration entries from modules
|
|
1545
|
+
* @param controllers - All registered controller classes (for route resolution)
|
|
1546
|
+
* @param container - DI container for resolving middleware instances
|
|
1547
|
+
*/
|
|
1548
|
+
applyMiddlewares(app: OpenAPIHono<RouterEnv>, configs: MiddlewareConfigEntry[], controllers: Constructor<IController>[], container: Container): void;
|
|
1549
|
+
/**
|
|
1550
|
+
* Apply a single middleware configuration entry
|
|
1551
|
+
*/
|
|
1552
|
+
private applyMiddlewareConfig;
|
|
1553
|
+
/**
|
|
1554
|
+
* Resolve route targets into concrete route patterns
|
|
1555
|
+
*/
|
|
1556
|
+
private resolveRoutePatterns;
|
|
1557
|
+
/**
|
|
1558
|
+
* Resolve a RouteInfo with version into versioned path(s).
|
|
1559
|
+
* If versioning is disabled or no version is specified, returns the RouteInfo as-is.
|
|
1560
|
+
*/
|
|
1561
|
+
private resolveVersionedRouteInfo;
|
|
1562
|
+
/**
|
|
1563
|
+
* Register middleware handlers for a specific route pattern
|
|
1564
|
+
*/
|
|
1565
|
+
private registerMiddlewareForPattern;
|
|
1566
|
+
/**
|
|
1567
|
+
* Register handler for a specific HTTP method
|
|
1568
|
+
*/
|
|
1569
|
+
private registerForMethod;
|
|
1570
|
+
/**
|
|
1571
|
+
* Create a middleware handler function that executes the middleware chain
|
|
1572
|
+
*/
|
|
1573
|
+
private createMiddlewareHandler;
|
|
1574
|
+
/**
|
|
1575
|
+
* Check if a request matches any exclusion pattern
|
|
1576
|
+
*/
|
|
1577
|
+
private isExcluded;
|
|
1578
|
+
/**
|
|
1579
|
+
* Check if request matches a route pattern
|
|
1580
|
+
*/
|
|
1581
|
+
private matchesRoute;
|
|
1582
|
+
/**
|
|
1583
|
+
* Match request path against pattern
|
|
1584
|
+
* Supports wildcards: /api/* matches /api/users, /api/v1/users
|
|
1585
|
+
*/
|
|
1586
|
+
private matchesPath;
|
|
1587
|
+
/**
|
|
1588
|
+
* Execute middleware chain in order
|
|
1589
|
+
*/
|
|
1590
|
+
private executeMiddlewareChain;
|
|
1591
|
+
}
|
|
1592
|
+
//#endregion
|
|
1593
|
+
//#region src/router/hono-app.d.ts
|
|
1594
|
+
/**
|
|
1595
|
+
* HonoApp — extends OpenAPIHono with Stratal-specific setup
|
|
1596
|
+
*
|
|
1597
|
+
* Absorbs all Hono-related setup from the former RouterService and RequestScopeService:
|
|
1598
|
+
* - Request scope middleware (child container per request)
|
|
1599
|
+
* - Global middleware (CORS, logging, error handling)
|
|
1600
|
+
* - defaultHook for validation errors
|
|
1601
|
+
* - `use()` overload for Stratal middleware classes
|
|
1602
|
+
* - `configure()` for module middleware, OpenAPI, routes, and 404
|
|
1603
|
+
*/
|
|
1604
|
+
declare class HonoApp extends OpenAPIHono<RouterEnv> {
|
|
1605
|
+
private configured;
|
|
1606
|
+
private readonly _container;
|
|
1607
|
+
private readonly _logger;
|
|
1608
|
+
/**
|
|
1609
|
+
* Reference to the original Hono `use` implementation.
|
|
1610
|
+
* Captured in constructor after super() sets it as an instance property.
|
|
1611
|
+
* Used by private methods to register middleware without going through the override.
|
|
1612
|
+
*/
|
|
1613
|
+
private nativeUse;
|
|
1614
|
+
constructor(container: Container, logger: LoggerService);
|
|
1615
|
+
/**
|
|
1616
|
+
* Configure module middleware, OpenAPI endpoints, controller routes, and 404 handler.
|
|
1617
|
+
* Called once by Application.initialize().
|
|
1618
|
+
*/
|
|
1619
|
+
configure(middlewareConfigs: MiddlewareConfigEntry[], controllers: Constructor<IController>[], versioningOptions?: VersioningOptions | null): Promise<void>;
|
|
1620
|
+
private setupRequestScope;
|
|
1621
|
+
private setupGlobalMiddleware;
|
|
1622
|
+
private applyMiddlewareClasses;
|
|
1623
|
+
}
|
|
1624
|
+
//#endregion
|
|
1625
|
+
//#region src/router/services/route-registration.service.d.ts
|
|
1626
|
+
/**
|
|
1627
|
+
* Route registration service
|
|
1628
|
+
* Manages controller and route registration with OpenAPI support
|
|
1629
|
+
*
|
|
1630
|
+
* Responsibilities:
|
|
1631
|
+
* - Register RESTful controllers with OpenAPI metadata
|
|
1632
|
+
* - Auto-derive HTTP methods/paths from controller method names
|
|
1633
|
+
* - Build OpenAPI route configurations with guard execution
|
|
1634
|
+
* - Validate all controllers have access decorators (strict mode)
|
|
1635
|
+
* - Create controller handlers with DI resolution
|
|
1636
|
+
*/
|
|
1637
|
+
declare class RouteRegistrationService {
|
|
1638
|
+
private logger;
|
|
1639
|
+
private versioningOptions;
|
|
1640
|
+
private controllerClasses;
|
|
1641
|
+
constructor(logger: LoggerService, versioningOptions?: VersioningOptions | null);
|
|
1642
|
+
/**
|
|
1643
|
+
* Configure router with controllers
|
|
1644
|
+
*
|
|
1645
|
+
* @param app - OpenAPIHono application instance
|
|
1646
|
+
* @param controllers - Array of controller classes from modules
|
|
1647
|
+
*/
|
|
1648
|
+
configure(app: OpenAPIHono<RouterEnv>, controllers: Constructor<IController>[]): Promise<void>;
|
|
1649
|
+
/**
|
|
1650
|
+
* Register a WebSocket gateway
|
|
1651
|
+
* Applies versioning and guards, then registers an upgradeWebSocket handler
|
|
1652
|
+
*/
|
|
1653
|
+
private registerGateway;
|
|
1654
|
+
/**
|
|
1655
|
+
* Register a single WebSocket gateway route
|
|
1656
|
+
*/
|
|
1657
|
+
private registerGatewayRoute;
|
|
1658
|
+
/**
|
|
1659
|
+
* Register a single controller with all its routes
|
|
1660
|
+
* Validates that controller has access decorator (strict mode)
|
|
1661
|
+
*/
|
|
1662
|
+
private registerController;
|
|
1663
|
+
/**
|
|
1664
|
+
* Dispatch route registration based on decorator type
|
|
1665
|
+
*/
|
|
1666
|
+
private dispatchRoutes;
|
|
1667
|
+
/**
|
|
1668
|
+
* Resolve versioned paths for a controller based on versioning configuration.
|
|
1669
|
+
*
|
|
1670
|
+
* @param basePath - The base path from @Controller decorator
|
|
1671
|
+
* @param controllerOpts - Controller options (may contain version)
|
|
1672
|
+
* @returns Array of resolved paths (with version prefix if applicable)
|
|
1673
|
+
*/
|
|
1674
|
+
private resolveVersionedPaths;
|
|
1675
|
+
/**
|
|
1676
|
+
* Create a guard execution middleware
|
|
1677
|
+
*
|
|
1678
|
+
* This middleware executes all guards for a route before the handler.
|
|
1679
|
+
* Guards are executed in order; all must pass for the request to proceed.
|
|
1680
|
+
*
|
|
1681
|
+
* @param guards - Array of guards to execute
|
|
1682
|
+
* @returns Hono middleware function
|
|
1683
|
+
*/
|
|
1684
|
+
private createGuardMiddleware;
|
|
1685
|
+
/**
|
|
1686
|
+
* Register wildcard route for non-RESTful controllers
|
|
1687
|
+
*/
|
|
1688
|
+
private registerWildcardRoute;
|
|
1689
|
+
/**
|
|
1690
|
+
* Register OpenAPI routes with metadata
|
|
1691
|
+
*/
|
|
1692
|
+
private registerOpenAPIRoutes;
|
|
1693
|
+
/**
|
|
1694
|
+
* Register routes using HTTP method decorators (@Get, @Post, etc.)
|
|
1695
|
+
* These use explicit method + path instead of convention-based derivation
|
|
1696
|
+
*/
|
|
1697
|
+
private registerHttpRoutes;
|
|
1698
|
+
/**
|
|
1699
|
+
* Join a base path and a route path, normalizing slashes
|
|
1700
|
+
*/
|
|
1701
|
+
private joinPaths;
|
|
1702
|
+
/**
|
|
1703
|
+
* Register route without OpenAPI metadata (for hidden routes)
|
|
1704
|
+
* Route is functional but won't appear in documentation
|
|
1705
|
+
*/
|
|
1706
|
+
private registerRouteWithoutOpenAPI;
|
|
1707
|
+
/**
|
|
1708
|
+
* Register traditional RESTful routes without OpenAPI
|
|
1709
|
+
*/
|
|
1710
|
+
private registerRESTfulRoutes;
|
|
1711
|
+
/**
|
|
1712
|
+
* Auto-derive HTTP method and path from controller method name
|
|
1713
|
+
* Uses HTTP_METHODS constant for RESTful convention mapping
|
|
1714
|
+
*/
|
|
1715
|
+
private deriveHttpMethodAndPath;
|
|
1716
|
+
/**
|
|
1717
|
+
* Merge controller-level and route-level metadata
|
|
1718
|
+
* Tags are merged (appended), security is merged (union)
|
|
1719
|
+
* Guards automatically add sessionCookie security if present
|
|
1720
|
+
*/
|
|
1721
|
+
private mergeMetadata;
|
|
1722
|
+
/**
|
|
1723
|
+
* Build OpenAPI route configuration from metadata
|
|
1724
|
+
* Creates a route definition compatible with @hono/zod-openapi
|
|
1725
|
+
* Includes guard execution for proper access control
|
|
1726
|
+
*
|
|
1727
|
+
* Execution order: Global middlewares → Guards → Handler
|
|
1728
|
+
*/
|
|
1729
|
+
private buildOpenAPIRoute;
|
|
1730
|
+
/**
|
|
1731
|
+
* Check if a body definition is a RouteBodyObject (has schema key) vs bare ZodType
|
|
1732
|
+
*/
|
|
1733
|
+
private isRouteBodyObject;
|
|
1734
|
+
/**
|
|
1735
|
+
* Resolve method parameter injections from the container
|
|
1736
|
+
*
|
|
1737
|
+
* @param prototype - Controller prototype
|
|
1738
|
+
* @param methodName - Method name to get injections for
|
|
1739
|
+
* @param container - Request-scoped container
|
|
1740
|
+
* @returns Array of resolved dependencies in parameter order
|
|
1741
|
+
*/
|
|
1742
|
+
private resolveMethodInjections;
|
|
1743
|
+
/**
|
|
1744
|
+
* Create controller handler that resolves controller from request-scoped container
|
|
1745
|
+
* This ensures each request gets a fresh controller with request-scoped context
|
|
1746
|
+
*/
|
|
1747
|
+
private createControllerHandler;
|
|
1748
|
+
}
|
|
1749
|
+
//#endregion
|
|
1750
|
+
//#region src/router/router.tokens.d.ts
|
|
1751
|
+
/**
|
|
1752
|
+
* Dependency injection tokens for the router system
|
|
1753
|
+
*/
|
|
1754
|
+
declare const ROUTER_TOKENS: {
|
|
1755
|
+
/**
|
|
1756
|
+
* Token for RouterContext (request-scoped)
|
|
1757
|
+
* Contains Hono context wrapper with helper methods
|
|
1758
|
+
*/
|
|
1759
|
+
readonly RouterContext: symbol;
|
|
1760
|
+
};
|
|
1761
|
+
//#endregion
|
|
1762
|
+
//#region src/router/decorators/controller.decorator.d.ts
|
|
1763
|
+
/**
|
|
1764
|
+
* Base controller decorator for route registration
|
|
1765
|
+
*
|
|
1766
|
+
* This is the core controller decorator that handles:
|
|
1767
|
+
* - Transient scope registration (request-scoped)
|
|
1768
|
+
* - Route metadata storage
|
|
1769
|
+
* - Controller options (tags, security schemes, hideFromDocs)
|
|
1770
|
+
*
|
|
1771
|
+
* @param route - Base route for this controller (e.g., '/api/v1/users')
|
|
1772
|
+
* @param options - Optional configuration (tags, security schemes, hideFromDocs)
|
|
1773
|
+
*
|
|
1774
|
+
* @example
|
|
1775
|
+
* ```typescript
|
|
1776
|
+
* import { Controller } from 'stratal/router'
|
|
1777
|
+
*
|
|
1778
|
+
* @Controller('/api/v1/users', { tags: ['Users'] })
|
|
1779
|
+
* export class UsersController implements IController {
|
|
1780
|
+
* // All routes accessible
|
|
1781
|
+
* }
|
|
1782
|
+
* ```
|
|
1783
|
+
*/
|
|
1784
|
+
declare function Controller(route: string, options?: ControllerOptions): <T extends Constructor>(target: T) => T;
|
|
1785
|
+
/**
|
|
1786
|
+
* Get the route from controller class metadata
|
|
1787
|
+
*
|
|
1788
|
+
* @param target - Controller class or instance
|
|
1789
|
+
* @returns Route string or undefined if not set
|
|
1790
|
+
*/
|
|
1791
|
+
declare function getControllerRoute(target: object): string | undefined;
|
|
1792
|
+
/**
|
|
1793
|
+
* Get the options from controller class metadata
|
|
1794
|
+
*
|
|
1795
|
+
* @param target - Controller class or instance
|
|
1796
|
+
* @returns Controller options or undefined if not set
|
|
1797
|
+
*/
|
|
1798
|
+
declare function getControllerOptions(target: object): ControllerOptions | undefined;
|
|
1799
|
+
/**
|
|
1800
|
+
* Get the version from controller class metadata
|
|
1801
|
+
*
|
|
1802
|
+
* @param target - Controller class or instance
|
|
1803
|
+
* @returns Version string, array, VERSION_NEUTRAL symbol, or undefined if not set
|
|
1804
|
+
*/
|
|
1805
|
+
declare function getControllerVersion(target: object): ControllerOptions['version'];
|
|
1806
|
+
//#endregion
|
|
1807
|
+
//#region src/router/decorators/http-method.decorator.d.ts
|
|
1808
|
+
/**
|
|
1809
|
+
* Registers a GET route on the controller method.
|
|
1810
|
+
*
|
|
1811
|
+
* @param path - Route path relative to the controller base path
|
|
1812
|
+
* @param config - Optional route configuration (response schema, body, params, etc.)
|
|
1813
|
+
*
|
|
1814
|
+
* @example
|
|
1815
|
+
* ```typescript
|
|
1816
|
+
* @Controller('/api/v1/users')
|
|
1817
|
+
* class UsersController {
|
|
1818
|
+
* @Get('/', { response: z.array(userSchema), summary: 'List users' })
|
|
1819
|
+
* async list(ctx: RouterContext) { ... }
|
|
1820
|
+
*
|
|
1821
|
+
* @Get('/:id', { params: z.object({ id: z.string().uuid() }), response: userSchema })
|
|
1822
|
+
* async getUser(ctx: RouterContext) { ... }
|
|
1823
|
+
* }
|
|
1824
|
+
* ```
|
|
1825
|
+
*/
|
|
1826
|
+
declare const Get: (path: string, config?: RouteConfig) => (target: object, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
1827
|
+
/**
|
|
1828
|
+
* Registers a POST route on the controller method.
|
|
1829
|
+
*
|
|
1830
|
+
* @param path - Route path relative to the controller base path
|
|
1831
|
+
* @param config - Optional route configuration (response schema, body, params, etc.)
|
|
1832
|
+
*
|
|
1833
|
+
* @example
|
|
1834
|
+
* ```typescript
|
|
1835
|
+
* @Controller('/api/v1/users')
|
|
1836
|
+
* class UsersController {
|
|
1837
|
+
* @Post('/', { body: createUserSchema, response: userSchema, statusCode: 201 })
|
|
1838
|
+
* async createUser(ctx: RouterContext) { ... }
|
|
1839
|
+
* }
|
|
1840
|
+
* ```
|
|
1841
|
+
*/
|
|
1842
|
+
declare const Post: (path: string, config?: RouteConfig) => (target: object, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
1843
|
+
/**
|
|
1844
|
+
* Registers a PUT route on the controller method.
|
|
1845
|
+
*
|
|
1846
|
+
* @param path - Route path relative to the controller base path
|
|
1847
|
+
* @param config - Optional route configuration
|
|
1848
|
+
*/
|
|
1849
|
+
declare const Put: (path: string, config?: RouteConfig) => (target: object, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
1850
|
+
/**
|
|
1851
|
+
* Registers a PATCH route on the controller method.
|
|
1852
|
+
*
|
|
1853
|
+
* @param path - Route path relative to the controller base path
|
|
1854
|
+
* @param config - Optional route configuration
|
|
1855
|
+
*/
|
|
1856
|
+
declare const Patch: (path: string, config?: RouteConfig) => (target: object, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
1857
|
+
/**
|
|
1858
|
+
* Registers a DELETE route on the controller method.
|
|
1859
|
+
*
|
|
1860
|
+
* @param path - Route path relative to the controller base path
|
|
1861
|
+
* @param config - Optional route configuration
|
|
1862
|
+
*/
|
|
1863
|
+
declare const Delete: (path: string, config?: RouteConfig) => (target: object, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
1864
|
+
/**
|
|
1865
|
+
* Registers an ALL (any HTTP method) route on the controller method.
|
|
1866
|
+
* Routes using @All are automatically hidden from OpenAPI documentation
|
|
1867
|
+
* since OpenAPI does not support a catch-all HTTP method.
|
|
1868
|
+
*
|
|
1869
|
+
* @param path - Route path relative to the controller base path
|
|
1870
|
+
* @param config - Optional route configuration
|
|
1871
|
+
*/
|
|
1872
|
+
declare const All: (path: string, config?: RouteConfig) => (target: object, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
1873
|
+
/**
|
|
1874
|
+
* Get the HTTP route metadata from a controller method decorated with
|
|
1875
|
+
* @Get, @Post, @Put, @Patch, @Delete, or @All.
|
|
1876
|
+
*
|
|
1877
|
+
* @param target - Controller prototype
|
|
1878
|
+
* @param methodName - Name of the method
|
|
1879
|
+
* @returns HTTP route metadata or undefined if not decorated
|
|
1880
|
+
*/
|
|
1881
|
+
declare function getHttpRouteMetadata(target: object, methodName: string): HttpRouteMetadata | undefined;
|
|
1882
|
+
/**
|
|
1883
|
+
* Get all methods decorated with HTTP method decorators from a controller class.
|
|
1884
|
+
*
|
|
1885
|
+
* @param ControllerClass - Controller class
|
|
1886
|
+
* @returns Array of method names that have HTTP route metadata
|
|
1887
|
+
*/
|
|
1888
|
+
declare function getHttpDecoratedMethods(ControllerClass: new (...args: unknown[]) => object): string[];
|
|
1889
|
+
//#endregion
|
|
1890
|
+
//#region src/router/decorators/route.decorator.d.ts
|
|
1891
|
+
/**
|
|
1892
|
+
* Decorator to add OpenAPI metadata to a controller method using convention-based routing.
|
|
1893
|
+
*
|
|
1894
|
+
* **Cannot be mixed with HTTP method decorators** (`@Get`, `@Post`, `@Put`, `@Patch`,
|
|
1895
|
+
* `@Delete`, `@All`) in the same controller. Use one pattern or the other.
|
|
1896
|
+
*
|
|
1897
|
+
* Stores route configuration (schemas, response, tags, security) in metadata.
|
|
1898
|
+
* HTTP method, path, and success status code are auto-derived from the method name:
|
|
1899
|
+
* - index() → GET /base-path → 200
|
|
1900
|
+
* - show() → GET /base-path/:id → 200
|
|
1901
|
+
* - create() → POST /base-path → 201
|
|
1902
|
+
* - update() → PUT /base-path/:id → 200
|
|
1903
|
+
* - patch() → PATCH /base-path/:id → 200
|
|
1904
|
+
* - destroy() → DELETE /base-path/:id → 200
|
|
1905
|
+
*
|
|
1906
|
+
* @param config - Route configuration (schemas, response, tags, security)
|
|
1907
|
+
*
|
|
1908
|
+
* @example
|
|
1909
|
+
* ```typescript
|
|
1910
|
+
* @Controller('/api/v1/notes', {
|
|
1911
|
+
* tags: ['Notes'],
|
|
1912
|
+
* security: ['bearerAuth']
|
|
1913
|
+
* })
|
|
1914
|
+
* export class NotesController implements Controller {
|
|
1915
|
+
* @Route({
|
|
1916
|
+
* body: createNoteSchema,
|
|
1917
|
+
* response: noteSchema, // 201 auto-derived from 'create' method
|
|
1918
|
+
* tags: ['Mutations'],
|
|
1919
|
+
* description: 'Create a new note'
|
|
1920
|
+
* })
|
|
1921
|
+
* async create(ctx: RouterContext): Promise<Response> {
|
|
1922
|
+
* // POST /api/v1/notes (auto-derived from method name)
|
|
1923
|
+
* // Body schema: createNoteSchema (auto-validated)
|
|
1924
|
+
* // Response: 201 → noteSchema (status auto-derived)
|
|
1925
|
+
* // Tags: ['Notes', 'Mutations'] (merged with controller)
|
|
1926
|
+
* // Security: ['bearerAuth'] (inherited from controller)
|
|
1927
|
+
* const body = ctx.body()
|
|
1928
|
+
* const note = await this.notesService.create(body)
|
|
1929
|
+
* return ctx.json(note, 201)
|
|
1930
|
+
* }
|
|
1931
|
+
*
|
|
1932
|
+
* @Route({
|
|
1933
|
+
* query: paginationSchema,
|
|
1934
|
+
* response: z.array(noteSchema) // 200 auto-derived from 'index' method
|
|
1935
|
+
* })
|
|
1936
|
+
* async index(ctx: RouterContext): Promise<Response> {
|
|
1937
|
+
* // GET /api/v1/notes (auto-derived)
|
|
1938
|
+
* // Query params auto-validated
|
|
1939
|
+
* const notes = await this.notesService.list()
|
|
1940
|
+
* return ctx.json(notes)
|
|
1941
|
+
* }
|
|
1942
|
+
*
|
|
1943
|
+
* @Route({
|
|
1944
|
+
* params: z.object({ id: z.string().uuid() }),
|
|
1945
|
+
* response: {
|
|
1946
|
+
* schema: noteSchema,
|
|
1947
|
+
* description: 'Note details'
|
|
1948
|
+
* },
|
|
1949
|
+
* security: [] // Override to make public
|
|
1950
|
+
* })
|
|
1951
|
+
* async show(ctx: RouterContext): Promise<Response> {
|
|
1952
|
+
* // GET /api/v1/notes/:id (auto-derived)
|
|
1953
|
+
* // URL params auto-validated
|
|
1954
|
+
* // Response: 200 → noteSchema (status auto-derived)
|
|
1955
|
+
* // Security: [] (public route, override controller security)
|
|
1956
|
+
* const id = ctx.param('id')
|
|
1957
|
+
* const note = await this.notesService.findById(id)
|
|
1958
|
+
* return ctx.json(note)
|
|
1959
|
+
* }
|
|
1960
|
+
* }
|
|
1961
|
+
* ```
|
|
1962
|
+
*/
|
|
1963
|
+
declare function Route(config: Omit<RouteConfig, 'statusCode'>): (target: object, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
1964
|
+
/**
|
|
1965
|
+
* Get the route configuration from a controller method
|
|
1966
|
+
*
|
|
1967
|
+
* @param target - Controller instance or prototype
|
|
1968
|
+
* @param methodName - Name of the method
|
|
1969
|
+
* @returns Route configuration or undefined if not decorated
|
|
1970
|
+
*/
|
|
1971
|
+
declare function getRouteConfig(target: object, methodName: string): RouteConfig | undefined;
|
|
1972
|
+
/**
|
|
1973
|
+
* Get all methods with @Route() decorator from a controller
|
|
1974
|
+
*
|
|
1975
|
+
* @param ControllerClass - Controller class
|
|
1976
|
+
* @returns Array of method names that have route config
|
|
1977
|
+
*/
|
|
1978
|
+
declare function getDecoratedMethods(ControllerClass: new (...args: unknown[]) => object): string[];
|
|
1979
|
+
//#endregion
|
|
1980
|
+
//#region src/router/schemas/common.schemas.d.ts
|
|
1981
|
+
/**
|
|
1982
|
+
* Common OpenAPI Schemas
|
|
1983
|
+
*
|
|
1984
|
+
* Reusable schema definitions for common API patterns:
|
|
1985
|
+
* - Error responses
|
|
1986
|
+
* - Pagination
|
|
1987
|
+
* - Common parameters
|
|
1988
|
+
*/
|
|
1989
|
+
/**
|
|
1990
|
+
* Generic error response schema
|
|
1991
|
+
* Used for all error responses (4xx, 5xx)
|
|
1992
|
+
* Matches ApplicationError.toErrorResponse() structure
|
|
1993
|
+
*/
|
|
1994
|
+
declare const errorResponseSchema: z.ZodObject<{
|
|
1995
|
+
code: z.ZodNumber;
|
|
1996
|
+
message: z.ZodString;
|
|
1997
|
+
timestamp: z.ZodString;
|
|
1998
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1999
|
+
stack: z.ZodOptional<z.ZodString>;
|
|
2000
|
+
}, z.core.$strip>;
|
|
2001
|
+
/**
|
|
2002
|
+
* Validation error response schema
|
|
2003
|
+
* Used for 400 Bad Request with validation failures
|
|
2004
|
+
* Matches ApplicationError.toErrorResponse() structure with validation-specific metadata
|
|
2005
|
+
*/
|
|
2006
|
+
declare const validationErrorResponseSchema: z.ZodObject<{
|
|
2007
|
+
code: z.ZodNumber;
|
|
2008
|
+
message: z.ZodString;
|
|
2009
|
+
timestamp: z.ZodString;
|
|
2010
|
+
metadata: z.ZodObject<{
|
|
2011
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
2012
|
+
path: z.ZodString;
|
|
2013
|
+
message: z.ZodString;
|
|
2014
|
+
code: z.ZodString;
|
|
2015
|
+
}, z.core.$strip>>;
|
|
2016
|
+
}, z.core.$strip>;
|
|
2017
|
+
stack: z.ZodOptional<z.ZodString>;
|
|
2018
|
+
}, z.core.$strip>;
|
|
2019
|
+
/**
|
|
2020
|
+
* Pagination query parameters schema
|
|
2021
|
+
* Used for list endpoints
|
|
2022
|
+
*/
|
|
2023
|
+
declare const paginationQuerySchema: z.ZodObject<{
|
|
2024
|
+
page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
2025
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
2026
|
+
}, z.core.$strip>;
|
|
2027
|
+
/**
|
|
2028
|
+
* Paginated response wrapper schema
|
|
2029
|
+
* Generic wrapper for paginated list responses
|
|
2030
|
+
*/
|
|
2031
|
+
declare const paginatedResponseSchema: <T extends z.ZodType>(itemSchema: T) => z.ZodObject<{
|
|
2032
|
+
data: z.ZodArray<T>;
|
|
2033
|
+
pagination: z.ZodObject<{
|
|
2034
|
+
page: z.ZodNumber;
|
|
2035
|
+
limit: z.ZodNumber;
|
|
2036
|
+
total: z.ZodNumber;
|
|
2037
|
+
totalPages: z.ZodNumber;
|
|
2038
|
+
}, z.core.$strip>;
|
|
2039
|
+
}, z.core.$strip>;
|
|
2040
|
+
/**
|
|
2041
|
+
* UUID parameter schema
|
|
2042
|
+
* Used for :id parameters in RESTful routes
|
|
2043
|
+
*/
|
|
2044
|
+
declare const uuidParamSchema: z.ZodObject<{
|
|
2045
|
+
id: z.ZodString;
|
|
2046
|
+
}, z.core.$strip>;
|
|
2047
|
+
/**
|
|
2048
|
+
* Success message response schema
|
|
2049
|
+
* Used for operations that don't return data (e.g., DELETE)
|
|
2050
|
+
*/
|
|
2051
|
+
declare const successMessageSchema: z.ZodObject<{
|
|
2052
|
+
message: z.ZodString;
|
|
2053
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2054
|
+
}, z.core.$strip>;
|
|
2055
|
+
/**
|
|
2056
|
+
* Common HTTP status error schemas
|
|
2057
|
+
* Pre-configured for standard error responses
|
|
2058
|
+
*/
|
|
2059
|
+
declare const commonErrorSchemas: {
|
|
2060
|
+
readonly 400: {
|
|
2061
|
+
readonly schema: z.ZodObject<{
|
|
2062
|
+
code: z.ZodNumber;
|
|
2063
|
+
message: z.ZodString;
|
|
2064
|
+
timestamp: z.ZodString;
|
|
2065
|
+
metadata: z.ZodObject<{
|
|
2066
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
2067
|
+
path: z.ZodString;
|
|
2068
|
+
message: z.ZodString;
|
|
2069
|
+
code: z.ZodString;
|
|
2070
|
+
}, z.core.$strip>>;
|
|
2071
|
+
}, z.core.$strip>;
|
|
2072
|
+
stack: z.ZodOptional<z.ZodString>;
|
|
2073
|
+
}, z.core.$strip>;
|
|
2074
|
+
readonly description: "Validation error";
|
|
2075
|
+
};
|
|
2076
|
+
readonly 401: {
|
|
2077
|
+
readonly schema: z.ZodObject<{
|
|
2078
|
+
code: z.ZodNumber;
|
|
2079
|
+
message: z.ZodString;
|
|
2080
|
+
timestamp: z.ZodString;
|
|
2081
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2082
|
+
stack: z.ZodOptional<z.ZodString>;
|
|
2083
|
+
}, z.core.$strip>;
|
|
2084
|
+
readonly description: "Unauthorized";
|
|
2085
|
+
};
|
|
2086
|
+
readonly 403: {
|
|
2087
|
+
readonly schema: z.ZodObject<{
|
|
2088
|
+
code: z.ZodNumber;
|
|
2089
|
+
message: z.ZodString;
|
|
2090
|
+
timestamp: z.ZodString;
|
|
2091
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2092
|
+
stack: z.ZodOptional<z.ZodString>;
|
|
2093
|
+
}, z.core.$strip>;
|
|
2094
|
+
readonly description: "Forbidden";
|
|
2095
|
+
};
|
|
2096
|
+
readonly 404: {
|
|
2097
|
+
readonly schema: z.ZodObject<{
|
|
2098
|
+
code: z.ZodNumber;
|
|
2099
|
+
message: z.ZodString;
|
|
2100
|
+
timestamp: z.ZodString;
|
|
2101
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2102
|
+
stack: z.ZodOptional<z.ZodString>;
|
|
2103
|
+
}, z.core.$strip>;
|
|
2104
|
+
readonly description: "Not found";
|
|
2105
|
+
};
|
|
2106
|
+
readonly 409: {
|
|
2107
|
+
readonly schema: z.ZodObject<{
|
|
2108
|
+
code: z.ZodNumber;
|
|
2109
|
+
message: z.ZodString;
|
|
2110
|
+
timestamp: z.ZodString;
|
|
2111
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2112
|
+
stack: z.ZodOptional<z.ZodString>;
|
|
2113
|
+
}, z.core.$strip>;
|
|
2114
|
+
readonly description: "Conflict";
|
|
2115
|
+
};
|
|
2116
|
+
readonly 500: {
|
|
2117
|
+
readonly schema: z.ZodObject<{
|
|
2118
|
+
code: z.ZodNumber;
|
|
2119
|
+
message: z.ZodString;
|
|
2120
|
+
timestamp: z.ZodString;
|
|
2121
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2122
|
+
stack: z.ZodOptional<z.ZodString>;
|
|
2123
|
+
}, z.core.$strip>;
|
|
2124
|
+
readonly description: "Internal server error";
|
|
2125
|
+
};
|
|
2126
|
+
};
|
|
2127
|
+
//#endregion
|
|
2128
|
+
//#region src/router/errors/hono-app-already-configured.error.d.ts
|
|
2129
|
+
/**
|
|
2130
|
+
* Error thrown when HonoApp.configure() is called more than once.
|
|
2131
|
+
*
|
|
2132
|
+
* HonoApp can only be configured a single time during application bootstrap.
|
|
2133
|
+
*/
|
|
2134
|
+
declare class HonoAppAlreadyConfiguredError extends ApplicationError {
|
|
2135
|
+
constructor();
|
|
2136
|
+
}
|
|
2137
|
+
//#endregion
|
|
2138
|
+
//#region src/router/errors/controller-registration.error.d.ts
|
|
2139
|
+
/**
|
|
2140
|
+
* Error thrown when a controller fails to register
|
|
2141
|
+
*
|
|
2142
|
+
* This typically happens when:
|
|
2143
|
+
* - Controller is missing the `@Controller` decorator
|
|
2144
|
+
* - Controller route metadata is not set
|
|
2145
|
+
* - Controller class name is invalid
|
|
2146
|
+
*
|
|
2147
|
+
* Error Code: 9005
|
|
2148
|
+
*/
|
|
2149
|
+
declare class ControllerRegistrationError extends ApplicationError {
|
|
2150
|
+
constructor(controllerName: string, reason?: string);
|
|
2151
|
+
}
|
|
2152
|
+
//#endregion
|
|
2153
|
+
//#region src/router/errors/openapi-route-registration.error.d.ts
|
|
2154
|
+
/**
|
|
2155
|
+
* OpenAPIRouteRegistrationError
|
|
2156
|
+
*
|
|
2157
|
+
* Thrown when an OpenAPI route fails to register properly
|
|
2158
|
+
* This indicates a configuration issue with route decorators or metadata
|
|
2159
|
+
* Uses i18n key for localized error messages
|
|
2160
|
+
*
|
|
2161
|
+
* @example
|
|
2162
|
+
* ```typescript
|
|
2163
|
+
* throw new OpenAPIRouteRegistrationError('/api/v1/users', 'Missing response schema')
|
|
2164
|
+
* ```
|
|
2165
|
+
*/
|
|
2166
|
+
declare class OpenAPIRouteRegistrationError extends ApplicationError {
|
|
2167
|
+
constructor(path: string, reason: string);
|
|
2168
|
+
}
|
|
2169
|
+
//#endregion
|
|
2170
|
+
//#region src/router/errors/openapi-validation.error.d.ts
|
|
2171
|
+
/**
|
|
2172
|
+
* OpenAPIValidationError
|
|
2173
|
+
*
|
|
2174
|
+
* Thrown when OpenAPI request/response validation fails
|
|
2175
|
+
* Uses i18n key for localized error messages
|
|
2176
|
+
*
|
|
2177
|
+
* HTTP Status: 400 Bad Request
|
|
2178
|
+
* Error Code: 1004
|
|
2179
|
+
*
|
|
2180
|
+
* @example
|
|
2181
|
+
* ```typescript
|
|
2182
|
+
* throw new OpenAPIValidationError('Request body missing required field: email')
|
|
2183
|
+
* ```
|
|
2184
|
+
*/
|
|
2185
|
+
declare class OpenAPIValidationError extends ApplicationError {
|
|
2186
|
+
constructor(details: string);
|
|
2187
|
+
}
|
|
2188
|
+
//#endregion
|
|
2189
|
+
//#region src/router/errors/route-not-found.error.d.ts
|
|
2190
|
+
/**
|
|
2191
|
+
* Error thrown when a requested route is not found
|
|
2192
|
+
*
|
|
2193
|
+
* HTTP Status: 404 Not Found
|
|
2194
|
+
* Error Code: 4004
|
|
2195
|
+
*/
|
|
2196
|
+
declare class RouteNotFoundError extends ApplicationError {
|
|
2197
|
+
constructor(path: string, method: string);
|
|
2198
|
+
}
|
|
2199
|
+
//#endregion
|
|
2200
|
+
//#region src/i18n/services/i18n.service.d.ts
|
|
2201
|
+
/**
|
|
2202
|
+
* I18n Service
|
|
2203
|
+
*
|
|
2204
|
+
* Provides internationalization (i18n) support for the application.
|
|
2205
|
+
* Injects RouterContext to access request-specific locale.
|
|
2206
|
+
*
|
|
2207
|
+
* @example Usage in services
|
|
2208
|
+
* ```typescript
|
|
2209
|
+
* @Transient(MY_TOKENS.UserService)
|
|
2210
|
+
* export class UserService {
|
|
2211
|
+
* constructor(
|
|
2212
|
+
* @inject(I18N_TOKENS.I18nService) private readonly i18n: II18nService
|
|
2213
|
+
* ) {}
|
|
2214
|
+
*
|
|
2215
|
+
* getWelcomeMessage(): string {
|
|
2216
|
+
* return this.i18n.t('common.welcome')
|
|
2217
|
+
* }
|
|
2218
|
+
* }
|
|
2219
|
+
* ```
|
|
2220
|
+
*/
|
|
2221
|
+
declare class I18nService implements II18nService {
|
|
2222
|
+
private readonly loader;
|
|
2223
|
+
private readonly routerContext?;
|
|
2224
|
+
constructor(loader: MessageLoaderService, routerContext?: RouterContext | undefined);
|
|
2225
|
+
/**
|
|
2226
|
+
* Translate a message key
|
|
2227
|
+
*
|
|
2228
|
+
* @param key - Message key (e.g., 'common.actions.save')
|
|
2229
|
+
* @param params - Optional parameters for interpolation
|
|
2230
|
+
* @returns Translated string
|
|
2231
|
+
*/
|
|
2232
|
+
t(key: MessageKeys, params?: MessageParams): string;
|
|
2233
|
+
/**
|
|
2234
|
+
* Get current locale
|
|
2235
|
+
*
|
|
2236
|
+
* @returns Current locale code from RouterContext or default locale
|
|
2237
|
+
*/
|
|
2238
|
+
getLocale(): string;
|
|
2239
|
+
}
|
|
2240
|
+
//#endregion
|
|
2241
|
+
//#region src/i18n/middleware/i18n-context.middleware.d.ts
|
|
2242
|
+
declare class I18nContextMiddleware implements Middleware {
|
|
2243
|
+
private readonly i18n;
|
|
2244
|
+
constructor(i18n: I18nService);
|
|
2245
|
+
handle(ctx: RouterContext, next: () => Promise<void>): Promise<void>;
|
|
2246
|
+
}
|
|
2247
|
+
//#endregion
|
|
2248
|
+
//#region src/errors/error-codes.d.ts
|
|
2249
|
+
/**
|
|
2250
|
+
* Centralized Error Code Registry
|
|
2251
|
+
*
|
|
2252
|
+
* Error codes are organized by category with specific ranges:
|
|
2253
|
+
* - 1000-1999: Validation errors
|
|
2254
|
+
* - 2000-2999: Database errors (generic)
|
|
2255
|
+
* - 3000-3999: Authentication & Authorization
|
|
2256
|
+
* - 4000-4999: Resource errors
|
|
2257
|
+
* - 5000-5999: Domain-specific business logic (per module)
|
|
2258
|
+
* - 9000-9999: System/Internal errors
|
|
2259
|
+
* - 9000-9099: Router errors
|
|
2260
|
+
* - 9100-9199: Configuration errors
|
|
2261
|
+
* - 9200-9299: Infrastructure errors
|
|
2262
|
+
* - 9300-9399: I18n errors
|
|
2263
|
+
*/
|
|
2264
|
+
declare const ERROR_CODES: {
|
|
2265
|
+
/**
|
|
2266
|
+
* Database Errors (2000-2999)
|
|
2267
|
+
* Generic database errors thrown by Prisma client extensions
|
|
2268
|
+
*/
|
|
2269
|
+
readonly DATABASE: {
|
|
2270
|
+
/** Generic database error */readonly GENERIC: 2000; /** Record not found in database */
|
|
2271
|
+
readonly RECORD_NOT_FOUND: 2001; /** Unique constraint violation */
|
|
2272
|
+
readonly UNIQUE_CONSTRAINT: 2002; /** Foreign key constraint violation */
|
|
2273
|
+
readonly FOREIGN_KEY_CONSTRAINT: 2003; /** Database connection failed */
|
|
2274
|
+
readonly CONNECTION_FAILED: 2004; /** Database timeout */
|
|
2275
|
+
readonly TIMEOUT: 2005; /** Null constraint violation */
|
|
2276
|
+
readonly NULL_CONSTRAINT: 2006; /** Too many database connections */
|
|
2277
|
+
readonly TOO_MANY_CONNECTIONS: 2007; /** Transaction conflict or deadlock */
|
|
2278
|
+
readonly TRANSACTION_CONFLICT: 2008;
|
|
2279
|
+
};
|
|
2280
|
+
/**
|
|
2281
|
+
* Authentication Errors (3000-3099)
|
|
2282
|
+
* Authentication-related failures
|
|
2283
|
+
*/
|
|
2284
|
+
readonly AUTH: {
|
|
2285
|
+
/** Invalid credentials provided */readonly INVALID_CREDENTIALS: 3000; /** Session expired or invalid */
|
|
2286
|
+
readonly SESSION_EXPIRED: 3001; /** Account locked or disabled */
|
|
2287
|
+
readonly ACCOUNT_LOCKED: 3002; /** Invalid or expired token */
|
|
2288
|
+
readonly INVALID_TOKEN: 3003; /** Context not initialized */
|
|
2289
|
+
readonly CONTEXT_NOT_INITIALIZED: 3004; /** User not authenticated */
|
|
2290
|
+
readonly USER_NOT_AUTHENTICATED: 3005; /** Email verification required before login */
|
|
2291
|
+
readonly EMAIL_NOT_VERIFIED: 3007; /** Password doesn't meet minimum length */
|
|
2292
|
+
readonly PASSWORD_TOO_SHORT: 3008; /** Password exceeds maximum length */
|
|
2293
|
+
readonly PASSWORD_TOO_LONG: 3009; /** Account with email already exists */
|
|
2294
|
+
readonly ACCOUNT_ALREADY_EXISTS: 3010; /** User creation failed */
|
|
2295
|
+
readonly FAILED_TO_CREATE_USER: 3011; /** Session creation failed */
|
|
2296
|
+
readonly FAILED_TO_CREATE_SESSION: 3012; /** User update failed */
|
|
2297
|
+
readonly FAILED_TO_UPDATE_USER: 3013; /** Social account already linked */
|
|
2298
|
+
readonly SOCIAL_ACCOUNT_LINKED: 3014; /** Last account cannot be unlinked */
|
|
2299
|
+
readonly CANNOT_UNLINK_LAST_ACCOUNT: 3015;
|
|
2300
|
+
};
|
|
2301
|
+
/**
|
|
2302
|
+
* Authorization Errors (3100-3199)
|
|
2303
|
+
* Permission and access control failures
|
|
2304
|
+
*/
|
|
2305
|
+
readonly AUTHZ: {
|
|
2306
|
+
/** Insufficient permissions */readonly FORBIDDEN: 3100; /** Resource access denied */
|
|
2307
|
+
readonly ACCESS_DENIED: 3101; /** User lacks required role */
|
|
2308
|
+
readonly INSUFFICIENT_PERMISSIONS: 3102;
|
|
2309
|
+
};
|
|
2310
|
+
/**
|
|
2311
|
+
* Resource Errors (4000-4999)
|
|
2312
|
+
* Generic resource-related errors
|
|
2313
|
+
*/
|
|
2314
|
+
readonly RESOURCE: {
|
|
2315
|
+
/** Generic resource not found */readonly NOT_FOUND: 4000; /** Route/endpoint not found */
|
|
2316
|
+
readonly ROUTE_NOT_FOUND: 4004; /** Resource conflict or duplicate */
|
|
2317
|
+
readonly CONFLICT: 4100; /** Resource already exists */
|
|
2318
|
+
readonly ALREADY_EXISTS: 4101;
|
|
2319
|
+
};
|
|
2320
|
+
/**
|
|
2321
|
+
* Validation Errors (1000-1999)
|
|
2322
|
+
* Input validation failures
|
|
2323
|
+
*/
|
|
2324
|
+
readonly VALIDATION: {
|
|
2325
|
+
/** Generic validation error */readonly GENERIC: 1000; /** Required field missing */
|
|
2326
|
+
readonly REQUIRED_FIELD: 1001; /** Invalid format */
|
|
2327
|
+
readonly INVALID_FORMAT: 1002; /** Schema validation failed */
|
|
2328
|
+
readonly SCHEMA_VALIDATION: 1003; /** Request validation failed (OpenAPI, etc.) */
|
|
2329
|
+
readonly REQUEST_VALIDATION: 1004;
|
|
2330
|
+
};
|
|
2331
|
+
/**
|
|
2332
|
+
* Router Errors (9000-9099)
|
|
2333
|
+
* Router and controller-related INTERNAL errors
|
|
2334
|
+
*/
|
|
2335
|
+
readonly ROUTER: {
|
|
2336
|
+
/** Controller registration error */readonly CONTROLLER_REGISTRATION_ERROR: 9005; /** Controller method not found */
|
|
2337
|
+
readonly CONTROLLER_METHOD_NOT_FOUND: 9006; /** OpenAPI route registration failed */
|
|
2338
|
+
readonly OPENAPI_ROUTE_REGISTRATION: 9008;
|
|
2339
|
+
};
|
|
2340
|
+
/**
|
|
2341
|
+
* I18n Errors (9300-9399)
|
|
2342
|
+
* Internationalization and localization errors
|
|
2343
|
+
*/
|
|
2344
|
+
readonly I18N: {
|
|
2345
|
+
/** Translation key missing from all locales */readonly TRANSLATION_MISSING: 9300; /** Requested locale not supported */
|
|
2346
|
+
readonly LOCALE_NOT_SUPPORTED: 9301;
|
|
2347
|
+
};
|
|
2348
|
+
/**
|
|
2349
|
+
* System Errors (9000-9999)
|
|
2350
|
+
* Internal system errors and unexpected failures
|
|
2351
|
+
*/
|
|
2352
|
+
readonly SYSTEM: {
|
|
2353
|
+
/** Internal server error */readonly INTERNAL_ERROR: 9000; /** Generic configuration error */
|
|
2354
|
+
readonly CONFIGURATION_ERROR: 9100; /** ConfigService not initialized */
|
|
2355
|
+
readonly CONFIG_NOT_INITIALIZED: 9101; /** Module already registered */
|
|
2356
|
+
readonly MODULE_ALREADY_REGISTERED: 9102; /** Circular module dependency detected */
|
|
2357
|
+
readonly MODULE_CIRCULAR_DEPENDENCY: 9103; /** Module dependency not found */
|
|
2358
|
+
readonly MODULE_DEPENDENCY_NOT_FOUND: 9104; /** Invalid error code range */
|
|
2359
|
+
readonly INVALID_ERROR_CODE_RANGE: 9105; /** Invalid module provider configuration */
|
|
2360
|
+
readonly INVALID_MODULE_PROVIDER: 9106; /** ConfigModule.forRoot() was not called */
|
|
2361
|
+
readonly CONFIG_MODULE_NOT_INITIALIZED: 9107; /** Generic infrastructure error */
|
|
2362
|
+
readonly INFRASTRUCTURE_ERROR: 9200; /** Execution context not initialized */
|
|
2363
|
+
readonly EXECUTION_CONTEXT_NOT_INITIALIZED: 9201; /** Request container not initialized */
|
|
2364
|
+
readonly REQUEST_CONTAINER_NOT_INITIALIZED: 9202; /** Queue binding not found */
|
|
2365
|
+
readonly QUEUE_BINDING_NOT_FOUND: 9203; /** Cron job execution failed */
|
|
2366
|
+
readonly CRON_EXECUTION_FAILED: 9204; /** Queue provider not supported */
|
|
2367
|
+
readonly QUEUE_PROVIDER_NOT_SUPPORTED: 9205; /** body() called on WebSocket gateway context */
|
|
2368
|
+
readonly WEBSOCKET_BODY_NOT_AVAILABLE: 9206; /** Duplicate WebSocket event decorator on a gateway */
|
|
2369
|
+
readonly WEBSOCKET_DUPLICATE_EVENT_HANDLER: 9207; /** Seeder name collision — two seeders share the same class name */
|
|
2370
|
+
readonly SEEDER_NAME_COLLISION: 9208; /** Seeder not registered in the SeederRegistry */
|
|
2371
|
+
readonly SEEDER_NOT_REGISTERED: 9209;
|
|
2372
|
+
};
|
|
2373
|
+
};
|
|
2374
|
+
/**
|
|
2375
|
+
* Recursively extract all leaf values from a nested object type
|
|
2376
|
+
* Similar to DeepKeys but extracts values instead of keys
|
|
2377
|
+
*
|
|
2378
|
+
* Example:
|
|
2379
|
+
* { DATABASE: { GENERIC: 2000, NOT_FOUND: 2001 }, AUTH: { INVALID: 3000 } }
|
|
2380
|
+
* becomes
|
|
2381
|
+
* 2000 | 2001 | 3000
|
|
2382
|
+
*/
|
|
2383
|
+
type DeepValues<T> = T extends object ? { [K in keyof T]: DeepValues<T[K]> }[keyof T] : T;
|
|
2384
|
+
/**
|
|
2385
|
+
* Type helper to extract all error code values
|
|
2386
|
+
* Union type of all numeric error codes defined in ERROR_CODES
|
|
2387
|
+
*
|
|
2388
|
+
* Type: 2000 | 2001 | 2002 | ... | 9203
|
|
2389
|
+
*/
|
|
2390
|
+
type ErrorCode = DeepValues<typeof ERROR_CODES>;
|
|
2391
|
+
//#endregion
|
|
2392
|
+
//#region src/errors/application-error.d.ts
|
|
2393
|
+
/**
|
|
2394
|
+
* ApplicationError
|
|
2395
|
+
*
|
|
2396
|
+
* Abstract base class for all application errors.
|
|
2397
|
+
* This class should never be used directly - always extend it to create specific error types.
|
|
2398
|
+
*
|
|
2399
|
+
* Features:
|
|
2400
|
+
* - Type-safe error codes from ERROR_CODES registry
|
|
2401
|
+
* - Type-safe message keys from i18n module
|
|
2402
|
+
* - Localized message keys (translated by GlobalErrorHandler)
|
|
2403
|
+
* - Structured metadata for logging and interpolation
|
|
2404
|
+
* - Proper Error prototype chain
|
|
2405
|
+
* - Automatic timestamp generation
|
|
2406
|
+
* - Serialization for RPC transmission
|
|
2407
|
+
*
|
|
2408
|
+
* Message Localization:
|
|
2409
|
+
* - Each error class passes an i18n key (e.g., 'errors.userNotFound') to super()
|
|
2410
|
+
* - `Error.message` contains the i18n key for useful stack traces and fallback display
|
|
2411
|
+
* - Metadata provides interpolation parameters (e.g., { userId: '123' })
|
|
2412
|
+
* - GlobalErrorHandler translates the message key using I18nService before sending response
|
|
2413
|
+
* - This ensures errors are localized based on the user's locale (from X-Locale header)
|
|
2414
|
+
*/
|
|
2415
|
+
declare abstract class ApplicationError extends Error {
|
|
2416
|
+
/**
|
|
2417
|
+
* Controls whether stack traces are captured.
|
|
2418
|
+
* Set to false in production to skip the expensive Error.captureStackTrace() call,
|
|
2419
|
+
* since stack traces are stripped from responses in production anyway.
|
|
2420
|
+
*/
|
|
2421
|
+
static captureStackTraces: boolean;
|
|
2422
|
+
/**
|
|
2423
|
+
* Type-safe error code from ERROR_CODES registry
|
|
2424
|
+
* See error-codes.ts for the complete registry
|
|
2425
|
+
*/
|
|
2426
|
+
readonly code: ErrorCode;
|
|
2427
|
+
/**
|
|
2428
|
+
* ISO timestamp when the error was created
|
|
2429
|
+
*/
|
|
2430
|
+
readonly timestamp: string;
|
|
2431
|
+
/**
|
|
2432
|
+
* Additional structured data about the error
|
|
2433
|
+
* Used for:
|
|
2434
|
+
* 1. Logging and debugging
|
|
2435
|
+
* 2. Message interpolation (e.g., { userId: '123', email: 'user@example.com' })
|
|
2436
|
+
*/
|
|
2437
|
+
readonly metadata?: Record<string, unknown>;
|
|
2438
|
+
/**
|
|
2439
|
+
* @param i18nKey - Type-safe i18n message key (e.g., 'errors.userNotFound')
|
|
2440
|
+
* @param code - Type-safe error code from ERROR_CODES registry
|
|
2441
|
+
* @param metadata - Optional data for logging and interpolation
|
|
2442
|
+
*/
|
|
2443
|
+
constructor(i18nKey: MessageKeys, code: ErrorCode, metadata?: Record<string, unknown>);
|
|
2444
|
+
/**
|
|
2445
|
+
* Filter metadata to include only user-facing properties
|
|
2446
|
+
*
|
|
2447
|
+
* User-facing properties (validation/constraint errors):
|
|
2448
|
+
* - issues: Validation errors from SchemaValidationError
|
|
2449
|
+
* - fields: Constraint violation fields
|
|
2450
|
+
* - field: Single field constraint/foreign key
|
|
2451
|
+
*
|
|
2452
|
+
* Internal properties (excluded from response):
|
|
2453
|
+
* - path, method: Route debugging
|
|
2454
|
+
* - controllerName, reason: Controller errors
|
|
2455
|
+
* - details, etc.: Internal debugging info
|
|
2456
|
+
*
|
|
2457
|
+
* @param metadata - Raw metadata object
|
|
2458
|
+
* @returns Filtered metadata with only whitelisted properties
|
|
2459
|
+
*/
|
|
2460
|
+
private static filterMetadata;
|
|
2461
|
+
/**
|
|
2462
|
+
* Serialize error to ErrorResponse format for RPC transmission
|
|
2463
|
+
*
|
|
2464
|
+
* @param env - Environment (development | production)
|
|
2465
|
+
* @param translatedMessage - Optional translated message (from GlobalErrorHandler)
|
|
2466
|
+
* @returns ErrorResponse object suitable for JSON serialization
|
|
2467
|
+
*/
|
|
2468
|
+
toErrorResponse(env: Environment, translatedMessage?: string): ErrorResponse;
|
|
2469
|
+
/**
|
|
2470
|
+
* JSON serialization (used by JSON.stringify)
|
|
2471
|
+
* Defaults to development mode for backward compatibility
|
|
2472
|
+
* Note: This will use the untranslated message key - use GlobalErrorHandler for proper localization
|
|
2473
|
+
*/
|
|
2474
|
+
toJSON(): ErrorResponse;
|
|
2475
|
+
}
|
|
2476
|
+
//#endregion
|
|
2477
|
+
//#region src/errors/get-http-status.d.ts
|
|
2478
|
+
/**
|
|
2479
|
+
* Maps error codes to HTTP status codes
|
|
2480
|
+
*
|
|
2481
|
+
* This utility is used by the frontend to set appropriate HTTP status codes
|
|
2482
|
+
* when returning errors from API routes.
|
|
2483
|
+
*
|
|
2484
|
+
* @param code - Numeric error code from ERROR_CODES registry
|
|
2485
|
+
* @returns HTTP status code (200-599)
|
|
2486
|
+
*/
|
|
2487
|
+
declare function getHttpStatus(code: number): ContentfulStatusCode;
|
|
2488
|
+
//#endregion
|
|
2489
|
+
//#region src/errors/global-error-handler.d.ts
|
|
2490
|
+
/**
|
|
2491
|
+
* GlobalErrorHandler
|
|
2492
|
+
*
|
|
2493
|
+
* Centralized error handler registered in the DI container.
|
|
2494
|
+
* Responsible for:
|
|
2495
|
+
* - Intercepting all errors in the application
|
|
2496
|
+
* - Logging errors with appropriate severity via Logger service
|
|
2497
|
+
* - Translating error message keys using I18nService (when available)
|
|
2498
|
+
* - Serializing errors for RPC transmission
|
|
2499
|
+
* - Wrapping unexpected errors in InternalError
|
|
2500
|
+
*
|
|
2501
|
+
* **Translation Availability by Context:**
|
|
2502
|
+
*
|
|
2503
|
+
* ✅ **HTTP Requests**: Errors are fully translated
|
|
2504
|
+
* - GlobalErrorHandler resolved from request container
|
|
2505
|
+
* - I18nService available via AsyncLocalStorage with user's locale
|
|
2506
|
+
* - Full translation with parameter interpolation
|
|
2507
|
+
*
|
|
2508
|
+
* ✅ **Queue Processing**: Errors are fully translated
|
|
2509
|
+
* - Error handling executes inside AsyncLocalStorage scope
|
|
2510
|
+
* - Locale extracted from queue message metadata
|
|
2511
|
+
* - Request container created with mock RouterContext
|
|
2512
|
+
* - I18nService available with correct locale
|
|
2513
|
+
*
|
|
2514
|
+
* ⚠️ **RPC/Startup**: Message keys returned as-is (i18n unavailable)
|
|
2515
|
+
* - No request context available during service binding or startup
|
|
2516
|
+
* - No locale information available
|
|
2517
|
+
* - Frontend can translate message keys using its own i18n if needed
|
|
2518
|
+
* - This is expected behavior, not a bug
|
|
2519
|
+
*
|
|
2520
|
+
* **Implementation Note:**
|
|
2521
|
+
* The `isAvailable()` check exists to gracefully handle RPC/startup contexts
|
|
2522
|
+
* where no request container exists. For HTTP and Queue contexts, i18n is
|
|
2523
|
+
* always available thanks to AsyncLocalStorage scope propagation. This follows
|
|
2524
|
+
* the "Laravel philosophy" - transparent dependency injection for request contexts,
|
|
2525
|
+
* with explicit handling only for legitimate non-request edge cases.
|
|
2526
|
+
*/
|
|
2527
|
+
declare class GlobalErrorHandler {
|
|
2528
|
+
private readonly logger;
|
|
2529
|
+
private readonly i18n;
|
|
2530
|
+
private readonly env;
|
|
2531
|
+
private readonly environment;
|
|
2532
|
+
constructor(logger: LoggerService, i18n: II18nService, env: StratalEnv);
|
|
2533
|
+
/**
|
|
2534
|
+
* Handle an error, log it, and serialize for response
|
|
2535
|
+
*
|
|
2536
|
+
* @param error - The error to handle
|
|
2537
|
+
* @returns Serialized ErrorResponse for RPC transmission
|
|
2538
|
+
*/
|
|
2539
|
+
handle(error: unknown): ErrorResponse;
|
|
2540
|
+
/**
|
|
2541
|
+
* Translate error message key using I18nService
|
|
2542
|
+
* Uses error metadata as interpolation parameters
|
|
2543
|
+
*
|
|
2544
|
+
* No try/catch - if translation fails, it's a bug that should fail loudly
|
|
2545
|
+
*
|
|
2546
|
+
* **Note**: This method is only called when isAvailable() returns true,
|
|
2547
|
+
* so the service is guaranteed to be resolved.
|
|
2548
|
+
*
|
|
2549
|
+
* @param error - ApplicationError with messageKey and metadata
|
|
2550
|
+
* @returns Translated message string
|
|
2551
|
+
*/
|
|
2552
|
+
private translateError;
|
|
2553
|
+
/**
|
|
2554
|
+
* Log an ApplicationError with appropriate severity
|
|
2555
|
+
*/
|
|
2556
|
+
private log;
|
|
2557
|
+
/**
|
|
2558
|
+
* Log an unexpected error
|
|
2559
|
+
*/
|
|
2560
|
+
private logUnexpectedError;
|
|
2561
|
+
/**
|
|
2562
|
+
* Determine log severity based on error code
|
|
2563
|
+
*/
|
|
2564
|
+
private getSeverity;
|
|
2565
|
+
}
|
|
2566
|
+
//#endregion
|
|
2567
|
+
//#region src/errors/internal-error.d.ts
|
|
2568
|
+
/**
|
|
2569
|
+
* InternalError
|
|
2570
|
+
*
|
|
2571
|
+
* Represents an unexpected internal server error.
|
|
2572
|
+
* Used to wrap unknown errors that don't fit into specific error categories.
|
|
2573
|
+
*
|
|
2574
|
+
* This error is thrown when:
|
|
2575
|
+
* - An unexpected exception occurs
|
|
2576
|
+
* - An error type is not recognized
|
|
2577
|
+
* - A system-level failure happens
|
|
2578
|
+
*/
|
|
2579
|
+
declare class InternalError extends ApplicationError {
|
|
2580
|
+
constructor(metadata?: Record<string, unknown>);
|
|
2581
|
+
}
|
|
2582
|
+
//#endregion
|
|
2583
|
+
//#region src/errors/is-application-error.d.ts
|
|
2584
|
+
/**
|
|
2585
|
+
* Type guard to check if an error is an ApplicationError
|
|
2586
|
+
*
|
|
2587
|
+
* @param error - The error to check
|
|
2588
|
+
* @returns True if the error is an ApplicationError instance
|
|
2589
|
+
*/
|
|
2590
|
+
declare function isApplicationError(error: unknown): error is ApplicationError;
|
|
2591
|
+
//#endregion
|
|
2592
|
+
//#region src/errors/request-container-not-initialized.error.d.ts
|
|
2593
|
+
/**
|
|
2594
|
+
* RequestContainerNotInitializedError
|
|
2595
|
+
*
|
|
2596
|
+
* Thrown when attempting to access the request-scoped container before it has been initialized.
|
|
2597
|
+
* This typically indicates that the RouterService middleware hasn't run yet,
|
|
2598
|
+
* or the router context is being accessed outside of a request lifecycle.
|
|
2599
|
+
*/
|
|
2600
|
+
declare class RequestContainerNotInitializedError extends ApplicationError {
|
|
2601
|
+
constructor();
|
|
2602
|
+
}
|
|
2603
|
+
//#endregion
|
|
2604
|
+
//#region src/errors/stratal-not-initialized.error.d.ts
|
|
2605
|
+
/**
|
|
2606
|
+
* StratalNotInitializedError
|
|
2607
|
+
*
|
|
2608
|
+
* Thrown when attempting to resolve the Application instance before Stratal has been instantiated.
|
|
2609
|
+
* This typically indicates that the Stratal instance is not exported as the default export.
|
|
2610
|
+
*/
|
|
2611
|
+
declare class StratalNotInitializedError extends ApplicationError {
|
|
2612
|
+
constructor();
|
|
2613
|
+
}
|
|
2614
|
+
//#endregion
|
|
2615
|
+
export { I18nModuleOptions as $, Container as $t, Delete as A, RouteConfig as At, getControllerVersion as B, SECURITY_SCHEMES as Bt, successMessageSchema as C, isErrorResponse as Cn, IController as Ct, getDecoratedMethods as D, HttpRouteMetadata as Dt, Route as E, ControllerOptions as Et, getHttpDecoratedMethods as F, SecurityScheme as Ft, MiddlewareConsumerImpl as G, Transient as Gt, RouteRegistrationService as H, StratalEnv as Ht, getHttpRouteMetadata as I, VersioningOptions as It, TranslationMissingError as J, ParamInjection as Jt, createMiddlewareConsumer as K, INJECT_PARAM_METADATA_KEY as Kt, Controller as L, HTTP_METHODS as Lt, Patch as M, RouteResponseObject as Mt, Post as N, RouterEnv as Nt, getRouteConfig as O, RouteBody as Ot, Put as P, RouterVariables as Pt, I18nModule as Q, DI_TOKENS as Qt, getControllerOptions as R, ROUTER_CONTEXT_KEYS as Rt, paginationQuerySchema as S, ErrorResponse as Sn, Middleware as St, validationErrorResponseSchema as T, RouterContext as Tt, HonoApp as U, RequestScopeOperationNotAllowedError as Ut, ROUTER_TOKENS as V, VERSION_NEUTRAL as Vt, MiddlewareConfigurationService as W, ConditionalBindingFallbackError as Wt, setupI18nCompiler as X, CONTAINER_TOKEN as Xt, LocaleNotSupportedError as Y, getMethodInjections as Yt, I18N_TOKENS as Z, DIToken as Zt, ControllerRegistrationError as _, Messages as _n, MiddlewareConfigEntry as _t, GlobalErrorHandler as a, injectable$1 as an, ExistingProvider as at, errorResponseSchema as b, messages as bn, MiddlewareRouteTarget as bt, ERROR_CODES as c, ConditionalBindingBuilder as cn, ModuleClass as ct, SSEMessage as d, ConditionalBindingUse as dn, OnInitialize as dt, ContainerOptions as en, ResolvedI18nOptions as et, SSEStreamingApi$1 as f, PredicateContainer as fn, OnShutdown as ft, OpenAPIRouteRegistrationError as g, WhenOptions as gn, MiddlewareBuilder as gt, OpenAPIValidationError as h, Scope as hn, ValueProvider as ht, InternalError as i, inject$1 as in, DynamicModule as it, Get as j, RouteResponse as jt, All as k, RouteBodyObject as kt, ErrorCode as l, ConditionalBindingBuilderImpl as ln, ModuleContext as lt, RouteNotFoundError as m, ExtensionDecorator as mn, RegistryEntry as mt, RequestContainerNotInitializedError as n, container$1 as nn, AsyncModuleOptions as nt, getHttpStatus as o, instancePerContainerCachingFactory$1 as on, FactoryProvider as ot, StreamingApi$1 as p, ContainerLike as pn, Provider as pt, LocaleExtractionMiddleware as q, InjectParam as qt, isApplicationError as r, delay as rn, ClassProvider as rt, ApplicationError as s, singleton as sn, InjectionToken$2 as st, StratalNotInitializedError as t, DependencyContainer$1 as tn, resolveI18nOptions as tt, I18nContextMiddleware as u, ConditionalBindingGive as un, ModuleOptions as ut, HonoAppAlreadyConfiguredError as v, getLocales as vn, MiddlewareConfigurable as vt, uuidParamSchema as w, ContextQueryResult as wt, paginatedResponseSchema as x, Environment as xn, RouteInfo as xt, commonErrorSchemas as y, getMessages as yn, MiddlewareConsumer as yt, getControllerRoute as z, ROUTE_METADATA_KEYS as zt };
|
|
2616
|
+
//# sourceMappingURL=index-D69rxo8H.d.mts.map
|