@expressots/core 3.0.0 → 4.0.0-preview.3

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.
Files changed (1107) hide show
  1. package/LICENSE.md +21 -21
  2. package/README.md +66 -118
  3. package/lib/CHANGELOG.md +774 -739
  4. package/lib/README.md +66 -118
  5. package/lib/cjs/application/application-container.js +467 -33
  6. package/lib/cjs/application/application-factory.js +111 -5
  7. package/lib/cjs/application/application.types.js +32 -2
  8. package/lib/cjs/application/bootstrap.js +716 -0
  9. package/lib/cjs/application/index.js +10 -7
  10. package/lib/cjs/authorization/authorization-config.interface.js +2 -0
  11. package/lib/cjs/authorization/decorators/convenience.js +80 -0
  12. package/lib/cjs/authorization/guard-constants.js +12 -0
  13. package/lib/cjs/authorization/guard-decorators.js +159 -0
  14. package/lib/cjs/authorization/guard-executor.js +101 -0
  15. package/lib/cjs/authorization/guard-registry.js +133 -0
  16. package/lib/cjs/authorization/guard.interface.js +75 -0
  17. package/lib/cjs/authorization/guards/attribute-based.guard.js +109 -0
  18. package/lib/cjs/authorization/guards/authenticated.guard.js +49 -0
  19. package/lib/cjs/authorization/guards/composition.guard.js +67 -0
  20. package/lib/cjs/authorization/guards/conditional.guard.js +41 -0
  21. package/lib/cjs/authorization/guards/index.js +24 -0
  22. package/lib/cjs/authorization/guards/permission.guard.js +82 -0
  23. package/lib/cjs/authorization/guards/resource-owner.guard.js +61 -0
  24. package/lib/cjs/authorization/guards/role.guard.js +64 -0
  25. package/lib/cjs/authorization/index.js +40 -0
  26. package/lib/cjs/authorization/services/guard-cache.interface.js +2 -0
  27. package/lib/cjs/authorization/services/guard-cache.js +56 -0
  28. package/lib/cjs/authorization/services/permission-hierarchy.interface.js +2 -0
  29. package/lib/cjs/authorization/services/permission-hierarchy.js +54 -0
  30. package/lib/cjs/authorization/services/permission-service.interface.js +2 -0
  31. package/lib/cjs/authorization/services/permission-service.js +58 -0
  32. package/lib/cjs/authorization/services/security-context.interface.js +2 -0
  33. package/lib/cjs/authorization/services/security-context.js +75 -0
  34. package/lib/cjs/authorization/setup.js +141 -0
  35. package/lib/cjs/config/config-resolver.js +719 -0
  36. package/lib/cjs/config/config.interfaces.js +14 -0
  37. package/lib/cjs/config/define-config.js +495 -0
  38. package/lib/cjs/config/env-field-builders.js +449 -0
  39. package/lib/cjs/config/index.js +89 -0
  40. package/lib/cjs/config/secret-value.js +201 -0
  41. package/lib/cjs/console/color-codes.js +4 -0
  42. package/lib/cjs/console/console.js +72 -9
  43. package/lib/cjs/console/index.js +2 -2
  44. package/lib/cjs/container-module/container-module.js +257 -26
  45. package/lib/cjs/container-module/index.js +6 -4
  46. package/lib/cjs/decorator/index.js +1 -1
  47. package/lib/cjs/decorator/scope-binding.js +307 -16
  48. package/lib/cjs/di/annotation/decorator_utils.js +4 -4
  49. package/lib/cjs/di/annotation/inject.js +3 -3
  50. package/lib/cjs/di/annotation/inject_base.js +5 -5
  51. package/lib/cjs/di/annotation/injectable.js +2 -2
  52. package/lib/cjs/di/annotation/multi_inject.js +3 -3
  53. package/lib/cjs/di/annotation/named.js +4 -4
  54. package/lib/cjs/di/annotation/optional.js +4 -4
  55. package/lib/cjs/di/annotation/post_construct.js +4 -4
  56. package/lib/cjs/di/annotation/pre_destroy.js +4 -4
  57. package/lib/cjs/di/annotation/property_event_decorator.js +2 -2
  58. package/lib/cjs/di/annotation/tagged.js +3 -3
  59. package/lib/cjs/di/annotation/target_name.js +5 -5
  60. package/lib/cjs/di/annotation/unmanaged.js +5 -5
  61. package/lib/cjs/di/binding-decorator/constants.js +3 -0
  62. package/lib/cjs/di/binding-decorator/decorator/fluent_provide.js +7 -7
  63. package/lib/cjs/di/binding-decorator/decorator/provide.js +7 -7
  64. package/lib/cjs/di/binding-decorator/factory/module_factory.js +23 -4
  65. package/lib/cjs/di/binding-decorator/index.js +11 -9
  66. package/lib/cjs/di/binding-decorator/syntax/provide_done_syntax.js +7 -7
  67. package/lib/cjs/di/binding-decorator/syntax/provide_in_syntax.js +19 -12
  68. package/lib/cjs/di/binding-decorator/syntax/provide_in_when_on_syntax.js +3 -0
  69. package/lib/cjs/di/binding-decorator/syntax/provide_on_syntax.js +4 -4
  70. package/lib/cjs/di/binding-decorator/syntax/provide_when_syntax.js +30 -30
  71. package/lib/cjs/di/binding-decorator/utils/auto_wire.js +4 -4
  72. package/lib/cjs/di/bindings/binding.js +5 -6
  73. package/lib/cjs/di/constants/error_msgs.js +6 -2
  74. package/lib/cjs/di/constants/literal_types.js +3 -3
  75. package/lib/cjs/di/container/container.js +44 -44
  76. package/lib/cjs/di/container/container_module.js +3 -3
  77. package/lib/cjs/di/container/lookup.js +3 -3
  78. package/lib/cjs/di/container/module_activation_store.js +3 -3
  79. package/lib/cjs/di/container-introspection.js +42 -0
  80. package/lib/cjs/di/inversify.js +85 -52
  81. package/lib/cjs/di/planning/context.js +2 -2
  82. package/lib/cjs/di/planning/metadata.js +1 -1
  83. package/lib/cjs/di/planning/metadata_reader.js +1 -1
  84. package/lib/cjs/di/planning/planner.js +37 -37
  85. package/lib/cjs/di/planning/reflection_utils.js +12 -12
  86. package/lib/cjs/di/planning/request.js +2 -2
  87. package/lib/cjs/di/planning/target.js +10 -10
  88. package/lib/cjs/di/resolution/instantiation.js +13 -13
  89. package/lib/cjs/di/resolution/resolver.js +22 -22
  90. package/lib/cjs/di/scope/scope-registry.js +115 -0
  91. package/lib/cjs/di/scope/scope.js +38 -8
  92. package/lib/cjs/di/syntax/binding_in_syntax.js +18 -8
  93. package/lib/cjs/di/syntax/binding_in_when_on_syntax.js +9 -6
  94. package/lib/cjs/di/syntax/binding_on_syntax.js +3 -3
  95. package/lib/cjs/di/syntax/binding_to_syntax.js +27 -27
  96. package/lib/cjs/di/syntax/binding_when_on_syntax.js +4 -4
  97. package/lib/cjs/di/syntax/binding_when_syntax.js +30 -30
  98. package/lib/cjs/di/syntax/constraint_helpers.js +3 -3
  99. package/lib/cjs/di/utils/binding_utils.js +18 -18
  100. package/lib/cjs/di/utils/exceptions.js +1 -1
  101. package/lib/cjs/di/utils/serialization.js +1 -1
  102. package/lib/cjs/error/app-error.js +152 -8
  103. package/lib/cjs/error/base-exception-filter.js +135 -0
  104. package/lib/cjs/error/error-handler-middleware.js +7 -7
  105. package/lib/cjs/error/exception-filter-constants.js +12 -0
  106. package/lib/cjs/error/exception-filter-decorators.js +161 -0
  107. package/lib/cjs/error/exception-filter-registry.js +163 -0
  108. package/lib/cjs/error/exception-filter.interface.js +2 -0
  109. package/lib/cjs/error/exception-handler-middleware.js +378 -0
  110. package/lib/cjs/error/filters/app-error.filter.js +31 -0
  111. package/lib/cjs/error/filters/global-exception.filter.js +39 -0
  112. package/lib/cjs/error/filters/not-found.filter.js +35 -0
  113. package/lib/cjs/error/filters/validation-error.filter.js +35 -0
  114. package/lib/cjs/error/index.js +28 -7
  115. package/lib/cjs/error/not-found.error.js +17 -0
  116. package/lib/cjs/error/report.js +104 -9
  117. package/lib/cjs/error/status-code.js +20 -0
  118. package/lib/cjs/error/utils.js +247 -33
  119. package/lib/cjs/error/validation.error.js +18 -0
  120. package/lib/cjs/event/event-decorators.js +280 -0
  121. package/lib/cjs/event/event-emitter.js +373 -0
  122. package/lib/cjs/event/event-flow-tracker.js +236 -0
  123. package/lib/cjs/event/event-recorder.js +289 -0
  124. package/lib/cjs/event/event-registry.js +207 -0
  125. package/lib/cjs/event/event.interfaces.js +54 -0
  126. package/lib/cjs/event/index.js +80 -0
  127. package/lib/cjs/framework-version.js +10 -0
  128. package/lib/cjs/index.js +29 -8
  129. package/lib/cjs/interceptor/conditional-interceptor.js +108 -0
  130. package/lib/cjs/interceptor/execution-context.js +66 -0
  131. package/lib/cjs/interceptor/index.js +64 -0
  132. package/lib/cjs/interceptor/interceptor-composition.js +130 -0
  133. package/lib/cjs/interceptor/interceptor-constants.js +20 -0
  134. package/lib/cjs/interceptor/interceptor-decorators.js +155 -0
  135. package/lib/cjs/interceptor/interceptor-executor.js +140 -0
  136. package/lib/cjs/interceptor/interceptor-registry.js +159 -0
  137. package/lib/cjs/interceptor/interceptor.interface.js +20 -0
  138. package/lib/cjs/interceptor/interceptors/index.js +22 -0
  139. package/lib/cjs/interceptor/interceptors/logging.interceptor.js +70 -0
  140. package/lib/cjs/interceptor/interceptors/performance.interceptor.js +251 -0
  141. package/lib/cjs/interceptor/interceptors/timeout.interceptor.js +66 -0
  142. package/lib/cjs/lazy-loading/index.js +77 -0
  143. package/lib/cjs/lazy-loading/lazy-load-metrics.js +355 -0
  144. package/lib/cjs/lazy-loading/lazy-module-helpers.js +49 -0
  145. package/lib/cjs/lazy-loading/lazy-module-loader.js +311 -0
  146. package/lib/cjs/lazy-loading/lazy-module-manager.js +244 -0
  147. package/lib/cjs/lazy-loading/lazy-module-warmup.js +294 -0
  148. package/lib/cjs/lazy-loading/lazy-module.js +380 -0
  149. package/lib/cjs/lazy-loading/lazy.interfaces.js +18 -0
  150. package/lib/cjs/lifecycle/index.js +15 -0
  151. package/lib/cjs/lifecycle/lifecycle-registry.js +301 -0
  152. package/lib/cjs/lifecycle/lifecycle.interface.js +37 -0
  153. package/lib/cjs/middleware/content-negotiation/accept-header-parser.js +110 -0
  154. package/lib/cjs/middleware/content-negotiation/content-negotiation-service.js +288 -0
  155. package/lib/cjs/middleware/content-negotiation/formatter-registry.js +168 -0
  156. package/lib/cjs/middleware/content-negotiation/formatters/csv-formatter.js +114 -0
  157. package/lib/cjs/middleware/content-negotiation/formatters/index.js +16 -0
  158. package/lib/cjs/middleware/content-negotiation/formatters/json-formatter.js +34 -0
  159. package/lib/cjs/middleware/content-negotiation/formatters/plain-text-formatter.js +44 -0
  160. package/lib/cjs/middleware/content-negotiation/formatters/xml-formatter.js +124 -0
  161. package/lib/cjs/middleware/content-negotiation/formatters/yaml-formatter.js +134 -0
  162. package/lib/cjs/middleware/content-negotiation/index.js +27 -0
  163. package/lib/cjs/middleware/index.js +58 -30
  164. package/lib/cjs/middleware/interfaces/content-negotiation.interface.js +7 -0
  165. package/lib/cjs/middleware/middleware-config.js +10 -0
  166. package/lib/cjs/middleware/middleware-profiler.js +310 -0
  167. package/lib/cjs/middleware/middleware-registry.js +160 -0
  168. package/lib/cjs/middleware/middleware-resolver.js +318 -57
  169. package/lib/cjs/middleware/middleware-service.js +1692 -308
  170. package/lib/cjs/middleware/middleware-utils.js +280 -0
  171. package/lib/cjs/middleware/presets-standalone.js +93 -0
  172. package/lib/cjs/middleware/upload-registry.js +91 -0
  173. package/lib/cjs/path-resolver/index.js +252 -0
  174. package/lib/cjs/provider/db-in-memory/adapter/adapter.interface.js +10 -0
  175. package/lib/cjs/provider/db-in-memory/adapter/in-memory.adapter.js +688 -0
  176. package/lib/cjs/provider/db-in-memory/adapter/index.js +10 -0
  177. package/lib/cjs/provider/db-in-memory/base-repo.repository.js +4 -4
  178. package/lib/cjs/provider/db-in-memory/db-in-memory.provider.js +14 -18
  179. package/lib/cjs/provider/db-in-memory/db.provider.js +402 -0
  180. package/lib/cjs/provider/db-in-memory/index.js +125 -9
  181. package/lib/cjs/provider/db-in-memory/query/index.js +24 -0
  182. package/lib/cjs/provider/db-in-memory/query/query-engine.js +601 -0
  183. package/lib/cjs/provider/db-in-memory/query/query.types.js +10 -0
  184. package/lib/cjs/provider/db-in-memory/schema/decorators.js +420 -0
  185. package/lib/cjs/provider/db-in-memory/schema/entity.interface.js +9 -0
  186. package/lib/cjs/provider/db-in-memory/schema/index.js +21 -0
  187. package/lib/cjs/provider/db-in-memory/storage/index.js +16 -0
  188. package/lib/cjs/provider/db-in-memory/storage/memory-store.js +777 -0
  189. package/lib/cjs/provider/dto-validator/dto-validator.provider.js +8 -8
  190. package/lib/cjs/provider/dto-validator/package-resolver.js +2 -2
  191. package/lib/cjs/provider/index.js +14 -10
  192. package/lib/cjs/provider/logger/decorators/index.js +17 -0
  193. package/lib/cjs/provider/logger/decorators/log-performance.decorator.js +178 -0
  194. package/lib/cjs/provider/logger/index.js +35 -0
  195. package/lib/cjs/provider/logger/logger.banner.js +482 -0
  196. package/lib/cjs/provider/logger/logger.config.js +32 -0
  197. package/lib/cjs/provider/logger/logger.context.js +341 -0
  198. package/lib/cjs/provider/logger/logger.flow.js +255 -0
  199. package/lib/cjs/provider/logger/logger.formatter.js +697 -0
  200. package/lib/cjs/provider/logger/logger.grouping.js +319 -0
  201. package/lib/cjs/provider/logger/logger.health.js +295 -0
  202. package/lib/cjs/provider/logger/logger.metrics-collector.js +184 -0
  203. package/lib/cjs/provider/logger/logger.metrics.js +91 -0
  204. package/lib/cjs/provider/logger/logger.performance.js +300 -0
  205. package/lib/cjs/provider/logger/logger.provider.js +746 -73
  206. package/lib/cjs/provider/logger/logger.query.js +532 -0
  207. package/lib/cjs/provider/logger/logger.redaction.js +456 -0
  208. package/lib/cjs/provider/logger/logger.suggestions.js +480 -0
  209. package/lib/cjs/provider/logger/transports/console.transport.js +141 -0
  210. package/lib/cjs/provider/logger/transports/file.transport.js +296 -0
  211. package/lib/cjs/provider/logger/transports/http-server.js +141 -0
  212. package/lib/cjs/provider/logger/transports/http.transport.js +151 -0
  213. package/lib/cjs/provider/logger/transports/index.js +21 -0
  214. package/lib/cjs/provider/logger/transports/transport.interface.js +2 -0
  215. package/lib/cjs/provider/logger/utils/index.js +18 -0
  216. package/lib/cjs/provider/logger/utils/log-entry.js +26 -0
  217. package/lib/cjs/provider/logger/utils/log-levels.js +107 -0
  218. package/lib/cjs/provider/provider-manager.js +209 -16
  219. package/lib/cjs/provider/provider-registry.js +414 -0
  220. package/lib/cjs/provider/provider.interface.js +49 -0
  221. package/lib/cjs/provider/validation/adapters/class-validator.adapter.js +264 -0
  222. package/lib/cjs/provider/validation/adapters/index.js +21 -0
  223. package/lib/cjs/provider/validation/adapters/yup.adapter.js +118 -0
  224. package/lib/cjs/provider/validation/adapters/zod.adapter.js +137 -0
  225. package/lib/cjs/provider/validation/helpful-error-formatter.js +228 -0
  226. package/lib/cjs/provider/validation/index.js +39 -0
  227. package/lib/cjs/provider/validation/smart-field-detector.js +543 -0
  228. package/lib/cjs/provider/validation/type-inference.js +192 -0
  229. package/lib/cjs/provider/validation/validation-registry.js +220 -0
  230. package/lib/cjs/provider/validation/validation.interface.js +9 -0
  231. package/lib/cjs/render/adapters/base-adapter.js +134 -0
  232. package/lib/cjs/render/adapters/ejs-adapter.js +172 -0
  233. package/lib/cjs/render/adapters/handlebars-adapter.js +191 -0
  234. package/lib/cjs/render/adapters/index.js +20 -0
  235. package/lib/cjs/render/adapters/pug-adapter.js +164 -0
  236. package/lib/cjs/render/adapters/react-adapter.js +336 -0
  237. package/lib/cjs/render/features/auto-detection.js +228 -0
  238. package/lib/cjs/render/features/hot-reload.js +155 -0
  239. package/lib/cjs/render/features/index.js +20 -0
  240. package/lib/cjs/render/features/streaming.js +106 -0
  241. package/lib/cjs/render/features/type-generator.js +221 -0
  242. package/lib/cjs/render/features/view-debugger.js +194 -0
  243. package/lib/cjs/render/index.js +80 -0
  244. package/lib/cjs/render/presets/index.js +216 -0
  245. package/lib/cjs/render/render-config.js +10 -0
  246. package/lib/cjs/render/render-interface.js +2 -0
  247. package/lib/cjs/render/render-registry.js +130 -0
  248. package/lib/cjs/render/render-service.js +418 -0
  249. package/lib/cjs/render/utils/cache-manager.js +199 -0
  250. package/lib/cjs/render/utils/index.js +20 -0
  251. package/lib/cjs/render/utils/package-resolver.js +121 -0
  252. package/lib/cjs/render/utils/view-scanner.js +208 -0
  253. package/lib/cjs/testing/create-test-app.js +366 -0
  254. package/lib/cjs/testing/create-test-database.js +416 -0
  255. package/lib/cjs/testing/fluent-request.js +461 -0
  256. package/lib/cjs/testing/index.js +142 -0
  257. package/lib/cjs/testing/load-test.js +484 -0
  258. package/lib/cjs/testing/matchers.js +444 -0
  259. package/lib/cjs/testing/mock-context.js +406 -0
  260. package/lib/cjs/testing/mock-provider.js +339 -0
  261. package/lib/cjs/testing/snapshot-request.js +380 -0
  262. package/lib/cjs/testing/testing.interfaces.js +10 -0
  263. package/lib/cjs/types/application/application-container.d.ts +320 -20
  264. package/lib/cjs/types/application/application-factory.d.ts +105 -3
  265. package/lib/cjs/types/application/application.types.d.ts +177 -2
  266. package/lib/cjs/types/application/bootstrap.d.ts +656 -0
  267. package/lib/cjs/types/application/index.d.ts +4 -3
  268. package/lib/cjs/types/authorization/authorization-config.interface.d.ts +45 -0
  269. package/lib/cjs/types/authorization/decorators/convenience.d.ts +64 -0
  270. package/lib/cjs/types/authorization/guard-constants.d.ts +9 -0
  271. package/lib/cjs/types/authorization/guard-decorators.d.ts +128 -0
  272. package/lib/cjs/types/authorization/guard-executor.d.ts +26 -0
  273. package/lib/cjs/types/authorization/guard-registry.d.ts +35 -0
  274. package/lib/cjs/types/authorization/guard.interface.d.ts +335 -0
  275. package/lib/cjs/types/authorization/guards/attribute-based.guard.d.ts +60 -0
  276. package/lib/cjs/types/authorization/guards/authenticated.guard.d.ts +26 -0
  277. package/lib/cjs/types/authorization/guards/composition.guard.d.ts +42 -0
  278. package/lib/cjs/types/authorization/guards/conditional.guard.d.ts +21 -0
  279. package/lib/cjs/types/authorization/guards/index.d.ts +7 -0
  280. package/lib/cjs/types/authorization/guards/permission.guard.d.ts +29 -0
  281. package/lib/cjs/types/authorization/guards/resource-owner.guard.d.ts +29 -0
  282. package/lib/cjs/types/authorization/guards/role.guard.d.ts +28 -0
  283. package/lib/cjs/types/authorization/index.d.ts +18 -0
  284. package/lib/cjs/types/authorization/services/guard-cache.d.ts +26 -0
  285. package/lib/cjs/types/authorization/services/guard-cache.interface.d.ts +29 -0
  286. package/lib/cjs/types/authorization/services/permission-hierarchy.d.ts +21 -0
  287. package/lib/cjs/types/authorization/services/permission-hierarchy.interface.d.ts +22 -0
  288. package/lib/cjs/types/authorization/services/permission-service.d.ts +21 -0
  289. package/lib/cjs/types/authorization/services/permission-service.interface.d.ts +19 -0
  290. package/lib/cjs/types/authorization/services/security-context.d.ts +32 -0
  291. package/lib/cjs/types/authorization/services/security-context.interface.d.ts +25 -0
  292. package/lib/cjs/types/authorization/setup.d.ts +84 -0
  293. package/lib/cjs/types/config/config-resolver.d.ts +40 -0
  294. package/lib/cjs/types/config/config.interfaces.d.ts +576 -0
  295. package/lib/cjs/types/config/define-config.d.ts +109 -0
  296. package/lib/cjs/types/config/env-field-builders.d.ts +327 -0
  297. package/lib/cjs/types/config/index.d.ts +61 -0
  298. package/lib/cjs/types/config/secret-value.d.ts +99 -0
  299. package/lib/cjs/types/console/color-codes.d.ts +1 -1
  300. package/lib/cjs/types/console/console.d.ts +65 -2
  301. package/lib/cjs/types/console/index.d.ts +1 -1
  302. package/lib/cjs/types/container-module/container-module.d.ts +215 -8
  303. package/lib/cjs/types/container-module/index.d.ts +1 -1
  304. package/lib/cjs/types/decorator/index.d.ts +1 -1
  305. package/lib/cjs/types/decorator/scope-binding.d.ts +339 -11
  306. package/lib/cjs/types/di/annotation/decorator_utils.d.ts +1 -1
  307. package/lib/cjs/types/di/annotation/inject.d.ts +1 -1
  308. package/lib/cjs/types/di/annotation/inject_base.d.ts +2 -2
  309. package/lib/cjs/types/di/annotation/lazy_service_identifier.d.ts +1 -1
  310. package/lib/cjs/types/di/annotation/multi_inject.d.ts +1 -1
  311. package/lib/cjs/types/di/annotation/named.d.ts +1 -1
  312. package/lib/cjs/types/di/annotation/target_name.d.ts +1 -1
  313. package/lib/cjs/types/di/annotation/unmanaged.d.ts +1 -1
  314. package/lib/cjs/types/di/binding-decorator/constants.d.ts +3 -0
  315. package/lib/cjs/types/di/binding-decorator/decorator/fluent_provide.d.ts +2 -2
  316. package/lib/cjs/types/di/binding-decorator/decorator/provide.d.ts +1 -1
  317. package/lib/cjs/types/di/binding-decorator/factory/module_factory.d.ts +20 -1
  318. package/lib/cjs/types/di/binding-decorator/index.d.ts +6 -4
  319. package/lib/cjs/types/di/binding-decorator/interfaces/interfaces.d.ts +2 -1
  320. package/lib/cjs/types/di/binding-decorator/syntax/provide_done_syntax.d.ts +1 -1
  321. package/lib/cjs/types/di/binding-decorator/syntax/provide_in_syntax.d.ts +3 -2
  322. package/lib/cjs/types/di/binding-decorator/syntax/provide_in_when_on_syntax.d.ts +3 -2
  323. package/lib/cjs/types/di/binding-decorator/syntax/provide_on_syntax.d.ts +2 -2
  324. package/lib/cjs/types/di/binding-decorator/syntax/provide_when_on_syntax.d.ts +2 -2
  325. package/lib/cjs/types/di/binding-decorator/syntax/provide_when_syntax.d.ts +2 -2
  326. package/lib/cjs/types/di/binding-decorator/utils/auto_wire.d.ts +1 -1
  327. package/lib/cjs/types/di/bindings/binding.d.ts +1 -1
  328. package/lib/cjs/types/di/constants/literal_types.d.ts +3 -3
  329. package/lib/cjs/types/di/container/container.d.ts +1 -1
  330. package/lib/cjs/types/di/container/container_module.d.ts +1 -1
  331. package/lib/cjs/types/di/container/container_snapshot.d.ts +1 -1
  332. package/lib/cjs/types/di/container/lookup.d.ts +1 -1
  333. package/lib/cjs/types/di/container/module_activation_store.d.ts +1 -1
  334. package/lib/cjs/types/di/container-introspection.d.ts +25 -0
  335. package/lib/cjs/types/di/interfaces/interfaces.d.ts +4 -3
  336. package/lib/cjs/types/di/inversify.d.ts +53 -24
  337. package/lib/cjs/types/di/planning/context.d.ts +1 -1
  338. package/lib/cjs/types/di/planning/metadata.d.ts +1 -1
  339. package/lib/cjs/types/di/planning/metadata_reader.d.ts +1 -1
  340. package/lib/cjs/types/di/planning/plan.d.ts +1 -1
  341. package/lib/cjs/types/di/planning/planner.d.ts +1 -1
  342. package/lib/cjs/types/di/planning/queryable_string.d.ts +1 -1
  343. package/lib/cjs/types/di/planning/reflection_utils.d.ts +2 -2
  344. package/lib/cjs/types/di/planning/request.d.ts +1 -1
  345. package/lib/cjs/types/di/planning/target.d.ts +2 -2
  346. package/lib/cjs/types/di/resolution/instantiation.d.ts +1 -1
  347. package/lib/cjs/types/di/resolution/resolver.d.ts +1 -1
  348. package/lib/cjs/types/di/scope/scope-registry.d.ts +91 -0
  349. package/lib/cjs/types/di/scope/scope.d.ts +1 -1
  350. package/lib/cjs/types/di/syntax/binding_in_syntax.d.ts +2 -1
  351. package/lib/cjs/types/di/syntax/binding_in_when_on_syntax.d.ts +2 -1
  352. package/lib/cjs/types/di/syntax/binding_on_syntax.d.ts +1 -1
  353. package/lib/cjs/types/di/syntax/binding_to_syntax.d.ts +2 -2
  354. package/lib/cjs/types/di/syntax/binding_when_on_syntax.d.ts +1 -1
  355. package/lib/cjs/types/di/syntax/binding_when_syntax.d.ts +1 -1
  356. package/lib/cjs/types/di/syntax/constraint_helpers.d.ts +1 -1
  357. package/lib/cjs/types/di/utils/binding_utils.d.ts +1 -1
  358. package/lib/cjs/types/di/utils/clonable.d.ts +1 -1
  359. package/lib/cjs/types/di/utils/serialization.d.ts +1 -1
  360. package/lib/cjs/types/error/app-error.d.ts +155 -7
  361. package/lib/cjs/types/error/base-exception-filter.d.ts +73 -0
  362. package/lib/cjs/types/error/exception-filter-constants.d.ts +9 -0
  363. package/lib/cjs/types/error/exception-filter-decorators.d.ts +126 -0
  364. package/lib/cjs/types/error/exception-filter-registry.d.ts +38 -0
  365. package/lib/cjs/types/error/exception-filter.interface.d.ts +82 -0
  366. package/lib/cjs/types/error/exception-handler-middleware.d.ts +35 -0
  367. package/lib/cjs/types/error/filters/app-error.filter.d.ts +10 -0
  368. package/lib/cjs/types/error/filters/global-exception.filter.d.ts +9 -0
  369. package/lib/cjs/types/error/filters/not-found.filter.d.ts +10 -0
  370. package/lib/cjs/types/error/filters/validation-error.filter.d.ts +10 -0
  371. package/lib/cjs/types/error/index.d.ts +14 -3
  372. package/lib/cjs/types/error/not-found.error.d.ts +7 -0
  373. package/lib/cjs/types/error/report.d.ts +84 -6
  374. package/lib/cjs/types/error/status-code.d.ts +20 -0
  375. package/lib/cjs/types/error/utils.d.ts +16 -0
  376. package/lib/cjs/types/error/validation.error.d.ts +8 -0
  377. package/lib/cjs/types/event/event-decorators.d.ts +199 -0
  378. package/lib/cjs/types/event/event-emitter.d.ts +109 -0
  379. package/lib/cjs/types/event/event-flow-tracker.d.ts +88 -0
  380. package/lib/cjs/types/event/event-recorder.d.ts +121 -0
  381. package/lib/cjs/types/event/event-registry.d.ts +84 -0
  382. package/lib/cjs/types/event/event.interfaces.d.ts +528 -0
  383. package/lib/cjs/types/event/index.d.ts +55 -0
  384. package/lib/cjs/types/framework-version.d.ts +7 -0
  385. package/lib/cjs/types/index.d.ts +27 -8
  386. package/lib/cjs/types/interceptor/conditional-interceptor.d.ts +91 -0
  387. package/lib/cjs/types/interceptor/execution-context.d.ts +41 -0
  388. package/lib/cjs/types/interceptor/index.d.ts +41 -0
  389. package/lib/cjs/types/interceptor/interceptor-composition.d.ts +115 -0
  390. package/lib/cjs/types/interceptor/interceptor-constants.d.ts +17 -0
  391. package/lib/cjs/types/interceptor/interceptor-decorators.d.ts +124 -0
  392. package/lib/cjs/types/interceptor/interceptor-executor.d.ts +46 -0
  393. package/lib/cjs/types/interceptor/interceptor-registry.d.ts +65 -0
  394. package/lib/cjs/types/interceptor/interceptor.interface.d.ts +281 -0
  395. package/lib/cjs/types/interceptor/interceptors/index.d.ts +6 -0
  396. package/lib/cjs/types/interceptor/interceptors/logging.interceptor.d.ts +28 -0
  397. package/lib/cjs/types/interceptor/interceptors/performance.interceptor.d.ts +197 -0
  398. package/lib/cjs/types/interceptor/interceptors/timeout.interceptor.d.ts +42 -0
  399. package/lib/cjs/types/lazy-loading/index.d.ts +43 -0
  400. package/lib/cjs/types/lazy-loading/lazy-load-metrics.d.ts +139 -0
  401. package/lib/cjs/types/lazy-loading/lazy-module-helpers.d.ts +42 -0
  402. package/lib/cjs/types/lazy-loading/lazy-module-loader.d.ts +169 -0
  403. package/lib/cjs/types/lazy-loading/lazy-module-manager.d.ts +148 -0
  404. package/lib/cjs/types/lazy-loading/lazy-module-warmup.d.ts +130 -0
  405. package/lib/cjs/types/lazy-loading/lazy-module.d.ts +168 -0
  406. package/lib/cjs/types/lazy-loading/lazy.interfaces.d.ts +480 -0
  407. package/lib/cjs/types/lifecycle/index.d.ts +9 -0
  408. package/lib/cjs/types/lifecycle/lifecycle-registry.d.ts +213 -0
  409. package/lib/cjs/types/lifecycle/lifecycle.interface.d.ts +191 -0
  410. package/lib/cjs/types/middleware/content-negotiation/accept-header-parser.d.ts +26 -0
  411. package/lib/cjs/types/middleware/content-negotiation/content-negotiation-service.d.ts +64 -0
  412. package/lib/cjs/types/middleware/content-negotiation/formatter-registry.d.ts +60 -0
  413. package/lib/cjs/types/middleware/content-negotiation/formatters/csv-formatter.d.ts +34 -0
  414. package/lib/cjs/types/middleware/content-negotiation/formatters/index.d.ts +8 -0
  415. package/lib/cjs/types/middleware/content-negotiation/formatters/json-formatter.d.ts +14 -0
  416. package/lib/cjs/types/middleware/content-negotiation/formatters/plain-text-formatter.d.ts +12 -0
  417. package/lib/cjs/types/middleware/content-negotiation/formatters/xml-formatter.d.ts +26 -0
  418. package/lib/cjs/types/middleware/content-negotiation/formatters/yaml-formatter.d.ts +26 -0
  419. package/lib/cjs/types/middleware/content-negotiation/index.d.ts +7 -0
  420. package/lib/cjs/types/middleware/index.d.ts +25 -15
  421. package/lib/cjs/types/middleware/interfaces/content-negotiation.interface.d.ts +142 -0
  422. package/lib/cjs/types/middleware/interfaces/cookie-session/cookie-session.interface.d.ts +1 -1
  423. package/lib/cjs/types/middleware/middleware-config.d.ts +574 -0
  424. package/lib/cjs/types/middleware/middleware-interface.d.ts +594 -88
  425. package/lib/cjs/types/middleware/middleware-profiler.d.ts +199 -0
  426. package/lib/cjs/types/middleware/middleware-registry.d.ts +103 -0
  427. package/lib/cjs/types/middleware/middleware-resolver.d.ts +156 -8
  428. package/lib/cjs/types/middleware/middleware-service.d.ts +654 -111
  429. package/lib/cjs/types/middleware/middleware-utils.d.ts +145 -0
  430. package/lib/cjs/types/middleware/presets-standalone.d.ts +75 -0
  431. package/lib/cjs/types/middleware/upload-registry.d.ts +50 -0
  432. package/lib/cjs/types/path-resolver/index.d.ts +80 -0
  433. package/lib/cjs/types/provider/db-in-memory/adapter/adapter.interface.d.ts +222 -0
  434. package/lib/cjs/types/provider/db-in-memory/adapter/in-memory.adapter.d.ts +241 -0
  435. package/lib/cjs/types/provider/db-in-memory/adapter/index.d.ts +6 -0
  436. package/lib/cjs/types/provider/db-in-memory/base-repo.repository.d.ts +1 -1
  437. package/lib/cjs/types/provider/db-in-memory/db-in-memory.interface.d.ts +1 -1
  438. package/lib/cjs/types/provider/db-in-memory/db-in-memory.provider.d.ts +8 -2
  439. package/lib/cjs/types/provider/db-in-memory/db.provider.d.ts +281 -0
  440. package/lib/cjs/types/provider/db-in-memory/index.d.ts +71 -4
  441. package/lib/cjs/types/provider/db-in-memory/query/index.d.ts +6 -0
  442. package/lib/cjs/types/provider/db-in-memory/query/query-engine.d.ts +114 -0
  443. package/lib/cjs/types/provider/db-in-memory/query/query.types.d.ts +318 -0
  444. package/lib/cjs/types/provider/db-in-memory/schema/decorators.d.ts +328 -0
  445. package/lib/cjs/types/provider/db-in-memory/schema/entity.interface.d.ts +60 -0
  446. package/lib/cjs/types/provider/db-in-memory/schema/index.d.ts +6 -0
  447. package/lib/cjs/types/provider/db-in-memory/storage/index.d.ts +5 -0
  448. package/lib/cjs/types/provider/db-in-memory/storage/memory-store.d.ts +360 -0
  449. package/lib/cjs/types/provider/index.d.ts +7 -5
  450. package/lib/cjs/types/provider/logger/decorators/index.d.ts +1 -0
  451. package/lib/cjs/types/provider/logger/decorators/log-performance.decorator.d.ts +49 -0
  452. package/lib/cjs/types/provider/logger/index.d.ts +17 -0
  453. package/lib/cjs/types/provider/logger/logger.banner.d.ts +94 -0
  454. package/lib/cjs/types/provider/logger/logger.config.d.ts +62 -0
  455. package/lib/cjs/types/provider/logger/logger.context.d.ts +189 -0
  456. package/lib/cjs/types/provider/logger/logger.flow.d.ts +165 -0
  457. package/lib/cjs/types/provider/logger/logger.formatter.d.ts +54 -0
  458. package/lib/cjs/types/provider/logger/logger.grouping.d.ts +124 -0
  459. package/lib/cjs/types/provider/logger/logger.health.d.ts +123 -0
  460. package/lib/cjs/types/provider/logger/logger.metrics-collector.d.ts +44 -0
  461. package/lib/cjs/types/provider/logger/logger.metrics.d.ts +162 -0
  462. package/lib/cjs/types/provider/logger/logger.performance.d.ts +179 -0
  463. package/lib/cjs/types/provider/logger/logger.provider.d.ts +332 -28
  464. package/lib/cjs/types/provider/logger/logger.query.d.ts +232 -0
  465. package/lib/cjs/types/provider/logger/logger.redaction.d.ts +169 -0
  466. package/lib/cjs/types/provider/logger/logger.suggestions.d.ts +124 -0
  467. package/lib/cjs/types/provider/logger/transports/console.transport.d.ts +56 -0
  468. package/lib/cjs/types/provider/logger/transports/file.transport.d.ts +87 -0
  469. package/lib/cjs/types/provider/logger/transports/http-server.d.ts +88 -0
  470. package/lib/cjs/types/provider/logger/transports/http.transport.d.ts +74 -0
  471. package/lib/cjs/types/provider/logger/transports/index.d.ts +5 -0
  472. package/lib/cjs/types/provider/logger/transports/transport.interface.d.ts +31 -0
  473. package/lib/cjs/types/provider/logger/utils/index.d.ts +2 -0
  474. package/lib/cjs/types/provider/logger/utils/log-entry.d.ts +82 -0
  475. package/lib/cjs/types/provider/logger/utils/log-levels.d.ts +53 -0
  476. package/lib/cjs/types/provider/provider-manager.d.ts +165 -13
  477. package/lib/cjs/types/provider/provider-registry.d.ts +192 -0
  478. package/lib/cjs/types/provider/provider.interface.d.ts +337 -0
  479. package/lib/cjs/types/provider/validation/adapters/class-validator.adapter.d.ts +68 -0
  480. package/lib/cjs/types/provider/validation/adapters/index.d.ts +13 -0
  481. package/lib/cjs/types/provider/validation/adapters/yup.adapter.d.ts +65 -0
  482. package/lib/cjs/types/provider/validation/adapters/zod.adapter.d.ts +84 -0
  483. package/lib/cjs/types/provider/validation/helpful-error-formatter.d.ts +110 -0
  484. package/lib/cjs/types/provider/validation/index.d.ts +19 -0
  485. package/lib/cjs/types/provider/validation/smart-field-detector.d.ts +91 -0
  486. package/lib/cjs/types/provider/validation/type-inference.d.ts +81 -0
  487. package/lib/cjs/types/provider/validation/validation-registry.d.ts +105 -0
  488. package/lib/cjs/types/provider/validation/validation.interface.d.ts +178 -0
  489. package/lib/cjs/types/render/adapters/base-adapter.d.ts +95 -0
  490. package/lib/cjs/types/render/adapters/ejs-adapter.d.ts +57 -0
  491. package/lib/cjs/types/render/adapters/handlebars-adapter.d.ts +74 -0
  492. package/lib/cjs/types/render/adapters/index.d.ts +12 -0
  493. package/lib/cjs/types/render/adapters/pug-adapter.d.ts +57 -0
  494. package/lib/cjs/types/render/adapters/react-adapter.d.ts +99 -0
  495. package/lib/cjs/types/render/features/auto-detection.d.ts +58 -0
  496. package/lib/cjs/types/render/features/hot-reload.d.ts +65 -0
  497. package/lib/cjs/types/render/features/index.d.ts +12 -0
  498. package/lib/cjs/types/render/features/streaming.d.ts +39 -0
  499. package/lib/cjs/types/render/features/type-generator.d.ts +64 -0
  500. package/lib/cjs/types/render/features/view-debugger.d.ts +52 -0
  501. package/lib/cjs/types/render/index.d.ts +50 -0
  502. package/lib/cjs/types/render/presets/index.d.ts +119 -0
  503. package/lib/cjs/types/render/render-config.d.ts +213 -0
  504. package/lib/cjs/types/render/render-interface.d.ts +126 -0
  505. package/lib/cjs/types/render/render-registry.d.ts +86 -0
  506. package/lib/cjs/types/render/render-service.d.ts +157 -0
  507. package/lib/cjs/types/render/utils/cache-manager.d.ts +106 -0
  508. package/lib/cjs/types/render/utils/index.d.ts +11 -0
  509. package/lib/cjs/types/render/utils/package-resolver.d.ts +57 -0
  510. package/lib/cjs/types/render/utils/view-scanner.d.ts +74 -0
  511. package/lib/cjs/types/testing/create-test-app.d.ts +71 -0
  512. package/lib/cjs/types/testing/create-test-database.d.ts +100 -0
  513. package/lib/cjs/types/testing/fluent-request.d.ts +37 -0
  514. package/lib/cjs/types/testing/index.d.ts +93 -0
  515. package/lib/cjs/types/testing/load-test.d.ts +139 -0
  516. package/lib/cjs/types/testing/matchers.d.ts +184 -0
  517. package/lib/cjs/types/testing/mock-context.d.ts +117 -0
  518. package/lib/cjs/types/testing/mock-provider.d.ts +93 -0
  519. package/lib/cjs/types/testing/snapshot-request.d.ts +46 -0
  520. package/lib/cjs/types/testing/testing.interfaces.d.ts +973 -0
  521. package/lib/cjs/types/utils/node-require.d.ts +11 -0
  522. package/lib/cjs/utils/node-require.js +59 -0
  523. package/lib/esm/application/application-container.js +526 -0
  524. package/lib/esm/application/application-factory.js +140 -0
  525. package/lib/esm/application/application.types.js +41 -0
  526. package/lib/esm/application/bootstrap.js +709 -0
  527. package/lib/esm/application/index.js +4 -0
  528. package/lib/esm/authorization/authorization-config.interface.js +1 -0
  529. package/lib/esm/authorization/decorators/convenience.js +74 -0
  530. package/lib/esm/authorization/guard-constants.js +9 -0
  531. package/lib/esm/authorization/guard-decorators.js +155 -0
  532. package/lib/esm/authorization/guard-executor.js +101 -0
  533. package/lib/esm/authorization/guard-registry.js +132 -0
  534. package/lib/esm/authorization/guard.interface.js +73 -0
  535. package/lib/esm/authorization/guards/attribute-based.guard.js +106 -0
  536. package/lib/esm/authorization/guards/authenticated.guard.js +45 -0
  537. package/lib/esm/authorization/guards/composition.guard.js +63 -0
  538. package/lib/esm/authorization/guards/conditional.guard.js +38 -0
  539. package/lib/esm/authorization/guards/index.js +8 -0
  540. package/lib/esm/authorization/guards/permission.guard.js +80 -0
  541. package/lib/esm/authorization/guards/resource-owner.guard.js +58 -0
  542. package/lib/esm/authorization/guards/role.guard.js +61 -0
  543. package/lib/esm/authorization/index.js +24 -0
  544. package/lib/esm/authorization/services/guard-cache.interface.js +1 -0
  545. package/lib/esm/authorization/services/guard-cache.js +51 -0
  546. package/lib/esm/authorization/services/permission-hierarchy.interface.js +1 -0
  547. package/lib/esm/authorization/services/permission-hierarchy.js +49 -0
  548. package/lib/esm/authorization/services/permission-service.interface.js +1 -0
  549. package/lib/esm/authorization/services/permission-service.js +56 -0
  550. package/lib/esm/authorization/services/security-context.interface.js +1 -0
  551. package/lib/esm/authorization/services/security-context.js +74 -0
  552. package/lib/esm/authorization/setup.js +137 -0
  553. package/lib/esm/config/config-resolver.js +714 -0
  554. package/lib/esm/config/config.interfaces.js +13 -0
  555. package/lib/esm/config/define-config.js +492 -0
  556. package/lib/esm/config/env-field-builders.js +440 -0
  557. package/lib/esm/config/index.js +72 -0
  558. package/lib/esm/config/secret-value.js +175 -0
  559. package/lib/esm/console/color-codes.js +46 -0
  560. package/lib/esm/console/console.js +107 -0
  561. package/lib/esm/console/index.js +1 -0
  562. package/lib/esm/container-module/container-module.js +322 -0
  563. package/lib/esm/container-module/index.js +1 -0
  564. package/lib/esm/decorator/index.js +1 -0
  565. package/lib/esm/decorator/scope-binding.js +344 -0
  566. package/lib/esm/di/annotation/decorator_utils.js +93 -0
  567. package/lib/esm/di/annotation/inject.js +18 -0
  568. package/lib/esm/di/annotation/inject_base.js +14 -0
  569. package/lib/esm/di/annotation/injectable.js +19 -0
  570. package/lib/esm/di/annotation/lazy_service_identifier.js +9 -0
  571. package/lib/esm/di/annotation/multi_inject.js +4 -0
  572. package/lib/esm/di/annotation/named.js +9 -0
  573. package/lib/esm/di/annotation/optional.js +7 -0
  574. package/lib/esm/di/annotation/post_construct.js +5 -0
  575. package/lib/esm/di/annotation/pre_destroy.js +5 -0
  576. package/lib/esm/di/annotation/property_event_decorator.js +13 -0
  577. package/lib/esm/di/annotation/tagged.js +7 -0
  578. package/lib/esm/di/annotation/target_name.js +10 -0
  579. package/lib/esm/di/annotation/unmanaged.js +10 -0
  580. package/lib/esm/di/binding-decorator/constants.js +7 -0
  581. package/lib/esm/di/binding-decorator/decorator/fluent_provide.js +15 -0
  582. package/lib/esm/di/binding-decorator/decorator/provide.js +35 -0
  583. package/lib/esm/di/binding-decorator/factory/module_factory.js +34 -0
  584. package/lib/esm/di/binding-decorator/index.js +10 -0
  585. package/lib/esm/di/binding-decorator/interfaces/interfaces.js +1 -0
  586. package/lib/esm/di/binding-decorator/syntax/provide_done_syntax.js +41 -0
  587. package/lib/esm/di/binding-decorator/syntax/provide_in_syntax.js +37 -0
  588. package/lib/esm/di/binding-decorator/syntax/provide_in_when_on_syntax.js +68 -0
  589. package/lib/esm/di/binding-decorator/syntax/provide_on_syntax.js +19 -0
  590. package/lib/esm/di/binding-decorator/syntax/provide_when_on_syntax.js +57 -0
  591. package/lib/esm/di/binding-decorator/syntax/provide_when_syntax.js +86 -0
  592. package/lib/esm/di/binding-decorator/utils/auto_wire.js +13 -0
  593. package/lib/esm/di/bindings/binding.js +64 -0
  594. package/lib/esm/di/bindings/binding_count.js +5 -0
  595. package/lib/esm/di/constants/error_msgs.js +54 -0
  596. package/lib/esm/di/constants/literal_types.js +21 -0
  597. package/lib/esm/di/constants/metadata_keys.js +35 -0
  598. package/lib/esm/di/container/container.js +505 -0
  599. package/lib/esm/di/container/container_module.js +17 -0
  600. package/lib/esm/di/container/container_snapshot.js +17 -0
  601. package/lib/esm/di/container/lookup.js +108 -0
  602. package/lib/esm/di/container/module_activation_store.js +43 -0
  603. package/lib/esm/di/container-introspection.js +38 -0
  604. package/lib/esm/di/interfaces/interfaces.js +1 -0
  605. package/lib/esm/di/inversify.js +53 -0
  606. package/lib/esm/di/planning/context.js +18 -0
  607. package/lib/esm/di/planning/metadata.js +18 -0
  608. package/lib/esm/di/planning/metadata_reader.js +19 -0
  609. package/lib/esm/di/planning/plan.js +9 -0
  610. package/lib/esm/di/planning/planner.js +159 -0
  611. package/lib/esm/di/planning/queryable_string.js +25 -0
  612. package/lib/esm/di/planning/reflection_utils.js +150 -0
  613. package/lib/esm/di/planning/request.js +28 -0
  614. package/lib/esm/di/planning/target.js +89 -0
  615. package/lib/esm/di/resolution/instantiation.js +125 -0
  616. package/lib/esm/di/resolution/resolver.js +163 -0
  617. package/lib/esm/di/scope/scope-registry.js +109 -0
  618. package/lib/esm/di/scope/scope.js +75 -0
  619. package/lib/esm/di/syntax/binding_in_syntax.js +31 -0
  620. package/lib/esm/di/syntax/binding_in_when_on_syntax.js +79 -0
  621. package/lib/esm/di/syntax/binding_on_syntax.js +16 -0
  622. package/lib/esm/di/syntax/binding_to_syntax.js +89 -0
  623. package/lib/esm/di/syntax/binding_when_on_syntax.js +64 -0
  624. package/lib/esm/di/syntax/binding_when_syntax.js +82 -0
  625. package/lib/esm/di/syntax/constraint_helpers.js +39 -0
  626. package/lib/esm/di/utils/async.js +12 -0
  627. package/lib/esm/di/utils/binding_utils.js +48 -0
  628. package/lib/esm/di/utils/clonable.js +7 -0
  629. package/lib/esm/di/utils/exceptions.js +18 -0
  630. package/lib/esm/di/utils/factory_type.js +6 -0
  631. package/lib/esm/di/utils/id.js +5 -0
  632. package/lib/esm/di/utils/js.js +12 -0
  633. package/lib/esm/di/utils/serialization.js +102 -0
  634. package/lib/esm/error/app-error.js +209 -0
  635. package/lib/esm/error/base-exception-filter.js +134 -0
  636. package/lib/esm/error/error-handler-middleware.js +34 -0
  637. package/lib/esm/error/exception-filter-constants.js +9 -0
  638. package/lib/esm/error/exception-filter-decorators.js +157 -0
  639. package/lib/esm/error/exception-filter-registry.js +162 -0
  640. package/lib/esm/error/exception-filter.interface.js +1 -0
  641. package/lib/esm/error/exception-handler-middleware.js +378 -0
  642. package/lib/esm/error/filters/app-error.filter.js +28 -0
  643. package/lib/esm/error/filters/global-exception.filter.js +36 -0
  644. package/lib/esm/error/filters/not-found.filter.js +32 -0
  645. package/lib/esm/error/filters/validation-error.filter.js +32 -0
  646. package/lib/esm/error/index.js +13 -0
  647. package/lib/esm/error/not-found.error.js +13 -0
  648. package/lib/esm/error/report.js +153 -0
  649. package/lib/esm/error/status-code.js +106 -0
  650. package/lib/esm/error/utils.js +252 -0
  651. package/lib/esm/error/validation.error.js +15 -0
  652. package/lib/esm/event/event-decorators.js +268 -0
  653. package/lib/esm/event/event-emitter.js +376 -0
  654. package/lib/esm/event/event-flow-tracker.js +230 -0
  655. package/lib/esm/event/event-recorder.js +286 -0
  656. package/lib/esm/event/event-registry.js +201 -0
  657. package/lib/esm/event/event.interfaces.js +51 -0
  658. package/lib/esm/event/index.js +58 -0
  659. package/lib/esm/framework-version.js +7 -0
  660. package/lib/esm/index.mjs +27 -0
  661. package/lib/esm/interceptor/conditional-interceptor.js +104 -0
  662. package/lib/esm/interceptor/execution-context.js +66 -0
  663. package/lib/esm/interceptor/index.js +48 -0
  664. package/lib/esm/interceptor/interceptor-composition.js +126 -0
  665. package/lib/esm/interceptor/interceptor-constants.js +17 -0
  666. package/lib/esm/interceptor/interceptor-decorators.js +151 -0
  667. package/lib/esm/interceptor/interceptor-executor.js +139 -0
  668. package/lib/esm/interceptor/interceptor-registry.js +158 -0
  669. package/lib/esm/interceptor/interceptor.interface.js +16 -0
  670. package/lib/esm/interceptor/interceptors/index.js +6 -0
  671. package/lib/esm/interceptor/interceptors/logging.interceptor.js +68 -0
  672. package/lib/esm/interceptor/interceptors/performance.interceptor.js +253 -0
  673. package/lib/esm/interceptor/interceptors/timeout.interceptor.js +65 -0
  674. package/lib/esm/lazy-loading/index.js +58 -0
  675. package/lib/esm/lazy-loading/lazy-load-metrics.js +352 -0
  676. package/lib/esm/lazy-loading/lazy-module-helpers.js +45 -0
  677. package/lib/esm/lazy-loading/lazy-module-loader.js +305 -0
  678. package/lib/esm/lazy-loading/lazy-module-manager.js +241 -0
  679. package/lib/esm/lazy-loading/lazy-module-warmup.js +291 -0
  680. package/lib/esm/lazy-loading/lazy-module.js +352 -0
  681. package/lib/esm/lazy-loading/lazy.interfaces.js +17 -0
  682. package/lib/esm/lifecycle/index.js +9 -0
  683. package/lib/esm/lifecycle/lifecycle-registry.js +298 -0
  684. package/lib/esm/lifecycle/lifecycle.interface.js +33 -0
  685. package/lib/esm/middleware/content-negotiation/accept-header-parser.js +106 -0
  686. package/lib/esm/middleware/content-negotiation/content-negotiation-service.js +286 -0
  687. package/lib/esm/middleware/content-negotiation/formatter-registry.js +165 -0
  688. package/lib/esm/middleware/content-negotiation/formatters/csv-formatter.js +111 -0
  689. package/lib/esm/middleware/content-negotiation/formatters/index.js +8 -0
  690. package/lib/esm/middleware/content-negotiation/formatters/json-formatter.js +30 -0
  691. package/lib/esm/middleware/content-negotiation/formatters/plain-text-formatter.js +40 -0
  692. package/lib/esm/middleware/content-negotiation/formatters/xml-formatter.js +121 -0
  693. package/lib/esm/middleware/content-negotiation/formatters/yaml-formatter.js +131 -0
  694. package/lib/esm/middleware/content-negotiation/index.js +7 -0
  695. package/lib/esm/middleware/index.js +20 -0
  696. package/lib/esm/middleware/interfaces/body-parser.interface.js +1 -0
  697. package/lib/esm/middleware/interfaces/compression.interface.js +1 -0
  698. package/lib/esm/middleware/interfaces/content-negotiation.interface.js +6 -0
  699. package/lib/esm/middleware/interfaces/cookie-parser.interface.js +1 -0
  700. package/lib/esm/middleware/interfaces/cookie-session/cookie-session.interface.js +1 -0
  701. package/lib/esm/middleware/interfaces/cookie-session/keygrip.interface.js +1 -0
  702. package/lib/esm/middleware/interfaces/cors.interface.js +1 -0
  703. package/lib/esm/middleware/interfaces/express-rate-limit.interface.js +1 -0
  704. package/lib/esm/middleware/interfaces/express-session.interface.js +1 -0
  705. package/lib/esm/middleware/interfaces/helmet.interface.js +1 -0
  706. package/lib/esm/middleware/interfaces/morgan.interface.js +1 -0
  707. package/lib/esm/middleware/interfaces/multer.interface.js +1 -0
  708. package/lib/esm/middleware/interfaces/serve-favicon.interface.js +1 -0
  709. package/lib/esm/middleware/interfaces/serve-static.interface.js +1 -0
  710. package/lib/esm/middleware/interfaces/url-encoded.interface.js +1 -0
  711. package/lib/esm/middleware/middleware-config.js +9 -0
  712. package/lib/esm/middleware/middleware-interface.js +1 -0
  713. package/lib/esm/middleware/middleware-profiler.js +307 -0
  714. package/lib/esm/middleware/middleware-registry.js +152 -0
  715. package/lib/esm/middleware/middleware-resolver.js +320 -0
  716. package/lib/esm/middleware/middleware-service.js +1853 -0
  717. package/lib/esm/middleware/middleware-utils.js +273 -0
  718. package/lib/esm/middleware/presets-standalone.js +87 -0
  719. package/lib/esm/middleware/upload-registry.js +84 -0
  720. package/lib/esm/package.json +3 -0
  721. package/lib/esm/path-resolver/index.js +224 -0
  722. package/lib/esm/provider/db-in-memory/adapter/adapter.interface.js +9 -0
  723. package/lib/esm/provider/db-in-memory/adapter/in-memory.adapter.js +690 -0
  724. package/lib/esm/provider/db-in-memory/adapter/index.js +5 -0
  725. package/lib/esm/provider/db-in-memory/base-repo.repository.js +54 -0
  726. package/lib/esm/provider/db-in-memory/db-in-memory.interface.js +1 -0
  727. package/lib/esm/provider/db-in-memory/db-in-memory.provider.js +104 -0
  728. package/lib/esm/provider/db-in-memory/db-in-memory.types.js +20 -0
  729. package/lib/esm/provider/db-in-memory/db.provider.js +405 -0
  730. package/lib/esm/provider/db-in-memory/index.js +98 -0
  731. package/lib/esm/provider/db-in-memory/query/index.js +6 -0
  732. package/lib/esm/provider/db-in-memory/query/query-engine.js +598 -0
  733. package/lib/esm/provider/db-in-memory/query/query.types.js +9 -0
  734. package/lib/esm/provider/db-in-memory/schema/decorators.js +405 -0
  735. package/lib/esm/provider/db-in-memory/schema/entity.interface.js +8 -0
  736. package/lib/esm/provider/db-in-memory/schema/index.js +5 -0
  737. package/lib/esm/provider/db-in-memory/storage/index.js +5 -0
  738. package/lib/esm/provider/db-in-memory/storage/memory-store.js +784 -0
  739. package/lib/esm/provider/dto-validator/dto-validator.provider.js +49 -0
  740. package/lib/esm/provider/dto-validator/package-resolver.js +30 -0
  741. package/lib/esm/provider/index.js +7 -0
  742. package/lib/esm/provider/logger/decorators/index.js +1 -0
  743. package/lib/esm/provider/logger/decorators/log-performance.decorator.js +175 -0
  744. package/lib/esm/provider/logger/index.js +17 -0
  745. package/lib/esm/provider/logger/logger.banner.js +480 -0
  746. package/lib/esm/provider/logger/logger.config.js +29 -0
  747. package/lib/esm/provider/logger/logger.context.js +334 -0
  748. package/lib/esm/provider/logger/logger.flow.js +248 -0
  749. package/lib/esm/provider/logger/logger.formatter.js +691 -0
  750. package/lib/esm/provider/logger/logger.grouping.js +314 -0
  751. package/lib/esm/provider/logger/logger.health.js +291 -0
  752. package/lib/esm/provider/logger/logger.metrics-collector.js +180 -0
  753. package/lib/esm/provider/logger/logger.metrics.js +85 -0
  754. package/lib/esm/provider/logger/logger.performance.js +299 -0
  755. package/lib/esm/provider/logger/logger.provider.js +797 -0
  756. package/lib/esm/provider/logger/logger.query.js +529 -0
  757. package/lib/esm/provider/logger/logger.redaction.js +450 -0
  758. package/lib/esm/provider/logger/logger.suggestions.js +471 -0
  759. package/lib/esm/provider/logger/transports/console.transport.js +144 -0
  760. package/lib/esm/provider/logger/transports/file.transport.js +300 -0
  761. package/lib/esm/provider/logger/transports/http-server.js +141 -0
  762. package/lib/esm/provider/logger/transports/http.transport.js +157 -0
  763. package/lib/esm/provider/logger/transports/index.js +5 -0
  764. package/lib/esm/provider/logger/transports/transport.interface.js +1 -0
  765. package/lib/esm/provider/logger/utils/index.js +2 -0
  766. package/lib/esm/provider/logger/utils/log-entry.js +23 -0
  767. package/lib/esm/provider/logger/utils/log-levels.js +101 -0
  768. package/lib/esm/provider/provider-manager.js +283 -0
  769. package/lib/esm/provider/provider-registry.js +411 -0
  770. package/lib/esm/provider/provider.interface.js +44 -0
  771. package/lib/esm/provider/validation/adapters/class-validator.adapter.js +258 -0
  772. package/lib/esm/provider/validation/adapters/index.js +13 -0
  773. package/lib/esm/provider/validation/adapters/yup.adapter.js +111 -0
  774. package/lib/esm/provider/validation/adapters/zod.adapter.js +130 -0
  775. package/lib/esm/provider/validation/helpful-error-formatter.js +225 -0
  776. package/lib/esm/provider/validation/index.js +21 -0
  777. package/lib/esm/provider/validation/smart-field-detector.js +539 -0
  778. package/lib/esm/provider/validation/type-inference.js +183 -0
  779. package/lib/esm/provider/validation/validation-registry.js +214 -0
  780. package/lib/esm/provider/validation/validation.interface.js +8 -0
  781. package/lib/esm/render/adapters/base-adapter.js +131 -0
  782. package/lib/esm/render/adapters/ejs-adapter.js +142 -0
  783. package/lib/esm/render/adapters/handlebars-adapter.js +161 -0
  784. package/lib/esm/render/adapters/index.js +12 -0
  785. package/lib/esm/render/adapters/pug-adapter.js +134 -0
  786. package/lib/esm/render/adapters/react-adapter.js +303 -0
  787. package/lib/esm/render/features/auto-detection.js +202 -0
  788. package/lib/esm/render/features/hot-reload.js +153 -0
  789. package/lib/esm/render/features/index.js +12 -0
  790. package/lib/esm/render/features/streaming.js +103 -0
  791. package/lib/esm/render/features/type-generator.js +195 -0
  792. package/lib/esm/render/features/view-debugger.js +192 -0
  793. package/lib/esm/render/index.js +54 -0
  794. package/lib/esm/render/presets/index.js +207 -0
  795. package/lib/esm/render/render-config.js +9 -0
  796. package/lib/esm/render/render-interface.js +1 -0
  797. package/lib/esm/render/render-registry.js +124 -0
  798. package/lib/esm/render/render-service.js +394 -0
  799. package/lib/esm/render/utils/cache-manager.js +196 -0
  800. package/lib/esm/render/utils/index.js +10 -0
  801. package/lib/esm/render/utils/package-resolver.js +118 -0
  802. package/lib/esm/render/utils/view-scanner.js +178 -0
  803. package/lib/esm/testing/create-test-app.js +365 -0
  804. package/lib/esm/testing/create-test-database.js +411 -0
  805. package/lib/esm/testing/fluent-request.js +459 -0
  806. package/lib/esm/testing/index.js +102 -0
  807. package/lib/esm/testing/load-test.js +479 -0
  808. package/lib/esm/testing/matchers.js +440 -0
  809. package/lib/esm/testing/mock-context.js +400 -0
  810. package/lib/esm/testing/mock-provider.js +333 -0
  811. package/lib/esm/testing/snapshot-request.js +358 -0
  812. package/lib/esm/testing/testing.interfaces.js +9 -0
  813. package/lib/esm/types/application/application-container.d.ts +352 -0
  814. package/lib/esm/types/application/application-factory.d.ts +124 -0
  815. package/lib/esm/types/application/application.types.d.ts +185 -0
  816. package/lib/esm/types/application/bootstrap.d.ts +656 -0
  817. package/lib/esm/types/application/index.d.ts +4 -0
  818. package/lib/esm/types/authorization/authorization-config.interface.d.ts +45 -0
  819. package/lib/esm/types/authorization/decorators/convenience.d.ts +64 -0
  820. package/lib/esm/types/authorization/guard-constants.d.ts +9 -0
  821. package/lib/esm/types/authorization/guard-decorators.d.ts +128 -0
  822. package/lib/esm/types/authorization/guard-executor.d.ts +26 -0
  823. package/lib/esm/types/authorization/guard-registry.d.ts +35 -0
  824. package/lib/esm/types/authorization/guard.interface.d.ts +335 -0
  825. package/lib/esm/types/authorization/guards/attribute-based.guard.d.ts +60 -0
  826. package/lib/esm/types/authorization/guards/authenticated.guard.d.ts +26 -0
  827. package/lib/esm/types/authorization/guards/composition.guard.d.ts +42 -0
  828. package/lib/esm/types/authorization/guards/conditional.guard.d.ts +21 -0
  829. package/lib/esm/types/authorization/guards/index.d.ts +7 -0
  830. package/lib/esm/types/authorization/guards/permission.guard.d.ts +29 -0
  831. package/lib/esm/types/authorization/guards/resource-owner.guard.d.ts +29 -0
  832. package/lib/esm/types/authorization/guards/role.guard.d.ts +28 -0
  833. package/lib/esm/types/authorization/index.d.ts +18 -0
  834. package/lib/esm/types/authorization/services/guard-cache.d.ts +26 -0
  835. package/lib/esm/types/authorization/services/guard-cache.interface.d.ts +29 -0
  836. package/lib/esm/types/authorization/services/permission-hierarchy.d.ts +21 -0
  837. package/lib/esm/types/authorization/services/permission-hierarchy.interface.d.ts +22 -0
  838. package/lib/esm/types/authorization/services/permission-service.d.ts +21 -0
  839. package/lib/esm/types/authorization/services/permission-service.interface.d.ts +19 -0
  840. package/lib/esm/types/authorization/services/security-context.d.ts +32 -0
  841. package/lib/esm/types/authorization/services/security-context.interface.d.ts +25 -0
  842. package/lib/esm/types/authorization/setup.d.ts +84 -0
  843. package/lib/esm/types/config/config-resolver.d.ts +40 -0
  844. package/lib/esm/types/config/config.interfaces.d.ts +576 -0
  845. package/lib/esm/types/config/define-config.d.ts +109 -0
  846. package/lib/esm/types/config/env-field-builders.d.ts +327 -0
  847. package/lib/esm/types/config/index.d.ts +61 -0
  848. package/lib/esm/types/config/secret-value.d.ts +99 -0
  849. package/lib/esm/types/console/color-codes.d.ts +29 -0
  850. package/lib/esm/types/console/console.d.ts +83 -0
  851. package/lib/esm/types/console/index.d.ts +2 -0
  852. package/lib/esm/types/container-module/container-module.d.ts +242 -0
  853. package/lib/esm/types/container-module/index.d.ts +1 -0
  854. package/lib/esm/types/decorator/index.d.ts +1 -0
  855. package/lib/esm/types/decorator/scope-binding.d.ts +374 -0
  856. package/lib/esm/types/di/annotation/decorator_utils.d.ts +16 -0
  857. package/lib/esm/types/di/annotation/inject.d.ts +16 -0
  858. package/lib/esm/types/di/annotation/inject_base.d.ts +3 -0
  859. package/lib/esm/types/di/annotation/injectable.d.ts +7 -0
  860. package/lib/esm/types/di/annotation/lazy_service_identifier.d.ts +7 -0
  861. package/lib/esm/types/di/annotation/multi_inject.d.ts +2 -0
  862. package/lib/esm/types/di/annotation/named.d.ts +2 -0
  863. package/lib/esm/types/di/annotation/optional.d.ts +2 -0
  864. package/lib/esm/types/di/annotation/post_construct.d.ts +4 -0
  865. package/lib/esm/types/di/annotation/pre_destroy.d.ts +4 -0
  866. package/lib/esm/types/di/annotation/property_event_decorator.d.ts +4 -0
  867. package/lib/esm/types/di/annotation/tagged.d.ts +2 -0
  868. package/lib/esm/types/di/annotation/target_name.d.ts +3 -0
  869. package/lib/esm/types/di/annotation/unmanaged.d.ts +3 -0
  870. package/lib/esm/types/di/binding-decorator/constants.d.ts +7 -0
  871. package/lib/esm/types/di/binding-decorator/decorator/fluent_provide.d.ts +4 -0
  872. package/lib/esm/types/di/binding-decorator/decorator/provide.d.ts +4 -0
  873. package/lib/esm/types/di/binding-decorator/factory/module_factory.d.ts +23 -0
  874. package/lib/esm/types/di/binding-decorator/index.d.ts +10 -0
  875. package/lib/esm/types/di/binding-decorator/interfaces/interfaces.d.ts +40 -0
  876. package/lib/esm/types/di/binding-decorator/syntax/provide_done_syntax.d.ts +7 -0
  877. package/lib/esm/types/di/binding-decorator/syntax/provide_in_syntax.d.ts +12 -0
  878. package/lib/esm/types/di/binding-decorator/syntax/provide_in_when_on_syntax.d.ts +28 -0
  879. package/lib/esm/types/di/binding-decorator/syntax/provide_on_syntax.d.ts +10 -0
  880. package/lib/esm/types/di/binding-decorator/syntax/provide_when_on_syntax.d.ts +24 -0
  881. package/lib/esm/types/di/binding-decorator/syntax/provide_when_syntax.d.ts +23 -0
  882. package/lib/esm/types/di/binding-decorator/utils/auto_wire.d.ts +3 -0
  883. package/lib/esm/types/di/bindings/binding.d.ts +20 -0
  884. package/lib/esm/types/di/bindings/binding_count.d.ts +5 -0
  885. package/lib/esm/types/di/constants/error_msgs.d.ts +32 -0
  886. package/lib/esm/types/di/constants/literal_types.d.ts +5 -0
  887. package/lib/esm/types/di/constants/metadata_keys.d.ts +13 -0
  888. package/lib/esm/types/di/container/container.d.ts +73 -0
  889. package/lib/esm/types/di/container/container_module.d.ts +11 -0
  890. package/lib/esm/types/di/container/container_snapshot.d.ts +10 -0
  891. package/lib/esm/types/di/container/lookup.d.ts +16 -0
  892. package/lib/esm/types/di/container/module_activation_store.d.ts +10 -0
  893. package/lib/esm/types/di/container-introspection.d.ts +25 -0
  894. package/lib/esm/types/di/interfaces/interfaces.d.ts +300 -0
  895. package/lib/esm/types/di/inversify.d.ts +54 -0
  896. package/lib/esm/types/di/planning/context.d.ts +11 -0
  897. package/lib/esm/types/di/planning/metadata.d.ts +8 -0
  898. package/lib/esm/types/di/planning/metadata_reader.d.ts +6 -0
  899. package/lib/esm/types/di/planning/plan.d.ts +7 -0
  900. package/lib/esm/types/di/planning/planner.d.ts +5 -0
  901. package/lib/esm/types/di/planning/queryable_string.d.ts +11 -0
  902. package/lib/esm/types/di/planning/reflection_utils.d.ts +5 -0
  903. package/lib/esm/types/di/planning/request.d.ts +14 -0
  904. package/lib/esm/types/di/planning/target.d.ts +23 -0
  905. package/lib/esm/types/di/resolution/instantiation.d.ts +3 -0
  906. package/lib/esm/types/di/resolution/resolver.d.ts +3 -0
  907. package/lib/esm/types/di/scope/scope-registry.d.ts +91 -0
  908. package/lib/esm/types/di/scope/scope.d.ts +3 -0
  909. package/lib/esm/types/di/syntax/binding_in_syntax.d.ts +10 -0
  910. package/lib/esm/types/di/syntax/binding_in_when_on_syntax.d.ts +30 -0
  911. package/lib/esm/types/di/syntax/binding_on_syntax.d.ts +8 -0
  912. package/lib/esm/types/di/syntax/binding_to_syntax.d.ts +18 -0
  913. package/lib/esm/types/di/syntax/binding_when_on_syntax.d.ts +25 -0
  914. package/lib/esm/types/di/syntax/binding_when_syntax.d.ts +21 -0
  915. package/lib/esm/types/di/syntax/constraint_helpers.d.ts +6 -0
  916. package/lib/esm/types/di/utils/async.d.ts +3 -0
  917. package/lib/esm/types/di/utils/binding_utils.d.ts +4 -0
  918. package/lib/esm/types/di/utils/clonable.d.ts +3 -0
  919. package/lib/esm/types/di/utils/exceptions.d.ts +2 -0
  920. package/lib/esm/types/di/utils/factory_type.d.ts +5 -0
  921. package/lib/esm/types/di/utils/id.d.ts +2 -0
  922. package/lib/esm/types/di/utils/js.d.ts +1 -0
  923. package/lib/esm/types/di/utils/serialization.d.ts +10 -0
  924. package/lib/esm/types/error/app-error.d.ts +177 -0
  925. package/lib/esm/types/error/base-exception-filter.d.ts +73 -0
  926. package/lib/esm/types/error/error-handler-middleware.d.ts +11 -0
  927. package/lib/esm/types/error/exception-filter-constants.d.ts +9 -0
  928. package/lib/esm/types/error/exception-filter-decorators.d.ts +126 -0
  929. package/lib/esm/types/error/exception-filter-registry.d.ts +38 -0
  930. package/lib/esm/types/error/exception-filter.interface.d.ts +82 -0
  931. package/lib/esm/types/error/exception-handler-middleware.d.ts +35 -0
  932. package/lib/esm/types/error/filters/app-error.filter.d.ts +10 -0
  933. package/lib/esm/types/error/filters/global-exception.filter.d.ts +9 -0
  934. package/lib/esm/types/error/filters/not-found.filter.d.ts +10 -0
  935. package/lib/esm/types/error/filters/validation-error.filter.d.ts +10 -0
  936. package/lib/esm/types/error/index.d.ts +14 -0
  937. package/lib/esm/types/error/not-found.error.d.ts +7 -0
  938. package/lib/esm/types/error/report.d.ts +105 -0
  939. package/lib/esm/types/error/status-code.d.ts +156 -0
  940. package/lib/esm/types/error/utils.d.ts +17 -0
  941. package/lib/esm/types/error/validation.error.d.ts +8 -0
  942. package/lib/esm/types/event/event-decorators.d.ts +199 -0
  943. package/lib/esm/types/event/event-emitter.d.ts +109 -0
  944. package/lib/esm/types/event/event-flow-tracker.d.ts +88 -0
  945. package/lib/esm/types/event/event-recorder.d.ts +121 -0
  946. package/lib/esm/types/event/event-registry.d.ts +84 -0
  947. package/lib/esm/types/event/event.interfaces.d.ts +528 -0
  948. package/lib/esm/types/event/index.d.ts +55 -0
  949. package/lib/esm/types/framework-version.d.ts +7 -0
  950. package/lib/esm/types/index.d.ts +27 -0
  951. package/lib/esm/types/interceptor/conditional-interceptor.d.ts +91 -0
  952. package/lib/esm/types/interceptor/execution-context.d.ts +41 -0
  953. package/lib/esm/types/interceptor/index.d.ts +41 -0
  954. package/lib/esm/types/interceptor/interceptor-composition.d.ts +115 -0
  955. package/lib/esm/types/interceptor/interceptor-constants.d.ts +17 -0
  956. package/lib/esm/types/interceptor/interceptor-decorators.d.ts +124 -0
  957. package/lib/esm/types/interceptor/interceptor-executor.d.ts +46 -0
  958. package/lib/esm/types/interceptor/interceptor-registry.d.ts +65 -0
  959. package/lib/esm/types/interceptor/interceptor.interface.d.ts +281 -0
  960. package/lib/esm/types/interceptor/interceptors/index.d.ts +6 -0
  961. package/lib/esm/types/interceptor/interceptors/logging.interceptor.d.ts +28 -0
  962. package/lib/esm/types/interceptor/interceptors/performance.interceptor.d.ts +197 -0
  963. package/lib/esm/types/interceptor/interceptors/timeout.interceptor.d.ts +42 -0
  964. package/lib/esm/types/lazy-loading/index.d.ts +43 -0
  965. package/lib/esm/types/lazy-loading/lazy-load-metrics.d.ts +139 -0
  966. package/lib/esm/types/lazy-loading/lazy-module-helpers.d.ts +42 -0
  967. package/lib/esm/types/lazy-loading/lazy-module-loader.d.ts +169 -0
  968. package/lib/esm/types/lazy-loading/lazy-module-manager.d.ts +148 -0
  969. package/lib/esm/types/lazy-loading/lazy-module-warmup.d.ts +130 -0
  970. package/lib/esm/types/lazy-loading/lazy-module.d.ts +168 -0
  971. package/lib/esm/types/lazy-loading/lazy.interfaces.d.ts +480 -0
  972. package/lib/esm/types/lifecycle/index.d.ts +9 -0
  973. package/lib/esm/types/lifecycle/lifecycle-registry.d.ts +213 -0
  974. package/lib/esm/types/lifecycle/lifecycle.interface.d.ts +191 -0
  975. package/lib/esm/types/middleware/content-negotiation/accept-header-parser.d.ts +26 -0
  976. package/lib/esm/types/middleware/content-negotiation/content-negotiation-service.d.ts +64 -0
  977. package/lib/esm/types/middleware/content-negotiation/formatter-registry.d.ts +60 -0
  978. package/lib/esm/types/middleware/content-negotiation/formatters/csv-formatter.d.ts +34 -0
  979. package/lib/esm/types/middleware/content-negotiation/formatters/index.d.ts +8 -0
  980. package/lib/esm/types/middleware/content-negotiation/formatters/json-formatter.d.ts +14 -0
  981. package/lib/esm/types/middleware/content-negotiation/formatters/plain-text-formatter.d.ts +12 -0
  982. package/lib/esm/types/middleware/content-negotiation/formatters/xml-formatter.d.ts +26 -0
  983. package/lib/esm/types/middleware/content-negotiation/formatters/yaml-formatter.d.ts +26 -0
  984. package/lib/esm/types/middleware/content-negotiation/index.d.ts +7 -0
  985. package/lib/esm/types/middleware/index.d.ts +25 -0
  986. package/lib/esm/types/middleware/interfaces/body-parser.interface.d.ts +31 -0
  987. package/lib/esm/types/middleware/interfaces/compression.interface.d.ts +98 -0
  988. package/lib/esm/types/middleware/interfaces/content-negotiation.interface.d.ts +142 -0
  989. package/lib/esm/types/middleware/interfaces/cookie-parser.interface.d.ts +9 -0
  990. package/lib/esm/types/middleware/interfaces/cookie-session/cookie-session.interface.d.ts +57 -0
  991. package/lib/esm/types/middleware/interfaces/cookie-session/keygrip.interface.d.ts +27 -0
  992. package/lib/esm/types/middleware/interfaces/cors.interface.d.ts +57 -0
  993. package/lib/esm/types/middleware/interfaces/express-rate-limit.interface.d.ts +292 -0
  994. package/lib/esm/types/middleware/interfaces/express-session.interface.d.ts +207 -0
  995. package/lib/esm/types/middleware/interfaces/helmet.interface.d.ts +210 -0
  996. package/lib/esm/types/middleware/interfaces/morgan.interface.d.ts +39 -0
  997. package/lib/esm/types/middleware/interfaces/multer.interface.d.ts +253 -0
  998. package/lib/esm/types/middleware/interfaces/serve-favicon.interface.d.ts +11 -0
  999. package/lib/esm/types/middleware/interfaces/serve-static.interface.d.ts +69 -0
  1000. package/lib/esm/types/middleware/interfaces/url-encoded.interface.d.ts +37 -0
  1001. package/lib/esm/types/middleware/middleware-config.d.ts +574 -0
  1002. package/lib/esm/types/middleware/middleware-interface.d.ts +691 -0
  1003. package/lib/esm/types/middleware/middleware-profiler.d.ts +199 -0
  1004. package/lib/esm/types/middleware/middleware-registry.d.ts +103 -0
  1005. package/lib/esm/types/middleware/middleware-resolver.d.ts +159 -0
  1006. package/lib/esm/types/middleware/middleware-service.d.ts +788 -0
  1007. package/lib/esm/types/middleware/middleware-utils.d.ts +145 -0
  1008. package/lib/esm/types/middleware/presets-standalone.d.ts +75 -0
  1009. package/lib/esm/types/middleware/upload-registry.d.ts +50 -0
  1010. package/lib/esm/types/path-resolver/index.d.ts +80 -0
  1011. package/lib/esm/types/provider/db-in-memory/adapter/adapter.interface.d.ts +222 -0
  1012. package/lib/esm/types/provider/db-in-memory/adapter/in-memory.adapter.d.ts +241 -0
  1013. package/lib/esm/types/provider/db-in-memory/adapter/index.d.ts +6 -0
  1014. package/lib/esm/types/provider/db-in-memory/base-repo.repository.d.ts +18 -0
  1015. package/lib/esm/types/provider/db-in-memory/db-in-memory.interface.d.ts +43 -0
  1016. package/lib/esm/types/provider/db-in-memory/db-in-memory.provider.d.ts +39 -0
  1017. package/lib/esm/types/provider/db-in-memory/db-in-memory.types.d.ts +14 -0
  1018. package/lib/esm/types/provider/db-in-memory/db.provider.d.ts +281 -0
  1019. package/lib/esm/types/provider/db-in-memory/index.d.ts +71 -0
  1020. package/lib/esm/types/provider/db-in-memory/query/index.d.ts +6 -0
  1021. package/lib/esm/types/provider/db-in-memory/query/query-engine.d.ts +114 -0
  1022. package/lib/esm/types/provider/db-in-memory/query/query.types.d.ts +318 -0
  1023. package/lib/esm/types/provider/db-in-memory/schema/decorators.d.ts +328 -0
  1024. package/lib/esm/types/provider/db-in-memory/schema/entity.interface.d.ts +60 -0
  1025. package/lib/esm/types/provider/db-in-memory/schema/index.d.ts +6 -0
  1026. package/lib/esm/types/provider/db-in-memory/storage/index.d.ts +5 -0
  1027. package/lib/esm/types/provider/db-in-memory/storage/memory-store.d.ts +360 -0
  1028. package/lib/esm/types/provider/dto-validator/dto-validator.provider.d.ts +10 -0
  1029. package/lib/esm/types/provider/dto-validator/package-resolver.d.ts +7 -0
  1030. package/lib/esm/types/provider/index.d.ts +7 -0
  1031. package/lib/esm/types/provider/logger/decorators/index.d.ts +1 -0
  1032. package/lib/esm/types/provider/logger/decorators/log-performance.decorator.d.ts +49 -0
  1033. package/lib/esm/types/provider/logger/index.d.ts +17 -0
  1034. package/lib/esm/types/provider/logger/logger.banner.d.ts +94 -0
  1035. package/lib/esm/types/provider/logger/logger.config.d.ts +62 -0
  1036. package/lib/esm/types/provider/logger/logger.context.d.ts +189 -0
  1037. package/lib/esm/types/provider/logger/logger.flow.d.ts +165 -0
  1038. package/lib/esm/types/provider/logger/logger.formatter.d.ts +54 -0
  1039. package/lib/esm/types/provider/logger/logger.grouping.d.ts +124 -0
  1040. package/lib/esm/types/provider/logger/logger.health.d.ts +123 -0
  1041. package/lib/esm/types/provider/logger/logger.metrics-collector.d.ts +44 -0
  1042. package/lib/esm/types/provider/logger/logger.metrics.d.ts +162 -0
  1043. package/lib/esm/types/provider/logger/logger.performance.d.ts +179 -0
  1044. package/lib/esm/types/provider/logger/logger.provider.d.ts +363 -0
  1045. package/lib/esm/types/provider/logger/logger.query.d.ts +232 -0
  1046. package/lib/esm/types/provider/logger/logger.redaction.d.ts +169 -0
  1047. package/lib/esm/types/provider/logger/logger.suggestions.d.ts +124 -0
  1048. package/lib/esm/types/provider/logger/transports/console.transport.d.ts +56 -0
  1049. package/lib/esm/types/provider/logger/transports/file.transport.d.ts +87 -0
  1050. package/lib/esm/types/provider/logger/transports/http-server.d.ts +88 -0
  1051. package/lib/esm/types/provider/logger/transports/http.transport.d.ts +74 -0
  1052. package/lib/esm/types/provider/logger/transports/index.d.ts +5 -0
  1053. package/lib/esm/types/provider/logger/transports/transport.interface.d.ts +31 -0
  1054. package/lib/esm/types/provider/logger/utils/index.d.ts +2 -0
  1055. package/lib/esm/types/provider/logger/utils/log-entry.d.ts +82 -0
  1056. package/lib/esm/types/provider/logger/utils/log-levels.d.ts +53 -0
  1057. package/lib/esm/types/provider/provider-manager.d.ts +208 -0
  1058. package/lib/esm/types/provider/provider-registry.d.ts +192 -0
  1059. package/lib/esm/types/provider/provider.interface.d.ts +337 -0
  1060. package/lib/esm/types/provider/validation/adapters/class-validator.adapter.d.ts +68 -0
  1061. package/lib/esm/types/provider/validation/adapters/index.d.ts +13 -0
  1062. package/lib/esm/types/provider/validation/adapters/yup.adapter.d.ts +65 -0
  1063. package/lib/esm/types/provider/validation/adapters/zod.adapter.d.ts +84 -0
  1064. package/lib/esm/types/provider/validation/helpful-error-formatter.d.ts +110 -0
  1065. package/lib/esm/types/provider/validation/index.d.ts +19 -0
  1066. package/lib/esm/types/provider/validation/smart-field-detector.d.ts +91 -0
  1067. package/lib/esm/types/provider/validation/type-inference.d.ts +81 -0
  1068. package/lib/esm/types/provider/validation/validation-registry.d.ts +105 -0
  1069. package/lib/esm/types/provider/validation/validation.interface.d.ts +178 -0
  1070. package/lib/esm/types/render/adapters/base-adapter.d.ts +95 -0
  1071. package/lib/esm/types/render/adapters/ejs-adapter.d.ts +57 -0
  1072. package/lib/esm/types/render/adapters/handlebars-adapter.d.ts +74 -0
  1073. package/lib/esm/types/render/adapters/index.d.ts +12 -0
  1074. package/lib/esm/types/render/adapters/pug-adapter.d.ts +57 -0
  1075. package/lib/esm/types/render/adapters/react-adapter.d.ts +99 -0
  1076. package/lib/esm/types/render/features/auto-detection.d.ts +58 -0
  1077. package/lib/esm/types/render/features/hot-reload.d.ts +65 -0
  1078. package/lib/esm/types/render/features/index.d.ts +12 -0
  1079. package/lib/esm/types/render/features/streaming.d.ts +39 -0
  1080. package/lib/esm/types/render/features/type-generator.d.ts +64 -0
  1081. package/lib/esm/types/render/features/view-debugger.d.ts +52 -0
  1082. package/lib/esm/types/render/index.d.ts +50 -0
  1083. package/lib/esm/types/render/presets/index.d.ts +119 -0
  1084. package/lib/esm/types/render/render-config.d.ts +213 -0
  1085. package/lib/esm/types/render/render-interface.d.ts +126 -0
  1086. package/lib/esm/types/render/render-registry.d.ts +86 -0
  1087. package/lib/esm/types/render/render-service.d.ts +157 -0
  1088. package/lib/esm/types/render/utils/cache-manager.d.ts +106 -0
  1089. package/lib/esm/types/render/utils/index.d.ts +11 -0
  1090. package/lib/esm/types/render/utils/package-resolver.d.ts +57 -0
  1091. package/lib/esm/types/render/utils/view-scanner.d.ts +74 -0
  1092. package/lib/esm/types/testing/create-test-app.d.ts +71 -0
  1093. package/lib/esm/types/testing/create-test-database.d.ts +100 -0
  1094. package/lib/esm/types/testing/fluent-request.d.ts +37 -0
  1095. package/lib/esm/types/testing/index.d.ts +93 -0
  1096. package/lib/esm/types/testing/load-test.d.ts +139 -0
  1097. package/lib/esm/types/testing/matchers.d.ts +184 -0
  1098. package/lib/esm/types/testing/mock-context.d.ts +117 -0
  1099. package/lib/esm/types/testing/mock-provider.d.ts +93 -0
  1100. package/lib/esm/types/testing/snapshot-request.d.ts +46 -0
  1101. package/lib/esm/types/testing/testing.interfaces.d.ts +973 -0
  1102. package/lib/esm/types/utils/node-require.d.ts +11 -0
  1103. package/lib/esm/utils/node-require.js +56 -0
  1104. package/lib/package.json +167 -151
  1105. package/package.json +167 -151
  1106. package/lib/cjs/provider/environment/env-validator.provider.js +0 -100
  1107. package/lib/cjs/types/provider/environment/env-validator.provider.d.ts +0 -39
