@expressots/core 3.0.0 → 4.0.0-preview.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -95
- package/lib/CHANGELOG.md +35 -0
- package/lib/README.md +43 -95
- package/lib/cjs/application/application-container.js +467 -33
- package/lib/cjs/application/application-factory.js +105 -5
- package/lib/cjs/application/application.types.js +32 -2
- package/lib/cjs/application/bootstrap.js +812 -0
- package/lib/cjs/application/index.js +10 -7
- package/lib/cjs/authorization/authorization-config.interface.js +2 -0
- package/lib/cjs/authorization/decorators/convenience.js +80 -0
- package/lib/cjs/authorization/guard-constants.js +12 -0
- package/lib/cjs/authorization/guard-decorators.js +159 -0
- package/lib/cjs/authorization/guard-executor.js +101 -0
- package/lib/cjs/authorization/guard-registry.js +133 -0
- package/lib/cjs/authorization/guard.interface.js +75 -0
- package/lib/cjs/authorization/guards/attribute-based.guard.js +109 -0
- package/lib/cjs/authorization/guards/authenticated.guard.js +49 -0
- package/lib/cjs/authorization/guards/composition.guard.js +67 -0
- package/lib/cjs/authorization/guards/conditional.guard.js +41 -0
- package/lib/cjs/authorization/guards/index.js +24 -0
- package/lib/cjs/authorization/guards/permission.guard.js +82 -0
- package/lib/cjs/authorization/guards/resource-owner.guard.js +61 -0
- package/lib/cjs/authorization/guards/role.guard.js +64 -0
- package/lib/cjs/authorization/index.js +40 -0
- package/lib/cjs/authorization/services/guard-cache.interface.js +2 -0
- package/lib/cjs/authorization/services/guard-cache.js +56 -0
- package/lib/cjs/authorization/services/permission-hierarchy.interface.js +2 -0
- package/lib/cjs/authorization/services/permission-hierarchy.js +54 -0
- package/lib/cjs/authorization/services/permission-service.interface.js +2 -0
- package/lib/cjs/authorization/services/permission-service.js +58 -0
- package/lib/cjs/authorization/services/security-context.interface.js +2 -0
- package/lib/cjs/authorization/services/security-context.js +75 -0
- package/lib/cjs/authorization/setup.js +141 -0
- package/lib/cjs/config/config-resolver.js +719 -0
- package/lib/cjs/config/config.interfaces.js +14 -0
- package/lib/cjs/config/define-config.js +495 -0
- package/lib/cjs/config/env-field-builders.js +402 -0
- package/lib/cjs/config/index.js +83 -0
- package/lib/cjs/config/secret-value.js +201 -0
- package/lib/cjs/console/color-codes.js +4 -0
- package/lib/cjs/console/console.js +72 -9
- package/lib/cjs/console/index.js +2 -2
- package/lib/cjs/container-module/container-module.js +257 -26
- package/lib/cjs/container-module/index.js +6 -4
- package/lib/cjs/decorator/index.js +1 -1
- package/lib/cjs/decorator/scope-binding.js +307 -16
- package/lib/cjs/di/annotation/decorator_utils.js +4 -4
- package/lib/cjs/di/annotation/inject.js +3 -3
- package/lib/cjs/di/annotation/inject_base.js +5 -5
- package/lib/cjs/di/annotation/injectable.js +2 -2
- package/lib/cjs/di/annotation/multi_inject.js +3 -3
- package/lib/cjs/di/annotation/named.js +4 -4
- package/lib/cjs/di/annotation/optional.js +4 -4
- package/lib/cjs/di/annotation/post_construct.js +4 -4
- package/lib/cjs/di/annotation/pre_destroy.js +4 -4
- package/lib/cjs/di/annotation/property_event_decorator.js +2 -2
- package/lib/cjs/di/annotation/tagged.js +3 -3
- package/lib/cjs/di/annotation/target_name.js +5 -5
- package/lib/cjs/di/annotation/unmanaged.js +5 -5
- package/lib/cjs/di/binding-decorator/constants.js +3 -0
- package/lib/cjs/di/binding-decorator/decorator/fluent_provide.js +7 -7
- package/lib/cjs/di/binding-decorator/decorator/provide.js +7 -7
- package/lib/cjs/di/binding-decorator/factory/module_factory.js +23 -4
- package/lib/cjs/di/binding-decorator/index.js +11 -9
- package/lib/cjs/di/binding-decorator/syntax/provide_done_syntax.js +7 -7
- package/lib/cjs/di/binding-decorator/syntax/provide_in_syntax.js +19 -12
- package/lib/cjs/di/binding-decorator/syntax/provide_in_when_on_syntax.js +3 -0
- package/lib/cjs/di/binding-decorator/syntax/provide_on_syntax.js +4 -4
- package/lib/cjs/di/binding-decorator/syntax/provide_when_syntax.js +30 -30
- package/lib/cjs/di/binding-decorator/utils/auto_wire.js +4 -4
- package/lib/cjs/di/bindings/binding.js +5 -6
- package/lib/cjs/di/constants/error_msgs.js +6 -2
- package/lib/cjs/di/constants/literal_types.js +3 -3
- package/lib/cjs/di/container/container.js +44 -44
- package/lib/cjs/di/container/container_module.js +3 -3
- package/lib/cjs/di/container/lookup.js +3 -3
- package/lib/cjs/di/container/module_activation_store.js +3 -3
- package/lib/cjs/di/container-introspection.js +42 -0
- package/lib/cjs/di/inversify.js +85 -52
- package/lib/cjs/di/planning/context.js +2 -2
- package/lib/cjs/di/planning/metadata.js +1 -1
- package/lib/cjs/di/planning/metadata_reader.js +1 -1
- package/lib/cjs/di/planning/planner.js +37 -37
- package/lib/cjs/di/planning/reflection_utils.js +12 -12
- package/lib/cjs/di/planning/request.js +2 -2
- package/lib/cjs/di/planning/target.js +10 -10
- package/lib/cjs/di/resolution/instantiation.js +13 -13
- package/lib/cjs/di/resolution/resolver.js +22 -22
- package/lib/cjs/di/scope/scope-registry.js +115 -0
- package/lib/cjs/di/scope/scope.js +38 -8
- package/lib/cjs/di/syntax/binding_in_syntax.js +18 -8
- package/lib/cjs/di/syntax/binding_in_when_on_syntax.js +9 -6
- package/lib/cjs/di/syntax/binding_on_syntax.js +3 -3
- package/lib/cjs/di/syntax/binding_to_syntax.js +27 -27
- package/lib/cjs/di/syntax/binding_when_on_syntax.js +4 -4
- package/lib/cjs/di/syntax/binding_when_syntax.js +30 -30
- package/lib/cjs/di/syntax/constraint_helpers.js +3 -3
- package/lib/cjs/di/utils/binding_utils.js +18 -18
- package/lib/cjs/di/utils/exceptions.js +1 -1
- package/lib/cjs/di/utils/serialization.js +1 -1
- package/lib/cjs/error/app-error.js +152 -8
- package/lib/cjs/error/base-exception-filter.js +135 -0
- package/lib/cjs/error/error-handler-middleware.js +7 -7
- package/lib/cjs/error/exception-filter-constants.js +12 -0
- package/lib/cjs/error/exception-filter-decorators.js +161 -0
- package/lib/cjs/error/exception-filter-registry.js +163 -0
- package/lib/cjs/error/exception-filter.interface.js +2 -0
- package/lib/cjs/error/exception-handler-middleware.js +378 -0
- package/lib/cjs/error/filters/app-error.filter.js +31 -0
- package/lib/cjs/error/filters/global-exception.filter.js +39 -0
- package/lib/cjs/error/filters/not-found.filter.js +35 -0
- package/lib/cjs/error/filters/validation-error.filter.js +35 -0
- package/lib/cjs/error/index.js +28 -7
- package/lib/cjs/error/not-found.error.js +17 -0
- package/lib/cjs/error/report.js +104 -9
- package/lib/cjs/error/status-code.js +20 -0
- package/lib/cjs/error/utils.js +247 -33
- package/lib/cjs/error/validation.error.js +18 -0
- package/lib/cjs/event/event-decorators.js +280 -0
- package/lib/cjs/event/event-emitter.js +373 -0
- package/lib/cjs/event/event-flow-tracker.js +236 -0
- package/lib/cjs/event/event-recorder.js +289 -0
- package/lib/cjs/event/event-registry.js +207 -0
- package/lib/cjs/event/event.interfaces.js +54 -0
- package/lib/cjs/event/index.js +80 -0
- package/lib/cjs/index.js +29 -8
- package/lib/cjs/interceptor/conditional-interceptor.js +108 -0
- package/lib/cjs/interceptor/execution-context.js +66 -0
- package/lib/cjs/interceptor/index.js +64 -0
- package/lib/cjs/interceptor/interceptor-composition.js +130 -0
- package/lib/cjs/interceptor/interceptor-constants.js +20 -0
- package/lib/cjs/interceptor/interceptor-decorators.js +155 -0
- package/lib/cjs/interceptor/interceptor-executor.js +140 -0
- package/lib/cjs/interceptor/interceptor-registry.js +159 -0
- package/lib/cjs/interceptor/interceptor.interface.js +20 -0
- package/lib/cjs/interceptor/interceptors/index.js +22 -0
- package/lib/cjs/interceptor/interceptors/logging.interceptor.js +70 -0
- package/lib/cjs/interceptor/interceptors/performance.interceptor.js +251 -0
- package/lib/cjs/interceptor/interceptors/timeout.interceptor.js +66 -0
- package/lib/cjs/lazy-loading/index.js +73 -0
- package/lib/cjs/lazy-loading/lazy-load-metrics.js +355 -0
- package/lib/cjs/lazy-loading/lazy-module-loader.js +311 -0
- package/lib/cjs/lazy-loading/lazy-module-manager.js +244 -0
- package/lib/cjs/lazy-loading/lazy-module-warmup.js +294 -0
- package/lib/cjs/lazy-loading/lazy-module.js +380 -0
- package/lib/cjs/lazy-loading/lazy.interfaces.js +18 -0
- package/lib/cjs/lifecycle/index.js +15 -0
- package/lib/cjs/lifecycle/lifecycle-registry.js +301 -0
- package/lib/cjs/lifecycle/lifecycle.interface.js +37 -0
- package/lib/cjs/middleware/content-negotiation/accept-header-parser.js +110 -0
- package/lib/cjs/middleware/content-negotiation/content-negotiation-service.js +288 -0
- package/lib/cjs/middleware/content-negotiation/formatter-registry.js +168 -0
- package/lib/cjs/middleware/content-negotiation/formatters/csv-formatter.js +114 -0
- package/lib/cjs/middleware/content-negotiation/formatters/index.js +16 -0
- package/lib/cjs/middleware/content-negotiation/formatters/json-formatter.js +34 -0
- package/lib/cjs/middleware/content-negotiation/formatters/plain-text-formatter.js +44 -0
- package/lib/cjs/middleware/content-negotiation/formatters/xml-formatter.js +124 -0
- package/lib/cjs/middleware/content-negotiation/formatters/yaml-formatter.js +134 -0
- package/lib/cjs/middleware/content-negotiation/index.js +27 -0
- package/lib/cjs/middleware/index.js +59 -30
- package/lib/cjs/middleware/interfaces/content-negotiation.interface.js +7 -0
- package/lib/cjs/middleware/middleware-config.js +10 -0
- package/lib/cjs/middleware/middleware-presets.js +294 -0
- package/lib/cjs/middleware/middleware-profiler.js +310 -0
- package/lib/cjs/middleware/middleware-registry.js +160 -0
- package/lib/cjs/middleware/middleware-resolver.js +318 -57
- package/lib/cjs/middleware/middleware-service.js +1636 -308
- package/lib/cjs/middleware/middleware-utils.js +280 -0
- package/lib/cjs/middleware/upload-registry.js +91 -0
- package/lib/cjs/path-resolver/index.js +252 -0
- package/lib/cjs/provider/db-in-memory/adapter/adapter.interface.js +10 -0
- package/lib/cjs/provider/db-in-memory/adapter/in-memory.adapter.js +665 -0
- package/lib/cjs/provider/db-in-memory/adapter/index.js +10 -0
- package/lib/cjs/provider/db-in-memory/base-repo.repository.js +4 -4
- package/lib/cjs/provider/db-in-memory/db-in-memory.provider.js +14 -18
- package/lib/cjs/provider/db-in-memory/db.provider.js +402 -0
- package/lib/cjs/provider/db-in-memory/index.js +115 -9
- package/lib/cjs/provider/db-in-memory/query/index.js +24 -0
- package/lib/cjs/provider/db-in-memory/query/query-engine.js +573 -0
- package/lib/cjs/provider/db-in-memory/query/query.types.js +10 -0
- package/lib/cjs/provider/db-in-memory/schema/decorators.js +402 -0
- package/lib/cjs/provider/db-in-memory/schema/entity.interface.js +9 -0
- package/lib/cjs/provider/db-in-memory/schema/index.js +21 -0
- package/lib/cjs/provider/db-in-memory/storage/index.js +14 -0
- package/lib/cjs/provider/db-in-memory/storage/memory-store.js +706 -0
- package/lib/cjs/provider/dto-validator/dto-validator.provider.js +8 -8
- package/lib/cjs/provider/dto-validator/package-resolver.js +2 -2
- package/lib/cjs/provider/index.js +14 -10
- package/lib/cjs/provider/logger/decorators/index.js +17 -0
- package/lib/cjs/provider/logger/decorators/log-performance.decorator.js +178 -0
- package/lib/cjs/provider/logger/index.js +35 -0
- package/lib/cjs/provider/logger/logger.banner.js +473 -0
- package/lib/cjs/provider/logger/logger.config.js +22 -0
- package/lib/cjs/provider/logger/logger.context.js +341 -0
- package/lib/cjs/provider/logger/logger.flow.js +255 -0
- package/lib/cjs/provider/logger/logger.formatter.js +676 -0
- package/lib/cjs/provider/logger/logger.grouping.js +319 -0
- package/lib/cjs/provider/logger/logger.health.js +295 -0
- package/lib/cjs/provider/logger/logger.metrics-collector.js +184 -0
- package/lib/cjs/provider/logger/logger.metrics.js +91 -0
- package/lib/cjs/provider/logger/logger.performance.js +300 -0
- package/lib/cjs/provider/logger/logger.provider.js +698 -75
- package/lib/cjs/provider/logger/logger.query.js +532 -0
- package/lib/cjs/provider/logger/logger.redaction.js +456 -0
- package/lib/cjs/provider/logger/logger.suggestions.js +480 -0
- package/lib/cjs/provider/logger/transports/console.transport.js +78 -0
- package/lib/cjs/provider/logger/transports/file.transport.js +287 -0
- package/lib/cjs/provider/logger/transports/http-server.js +141 -0
- package/lib/cjs/provider/logger/transports/http.transport.js +151 -0
- package/lib/cjs/provider/logger/transports/index.js +21 -0
- package/lib/cjs/provider/logger/transports/transport.interface.js +2 -0
- package/lib/cjs/provider/logger/utils/index.js +18 -0
- package/lib/cjs/provider/logger/utils/log-entry.js +26 -0
- package/lib/cjs/provider/logger/utils/log-levels.js +106 -0
- package/lib/cjs/provider/provider-manager.js +209 -16
- package/lib/cjs/provider/provider-registry.js +414 -0
- package/lib/cjs/provider/provider.interface.js +49 -0
- package/lib/cjs/provider/validation/adapters/class-validator.adapter.js +264 -0
- package/lib/cjs/provider/validation/adapters/index.js +14 -0
- package/lib/cjs/provider/validation/helpful-error-formatter.js +228 -0
- package/lib/cjs/provider/validation/index.js +35 -0
- package/lib/cjs/provider/validation/smart-field-detector.js +543 -0
- package/lib/cjs/provider/validation/type-inference.js +192 -0
- package/lib/cjs/provider/validation/validation-registry.js +220 -0
- package/lib/cjs/provider/validation/validation.interface.js +9 -0
- package/lib/cjs/render/adapters/base-adapter.js +134 -0
- package/lib/cjs/render/adapters/ejs-adapter.js +172 -0
- package/lib/cjs/render/adapters/handlebars-adapter.js +191 -0
- package/lib/cjs/render/adapters/index.js +20 -0
- package/lib/cjs/render/adapters/pug-adapter.js +164 -0
- package/lib/cjs/render/adapters/react-adapter.js +336 -0
- package/lib/cjs/render/features/auto-detection.js +228 -0
- package/lib/cjs/render/features/hot-reload.js +155 -0
- package/lib/cjs/render/features/index.js +20 -0
- package/lib/cjs/render/features/streaming.js +106 -0
- package/lib/cjs/render/features/type-generator.js +221 -0
- package/lib/cjs/render/features/view-debugger.js +174 -0
- package/lib/cjs/render/index.js +80 -0
- package/lib/cjs/render/presets/index.js +216 -0
- package/lib/cjs/render/render-config.js +10 -0
- package/lib/cjs/render/render-interface.js +2 -0
- package/lib/cjs/render/render-registry.js +130 -0
- package/lib/cjs/render/render-service.js +418 -0
- package/lib/cjs/render/utils/cache-manager.js +199 -0
- package/lib/cjs/render/utils/index.js +20 -0
- package/lib/cjs/render/utils/package-resolver.js +121 -0
- package/lib/cjs/render/utils/view-scanner.js +208 -0
- package/lib/cjs/testing/create-test-app.js +366 -0
- package/lib/cjs/testing/create-test-database.js +416 -0
- package/lib/cjs/testing/fluent-request.js +454 -0
- package/lib/cjs/testing/index.js +142 -0
- package/lib/cjs/testing/load-test.js +484 -0
- package/lib/cjs/testing/matchers.js +444 -0
- package/lib/cjs/testing/mock-context.js +406 -0
- package/lib/cjs/testing/mock-provider.js +339 -0
- package/lib/cjs/testing/snapshot-request.js +378 -0
- package/lib/cjs/testing/testing.interfaces.js +10 -0
- package/lib/cjs/types/application/application-container.d.ts +320 -20
- package/lib/cjs/types/application/application-factory.d.ts +99 -3
- package/lib/cjs/types/application/application.types.d.ts +177 -2
- package/lib/cjs/types/application/bootstrap.d.ts +484 -0
- package/lib/cjs/types/application/index.d.ts +4 -3
- package/lib/cjs/types/authorization/authorization-config.interface.d.ts +45 -0
- package/lib/cjs/types/authorization/decorators/convenience.d.ts +64 -0
- package/lib/cjs/types/authorization/guard-constants.d.ts +9 -0
- package/lib/cjs/types/authorization/guard-decorators.d.ts +128 -0
- package/lib/cjs/types/authorization/guard-executor.d.ts +26 -0
- package/lib/cjs/types/authorization/guard-registry.d.ts +35 -0
- package/lib/cjs/types/authorization/guard.interface.d.ts +335 -0
- package/lib/cjs/types/authorization/guards/attribute-based.guard.d.ts +60 -0
- package/lib/cjs/types/authorization/guards/authenticated.guard.d.ts +26 -0
- package/lib/cjs/types/authorization/guards/composition.guard.d.ts +42 -0
- package/lib/cjs/types/authorization/guards/conditional.guard.d.ts +21 -0
- package/lib/cjs/types/authorization/guards/index.d.ts +7 -0
- package/lib/cjs/types/authorization/guards/permission.guard.d.ts +29 -0
- package/lib/cjs/types/authorization/guards/resource-owner.guard.d.ts +29 -0
- package/lib/cjs/types/authorization/guards/role.guard.d.ts +28 -0
- package/lib/cjs/types/authorization/index.d.ts +18 -0
- package/lib/cjs/types/authorization/services/guard-cache.d.ts +26 -0
- package/lib/cjs/types/authorization/services/guard-cache.interface.d.ts +29 -0
- package/lib/cjs/types/authorization/services/permission-hierarchy.d.ts +21 -0
- package/lib/cjs/types/authorization/services/permission-hierarchy.interface.d.ts +22 -0
- package/lib/cjs/types/authorization/services/permission-service.d.ts +21 -0
- package/lib/cjs/types/authorization/services/permission-service.interface.d.ts +19 -0
- package/lib/cjs/types/authorization/services/security-context.d.ts +32 -0
- package/lib/cjs/types/authorization/services/security-context.interface.d.ts +25 -0
- package/lib/cjs/types/authorization/setup.d.ts +84 -0
- package/lib/cjs/types/config/config-resolver.d.ts +40 -0
- package/lib/cjs/types/config/config.interfaces.d.ts +570 -0
- package/lib/cjs/types/config/define-config.d.ts +109 -0
- package/lib/cjs/types/config/env-field-builders.d.ts +288 -0
- package/lib/cjs/types/config/index.d.ts +61 -0
- package/lib/cjs/types/config/secret-value.d.ts +99 -0
- package/lib/cjs/types/console/color-codes.d.ts +1 -1
- package/lib/cjs/types/console/console.d.ts +65 -2
- package/lib/cjs/types/console/index.d.ts +1 -1
- package/lib/cjs/types/container-module/container-module.d.ts +215 -8
- package/lib/cjs/types/container-module/index.d.ts +1 -1
- package/lib/cjs/types/decorator/index.d.ts +1 -1
- package/lib/cjs/types/decorator/scope-binding.d.ts +339 -11
- package/lib/cjs/types/di/annotation/decorator_utils.d.ts +1 -1
- package/lib/cjs/types/di/annotation/inject.d.ts +1 -1
- package/lib/cjs/types/di/annotation/inject_base.d.ts +2 -2
- package/lib/cjs/types/di/annotation/lazy_service_identifier.d.ts +1 -1
- package/lib/cjs/types/di/annotation/multi_inject.d.ts +1 -1
- package/lib/cjs/types/di/annotation/named.d.ts +1 -1
- package/lib/cjs/types/di/annotation/target_name.d.ts +1 -1
- package/lib/cjs/types/di/annotation/unmanaged.d.ts +1 -1
- package/lib/cjs/types/di/binding-decorator/constants.d.ts +3 -0
- package/lib/cjs/types/di/binding-decorator/decorator/fluent_provide.d.ts +2 -2
- package/lib/cjs/types/di/binding-decorator/decorator/provide.d.ts +1 -1
- package/lib/cjs/types/di/binding-decorator/factory/module_factory.d.ts +20 -1
- package/lib/cjs/types/di/binding-decorator/index.d.ts +6 -4
- package/lib/cjs/types/di/binding-decorator/interfaces/interfaces.d.ts +2 -1
- package/lib/cjs/types/di/binding-decorator/syntax/provide_done_syntax.d.ts +1 -1
- package/lib/cjs/types/di/binding-decorator/syntax/provide_in_syntax.d.ts +3 -2
- package/lib/cjs/types/di/binding-decorator/syntax/provide_in_when_on_syntax.d.ts +3 -2
- package/lib/cjs/types/di/binding-decorator/syntax/provide_on_syntax.d.ts +2 -2
- package/lib/cjs/types/di/binding-decorator/syntax/provide_when_on_syntax.d.ts +2 -2
- package/lib/cjs/types/di/binding-decorator/syntax/provide_when_syntax.d.ts +2 -2
- package/lib/cjs/types/di/binding-decorator/utils/auto_wire.d.ts +1 -1
- package/lib/cjs/types/di/bindings/binding.d.ts +1 -1
- package/lib/cjs/types/di/constants/literal_types.d.ts +3 -3
- package/lib/cjs/types/di/container/container.d.ts +1 -1
- package/lib/cjs/types/di/container/container_module.d.ts +1 -1
- package/lib/cjs/types/di/container/container_snapshot.d.ts +1 -1
- package/lib/cjs/types/di/container/lookup.d.ts +1 -1
- package/lib/cjs/types/di/container/module_activation_store.d.ts +1 -1
- package/lib/cjs/types/di/container-introspection.d.ts +25 -0
- package/lib/cjs/types/di/interfaces/interfaces.d.ts +4 -3
- package/lib/cjs/types/di/inversify.d.ts +53 -24
- package/lib/cjs/types/di/planning/context.d.ts +1 -1
- package/lib/cjs/types/di/planning/metadata.d.ts +1 -1
- package/lib/cjs/types/di/planning/metadata_reader.d.ts +1 -1
- package/lib/cjs/types/di/planning/plan.d.ts +1 -1
- package/lib/cjs/types/di/planning/planner.d.ts +1 -1
- package/lib/cjs/types/di/planning/queryable_string.d.ts +1 -1
- package/lib/cjs/types/di/planning/reflection_utils.d.ts +2 -2
- package/lib/cjs/types/di/planning/request.d.ts +1 -1
- package/lib/cjs/types/di/planning/target.d.ts +2 -2
- package/lib/cjs/types/di/resolution/instantiation.d.ts +1 -1
- package/lib/cjs/types/di/resolution/resolver.d.ts +1 -1
- package/lib/cjs/types/di/scope/scope-registry.d.ts +91 -0
- package/lib/cjs/types/di/scope/scope.d.ts +1 -1
- package/lib/cjs/types/di/syntax/binding_in_syntax.d.ts +2 -1
- package/lib/cjs/types/di/syntax/binding_in_when_on_syntax.d.ts +2 -1
- package/lib/cjs/types/di/syntax/binding_on_syntax.d.ts +1 -1
- package/lib/cjs/types/di/syntax/binding_to_syntax.d.ts +2 -2
- package/lib/cjs/types/di/syntax/binding_when_on_syntax.d.ts +1 -1
- package/lib/cjs/types/di/syntax/binding_when_syntax.d.ts +1 -1
- package/lib/cjs/types/di/syntax/constraint_helpers.d.ts +1 -1
- package/lib/cjs/types/di/utils/binding_utils.d.ts +1 -1
- package/lib/cjs/types/di/utils/clonable.d.ts +1 -1
- package/lib/cjs/types/di/utils/serialization.d.ts +1 -1
- package/lib/cjs/types/error/app-error.d.ts +155 -7
- package/lib/cjs/types/error/base-exception-filter.d.ts +73 -0
- package/lib/cjs/types/error/exception-filter-constants.d.ts +9 -0
- package/lib/cjs/types/error/exception-filter-decorators.d.ts +126 -0
- package/lib/cjs/types/error/exception-filter-registry.d.ts +38 -0
- package/lib/cjs/types/error/exception-filter.interface.d.ts +82 -0
- package/lib/cjs/types/error/exception-handler-middleware.d.ts +35 -0
- package/lib/cjs/types/error/filters/app-error.filter.d.ts +10 -0
- package/lib/cjs/types/error/filters/global-exception.filter.d.ts +9 -0
- package/lib/cjs/types/error/filters/not-found.filter.d.ts +10 -0
- package/lib/cjs/types/error/filters/validation-error.filter.d.ts +10 -0
- package/lib/cjs/types/error/index.d.ts +14 -3
- package/lib/cjs/types/error/not-found.error.d.ts +7 -0
- package/lib/cjs/types/error/report.d.ts +84 -6
- package/lib/cjs/types/error/status-code.d.ts +20 -0
- package/lib/cjs/types/error/utils.d.ts +16 -0
- package/lib/cjs/types/error/validation.error.d.ts +8 -0
- package/lib/cjs/types/event/event-decorators.d.ts +199 -0
- package/lib/cjs/types/event/event-emitter.d.ts +109 -0
- package/lib/cjs/types/event/event-flow-tracker.d.ts +88 -0
- package/lib/cjs/types/event/event-recorder.d.ts +121 -0
- package/lib/cjs/types/event/event-registry.d.ts +84 -0
- package/lib/cjs/types/event/event.interfaces.d.ts +528 -0
- package/lib/cjs/types/event/index.d.ts +55 -0
- package/lib/cjs/types/index.d.ts +27 -8
- package/lib/cjs/types/interceptor/conditional-interceptor.d.ts +91 -0
- package/lib/cjs/types/interceptor/execution-context.d.ts +41 -0
- package/lib/cjs/types/interceptor/index.d.ts +41 -0
- package/lib/cjs/types/interceptor/interceptor-composition.d.ts +115 -0
- package/lib/cjs/types/interceptor/interceptor-constants.d.ts +17 -0
- package/lib/cjs/types/interceptor/interceptor-decorators.d.ts +124 -0
- package/lib/cjs/types/interceptor/interceptor-executor.d.ts +46 -0
- package/lib/cjs/types/interceptor/interceptor-registry.d.ts +65 -0
- package/lib/cjs/types/interceptor/interceptor.interface.d.ts +281 -0
- package/lib/cjs/types/interceptor/interceptors/index.d.ts +6 -0
- package/lib/cjs/types/interceptor/interceptors/logging.interceptor.d.ts +28 -0
- package/lib/cjs/types/interceptor/interceptors/performance.interceptor.d.ts +197 -0
- package/lib/cjs/types/interceptor/interceptors/timeout.interceptor.d.ts +42 -0
- package/lib/cjs/types/lazy-loading/index.d.ts +42 -0
- package/lib/cjs/types/lazy-loading/lazy-load-metrics.d.ts +139 -0
- package/lib/cjs/types/lazy-loading/lazy-module-loader.d.ts +169 -0
- package/lib/cjs/types/lazy-loading/lazy-module-manager.d.ts +148 -0
- package/lib/cjs/types/lazy-loading/lazy-module-warmup.d.ts +130 -0
- package/lib/cjs/types/lazy-loading/lazy-module.d.ts +168 -0
- package/lib/cjs/types/lazy-loading/lazy.interfaces.d.ts +480 -0
- package/lib/cjs/types/lifecycle/index.d.ts +9 -0
- package/lib/cjs/types/lifecycle/lifecycle-registry.d.ts +213 -0
- package/lib/cjs/types/lifecycle/lifecycle.interface.d.ts +191 -0
- package/lib/cjs/types/middleware/content-negotiation/accept-header-parser.d.ts +26 -0
- package/lib/cjs/types/middleware/content-negotiation/content-negotiation-service.d.ts +64 -0
- package/lib/cjs/types/middleware/content-negotiation/formatter-registry.d.ts +60 -0
- package/lib/cjs/types/middleware/content-negotiation/formatters/csv-formatter.d.ts +34 -0
- package/lib/cjs/types/middleware/content-negotiation/formatters/index.d.ts +8 -0
- package/lib/cjs/types/middleware/content-negotiation/formatters/json-formatter.d.ts +14 -0
- package/lib/cjs/types/middleware/content-negotiation/formatters/plain-text-formatter.d.ts +12 -0
- package/lib/cjs/types/middleware/content-negotiation/formatters/xml-formatter.d.ts +26 -0
- package/lib/cjs/types/middleware/content-negotiation/formatters/yaml-formatter.d.ts +26 -0
- package/lib/cjs/types/middleware/content-negotiation/index.d.ts +7 -0
- package/lib/cjs/types/middleware/index.d.ts +25 -15
- package/lib/cjs/types/middleware/interfaces/content-negotiation.interface.d.ts +142 -0
- package/lib/cjs/types/middleware/interfaces/cookie-session/cookie-session.interface.d.ts +1 -1
- package/lib/cjs/types/middleware/middleware-config.d.ts +574 -0
- package/lib/cjs/types/middleware/middleware-interface.d.ts +594 -88
- package/lib/cjs/types/middleware/middleware-presets.d.ts +90 -0
- package/lib/cjs/types/middleware/middleware-profiler.d.ts +199 -0
- package/lib/cjs/types/middleware/middleware-registry.d.ts +103 -0
- package/lib/cjs/types/middleware/middleware-resolver.d.ts +156 -8
- package/lib/cjs/types/middleware/middleware-service.d.ts +634 -112
- package/lib/cjs/types/middleware/middleware-utils.d.ts +145 -0
- package/lib/cjs/types/middleware/upload-registry.d.ts +50 -0
- package/lib/cjs/types/path-resolver/index.d.ts +80 -0
- package/lib/cjs/types/provider/db-in-memory/adapter/adapter.interface.d.ts +222 -0
- package/lib/cjs/types/provider/db-in-memory/adapter/in-memory.adapter.d.ts +239 -0
- package/lib/cjs/types/provider/db-in-memory/adapter/index.d.ts +6 -0
- package/lib/cjs/types/provider/db-in-memory/base-repo.repository.d.ts +1 -1
- package/lib/cjs/types/provider/db-in-memory/db-in-memory.interface.d.ts +1 -1
- package/lib/cjs/types/provider/db-in-memory/db-in-memory.provider.d.ts +8 -2
- package/lib/cjs/types/provider/db-in-memory/db.provider.d.ts +281 -0
- package/lib/cjs/types/provider/db-in-memory/index.d.ts +63 -4
- package/lib/cjs/types/provider/db-in-memory/query/index.d.ts +6 -0
- package/lib/cjs/types/provider/db-in-memory/query/query-engine.d.ts +101 -0
- package/lib/cjs/types/provider/db-in-memory/query/query.types.d.ts +318 -0
- package/lib/cjs/types/provider/db-in-memory/schema/decorators.d.ts +314 -0
- package/lib/cjs/types/provider/db-in-memory/schema/entity.interface.d.ts +60 -0
- package/lib/cjs/types/provider/db-in-memory/schema/index.d.ts +6 -0
- package/lib/cjs/types/provider/db-in-memory/storage/index.d.ts +5 -0
- package/lib/cjs/types/provider/db-in-memory/storage/memory-store.d.ts +326 -0
- package/lib/cjs/types/provider/index.d.ts +7 -5
- package/lib/cjs/types/provider/logger/decorators/index.d.ts +1 -0
- package/lib/cjs/types/provider/logger/decorators/log-performance.decorator.d.ts +49 -0
- package/lib/cjs/types/provider/logger/index.d.ts +17 -0
- package/lib/cjs/types/provider/logger/logger.banner.d.ts +94 -0
- package/lib/cjs/types/provider/logger/logger.config.d.ts +55 -0
- package/lib/cjs/types/provider/logger/logger.context.d.ts +189 -0
- package/lib/cjs/types/provider/logger/logger.flow.d.ts +165 -0
- package/lib/cjs/types/provider/logger/logger.formatter.d.ts +44 -0
- package/lib/cjs/types/provider/logger/logger.grouping.d.ts +124 -0
- package/lib/cjs/types/provider/logger/logger.health.d.ts +123 -0
- package/lib/cjs/types/provider/logger/logger.metrics-collector.d.ts +44 -0
- package/lib/cjs/types/provider/logger/logger.metrics.d.ts +162 -0
- package/lib/cjs/types/provider/logger/logger.performance.d.ts +179 -0
- package/lib/cjs/types/provider/logger/logger.provider.d.ts +303 -30
- package/lib/cjs/types/provider/logger/logger.query.d.ts +232 -0
- package/lib/cjs/types/provider/logger/logger.redaction.d.ts +169 -0
- package/lib/cjs/types/provider/logger/logger.suggestions.d.ts +124 -0
- package/lib/cjs/types/provider/logger/transports/console.transport.d.ts +49 -0
- package/lib/cjs/types/provider/logger/transports/file.transport.d.ts +87 -0
- package/lib/cjs/types/provider/logger/transports/http-server.d.ts +88 -0
- package/lib/cjs/types/provider/logger/transports/http.transport.d.ts +74 -0
- package/lib/cjs/types/provider/logger/transports/index.d.ts +5 -0
- package/lib/cjs/types/provider/logger/transports/transport.interface.d.ts +31 -0
- package/lib/cjs/types/provider/logger/utils/index.d.ts +2 -0
- package/lib/cjs/types/provider/logger/utils/log-entry.d.ts +82 -0
- package/lib/cjs/types/provider/logger/utils/log-levels.d.ts +53 -0
- package/lib/cjs/types/provider/provider-manager.d.ts +165 -13
- package/lib/cjs/types/provider/provider-registry.d.ts +192 -0
- package/lib/cjs/types/provider/provider.interface.d.ts +337 -0
- package/lib/cjs/types/provider/validation/adapters/class-validator.adapter.d.ts +68 -0
- package/lib/cjs/types/provider/validation/adapters/index.d.ts +10 -0
- package/lib/cjs/types/provider/validation/helpful-error-formatter.d.ts +110 -0
- package/lib/cjs/types/provider/validation/index.d.ts +19 -0
- package/lib/cjs/types/provider/validation/smart-field-detector.d.ts +91 -0
- package/lib/cjs/types/provider/validation/type-inference.d.ts +81 -0
- package/lib/cjs/types/provider/validation/validation-registry.d.ts +105 -0
- package/lib/cjs/types/provider/validation/validation.interface.d.ts +178 -0
- package/lib/cjs/types/render/adapters/base-adapter.d.ts +95 -0
- package/lib/cjs/types/render/adapters/ejs-adapter.d.ts +57 -0
- package/lib/cjs/types/render/adapters/handlebars-adapter.d.ts +74 -0
- package/lib/cjs/types/render/adapters/index.d.ts +12 -0
- package/lib/cjs/types/render/adapters/pug-adapter.d.ts +57 -0
- package/lib/cjs/types/render/adapters/react-adapter.d.ts +99 -0
- package/lib/cjs/types/render/features/auto-detection.d.ts +58 -0
- package/lib/cjs/types/render/features/hot-reload.d.ts +65 -0
- package/lib/cjs/types/render/features/index.d.ts +12 -0
- package/lib/cjs/types/render/features/streaming.d.ts +39 -0
- package/lib/cjs/types/render/features/type-generator.d.ts +64 -0
- package/lib/cjs/types/render/features/view-debugger.d.ts +42 -0
- package/lib/cjs/types/render/index.d.ts +50 -0
- package/lib/cjs/types/render/presets/index.d.ts +119 -0
- package/lib/cjs/types/render/render-config.d.ts +213 -0
- package/lib/cjs/types/render/render-interface.d.ts +126 -0
- package/lib/cjs/types/render/render-registry.d.ts +86 -0
- package/lib/cjs/types/render/render-service.d.ts +157 -0
- package/lib/cjs/types/render/utils/cache-manager.d.ts +106 -0
- package/lib/cjs/types/render/utils/index.d.ts +11 -0
- package/lib/cjs/types/render/utils/package-resolver.d.ts +57 -0
- package/lib/cjs/types/render/utils/view-scanner.d.ts +74 -0
- package/lib/cjs/types/testing/create-test-app.d.ts +71 -0
- package/lib/cjs/types/testing/create-test-database.d.ts +100 -0
- package/lib/cjs/types/testing/fluent-request.d.ts +37 -0
- package/lib/cjs/types/testing/index.d.ts +93 -0
- package/lib/cjs/types/testing/load-test.d.ts +139 -0
- package/lib/cjs/types/testing/matchers.d.ts +184 -0
- package/lib/cjs/types/testing/mock-context.d.ts +117 -0
- package/lib/cjs/types/testing/mock-provider.d.ts +93 -0
- package/lib/cjs/types/testing/snapshot-request.d.ts +46 -0
- package/lib/cjs/types/testing/testing.interfaces.d.ts +948 -0
- package/lib/cjs/types/utils/node-require.d.ts +11 -0
- package/lib/cjs/utils/node-require.js +59 -0
- package/lib/esm/application/application-container.js +526 -0
- package/lib/esm/application/application-factory.js +134 -0
- package/lib/esm/application/application.types.js +41 -0
- package/lib/esm/application/bootstrap.js +805 -0
- package/lib/esm/application/index.js +4 -0
- package/lib/esm/authorization/authorization-config.interface.js +1 -0
- package/lib/esm/authorization/decorators/convenience.js +74 -0
- package/lib/esm/authorization/guard-constants.js +9 -0
- package/lib/esm/authorization/guard-decorators.js +155 -0
- package/lib/esm/authorization/guard-executor.js +101 -0
- package/lib/esm/authorization/guard-registry.js +132 -0
- package/lib/esm/authorization/guard.interface.js +73 -0
- package/lib/esm/authorization/guards/attribute-based.guard.js +106 -0
- package/lib/esm/authorization/guards/authenticated.guard.js +45 -0
- package/lib/esm/authorization/guards/composition.guard.js +63 -0
- package/lib/esm/authorization/guards/conditional.guard.js +38 -0
- package/lib/esm/authorization/guards/index.js +8 -0
- package/lib/esm/authorization/guards/permission.guard.js +80 -0
- package/lib/esm/authorization/guards/resource-owner.guard.js +58 -0
- package/lib/esm/authorization/guards/role.guard.js +61 -0
- package/lib/esm/authorization/index.js +24 -0
- package/lib/esm/authorization/services/guard-cache.interface.js +1 -0
- package/lib/esm/authorization/services/guard-cache.js +51 -0
- package/lib/esm/authorization/services/permission-hierarchy.interface.js +1 -0
- package/lib/esm/authorization/services/permission-hierarchy.js +49 -0
- package/lib/esm/authorization/services/permission-service.interface.js +1 -0
- package/lib/esm/authorization/services/permission-service.js +56 -0
- package/lib/esm/authorization/services/security-context.interface.js +1 -0
- package/lib/esm/authorization/services/security-context.js +74 -0
- package/lib/esm/authorization/setup.js +137 -0
- package/lib/esm/config/config-resolver.js +714 -0
- package/lib/esm/config/config.interfaces.js +13 -0
- package/lib/esm/config/define-config.js +492 -0
- package/lib/esm/config/env-field-builders.js +392 -0
- package/lib/esm/config/index.js +67 -0
- package/lib/esm/config/secret-value.js +175 -0
- package/lib/esm/console/color-codes.js +46 -0
- package/lib/esm/console/console.js +107 -0
- package/lib/esm/console/index.js +1 -0
- package/lib/esm/container-module/container-module.js +322 -0
- package/lib/esm/container-module/index.js +1 -0
- package/lib/esm/decorator/index.js +1 -0
- package/lib/esm/decorator/scope-binding.js +344 -0
- package/lib/esm/di/annotation/decorator_utils.js +93 -0
- package/lib/esm/di/annotation/inject.js +18 -0
- package/lib/esm/di/annotation/inject_base.js +14 -0
- package/lib/esm/di/annotation/injectable.js +19 -0
- package/lib/esm/di/annotation/lazy_service_identifier.js +9 -0
- package/lib/esm/di/annotation/multi_inject.js +4 -0
- package/lib/esm/di/annotation/named.js +9 -0
- package/lib/esm/di/annotation/optional.js +7 -0
- package/lib/esm/di/annotation/post_construct.js +5 -0
- package/lib/esm/di/annotation/pre_destroy.js +5 -0
- package/lib/esm/di/annotation/property_event_decorator.js +13 -0
- package/lib/esm/di/annotation/tagged.js +7 -0
- package/lib/esm/di/annotation/target_name.js +10 -0
- package/lib/esm/di/annotation/unmanaged.js +10 -0
- package/lib/esm/di/binding-decorator/constants.js +7 -0
- package/lib/esm/di/binding-decorator/decorator/fluent_provide.js +15 -0
- package/lib/esm/di/binding-decorator/decorator/provide.js +35 -0
- package/lib/esm/di/binding-decorator/factory/module_factory.js +34 -0
- package/lib/esm/di/binding-decorator/index.js +10 -0
- package/lib/esm/di/binding-decorator/interfaces/interfaces.js +1 -0
- package/lib/esm/di/binding-decorator/syntax/provide_done_syntax.js +41 -0
- package/lib/esm/di/binding-decorator/syntax/provide_in_syntax.js +37 -0
- package/lib/esm/di/binding-decorator/syntax/provide_in_when_on_syntax.js +68 -0
- package/lib/esm/di/binding-decorator/syntax/provide_on_syntax.js +19 -0
- package/lib/esm/di/binding-decorator/syntax/provide_when_on_syntax.js +57 -0
- package/lib/esm/di/binding-decorator/syntax/provide_when_syntax.js +86 -0
- package/lib/esm/di/binding-decorator/utils/auto_wire.js +13 -0
- package/lib/esm/di/bindings/binding.js +64 -0
- package/lib/esm/di/bindings/binding_count.js +5 -0
- package/lib/esm/di/constants/error_msgs.js +54 -0
- package/lib/esm/di/constants/literal_types.js +21 -0
- package/lib/esm/di/constants/metadata_keys.js +35 -0
- package/lib/esm/di/container/container.js +505 -0
- package/lib/esm/di/container/container_module.js +17 -0
- package/lib/esm/di/container/container_snapshot.js +17 -0
- package/lib/esm/di/container/lookup.js +108 -0
- package/lib/esm/di/container/module_activation_store.js +43 -0
- package/lib/esm/di/container-introspection.js +38 -0
- package/lib/esm/di/interfaces/interfaces.js +1 -0
- package/lib/esm/di/inversify.js +53 -0
- package/lib/esm/di/planning/context.js +18 -0
- package/lib/esm/di/planning/metadata.js +18 -0
- package/lib/esm/di/planning/metadata_reader.js +19 -0
- package/lib/esm/di/planning/plan.js +9 -0
- package/lib/esm/di/planning/planner.js +159 -0
- package/lib/esm/di/planning/queryable_string.js +25 -0
- package/lib/esm/di/planning/reflection_utils.js +150 -0
- package/lib/esm/di/planning/request.js +28 -0
- package/lib/esm/di/planning/target.js +89 -0
- package/lib/esm/di/resolution/instantiation.js +125 -0
- package/lib/esm/di/resolution/resolver.js +163 -0
- package/lib/esm/di/scope/scope-registry.js +109 -0
- package/lib/esm/di/scope/scope.js +75 -0
- package/lib/esm/di/syntax/binding_in_syntax.js +31 -0
- package/lib/esm/di/syntax/binding_in_when_on_syntax.js +79 -0
- package/lib/esm/di/syntax/binding_on_syntax.js +16 -0
- package/lib/esm/di/syntax/binding_to_syntax.js +89 -0
- package/lib/esm/di/syntax/binding_when_on_syntax.js +64 -0
- package/lib/esm/di/syntax/binding_when_syntax.js +82 -0
- package/lib/esm/di/syntax/constraint_helpers.js +39 -0
- package/lib/esm/di/utils/async.js +12 -0
- package/lib/esm/di/utils/binding_utils.js +48 -0
- package/lib/esm/di/utils/clonable.js +7 -0
- package/lib/esm/di/utils/exceptions.js +18 -0
- package/lib/esm/di/utils/factory_type.js +6 -0
- package/lib/esm/di/utils/id.js +5 -0
- package/lib/esm/di/utils/js.js +12 -0
- package/lib/esm/di/utils/serialization.js +102 -0
- package/lib/esm/error/app-error.js +209 -0
- package/lib/esm/error/base-exception-filter.js +134 -0
- package/lib/esm/error/error-handler-middleware.js +34 -0
- package/lib/esm/error/exception-filter-constants.js +9 -0
- package/lib/esm/error/exception-filter-decorators.js +157 -0
- package/lib/esm/error/exception-filter-registry.js +162 -0
- package/lib/esm/error/exception-filter.interface.js +1 -0
- package/lib/esm/error/exception-handler-middleware.js +378 -0
- package/lib/esm/error/filters/app-error.filter.js +28 -0
- package/lib/esm/error/filters/global-exception.filter.js +36 -0
- package/lib/esm/error/filters/not-found.filter.js +32 -0
- package/lib/esm/error/filters/validation-error.filter.js +32 -0
- package/lib/esm/error/index.js +13 -0
- package/lib/esm/error/not-found.error.js +13 -0
- package/lib/esm/error/report.js +153 -0
- package/lib/esm/error/status-code.js +106 -0
- package/lib/esm/error/utils.js +252 -0
- package/lib/esm/error/validation.error.js +15 -0
- package/lib/esm/event/event-decorators.js +268 -0
- package/lib/esm/event/event-emitter.js +376 -0
- package/lib/esm/event/event-flow-tracker.js +230 -0
- package/lib/esm/event/event-recorder.js +286 -0
- package/lib/esm/event/event-registry.js +201 -0
- package/lib/esm/event/event.interfaces.js +51 -0
- package/lib/esm/event/index.js +58 -0
- package/lib/esm/index.mjs +27 -0
- package/lib/esm/interceptor/conditional-interceptor.js +104 -0
- package/lib/esm/interceptor/execution-context.js +66 -0
- package/lib/esm/interceptor/index.js +48 -0
- package/lib/esm/interceptor/interceptor-composition.js +126 -0
- package/lib/esm/interceptor/interceptor-constants.js +17 -0
- package/lib/esm/interceptor/interceptor-decorators.js +151 -0
- package/lib/esm/interceptor/interceptor-executor.js +139 -0
- package/lib/esm/interceptor/interceptor-registry.js +158 -0
- package/lib/esm/interceptor/interceptor.interface.js +16 -0
- package/lib/esm/interceptor/interceptors/index.js +6 -0
- package/lib/esm/interceptor/interceptors/logging.interceptor.js +68 -0
- package/lib/esm/interceptor/interceptors/performance.interceptor.js +253 -0
- package/lib/esm/interceptor/interceptors/timeout.interceptor.js +65 -0
- package/lib/esm/lazy-loading/index.js +56 -0
- package/lib/esm/lazy-loading/lazy-load-metrics.js +352 -0
- package/lib/esm/lazy-loading/lazy-module-loader.js +305 -0
- package/lib/esm/lazy-loading/lazy-module-manager.js +241 -0
- package/lib/esm/lazy-loading/lazy-module-warmup.js +291 -0
- package/lib/esm/lazy-loading/lazy-module.js +352 -0
- package/lib/esm/lazy-loading/lazy.interfaces.js +17 -0
- package/lib/esm/lifecycle/index.js +9 -0
- package/lib/esm/lifecycle/lifecycle-registry.js +298 -0
- package/lib/esm/lifecycle/lifecycle.interface.js +33 -0
- package/lib/esm/middleware/content-negotiation/accept-header-parser.js +106 -0
- package/lib/esm/middleware/content-negotiation/content-negotiation-service.js +286 -0
- package/lib/esm/middleware/content-negotiation/formatter-registry.js +165 -0
- package/lib/esm/middleware/content-negotiation/formatters/csv-formatter.js +111 -0
- package/lib/esm/middleware/content-negotiation/formatters/index.js +8 -0
- package/lib/esm/middleware/content-negotiation/formatters/json-formatter.js +30 -0
- package/lib/esm/middleware/content-negotiation/formatters/plain-text-formatter.js +40 -0
- package/lib/esm/middleware/content-negotiation/formatters/xml-formatter.js +121 -0
- package/lib/esm/middleware/content-negotiation/formatters/yaml-formatter.js +131 -0
- package/lib/esm/middleware/content-negotiation/index.js +7 -0
- package/lib/esm/middleware/index.js +19 -0
- package/lib/esm/middleware/interfaces/body-parser.interface.js +1 -0
- package/lib/esm/middleware/interfaces/compression.interface.js +1 -0
- package/lib/esm/middleware/interfaces/content-negotiation.interface.js +6 -0
- package/lib/esm/middleware/interfaces/cookie-parser.interface.js +1 -0
- package/lib/esm/middleware/interfaces/cookie-session/cookie-session.interface.js +1 -0
- package/lib/esm/middleware/interfaces/cookie-session/keygrip.interface.js +1 -0
- package/lib/esm/middleware/interfaces/cors.interface.js +1 -0
- package/lib/esm/middleware/interfaces/express-rate-limit.interface.js +1 -0
- package/lib/esm/middleware/interfaces/express-session.interface.js +1 -0
- package/lib/esm/middleware/interfaces/helmet.interface.js +1 -0
- package/lib/esm/middleware/interfaces/morgan.interface.js +1 -0
- package/lib/esm/middleware/interfaces/multer.interface.js +1 -0
- package/lib/esm/middleware/interfaces/serve-favicon.interface.js +1 -0
- package/lib/esm/middleware/interfaces/serve-static.interface.js +1 -0
- package/lib/esm/middleware/interfaces/url-encoded.interface.js +1 -0
- package/lib/esm/middleware/middleware-config.js +9 -0
- package/lib/esm/middleware/middleware-interface.js +1 -0
- package/lib/esm/middleware/middleware-presets.js +286 -0
- package/lib/esm/middleware/middleware-profiler.js +307 -0
- package/lib/esm/middleware/middleware-registry.js +152 -0
- package/lib/esm/middleware/middleware-resolver.js +320 -0
- package/lib/esm/middleware/middleware-service.js +1797 -0
- package/lib/esm/middleware/middleware-utils.js +273 -0
- package/lib/esm/middleware/upload-registry.js +84 -0
- package/lib/esm/package.json +3 -0
- package/lib/esm/path-resolver/index.js +224 -0
- package/lib/esm/provider/db-in-memory/adapter/adapter.interface.js +9 -0
- package/lib/esm/provider/db-in-memory/adapter/in-memory.adapter.js +667 -0
- package/lib/esm/provider/db-in-memory/adapter/index.js +5 -0
- package/lib/esm/provider/db-in-memory/base-repo.repository.js +54 -0
- package/lib/esm/provider/db-in-memory/db-in-memory.interface.js +1 -0
- package/lib/esm/provider/db-in-memory/db-in-memory.provider.js +104 -0
- package/lib/esm/provider/db-in-memory/db-in-memory.types.js +20 -0
- package/lib/esm/provider/db-in-memory/db.provider.js +405 -0
- package/lib/esm/provider/db-in-memory/index.js +90 -0
- package/lib/esm/provider/db-in-memory/query/index.js +6 -0
- package/lib/esm/provider/db-in-memory/query/query-engine.js +570 -0
- package/lib/esm/provider/db-in-memory/query/query.types.js +9 -0
- package/lib/esm/provider/db-in-memory/schema/decorators.js +387 -0
- package/lib/esm/provider/db-in-memory/schema/entity.interface.js +8 -0
- package/lib/esm/provider/db-in-memory/schema/index.js +5 -0
- package/lib/esm/provider/db-in-memory/storage/index.js +5 -0
- package/lib/esm/provider/db-in-memory/storage/memory-store.js +709 -0
- package/lib/esm/provider/dto-validator/dto-validator.provider.js +49 -0
- package/lib/esm/provider/dto-validator/package-resolver.js +30 -0
- package/lib/esm/provider/index.js +7 -0
- package/lib/esm/provider/logger/decorators/index.js +1 -0
- package/lib/esm/provider/logger/decorators/log-performance.decorator.js +175 -0
- package/lib/esm/provider/logger/index.js +17 -0
- package/lib/esm/provider/logger/logger.banner.js +471 -0
- package/lib/esm/provider/logger/logger.config.js +19 -0
- package/lib/esm/provider/logger/logger.context.js +334 -0
- package/lib/esm/provider/logger/logger.flow.js +248 -0
- package/lib/esm/provider/logger/logger.formatter.js +670 -0
- package/lib/esm/provider/logger/logger.grouping.js +314 -0
- package/lib/esm/provider/logger/logger.health.js +291 -0
- package/lib/esm/provider/logger/logger.metrics-collector.js +180 -0
- package/lib/esm/provider/logger/logger.metrics.js +85 -0
- package/lib/esm/provider/logger/logger.performance.js +299 -0
- package/lib/esm/provider/logger/logger.provider.js +746 -0
- package/lib/esm/provider/logger/logger.query.js +529 -0
- package/lib/esm/provider/logger/logger.redaction.js +450 -0
- package/lib/esm/provider/logger/logger.suggestions.js +471 -0
- package/lib/esm/provider/logger/transports/console.transport.js +81 -0
- package/lib/esm/provider/logger/transports/file.transport.js +291 -0
- package/lib/esm/provider/logger/transports/http-server.js +141 -0
- package/lib/esm/provider/logger/transports/http.transport.js +157 -0
- package/lib/esm/provider/logger/transports/index.js +5 -0
- package/lib/esm/provider/logger/transports/transport.interface.js +1 -0
- package/lib/esm/provider/logger/utils/index.js +2 -0
- package/lib/esm/provider/logger/utils/log-entry.js +23 -0
- package/lib/esm/provider/logger/utils/log-levels.js +100 -0
- package/lib/esm/provider/provider-manager.js +283 -0
- package/lib/esm/provider/provider-registry.js +411 -0
- package/lib/esm/provider/provider.interface.js +44 -0
- package/lib/esm/provider/validation/adapters/class-validator.adapter.js +258 -0
- package/lib/esm/provider/validation/adapters/index.js +10 -0
- package/lib/esm/provider/validation/helpful-error-formatter.js +225 -0
- package/lib/esm/provider/validation/index.js +21 -0
- package/lib/esm/provider/validation/smart-field-detector.js +539 -0
- package/lib/esm/provider/validation/type-inference.js +183 -0
- package/lib/esm/provider/validation/validation-registry.js +214 -0
- package/lib/esm/provider/validation/validation.interface.js +8 -0
- package/lib/esm/render/adapters/base-adapter.js +131 -0
- package/lib/esm/render/adapters/ejs-adapter.js +142 -0
- package/lib/esm/render/adapters/handlebars-adapter.js +161 -0
- package/lib/esm/render/adapters/index.js +12 -0
- package/lib/esm/render/adapters/pug-adapter.js +134 -0
- package/lib/esm/render/adapters/react-adapter.js +303 -0
- package/lib/esm/render/features/auto-detection.js +202 -0
- package/lib/esm/render/features/hot-reload.js +153 -0
- package/lib/esm/render/features/index.js +12 -0
- package/lib/esm/render/features/streaming.js +103 -0
- package/lib/esm/render/features/type-generator.js +195 -0
- package/lib/esm/render/features/view-debugger.js +172 -0
- package/lib/esm/render/index.js +54 -0
- package/lib/esm/render/presets/index.js +207 -0
- package/lib/esm/render/render-config.js +9 -0
- package/lib/esm/render/render-interface.js +1 -0
- package/lib/esm/render/render-registry.js +124 -0
- package/lib/esm/render/render-service.js +394 -0
- package/lib/esm/render/utils/cache-manager.js +196 -0
- package/lib/esm/render/utils/index.js +10 -0
- package/lib/esm/render/utils/package-resolver.js +118 -0
- package/lib/esm/render/utils/view-scanner.js +178 -0
- package/lib/esm/testing/create-test-app.js +365 -0
- package/lib/esm/testing/create-test-database.js +411 -0
- package/lib/esm/testing/fluent-request.js +452 -0
- package/lib/esm/testing/index.js +102 -0
- package/lib/esm/testing/load-test.js +479 -0
- package/lib/esm/testing/matchers.js +440 -0
- package/lib/esm/testing/mock-context.js +400 -0
- package/lib/esm/testing/mock-provider.js +333 -0
- package/lib/esm/testing/snapshot-request.js +356 -0
- package/lib/esm/testing/testing.interfaces.js +9 -0
- package/lib/esm/types/application/application-container.d.ts +352 -0
- package/lib/esm/types/application/application-factory.d.ts +118 -0
- package/lib/esm/types/application/application.types.d.ts +185 -0
- package/lib/esm/types/application/bootstrap.d.ts +484 -0
- package/lib/esm/types/application/index.d.ts +4 -0
- package/lib/esm/types/authorization/authorization-config.interface.d.ts +45 -0
- package/lib/esm/types/authorization/decorators/convenience.d.ts +64 -0
- package/lib/esm/types/authorization/guard-constants.d.ts +9 -0
- package/lib/esm/types/authorization/guard-decorators.d.ts +128 -0
- package/lib/esm/types/authorization/guard-executor.d.ts +26 -0
- package/lib/esm/types/authorization/guard-registry.d.ts +35 -0
- package/lib/esm/types/authorization/guard.interface.d.ts +335 -0
- package/lib/esm/types/authorization/guards/attribute-based.guard.d.ts +60 -0
- package/lib/esm/types/authorization/guards/authenticated.guard.d.ts +26 -0
- package/lib/esm/types/authorization/guards/composition.guard.d.ts +42 -0
- package/lib/esm/types/authorization/guards/conditional.guard.d.ts +21 -0
- package/lib/esm/types/authorization/guards/index.d.ts +7 -0
- package/lib/esm/types/authorization/guards/permission.guard.d.ts +29 -0
- package/lib/esm/types/authorization/guards/resource-owner.guard.d.ts +29 -0
- package/lib/esm/types/authorization/guards/role.guard.d.ts +28 -0
- package/lib/esm/types/authorization/index.d.ts +18 -0
- package/lib/esm/types/authorization/services/guard-cache.d.ts +26 -0
- package/lib/esm/types/authorization/services/guard-cache.interface.d.ts +29 -0
- package/lib/esm/types/authorization/services/permission-hierarchy.d.ts +21 -0
- package/lib/esm/types/authorization/services/permission-hierarchy.interface.d.ts +22 -0
- package/lib/esm/types/authorization/services/permission-service.d.ts +21 -0
- package/lib/esm/types/authorization/services/permission-service.interface.d.ts +19 -0
- package/lib/esm/types/authorization/services/security-context.d.ts +32 -0
- package/lib/esm/types/authorization/services/security-context.interface.d.ts +25 -0
- package/lib/esm/types/authorization/setup.d.ts +84 -0
- package/lib/esm/types/config/config-resolver.d.ts +40 -0
- package/lib/esm/types/config/config.interfaces.d.ts +570 -0
- package/lib/esm/types/config/define-config.d.ts +109 -0
- package/lib/esm/types/config/env-field-builders.d.ts +288 -0
- package/lib/esm/types/config/index.d.ts +61 -0
- package/lib/esm/types/config/secret-value.d.ts +99 -0
- package/lib/esm/types/console/color-codes.d.ts +29 -0
- package/lib/esm/types/console/console.d.ts +83 -0
- package/lib/esm/types/console/index.d.ts +2 -0
- package/lib/esm/types/container-module/container-module.d.ts +242 -0
- package/lib/esm/types/container-module/index.d.ts +1 -0
- package/lib/esm/types/decorator/index.d.ts +1 -0
- package/lib/esm/types/decorator/scope-binding.d.ts +374 -0
- package/lib/esm/types/di/annotation/decorator_utils.d.ts +16 -0
- package/lib/esm/types/di/annotation/inject.d.ts +16 -0
- package/lib/esm/types/di/annotation/inject_base.d.ts +3 -0
- package/lib/esm/types/di/annotation/injectable.d.ts +7 -0
- package/lib/esm/types/di/annotation/lazy_service_identifier.d.ts +7 -0
- package/lib/esm/types/di/annotation/multi_inject.d.ts +2 -0
- package/lib/esm/types/di/annotation/named.d.ts +2 -0
- package/lib/esm/types/di/annotation/optional.d.ts +2 -0
- package/lib/esm/types/di/annotation/post_construct.d.ts +4 -0
- package/lib/esm/types/di/annotation/pre_destroy.d.ts +4 -0
- package/lib/esm/types/di/annotation/property_event_decorator.d.ts +4 -0
- package/lib/esm/types/di/annotation/tagged.d.ts +2 -0
- package/lib/esm/types/di/annotation/target_name.d.ts +3 -0
- package/lib/esm/types/di/annotation/unmanaged.d.ts +3 -0
- package/lib/esm/types/di/binding-decorator/constants.d.ts +7 -0
- package/lib/esm/types/di/binding-decorator/decorator/fluent_provide.d.ts +4 -0
- package/lib/esm/types/di/binding-decorator/decorator/provide.d.ts +4 -0
- package/lib/esm/types/di/binding-decorator/factory/module_factory.d.ts +23 -0
- package/lib/esm/types/di/binding-decorator/index.d.ts +10 -0
- package/lib/esm/types/di/binding-decorator/interfaces/interfaces.d.ts +40 -0
- package/lib/esm/types/di/binding-decorator/syntax/provide_done_syntax.d.ts +7 -0
- package/lib/esm/types/di/binding-decorator/syntax/provide_in_syntax.d.ts +12 -0
- package/lib/esm/types/di/binding-decorator/syntax/provide_in_when_on_syntax.d.ts +28 -0
- package/lib/esm/types/di/binding-decorator/syntax/provide_on_syntax.d.ts +10 -0
- package/lib/esm/types/di/binding-decorator/syntax/provide_when_on_syntax.d.ts +24 -0
- package/lib/esm/types/di/binding-decorator/syntax/provide_when_syntax.d.ts +23 -0
- package/lib/esm/types/di/binding-decorator/utils/auto_wire.d.ts +3 -0
- package/lib/esm/types/di/bindings/binding.d.ts +20 -0
- package/lib/esm/types/di/bindings/binding_count.d.ts +5 -0
- package/lib/esm/types/di/constants/error_msgs.d.ts +32 -0
- package/lib/esm/types/di/constants/literal_types.d.ts +5 -0
- package/lib/esm/types/di/constants/metadata_keys.d.ts +13 -0
- package/lib/esm/types/di/container/container.d.ts +73 -0
- package/lib/esm/types/di/container/container_module.d.ts +11 -0
- package/lib/esm/types/di/container/container_snapshot.d.ts +10 -0
- package/lib/esm/types/di/container/lookup.d.ts +16 -0
- package/lib/esm/types/di/container/module_activation_store.d.ts +10 -0
- package/lib/esm/types/di/container-introspection.d.ts +25 -0
- package/lib/esm/types/di/interfaces/interfaces.d.ts +300 -0
- package/lib/esm/types/di/inversify.d.ts +54 -0
- package/lib/esm/types/di/planning/context.d.ts +11 -0
- package/lib/esm/types/di/planning/metadata.d.ts +8 -0
- package/lib/esm/types/di/planning/metadata_reader.d.ts +6 -0
- package/lib/esm/types/di/planning/plan.d.ts +7 -0
- package/lib/esm/types/di/planning/planner.d.ts +5 -0
- package/lib/esm/types/di/planning/queryable_string.d.ts +11 -0
- package/lib/esm/types/di/planning/reflection_utils.d.ts +5 -0
- package/lib/esm/types/di/planning/request.d.ts +14 -0
- package/lib/esm/types/di/planning/target.d.ts +23 -0
- package/lib/esm/types/di/resolution/instantiation.d.ts +3 -0
- package/lib/esm/types/di/resolution/resolver.d.ts +3 -0
- package/lib/esm/types/di/scope/scope-registry.d.ts +91 -0
- package/lib/esm/types/di/scope/scope.d.ts +3 -0
- package/lib/esm/types/di/syntax/binding_in_syntax.d.ts +10 -0
- package/lib/esm/types/di/syntax/binding_in_when_on_syntax.d.ts +30 -0
- package/lib/esm/types/di/syntax/binding_on_syntax.d.ts +8 -0
- package/lib/esm/types/di/syntax/binding_to_syntax.d.ts +18 -0
- package/lib/esm/types/di/syntax/binding_when_on_syntax.d.ts +25 -0
- package/lib/esm/types/di/syntax/binding_when_syntax.d.ts +21 -0
- package/lib/esm/types/di/syntax/constraint_helpers.d.ts +6 -0
- package/lib/esm/types/di/utils/async.d.ts +3 -0
- package/lib/esm/types/di/utils/binding_utils.d.ts +4 -0
- package/lib/esm/types/di/utils/clonable.d.ts +3 -0
- package/lib/esm/types/di/utils/exceptions.d.ts +2 -0
- package/lib/esm/types/di/utils/factory_type.d.ts +5 -0
- package/lib/esm/types/di/utils/id.d.ts +2 -0
- package/lib/esm/types/di/utils/js.d.ts +1 -0
- package/lib/esm/types/di/utils/serialization.d.ts +10 -0
- package/lib/esm/types/error/app-error.d.ts +177 -0
- package/lib/esm/types/error/base-exception-filter.d.ts +73 -0
- package/lib/esm/types/error/error-handler-middleware.d.ts +11 -0
- package/lib/esm/types/error/exception-filter-constants.d.ts +9 -0
- package/lib/esm/types/error/exception-filter-decorators.d.ts +126 -0
- package/lib/esm/types/error/exception-filter-registry.d.ts +38 -0
- package/lib/esm/types/error/exception-filter.interface.d.ts +82 -0
- package/lib/esm/types/error/exception-handler-middleware.d.ts +35 -0
- package/lib/esm/types/error/filters/app-error.filter.d.ts +10 -0
- package/lib/esm/types/error/filters/global-exception.filter.d.ts +9 -0
- package/lib/esm/types/error/filters/not-found.filter.d.ts +10 -0
- package/lib/esm/types/error/filters/validation-error.filter.d.ts +10 -0
- package/lib/esm/types/error/index.d.ts +14 -0
- package/lib/esm/types/error/not-found.error.d.ts +7 -0
- package/lib/esm/types/error/report.d.ts +105 -0
- package/lib/esm/types/error/status-code.d.ts +156 -0
- package/lib/esm/types/error/utils.d.ts +17 -0
- package/lib/esm/types/error/validation.error.d.ts +8 -0
- package/lib/esm/types/event/event-decorators.d.ts +199 -0
- package/lib/esm/types/event/event-emitter.d.ts +109 -0
- package/lib/esm/types/event/event-flow-tracker.d.ts +88 -0
- package/lib/esm/types/event/event-recorder.d.ts +121 -0
- package/lib/esm/types/event/event-registry.d.ts +84 -0
- package/lib/esm/types/event/event.interfaces.d.ts +528 -0
- package/lib/esm/types/event/index.d.ts +55 -0
- package/lib/esm/types/index.d.ts +27 -0
- package/lib/esm/types/interceptor/conditional-interceptor.d.ts +91 -0
- package/lib/esm/types/interceptor/execution-context.d.ts +41 -0
- package/lib/esm/types/interceptor/index.d.ts +41 -0
- package/lib/esm/types/interceptor/interceptor-composition.d.ts +115 -0
- package/lib/esm/types/interceptor/interceptor-constants.d.ts +17 -0
- package/lib/esm/types/interceptor/interceptor-decorators.d.ts +124 -0
- package/lib/esm/types/interceptor/interceptor-executor.d.ts +46 -0
- package/lib/esm/types/interceptor/interceptor-registry.d.ts +65 -0
- package/lib/esm/types/interceptor/interceptor.interface.d.ts +281 -0
- package/lib/esm/types/interceptor/interceptors/index.d.ts +6 -0
- package/lib/esm/types/interceptor/interceptors/logging.interceptor.d.ts +28 -0
- package/lib/esm/types/interceptor/interceptors/performance.interceptor.d.ts +197 -0
- package/lib/esm/types/interceptor/interceptors/timeout.interceptor.d.ts +42 -0
- package/lib/esm/types/lazy-loading/index.d.ts +42 -0
- package/lib/esm/types/lazy-loading/lazy-load-metrics.d.ts +139 -0
- package/lib/esm/types/lazy-loading/lazy-module-loader.d.ts +169 -0
- package/lib/esm/types/lazy-loading/lazy-module-manager.d.ts +148 -0
- package/lib/esm/types/lazy-loading/lazy-module-warmup.d.ts +130 -0
- package/lib/esm/types/lazy-loading/lazy-module.d.ts +168 -0
- package/lib/esm/types/lazy-loading/lazy.interfaces.d.ts +480 -0
- package/lib/esm/types/lifecycle/index.d.ts +9 -0
- package/lib/esm/types/lifecycle/lifecycle-registry.d.ts +213 -0
- package/lib/esm/types/lifecycle/lifecycle.interface.d.ts +191 -0
- package/lib/esm/types/middleware/content-negotiation/accept-header-parser.d.ts +26 -0
- package/lib/esm/types/middleware/content-negotiation/content-negotiation-service.d.ts +64 -0
- package/lib/esm/types/middleware/content-negotiation/formatter-registry.d.ts +60 -0
- package/lib/esm/types/middleware/content-negotiation/formatters/csv-formatter.d.ts +34 -0
- package/lib/esm/types/middleware/content-negotiation/formatters/index.d.ts +8 -0
- package/lib/esm/types/middleware/content-negotiation/formatters/json-formatter.d.ts +14 -0
- package/lib/esm/types/middleware/content-negotiation/formatters/plain-text-formatter.d.ts +12 -0
- package/lib/esm/types/middleware/content-negotiation/formatters/xml-formatter.d.ts +26 -0
- package/lib/esm/types/middleware/content-negotiation/formatters/yaml-formatter.d.ts +26 -0
- package/lib/esm/types/middleware/content-negotiation/index.d.ts +7 -0
- package/lib/esm/types/middleware/index.d.ts +25 -0
- package/lib/esm/types/middleware/interfaces/body-parser.interface.d.ts +31 -0
- package/lib/esm/types/middleware/interfaces/compression.interface.d.ts +98 -0
- package/lib/esm/types/middleware/interfaces/content-negotiation.interface.d.ts +142 -0
- package/lib/esm/types/middleware/interfaces/cookie-parser.interface.d.ts +9 -0
- package/lib/esm/types/middleware/interfaces/cookie-session/cookie-session.interface.d.ts +57 -0
- package/lib/esm/types/middleware/interfaces/cookie-session/keygrip.interface.d.ts +27 -0
- package/lib/esm/types/middleware/interfaces/cors.interface.d.ts +57 -0
- package/lib/esm/types/middleware/interfaces/express-rate-limit.interface.d.ts +292 -0
- package/lib/esm/types/middleware/interfaces/express-session.interface.d.ts +207 -0
- package/lib/esm/types/middleware/interfaces/helmet.interface.d.ts +210 -0
- package/lib/esm/types/middleware/interfaces/morgan.interface.d.ts +39 -0
- package/lib/esm/types/middleware/interfaces/multer.interface.d.ts +253 -0
- package/lib/esm/types/middleware/interfaces/serve-favicon.interface.d.ts +11 -0
- package/lib/esm/types/middleware/interfaces/serve-static.interface.d.ts +69 -0
- package/lib/esm/types/middleware/interfaces/url-encoded.interface.d.ts +37 -0
- package/lib/esm/types/middleware/middleware-config.d.ts +574 -0
- package/lib/esm/types/middleware/middleware-interface.d.ts +691 -0
- package/lib/esm/types/middleware/middleware-presets.d.ts +90 -0
- package/lib/esm/types/middleware/middleware-profiler.d.ts +199 -0
- package/lib/esm/types/middleware/middleware-registry.d.ts +103 -0
- package/lib/esm/types/middleware/middleware-resolver.d.ts +159 -0
- package/lib/esm/types/middleware/middleware-service.d.ts +767 -0
- package/lib/esm/types/middleware/middleware-utils.d.ts +145 -0
- package/lib/esm/types/middleware/upload-registry.d.ts +50 -0
- package/lib/esm/types/path-resolver/index.d.ts +80 -0
- package/lib/esm/types/provider/db-in-memory/adapter/adapter.interface.d.ts +222 -0
- package/lib/esm/types/provider/db-in-memory/adapter/in-memory.adapter.d.ts +239 -0
- package/lib/esm/types/provider/db-in-memory/adapter/index.d.ts +6 -0
- package/lib/esm/types/provider/db-in-memory/base-repo.repository.d.ts +18 -0
- package/lib/esm/types/provider/db-in-memory/db-in-memory.interface.d.ts +43 -0
- package/lib/esm/types/provider/db-in-memory/db-in-memory.provider.d.ts +39 -0
- package/lib/esm/types/provider/db-in-memory/db-in-memory.types.d.ts +14 -0
- package/lib/esm/types/provider/db-in-memory/db.provider.d.ts +281 -0
- package/lib/esm/types/provider/db-in-memory/index.d.ts +63 -0
- package/lib/esm/types/provider/db-in-memory/query/index.d.ts +6 -0
- package/lib/esm/types/provider/db-in-memory/query/query-engine.d.ts +101 -0
- package/lib/esm/types/provider/db-in-memory/query/query.types.d.ts +318 -0
- package/lib/esm/types/provider/db-in-memory/schema/decorators.d.ts +314 -0
- package/lib/esm/types/provider/db-in-memory/schema/entity.interface.d.ts +60 -0
- package/lib/esm/types/provider/db-in-memory/schema/index.d.ts +6 -0
- package/lib/esm/types/provider/db-in-memory/storage/index.d.ts +5 -0
- package/lib/esm/types/provider/db-in-memory/storage/memory-store.d.ts +326 -0
- package/lib/esm/types/provider/dto-validator/dto-validator.provider.d.ts +10 -0
- package/lib/esm/types/provider/dto-validator/package-resolver.d.ts +7 -0
- package/lib/esm/types/provider/index.d.ts +7 -0
- package/lib/esm/types/provider/logger/decorators/index.d.ts +1 -0
- package/lib/esm/types/provider/logger/decorators/log-performance.decorator.d.ts +49 -0
- package/lib/esm/types/provider/logger/index.d.ts +17 -0
- package/lib/esm/types/provider/logger/logger.banner.d.ts +94 -0
- package/lib/esm/types/provider/logger/logger.config.d.ts +55 -0
- package/lib/esm/types/provider/logger/logger.context.d.ts +189 -0
- package/lib/esm/types/provider/logger/logger.flow.d.ts +165 -0
- package/lib/esm/types/provider/logger/logger.formatter.d.ts +44 -0
- package/lib/esm/types/provider/logger/logger.grouping.d.ts +124 -0
- package/lib/esm/types/provider/logger/logger.health.d.ts +123 -0
- package/lib/esm/types/provider/logger/logger.metrics-collector.d.ts +44 -0
- package/lib/esm/types/provider/logger/logger.metrics.d.ts +162 -0
- package/lib/esm/types/provider/logger/logger.performance.d.ts +179 -0
- package/lib/esm/types/provider/logger/logger.provider.d.ts +332 -0
- package/lib/esm/types/provider/logger/logger.query.d.ts +232 -0
- package/lib/esm/types/provider/logger/logger.redaction.d.ts +169 -0
- package/lib/esm/types/provider/logger/logger.suggestions.d.ts +124 -0
- package/lib/esm/types/provider/logger/transports/console.transport.d.ts +49 -0
- package/lib/esm/types/provider/logger/transports/file.transport.d.ts +87 -0
- package/lib/esm/types/provider/logger/transports/http-server.d.ts +88 -0
- package/lib/esm/types/provider/logger/transports/http.transport.d.ts +74 -0
- package/lib/esm/types/provider/logger/transports/index.d.ts +5 -0
- package/lib/esm/types/provider/logger/transports/transport.interface.d.ts +31 -0
- package/lib/esm/types/provider/logger/utils/index.d.ts +2 -0
- package/lib/esm/types/provider/logger/utils/log-entry.d.ts +82 -0
- package/lib/esm/types/provider/logger/utils/log-levels.d.ts +53 -0
- package/lib/esm/types/provider/provider-manager.d.ts +208 -0
- package/lib/esm/types/provider/provider-registry.d.ts +192 -0
- package/lib/esm/types/provider/provider.interface.d.ts +337 -0
- package/lib/esm/types/provider/validation/adapters/class-validator.adapter.d.ts +68 -0
- package/lib/esm/types/provider/validation/adapters/index.d.ts +10 -0
- package/lib/esm/types/provider/validation/helpful-error-formatter.d.ts +110 -0
- package/lib/esm/types/provider/validation/index.d.ts +19 -0
- package/lib/esm/types/provider/validation/smart-field-detector.d.ts +91 -0
- package/lib/esm/types/provider/validation/type-inference.d.ts +81 -0
- package/lib/esm/types/provider/validation/validation-registry.d.ts +105 -0
- package/lib/esm/types/provider/validation/validation.interface.d.ts +178 -0
- package/lib/esm/types/render/adapters/base-adapter.d.ts +95 -0
- package/lib/esm/types/render/adapters/ejs-adapter.d.ts +57 -0
- package/lib/esm/types/render/adapters/handlebars-adapter.d.ts +74 -0
- package/lib/esm/types/render/adapters/index.d.ts +12 -0
- package/lib/esm/types/render/adapters/pug-adapter.d.ts +57 -0
- package/lib/esm/types/render/adapters/react-adapter.d.ts +99 -0
- package/lib/esm/types/render/features/auto-detection.d.ts +58 -0
- package/lib/esm/types/render/features/hot-reload.d.ts +65 -0
- package/lib/esm/types/render/features/index.d.ts +12 -0
- package/lib/esm/types/render/features/streaming.d.ts +39 -0
- package/lib/esm/types/render/features/type-generator.d.ts +64 -0
- package/lib/esm/types/render/features/view-debugger.d.ts +42 -0
- package/lib/esm/types/render/index.d.ts +50 -0
- package/lib/esm/types/render/presets/index.d.ts +119 -0
- package/lib/esm/types/render/render-config.d.ts +213 -0
- package/lib/esm/types/render/render-interface.d.ts +126 -0
- package/lib/esm/types/render/render-registry.d.ts +86 -0
- package/lib/esm/types/render/render-service.d.ts +157 -0
- package/lib/esm/types/render/utils/cache-manager.d.ts +106 -0
- package/lib/esm/types/render/utils/index.d.ts +11 -0
- package/lib/esm/types/render/utils/package-resolver.d.ts +57 -0
- package/lib/esm/types/render/utils/view-scanner.d.ts +74 -0
- package/lib/esm/types/testing/create-test-app.d.ts +71 -0
- package/lib/esm/types/testing/create-test-database.d.ts +100 -0
- package/lib/esm/types/testing/fluent-request.d.ts +37 -0
- package/lib/esm/types/testing/index.d.ts +93 -0
- package/lib/esm/types/testing/load-test.d.ts +139 -0
- package/lib/esm/types/testing/matchers.d.ts +184 -0
- package/lib/esm/types/testing/mock-context.d.ts +117 -0
- package/lib/esm/types/testing/mock-provider.d.ts +93 -0
- package/lib/esm/types/testing/snapshot-request.d.ts +46 -0
- package/lib/esm/types/testing/testing.interfaces.d.ts +948 -0
- package/lib/esm/types/utils/node-require.d.ts +11 -0
- package/lib/esm/utils/node-require.js +56 -0
- package/lib/package.json +152 -151
- package/package.json +152 -151
- package/lib/cjs/provider/environment/env-validator.provider.js +0 -100
- package/lib/cjs/types/provider/environment/env-validator.provider.d.ts +0 -39
|
@@ -0,0 +1,670 @@
|
|
|
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
|
+
* Format log entry for development (human-readable, colored).
|
|
6
|
+
* @param entry - Log entry to format
|
|
7
|
+
* @param options - Formatting options (redaction, etc.)
|
|
8
|
+
* @returns Formatted string
|
|
9
|
+
* @public API
|
|
10
|
+
*/
|
|
11
|
+
export function formatDev(entry, options) {
|
|
12
|
+
// Apply redaction if enabled
|
|
13
|
+
const processedEntry = applyRedaction(entry, options);
|
|
14
|
+
const timestamp = formatTimestamp(processedEntry.timestamp);
|
|
15
|
+
const level = logLevelToString(processedEntry.level);
|
|
16
|
+
const levelColor = getLevelColor(processedEntry.level);
|
|
17
|
+
const coloredLevel = colorText(level.padEnd(5, " "), levelColor);
|
|
18
|
+
const coloredContext = processedEntry.context
|
|
19
|
+
? colorText(`[${processedEntry.context}]`, "green")
|
|
20
|
+
: "";
|
|
21
|
+
const coloredMessage = colorText(processedEntry.message, levelColor);
|
|
22
|
+
let output = `${colorText("[ExpressoTS]", "green")} ${timestamp}`;
|
|
23
|
+
if (processedEntry.pid) {
|
|
24
|
+
output += ` ${colorText(`[PID:${processedEntry.pid}]`, "green")}`;
|
|
25
|
+
}
|
|
26
|
+
output += ` ${coloredLevel} ${coloredContext} ${coloredMessage}\n`;
|
|
27
|
+
// Add structured data if present
|
|
28
|
+
if (processedEntry.data) {
|
|
29
|
+
output += formatData(processedEntry.data, levelColor, 2);
|
|
30
|
+
}
|
|
31
|
+
// Add error details if present
|
|
32
|
+
if (processedEntry.error) {
|
|
33
|
+
output += formatError(processedEntry.error, 2);
|
|
34
|
+
}
|
|
35
|
+
// Add trace information if present
|
|
36
|
+
if (processedEntry.trace) {
|
|
37
|
+
output += formatTrace(processedEntry.trace, 2);
|
|
38
|
+
}
|
|
39
|
+
// Add performance data if present
|
|
40
|
+
if (processedEntry.performance) {
|
|
41
|
+
output += formatPerformance(processedEntry.performance, 2);
|
|
42
|
+
}
|
|
43
|
+
// Add flow visualization if present
|
|
44
|
+
if (processedEntry.flow) {
|
|
45
|
+
output += formatFlow(processedEntry.flow, 2);
|
|
46
|
+
}
|
|
47
|
+
return output;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Format log entry for production (JSON structured).
|
|
51
|
+
* @param entry - Log entry to format
|
|
52
|
+
* @param options - Formatting options (redaction, etc.)
|
|
53
|
+
* @returns JSON string
|
|
54
|
+
* @public API
|
|
55
|
+
*/
|
|
56
|
+
export function formatProd(entry, options) {
|
|
57
|
+
// Apply redaction if enabled (especially important for production!)
|
|
58
|
+
const processedEntry = applyRedaction(entry, options);
|
|
59
|
+
const jsonEntry = {
|
|
60
|
+
timestamp: processedEntry.timestamp.toISOString(),
|
|
61
|
+
level: logLevelToString(processedEntry.level),
|
|
62
|
+
message: processedEntry.message,
|
|
63
|
+
};
|
|
64
|
+
if (processedEntry.context) {
|
|
65
|
+
jsonEntry.context = processedEntry.context;
|
|
66
|
+
}
|
|
67
|
+
if (processedEntry.pid) {
|
|
68
|
+
jsonEntry.pid = processedEntry.pid;
|
|
69
|
+
}
|
|
70
|
+
if (processedEntry.data) {
|
|
71
|
+
jsonEntry.data = processedEntry.data;
|
|
72
|
+
}
|
|
73
|
+
if (processedEntry.error) {
|
|
74
|
+
jsonEntry.error = formatErrorForJson(processedEntry.error);
|
|
75
|
+
}
|
|
76
|
+
if (processedEntry.trace) {
|
|
77
|
+
jsonEntry.trace = processedEntry.trace;
|
|
78
|
+
}
|
|
79
|
+
if (processedEntry.performance) {
|
|
80
|
+
jsonEntry.performance = processedEntry.performance;
|
|
81
|
+
}
|
|
82
|
+
if (processedEntry.metadata) {
|
|
83
|
+
jsonEntry.metadata = processedEntry.metadata;
|
|
84
|
+
}
|
|
85
|
+
if (processedEntry.flow) {
|
|
86
|
+
jsonEntry.flow = processedEntry.flow;
|
|
87
|
+
}
|
|
88
|
+
return JSON.stringify(jsonEntry);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Format timestamp for display.
|
|
92
|
+
*/
|
|
93
|
+
function formatTimestamp(date) {
|
|
94
|
+
const options = {
|
|
95
|
+
year: "numeric",
|
|
96
|
+
month: "2-digit",
|
|
97
|
+
day: "2-digit",
|
|
98
|
+
hour: "2-digit",
|
|
99
|
+
minute: "2-digit",
|
|
100
|
+
second: "2-digit",
|
|
101
|
+
};
|
|
102
|
+
return date.toLocaleString(undefined, options).replace(",", "");
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Get color for log level.
|
|
106
|
+
*/
|
|
107
|
+
function getLevelColor(level) {
|
|
108
|
+
switch (level) {
|
|
109
|
+
case LogLevel.TRACE:
|
|
110
|
+
return "white";
|
|
111
|
+
case LogLevel.DEBUG:
|
|
112
|
+
return "blue";
|
|
113
|
+
case LogLevel.INFO:
|
|
114
|
+
return "blue";
|
|
115
|
+
case LogLevel.WARN:
|
|
116
|
+
return "yellow";
|
|
117
|
+
case LogLevel.ERROR:
|
|
118
|
+
case LogLevel.FATAL:
|
|
119
|
+
return "red";
|
|
120
|
+
default:
|
|
121
|
+
return "none";
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Apply color to text.
|
|
126
|
+
*/
|
|
127
|
+
function colorText(text, color) {
|
|
128
|
+
return `${colorCodes[color]}${text}\x1b[0m`;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Format structured data with indentation.
|
|
132
|
+
*/
|
|
133
|
+
function formatData(data, color, indent) {
|
|
134
|
+
const indentStr = " ".repeat(indent);
|
|
135
|
+
const prefix = `${indentStr}├─ `;
|
|
136
|
+
if (typeof data === "object" && data !== null) {
|
|
137
|
+
if (Array.isArray(data)) {
|
|
138
|
+
return `${prefix}${colorText(`Array(${data.length})`, color)}\n`;
|
|
139
|
+
}
|
|
140
|
+
const entries = Object.entries(data);
|
|
141
|
+
if (entries.length === 0) {
|
|
142
|
+
return "";
|
|
143
|
+
}
|
|
144
|
+
let output = "";
|
|
145
|
+
entries.forEach(([key, value], index) => {
|
|
146
|
+
const isLast = index === entries.length - 1;
|
|
147
|
+
const connector = isLast ? "└─" : "├─";
|
|
148
|
+
const valueStr = formatValue(value, color);
|
|
149
|
+
output += `${indentStr}${connector} ${key}: ${valueStr}\n`;
|
|
150
|
+
});
|
|
151
|
+
return output;
|
|
152
|
+
}
|
|
153
|
+
return `${prefix}${colorText(String(data), color)}\n`;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Format a value for display.
|
|
157
|
+
*/
|
|
158
|
+
function formatValue(value, color) {
|
|
159
|
+
if (value === null) {
|
|
160
|
+
return colorText("null", "none");
|
|
161
|
+
}
|
|
162
|
+
if (value === undefined) {
|
|
163
|
+
return colorText("undefined", "none");
|
|
164
|
+
}
|
|
165
|
+
if (typeof value === "string") {
|
|
166
|
+
return colorText(`"${value}"`, color);
|
|
167
|
+
}
|
|
168
|
+
if (typeof value === "number" || typeof value === "boolean") {
|
|
169
|
+
return colorText(String(value), color);
|
|
170
|
+
}
|
|
171
|
+
if (typeof value === "object") {
|
|
172
|
+
if (Array.isArray(value)) {
|
|
173
|
+
return colorText(`[${value.length} items]`, color);
|
|
174
|
+
}
|
|
175
|
+
return colorText(`{${Object.keys(value).length} keys}`, color);
|
|
176
|
+
}
|
|
177
|
+
return colorText(String(value), color);
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Format error for display.
|
|
181
|
+
*/
|
|
182
|
+
function formatError(error, indent) {
|
|
183
|
+
const indentStr = " ".repeat(indent);
|
|
184
|
+
let output = "";
|
|
185
|
+
if (error instanceof Error) {
|
|
186
|
+
output += `${indentStr}├─ ${colorText("Error:", "red")} ${colorText(error.name, "red")}\n`;
|
|
187
|
+
output += `${indentStr}├─ ${colorText("Message:", "red")} ${colorText(error.message, "red")}\n`;
|
|
188
|
+
if (error.stack) {
|
|
189
|
+
const stackLines = error.stack.split("\n").slice(1); // Skip first line (already shown)
|
|
190
|
+
if (stackLines.length > 0) {
|
|
191
|
+
output += `${indentStr}└─ ${colorText("Stack:", "red")}\n`;
|
|
192
|
+
stackLines.slice(0, 5).forEach((line) => {
|
|
193
|
+
output += `${indentStr} ${colorText(line.trim(), "none")}\n`;
|
|
194
|
+
});
|
|
195
|
+
if (stackLines.length > 5) {
|
|
196
|
+
output += `${indentStr} ${colorText(`... and ${stackLines.length - 5} more`, "none")}\n`;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
output += `${indentStr}└─ ${colorText(String(error), "red")}\n`;
|
|
203
|
+
}
|
|
204
|
+
return output;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Format error for JSON output.
|
|
208
|
+
*/
|
|
209
|
+
function formatErrorForJson(error) {
|
|
210
|
+
if (error instanceof Error) {
|
|
211
|
+
return {
|
|
212
|
+
name: error.name,
|
|
213
|
+
message: error.message,
|
|
214
|
+
stack: error.stack,
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
return {
|
|
218
|
+
message: String(error),
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Format trace information.
|
|
223
|
+
*/
|
|
224
|
+
function formatTrace(trace, indent) {
|
|
225
|
+
const indentStr = " ".repeat(indent);
|
|
226
|
+
let output = `${indentStr}├─ ${colorText("Trace:", "blue")}\n`;
|
|
227
|
+
Object.entries(trace).forEach(([key, value], index, entries) => {
|
|
228
|
+
const isLast = index === entries.length - 1;
|
|
229
|
+
const connector = isLast ? "└─" : "├─";
|
|
230
|
+
output += `${indentStr} ${connector} ${key}: ${colorText(String(value), "blue")}\n`;
|
|
231
|
+
});
|
|
232
|
+
return output;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Format performance data.
|
|
236
|
+
*/
|
|
237
|
+
function formatPerformance(perf, indent) {
|
|
238
|
+
const indentStr = " ".repeat(indent);
|
|
239
|
+
let output = `${indentStr}├─ ${colorText("Performance:", "yellow")}\n`;
|
|
240
|
+
if (perf.duration !== undefined) {
|
|
241
|
+
output += `${indentStr} ├─ Duration: ${colorText(`${perf.duration}ms`, "yellow")}\n`;
|
|
242
|
+
}
|
|
243
|
+
if (perf.memoryDelta !== undefined) {
|
|
244
|
+
const mb = (perf.memoryDelta / 1024 / 1024).toFixed(2);
|
|
245
|
+
output += `${indentStr} ├─ Memory: ${colorText(`${mb}MB`, "yellow")}\n`;
|
|
246
|
+
}
|
|
247
|
+
if (perf.cpuUsage !== undefined) {
|
|
248
|
+
output += `${indentStr} └─ CPU: ${colorText(`${perf.cpuUsage}%`, "yellow")}\n`;
|
|
249
|
+
}
|
|
250
|
+
else if (perf.duration !== undefined || perf.memoryDelta !== undefined) {
|
|
251
|
+
output = output.replace(/├─/g, "└─").replace(/├─/g, "├─");
|
|
252
|
+
}
|
|
253
|
+
return output;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Apply redaction to a log entry if enabled.
|
|
257
|
+
* @param entry - Log entry to process
|
|
258
|
+
* @param options - Format options with redaction settings
|
|
259
|
+
* @returns Processed entry with sensitive data redacted
|
|
260
|
+
*/
|
|
261
|
+
function applyRedaction(entry, options) {
|
|
262
|
+
// If redaction is explicitly disabled, return original entry
|
|
263
|
+
if (options?.redact === false) {
|
|
264
|
+
return entry;
|
|
265
|
+
}
|
|
266
|
+
// Get redactor (custom or global)
|
|
267
|
+
const redactor = options?.redactor ?? getGlobalRedactor();
|
|
268
|
+
// Create a shallow copy and redact relevant fields
|
|
269
|
+
const processedEntry = {
|
|
270
|
+
...entry,
|
|
271
|
+
message: redactor.redactString(entry.message),
|
|
272
|
+
};
|
|
273
|
+
// Redact data object if present
|
|
274
|
+
if (entry.data) {
|
|
275
|
+
processedEntry.data = redactor.redact(entry.data);
|
|
276
|
+
}
|
|
277
|
+
// Redact metadata if present
|
|
278
|
+
if (entry.metadata) {
|
|
279
|
+
processedEntry.metadata = redactor.redact(entry.metadata);
|
|
280
|
+
}
|
|
281
|
+
// Redact trace if present
|
|
282
|
+
if (entry.trace) {
|
|
283
|
+
processedEntry.trace = redactor.redact(entry.trace);
|
|
284
|
+
}
|
|
285
|
+
return processedEntry;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Format a grouped log entry for development output.
|
|
289
|
+
* @param groupedEntry - Grouped log entry
|
|
290
|
+
* @param options - Formatting options
|
|
291
|
+
* @returns Formatted string
|
|
292
|
+
* @public API
|
|
293
|
+
*/
|
|
294
|
+
export function formatGroupedDev(groupedEntry, options) {
|
|
295
|
+
const entry = groupedEntry.representative;
|
|
296
|
+
const processedEntry = applyRedaction(entry, options);
|
|
297
|
+
const timestamp = formatTimestamp(processedEntry.timestamp);
|
|
298
|
+
const level = logLevelToString(processedEntry.level);
|
|
299
|
+
const levelColor = getLevelColor(processedEntry.level);
|
|
300
|
+
const coloredLevel = colorText(level.padEnd(5, " "), levelColor);
|
|
301
|
+
const coloredContext = processedEntry.context
|
|
302
|
+
? colorText(`[${processedEntry.context}]`, "green")
|
|
303
|
+
: "";
|
|
304
|
+
// Format time range
|
|
305
|
+
const timeRange = formatTimeRange(groupedEntry.firstOccurrence, groupedEntry.lastOccurrence);
|
|
306
|
+
// Format grouped message
|
|
307
|
+
const groupedMessage = colorText(`[GROUPED ×${groupedEntry.count}] ${processedEntry.message}`, levelColor);
|
|
308
|
+
const timeRangeText = colorText(`(${timeRange})`, "yellow");
|
|
309
|
+
let output = `${colorText("[ExpressoTS]", "green")} ${timestamp}`;
|
|
310
|
+
if (processedEntry.pid) {
|
|
311
|
+
output += ` ${colorText(`[PID:${processedEntry.pid}]`, "green")}`;
|
|
312
|
+
}
|
|
313
|
+
output += ` ${coloredLevel} ${coloredContext} ${groupedMessage} ${timeRangeText}\n`;
|
|
314
|
+
// Show first occurrence details
|
|
315
|
+
output += ` ├─ First: ${formatTimestamp(groupedEntry.firstOccurrence)}\n`;
|
|
316
|
+
output += ` ├─ Last: ${formatTimestamp(groupedEntry.lastOccurrence)}\n`;
|
|
317
|
+
output += ` └─ Count: ${colorText(`${groupedEntry.count} occurrences`, "yellow")}\n`;
|
|
318
|
+
// Optionally show sample entries (first, middle, last)
|
|
319
|
+
if (groupedEntry.entries.length > 1) {
|
|
320
|
+
const sampleIndices = [
|
|
321
|
+
0,
|
|
322
|
+
Math.floor(groupedEntry.entries.length / 2),
|
|
323
|
+
groupedEntry.entries.length - 1,
|
|
324
|
+
].filter((idx, i, arr) => arr.indexOf(idx) === i); // Unique indices
|
|
325
|
+
if (sampleIndices.length > 1) {
|
|
326
|
+
output += ` └─ Sample entries:\n`;
|
|
327
|
+
for (const idx of sampleIndices) {
|
|
328
|
+
const sample = groupedEntry.entries[idx];
|
|
329
|
+
const sampleTime = formatTimestamp(sample.timestamp);
|
|
330
|
+
output += ` ${idx === 0 ? "├" : idx === sampleIndices[sampleIndices.length - 1] ? "└" : "├"}─ [${sampleTime}] ${sample.message}\n`;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
return output;
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Format a grouped log entry for production (JSON).
|
|
338
|
+
* @param groupedEntry - Grouped log entry
|
|
339
|
+
* @param options - Formatting options
|
|
340
|
+
* @returns JSON string
|
|
341
|
+
* @public API
|
|
342
|
+
*/
|
|
343
|
+
export function formatGroupedProd(groupedEntry, options) {
|
|
344
|
+
const entry = groupedEntry.representative;
|
|
345
|
+
const processedEntry = applyRedaction(entry, options);
|
|
346
|
+
const jsonEntry = {
|
|
347
|
+
timestamp: processedEntry.timestamp.toISOString(),
|
|
348
|
+
level: logLevelToString(processedEntry.level),
|
|
349
|
+
message: processedEntry.message,
|
|
350
|
+
grouped: true,
|
|
351
|
+
count: groupedEntry.count,
|
|
352
|
+
firstOccurrence: groupedEntry.firstOccurrence.toISOString(),
|
|
353
|
+
lastOccurrence: groupedEntry.lastOccurrence.toISOString(),
|
|
354
|
+
timeRange: formatTimeRange(groupedEntry.firstOccurrence, groupedEntry.lastOccurrence),
|
|
355
|
+
};
|
|
356
|
+
if (processedEntry.context) {
|
|
357
|
+
jsonEntry.context = processedEntry.context;
|
|
358
|
+
}
|
|
359
|
+
if (processedEntry.pid) {
|
|
360
|
+
jsonEntry.pid = processedEntry.pid;
|
|
361
|
+
}
|
|
362
|
+
if (processedEntry.data) {
|
|
363
|
+
jsonEntry.data = processedEntry.data;
|
|
364
|
+
}
|
|
365
|
+
if (processedEntry.error) {
|
|
366
|
+
jsonEntry.error = formatErrorForJson(processedEntry.error);
|
|
367
|
+
}
|
|
368
|
+
if (processedEntry.trace) {
|
|
369
|
+
jsonEntry.trace = processedEntry.trace;
|
|
370
|
+
}
|
|
371
|
+
if (processedEntry.performance) {
|
|
372
|
+
jsonEntry.performance = processedEntry.performance;
|
|
373
|
+
}
|
|
374
|
+
// Include sample entries
|
|
375
|
+
if (groupedEntry.entries.length > 0) {
|
|
376
|
+
const sampleIndices = [
|
|
377
|
+
0,
|
|
378
|
+
Math.floor(groupedEntry.entries.length / 2),
|
|
379
|
+
groupedEntry.entries.length - 1,
|
|
380
|
+
].filter((idx, i, arr) => arr.indexOf(idx) === i);
|
|
381
|
+
jsonEntry.sampleEntries = sampleIndices.map((idx) => ({
|
|
382
|
+
timestamp: groupedEntry.entries[idx].timestamp.toISOString(),
|
|
383
|
+
message: groupedEntry.entries[idx].message,
|
|
384
|
+
}));
|
|
385
|
+
}
|
|
386
|
+
return JSON.stringify(jsonEntry);
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Format time range between two dates.
|
|
390
|
+
* @param start - Start date
|
|
391
|
+
* @param end - End date
|
|
392
|
+
* @returns Formatted time range string
|
|
393
|
+
*/
|
|
394
|
+
function formatTimeRange(start, end) {
|
|
395
|
+
const diffMs = end.getTime() - start.getTime();
|
|
396
|
+
if (diffMs < 1000) {
|
|
397
|
+
return `${diffMs}ms`;
|
|
398
|
+
}
|
|
399
|
+
if (diffMs < 60000) {
|
|
400
|
+
return `${(diffMs / 1000).toFixed(1)}s`;
|
|
401
|
+
}
|
|
402
|
+
return `${(diffMs / 60000).toFixed(1)}m`;
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Format request flow visualization for development (ASCII tree).
|
|
406
|
+
* @param flow - Request flow data
|
|
407
|
+
* @param indent - Indentation level
|
|
408
|
+
* @returns Formatted ASCII visualization string
|
|
409
|
+
*/
|
|
410
|
+
function formatFlow(flow, indent) {
|
|
411
|
+
const indentStr = " ".repeat(indent);
|
|
412
|
+
const boxWidth = 65; // Increased to accommodate longer controller/method names
|
|
413
|
+
const title = "Request Flow Visualization";
|
|
414
|
+
let output = `\n${indentStr}${colorText("╔" + "═".repeat(boxWidth) + "╗", "blue")}\n`;
|
|
415
|
+
// Title - center aligned
|
|
416
|
+
const titlePlainLength = title.length;
|
|
417
|
+
const titlePadding = Math.max(0, Math.floor((boxWidth - titlePlainLength) / 2));
|
|
418
|
+
const titleRightPadding = boxWidth - titlePlainLength - titlePadding;
|
|
419
|
+
output += `${indentStr}${colorText("║", "blue")}${" ".repeat(titlePadding)}${colorText(title, "blue")}${" ".repeat(titleRightPadding)}${colorText("║", "blue")}\n`;
|
|
420
|
+
output += `${indentStr}${colorText("╠" + "═".repeat(boxWidth) + "╣", "blue")}\n`;
|
|
421
|
+
// Request info - left aligned
|
|
422
|
+
const methodPath = `${flow.method} ${flow.path}`;
|
|
423
|
+
const methodPathPlainLength = methodPath.length;
|
|
424
|
+
const methodPathPadding = boxWidth - methodPathPlainLength - 1;
|
|
425
|
+
output += `${indentStr}${colorText("║", "blue")} ${colorText(methodPath, "white")}${" ".repeat(methodPathPadding)}${colorText("║", "blue")}\n`;
|
|
426
|
+
const requestIdText = `Request ID: `;
|
|
427
|
+
const requestIdValue = flow.requestId;
|
|
428
|
+
const requestIdPlainLength = requestIdText.length + requestIdValue.length;
|
|
429
|
+
const requestIdPadding = boxWidth - requestIdPlainLength - 1;
|
|
430
|
+
output += `${indentStr}${colorText("║", "blue")} ${requestIdText}${colorText(requestIdValue, "yellow")}${" ".repeat(requestIdPadding)}${colorText("║", "blue")}\n`;
|
|
431
|
+
output += `${indentStr}${colorText("╠" + "═".repeat(boxWidth) + "╣", "blue")}\n`;
|
|
432
|
+
// Flow steps - render inside box
|
|
433
|
+
if (flow.steps.length === 0) {
|
|
434
|
+
const noStepsMsg = "No steps tracked";
|
|
435
|
+
const noStepsPlainLength = noStepsMsg.length;
|
|
436
|
+
const noStepsPadding = Math.max(0, Math.floor((boxWidth - noStepsPlainLength) / 2));
|
|
437
|
+
const noStepsRightPadding = boxWidth - noStepsPlainLength - noStepsPadding;
|
|
438
|
+
output += `${indentStr}${colorText("║", "blue")}${" ".repeat(noStepsPadding)}${colorText(noStepsMsg, "yellow")}${" ".repeat(noStepsRightPadding)}${colorText("║", "blue")}\n`;
|
|
439
|
+
}
|
|
440
|
+
else {
|
|
441
|
+
// Render steps as tree structure inside box
|
|
442
|
+
flow.steps.forEach((step, index) => {
|
|
443
|
+
const isLast = index === flow.steps.length - 1;
|
|
444
|
+
const stepOutput = formatFlowStep(step, 0, isLast);
|
|
445
|
+
// Split into lines and wrap each line in box borders
|
|
446
|
+
const stepLines = stepOutput
|
|
447
|
+
.split("\n")
|
|
448
|
+
.filter((line) => line.trim().length > 0);
|
|
449
|
+
stepLines.forEach((line) => {
|
|
450
|
+
// Remove ANSI codes for length calculation, but keep them in the output
|
|
451
|
+
// eslint-disable-next-line no-control-regex
|
|
452
|
+
const plainLine = line.replace(/\x1b\[[0-9;]*m/g, "");
|
|
453
|
+
const maxLineLength = boxWidth - 1; // Account for space after border
|
|
454
|
+
// Truncate if too long
|
|
455
|
+
let displayPlainLine = plainLine;
|
|
456
|
+
let displayLine = line;
|
|
457
|
+
if (plainLine.length > maxLineLength) {
|
|
458
|
+
// Simple truncation - preserve colors by truncating plain text version
|
|
459
|
+
displayPlainLine = plainLine.substring(0, maxLineLength - 3) + "...";
|
|
460
|
+
// For display, we'll use the plain text truncated version
|
|
461
|
+
// (colors will be lost on truncated part, but box will be correct)
|
|
462
|
+
displayLine = displayPlainLine;
|
|
463
|
+
}
|
|
464
|
+
const padding = Math.max(0, boxWidth - displayPlainLine.length - 1);
|
|
465
|
+
output += `${indentStr}${colorText("║", "blue")} ${displayLine}${" ".repeat(padding)}${colorText("║", "blue")}\n`;
|
|
466
|
+
});
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
// Summary
|
|
470
|
+
output += `${indentStr}${colorText("╠" + "═".repeat(boxWidth) + "╣", "blue")}\n`;
|
|
471
|
+
// Total Duration - left aligned
|
|
472
|
+
const durationValue = `${flow.totalDuration.toFixed(2)}ms`;
|
|
473
|
+
const durationText = "Total Duration: ";
|
|
474
|
+
const durationPlainLength = durationText.length + durationValue.length;
|
|
475
|
+
const durationPadding = boxWidth - durationPlainLength - 1;
|
|
476
|
+
output += `${indentStr}${colorText("║", "blue")} ${durationText}${colorText(durationValue, "yellow")}${" ".repeat(durationPadding)}${colorText("║", "blue")}\n`;
|
|
477
|
+
if (flow.statusCode !== undefined) {
|
|
478
|
+
const statusColor = flow.statusCode >= 400
|
|
479
|
+
? "red"
|
|
480
|
+
: flow.statusCode >= 300
|
|
481
|
+
? "yellow"
|
|
482
|
+
: "green";
|
|
483
|
+
const statusCodeStr = String(flow.statusCode);
|
|
484
|
+
const statusText = "Status Code: ";
|
|
485
|
+
const statusPlainLength = statusText.length + statusCodeStr.length;
|
|
486
|
+
const statusPadding = boxWidth - statusPlainLength - 1;
|
|
487
|
+
output += `${indentStr}${colorText("║", "blue")} ${statusText}${colorText(statusCodeStr, statusColor)}${" ".repeat(statusPadding)}${colorText("║", "blue")}\n`;
|
|
488
|
+
}
|
|
489
|
+
if (flow.memoryDelta !== 0) {
|
|
490
|
+
const memoryMB = (flow.memoryDelta / 1024 / 1024).toFixed(2);
|
|
491
|
+
const memoryMBNum = parseFloat(memoryMB);
|
|
492
|
+
const memoryColor = flow.memoryDelta > 0 ? "yellow" : "green";
|
|
493
|
+
const memoryValue = `${memoryMBNum > 0 ? "+" : ""}${memoryMB}MB`;
|
|
494
|
+
const memoryText = "Memory Delta: ";
|
|
495
|
+
const memoryPlainLength = memoryText.length + memoryValue.length;
|
|
496
|
+
const memoryPadding = boxWidth - memoryPlainLength - 1;
|
|
497
|
+
output += `${indentStr}${colorText("║", "blue")} ${memoryText}${colorText(memoryValue, memoryColor)}${" ".repeat(memoryPadding)}${colorText("║", "blue")}\n`;
|
|
498
|
+
}
|
|
499
|
+
if (flow.error) {
|
|
500
|
+
const maxErrorLength = boxWidth - 8; // "Error: " = 7 chars + 1 space
|
|
501
|
+
const errorMsg = flow.error.message.length > maxErrorLength
|
|
502
|
+
? flow.error.message.substring(0, maxErrorLength - 3) + "..."
|
|
503
|
+
: flow.error.message;
|
|
504
|
+
const errorText = "Error: ";
|
|
505
|
+
const errorPlainLength = errorText.length + errorMsg.length;
|
|
506
|
+
const errorPadding = boxWidth - errorPlainLength - 1;
|
|
507
|
+
output += `${indentStr}${colorText("║", "blue")} ${errorText}${colorText(errorMsg, "red")}${" ".repeat(errorPadding)}${colorText("║", "blue")}\n`;
|
|
508
|
+
}
|
|
509
|
+
output += `${indentStr}${colorText("╚" + "═".repeat(boxWidth) + "╝", "blue")}\n`;
|
|
510
|
+
return output;
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* Format a single flow step with tree visualization.
|
|
514
|
+
* @param step - Flow step to format
|
|
515
|
+
* @param indent - Indentation level
|
|
516
|
+
* @param isLast - Whether this is the last sibling
|
|
517
|
+
* @returns Formatted step string
|
|
518
|
+
*/
|
|
519
|
+
function formatFlowStep(step, indent, isLast) {
|
|
520
|
+
const indentStr = " ".repeat(indent);
|
|
521
|
+
const stepIcon = getStepIcon(step.type);
|
|
522
|
+
const statusIcon = getStatusIcon(step.status);
|
|
523
|
+
const stepColor = getStepColor(step.type);
|
|
524
|
+
const statusColor = getStatusColor(step.status);
|
|
525
|
+
// Main step line
|
|
526
|
+
const connector = isLast ? "└─" : "├─";
|
|
527
|
+
const stepName = colorText(step.name, stepColor);
|
|
528
|
+
const duration = colorText(`${step.duration.toFixed(2)}ms`, "yellow");
|
|
529
|
+
const status = colorText(statusIcon, statusColor);
|
|
530
|
+
let output = `${indentStr}${connector} ${status} ${stepIcon} ${stepName} ${duration}\n`;
|
|
531
|
+
// Filter and add metadata if present (exclude error stack traces and verbose data)
|
|
532
|
+
if (step.metadata && Object.keys(step.metadata).length > 0) {
|
|
533
|
+
const filteredMetadata = Object.entries(step.metadata).filter(([key]) => {
|
|
534
|
+
// Skip error objects (they contain stack traces)
|
|
535
|
+
if (key === "error") {
|
|
536
|
+
return false;
|
|
537
|
+
}
|
|
538
|
+
// Skip stack traces
|
|
539
|
+
if (key === "stack") {
|
|
540
|
+
return false;
|
|
541
|
+
}
|
|
542
|
+
return true;
|
|
543
|
+
});
|
|
544
|
+
if (filteredMetadata.length > 0) {
|
|
545
|
+
filteredMetadata.forEach(([key, value], index) => {
|
|
546
|
+
const isLastMeta = index === filteredMetadata.length - 1 &&
|
|
547
|
+
(!step.children || step.children.length === 0);
|
|
548
|
+
const metaConnector = isLastMeta ? "└─" : "├─";
|
|
549
|
+
const metaPrefix = isLast ? " " : "│";
|
|
550
|
+
let valueStr;
|
|
551
|
+
if (typeof value === "object" && value !== null) {
|
|
552
|
+
// For arrays, show content if it's guardNames or similar
|
|
553
|
+
if (Array.isArray(value)) {
|
|
554
|
+
if (key === "guardNames") {
|
|
555
|
+
valueStr = value.join(", ");
|
|
556
|
+
}
|
|
557
|
+
else {
|
|
558
|
+
valueStr = `[${value.length} items]`;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
else {
|
|
562
|
+
// For objects, show key count or skip if too complex
|
|
563
|
+
const obj = value;
|
|
564
|
+
if (Object.keys(obj).length > 3) {
|
|
565
|
+
valueStr = `{${Object.keys(obj).length} keys}`;
|
|
566
|
+
}
|
|
567
|
+
else {
|
|
568
|
+
// Show simple object as key:value pairs
|
|
569
|
+
valueStr = Object.entries(obj)
|
|
570
|
+
.map(([k, v]) => `${k}:${String(v).substring(0, 10)}`)
|
|
571
|
+
.join(", ");
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
else {
|
|
576
|
+
valueStr = String(value);
|
|
577
|
+
}
|
|
578
|
+
// Truncate long values
|
|
579
|
+
if (valueStr.length > 45) {
|
|
580
|
+
valueStr = valueStr.substring(0, 42) + "...";
|
|
581
|
+
}
|
|
582
|
+
output += `${indentStr}${metaPrefix} ${metaConnector} ${key}: ${colorText(valueStr, "none")}\n`;
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
// Add nested children (only if trackNested is enabled)
|
|
587
|
+
if (step.children && step.children.length > 0) {
|
|
588
|
+
step.children.forEach((child, index) => {
|
|
589
|
+
const isLastChild = index === step.children.length - 1;
|
|
590
|
+
output += formatFlowStep(child, indent + 2, isLastChild);
|
|
591
|
+
});
|
|
592
|
+
}
|
|
593
|
+
return output;
|
|
594
|
+
}
|
|
595
|
+
/**
|
|
596
|
+
* Get icon for step type.
|
|
597
|
+
*/
|
|
598
|
+
function getStepIcon(type) {
|
|
599
|
+
switch (type) {
|
|
600
|
+
case "middleware":
|
|
601
|
+
return "⚙";
|
|
602
|
+
case "guard":
|
|
603
|
+
return "🛡";
|
|
604
|
+
case "validation":
|
|
605
|
+
return "✓";
|
|
606
|
+
case "controller":
|
|
607
|
+
return "🎮";
|
|
608
|
+
case "use-case":
|
|
609
|
+
return "💼";
|
|
610
|
+
case "exception-filter":
|
|
611
|
+
return "⚠";
|
|
612
|
+
case "response":
|
|
613
|
+
return "📤";
|
|
614
|
+
default:
|
|
615
|
+
return "•";
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* Get icon for step status.
|
|
620
|
+
*/
|
|
621
|
+
function getStatusIcon(status) {
|
|
622
|
+
switch (status) {
|
|
623
|
+
case "success":
|
|
624
|
+
return "✓";
|
|
625
|
+
case "failure":
|
|
626
|
+
return "✗";
|
|
627
|
+
case "skipped":
|
|
628
|
+
return "⊘";
|
|
629
|
+
default:
|
|
630
|
+
return "•";
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* Get color for step type.
|
|
635
|
+
*/
|
|
636
|
+
function getStepColor(type) {
|
|
637
|
+
switch (type) {
|
|
638
|
+
case "middleware":
|
|
639
|
+
return "blue";
|
|
640
|
+
case "guard":
|
|
641
|
+
return "yellow";
|
|
642
|
+
case "validation":
|
|
643
|
+
return "green";
|
|
644
|
+
case "controller":
|
|
645
|
+
return "blue";
|
|
646
|
+
case "use-case":
|
|
647
|
+
return "blue";
|
|
648
|
+
case "exception-filter":
|
|
649
|
+
return "red";
|
|
650
|
+
case "response":
|
|
651
|
+
return "green";
|
|
652
|
+
default:
|
|
653
|
+
return "none";
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* Get color for step status.
|
|
658
|
+
*/
|
|
659
|
+
function getStatusColor(status) {
|
|
660
|
+
switch (status) {
|
|
661
|
+
case "success":
|
|
662
|
+
return "green";
|
|
663
|
+
case "failure":
|
|
664
|
+
return "red";
|
|
665
|
+
case "skipped":
|
|
666
|
+
return "yellow";
|
|
667
|
+
default:
|
|
668
|
+
return "none";
|
|
669
|
+
}
|
|
670
|
+
}
|