@elsikora/nestjs-crud-automator 1.9.0-dev.2 → 1.10.0-dev.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/dist/cjs/class/api/index.d.ts +2 -1
- package/dist/cjs/class/api/subscriber/base.class.d.ts +3 -0
- package/dist/cjs/class/api/subscriber/base.class.js +7 -0
- package/dist/cjs/class/api/subscriber/base.class.js.map +1 -0
- package/dist/cjs/class/api/subscriber/discovery-service.class.d.ts +9 -0
- package/dist/cjs/class/api/subscriber/discovery-service.class.js +46 -0
- package/dist/cjs/class/api/subscriber/discovery-service.class.js.map +1 -0
- package/dist/cjs/class/api/subscriber/executor.class.d.ts +10 -0
- package/dist/cjs/class/api/subscriber/executor.class.js +52 -0
- package/dist/cjs/class/api/subscriber/executor.class.js.map +1 -0
- package/dist/cjs/class/api/subscriber/function-base.class.d.ts +5 -0
- package/dist/cjs/class/api/subscriber/function-base.class.js +9 -0
- package/dist/cjs/class/api/subscriber/function-base.class.js.map +1 -0
- package/dist/cjs/class/api/subscriber/index.d.ts +6 -0
- package/dist/cjs/class/api/subscriber/registry.class.d.ts +15 -0
- package/dist/cjs/class/api/subscriber/registry.class.js +57 -0
- package/dist/cjs/class/api/subscriber/registry.class.js.map +1 -0
- package/dist/cjs/class/api/subscriber/route-base.class.d.ts +5 -0
- package/dist/cjs/class/api/subscriber/route-base.class.js +9 -0
- package/dist/cjs/class/api/subscriber/route-base.class.js.map +1 -0
- package/dist/cjs/class/metadata-storage.class.js +1 -2
- package/dist/cjs/class/metadata-storage.class.js.map +1 -1
- package/dist/cjs/class/utility/dto/property/factory/number.class.js +1 -0
- package/dist/cjs/class/utility/dto/property/factory/number.class.js.map +1 -1
- package/dist/cjs/class/utility/dto/property/factory/relation.class.js +1 -0
- package/dist/cjs/class/utility/dto/property/factory/relation.class.js.map +1 -1
- package/dist/cjs/class/utility/dto/strategy/body.class.js +1 -0
- package/dist/cjs/class/utility/dto/strategy/body.class.js.map +1 -1
- package/dist/cjs/class/utility/dto/strategy/query.class.js +1 -0
- package/dist/cjs/class/utility/dto/strategy/query.class.js.map +1 -1
- package/dist/cjs/class/utility/dto/strategy/request.class.js +1 -0
- package/dist/cjs/class/utility/dto/strategy/request.class.js.map +1 -1
- package/dist/cjs/class/utility/dto/strategy/response.class.js +1 -0
- package/dist/cjs/class/utility/dto/strategy/response.class.js.map +1 -1
- package/dist/cjs/constant/decorator/api/controller.constant.d.ts +1 -0
- package/dist/cjs/constant/decorator/api/controller.constant.js +2 -0
- package/dist/cjs/constant/decorator/api/controller.constant.js.map +1 -1
- package/dist/cjs/constant/decorator/api/property-describe.constant.d.ts +1 -1
- package/dist/cjs/constant/decorator/api/property-describe.constant.js +2 -2
- package/dist/cjs/constant/decorator/api/property-describe.constant.js.map +1 -1
- package/dist/cjs/constant/decorator/api/service.constant.d.ts +3 -0
- package/dist/cjs/constant/decorator/api/service.constant.js +9 -0
- package/dist/cjs/constant/decorator/api/service.constant.js.map +1 -0
- package/dist/cjs/constant/decorator/api/subscriber.constant.d.ts +4 -0
- package/dist/cjs/constant/decorator/api/subscriber.constant.js +11 -0
- package/dist/cjs/constant/decorator/api/subscriber.constant.js.map +1 -0
- package/dist/cjs/constant/utility/dto/constant.js +1 -0
- package/dist/cjs/constant/utility/dto/constant.js.map +1 -1
- package/dist/cjs/constant/validator/has-paired-custom-suffixes-fields.constant.js +0 -1
- package/dist/cjs/constant/validator/has-paired-custom-suffixes-fields.constant.js.map +1 -1
- package/dist/cjs/decorator/api/controller/index.d.ts +1 -0
- package/dist/cjs/decorator/api/controller/observable.decorator.d.ts +4 -0
- package/dist/cjs/decorator/api/controller/observable.decorator.js +15 -0
- package/dist/cjs/decorator/api/controller/observable.decorator.js.map +1 -0
- package/dist/cjs/decorator/api/function/create.decorator.d.ts +2 -2
- package/dist/cjs/decorator/api/function/create.decorator.js +45 -8
- package/dist/cjs/decorator/api/function/create.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/decorator.js +1 -1
- package/dist/cjs/decorator/api/function/decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/delete.decorator.d.ts +5 -1
- package/dist/cjs/decorator/api/function/delete.decorator.js +59 -7
- package/dist/cjs/decorator/api/function/delete.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get-list.decorator.d.ts +5 -1
- package/dist/cjs/decorator/api/function/get-list.decorator.js +56 -10
- package/dist/cjs/decorator/api/function/get-list.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get-many.decorator.d.ts +5 -1
- package/dist/cjs/decorator/api/function/get-many.decorator.js +53 -5
- package/dist/cjs/decorator/api/function/get-many.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get.decorator.d.ts +5 -1
- package/dist/cjs/decorator/api/function/get.decorator.js +53 -5
- package/dist/cjs/decorator/api/function/get.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/update.decorator.d.ts +5 -1
- package/dist/cjs/decorator/api/function/update.decorator.js +60 -11
- package/dist/cjs/decorator/api/function/update.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/index.d.ts +6 -3
- package/dist/cjs/decorator/api/method.decorator.js +1 -0
- package/dist/cjs/decorator/api/method.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/boolean.decorator.js +1 -2
- package/dist/cjs/decorator/api/property/boolean.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/copy.decorator.js +1 -1
- package/dist/cjs/decorator/api/property/copy.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/date.decorator.js +1 -2
- package/dist/cjs/decorator/api/property/date.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/describe.decorator.js +1 -1
- package/dist/cjs/decorator/api/property/describe.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/enum.decorator.js +0 -2
- package/dist/cjs/decorator/api/property/enum.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/number.decorator.js +1 -4
- package/dist/cjs/decorator/api/property/number.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/object.decorator.js +0 -4
- package/dist/cjs/decorator/api/property/object.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/string.decorator.js +4 -21
- package/dist/cjs/decorator/api/property/string.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/uuid.decorator.js +1 -2
- package/dist/cjs/decorator/api/property/uuid.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/service/index.d.ts +1 -0
- package/dist/cjs/decorator/api/service/observable.decorator.d.ts +4 -0
- package/dist/cjs/decorator/api/service/observable.decorator.js +15 -0
- package/dist/cjs/decorator/api/service/observable.decorator.js.map +1 -0
- package/dist/cjs/decorator/api/service.decorator.js +3 -37
- package/dist/cjs/decorator/api/service.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/subscriber/function.decorator.d.ts +9 -0
- package/dist/cjs/decorator/api/subscriber/function.decorator.js +18 -0
- package/dist/cjs/decorator/api/subscriber/function.decorator.js.map +1 -0
- package/dist/cjs/decorator/api/subscriber/index.d.ts +2 -0
- package/dist/cjs/decorator/api/subscriber/route.decorator.d.ts +9 -0
- package/dist/cjs/decorator/api/subscriber/route.decorator.js +18 -0
- package/dist/cjs/decorator/api/subscriber/route.decorator.js.map +1 -0
- package/dist/cjs/enum/decorator/api/index.d.ts +5 -4
- package/dist/cjs/enum/decorator/api/on-type.enum.d.ts +6 -0
- package/dist/cjs/enum/decorator/api/on-type.enum.js +10 -0
- package/dist/cjs/enum/decorator/api/on-type.enum.js.map +1 -0
- package/dist/cjs/external/@elsikora/cladi/dist/esm/domain/enum/logger-log-level.enum.js +14 -0
- package/dist/cjs/external/@elsikora/cladi/dist/esm/domain/enum/logger-log-level.enum.js.map +1 -0
- package/dist/cjs/external/@elsikora/cladi/dist/esm/infrastructure/class/base/error.class.js +31 -0
- package/dist/cjs/external/@elsikora/cladi/dist/esm/infrastructure/class/base/error.class.js.map +1 -0
- package/dist/cjs/external/@elsikora/cladi/dist/esm/infrastructure/class/base/registry.class.js +222 -0
- package/dist/cjs/external/@elsikora/cladi/dist/esm/infrastructure/class/base/registry.class.js.map +1 -0
- package/dist/cjs/external/@elsikora/cladi/dist/esm/infrastructure/constant/console-logger-default-options.constant.js +11 -0
- package/dist/cjs/external/@elsikora/cladi/dist/esm/infrastructure/constant/console-logger-default-options.constant.js.map +1 -0
- package/dist/cjs/external/@elsikora/cladi/dist/esm/infrastructure/service/console-logger.service.js +131 -0
- package/dist/cjs/external/@elsikora/cladi/dist/esm/infrastructure/service/console-logger.service.js.map +1 -0
- package/dist/cjs/external/@elsikora/cladi/dist/esm/presentation/utility/create/registry.utility.js +19 -0
- package/dist/cjs/external/@elsikora/cladi/dist/esm/presentation/utility/create/registry.utility.js.map +1 -0
- package/dist/cjs/factory/api/controller.factory.d.ts +2 -1
- package/dist/cjs/factory/api/controller.factory.js +299 -105
- package/dist/cjs/factory/api/controller.factory.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +33 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/interface/class/api/subscriber/execution-context.interface.d.ts +15 -0
- package/dist/cjs/interface/class/api/subscriber/function-execution-context.interface.d.ts +6 -0
- package/dist/cjs/interface/class/api/subscriber/function.interface.d.ts +31 -0
- package/dist/cjs/interface/class/api/subscriber/interface.d.ts +2 -0
- package/dist/cjs/interface/class/api/subscriber/route-execution-context.interface.d.ts +6 -0
- package/dist/cjs/interface/class/api/subscriber/route.interface.d.ts +39 -0
- package/dist/cjs/interface/decorator/api/function/create-executor-properties.interface.d.ts +2 -1
- package/dist/cjs/interface/decorator/api/function/delete-executor-properties.interface.d.ts +5 -4
- package/dist/cjs/interface/decorator/api/function/get-executor-properties.interface.d.ts +2 -1
- package/dist/cjs/interface/decorator/api/function/get-list-executor-properties.interface.d.ts +2 -1
- package/dist/cjs/interface/decorator/api/function/get-many-executor-properties.interface.d.ts +2 -1
- package/dist/cjs/interface/decorator/api/function/properties.interface.d.ts +2 -2
- package/dist/cjs/interface/decorator/api/function/update-executor-properties.interface.d.ts +5 -4
- package/dist/cjs/interface/decorator/api/index.d.ts +6 -5
- package/dist/cjs/interface/decorator/api/subscriber/function-properties.interface.d.ts +5 -0
- package/dist/cjs/interface/decorator/api/subscriber/index.d.ts +2 -0
- package/dist/cjs/interface/decorator/api/subscriber/route-properties.interface.d.ts +5 -0
- package/dist/cjs/module/api-subscriber.module.d.ts +2 -0
- package/dist/cjs/module/api-subscriber.module.js +17 -0
- package/dist/cjs/module/api-subscriber.module.js.map +1 -0
- package/dist/cjs/module/index.d.ts +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/utility/api/controller/apply-decorators.utility.js +1 -0
- package/dist/cjs/utility/api/controller/apply-decorators.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/apply-metadata.utility.js +1 -0
- package/dist/cjs/utility/api/controller/apply-metadata.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/get-list/transform-filter.utility.js +1 -0
- package/dist/cjs/utility/api/controller/get-list/transform-filter.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/get-list/transform-operation.utility.d.ts +5 -0
- package/dist/cjs/utility/api/controller/get-list/transform-operation.utility.js +5 -1
- package/dist/cjs/utility/api/controller/get-list/transform-operation.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/handle-request-relations.utility.js +4 -0
- package/dist/cjs/utility/api/controller/handle-request-relations.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/transform-data.utility.js +1 -0
- package/dist/cjs/utility/api/controller/transform-data.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/write-dto-swagger.utility.js +2 -4
- package/dist/cjs/utility/api/controller/write-dto-swagger.utility.js.map +1 -1
- package/dist/cjs/utility/api/filter-order-by-from-entity.utility.js +1 -1
- package/dist/cjs/utility/api/filter-order-by-from-entity.utility.js.map +1 -1
- package/dist/cjs/utility/dto/build-decorator.utility.js +1 -0
- package/dist/cjs/utility/dto/build-decorator.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate-dynamic.utility.js +1 -3
- package/dist/cjs/utility/dto/generate-dynamic.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate-exception.utility.js +1 -0
- package/dist/cjs/utility/dto/generate-exception.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate-filter-decorator.utility.js +1 -0
- package/dist/cjs/utility/dto/generate-filter-decorator.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate-get-list-response.utility.js +1 -0
- package/dist/cjs/utility/dto/generate-get-list-response.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate.utility.js +4 -18
- package/dist/cjs/utility/dto/generate.utility.js.map +1 -1
- package/dist/cjs/utility/dto/get-get-list-query-base-class.utility.js +1 -0
- package/dist/cjs/utility/dto/get-get-list-query-base-class.utility.js.map +1 -1
- package/dist/cjs/utility/dto/handle-date-property.utility.js +1 -0
- package/dist/cjs/utility/dto/handle-date-property.utility.js.map +1 -1
- package/dist/cjs/utility/dto/is-property-should-be-marked.utility.js +1 -0
- package/dist/cjs/utility/dto/is-property-should-be-marked.utility.js.map +1 -1
- package/dist/cjs/utility/dto/is-should-be-generated.utility.js +1 -0
- package/dist/cjs/utility/dto/is-should-be-generated.utility.js.map +1 -1
- package/dist/cjs/utility/logger.utility.js +3 -2
- package/dist/cjs/utility/logger.utility.js.map +1 -1
- package/dist/cjs/validator/all-or-none-of-listed-properties.validator.js +0 -1
- package/dist/cjs/validator/all-or-none-of-listed-properties.validator.js.map +1 -1
- package/dist/cjs/validator/has-at-least-one-and-only-one-of-listed-properties.validator.js +0 -1
- package/dist/cjs/validator/has-at-least-one-and-only-one-of-listed-properties.validator.js.map +1 -1
- package/dist/cjs/validator/has-at-least-one-of-listed-properties.validator.js +0 -1
- package/dist/cjs/validator/has-at-least-one-of-listed-properties.validator.js.map +1 -1
- package/dist/cjs/validator/has-at-least-one-property.validator.js +0 -1
- package/dist/cjs/validator/has-at-least-one-property.validator.js.map +1 -1
- package/dist/cjs/validator/has-paired-custom-suffixes-fields.validator.js +0 -1
- package/dist/cjs/validator/has-paired-custom-suffixes-fields.validator.js.map +1 -1
- package/dist/cjs/validator/must-match-one-of-schemas.validator.js +0 -1
- package/dist/cjs/validator/must-match-one-of-schemas.validator.js.map +1 -1
- package/dist/cjs/validator/only-one-of-listed-properties.validator.js +0 -1
- package/dist/cjs/validator/only-one-of-listed-properties.validator.js.map +1 -1
- package/dist/esm/class/api/index.d.ts +2 -1
- package/dist/esm/class/api/subscriber/base.class.d.ts +3 -0
- package/dist/esm/class/api/subscriber/base.class.js +5 -0
- package/dist/esm/class/api/subscriber/base.class.js.map +1 -0
- package/dist/esm/class/api/subscriber/discovery-service.class.d.ts +9 -0
- package/dist/esm/class/api/subscriber/discovery-service.class.js +46 -0
- package/dist/esm/class/api/subscriber/discovery-service.class.js.map +1 -0
- package/dist/esm/class/api/subscriber/executor.class.d.ts +10 -0
- package/dist/esm/class/api/subscriber/executor.class.js +50 -0
- package/dist/esm/class/api/subscriber/executor.class.js.map +1 -0
- package/dist/esm/class/api/subscriber/function-base.class.d.ts +5 -0
- package/dist/esm/class/api/subscriber/function-base.class.js +7 -0
- package/dist/esm/class/api/subscriber/function-base.class.js.map +1 -0
- package/dist/esm/class/api/subscriber/index.d.ts +6 -0
- package/dist/esm/class/api/subscriber/registry.class.d.ts +15 -0
- package/dist/esm/class/api/subscriber/registry.class.js +55 -0
- package/dist/esm/class/api/subscriber/registry.class.js.map +1 -0
- package/dist/esm/class/api/subscriber/route-base.class.d.ts +5 -0
- package/dist/esm/class/api/subscriber/route-base.class.js +7 -0
- package/dist/esm/class/api/subscriber/route-base.class.js.map +1 -0
- package/dist/esm/class/metadata-storage.class.js +1 -2
- package/dist/esm/class/metadata-storage.class.js.map +1 -1
- package/dist/esm/class/utility/dto/property/factory/number.class.js +1 -0
- package/dist/esm/class/utility/dto/property/factory/number.class.js.map +1 -1
- package/dist/esm/class/utility/dto/property/factory/relation.class.js +1 -0
- package/dist/esm/class/utility/dto/property/factory/relation.class.js.map +1 -1
- package/dist/esm/class/utility/dto/strategy/body.class.js +1 -0
- package/dist/esm/class/utility/dto/strategy/body.class.js.map +1 -1
- package/dist/esm/class/utility/dto/strategy/query.class.js +1 -0
- package/dist/esm/class/utility/dto/strategy/query.class.js.map +1 -1
- package/dist/esm/class/utility/dto/strategy/request.class.js +1 -0
- package/dist/esm/class/utility/dto/strategy/request.class.js.map +1 -1
- package/dist/esm/class/utility/dto/strategy/response.class.js +1 -0
- package/dist/esm/class/utility/dto/strategy/response.class.js.map +1 -1
- package/dist/esm/constant/decorator/api/controller.constant.d.ts +1 -0
- package/dist/esm/constant/decorator/api/controller.constant.js +2 -0
- package/dist/esm/constant/decorator/api/controller.constant.js.map +1 -1
- package/dist/esm/constant/decorator/api/property-describe.constant.d.ts +1 -1
- package/dist/esm/constant/decorator/api/property-describe.constant.js +2 -2
- package/dist/esm/constant/decorator/api/property-describe.constant.js.map +1 -1
- package/dist/esm/constant/decorator/api/service.constant.d.ts +3 -0
- package/dist/esm/constant/decorator/api/service.constant.js +7 -0
- package/dist/esm/constant/decorator/api/service.constant.js.map +1 -0
- package/dist/esm/constant/decorator/api/subscriber.constant.d.ts +4 -0
- package/dist/esm/constant/decorator/api/subscriber.constant.js +9 -0
- package/dist/esm/constant/decorator/api/subscriber.constant.js.map +1 -0
- package/dist/esm/constant/utility/dto/constant.js +1 -0
- package/dist/esm/constant/utility/dto/constant.js.map +1 -1
- package/dist/esm/constant/validator/has-paired-custom-suffixes-fields.constant.js +0 -1
- package/dist/esm/constant/validator/has-paired-custom-suffixes-fields.constant.js.map +1 -1
- package/dist/esm/decorator/api/controller/index.d.ts +1 -0
- package/dist/esm/decorator/api/controller/observable.decorator.d.ts +4 -0
- package/dist/esm/decorator/api/controller/observable.decorator.js +13 -0
- package/dist/esm/decorator/api/controller/observable.decorator.js.map +1 -0
- package/dist/esm/decorator/api/function/create.decorator.d.ts +2 -2
- package/dist/esm/decorator/api/function/create.decorator.js +45 -8
- package/dist/esm/decorator/api/function/create.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/decorator.js +1 -1
- package/dist/esm/decorator/api/function/decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/delete.decorator.d.ts +5 -1
- package/dist/esm/decorator/api/function/delete.decorator.js +59 -7
- package/dist/esm/decorator/api/function/delete.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/get-list.decorator.d.ts +5 -1
- package/dist/esm/decorator/api/function/get-list.decorator.js +56 -10
- package/dist/esm/decorator/api/function/get-list.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/get-many.decorator.d.ts +5 -1
- package/dist/esm/decorator/api/function/get-many.decorator.js +53 -5
- package/dist/esm/decorator/api/function/get-many.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/get.decorator.d.ts +5 -1
- package/dist/esm/decorator/api/function/get.decorator.js +53 -5
- package/dist/esm/decorator/api/function/get.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/update.decorator.d.ts +5 -1
- package/dist/esm/decorator/api/function/update.decorator.js +60 -11
- package/dist/esm/decorator/api/function/update.decorator.js.map +1 -1
- package/dist/esm/decorator/api/index.d.ts +6 -3
- package/dist/esm/decorator/api/method.decorator.js +1 -0
- package/dist/esm/decorator/api/method.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/boolean.decorator.js +1 -2
- package/dist/esm/decorator/api/property/boolean.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/copy.decorator.js +1 -1
- package/dist/esm/decorator/api/property/copy.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/date.decorator.js +1 -2
- package/dist/esm/decorator/api/property/date.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/describe.decorator.js +1 -1
- package/dist/esm/decorator/api/property/describe.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/enum.decorator.js +0 -2
- package/dist/esm/decorator/api/property/enum.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/number.decorator.js +1 -4
- package/dist/esm/decorator/api/property/number.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/object.decorator.js +0 -4
- package/dist/esm/decorator/api/property/object.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/string.decorator.js +4 -21
- package/dist/esm/decorator/api/property/string.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/uuid.decorator.js +1 -2
- package/dist/esm/decorator/api/property/uuid.decorator.js.map +1 -1
- package/dist/esm/decorator/api/service/index.d.ts +1 -0
- package/dist/esm/decorator/api/service/observable.decorator.d.ts +4 -0
- package/dist/esm/decorator/api/service/observable.decorator.js +13 -0
- package/dist/esm/decorator/api/service/observable.decorator.js.map +1 -0
- package/dist/esm/decorator/api/service.decorator.js +3 -37
- package/dist/esm/decorator/api/service.decorator.js.map +1 -1
- package/dist/esm/decorator/api/subscriber/function.decorator.d.ts +9 -0
- package/dist/esm/decorator/api/subscriber/function.decorator.js +16 -0
- package/dist/esm/decorator/api/subscriber/function.decorator.js.map +1 -0
- package/dist/esm/decorator/api/subscriber/index.d.ts +2 -0
- package/dist/esm/decorator/api/subscriber/route.decorator.d.ts +9 -0
- package/dist/esm/decorator/api/subscriber/route.decorator.js +16 -0
- package/dist/esm/decorator/api/subscriber/route.decorator.js.map +1 -0
- package/dist/esm/enum/decorator/api/index.d.ts +5 -4
- package/dist/esm/enum/decorator/api/on-type.enum.d.ts +6 -0
- package/dist/esm/enum/decorator/api/on-type.enum.js +10 -0
- package/dist/esm/enum/decorator/api/on-type.enum.js.map +1 -0
- package/dist/esm/external/@elsikora/cladi/dist/esm/domain/enum/logger-log-level.enum.js +14 -0
- package/dist/esm/external/@elsikora/cladi/dist/esm/domain/enum/logger-log-level.enum.js.map +1 -0
- package/dist/esm/external/@elsikora/cladi/dist/esm/infrastructure/class/base/error.class.js +29 -0
- package/dist/esm/external/@elsikora/cladi/dist/esm/infrastructure/class/base/error.class.js.map +1 -0
- package/dist/esm/external/@elsikora/cladi/dist/esm/infrastructure/class/base/registry.class.js +220 -0
- package/dist/esm/external/@elsikora/cladi/dist/esm/infrastructure/class/base/registry.class.js.map +1 -0
- package/dist/esm/external/@elsikora/cladi/dist/esm/infrastructure/constant/console-logger-default-options.constant.js +9 -0
- package/dist/esm/external/@elsikora/cladi/dist/esm/infrastructure/constant/console-logger-default-options.constant.js.map +1 -0
- package/dist/esm/external/@elsikora/cladi/dist/esm/infrastructure/service/console-logger.service.js +129 -0
- package/dist/esm/external/@elsikora/cladi/dist/esm/infrastructure/service/console-logger.service.js.map +1 -0
- package/dist/esm/external/@elsikora/cladi/dist/esm/presentation/utility/create/registry.utility.js +17 -0
- package/dist/esm/external/@elsikora/cladi/dist/esm/presentation/utility/create/registry.utility.js.map +1 -0
- package/dist/esm/factory/api/controller.factory.d.ts +2 -1
- package/dist/esm/factory/api/controller.factory.js +299 -105
- package/dist/esm/factory/api/controller.factory.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interface/class/api/subscriber/execution-context.interface.d.ts +15 -0
- package/dist/esm/interface/class/api/subscriber/function-execution-context.interface.d.ts +6 -0
- package/dist/esm/interface/class/api/subscriber/function.interface.d.ts +31 -0
- package/dist/esm/interface/class/api/subscriber/interface.d.ts +2 -0
- package/dist/esm/interface/class/api/subscriber/route-execution-context.interface.d.ts +6 -0
- package/dist/esm/interface/class/api/subscriber/route.interface.d.ts +39 -0
- package/dist/esm/interface/decorator/api/function/create-executor-properties.interface.d.ts +2 -1
- package/dist/esm/interface/decorator/api/function/delete-executor-properties.interface.d.ts +5 -4
- package/dist/esm/interface/decorator/api/function/get-executor-properties.interface.d.ts +2 -1
- package/dist/esm/interface/decorator/api/function/get-list-executor-properties.interface.d.ts +2 -1
- package/dist/esm/interface/decorator/api/function/get-many-executor-properties.interface.d.ts +2 -1
- package/dist/esm/interface/decorator/api/function/properties.interface.d.ts +2 -2
- package/dist/esm/interface/decorator/api/function/update-executor-properties.interface.d.ts +5 -4
- package/dist/esm/interface/decorator/api/index.d.ts +6 -5
- package/dist/esm/interface/decorator/api/subscriber/function-properties.interface.d.ts +5 -0
- package/dist/esm/interface/decorator/api/subscriber/index.d.ts +2 -0
- package/dist/esm/interface/decorator/api/subscriber/route-properties.interface.d.ts +5 -0
- package/dist/esm/module/api-subscriber.module.d.ts +2 -0
- package/dist/esm/module/api-subscriber.module.js +17 -0
- package/dist/esm/module/api-subscriber.module.js.map +1 -0
- package/dist/esm/module/index.d.ts +1 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/utility/api/controller/apply-decorators.utility.js +1 -0
- package/dist/esm/utility/api/controller/apply-decorators.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/apply-metadata.utility.js +1 -0
- package/dist/esm/utility/api/controller/apply-metadata.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/get-list/transform-filter.utility.js +1 -0
- package/dist/esm/utility/api/controller/get-list/transform-filter.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/get-list/transform-operation.utility.d.ts +5 -0
- package/dist/esm/utility/api/controller/get-list/transform-operation.utility.js +5 -1
- package/dist/esm/utility/api/controller/get-list/transform-operation.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/handle-request-relations.utility.js +4 -0
- package/dist/esm/utility/api/controller/handle-request-relations.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/transform-data.utility.js +1 -0
- package/dist/esm/utility/api/controller/transform-data.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/write-dto-swagger.utility.js +2 -4
- package/dist/esm/utility/api/controller/write-dto-swagger.utility.js.map +1 -1
- package/dist/esm/utility/api/filter-order-by-from-entity.utility.js +1 -1
- package/dist/esm/utility/api/filter-order-by-from-entity.utility.js.map +1 -1
- package/dist/esm/utility/dto/build-decorator.utility.js +1 -0
- package/dist/esm/utility/dto/build-decorator.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate-dynamic.utility.js +1 -3
- package/dist/esm/utility/dto/generate-dynamic.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate-exception.utility.js +1 -0
- package/dist/esm/utility/dto/generate-exception.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate-filter-decorator.utility.js +1 -0
- package/dist/esm/utility/dto/generate-filter-decorator.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate-get-list-response.utility.js +1 -0
- package/dist/esm/utility/dto/generate-get-list-response.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate.utility.js +4 -18
- package/dist/esm/utility/dto/generate.utility.js.map +1 -1
- package/dist/esm/utility/dto/get-get-list-query-base-class.utility.js +1 -0
- package/dist/esm/utility/dto/get-get-list-query-base-class.utility.js.map +1 -1
- package/dist/esm/utility/dto/handle-date-property.utility.js +1 -0
- package/dist/esm/utility/dto/handle-date-property.utility.js.map +1 -1
- package/dist/esm/utility/dto/is-property-should-be-marked.utility.js +1 -0
- package/dist/esm/utility/dto/is-property-should-be-marked.utility.js.map +1 -1
- package/dist/esm/utility/dto/is-should-be-generated.utility.js +1 -0
- package/dist/esm/utility/dto/is-should-be-generated.utility.js.map +1 -1
- package/dist/esm/utility/logger.utility.js +3 -2
- package/dist/esm/utility/logger.utility.js.map +1 -1
- package/dist/esm/validator/all-or-none-of-listed-properties.validator.js +0 -1
- package/dist/esm/validator/all-or-none-of-listed-properties.validator.js.map +1 -1
- package/dist/esm/validator/has-at-least-one-and-only-one-of-listed-properties.validator.js +0 -1
- package/dist/esm/validator/has-at-least-one-and-only-one-of-listed-properties.validator.js.map +1 -1
- package/dist/esm/validator/has-at-least-one-of-listed-properties.validator.js +0 -1
- package/dist/esm/validator/has-at-least-one-of-listed-properties.validator.js.map +1 -1
- package/dist/esm/validator/has-at-least-one-property.validator.js +0 -1
- package/dist/esm/validator/has-at-least-one-property.validator.js.map +1 -1
- package/dist/esm/validator/has-paired-custom-suffixes-fields.validator.js +0 -1
- package/dist/esm/validator/has-paired-custom-suffixes-fields.validator.js.map +1 -1
- package/dist/esm/validator/must-match-one-of-schemas.validator.js +0 -1
- package/dist/esm/validator/must-match-one-of-schemas.validator.js.map +1 -1
- package/dist/esm/validator/only-one-of-listed-properties.validator.js +0 -1
- package/dist/esm/validator/only-one-of-listed-properties.validator.js.map +1 -1
- package/package.json +21 -18
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.EApiSubscriberOnType = void 0;
|
|
4
|
+
(function (EApiSubscriberOnType) {
|
|
5
|
+
EApiSubscriberOnType["AFTER"] = "After";
|
|
6
|
+
EApiSubscriberOnType["AFTER_ERROR"] = "AfterError";
|
|
7
|
+
EApiSubscriberOnType["BEFORE"] = "Before";
|
|
8
|
+
EApiSubscriberOnType["BEFORE_ERROR"] = "BeforeError";
|
|
9
|
+
})(exports.EApiSubscriberOnType || (exports.EApiSubscriberOnType = {}));
|
|
10
|
+
//# sourceMappingURL=on-type.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"on-type.enum.js","sources":["../../../../../../src/enum/decorator/api/on-type.enum.ts"],"sourcesContent":[null],"names":["EApiSubscriberOnType"],"mappings":";;AAAYA;AAAZ,CAAA,UAAY,oBAAoB,EAAA;AAC/B,IAAA,oBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,oBAAA,CAAA,aAAA,CAAA,GAAA,YAA0B;AAC1B,IAAA,oBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,oBAAA,CAAA,cAAA,CAAA,GAAA,aAA4B;AAC7B,CAAC,EALWA,4BAAoB,KAApBA,4BAAoB,GAK/B,EAAA,CAAA,CAAA;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Log levels.
|
|
5
|
+
*/
|
|
6
|
+
exports.ELoggerLogLevel = void 0;
|
|
7
|
+
(function (ELoggerLogLevel) {
|
|
8
|
+
ELoggerLogLevel["DEBUG"] = "debug";
|
|
9
|
+
ELoggerLogLevel["ERROR"] = "error";
|
|
10
|
+
ELoggerLogLevel["INFO"] = "info";
|
|
11
|
+
ELoggerLogLevel["TRACE"] = "trace";
|
|
12
|
+
ELoggerLogLevel["WARN"] = "warn";
|
|
13
|
+
})(exports.ELoggerLogLevel || (exports.ELoggerLogLevel = {}));
|
|
14
|
+
//# sourceMappingURL=logger-log-level.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger-log-level.enum.js","sources":["../../../../../../../../../node_modules/@elsikora/cladi/dist/esm/domain/enum/logger-log-level.enum.js"],"sourcesContent":["/**\n * Log levels.\n */\nvar ELoggerLogLevel;\n(function (ELoggerLogLevel) {\n ELoggerLogLevel[\"DEBUG\"] = \"debug\";\n ELoggerLogLevel[\"ERROR\"] = \"error\";\n ELoggerLogLevel[\"INFO\"] = \"info\";\n ELoggerLogLevel[\"TRACE\"] = \"trace\";\n ELoggerLogLevel[\"WARN\"] = \"warn\";\n})(ELoggerLogLevel || (ELoggerLogLevel = {}));\n\nexport { ELoggerLogLevel };\n//# sourceMappingURL=logger-log-level.enum.js.map\n"],"names":["ELoggerLogLevel"],"mappings":";;AAAA;AACA;AACA;AACIA;AACJ,CAAC,UAAU,eAAe,EAAE;AAC5B,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO;AACtC,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO;AACtC,IAAI,eAAe,CAAC,MAAM,CAAC,GAAG,MAAM;AACpC,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO;AACtC,IAAI,eAAe,CAAC,MAAM,CAAC,GAAG,MAAM;AACpC,CAAC,EAAEA,uBAAe,KAAKA,uBAAe,GAAG,EAAE,CAAC,CAAC;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Base error class.
|
|
5
|
+
* @see {@link https://elsikora.com/docs/cladi/core-concepts/error-handling}
|
|
6
|
+
*/
|
|
7
|
+
class BaseError extends Error {
|
|
8
|
+
CAUSE;
|
|
9
|
+
CODE;
|
|
10
|
+
CONTEXT;
|
|
11
|
+
SOURCE;
|
|
12
|
+
/**
|
|
13
|
+
* Creates a new base error.
|
|
14
|
+
* @param {string} message Error message.
|
|
15
|
+
* @param {IBaseErrorOptions} options Error options.
|
|
16
|
+
*/
|
|
17
|
+
constructor(message, options) {
|
|
18
|
+
super(message);
|
|
19
|
+
this.name = this.constructor.name;
|
|
20
|
+
this.CAUSE = options.cause;
|
|
21
|
+
this.CODE = options.code;
|
|
22
|
+
this.CONTEXT = options.context;
|
|
23
|
+
this.SOURCE = options.source;
|
|
24
|
+
if (typeof Error.captureStackTrace === "function") {
|
|
25
|
+
Error.captureStackTrace(this, this.constructor);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
exports.BaseError = BaseError;
|
|
31
|
+
//# sourceMappingURL=error.class.js.map
|
package/dist/cjs/external/@elsikora/cladi/dist/esm/infrastructure/class/base/error.class.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.class.js","sources":["../../../../../../../../../../node_modules/@elsikora/cladi/dist/esm/infrastructure/class/base/error.class.js"],"sourcesContent":["/**\n * Base error class.\n * @see {@link https://elsikora.com/docs/cladi/core-concepts/error-handling}\n */\nclass BaseError extends Error {\n CAUSE;\n CODE;\n CONTEXT;\n SOURCE;\n /**\n * Creates a new base error.\n * @param {string} message Error message.\n * @param {IBaseErrorOptions} options Error options.\n */\n constructor(message, options) {\n super(message);\n this.name = this.constructor.name;\n this.CAUSE = options.cause;\n this.CODE = options.code;\n this.CONTEXT = options.context;\n this.SOURCE = options.source;\n if (typeof Error.captureStackTrace === \"function\") {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n}\n\nexport { BaseError };\n//# sourceMappingURL=error.class.js.map\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA,MAAM,SAAS,SAAS,KAAK,CAAC;AAC9B,IAAI,KAAK;AACT,IAAI,IAAI;AACR,IAAI,OAAO;AACX,IAAI,MAAM;AACV;AACA;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE;AAClC,QAAQ,KAAK,CAAC,OAAO,CAAC;AACtB,QAAQ,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI;AACzC,QAAQ,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK;AAClC,QAAQ,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI;AAChC,QAAQ,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO;AACtC,QAAQ,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM;AACpC,QAAQ,IAAI,OAAO,KAAK,CAAC,iBAAiB,KAAK,UAAU,EAAE;AAC3D,YAAY,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC;AAC3D;AACA;AACA;;;;","x_google_ignoreList":[0]}
|
package/dist/cjs/external/@elsikora/cladi/dist/esm/infrastructure/class/base/registry.class.js
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var error_class = require('./error.class.js');
|
|
4
|
+
var consoleLogger_service = require('../../service/console-logger.service.js');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Generic registry implementation that stores items by name.
|
|
8
|
+
* @template T The type of items stored in the registry.
|
|
9
|
+
* @see {@link https://elsikora.com/docs/cladi/core-concepts/registry}
|
|
10
|
+
*/
|
|
11
|
+
class BaseRegistry {
|
|
12
|
+
CACHE;
|
|
13
|
+
ITEMS;
|
|
14
|
+
LOGGER;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new registry instance.
|
|
17
|
+
* @param {IBaseRegistryOptions} options Registry creation options including logger.
|
|
18
|
+
*/
|
|
19
|
+
constructor(options) {
|
|
20
|
+
this.ITEMS = new Map();
|
|
21
|
+
this.CACHE = new Map();
|
|
22
|
+
this.LOGGER = options.logger ?? new consoleLogger_service.ConsoleLoggerService();
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Clear the registry.
|
|
26
|
+
*/
|
|
27
|
+
clear() {
|
|
28
|
+
this.LOGGER.debug("Clearing registry", { source: "Registry" });
|
|
29
|
+
this.ITEMS.clear();
|
|
30
|
+
this.clearCache();
|
|
31
|
+
this.LOGGER.debug("Registry cleared", { source: "Registry" });
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get a single item from the registry by name.
|
|
35
|
+
* @param {string} name The name of the item to get.
|
|
36
|
+
* @returns {T | undefined} The item or undefined if it doesn't exist.
|
|
37
|
+
*/
|
|
38
|
+
get(name) {
|
|
39
|
+
this.LOGGER.debug(`Getting item with name: ${name}`, { source: "Registry" });
|
|
40
|
+
if (!name) {
|
|
41
|
+
this.LOGGER.warn("Attempted to get item with empty name", { source: "Registry" });
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
const item = this.ITEMS.get(name);
|
|
45
|
+
if (item) {
|
|
46
|
+
this.LOGGER.debug(`Item found: ${name}`, { source: "Registry" });
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
this.LOGGER.debug(`Item not found: ${name}`, { source: "Registry" });
|
|
50
|
+
}
|
|
51
|
+
return item;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Get all items from the registry.
|
|
55
|
+
* @returns {Array<T>} An array of all items.
|
|
56
|
+
*/
|
|
57
|
+
getAll() {
|
|
58
|
+
this.LOGGER.debug("Getting all items", { source: "Registry" });
|
|
59
|
+
const cacheKey = "getAll";
|
|
60
|
+
const cachedResult = this.CACHE.get(cacheKey);
|
|
61
|
+
if (cachedResult) {
|
|
62
|
+
this.LOGGER.debug("Cache hit for getAll query", { source: "Registry" });
|
|
63
|
+
return cachedResult;
|
|
64
|
+
}
|
|
65
|
+
const result = [...this.ITEMS.values()];
|
|
66
|
+
this.CACHE.set(cacheKey, result);
|
|
67
|
+
this.LOGGER.debug(`Cached result for getAll query with ${String(result.length)} items`, { source: "Registry" });
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Get multiple items from the registry by their names.
|
|
72
|
+
* @param {Array<string>} names The names of the items to get.
|
|
73
|
+
* @returns {Array<T>} An array of items.
|
|
74
|
+
*/
|
|
75
|
+
getMany(names) {
|
|
76
|
+
if (!names) {
|
|
77
|
+
throw new error_class.BaseError("Names cannot be null or undefined", {
|
|
78
|
+
code: "REGISTRY_NAMES_NOT_NULL_OR_UNDEFINED",
|
|
79
|
+
source: "Registry",
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
if (!Array.isArray(names)) {
|
|
83
|
+
throw new error_class.BaseError("Names must be an array", {
|
|
84
|
+
code: "REGISTRY_NAMES_NOT_ARRAY",
|
|
85
|
+
source: "Registry",
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
this.LOGGER.debug(`Getting ${String(names.length)} items by name`, { source: "Registry" });
|
|
89
|
+
const cacheKey = `getMany:${names.join(",")}`;
|
|
90
|
+
const cachedResult = this.CACHE.get(cacheKey);
|
|
91
|
+
if (cachedResult) {
|
|
92
|
+
this.LOGGER.debug(`Cache hit for query: ${cacheKey}`, { source: "Registry" });
|
|
93
|
+
return cachedResult;
|
|
94
|
+
}
|
|
95
|
+
const result = names.map((name) => this.get(name)).filter((item) => item !== undefined);
|
|
96
|
+
this.CACHE.set(cacheKey, result);
|
|
97
|
+
this.LOGGER.debug(`Cached result for query: ${cacheKey}`, { source: "Registry" });
|
|
98
|
+
return result;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Check if an item exists in the registry by name.
|
|
102
|
+
* @param {string} name The name of the item to check.
|
|
103
|
+
* @returns {boolean} True if the item exists, false otherwise.
|
|
104
|
+
*/
|
|
105
|
+
has(name) {
|
|
106
|
+
this.LOGGER.debug(`Checking if item exists: ${name}`, { source: "Registry" });
|
|
107
|
+
if (!name) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
const isExisting = this.ITEMS.has(name);
|
|
111
|
+
this.LOGGER.debug(`Item ${isExisting ? "exists" : "does not exist"}: ${name}`, { source: "Registry" });
|
|
112
|
+
return isExisting;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Register a single item in the registry.
|
|
116
|
+
* @param {T} item The item to register.
|
|
117
|
+
* @throws ValidationError if the item is invalid.
|
|
118
|
+
*/
|
|
119
|
+
register(item) {
|
|
120
|
+
if (!item) {
|
|
121
|
+
throw new error_class.BaseError("Item cannot be null or undefined", {
|
|
122
|
+
code: "REGISTRY_ITEM_NOT_NULL_OR_UNDEFINED",
|
|
123
|
+
source: "Registry",
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
this.LOGGER.debug(`Registering item with name: ${item.getName()}`, { source: "Registry" });
|
|
127
|
+
if (this.has(item.getName())) {
|
|
128
|
+
throw new error_class.BaseError("Item already exists in registry", {
|
|
129
|
+
code: "REGISTRY_ITEM_ALREADY_EXISTS",
|
|
130
|
+
source: "Registry",
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
this.ITEMS.set(item.getName(), item);
|
|
134
|
+
this.clearCache();
|
|
135
|
+
this.LOGGER.debug(`Item registered successfully: ${item.getName()}`, { source: "Registry" });
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Register multiple items in the registry.
|
|
139
|
+
* @param {Array<T>} items The items to register.
|
|
140
|
+
* @throws ValidationError if any item is invalid.
|
|
141
|
+
*/
|
|
142
|
+
registerMany(items) {
|
|
143
|
+
if (!items) {
|
|
144
|
+
throw new error_class.BaseError("Items cannot be null or undefined", {
|
|
145
|
+
code: "REGISTRY_ITEMS_NOT_NULL_OR_UNDEFINED",
|
|
146
|
+
source: "Registry",
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
if (!Array.isArray(items)) {
|
|
150
|
+
throw new error_class.BaseError("Items must be an array", {
|
|
151
|
+
code: "REGISTRY_ITEMS_NOT_ARRAY",
|
|
152
|
+
source: "Registry",
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
this.LOGGER.debug(`Registering ${String(items.length)} items`, { source: "Registry" });
|
|
156
|
+
for (const item of items) {
|
|
157
|
+
this.register(item);
|
|
158
|
+
}
|
|
159
|
+
this.LOGGER.debug(`${String(items.length)} items registered successfully`, { source: "Registry" });
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Unregister a single item from the registry by name.
|
|
163
|
+
* @param {string} name The name of the item to unregister.
|
|
164
|
+
*/
|
|
165
|
+
unregister(name) {
|
|
166
|
+
this.LOGGER.debug(`Unregistering item with name: ${name}`, { source: "Registry" });
|
|
167
|
+
if (!name) {
|
|
168
|
+
throw new error_class.BaseError("Name cannot be empty", {
|
|
169
|
+
code: "REGISTRY_NAME_NOT_EMPTY",
|
|
170
|
+
source: "Registry",
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
const wasDeleted = this.ITEMS.delete(name);
|
|
174
|
+
this.clearCache();
|
|
175
|
+
if (wasDeleted) {
|
|
176
|
+
this.LOGGER.debug(`Item unregistered successfully: ${name}`, { source: "Registry" });
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
this.LOGGER.debug(`Item not found for unregistering: ${name}`, { source: "Registry" });
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Unregister multiple items from the registry by their names.
|
|
184
|
+
* @param {Array<string>} names The names of the items to unregister.
|
|
185
|
+
*/
|
|
186
|
+
unregisterMany(names) {
|
|
187
|
+
if (!names) {
|
|
188
|
+
throw new error_class.BaseError("Names cannot be null or undefined", {
|
|
189
|
+
code: "REGISTRY_NAMES_NOT_NULL_OR_UNDEFINED",
|
|
190
|
+
source: "Registry",
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
if (!Array.isArray(names)) {
|
|
194
|
+
throw new error_class.BaseError("Names must be an array", {
|
|
195
|
+
code: "REGISTRY_NAMES_NOT_ARRAY",
|
|
196
|
+
source: "Registry",
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
this.LOGGER.debug(`Unregistering ${String(names.length)} items`, { source: "Registry" });
|
|
200
|
+
for (const name of names) {
|
|
201
|
+
this.unregister(name);
|
|
202
|
+
}
|
|
203
|
+
this.LOGGER.debug(`${String(names.length)} items unregistered`, { source: "Registry" });
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Clear the cache for a specific query or all caches if no query is provided.
|
|
207
|
+
* @param {string} [cacheKey] Optional cache key to clear. If not provided, all caches are cleared.
|
|
208
|
+
*/
|
|
209
|
+
clearCache(cacheKey) {
|
|
210
|
+
if (cacheKey) {
|
|
211
|
+
this.CACHE.delete(cacheKey);
|
|
212
|
+
this.LOGGER.debug(`Cache cleared for key: ${cacheKey}`, { source: "Registry" });
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
this.CACHE.clear();
|
|
216
|
+
this.LOGGER.debug("All caches cleared", { source: "Registry" });
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
exports.BaseRegistry = BaseRegistry;
|
|
222
|
+
//# sourceMappingURL=registry.class.js.map
|
package/dist/cjs/external/@elsikora/cladi/dist/esm/infrastructure/class/base/registry.class.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.class.js","sources":["../../../../../../../../../../node_modules/@elsikora/cladi/dist/esm/infrastructure/class/base/registry.class.js"],"sourcesContent":["import { BaseError } from './error.class.js';\nimport { ConsoleLoggerService } from '../../service/console-logger.service.js';\n\n/**\n * Generic registry implementation that stores items by name.\n * @template T The type of items stored in the registry.\n * @see {@link https://elsikora.com/docs/cladi/core-concepts/registry}\n */\nclass BaseRegistry {\n CACHE;\n ITEMS;\n LOGGER;\n /**\n * Creates a new registry instance.\n * @param {IBaseRegistryOptions} options Registry creation options including logger.\n */\n constructor(options) {\n this.ITEMS = new Map();\n this.CACHE = new Map();\n this.LOGGER = options.logger ?? new ConsoleLoggerService();\n }\n /**\n * Clear the registry.\n */\n clear() {\n this.LOGGER.debug(\"Clearing registry\", { source: \"Registry\" });\n this.ITEMS.clear();\n this.clearCache();\n this.LOGGER.debug(\"Registry cleared\", { source: \"Registry\" });\n }\n /**\n * Get a single item from the registry by name.\n * @param {string} name The name of the item to get.\n * @returns {T | undefined} The item or undefined if it doesn't exist.\n */\n get(name) {\n this.LOGGER.debug(`Getting item with name: ${name}`, { source: \"Registry\" });\n if (!name) {\n this.LOGGER.warn(\"Attempted to get item with empty name\", { source: \"Registry\" });\n return undefined;\n }\n const item = this.ITEMS.get(name);\n if (item) {\n this.LOGGER.debug(`Item found: ${name}`, { source: \"Registry\" });\n }\n else {\n this.LOGGER.debug(`Item not found: ${name}`, { source: \"Registry\" });\n }\n return item;\n }\n /**\n * Get all items from the registry.\n * @returns {Array<T>} An array of all items.\n */\n getAll() {\n this.LOGGER.debug(\"Getting all items\", { source: \"Registry\" });\n const cacheKey = \"getAll\";\n const cachedResult = this.CACHE.get(cacheKey);\n if (cachedResult) {\n this.LOGGER.debug(\"Cache hit for getAll query\", { source: \"Registry\" });\n return cachedResult;\n }\n const result = [...this.ITEMS.values()];\n this.CACHE.set(cacheKey, result);\n this.LOGGER.debug(`Cached result for getAll query with ${String(result.length)} items`, { source: \"Registry\" });\n return result;\n }\n /**\n * Get multiple items from the registry by their names.\n * @param {Array<string>} names The names of the items to get.\n * @returns {Array<T>} An array of items.\n */\n getMany(names) {\n if (!names) {\n throw new BaseError(\"Names cannot be null or undefined\", {\n code: \"REGISTRY_NAMES_NOT_NULL_OR_UNDEFINED\",\n source: \"Registry\",\n });\n }\n if (!Array.isArray(names)) {\n throw new BaseError(\"Names must be an array\", {\n code: \"REGISTRY_NAMES_NOT_ARRAY\",\n source: \"Registry\",\n });\n }\n this.LOGGER.debug(`Getting ${String(names.length)} items by name`, { source: \"Registry\" });\n const cacheKey = `getMany:${names.join(\",\")}`;\n const cachedResult = this.CACHE.get(cacheKey);\n if (cachedResult) {\n this.LOGGER.debug(`Cache hit for query: ${cacheKey}`, { source: \"Registry\" });\n return cachedResult;\n }\n const result = names.map((name) => this.get(name)).filter((item) => item !== undefined);\n this.CACHE.set(cacheKey, result);\n this.LOGGER.debug(`Cached result for query: ${cacheKey}`, { source: \"Registry\" });\n return result;\n }\n /**\n * Check if an item exists in the registry by name.\n * @param {string} name The name of the item to check.\n * @returns {boolean} True if the item exists, false otherwise.\n */\n has(name) {\n this.LOGGER.debug(`Checking if item exists: ${name}`, { source: \"Registry\" });\n if (!name) {\n return false;\n }\n const isExisting = this.ITEMS.has(name);\n this.LOGGER.debug(`Item ${isExisting ? \"exists\" : \"does not exist\"}: ${name}`, { source: \"Registry\" });\n return isExisting;\n }\n /**\n * Register a single item in the registry.\n * @param {T} item The item to register.\n * @throws ValidationError if the item is invalid.\n */\n register(item) {\n if (!item) {\n throw new BaseError(\"Item cannot be null or undefined\", {\n code: \"REGISTRY_ITEM_NOT_NULL_OR_UNDEFINED\",\n source: \"Registry\",\n });\n }\n this.LOGGER.debug(`Registering item with name: ${item.getName()}`, { source: \"Registry\" });\n if (this.has(item.getName())) {\n throw new BaseError(\"Item already exists in registry\", {\n code: \"REGISTRY_ITEM_ALREADY_EXISTS\",\n source: \"Registry\",\n });\n }\n this.ITEMS.set(item.getName(), item);\n this.clearCache();\n this.LOGGER.debug(`Item registered successfully: ${item.getName()}`, { source: \"Registry\" });\n }\n /**\n * Register multiple items in the registry.\n * @param {Array<T>} items The items to register.\n * @throws ValidationError if any item is invalid.\n */\n registerMany(items) {\n if (!items) {\n throw new BaseError(\"Items cannot be null or undefined\", {\n code: \"REGISTRY_ITEMS_NOT_NULL_OR_UNDEFINED\",\n source: \"Registry\",\n });\n }\n if (!Array.isArray(items)) {\n throw new BaseError(\"Items must be an array\", {\n code: \"REGISTRY_ITEMS_NOT_ARRAY\",\n source: \"Registry\",\n });\n }\n this.LOGGER.debug(`Registering ${String(items.length)} items`, { source: \"Registry\" });\n for (const item of items) {\n this.register(item);\n }\n this.LOGGER.debug(`${String(items.length)} items registered successfully`, { source: \"Registry\" });\n }\n /**\n * Unregister a single item from the registry by name.\n * @param {string} name The name of the item to unregister.\n */\n unregister(name) {\n this.LOGGER.debug(`Unregistering item with name: ${name}`, { source: \"Registry\" });\n if (!name) {\n throw new BaseError(\"Name cannot be empty\", {\n code: \"REGISTRY_NAME_NOT_EMPTY\",\n source: \"Registry\",\n });\n }\n const wasDeleted = this.ITEMS.delete(name);\n this.clearCache();\n if (wasDeleted) {\n this.LOGGER.debug(`Item unregistered successfully: ${name}`, { source: \"Registry\" });\n }\n else {\n this.LOGGER.debug(`Item not found for unregistering: ${name}`, { source: \"Registry\" });\n }\n }\n /**\n * Unregister multiple items from the registry by their names.\n * @param {Array<string>} names The names of the items to unregister.\n */\n unregisterMany(names) {\n if (!names) {\n throw new BaseError(\"Names cannot be null or undefined\", {\n code: \"REGISTRY_NAMES_NOT_NULL_OR_UNDEFINED\",\n source: \"Registry\",\n });\n }\n if (!Array.isArray(names)) {\n throw new BaseError(\"Names must be an array\", {\n code: \"REGISTRY_NAMES_NOT_ARRAY\",\n source: \"Registry\",\n });\n }\n this.LOGGER.debug(`Unregistering ${String(names.length)} items`, { source: \"Registry\" });\n for (const name of names) {\n this.unregister(name);\n }\n this.LOGGER.debug(`${String(names.length)} items unregistered`, { source: \"Registry\" });\n }\n /**\n * Clear the cache for a specific query or all caches if no query is provided.\n * @param {string} [cacheKey] Optional cache key to clear. If not provided, all caches are cleared.\n */\n clearCache(cacheKey) {\n if (cacheKey) {\n this.CACHE.delete(cacheKey);\n this.LOGGER.debug(`Cache cleared for key: ${cacheKey}`, { source: \"Registry\" });\n }\n else {\n this.CACHE.clear();\n this.LOGGER.debug(\"All caches cleared\", { source: \"Registry\" });\n }\n }\n}\n\nexport { BaseRegistry };\n//# sourceMappingUR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AE,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;AAChG,QAAQ,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;AAClC,YAAY,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;AACjC;AACA,QAAQ,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;AAC/F;AACA;AACA;AACA;AACA;AACA,IAAI,UAAU,CAAC,QAAQ,EAAE;AACzB,QAAQ,IAAI,QAAQ,EAAE;AACtB,YAAY,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC;AACvC,YAAY,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,uBAAuB,EAAE,QAAQ,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;AAC3F;AACA,aAAa;AACb,YAAY,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;AAC9B,YAAY,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;AAC3E;AACA;AACA;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var loggerLogLevel_enum = require('../../domain/enum/logger-log-level.enum.js');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The default options for the console logger.
|
|
7
|
+
*/
|
|
8
|
+
const CONSOLE_LOGGER_DEFAULT_OPTIONS = { level: loggerLogLevel_enum.ELoggerLogLevel.INFO };
|
|
9
|
+
|
|
10
|
+
exports.CONSOLE_LOGGER_DEFAULT_OPTIONS = CONSOLE_LOGGER_DEFAULT_OPTIONS;
|
|
11
|
+
//# sourceMappingURL=console-logger-default-options.constant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"console-logger-default-options.constant.js","sources":["../../../../../../../../../node_modules/@elsikora/cladi/dist/esm/infrastructure/constant/console-logger-default-options.constant.js"],"sourcesContent":["import { ELoggerLogLevel } from '../../domain/enum/logger-log-level.enum.js';\n\n/**\n * The default options for the console logger.\n */\nconst CONSOLE_LOGGER_DEFAULT_OPTIONS = { level: ELoggerLogLevel.INFO };\n\nexport { CONSOLE_LOGGER_DEFAULT_OPTIONS };\n//# sourceMappingURL=console-logger-default-options.constant.js.map\n"],"names":["ELoggerLogLevel"],"mappings":";;;;AAEA;AACA;AACA;AACK,MAAC,8BAA8B,GAAG,EAAE,KAAK,EAAEA,mCAAe,CAAC,IAAI;;;;","x_google_ignoreList":[0]}
|
package/dist/cjs/external/@elsikora/cladi/dist/esm/infrastructure/service/console-logger.service.js
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var loggerLogLevel_enum = require('../../domain/enum/logger-log-level.enum.js');
|
|
4
|
+
var consoleLoggerDefaultOptions_constant = require('../constant/console-logger-default-options.constant.js');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Console logger implementation.
|
|
8
|
+
* @see {@link https://elsikora.com/docs/cladi/services/logging}
|
|
9
|
+
*/
|
|
10
|
+
class ConsoleLoggerService {
|
|
11
|
+
/**
|
|
12
|
+
* Current log level. Messages below this level will not be logged.
|
|
13
|
+
*/
|
|
14
|
+
LEVEL;
|
|
15
|
+
/**
|
|
16
|
+
* Default source identifier.
|
|
17
|
+
*/
|
|
18
|
+
SOURCE;
|
|
19
|
+
/**
|
|
20
|
+
* Create a new console logger.
|
|
21
|
+
* @param {IConsoleLoggerOptions} [options] - The options to use for the logger.
|
|
22
|
+
* @default
|
|
23
|
+
*/
|
|
24
|
+
constructor(options = consoleLoggerDefaultOptions_constant.CONSOLE_LOGGER_DEFAULT_OPTIONS) {
|
|
25
|
+
this.LEVEL = options.level;
|
|
26
|
+
this.SOURCE = options.source;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Log a debug message.
|
|
30
|
+
* @param {string} message Message to log.
|
|
31
|
+
* @param {ILoggerMethodOptions} [options] Optional logging options.
|
|
32
|
+
*/
|
|
33
|
+
debug(message, options) {
|
|
34
|
+
if (this.shouldLog(loggerLogLevel_enum.ELoggerLogLevel.DEBUG)) {
|
|
35
|
+
console.debug(this.formatMessage(loggerLogLevel_enum.ELoggerLogLevel.DEBUG, message, options));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Log an error message.
|
|
40
|
+
* @param {string} message Message to log.
|
|
41
|
+
* @param {ILoggerMethodOptions} [options] Optional logging options.
|
|
42
|
+
*/
|
|
43
|
+
error(message, options) {
|
|
44
|
+
if (this.shouldLog(loggerLogLevel_enum.ELoggerLogLevel.ERROR)) {
|
|
45
|
+
console.error(this.formatMessage(loggerLogLevel_enum.ELoggerLogLevel.ERROR, message, options));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Log an info message.
|
|
50
|
+
* @param {string} message Message to log.
|
|
51
|
+
* @param {ILoggerMethodOptions} [options] Optional logging options.
|
|
52
|
+
*/
|
|
53
|
+
info(message, options) {
|
|
54
|
+
if (this.shouldLog(loggerLogLevel_enum.ELoggerLogLevel.INFO)) {
|
|
55
|
+
console.info(this.formatMessage(loggerLogLevel_enum.ELoggerLogLevel.INFO, message, options));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Log a trace message.
|
|
60
|
+
* @param {string} message Message to log.
|
|
61
|
+
* @param {ILoggerMethodOptions} [options] Optional logging options.
|
|
62
|
+
*/
|
|
63
|
+
trace(message, options) {
|
|
64
|
+
if (this.shouldLog(loggerLogLevel_enum.ELoggerLogLevel.TRACE)) {
|
|
65
|
+
console.trace(this.formatMessage(loggerLogLevel_enum.ELoggerLogLevel.TRACE, message, options));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Log a warning message.
|
|
70
|
+
* @param {string} message Message to log.
|
|
71
|
+
* @param {ILoggerMethodOptions} [options] Optional logging options.
|
|
72
|
+
*/
|
|
73
|
+
warn(message, options) {
|
|
74
|
+
if (this.shouldLog(loggerLogLevel_enum.ELoggerLogLevel.WARN)) {
|
|
75
|
+
console.warn(this.formatMessage(loggerLogLevel_enum.ELoggerLogLevel.WARN, message, options));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Combines source from options with class source.
|
|
80
|
+
* @param {string} [optionsSource] Source from options.
|
|
81
|
+
* @returns {string|undefined} Combined source or undefined if both sources are undefined.
|
|
82
|
+
*/
|
|
83
|
+
combineSource(optionsSource) {
|
|
84
|
+
if (!this.SOURCE && !optionsSource) {
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
if (!this.SOURCE && optionsSource) {
|
|
88
|
+
return `[${optionsSource}]`;
|
|
89
|
+
}
|
|
90
|
+
if (this.SOURCE && !optionsSource) {
|
|
91
|
+
return `[${this.SOURCE}]`;
|
|
92
|
+
}
|
|
93
|
+
if (this.SOURCE && optionsSource) {
|
|
94
|
+
return `[${this.SOURCE} → ${optionsSource}]`;
|
|
95
|
+
}
|
|
96
|
+
return undefined;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Format a message for logging.
|
|
100
|
+
* @param {ELoggerLogLevel} level Log level.
|
|
101
|
+
* @param {string} message Message to log.
|
|
102
|
+
* @param {ILoggerMethodOptions} [options] Optional logging options.
|
|
103
|
+
* @returns {string} Formatted message.
|
|
104
|
+
*/
|
|
105
|
+
formatMessage(level, message, options) {
|
|
106
|
+
const timestamp = new Date().toISOString();
|
|
107
|
+
// Safely extract context from options
|
|
108
|
+
let context;
|
|
109
|
+
let source;
|
|
110
|
+
if (options) {
|
|
111
|
+
context = options.context;
|
|
112
|
+
source = options.source;
|
|
113
|
+
}
|
|
114
|
+
const formattedContext = context ? ` ${JSON.stringify(context)}` : "";
|
|
115
|
+
const formattedSource = this.combineSource(source) ?? "";
|
|
116
|
+
const sourceWithSpace = formattedSource ? `${formattedSource} ` : "";
|
|
117
|
+
return `[${timestamp}] ${level.toUpperCase()}: ${sourceWithSpace}${message}${formattedContext}`;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Check if the given level should be logged.
|
|
121
|
+
* @param {ELoggerLogLevel} level Level to check.
|
|
122
|
+
* @returns {boolean} True if the level should be logged.
|
|
123
|
+
*/
|
|
124
|
+
shouldLog(level) {
|
|
125
|
+
const levels = [loggerLogLevel_enum.ELoggerLogLevel.ERROR, loggerLogLevel_enum.ELoggerLogLevel.WARN, loggerLogLevel_enum.ELoggerLogLevel.INFO, loggerLogLevel_enum.ELoggerLogLevel.DEBUG, loggerLogLevel_enum.ELoggerLogLevel.TRACE];
|
|
126
|
+
return levels.indexOf(level) <= levels.indexOf(this.LEVEL);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
exports.ConsoleLoggerService = ConsoleLoggerService;
|
|
131
|
+
//# sourceMappingURL=console-logger.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"console-logger.service.js","sources":["../../../../../../../../../node_modules/@elsikora/cladi/dist/esm/infrastructure/service/console-logger.service.js"],"sourcesContent":["import { ELoggerLogLevel } from '../../domain/enum/logger-log-level.enum.js';\nimport { CONSOLE_LOGGER_DEFAULT_OPTIONS } from '../constant/console-logger-default-options.constant.js';\n\n/**\n * Console logger implementation.\n * @see {@link https://elsikora.com/docs/cladi/services/logging}\n */\nclass ConsoleLoggerService {\n /**\n * Current log level. Messages below this level will not be logged.\n */\n LEVEL;\n /**\n * Default source identifier.\n */\n SOURCE;\n /**\n * Create a new console logger.\n * @param {IConsoleLoggerOptions} [options] - The options to use for the logger.\n * @default\n */\n constructor(options = CONSOLE_LOGGER_DEFAULT_OPTIONS) {\n this.LEVEL = options.level;\n this.SOURCE = options.source;\n }\n /**\n * Log a debug message.\n * @param {string} message Message to log.\n * @param {ILoggerMethodOptions} [options] Optional logging options.\n */\n debug(message, options) {\n if (this.shouldLog(ELoggerLogLevel.DEBUG)) {\n console.debug(this.formatMessage(ELoggerLogLevel.DEBUG, message, options));\n }\n }\n /**\n * Log an error message.\n * @param {string} message Message to log.\n * @param {ILoggerMethodOptions} [options] Optional logging options.\n */\n error(message, options) {\n if (this.shouldLog(ELoggerLogLevel.ERROR)) {\n console.error(this.formatMessage(ELoggerLogLevel.ERROR, message, options));\n }\n }\n /**\n * Log an info message.\n * @param {string} message Message to log.\n * @param {ILoggerMethodOptions} [options] Optional logging options.\n */\n info(message, options) {\n if (this.shouldLog(ELoggerLogLevel.INFO)) {\n console.info(this.formatMessage(ELoggerLogLevel.INFO, message, options));\n }\n }\n /**\n * Log a trace message.\n * @param {string} message Message to log.\n * @param {ILoggerMethodOptions} [options] Optional logging options.\n */\n trace(message, options) {\n if (this.shouldLog(ELoggerLogLevel.TRACE)) {\n console.trace(this.formatMessage(ELoggerLogLevel.TRACE, message, options));\n }\n }\n /**\n * Log a warning message.\n * @param {string} message Message to log.\n * @param {ILoggerMethodOptions} [options] Optional logging options.\n */\n warn(message, options) {\n if (this.shouldLog(ELoggerLogLevel.WARN)) {\n console.warn(this.formatMessage(ELoggerLogLevel.WARN, message, options));\n }\n }\n /**\n * Combines source from options with class source.\n * @param {string} [optionsSource] Source from options.\n * @returns {string|undefined} Combined source or undefined if both sources are undefined.\n */\n combineSource(optionsSource) {\n if (!this.SOURCE && !optionsSource) {\n return undefined;\n }\n if (!this.SOURCE && optionsSource) {\n return `[${optionsSource}]`;\n }\n if (this.SOURCE && !optionsSource) {\n return `[${this.SOURCE}]`;\n }\n if (this.SOURCE && optionsSource) {\n return `[${this.SOURCE} → ${optionsSource}]`;\n }\n return undefined;\n }\n /**\n * Format a message for logging.\n * @param {ELoggerLogLevel} level Log level.\n * @param {string} message Message to log.\n * @param {ILoggerMethodOptions} [options] Optional logging options.\n * @returns {string} Formatted message.\n */\n formatMessage(level, message, options) {\n const timestamp = new Date().toISOString();\n // Safely extract context from options\n let context;\n let source;\n if (options) {\n context = options.context;\n source = options.source;\n }\n const formattedContext = context ? ` ${JSON.stringify(context)}` : \"\";\n const formattedSource = this.combineSource(source) ?? \"\";\n const sourceWithSpace = formattedSource ? `${formattedSource} ` : \"\";\n return `[${timestamp}] ${level.toUpperCase()}: ${sourceWithSpace}${message}${formattedContext}`;\n }\n /**\n * Check if the given level should be logged.\n * @param {ELoggerLogLevel} level Level to check.\n * @returns {boolean} True if the level should be logged.\n */\n shouldLog(level) {\n const levels = [ELoggerLogLevel.ERROR, ELoggerLogLevel.WARN, ELoggerLogLevel.INFO, ELoggerLogLevel.DEBUG, ELoggerLogLevel.TRACE];\n return levels.indexOf(level) <= levels.indexOf(this.LEVEL);\n }\n}\n\nexport { ConsoleLoggerService };\n//# sourceMappingURL=console-logger.service.js.map\n"],"names":["CONSOLE_LOGGER_DEFAULT_OPTIONS","ELoggerLogLevel"],"mappings":";;;;;AAGA;AACA;AACA;AACA;AACA,MAAM,oBAAoB,CAAC;AAC3B;AACA;AACA;AACA,IAAI,KAAK;AACT;AACA;AACA;AACA,IAAI,MAAM;AACV;AACA;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,OAAO,GAAGA,mEAA8B,EAAE;AAC1D,QAAQ,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK;AAClC,QAAQ,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE;AAC5B,QAAQ,IAAI,IAAI,CAAC,SAAS,CAACC,mCAAe,CAAC,KAAK,CAAC,EAAE;AACnD,YAAY,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAACA,mCAAe,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AACtF;A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,OAAO,CAAC,EAAE,gBAAgB,CAAC,CAAC;AACvG;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,KAAK,EAAE;AACrB,QAAQ,MAAM,MAAM,GAAG,CAACA,mCAAe,CAAC,KAAK,EAAEA,mCAAe,CAAC,IAAI,EAAEA,mCAAe,CAAC,IAAI,EAAEA,mCAAe,CAAC,KAAK,EAAEA,mCAAe,CAAC,KAAK,CAAC;AACxI,QAAQ,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;AAClE;AACA;;;;","x_google_ignoreList":[0]}
|
package/dist/cjs/external/@elsikora/cladi/dist/esm/presentation/utility/create/registry.utility.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
require('../../../domain/enum/logger-log-level.enum.js');
|
|
4
|
+
require('../../../infrastructure/constant/console-logger-default-options.constant.js');
|
|
5
|
+
var registry_class = require('../../../infrastructure/class/base/registry.class.js');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Creates a new registry instance.
|
|
9
|
+
* @param {IBaseRegistryOptions} options - The options to use for the registry.
|
|
10
|
+
* @returns {IRegistry<T>} A new registry instance.
|
|
11
|
+
* @template T The type of items stored in the registry.
|
|
12
|
+
* @see {@link https://elsikora.com/docs/cladi/core-concepts/registry} for more information on registries.
|
|
13
|
+
*/
|
|
14
|
+
function createRegistry(options) {
|
|
15
|
+
return new registry_class.BaseRegistry(options);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
exports.createRegistry = createRegistry;
|
|
19
|
+
//# sourceMappingURL=registry.utility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.utility.js","sources":["../../../../../../../../../../node_modules/@elsikora/cladi/dist/esm/presentation/utility/create/registry.utility.js"],"sourcesContent":["import '../../../domain/enum/logger-log-level.enum.js';\nimport '../../../infrastructure/constant/console-logger-default-options.constant.js';\nimport { BaseRegistry } from '../../../infrastructure/class/base/registry.class.js';\n\n/**\n * Creates a new registry instance.\n * @param {IBaseRegistryOptions} options - The options to use for the registry.\n * @returns {IRegistry<T>} A new registry instance.\n * @template T The type of items stored in the registry.\n * @see {@link https://elsikora.com/docs/cladi/core-concepts/registry} for more information on registries.\n */\nfunction createRegistry(options) {\n return new BaseRegistry(options);\n}\n\nexport { createRegistry };\n//# sourceMappingURL=registry.utility.js.map\n"],"names":["BaseRegistry"],"mappings":";;;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,cAAc,CAAC,OAAO,EAAE;AACjC,IAAI,OAAO,IAAIA,2BAAY,CAAC,OAAO,CAAC;AACpC;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { IApiBaseEntity } from '../../interface/api-base-entity.interface';
|
|
1
2
|
import type { IApiControllerProperties } from '../../interface/decorator/api/index';
|
|
2
3
|
import type { IApiEntity } from '../../interface/entity/index';
|
|
3
4
|
import type { TApiControllerMethodName, TApiControllerTargetMethod } from '../../type/factory/api/controller/index';
|
|
4
5
|
import { EApiRouteType } from '../../enum/decorator/api/index';
|
|
5
|
-
export declare class ApiControllerFactory<E> {
|
|
6
|
+
export declare class ApiControllerFactory<E extends IApiBaseEntity> {
|
|
6
7
|
protected target: TApiControllerTargetMethod<E>;
|
|
7
8
|
private readonly properties;
|
|
8
9
|
protected get targetPrototype(): InstanceType<typeof this.target>;
|