@@ -0,0 +1,691 @@
1
+ import { LogLevel, logLevelToString } from "./utils/log-levels.js";
2
+ import { colorCodes } from "../../console/color-codes.js";
3
+ import { getGlobalRedactor } from "./logger.redaction.js";
4
+ /**
5
+ * Strip ANSI escape sequences (SGR colors, cursor moves, etc.) from a
6
+ * string. Cheap fast-path bails out when no escape character is present.
7
+ */
8
+ // eslint-disable-next-line no-control-regex
9
+ const ANSI_ESCAPE_REGEX = /\u001b\[[\d;?]*[ -/]*[@-~]/g;
10
+ function stripAnsiEscapes(input) {
11
+ if (!input || input.indexOf("\u001b") === -1)
12
+ return input;
13
+ return input.replace(ANSI_ESCAPE_REGEX, "");
14
+ }
15
+ /**
16
+ * Format log entry for development (human-readable, colored).
17
+ * @param entry - Log entry to format
18
+ * @param options - Formatting options (redaction, etc.)
19
+ * @returns Formatted string
20
+ * @public API
21
+ */
22
+ export function formatDev(entry, options) {
23
+ // Apply redaction if enabled
24
+ const processedEntry = applyRedaction(entry, options);
25
+ const timestamp = formatTimestamp(processedEntry.timestamp);
26
+ const level = logLevelToString(processedEntry.level);
27
+ const levelColor = getLevelColor(processedEntry.level);
28
+ const coloredLevel = colorText(level.padEnd(5, " "), levelColor);
29
+ const coloredContext = processedEntry.context
30
+ ? colorText(`[${processedEntry.context}]`, "green")
31
+ : "";
32
+ const coloredMessage = colorText(processedEntry.message, levelColor);
33
+ let output = `${colorText("[ExpressoTS]", "green")} ${timestamp}`;
34
+ if (processedEntry.pid) {
35
+ output += ` ${colorText(`[PID:${processedEntry.pid}]`, "green")}`;
36
+ }
37
+ output += ` ${coloredLevel} ${coloredContext} ${coloredMessage}\n`;
38
+ // Add structured data if present
39
+ if (processedEntry.data) {
40
+ output += formatData(processedEntry.data, levelColor, 2);
41
+ }
42
+ // Add error details if present
43
+ if (processedEntry.error) {
44
+ output += formatError(processedEntry.error, 2);
45
+ }
46
+ // Add trace information if present
47
+ if (processedEntry.trace) {
48
+ output += formatTrace(processedEntry.trace, 2);
49
+ }
50
+ // Add performance data if present
51
+ if (processedEntry.performance) {
52
+ output += formatPerformance(processedEntry.performance, 2);
53
+ }
54
+ // Add flow visualization if present
55
+ if (processedEntry.flow) {
56
+ output += formatFlow(processedEntry.flow, 2);
57
+ }
58
+ // Strip ANSI escapes once at the end when colors are disabled. This is
59
+ // far simpler than threading a "useColors" flag through every nested
60
+ // `colorText(...)` call site and the perf cost (one regex pass over a
61
+ // log line) is negligible relative to the I/O that follows.
62
+ if (options?.colors === false) {
63
+ return stripAnsiEscapes(output);
64
+ }
65
+ return output;
66
+ }
67
+ /**
68
+ * Format log entry for production (JSON structured).
69
+ * @param entry - Log entry to format
70
+ * @param options - Formatting options (redaction, etc.)
71
+ * @returns JSON string
72
+ * @public API
73
+ */
74
+ export function formatProd(entry, options) {
75
+ // Apply redaction if enabled (especially important for production!)
76
+ const processedEntry = applyRedaction(entry, options);
77
+ const jsonEntry = {
78
+ timestamp: processedEntry.timestamp.toISOString(),
79
+ level: logLevelToString(processedEntry.level),
80
+ message: processedEntry.message,
81
+ };
82
+ if (processedEntry.context) {
83
+ jsonEntry.context = processedEntry.context;
84
+ }
85
+ if (processedEntry.pid) {
86
+ jsonEntry.pid = processedEntry.pid;
87
+ }
88
+ if (processedEntry.data) {
89
+ jsonEntry.data = processedEntry.data;
90
+ }
91
+ if (processedEntry.error) {
92
+ jsonEntry.error = formatErrorForJson(processedEntry.error);
93
+ }
94
+ if (processedEntry.trace) {
95
+ jsonEntry.trace = processedEntry.trace;
96
+ }
97
+ if (processedEntry.performance) {
98
+ jsonEntry.performance = processedEntry.performance;
99
+ }
100
+ if (processedEntry.metadata) {
101
+ jsonEntry.metadata = processedEntry.metadata;
102
+ }
103
+ if (processedEntry.flow) {
104
+ jsonEntry.flow = processedEntry.flow;
105
+ }
106
+ return JSON.stringify(jsonEntry);
107
+ }
108
+ /**
109
+ * Format timestamp for display.
110
+ */
111
+ function formatTimestamp(date) {
112
+ const options = {
113
+ year: "numeric",
114
+ month: "2-digit",
115
+ day: "2-digit",
116
+ hour: "2-digit",
117
+ minute: "2-digit",
118
+ second: "2-digit",
119
+ };
120
+ return date.toLocaleString(undefined, options).replace(",", "");
121
+ }
122
+ /**
123
+ * Get color for log level.
124
+ */
125
+ function getLevelColor(level) {
126
+ switch (level) {
127
+ case LogLevel.ALL:
128
+ return "white";
129
+ case LogLevel.DEBUG:
130
+ return "blue";
131
+ case LogLevel.INFO:
132
+ return "blue";
133
+ case LogLevel.WARN:
134
+ return "yellow";
135
+ case LogLevel.ERROR:
136
+ case LogLevel.FATAL:
137
+ return "red";
138
+ default:
139
+ return "none";
140
+ }
141
+ }
142
+ /**
143
+ * Apply color to text.
144
+ */
145
+ function colorText(text, color) {
146
+ return `${colorCodes[color]}${text}\x1b[0m`;
147
+ }
148
+ /**
149
+ * Format structured data with indentation.
150
+ */
151
+ function formatData(data, color, indent) {
152
+ const indentStr = " ".repeat(indent);
153
+ const prefix = `${indentStr}├─ `;
154
+ if (typeof data === "object" && data !== null) {
155
+ if (Array.isArray(data)) {
156
+ return `${prefix}${colorText(`Array(${data.length})`, color)}\n`;
157
+ }
158
+ const entries = Object.entries(data);
159
+ if (entries.length === 0) {
160
+ return "";
161
+ }
162
+ let output = "";
163
+ entries.forEach(([key, value], index) => {
164
+ const isLast = index === entries.length - 1;
165
+ const connector = isLast ? "└─" : "├─";
166
+ const valueStr = formatValue(value, color);
167
+ output += `${indentStr}${connector} ${key}: ${valueStr}\n`;
168
+ });
169
+ return output;
170
+ }
171
+ return `${prefix}${colorText(String(data), color)}\n`;
172
+ }
173
+ /**
174
+ * Format a value for display.
175
+ */
176
+ function formatValue(value, color) {
177
+ if (value === null) {
178
+ return colorText("null", "none");
179
+ }
180
+ if (value === undefined) {
181
+ return colorText("undefined", "none");
182
+ }
183
+ if (typeof value === "string") {
184
+ return colorText(`"${value}"`, color);
185
+ }
186
+ if (typeof value === "number" || typeof value === "boolean") {
187
+ return colorText(String(value), color);
188
+ }
189
+ if (typeof value === "object") {
190
+ if (Array.isArray(value)) {
191
+ return colorText(`[${value.length} items]`, color);
192
+ }
193
+ return colorText(`{${Object.keys(value).length} keys}`, color);
194
+ }
195
+ return colorText(String(value), color);
196
+ }
197
+ /**
198
+ * Format error for display.
199
+ */
200
+ function formatError(error, indent) {
201
+ const indentStr = " ".repeat(indent);
202
+ let output = "";
203
+ if (error instanceof Error) {
204
+ output += `${indentStr}├─ ${colorText("Error:", "red")} ${colorText(error.name, "red")}\n`;
205
+ output += `${indentStr}├─ ${colorText("Message:", "red")} ${colorText(error.message, "red")}\n`;
206
+ if (error.stack) {
207
+ const stackLines = error.stack.split("\n").slice(1); // Skip first line (already shown)
208
+ if (stackLines.length > 0) {
209
+ output += `${indentStr}└─ ${colorText("Stack:", "red")}\n`;
210
+ stackLines.slice(0, 5).forEach((line) => {
211
+ output += `${indentStr} ${colorText(line.trim(), "none")}\n`;
212
+ });
213
+ if (stackLines.length > 5) {
214
+ output += `${indentStr} ${colorText(`... and ${stackLines.length - 5} more`, "none")}\n`;
215
+ }
216
+ }
217
+ }
218
+ }
219
+ else {
220
+ output += `${indentStr}└─ ${colorText(String(error), "red")}\n`;
221
+ }
222
+ return output;
223
+ }
224
+ /**
225
+ * Format error for JSON output.
226
+ */
227
+ function formatErrorForJson(error) {
228
+ if (error instanceof Error) {
229
+ return {
230
+ name: error.name,
231
+ message: error.message,
232
+ stack: error.stack,
233
+ };
234
+ }
235
+ return {
236
+ message: String(error),
237
+ };
238
+ }
239
+ /**
240
+ * Format trace information.
241
+ */
242
+ function formatTrace(trace, indent) {
243
+ const indentStr = " ".repeat(indent);
244
+ let output = `${indentStr}├─ ${colorText("Trace:", "blue")}\n`;
245
+ Object.entries(trace).forEach(([key, value], index, entries) => {
246
+ const isLast = index === entries.length - 1;
247
+ const connector = isLast ? "└─" : "├─";
248
+ output += `${indentStr} ${connector} ${key}: ${colorText(String(value), "blue")}\n`;
249
+ });
250
+ return output;
251
+ }
252
+ /**
253
+ * Format performance data.
254
+ */
255
+ function formatPerformance(perf, indent) {
256
+ const indentStr = " ".repeat(indent);
257
+ let output = `${indentStr}├─ ${colorText("Performance:", "yellow")}\n`;
258
+ if (perf.duration !== undefined) {
259
+ output += `${indentStr} ├─ Duration: ${colorText(`${perf.duration}ms`, "yellow")}\n`;
260
+ }
261
+ if (perf.memoryDelta !== undefined) {
262
+ const mb = (perf.memoryDelta / 1024 / 1024).toFixed(2);
263
+ output += `${indentStr} ├─ Memory: ${colorText(`${mb}MB`, "yellow")}\n`;
264
+ }
265
+ if (perf.cpuUsage !== undefined) {
266
+ output += `${indentStr} └─ CPU: ${colorText(`${perf.cpuUsage}%`, "yellow")}\n`;
267
+ }
268
+ else if (perf.duration !== undefined || perf.memoryDelta !== undefined) {
269
+ output = output.replace(/├─/g, "└─").replace(/├─/g, "├─");
270
+ }
271
+ return output;
272
+ }
273
+ /**
274
+ * Apply redaction to a log entry if enabled.
275
+ * @param entry - Log entry to process
276
+ * @param options - Format options with redaction settings
277
+ * @returns Processed entry with sensitive data redacted
278
+ */
279
+ function applyRedaction(entry, options) {
280
+ // If redaction is explicitly disabled, return original entry
281
+ if (options?.redact === false) {
282
+ return entry;
283
+ }
284
+ // Get redactor (custom or global)
285
+ const redactor = options?.redactor ?? getGlobalRedactor();
286
+ // Create a shallow copy and redact relevant fields
287
+ const processedEntry = {
288
+ ...entry,
289
+ message: redactor.redactString(entry.message),
290
+ };
291
+ // Redact data object if present
292
+ if (entry.data) {
293
+ processedEntry.data = redactor.redact(entry.data);
294
+ }
295
+ // Redact metadata if present
296
+ if (entry.metadata) {
297
+ processedEntry.metadata = redactor.redact(entry.metadata);
298
+ }
299
+ // Redact trace if present
300
+ if (entry.trace) {
301
+ processedEntry.trace = redactor.redact(entry.trace);
302
+ }
303
+ return processedEntry;
304
+ }
305
+ /**
306
+ * Format a grouped log entry for development output.
307
+ * @param groupedEntry - Grouped log entry
308
+ * @param options - Formatting options
309
+ * @returns Formatted string
310
+ * @public API
311
+ */
312
+ export function formatGroupedDev(groupedEntry, options) {
313
+ const entry = groupedEntry.representative;
314
+ const processedEntry = applyRedaction(entry, options);
315
+ const timestamp = formatTimestamp(processedEntry.timestamp);
316
+ const level = logLevelToString(processedEntry.level);
317
+ const levelColor = getLevelColor(processedEntry.level);
318
+ const coloredLevel = colorText(level.padEnd(5, " "), levelColor);
319
+ const coloredContext = processedEntry.context
320
+ ? colorText(`[${processedEntry.context}]`, "green")
321
+ : "";
322
+ // Format time range
323
+ const timeRange = formatTimeRange(groupedEntry.firstOccurrence, groupedEntry.lastOccurrence);
324
+ // Format grouped message
325
+ const groupedMessage = colorText(`[GROUPED ×${groupedEntry.count}] ${processedEntry.message}`, levelColor);
326
+ const timeRangeText = colorText(`(${timeRange})`, "yellow");
327
+ let output = `${colorText("[ExpressoTS]", "green")} ${timestamp}`;
328
+ if (processedEntry.pid) {
329
+ output += ` ${colorText(`[PID:${processedEntry.pid}]`, "green")}`;
330
+ }
331
+ output += ` ${coloredLevel} ${coloredContext} ${groupedMessage} ${timeRangeText}\n`;
332
+ // Show first occurrence details
333
+ output += ` ├─ First: ${formatTimestamp(groupedEntry.firstOccurrence)}\n`;
334
+ output += ` ├─ Last: ${formatTimestamp(groupedEntry.lastOccurrence)}\n`;
335
+ output += ` └─ Count: ${colorText(`${groupedEntry.count} occurrences`, "yellow")}\n`;
336
+ // Optionally show sample entries (first, middle, last)
337
+ if (groupedEntry.entries.length > 1) {
338
+ const sampleIndices = [
339
+ 0,
340
+ Math.floor(groupedEntry.entries.length / 2),
341
+ groupedEntry.entries.length - 1,
342
+ ].filter((idx, i, arr) => arr.indexOf(idx) === i); // Unique indices
343
+ if (sampleIndices.length > 1) {
344
+ output += ` └─ Sample entries:\n`;
345
+ for (const idx of sampleIndices) {
346
+ const sample = groupedEntry.entries[idx];
347
+ const sampleTime = formatTimestamp(sample.timestamp);
348
+ output += ` ${idx === 0 ? "├" : idx === sampleIndices[sampleIndices.length - 1] ? "└" : "├"}─ [${sampleTime}] ${sample.message}\n`;
349
+ }
350
+ }
351
+ }
352
+ if (options?.colors === false) {
353
+ return stripAnsiEscapes(output);
354
+ }
355
+ return output;
356
+ }
357
+ /**
358
+ * Format a grouped log entry for production (JSON).
359
+ * @param groupedEntry - Grouped log entry
360
+ * @param options - Formatting options
361
+ * @returns JSON string
362
+ * @public API
363
+ */
364
+ export function formatGroupedProd(groupedEntry, options) {
365
+ const entry = groupedEntry.representative;
366
+ const processedEntry = applyRedaction(entry, options);
367
+ const jsonEntry = {
368
+ timestamp: processedEntry.timestamp.toISOString(),
369
+ level: logLevelToString(processedEntry.level),
370
+ message: processedEntry.message,
371
+ grouped: true,
372
+ count: groupedEntry.count,
373
+ firstOccurrence: groupedEntry.firstOccurrence.toISOString(),
374
+ lastOccurrence: groupedEntry.lastOccurrence.toISOString(),
375
+ timeRange: formatTimeRange(groupedEntry.firstOccurrence, groupedEntry.lastOccurrence),
376
+ };
377
+ if (processedEntry.context) {
378
+ jsonEntry.context = processedEntry.context;
379
+ }
380
+ if (processedEntry.pid) {
381
+ jsonEntry.pid = processedEntry.pid;
382
+ }
383
+ if (processedEntry.data) {
384
+ jsonEntry.data = processedEntry.data;
385
+ }
386
+ if (processedEntry.error) {
387
+ jsonEntry.error = formatErrorForJson(processedEntry.error);
388
+ }
389
+ if (processedEntry.trace) {
390
+ jsonEntry.trace = processedEntry.trace;
391
+ }
392
+ if (processedEntry.performance) {
393
+ jsonEntry.performance = processedEntry.performance;
394
+ }
395
+ // Include sample entries
396
+ if (groupedEntry.entries.length > 0) {
397
+ const sampleIndices = [
398
+ 0,
399
+ Math.floor(groupedEntry.entries.length / 2),
400
+ groupedEntry.entries.length - 1,
401
+ ].filter((idx, i, arr) => arr.indexOf(idx) === i);
402
+ jsonEntry.sampleEntries = sampleIndices.map((idx) => ({
403
+ timestamp: groupedEntry.entries[idx].timestamp.toISOString(),
404
+ message: groupedEntry.entries[idx].message,
405
+ }));
406
+ }
407
+ return JSON.stringify(jsonEntry);
408
+ }
409
+ /**
410
+ * Format time range between two dates.
411
+ * @param start - Start date
412
+ * @param end - End date
413
+ * @returns Formatted time range string
414
+ */
415
+ function formatTimeRange(start, end) {
416
+ const diffMs = end.getTime() - start.getTime();
417
+ if (diffMs < 1000) {
418
+ return `${diffMs}ms`;
419
+ }
420
+ if (diffMs < 60000) {
421
+ return `${(diffMs / 1000).toFixed(1)}s`;
422
+ }
423
+ return `${(diffMs / 60000).toFixed(1)}m`;
424
+ }
425
+ /**
426
+ * Format request flow visualization for development (ASCII tree).
427
+ * @param flow - Request flow data
428
+ * @param indent - Indentation level
429
+ * @returns Formatted ASCII visualization string
430
+ */
431
+ function formatFlow(flow, indent) {
432
+ const indentStr = " ".repeat(indent);
433
+ const boxWidth = 65; // Increased to accommodate longer controller/method names
434
+ const title = "Request Flow Visualization";
435
+ let output = `\n${indentStr}${colorText("╔" + "═".repeat(boxWidth) + "╗", "blue")}\n`;
436
+ // Title - center aligned
437
+ const titlePlainLength = title.length;
438
+ const titlePadding = Math.max(0, Math.floor((boxWidth - titlePlainLength) / 2));
439
+ const titleRightPadding = boxWidth - titlePlainLength - titlePadding;
440
+ output += `${indentStr}${colorText("║", "blue")}${" ".repeat(titlePadding)}${colorText(title, "blue")}${" ".repeat(titleRightPadding)}${colorText("║", "blue")}\n`;
441
+ output += `${indentStr}${colorText("╠" + "═".repeat(boxWidth) + "╣", "blue")}\n`;
442
+ // Request info - left aligned
443
+ const methodPath = `${flow.method} ${flow.path}`;
444
+ const methodPathPlainLength = methodPath.length;
445
+ const methodPathPadding = boxWidth - methodPathPlainLength - 1;
446
+ output += `${indentStr}${colorText("║", "blue")} ${colorText(methodPath, "white")}${" ".repeat(methodPathPadding)}${colorText("║", "blue")}\n`;
447
+ const requestIdText = `Request ID: `;
448
+ const requestIdValue = flow.requestId;
449
+ const requestIdPlainLength = requestIdText.length + requestIdValue.length;
450
+ const requestIdPadding = boxWidth - requestIdPlainLength - 1;
451
+ output += `${indentStr}${colorText("║", "blue")} ${requestIdText}${colorText(requestIdValue, "yellow")}${" ".repeat(requestIdPadding)}${colorText("║", "blue")}\n`;
452
+ output += `${indentStr}${colorText("╠" + "═".repeat(boxWidth) + "╣", "blue")}\n`;
453
+ // Flow steps - render inside box
454
+ if (flow.steps.length === 0) {
455
+ const noStepsMsg = "No steps tracked";
456
+ const noStepsPlainLength = noStepsMsg.length;
457
+ const noStepsPadding = Math.max(0, Math.floor((boxWidth - noStepsPlainLength) / 2));
458
+ const noStepsRightPadding = boxWidth - noStepsPlainLength - noStepsPadding;
459
+ output += `${indentStr}${colorText("║", "blue")}${" ".repeat(noStepsPadding)}${colorText(noStepsMsg, "yellow")}${" ".repeat(noStepsRightPadding)}${colorText("║", "blue")}\n`;
460
+ }
461
+ else {
462
+ // Render steps as tree structure inside box
463
+ flow.steps.forEach((step, index) => {
464
+ const isLast = index === flow.steps.length - 1;
465
+ const stepOutput = formatFlowStep(step, 0, isLast);
466
+ // Split into lines and wrap each line in box borders
467
+ const stepLines = stepOutput
468
+ .split("\n")
469
+ .filter((line) => line.trim().length > 0);
470
+ stepLines.forEach((line) => {
471
+ // Remove ANSI codes for length calculation, but keep them in the output
472
+ // eslint-disable-next-line no-control-regex
473
+ const plainLine = line.replace(/\x1b\[[0-9;]*m/g, "");
474
+ const maxLineLength = boxWidth - 1; // Account for space after border
475
+ // Truncate if too long
476
+ let displayPlainLine = plainLine;
477
+ let displayLine = line;
478
+ if (plainLine.length > maxLineLength) {
479
+ // Simple truncation - preserve colors by truncating plain text version
480
+ displayPlainLine = plainLine.substring(0, maxLineLength - 3) + "...";
481
+ // For display, we'll use the plain text truncated version
482
+ // (colors will be lost on truncated part, but box will be correct)
483
+ displayLine = displayPlainLine;
484
+ }
485
+ const padding = Math.max(0, boxWidth - displayPlainLine.length - 1);
486
+ output += `${indentStr}${colorText("║", "blue")} ${displayLine}${" ".repeat(padding)}${colorText("║", "blue")}\n`;
487
+ });
488
+ });
489
+ }
490
+ // Summary
491
+ output += `${indentStr}${colorText("╠" + "═".repeat(boxWidth) + "╣", "blue")}\n`;
492
+ // Total Duration - left aligned
493
+ const durationValue = `${flow.totalDuration.toFixed(2)}ms`;
494
+ const durationText = "Total Duration: ";
495
+ const durationPlainLength = durationText.length + durationValue.length;
496
+ const durationPadding = boxWidth - durationPlainLength - 1;
497
+ output += `${indentStr}${colorText("║", "blue")} ${durationText}${colorText(durationValue, "yellow")}${" ".repeat(durationPadding)}${colorText("║", "blue")}\n`;
498
+ if (flow.statusCode !== undefined) {
499
+ const statusColor = flow.statusCode >= 400
500
+ ? "red"
501
+ : flow.statusCode >= 300
502
+ ? "yellow"
503
+ : "green";
504
+ const statusCodeStr = String(flow.statusCode);
505
+ const statusText = "Status Code: ";
506
+ const statusPlainLength = statusText.length + statusCodeStr.length;
507
+ const statusPadding = boxWidth - statusPlainLength - 1;
508
+ output += `${indentStr}${colorText("║", "blue")} ${statusText}${colorText(statusCodeStr, statusColor)}${" ".repeat(statusPadding)}${colorText("║", "blue")}\n`;
509
+ }
510
+ if (flow.memoryDelta !== 0) {
511
+ const memoryMB = (flow.memoryDelta / 1024 / 1024).toFixed(2);
512
+ const memoryMBNum = parseFloat(memoryMB);
513
+ const memoryColor = flow.memoryDelta > 0 ? "yellow" : "green";
514
+ const memoryValue = `${memoryMBNum > 0 ? "+" : ""}${memoryMB}MB`;
515
+ const memoryText = "Memory Delta: ";
516
+ const memoryPlainLength = memoryText.length + memoryValue.length;
517
+ const memoryPadding = boxWidth - memoryPlainLength - 1;
518
+ output += `${indentStr}${colorText("║", "blue")} ${memoryText}${colorText(memoryValue, memoryColor)}${" ".repeat(memoryPadding)}${colorText("║", "blue")}\n`;
519
+ }
520
+ if (flow.error) {
521
+ const maxErrorLength = boxWidth - 8; // "Error: " = 7 chars + 1 space
522
+ const errorMsg = flow.error.message.length > maxErrorLength
523
+ ? flow.error.message.substring(0, maxErrorLength - 3) + "..."
524
+ : flow.error.message;
525
+ const errorText = "Error: ";
526
+ const errorPlainLength = errorText.length + errorMsg.length;
527
+ const errorPadding = boxWidth - errorPlainLength - 1;
528
+ output += `${indentStr}${colorText("║", "blue")} ${errorText}${colorText(errorMsg, "red")}${" ".repeat(errorPadding)}${colorText("║", "blue")}\n`;
529
+ }
530
+ output += `${indentStr}${colorText("╚" + "═".repeat(boxWidth) + "╝", "blue")}\n`;
531
+ return output;
532
+ }
533
+ /**
534
+ * Format a single flow step with tree visualization.
535
+ * @param step - Flow step to format
536
+ * @param indent - Indentation level
537
+ * @param isLast - Whether this is the last sibling
538
+ * @returns Formatted step string
539
+ */
540
+ function formatFlowStep(step, indent, isLast) {
541
+ const indentStr = " ".repeat(indent);
542
+ const stepIcon = getStepIcon(step.type);
543
+ const statusIcon = getStatusIcon(step.status);
544
+ const stepColor = getStepColor(step.type);
545
+ const statusColor = getStatusColor(step.status);
546
+ // Main step line
547
+ const connector = isLast ? "└─" : "├─";
548
+ const stepName = colorText(step.name, stepColor);
549
+ const duration = colorText(`${step.duration.toFixed(2)}ms`, "yellow");
550
+ const status = colorText(statusIcon, statusColor);
551
+ let output = `${indentStr}${connector} ${status} ${stepIcon} ${stepName} ${duration}\n`;
552
+ // Filter and add metadata if present (exclude error stack traces and verbose data)
553
+ if (step.metadata && Object.keys(step.metadata).length > 0) {
554
+ const filteredMetadata = Object.entries(step.metadata).filter(([key]) => {
555
+ // Skip error objects (they contain stack traces)
556
+ if (key === "error") {
557
+ return false;
558
+ }
559
+ // Skip stack traces
560
+ if (key === "stack") {
561
+ return false;
562
+ }
563
+ return true;
564
+ });
565
+ if (filteredMetadata.length > 0) {
566
+ filteredMetadata.forEach(([key, value], index) => {
567
+ const isLastMeta = index === filteredMetadata.length - 1 &&
568
+ (!step.children || step.children.length === 0);
569
+ const metaConnector = isLastMeta ? "└─" : "├─";
570
+ const metaPrefix = isLast ? " " : "│";
571
+ let valueStr;
572
+ if (typeof value === "object" && value !== null) {
573
+ // For arrays, show content if it's guardNames or similar
574
+ if (Array.isArray(value)) {
575
+ if (key === "guardNames") {
576
+ valueStr = value.join(", ");
577
+ }
578
+ else {
579
+ valueStr = `[${value.length} items]`;
580
+ }
581
+ }
582
+ else {
583
+ // For objects, show key count or skip if too complex
584
+ const obj = value;
585
+ if (Object.keys(obj).length > 3) {
586
+ valueStr = `{${Object.keys(obj).length} keys}`;
587
+ }
588
+ else {
589
+ // Show simple object as key:value pairs
590
+ valueStr = Object.entries(obj)
591
+ .map(([k, v]) => `${k}:${String(v).substring(0, 10)}`)
592
+ .join(", ");
593
+ }
594
+ }
595
+ }
596
+ else {
597
+ valueStr = String(value);
598
+ }
599
+ // Truncate long values
600
+ if (valueStr.length > 45) {
601
+ valueStr = valueStr.substring(0, 42) + "...";
602
+ }
603
+ output += `${indentStr}${metaPrefix} ${metaConnector} ${key}: ${colorText(valueStr, "none")}\n`;
604
+ });
605
+ }
606
+ }
607
+ // Add nested children (only if trackNested is enabled)
608
+ if (step.children && step.children.length > 0) {
609
+ step.children.forEach((child, index) => {
610
+ const isLastChild = index === step.children.length - 1;
611
+ output += formatFlowStep(child, indent + 2, isLastChild);
612
+ });
613
+ }
614
+ return output;
615
+ }
616
+ /**
617
+ * Get icon for step type.
618
+ */
619
+ function getStepIcon(type) {
620
+ switch (type) {
621
+ case "middleware":
622
+ return "⚙";
623
+ case "guard":
624
+ return "🛡";
625
+ case "validation":
626
+ return "✓";
627
+ case "controller":
628
+ return "🎮";
629
+ case "use-case":
630
+ return "💼";
631
+ case "exception-filter":
632
+ return "⚠";
633
+ case "response":
634
+ return "📤";
635
+ default:
636
+ return "•";
637
+ }
638
+ }
639
+ /**
640
+ * Get icon for step status.
641
+ */
642
+ function getStatusIcon(status) {
643
+ switch (status) {
644
+ case "success":
645
+ return "✓";
646
+ case "failure":
647
+ return "✗";
648
+ case "skipped":
649
+ return "⊘";
650
+ default:
651
+ return "•";
652
+ }
653
+ }
654
+ /**
655
+ * Get color for step type.
656
+ */
657
+ function getStepColor(type) {
658
+ switch (type) {
659
+ case "middleware":
660
+ return "blue";
661
+ case "guard":
662
+ return "yellow";
663
+ case "validation":
664
+ return "green";
665
+ case "controller":
666
+ return "blue";
667
+ case "use-case":
668
+ return "blue";
669
+ case "exception-filter":
670
+ return "red";
671
+ case "response":
672
+ return "green";
673
+ default:
674
+ return "none";
675
+ }
676
+ }
677
+ /**
678
+ * Get color for step status.
679
+ */
680
+ function getStatusColor(status) {
681
+ switch (status) {
682
+ case "success":
683
+ return "green";
684
+ case "failure":
685
+ return "red";
686
+ case "skipped":
687
+ return "yellow";
688
+ default:
689
+ return "none";
690
+ }
691
+ }