@lakutata/core 1.0.59 → 3.0.0-beta.0
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 +173 -23
- package/THIRD_PARTY_NOTICES.md +320 -0
- package/dist/cjs/components/ConsoleLogger.d.ts +62 -0
- package/dist/cjs/components/ConsoleLogger.js +99 -0
- package/dist/cjs/constants/DIMetadataKey.d.ts +10 -0
- package/dist/cjs/constants/DIMetadataKey.js +13 -0
- package/dist/cjs/constants/DTOMetadataKey.d.ts +5 -0
- package/dist/cjs/constants/DTOMetadataKey.js +8 -0
- package/dist/cjs/decorators/asst/After.d.ts +29 -0
- package/dist/cjs/decorators/asst/After.js +33 -0
- package/dist/cjs/decorators/asst/Before.d.ts +28 -0
- package/dist/cjs/decorators/asst/Before.js +32 -0
- package/dist/cjs/decorators/di/Autoload.d.ts +33 -0
- package/dist/cjs/decorators/di/Autoload.js +37 -0
- package/dist/cjs/decorators/di/Configurable.d.ts +51 -0
- package/dist/cjs/decorators/di/Configurable.js +60 -0
- package/dist/cjs/decorators/di/Inject.d.ts +85 -0
- package/dist/cjs/decorators/di/Inject.js +36 -0
- package/dist/cjs/decorators/di/Lifetime.d.ts +94 -0
- package/dist/cjs/decorators/di/Lifetime.js +106 -0
- package/dist/cjs/decorators/dto/Accept.d.ts +38 -0
- package/dist/cjs/decorators/dto/Accept.js +41 -0
- package/dist/cjs/decorators/dto/Expect.d.ts +38 -0
- package/dist/cjs/decorators/dto/Expect.js +41 -0
- package/dist/cjs/decorators/dto/IndexSignature.d.ts +30 -0
- package/dist/cjs/decorators/dto/IndexSignature.js +33 -0
- package/dist/cjs/decorators/dto/Return.d.ts +39 -0
- package/dist/cjs/decorators/dto/Return.js +42 -0
- package/dist/cjs/dto/PaginationResultDTO.d.ts +33 -0
- package/dist/cjs/dto/PaginationResultDTO.js +50 -0
- package/dist/cjs/dto/PaginationSearchDTO.d.ts +33 -0
- package/dist/cjs/dto/PaginationSearchDTO.js +45 -0
- package/dist/cjs/dto/Paginator.d.ts +54 -0
- package/dist/cjs/dto/Paginator.js +53 -0
- package/dist/cjs/exceptions/DestroyRuntimeContainerException.d.ts +10 -0
- package/dist/cjs/exceptions/DestroyRuntimeContainerException.js +17 -0
- package/dist/cjs/exceptions/InvalidActionPatternDepthException.d.ts +8 -0
- package/dist/cjs/exceptions/InvalidActionPatternDepthException.js +15 -0
- package/dist/cjs/exceptions/InvalidAssistantFunctionTypeException.d.ts +9 -0
- package/dist/cjs/exceptions/InvalidAssistantFunctionTypeException.js +16 -0
- package/dist/cjs/exceptions/InvalidObjectTypeException.d.ts +9 -0
- package/dist/cjs/exceptions/InvalidObjectTypeException.js +16 -0
- package/dist/cjs/exceptions/MethodNotFoundException.d.ts +8 -0
- package/dist/cjs/exceptions/MethodNotFoundException.js +15 -0
- package/dist/cjs/exceptions/ObjectDestroyedException.d.ts +9 -0
- package/dist/cjs/exceptions/ObjectDestroyedException.js +16 -0
- package/dist/cjs/exceptions/alias/AliasExistsException.d.ts +8 -0
- package/dist/cjs/exceptions/alias/AliasExistsException.js +15 -0
- package/dist/cjs/exceptions/alias/AliasNotFoundException.d.ts +8 -0
- package/dist/cjs/exceptions/alias/AliasNotFoundException.js +15 -0
- package/dist/cjs/exceptions/alias/InvalidAliasNameException.d.ts +8 -0
- package/dist/cjs/exceptions/alias/InvalidAliasNameException.js +15 -0
- package/dist/cjs/exceptions/di/DependencyInjectionException.d.ts +9 -0
- package/dist/cjs/exceptions/di/DependencyInjectionException.js +16 -0
- package/dist/cjs/exceptions/di/InvalidObjectOptionsException.d.ts +9 -0
- package/dist/cjs/exceptions/di/InvalidObjectOptionsException.js +16 -0
- package/dist/cjs/exceptions/di/LifetimeLockedException.d.ts +9 -0
- package/dist/cjs/exceptions/di/LifetimeLockedException.js +16 -0
- package/dist/cjs/exceptions/di/OverridableObjectTargetConfigNotFoundException.d.ts +9 -0
- package/dist/cjs/exceptions/di/OverridableObjectTargetConfigNotFoundException.js +16 -0
- package/dist/cjs/exceptions/dto/InvalidMethodAcceptException.d.ts +9 -0
- package/dist/cjs/exceptions/dto/InvalidMethodAcceptException.js +16 -0
- package/dist/cjs/exceptions/dto/InvalidMethodReturnException.d.ts +9 -0
- package/dist/cjs/exceptions/dto/InvalidMethodReturnException.js +16 -0
- package/dist/cjs/exceptions/dto/InvalidValueException.d.ts +11 -0
- package/dist/cjs/exceptions/dto/InvalidValueException.js +18 -0
- package/dist/cjs/exports/ASSTDecorators.d.ts +3 -0
- package/dist/cjs/exports/ASSTDecorators.js +11 -0
- package/dist/cjs/exports/Core.d.ts +93 -0
- package/dist/cjs/exports/Core.js +127 -0
- package/dist/cjs/exports/DIDecorators.d.ts +5 -0
- package/dist/cjs/exports/DIDecorators.js +18 -0
- package/dist/cjs/exports/DTODecorators.d.ts +6 -0
- package/dist/cjs/exports/DTODecorators.js +17 -0
- package/dist/cjs/exports/DTOs.d.ts +17 -0
- package/dist/cjs/exports/DTOs.js +35 -0
- package/dist/cjs/exports/LoggerComponent.d.ts +3 -0
- package/dist/cjs/exports/LoggerComponent.js +22 -0
- package/dist/cjs/interfaces/IBaseObjectConstructor.d.ts +10 -0
- package/dist/cjs/interfaces/IBaseObjectConstructor.js +2 -0
- package/dist/cjs/interfaces/IConstructor.d.ts +6 -0
- package/dist/cjs/interfaces/IConstructor.js +2 -0
- package/dist/cjs/interfaces/ILogger.d.ts +35 -0
- package/dist/cjs/interfaces/ILogger.js +2 -0
- package/dist/cjs/lib/app/Application.d.ts +346 -0
- package/dist/cjs/lib/app/Application.js +613 -0
- package/dist/cjs/lib/app/ApplicationConfigLoader.d.ts +17 -0
- package/dist/cjs/lib/app/ApplicationConfigLoader.js +30 -0
- package/dist/cjs/lib/app/MigrationCommand.d.ts +31 -0
- package/dist/cjs/lib/app/MigrationCommand.js +31 -0
- package/dist/cjs/lib/base/BaseObject.d.ts +343 -0
- package/dist/cjs/lib/base/BaseObject.js +608 -0
- package/dist/cjs/lib/base/EventEmitter.d.ts +37 -0
- package/dist/cjs/lib/base/EventEmitter.js +152 -0
- package/dist/cjs/lib/base/async-constructor/Append.d.ts +1 -0
- package/dist/cjs/lib/base/async-constructor/Append.js +21 -0
- package/dist/cjs/lib/base/async-constructor/AsyncConstructor.d.ts +3 -0
- package/dist/cjs/lib/base/async-constructor/AsyncConstructor.js +11 -0
- package/dist/cjs/lib/base/internal/ApplicationLaunch.d.ts +16 -0
- package/dist/cjs/lib/base/internal/ApplicationLaunch.js +58 -0
- package/dist/cjs/lib/base/internal/ConfigurableRecordsInjection.d.ts +47 -0
- package/dist/cjs/lib/base/internal/ConfigurableRecordsInjection.js +85 -0
- package/dist/cjs/lib/base/internal/EventEmitter2.d.ts +184 -0
- package/dist/cjs/lib/base/internal/EventEmitter2.js +715 -0
- package/dist/cjs/lib/base/internal/MemberDeclarations.d.ts +23 -0
- package/dist/cjs/lib/base/internal/MemberDeclarations.js +45 -0
- package/dist/cjs/lib/base/internal/MethodAssistantFunction.d.ts +20 -0
- package/dist/cjs/lib/base/internal/MethodAssistantFunction.js +110 -0
- package/dist/cjs/lib/base/internal/ModuleConfigLoader.d.ts +46 -0
- package/dist/cjs/lib/base/internal/ModuleConfigLoader.js +113 -0
- package/dist/cjs/lib/base/internal/ModuleInitialization.d.ts +5 -0
- package/dist/cjs/lib/base/internal/ModuleInitialization.js +8 -0
- package/dist/cjs/lib/base/internal/ObjectConfiguration.d.ts +29 -0
- package/dist/cjs/lib/base/internal/ObjectConfiguration.js +41 -0
- package/dist/cjs/lib/base/internal/ObjectContainer.d.ts +15 -0
- package/dist/cjs/lib/base/internal/ObjectContainer.js +23 -0
- package/dist/cjs/lib/base/internal/ObjectInjection.d.ts +43 -0
- package/dist/cjs/lib/base/internal/ObjectInjection.js +60 -0
- package/dist/cjs/lib/base/internal/ObjectOptionsCheck.d.ts +12 -0
- package/dist/cjs/lib/base/internal/ObjectOptionsCheck.js +70 -0
- package/dist/cjs/lib/base/internal/ObjectStartup.d.ts +31 -0
- package/dist/cjs/lib/base/internal/ObjectStartup.js +75 -0
- package/dist/cjs/lib/base/internal/ObjectType.d.ts +37 -0
- package/dist/cjs/lib/base/internal/ObjectType.js +75 -0
- package/dist/cjs/lib/core/Alias.d.ts +48 -0
- package/dist/cjs/lib/core/Alias.js +100 -0
- package/dist/cjs/lib/core/Component.d.ts +267 -0
- package/dist/cjs/lib/core/Component.js +362 -0
- package/dist/cjs/lib/core/Container.d.ts +341 -0
- package/dist/cjs/lib/core/Container.js +667 -0
- package/dist/cjs/lib/core/Module.d.ts +165 -0
- package/dist/cjs/lib/core/Module.js +268 -0
- package/dist/cjs/lib/core/Provider.d.ts +52 -0
- package/dist/cjs/lib/core/Provider.js +57 -0
- package/dist/cjs/lib/dto/CachedSchema.d.ts +7 -0
- package/dist/cjs/lib/dto/CachedSchema.js +2 -0
- package/dist/cjs/lib/dto/DTO.d.ts +278 -0
- package/dist/cjs/lib/dto/DTO.js +461 -0
- package/dist/cjs/lib/dto/DataValidator.d.ts +166 -0
- package/dist/cjs/lib/dto/DataValidator.js +247 -0
- package/dist/cjs/lib/dto/FlexibleDTO.d.ts +23 -0
- package/dist/cjs/lib/dto/FlexibleDTO.js +36 -0
- package/dist/cjs/lib/dto/MethodValidation.d.ts +44 -0
- package/dist/cjs/lib/dto/MethodValidation.js +141 -0
- package/dist/cjs/lib/dto/ObjectSchemaValidation.d.ts +86 -0
- package/dist/cjs/lib/dto/ObjectSchemaValidation.js +181 -0
- package/dist/cjs/lib/dto/internal/CronValidator.d.ts +8 -0
- package/dist/cjs/lib/dto/internal/CronValidator.js +128 -0
- package/dist/cjs/lib/foundation/BasicInfo.d.ts +46 -0
- package/dist/cjs/lib/foundation/BasicInfo.js +115 -0
- package/dist/cjs/lib/foundation/EndProcess.d.ts +14 -0
- package/dist/cjs/lib/foundation/EndProcess.js +30 -0
- package/dist/cjs/lib/foundation/Exception.d.ts +88 -0
- package/dist/cjs/lib/foundation/Exception.js +165 -0
- package/dist/cjs/lib/foundation/LifecycleErrorReporter.d.ts +26 -0
- package/dist/cjs/lib/foundation/LifecycleErrorReporter.js +64 -0
- package/dist/cjs/lib/foundation/Packaging.d.ts +29 -0
- package/dist/cjs/lib/foundation/Packaging.js +42 -0
- package/dist/cjs/lib/foundation/ThrowWarning.d.ts +6 -0
- package/dist/cjs/lib/foundation/ThrowWarning.js +16 -0
- package/dist/cjs/lib/helpers/internal/WithCause.d.ts +6 -0
- package/dist/cjs/lib/helpers/internal/WithCause.js +12 -0
- package/dist/cjs/lib/ioc/ConstructorSymbol.d.ts +3 -0
- package/dist/cjs/lib/ioc/ConstructorSymbol.js +21 -0
- package/dist/cjs/lib/ioc/DependencyInjectionContainer.d.ts +178 -0
- package/dist/cjs/lib/ioc/DependencyInjectionContainer.js +445 -0
- package/dist/cjs/lib/ioc/Errors.d.ts +59 -0
- package/dist/cjs/lib/ioc/Errors.js +115 -0
- package/dist/cjs/lib/ioc/Lifetime.d.ts +12 -0
- package/dist/cjs/lib/ioc/Lifetime.js +31 -0
- package/dist/cjs/lib/ioc/ListModules.d.ts +42 -0
- package/dist/cjs/lib/ioc/ListModules.js +104 -0
- package/dist/cjs/lib/ioc/LoadModuleNative.d.ts +1 -0
- package/dist/cjs/lib/ioc/LoadModuleNative.js +41 -0
- package/dist/cjs/lib/ioc/LoadModules.d.ts +49 -0
- package/dist/cjs/lib/ioc/LoadModules.js +167 -0
- package/dist/cjs/lib/ioc/ObjectLifetime.d.ts +22 -0
- package/dist/cjs/lib/ioc/ObjectLifetime.js +39 -0
- package/dist/cjs/lib/ioc/ObjectWeakRefs.d.ts +19 -0
- package/dist/cjs/lib/ioc/ObjectWeakRefs.js +47 -0
- package/dist/cjs/lib/ioc/Resolvers.d.ts +136 -0
- package/dist/cjs/lib/ioc/Resolvers.js +248 -0
- package/dist/cjs/lib/ioc/Utils.d.ts +33 -0
- package/dist/cjs/lib/ioc/Utils.js +73 -0
- package/dist/cjs/lib/validation/JsonSchema.d.ts +127 -0
- package/dist/cjs/lib/validation/JsonSchema.js +85 -0
- package/dist/cjs/lib/validation/VLD.d.ts +275 -0
- package/dist/cjs/lib/validation/VLD.js +216 -0
- package/dist/cjs/lib/validation/ValidationLanguage.d.ts +42 -0
- package/dist/cjs/lib/validation/ValidationLanguage.js +55 -0
- package/dist/cjs/lib/validation/ValidationMessages.d.ts +92 -0
- package/dist/cjs/lib/validation/ValidationMessages.js +192 -0
- package/dist/cjs/lib/validation/engine/address/decode.d.ts +8 -0
- package/dist/cjs/lib/validation/engine/address/decode.js +104 -0
- package/dist/cjs/lib/validation/engine/address/domain.d.ts +74 -0
- package/dist/cjs/lib/validation/engine/address/domain.js +181 -0
- package/dist/cjs/lib/validation/engine/address/email.d.ts +27 -0
- package/dist/cjs/lib/validation/engine/address/email.js +182 -0
- package/dist/cjs/lib/validation/engine/address/errors.d.ts +48 -0
- package/dist/cjs/lib/validation/engine/address/errors.js +31 -0
- package/dist/cjs/lib/validation/engine/address/index.d.ts +9 -0
- package/dist/cjs/lib/validation/engine/address/index.js +30 -0
- package/dist/cjs/lib/validation/engine/address/ip.d.ts +35 -0
- package/dist/cjs/lib/validation/engine/address/ip.js +49 -0
- package/dist/cjs/lib/validation/engine/address/uri.d.ts +55 -0
- package/dist/cjs/lib/validation/engine/address/uri.js +218 -0
- package/dist/cjs/lib/validation/engine/expression/index.d.ts +70 -0
- package/dist/cjs/lib/validation/engine/expression/index.js +356 -0
- package/dist/cjs/lib/validation/engine/json-schema/combinations.d.ts +11 -0
- package/dist/cjs/lib/validation/engine/json-schema/combinations.js +33 -0
- package/dist/cjs/lib/validation/engine/json-schema/helpers.d.ts +76 -0
- package/dist/cjs/lib/validation/engine/json-schema/helpers.js +380 -0
- package/dist/cjs/lib/validation/engine/json-schema/import.d.ts +56 -0
- package/dist/cjs/lib/validation/engine/json-schema/import.js +872 -0
- package/dist/cjs/lib/validation/engine/json-schema/index.d.ts +20 -0
- package/dist/cjs/lib/validation/engine/json-schema/index.js +45 -0
- package/dist/cjs/lib/validation/engine/json-schema/model.d.ts +124 -0
- package/dist/cjs/lib/validation/engine/json-schema/model.js +5 -0
- package/dist/cjs/lib/validation/engine/json-schema/parsers/json-2020-12.d.ts +9 -0
- package/dist/cjs/lib/validation/engine/json-schema/parsers/json-2020-12.js +56 -0
- package/dist/cjs/lib/validation/engine/json-schema/parsers/json-draft-04.d.ts +17 -0
- package/dist/cjs/lib/validation/engine/json-schema/parsers/json-draft-04.js +93 -0
- package/dist/cjs/lib/validation/engine/json-schema/parsers/json-draft-2019-09.d.ts +13 -0
- package/dist/cjs/lib/validation/engine/json-schema/parsers/json-draft-2019-09.js +69 -0
- package/dist/cjs/lib/validation/engine/json-schema/parsers/json.d.ts +245 -0
- package/dist/cjs/lib/validation/engine/json-schema/parsers/json.js +1497 -0
- package/dist/cjs/lib/validation/engine/json-schema/parsers/open-api-3.1.d.ts +13 -0
- package/dist/cjs/lib/validation/engine/json-schema/parsers/open-api-3.1.js +71 -0
- package/dist/cjs/lib/validation/engine/json-schema/parsers/open-api.d.ts +24 -0
- package/dist/cjs/lib/validation/engine/json-schema/parsers/open-api.js +207 -0
- package/dist/cjs/lib/validation/engine/location/index.d.ts +18 -0
- package/dist/cjs/lib/validation/engine/location/index.js +23 -0
- package/dist/cjs/lib/validation/engine/schema/annotate.d.ts +13 -0
- package/dist/cjs/lib/validation/engine/schema/annotate.js +162 -0
- package/dist/cjs/lib/validation/engine/schema/assert.d.ts +25 -0
- package/dist/cjs/lib/validation/engine/schema/assert.js +66 -0
- package/dist/cjs/lib/validation/engine/schema/base.d.ts +194 -0
- package/dist/cjs/lib/validation/engine/schema/base.js +834 -0
- package/dist/cjs/lib/validation/engine/schema/cache.d.ts +41 -0
- package/dist/cjs/lib/validation/engine/schema/cache.js +131 -0
- package/dist/cjs/lib/validation/engine/schema/common.d.ts +79 -0
- package/dist/cjs/lib/validation/engine/schema/common.js +220 -0
- package/dist/cjs/lib/validation/engine/schema/compile.d.ts +81 -0
- package/dist/cjs/lib/validation/engine/schema/compile.js +242 -0
- package/dist/cjs/lib/validation/engine/schema/errors.d.ts +94 -0
- package/dist/cjs/lib/validation/engine/schema/errors.js +230 -0
- package/dist/cjs/lib/validation/engine/schema/extend.d.ts +122 -0
- package/dist/cjs/lib/validation/engine/schema/extend.js +235 -0
- package/dist/cjs/lib/validation/engine/schema/extensions/bigint.d.ts +33 -0
- package/dist/cjs/lib/validation/engine/schema/extensions/bigint.js +175 -0
- package/dist/cjs/lib/validation/engine/schema/fastpath.d.ts +35 -0
- package/dist/cjs/lib/validation/engine/schema/fastpath.js +661 -0
- package/dist/cjs/lib/validation/engine/schema/formats.d.ts +8 -0
- package/dist/cjs/lib/validation/engine/schema/formats.js +105 -0
- package/dist/cjs/lib/validation/engine/schema/index.d.ts +95 -0
- package/dist/cjs/lib/validation/engine/schema/index.js +237 -0
- package/dist/cjs/lib/validation/engine/schema/lazy.d.ts +21 -0
- package/dist/cjs/lib/validation/engine/schema/lazy.js +8 -0
- package/dist/cjs/lib/validation/engine/schema/manifest.d.ts +52 -0
- package/dist/cjs/lib/validation/engine/schema/manifest.js +364 -0
- package/dist/cjs/lib/validation/engine/schema/messages.d.ts +37 -0
- package/dist/cjs/lib/validation/engine/schema/messages.js +136 -0
- package/dist/cjs/lib/validation/engine/schema/model.d.ts +196 -0
- package/dist/cjs/lib/validation/engine/schema/model.js +2 -0
- package/dist/cjs/lib/validation/engine/schema/modify.d.ts +58 -0
- package/dist/cjs/lib/validation/engine/schema/modify.js +223 -0
- package/dist/cjs/lib/validation/engine/schema/ref.d.ts +116 -0
- package/dist/cjs/lib/validation/engine/schema/ref.js +318 -0
- package/dist/cjs/lib/validation/engine/schema/schemas.d.ts +6 -0
- package/dist/cjs/lib/validation/engine/schema/schemas.js +268 -0
- package/dist/cjs/lib/validation/engine/schema/state.d.ts +48 -0
- package/dist/cjs/lib/validation/engine/schema/state.js +148 -0
- package/dist/cjs/lib/validation/engine/schema/template.d.ts +72 -0
- package/dist/cjs/lib/validation/engine/schema/template.js +331 -0
- package/dist/cjs/lib/validation/engine/schema/trace.d.ts +121 -0
- package/dist/cjs/lib/validation/engine/schema/trace.js +280 -0
- package/dist/cjs/lib/validation/engine/schema/types/alternatives.d.ts +36 -0
- package/dist/cjs/lib/validation/engine/schema/types/alternatives.js +332 -0
- package/dist/cjs/lib/validation/engine/schema/types/any.d.ts +37 -0
- package/dist/cjs/lib/validation/engine/schema/types/any.js +198 -0
- package/dist/cjs/lib/validation/engine/schema/types/array.d.ts +46 -0
- package/dist/cjs/lib/validation/engine/schema/types/array.js +668 -0
- package/dist/cjs/lib/validation/engine/schema/types/binary.d.ts +20 -0
- package/dist/cjs/lib/validation/engine/schema/types/binary.js +116 -0
- package/dist/cjs/lib/validation/engine/schema/types/boolean.d.ts +29 -0
- package/dist/cjs/lib/validation/engine/schema/types/boolean.js +142 -0
- package/dist/cjs/lib/validation/engine/schema/types/date.d.ts +27 -0
- package/dist/cjs/lib/validation/engine/schema/types/date.js +197 -0
- package/dist/cjs/lib/validation/engine/schema/types/function.d.ts +12 -0
- package/dist/cjs/lib/validation/engine/schema/types/function.js +68 -0
- package/dist/cjs/lib/validation/engine/schema/types/keys.d.ts +119 -0
- package/dist/cjs/lib/validation/engine/schema/types/keys.js +911 -0
- package/dist/cjs/lib/validation/engine/schema/types/link.d.ts +21 -0
- package/dist/cjs/lib/validation/engine/schema/types/link.js +160 -0
- package/dist/cjs/lib/validation/engine/schema/types/number.d.ts +46 -0
- package/dist/cjs/lib/validation/engine/schema/types/number.js +385 -0
- package/dist/cjs/lib/validation/engine/schema/types/object.d.ts +10 -0
- package/dist/cjs/lib/validation/engine/schema/types/object.js +21 -0
- package/dist/cjs/lib/validation/engine/schema/types/string.d.ts +115 -0
- package/dist/cjs/lib/validation/engine/schema/types/string.js +767 -0
- package/dist/cjs/lib/validation/engine/schema/types/symbol.d.ts +23 -0
- package/dist/cjs/lib/validation/engine/schema/types/symbol.js +75 -0
- package/dist/cjs/lib/validation/engine/schema/validator.d.ts +114 -0
- package/dist/cjs/lib/validation/engine/schema/validator.js +680 -0
- package/dist/cjs/lib/validation/engine/schema/values.d.ts +51 -0
- package/dist/cjs/lib/validation/engine/schema/values.js +201 -0
- package/dist/cjs/lib/validation/engine/sorter/index.d.ts +54 -0
- package/dist/cjs/lib/validation/engine/sorter/index.js +180 -0
- package/dist/cjs/lib/validation/engine/tlds/index.d.ts +1 -0
- package/dist/cjs/lib/validation/engine/tlds/index.js +8 -0
- package/dist/cjs/lib/validation/engine/tlds/tlds.d.ts +4 -0
- package/dist/cjs/lib/validation/engine/tlds/tlds.js +1448 -0
- package/dist/cjs/lib/validation/engine/utils/applyToDefaults.d.ts +17 -0
- package/dist/cjs/lib/validation/engine/utils/applyToDefaults.js +89 -0
- package/dist/cjs/lib/validation/engine/utils/assert.d.ts +6 -0
- package/dist/cjs/lib/validation/engine/utils/assert.js +23 -0
- package/dist/cjs/lib/validation/engine/utils/assertError.d.ts +10 -0
- package/dist/cjs/lib/validation/engine/utils/assertError.js +18 -0
- package/dist/cjs/lib/validation/engine/utils/clone.d.ts +25 -0
- package/dist/cjs/lib/validation/engine/utils/clone.js +160 -0
- package/dist/cjs/lib/validation/engine/utils/deepEqual.d.ts +29 -0
- package/dist/cjs/lib/validation/engine/utils/deepEqual.js +265 -0
- package/dist/cjs/lib/validation/engine/utils/escapeHtml.d.ts +8 -0
- package/dist/cjs/lib/validation/engine/utils/escapeHtml.js +62 -0
- package/dist/cjs/lib/validation/engine/utils/escapeRegex.d.ts +8 -0
- package/dist/cjs/lib/validation/engine/utils/escapeRegex.js +13 -0
- package/dist/cjs/lib/validation/engine/utils/ignore.d.ts +8 -0
- package/dist/cjs/lib/validation/engine/utils/ignore.js +12 -0
- package/dist/cjs/lib/validation/engine/utils/index.d.ts +16 -0
- package/dist/cjs/lib/validation/engine/utils/index.js +34 -0
- package/dist/cjs/lib/validation/engine/utils/merge.d.ts +21 -0
- package/dist/cjs/lib/validation/engine/utils/merge.js +67 -0
- package/dist/cjs/lib/validation/engine/utils/reach.d.ts +30 -0
- package/dist/cjs/lib/validation/engine/utils/reach.js +62 -0
- package/dist/cjs/lib/validation/engine/utils/stringify.d.ts +8 -0
- package/dist/cjs/lib/validation/engine/utils/stringify.js +18 -0
- package/dist/cjs/lib/validation/engine/utils/types.d.ts +26 -0
- package/dist/cjs/lib/validation/engine/utils/types.js +51 -0
- package/dist/cjs/lib/validation/engine/utils/utils.d.ts +24 -0
- package/dist/cjs/lib/validation/engine/utils/utils.js +22 -0
- package/dist/cjs/lib/validation/exceptions/SchemaConversionException.d.ts +7 -0
- package/dist/cjs/lib/validation/exceptions/SchemaConversionException.js +14 -0
- package/dist/cjs/lib/validation/exceptions/SchemaDefinitionException.d.ts +7 -0
- package/dist/cjs/lib/validation/exceptions/SchemaDefinitionException.js +14 -0
- package/dist/cjs/lib/validation/exceptions/SchemaException.d.ts +6 -0
- package/dist/cjs/lib/validation/exceptions/SchemaException.js +10 -0
- package/dist/cjs/lib/validation/exceptions/SchemaValidationException.d.ts +36 -0
- package/dist/cjs/lib/validation/exceptions/SchemaValidationException.js +43 -0
- package/dist/cjs/lib/validation/interfaces/AlternativesSchema.d.ts +45 -0
- package/dist/cjs/lib/validation/interfaces/AlternativesSchema.js +2 -0
- package/dist/cjs/lib/validation/interfaces/AnySchema.d.ts +399 -0
- package/dist/cjs/lib/validation/interfaces/AnySchema.js +2 -0
- package/dist/cjs/lib/validation/interfaces/ArraySchema.d.ts +106 -0
- package/dist/cjs/lib/validation/interfaces/ArraySchema.js +2 -0
- package/dist/cjs/lib/validation/interfaces/ArraySortOptions.d.ts +8 -0
- package/dist/cjs/lib/validation/interfaces/ArraySortOptions.js +2 -0
- package/dist/cjs/lib/validation/interfaces/ArrayUniqueOptions.d.ts +9 -0
- package/dist/cjs/lib/validation/interfaces/ArrayUniqueOptions.js +2 -0
- package/dist/cjs/lib/validation/interfaces/Base64Options.d.ts +9 -0
- package/dist/cjs/lib/validation/interfaces/Base64Options.js +2 -0
- package/dist/cjs/lib/validation/interfaces/BaseValidationOptions.d.ts +97 -0
- package/dist/cjs/lib/validation/interfaces/BaseValidationOptions.js +2 -0
- package/dist/cjs/lib/validation/interfaces/BigIntSchema.d.ts +67 -0
- package/dist/cjs/lib/validation/interfaces/BigIntSchema.js +2 -0
- package/dist/cjs/lib/validation/interfaces/BinarySchema.d.ts +33 -0
- package/dist/cjs/lib/validation/interfaces/BinarySchema.js +2 -0
- package/dist/cjs/lib/validation/interfaces/BooleanSchema.d.ts +29 -0
- package/dist/cjs/lib/validation/interfaces/BooleanSchema.js +2 -0
- package/dist/cjs/lib/validation/interfaces/Cache.d.ts +14 -0
- package/dist/cjs/lib/validation/interfaces/Cache.js +2 -0
- package/dist/cjs/lib/validation/interfaces/CacheConfiguration.d.ts +15 -0
- package/dist/cjs/lib/validation/interfaces/CacheConfiguration.js +2 -0
- package/dist/cjs/lib/validation/interfaces/CompileOptions.d.ts +9 -0
- package/dist/cjs/lib/validation/interfaces/CompileOptions.js +2 -0
- package/dist/cjs/lib/validation/interfaces/Context.d.ts +9 -0
- package/dist/cjs/lib/validation/interfaces/Context.js +2 -0
- package/dist/cjs/lib/validation/interfaces/CustomHelpers.d.ts +15 -0
- package/dist/cjs/lib/validation/interfaces/CustomHelpers.js +2 -0
- package/dist/cjs/lib/validation/interfaces/DataUriOptions.d.ts +8 -0
- package/dist/cjs/lib/validation/interfaces/DataUriOptions.js +2 -0
- package/dist/cjs/lib/validation/interfaces/DateSchema.d.ts +48 -0
- package/dist/cjs/lib/validation/interfaces/DateSchema.js +2 -0
- package/dist/cjs/lib/validation/interfaces/DependencyOptions.d.ts +9 -0
- package/dist/cjs/lib/validation/interfaces/DependencyOptions.js +2 -0
- package/dist/cjs/lib/validation/interfaces/Description.d.ts +20 -0
- package/dist/cjs/lib/validation/interfaces/Description.js +2 -0
- package/dist/cjs/lib/validation/interfaces/DomainOptions.d.ts +33 -0
- package/dist/cjs/lib/validation/interfaces/DomainOptions.js +2 -0
- package/dist/cjs/lib/validation/interfaces/EmailOptions.d.ts +51 -0
- package/dist/cjs/lib/validation/interfaces/EmailOptions.js +2 -0
- package/dist/cjs/lib/validation/interfaces/ErrorFormattingOptions.d.ts +60 -0
- package/dist/cjs/lib/validation/interfaces/ErrorFormattingOptions.js +2 -0
- package/dist/cjs/lib/validation/interfaces/ErrorReport.d.ts +14 -0
- package/dist/cjs/lib/validation/interfaces/ErrorReport.js +2 -0
- package/dist/cjs/lib/validation/interfaces/ErrorValidationOptions.d.ts +5 -0
- package/dist/cjs/lib/validation/interfaces/ErrorValidationOptions.js +2 -0
- package/dist/cjs/lib/validation/interfaces/Extension.d.ts +100 -0
- package/dist/cjs/lib/validation/interfaces/Extension.js +2 -0
- package/dist/cjs/lib/validation/interfaces/ExtensionFlag.d.ts +4 -0
- package/dist/cjs/lib/validation/interfaces/ExtensionFlag.js +2 -0
- package/dist/cjs/lib/validation/interfaces/ExternalHelpers.d.ts +16 -0
- package/dist/cjs/lib/validation/interfaces/ExternalHelpers.js +2 -0
- package/dist/cjs/lib/validation/interfaces/FunctionSchema.d.ts +31 -0
- package/dist/cjs/lib/validation/interfaces/FunctionSchema.js +2 -0
- package/dist/cjs/lib/validation/interfaces/GuidOptions.d.ts +6 -0
- package/dist/cjs/lib/validation/interfaces/GuidOptions.js +2 -0
- package/dist/cjs/lib/validation/interfaces/HexOptions.d.ts +16 -0
- package/dist/cjs/lib/validation/interfaces/HexOptions.js +2 -0
- package/dist/cjs/lib/validation/interfaces/HierarchySeparatorOptions.d.ts +7 -0
- package/dist/cjs/lib/validation/interfaces/HierarchySeparatorOptions.js +2 -0
- package/dist/cjs/lib/validation/interfaces/IpOptions.d.ts +11 -0
- package/dist/cjs/lib/validation/interfaces/IpOptions.js +2 -0
- package/dist/cjs/lib/validation/interfaces/LanguageMessageTemplate.d.ts +4 -0
- package/dist/cjs/lib/validation/interfaces/LanguageMessageTemplate.js +2 -0
- package/dist/cjs/lib/validation/interfaces/LinkSchema.d.ts +26 -0
- package/dist/cjs/lib/validation/interfaces/LinkSchema.js +2 -0
- package/dist/cjs/lib/validation/interfaces/NumberSchema.d.ts +134 -0
- package/dist/cjs/lib/validation/interfaces/NumberSchema.js +2 -0
- package/dist/cjs/lib/validation/interfaces/ObjectPatternOptions.d.ts +6 -0
- package/dist/cjs/lib/validation/interfaces/ObjectPatternOptions.js +2 -0
- package/dist/cjs/lib/validation/interfaces/ObjectSchema.d.ts +173 -0
- package/dist/cjs/lib/validation/interfaces/ObjectSchema.js +2 -0
- package/dist/cjs/lib/validation/interfaces/Reference.d.ts +38 -0
- package/dist/cjs/lib/validation/interfaces/Reference.js +2 -0
- package/dist/cjs/lib/validation/interfaces/ReferenceOptions.d.ts +59 -0
- package/dist/cjs/lib/validation/interfaces/ReferenceOptions.js +2 -0
- package/dist/cjs/lib/validation/interfaces/RenameOptions.d.ts +26 -0
- package/dist/cjs/lib/validation/interfaces/RenameOptions.js +2 -0
- package/dist/cjs/lib/validation/interfaces/RuleOptions.d.ts +22 -0
- package/dist/cjs/lib/validation/interfaces/RuleOptions.js +2 -0
- package/dist/cjs/lib/validation/interfaces/SchemaInternals.d.ts +103 -0
- package/dist/cjs/lib/validation/interfaces/SchemaInternals.js +2 -0
- package/dist/cjs/lib/validation/interfaces/State.d.ts +8 -0
- package/dist/cjs/lib/validation/interfaces/State.js +2 -0
- package/dist/cjs/lib/validation/interfaces/StringRegexOptions.d.ts +12 -0
- package/dist/cjs/lib/validation/interfaces/StringRegexOptions.js +2 -0
- package/dist/cjs/lib/validation/interfaces/StringSchema.d.ts +220 -0
- package/dist/cjs/lib/validation/interfaces/StringSchema.js +2 -0
- package/dist/cjs/lib/validation/interfaces/SwitchCases.d.ts +11 -0
- package/dist/cjs/lib/validation/interfaces/SwitchCases.js +2 -0
- package/dist/cjs/lib/validation/interfaces/SwitchDefault.d.ts +8 -0
- package/dist/cjs/lib/validation/interfaces/SwitchDefault.js +2 -0
- package/dist/cjs/lib/validation/interfaces/SymbolSchema.d.ts +16 -0
- package/dist/cjs/lib/validation/interfaces/SymbolSchema.js +2 -0
- package/dist/cjs/lib/validation/interfaces/TopLevelDomainOptions.d.ts +12 -0
- package/dist/cjs/lib/validation/interfaces/TopLevelDomainOptions.js +2 -0
- package/dist/cjs/lib/validation/interfaces/UriOptions.d.ts +31 -0
- package/dist/cjs/lib/validation/interfaces/UriOptions.js +2 -0
- package/dist/cjs/lib/validation/interfaces/ValidationErrorItem.d.ts +7 -0
- package/dist/cjs/lib/validation/interfaces/ValidationErrorItem.js +2 -0
- package/dist/cjs/lib/validation/interfaces/ValidationOptions.d.ts +21 -0
- package/dist/cjs/lib/validation/interfaces/ValidationOptions.js +2 -0
- package/dist/cjs/lib/validation/interfaces/WhenOptions.d.ts +30 -0
- package/dist/cjs/lib/validation/interfaces/WhenOptions.js +2 -0
- package/dist/cjs/lib/validation/interfaces/WhenSchemaOptions.d.ts +11 -0
- package/dist/cjs/lib/validation/interfaces/WhenSchemaOptions.js +2 -0
- package/dist/cjs/lib/validation/messages/ar.d.ts +5 -0
- package/dist/cjs/lib/validation/messages/ar.js +145 -0
- package/dist/cjs/lib/validation/messages/de.d.ts +5 -0
- package/dist/cjs/lib/validation/messages/de.js +145 -0
- package/dist/cjs/lib/validation/messages/es.d.ts +5 -0
- package/dist/cjs/lib/validation/messages/es.js +145 -0
- package/dist/cjs/lib/validation/messages/fr.d.ts +5 -0
- package/dist/cjs/lib/validation/messages/fr.js +145 -0
- package/dist/cjs/lib/validation/messages/hi.d.ts +5 -0
- package/dist/cjs/lib/validation/messages/hi.js +145 -0
- package/dist/cjs/lib/validation/messages/id.d.ts +5 -0
- package/dist/cjs/lib/validation/messages/id.js +145 -0
- package/dist/cjs/lib/validation/messages/it.d.ts +5 -0
- package/dist/cjs/lib/validation/messages/it.js +145 -0
- package/dist/cjs/lib/validation/messages/ja.d.ts +5 -0
- package/dist/cjs/lib/validation/messages/ja.js +145 -0
- package/dist/cjs/lib/validation/messages/ko.d.ts +5 -0
- package/dist/cjs/lib/validation/messages/ko.js +145 -0
- package/dist/cjs/lib/validation/messages/nl.d.ts +5 -0
- package/dist/cjs/lib/validation/messages/nl.js +145 -0
- package/dist/cjs/lib/validation/messages/pl.d.ts +5 -0
- package/dist/cjs/lib/validation/messages/pl.js +145 -0
- package/dist/cjs/lib/validation/messages/pt-BR.d.ts +5 -0
- package/dist/cjs/lib/validation/messages/pt-BR.js +145 -0
- package/dist/cjs/lib/validation/messages/ru.d.ts +5 -0
- package/dist/cjs/lib/validation/messages/ru.js +145 -0
- package/dist/cjs/lib/validation/messages/th.d.ts +5 -0
- package/dist/cjs/lib/validation/messages/th.js +145 -0
- package/dist/cjs/lib/validation/messages/tr.d.ts +5 -0
- package/dist/cjs/lib/validation/messages/tr.js +145 -0
- package/dist/cjs/lib/validation/messages/uk.d.ts +5 -0
- package/dist/cjs/lib/validation/messages/uk.js +145 -0
- package/dist/cjs/lib/validation/messages/vi.d.ts +5 -0
- package/dist/cjs/lib/validation/messages/vi.js +145 -0
- package/dist/cjs/lib/validation/messages/zh-CN.d.ts +5 -0
- package/dist/cjs/lib/validation/messages/zh-CN.js +145 -0
- package/dist/cjs/lib/validation/messages/zh-TW.d.ts +5 -0
- package/dist/cjs/lib/validation/messages/zh-TW.js +145 -0
- package/dist/cjs/lib/validation/types/BasicType.d.ts +4 -0
- package/dist/cjs/lib/validation/types/BasicType.js +2 -0
- package/dist/cjs/lib/validation/types/ComparatorFunction.d.ts +4 -0
- package/dist/cjs/lib/validation/types/ComparatorFunction.js +2 -0
- package/dist/cjs/lib/validation/types/CustomValidator.d.ts +9 -0
- package/dist/cjs/lib/validation/types/CustomValidator.js +2 -0
- package/dist/cjs/lib/validation/types/ExtensionBoundSchema.d.ts +2 -0
- package/dist/cjs/lib/validation/types/ExtensionBoundSchema.js +2 -0
- package/dist/cjs/lib/validation/types/ExternalValidationFunction.d.ts +8 -0
- package/dist/cjs/lib/validation/types/ExternalValidationFunction.js +2 -0
- package/dist/cjs/lib/validation/types/IsNonPrimitiveSubsetUnion.d.ts +3 -0
- package/dist/cjs/lib/validation/types/IsNonPrimitiveSubsetUnion.js +2 -0
- package/dist/cjs/lib/validation/types/IsPrimitiveSubset.d.ts +3 -0
- package/dist/cjs/lib/validation/types/IsPrimitiveSubset.js +2 -0
- package/dist/cjs/lib/validation/types/IsUnion.d.ts +1 -0
- package/dist/cjs/lib/validation/types/IsUnion.js +2 -0
- package/dist/cjs/lib/validation/types/LanguageMessages.d.ts +5 -0
- package/dist/cjs/lib/validation/types/LanguageMessages.js +2 -0
- package/dist/cjs/lib/validation/types/NoNestedArrays.d.ts +5 -0
- package/dist/cjs/lib/validation/types/NoNestedArrays.js +2 -0
- package/dist/cjs/lib/validation/types/NullableType.d.ts +1 -0
- package/dist/cjs/lib/validation/types/NullableType.js +2 -0
- package/dist/cjs/lib/validation/types/ObjectPropertiesSchema.d.ts +12 -0
- package/dist/cjs/lib/validation/types/ObjectPropertiesSchema.js +2 -0
- package/dist/cjs/lib/validation/types/PartialSchemaMap.d.ts +4 -0
- package/dist/cjs/lib/validation/types/PartialSchemaMap.js +2 -0
- package/dist/cjs/lib/validation/types/PresenceMode.d.ts +4 -0
- package/dist/cjs/lib/validation/types/PresenceMode.js +2 -0
- package/dist/cjs/lib/validation/types/Primitives.d.ts +4 -0
- package/dist/cjs/lib/validation/types/Primitives.js +2 -0
- package/dist/cjs/lib/validation/types/Schema.d.ts +17 -0
- package/dist/cjs/lib/validation/types/Schema.js +2 -0
- package/dist/cjs/lib/validation/types/SchemaFunction.d.ts +6 -0
- package/dist/cjs/lib/validation/types/SchemaFunction.js +2 -0
- package/dist/cjs/lib/validation/types/SchemaLike.d.ts +6 -0
- package/dist/cjs/lib/validation/types/SchemaLike.js +2 -0
- package/dist/cjs/lib/validation/types/SchemaLikeWithoutArray.d.ts +7 -0
- package/dist/cjs/lib/validation/types/SchemaLikeWithoutArray.js +2 -0
- package/dist/cjs/lib/validation/types/SchemaMap.d.ts +7 -0
- package/dist/cjs/lib/validation/types/SchemaMap.js +2 -0
- package/dist/cjs/lib/validation/types/StrictSchemaMap.d.ts +4 -0
- package/dist/cjs/lib/validation/types/StrictSchemaMap.js +2 -0
- package/dist/cjs/lib/validation/types/Types.d.ts +4 -0
- package/dist/cjs/lib/validation/types/Types.js +2 -0
- package/dist/cjs/lib/validation/types/UnwrapSchemaLikeWithoutArray.d.ts +5 -0
- package/dist/cjs/lib/validation/types/UnwrapSchemaLikeWithoutArray.js +2 -0
- package/dist/cjs/lib/validation/types/ValidationErrorFunction.d.ts +7 -0
- package/dist/cjs/lib/validation/types/ValidationErrorFunction.js +2 -0
- package/dist/cjs/options/ApplicationOptions.d.ts +60 -0
- package/dist/cjs/options/ApplicationOptions.js +75 -0
- package/dist/cjs/options/LoadAnonymousObjectOptions.d.ts +33 -0
- package/dist/cjs/options/LoadAnonymousObjectOptions.js +51 -0
- package/dist/cjs/options/LoadNamedObjectOptions.d.ts +29 -0
- package/dist/cjs/options/LoadNamedObjectOptions.js +42 -0
- package/dist/cjs/options/LoadObjectOptions.d.ts +30 -0
- package/dist/cjs/options/LoadObjectOptions.js +53 -0
- package/dist/cjs/options/ModuleLoadObjectsOptions.d.ts +44 -0
- package/dist/cjs/options/ModuleLoadObjectsOptions.js +61 -0
- package/dist/cjs/options/ModuleOptions.d.ts +74 -0
- package/dist/cjs/options/ModuleOptions.js +86 -0
- package/dist/cjs/options/OverridableNamedObjectOptions.d.ts +26 -0
- package/dist/cjs/options/OverridableNamedObjectOptions.js +37 -0
- package/dist/cjs/options/OverridableObjectOptions.d.ts +34 -0
- package/dist/cjs/options/OverridableObjectOptions.js +52 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/types/ActionPattern.d.ts +6 -0
- package/dist/cjs/types/ActionPattern.js +2 -0
- package/dist/cjs/types/ApplicationExitReason.d.ts +13 -0
- package/dist/cjs/types/ApplicationExitReason.js +2 -0
- package/dist/cjs/types/ClassDecorator.d.ts +6 -0
- package/dist/cjs/types/ClassDecorator.js +2 -0
- package/dist/cjs/types/ComponentOptions.d.ts +20 -0
- package/dist/cjs/types/ComponentOptions.js +2 -0
- package/dist/cjs/types/CronOptions.d.ts +25 -0
- package/dist/cjs/types/CronOptions.js +2 -0
- package/dist/cjs/types/JSONSchema.d.ts +284 -0
- package/dist/cjs/types/JSONSchema.js +2 -0
- package/dist/cjs/types/MethodDecorator.d.ts +5 -0
- package/dist/cjs/types/MethodDecorator.js +2 -0
- package/dist/cjs/types/ModuleOptions.d.ts +20 -0
- package/dist/cjs/types/ModuleOptions.js +2 -0
- package/dist/cjs/types/ObjectOptions.d.ts +20 -0
- package/dist/cjs/types/ObjectOptions.js +2 -0
- package/dist/cjs/types/PaginationMeta.d.ts +21 -0
- package/dist/cjs/types/PaginationMeta.js +2 -0
- package/dist/cjs/types/ParameterDecorator.d.ts +5 -0
- package/dist/cjs/types/ParameterDecorator.js +2 -0
- package/dist/cjs/types/PropertyDecorator.d.ts +4 -0
- package/dist/cjs/types/PropertyDecorator.js +2 -0
- package/dist/cjs/types/ProviderOptions.d.ts +20 -0
- package/dist/cjs/types/ProviderOptions.js +2 -0
- package/dist/esm/components/ConsoleLogger.js +96 -0
- package/dist/esm/constants/DIMetadataKey.js +10 -0
- package/dist/esm/constants/DTOMetadataKey.js +5 -0
- package/dist/esm/decorators/asst/After.js +30 -0
- package/dist/esm/decorators/asst/Before.js +29 -0
- package/dist/esm/decorators/di/Autoload.js +34 -0
- package/dist/esm/decorators/di/Configurable.js +57 -0
- package/dist/esm/decorators/di/Inject.js +33 -0
- package/dist/esm/decorators/di/Lifetime.js +100 -0
- package/dist/esm/decorators/dto/Accept.js +38 -0
- package/dist/esm/decorators/dto/Expect.js +38 -0
- package/dist/esm/decorators/dto/IndexSignature.js +30 -0
- package/dist/esm/decorators/dto/Return.js +39 -0
- package/dist/esm/dto/PaginationResultDTO.js +46 -0
- package/dist/esm/dto/PaginationSearchDTO.js +41 -0
- package/dist/esm/dto/Paginator.js +50 -0
- package/dist/esm/exceptions/DestroyRuntimeContainerException.js +13 -0
- package/dist/esm/exceptions/InvalidActionPatternDepthException.js +11 -0
- package/dist/esm/exceptions/InvalidAssistantFunctionTypeException.js +12 -0
- package/dist/esm/exceptions/InvalidObjectTypeException.js +12 -0
- package/dist/esm/exceptions/MethodNotFoundException.js +11 -0
- package/dist/esm/exceptions/ObjectDestroyedException.js +12 -0
- package/dist/esm/exceptions/alias/AliasExistsException.js +11 -0
- package/dist/esm/exceptions/alias/AliasNotFoundException.js +11 -0
- package/dist/esm/exceptions/alias/InvalidAliasNameException.js +11 -0
- package/dist/esm/exceptions/di/DependencyInjectionException.js +12 -0
- package/dist/esm/exceptions/di/InvalidObjectOptionsException.js +12 -0
- package/dist/esm/exceptions/di/LifetimeLockedException.js +12 -0
- package/dist/esm/exceptions/di/OverridableObjectTargetConfigNotFoundException.js +12 -0
- package/dist/esm/exceptions/dto/InvalidMethodAcceptException.js +12 -0
- package/dist/esm/exceptions/dto/InvalidMethodReturnException.js +12 -0
- package/dist/esm/exceptions/dto/InvalidValueException.js +14 -0
- package/dist/esm/exports/ASSTDecorators.js +3 -0
- package/dist/esm/exports/Core.js +64 -0
- package/dist/esm/exports/DIDecorators.js +5 -0
- package/dist/esm/exports/DTODecorators.js +6 -0
- package/dist/esm/exports/DTOs.js +16 -0
- package/dist/esm/exports/LoggerComponent.js +3 -0
- package/dist/esm/interfaces/IBaseObjectConstructor.js +1 -0
- package/dist/esm/interfaces/IConstructor.js +1 -0
- package/dist/esm/interfaces/ILogger.js +1 -0
- package/dist/esm/lib/app/Application.js +606 -0
- package/dist/esm/lib/app/ApplicationConfigLoader.js +26 -0
- package/dist/esm/lib/app/MigrationCommand.js +28 -0
- package/dist/esm/lib/base/BaseObject.js +605 -0
- package/dist/esm/lib/base/EventEmitter.js +147 -0
- package/dist/esm/lib/base/async-constructor/Append.js +18 -0
- package/dist/esm/lib/base/async-constructor/AsyncConstructor.js +7 -0
- package/dist/esm/lib/base/internal/ApplicationLaunch.js +53 -0
- package/dist/esm/lib/base/internal/ConfigurableRecordsInjection.js +76 -0
- package/dist/esm/lib/base/internal/EventEmitter2.js +711 -0
- package/dist/esm/lib/base/internal/MemberDeclarations.js +40 -0
- package/dist/esm/lib/base/internal/MethodAssistantFunction.js +106 -0
- package/dist/esm/lib/base/internal/ModuleConfigLoader.js +109 -0
- package/dist/esm/lib/base/internal/ModuleInitialization.js +5 -0
- package/dist/esm/lib/base/internal/ObjectConfiguration.js +36 -0
- package/dist/esm/lib/base/internal/ObjectContainer.js +19 -0
- package/dist/esm/lib/base/internal/ObjectInjection.js +53 -0
- package/dist/esm/lib/base/internal/ObjectOptionsCheck.js +67 -0
- package/dist/esm/lib/base/internal/ObjectStartup.js +69 -0
- package/dist/esm/lib/base/internal/ObjectType.js +68 -0
- package/dist/esm/lib/core/Alias.js +93 -0
- package/dist/esm/lib/core/Component.js +359 -0
- package/dist/esm/lib/core/Container.js +629 -0
- package/dist/esm/lib/core/Module.js +265 -0
- package/dist/esm/lib/core/Provider.js +54 -0
- package/dist/esm/lib/dto/CachedSchema.js +1 -0
- package/dist/esm/lib/dto/DTO.js +458 -0
- package/dist/esm/lib/dto/DataValidator.js +243 -0
- package/dist/esm/lib/dto/FlexibleDTO.js +33 -0
- package/dist/esm/lib/dto/MethodValidation.js +136 -0
- package/dist/esm/lib/dto/ObjectSchemaValidation.js +167 -0
- package/dist/esm/lib/dto/internal/CronValidator.js +125 -0
- package/dist/esm/lib/foundation/BasicInfo.js +106 -0
- package/dist/esm/lib/foundation/EndProcess.js +26 -0
- package/dist/esm/lib/foundation/Exception.js +160 -0
- package/dist/esm/lib/foundation/LifecycleErrorReporter.js +59 -0
- package/dist/esm/lib/foundation/Packaging.js +38 -0
- package/dist/esm/lib/foundation/ThrowWarning.js +13 -0
- package/dist/esm/lib/helpers/internal/WithCause.js +9 -0
- package/dist/esm/lib/ioc/ConstructorSymbol.js +17 -0
- package/dist/esm/lib/ioc/DependencyInjectionContainer.js +409 -0
- package/dist/esm/lib/ioc/Errors.js +108 -0
- package/dist/esm/lib/ioc/Lifetime.js +27 -0
- package/dist/esm/lib/ioc/ListModules.js +68 -0
- package/dist/esm/lib/ioc/LoadModuleNative.js +5 -0
- package/dist/esm/lib/ioc/LoadModules.js +164 -0
- package/dist/esm/lib/ioc/ObjectLifetime.js +34 -0
- package/dist/esm/lib/ioc/ObjectWeakRefs.js +42 -0
- package/dist/esm/lib/ioc/Resolvers.js +242 -0
- package/dist/esm/lib/ioc/Utils.js +65 -0
- package/dist/esm/lib/validation/JsonSchema.js +81 -0
- package/dist/esm/lib/validation/VLD.js +210 -0
- package/dist/esm/lib/validation/ValidationLanguage.js +51 -0
- package/dist/esm/lib/validation/ValidationMessages.js +151 -0
- package/dist/esm/lib/validation/engine/address/decode.js +101 -0
- package/dist/esm/lib/validation/engine/address/domain.js +143 -0
- package/dist/esm/lib/validation/engine/address/email.js +145 -0
- package/dist/esm/lib/validation/engine/address/errors.js +27 -0
- package/dist/esm/lib/validation/engine/address/index.js +9 -0
- package/dist/esm/lib/validation/engine/address/ip.js +46 -0
- package/dist/esm/lib/validation/engine/address/uri.js +214 -0
- package/dist/esm/lib/validation/engine/expression/index.js +352 -0
- package/dist/esm/lib/validation/engine/json-schema/combinations.js +30 -0
- package/dist/esm/lib/validation/engine/json-schema/helpers.js +366 -0
- package/dist/esm/lib/validation/engine/json-schema/import.js +865 -0
- package/dist/esm/lib/validation/engine/json-schema/index.js +36 -0
- package/dist/esm/lib/validation/engine/json-schema/model.js +4 -0
- package/dist/esm/lib/validation/engine/json-schema/parsers/json-2020-12.js +19 -0
- package/dist/esm/lib/validation/engine/json-schema/parsers/json-draft-04.js +56 -0
- package/dist/esm/lib/validation/engine/json-schema/parsers/json-draft-2019-09.js +32 -0
- package/dist/esm/lib/validation/engine/json-schema/parsers/json.js +1460 -0
- package/dist/esm/lib/validation/engine/json-schema/parsers/open-api-3.1.js +34 -0
- package/dist/esm/lib/validation/engine/json-schema/parsers/open-api.js +169 -0
- package/dist/esm/lib/validation/engine/location/index.js +20 -0
- package/dist/esm/lib/validation/engine/schema/annotate.js +126 -0
- package/dist/esm/lib/validation/engine/schema/assert.js +60 -0
- package/dist/esm/lib/validation/engine/schema/base.js +797 -0
- package/dist/esm/lib/validation/engine/schema/cache.js +94 -0
- package/dist/esm/lib/validation/engine/schema/common.js +203 -0
- package/dist/esm/lib/validation/engine/schema/compile.js +203 -0
- package/dist/esm/lib/validation/engine/schema/errors.js +189 -0
- package/dist/esm/lib/validation/engine/schema/extend.js +199 -0
- package/dist/esm/lib/validation/engine/schema/extensions/bigint.js +170 -0
- package/dist/esm/lib/validation/engine/schema/fastpath.js +622 -0
- package/dist/esm/lib/validation/engine/schema/formats.js +102 -0
- package/dist/esm/lib/validation/engine/schema/index.js +199 -0
- package/dist/esm/lib/validation/engine/schema/lazy.js +5 -0
- package/dist/esm/lib/validation/engine/schema/manifest.js +325 -0
- package/dist/esm/lib/validation/engine/schema/messages.js +131 -0
- package/dist/esm/lib/validation/engine/schema/model.js +1 -0
- package/dist/esm/lib/validation/engine/schema/modify.js +186 -0
- package/dist/esm/lib/validation/engine/schema/ref.js +277 -0
- package/dist/esm/lib/validation/engine/schema/schemas.js +262 -0
- package/dist/esm/lib/validation/engine/schema/state.js +110 -0
- package/dist/esm/lib/validation/engine/schema/template.js +294 -0
- package/dist/esm/lib/validation/engine/schema/trace.js +240 -0
- package/dist/esm/lib/validation/engine/schema/types/alternatives.js +294 -0
- package/dist/esm/lib/validation/engine/schema/types/any.js +160 -0
- package/dist/esm/lib/validation/engine/schema/types/array.js +630 -0
- package/dist/esm/lib/validation/engine/schema/types/binary.js +78 -0
- package/dist/esm/lib/validation/engine/schema/types/boolean.js +104 -0
- package/dist/esm/lib/validation/engine/schema/types/date.js +159 -0
- package/dist/esm/lib/validation/engine/schema/types/function.js +63 -0
- package/dist/esm/lib/validation/engine/schema/types/keys.js +873 -0
- package/dist/esm/lib/validation/engine/schema/types/link.js +122 -0
- package/dist/esm/lib/validation/engine/schema/types/number.js +346 -0
- package/dist/esm/lib/validation/engine/schema/types/object.js +16 -0
- package/dist/esm/lib/validation/engine/schema/types/string.js +728 -0
- package/dist/esm/lib/validation/engine/schema/types/symbol.js +70 -0
- package/dist/esm/lib/validation/engine/schema/validator.js +638 -0
- package/dist/esm/lib/validation/engine/schema/values.js +164 -0
- package/dist/esm/lib/validation/engine/sorter/index.js +176 -0
- package/dist/esm/lib/validation/engine/tlds/index.js +5 -0
- package/dist/esm/lib/validation/engine/tlds/tlds.js +1445 -0
- package/dist/esm/lib/validation/engine/utils/applyToDefaults.js +86 -0
- package/dist/esm/lib/validation/engine/utils/assert.js +20 -0
- package/dist/esm/lib/validation/engine/utils/assertError.js +14 -0
- package/dist/esm/lib/validation/engine/utils/clone.js +157 -0
- package/dist/esm/lib/validation/engine/utils/deepEqual.js +262 -0
- package/dist/esm/lib/validation/engine/utils/escapeHtml.js +59 -0
- package/dist/esm/lib/validation/engine/utils/escapeRegex.js +10 -0
- package/dist/esm/lib/validation/engine/utils/ignore.js +9 -0
- package/dist/esm/lib/validation/engine/utils/index.js +16 -0
- package/dist/esm/lib/validation/engine/utils/merge.js +64 -0
- package/dist/esm/lib/validation/engine/utils/reach.js +59 -0
- package/dist/esm/lib/validation/engine/utils/stringify.js +15 -0
- package/dist/esm/lib/validation/engine/utils/types.js +47 -0
- package/dist/esm/lib/validation/engine/utils/utils.js +18 -0
- package/dist/esm/lib/validation/exceptions/SchemaConversionException.js +10 -0
- package/dist/esm/lib/validation/exceptions/SchemaDefinitionException.js +10 -0
- package/dist/esm/lib/validation/exceptions/SchemaException.js +6 -0
- package/dist/esm/lib/validation/exceptions/SchemaValidationException.js +39 -0
- package/dist/esm/lib/validation/interfaces/AlternativesSchema.js +1 -0
- package/dist/esm/lib/validation/interfaces/AnySchema.js +1 -0
- package/dist/esm/lib/validation/interfaces/ArraySchema.js +1 -0
- package/dist/esm/lib/validation/interfaces/ArraySortOptions.js +1 -0
- package/dist/esm/lib/validation/interfaces/ArrayUniqueOptions.js +1 -0
- package/dist/esm/lib/validation/interfaces/Base64Options.js +1 -0
- package/dist/esm/lib/validation/interfaces/BaseValidationOptions.js +1 -0
- package/dist/esm/lib/validation/interfaces/BigIntSchema.js +1 -0
- package/dist/esm/lib/validation/interfaces/BinarySchema.js +1 -0
- package/dist/esm/lib/validation/interfaces/BooleanSchema.js +1 -0
- package/dist/esm/lib/validation/interfaces/Cache.js +1 -0
- package/dist/esm/lib/validation/interfaces/CacheConfiguration.js +1 -0
- package/dist/esm/lib/validation/interfaces/CompileOptions.js +1 -0
- package/dist/esm/lib/validation/interfaces/Context.js +1 -0
- package/dist/esm/lib/validation/interfaces/CustomHelpers.js +1 -0
- package/dist/esm/lib/validation/interfaces/DataUriOptions.js +1 -0
- package/dist/esm/lib/validation/interfaces/DateSchema.js +1 -0
- package/dist/esm/lib/validation/interfaces/DependencyOptions.js +1 -0
- package/dist/esm/lib/validation/interfaces/Description.js +1 -0
- package/dist/esm/lib/validation/interfaces/DomainOptions.js +1 -0
- package/dist/esm/lib/validation/interfaces/EmailOptions.js +1 -0
- package/dist/esm/lib/validation/interfaces/ErrorFormattingOptions.js +1 -0
- package/dist/esm/lib/validation/interfaces/ErrorReport.js +1 -0
- package/dist/esm/lib/validation/interfaces/ErrorValidationOptions.js +1 -0
- package/dist/esm/lib/validation/interfaces/Extension.js +1 -0
- package/dist/esm/lib/validation/interfaces/ExtensionFlag.js +1 -0
- package/dist/esm/lib/validation/interfaces/ExternalHelpers.js +1 -0
- package/dist/esm/lib/validation/interfaces/FunctionSchema.js +1 -0
- package/dist/esm/lib/validation/interfaces/GuidOptions.js +1 -0
- package/dist/esm/lib/validation/interfaces/HexOptions.js +1 -0
- package/dist/esm/lib/validation/interfaces/HierarchySeparatorOptions.js +1 -0
- package/dist/esm/lib/validation/interfaces/IpOptions.js +1 -0
- package/dist/esm/lib/validation/interfaces/LanguageMessageTemplate.js +1 -0
- package/dist/esm/lib/validation/interfaces/LinkSchema.js +1 -0
- package/dist/esm/lib/validation/interfaces/NumberSchema.js +1 -0
- package/dist/esm/lib/validation/interfaces/ObjectPatternOptions.js +1 -0
- package/dist/esm/lib/validation/interfaces/ObjectSchema.js +1 -0
- package/dist/esm/lib/validation/interfaces/Reference.js +1 -0
- package/dist/esm/lib/validation/interfaces/ReferenceOptions.js +1 -0
- package/dist/esm/lib/validation/interfaces/RenameOptions.js +1 -0
- package/dist/esm/lib/validation/interfaces/RuleOptions.js +1 -0
- package/dist/esm/lib/validation/interfaces/SchemaInternals.js +1 -0
- package/dist/esm/lib/validation/interfaces/State.js +1 -0
- package/dist/esm/lib/validation/interfaces/StringRegexOptions.js +1 -0
- package/dist/esm/lib/validation/interfaces/StringSchema.js +1 -0
- package/dist/esm/lib/validation/interfaces/SwitchCases.js +1 -0
- package/dist/esm/lib/validation/interfaces/SwitchDefault.js +1 -0
- package/dist/esm/lib/validation/interfaces/SymbolSchema.js +1 -0
- package/dist/esm/lib/validation/interfaces/TopLevelDomainOptions.js +1 -0
- package/dist/esm/lib/validation/interfaces/UriOptions.js +1 -0
- package/dist/esm/lib/validation/interfaces/ValidationErrorItem.js +1 -0
- package/dist/esm/lib/validation/interfaces/ValidationOptions.js +1 -0
- package/dist/esm/lib/validation/interfaces/WhenOptions.js +1 -0
- package/dist/esm/lib/validation/interfaces/WhenSchemaOptions.js +1 -0
- package/dist/esm/lib/validation/messages/ar.js +143 -0
- package/dist/esm/lib/validation/messages/de.js +143 -0
- package/dist/esm/lib/validation/messages/es.js +143 -0
- package/dist/esm/lib/validation/messages/fr.js +143 -0
- package/dist/esm/lib/validation/messages/hi.js +143 -0
- package/dist/esm/lib/validation/messages/id.js +143 -0
- package/dist/esm/lib/validation/messages/it.js +143 -0
- package/dist/esm/lib/validation/messages/ja.js +143 -0
- package/dist/esm/lib/validation/messages/ko.js +143 -0
- package/dist/esm/lib/validation/messages/nl.js +143 -0
- package/dist/esm/lib/validation/messages/pl.js +143 -0
- package/dist/esm/lib/validation/messages/pt-BR.js +143 -0
- package/dist/esm/lib/validation/messages/ru.js +143 -0
- package/dist/esm/lib/validation/messages/th.js +143 -0
- package/dist/esm/lib/validation/messages/tr.js +143 -0
- package/dist/esm/lib/validation/messages/uk.js +143 -0
- package/dist/esm/lib/validation/messages/vi.js +143 -0
- package/dist/esm/lib/validation/messages/zh-CN.js +143 -0
- package/dist/esm/lib/validation/messages/zh-TW.js +143 -0
- package/dist/esm/lib/validation/types/BasicType.js +1 -0
- package/dist/esm/lib/validation/types/ComparatorFunction.js +1 -0
- package/dist/esm/lib/validation/types/CustomValidator.js +1 -0
- package/dist/esm/lib/validation/types/ExtensionBoundSchema.js +1 -0
- package/dist/esm/lib/validation/types/ExternalValidationFunction.js +1 -0
- package/dist/esm/lib/validation/types/IsNonPrimitiveSubsetUnion.js +1 -0
- package/dist/esm/lib/validation/types/IsPrimitiveSubset.js +1 -0
- package/dist/esm/lib/validation/types/IsUnion.js +1 -0
- package/dist/esm/lib/validation/types/LanguageMessages.js +1 -0
- package/dist/esm/lib/validation/types/NoNestedArrays.js +1 -0
- package/dist/esm/lib/validation/types/NullableType.js +1 -0
- package/dist/esm/lib/validation/types/ObjectPropertiesSchema.js +1 -0
- package/dist/esm/lib/validation/types/PartialSchemaMap.js +1 -0
- package/dist/esm/lib/validation/types/PresenceMode.js +1 -0
- package/dist/esm/lib/validation/types/Primitives.js +1 -0
- package/dist/esm/lib/validation/types/Schema.js +1 -0
- package/dist/esm/lib/validation/types/SchemaFunction.js +1 -0
- package/dist/esm/lib/validation/types/SchemaLike.js +1 -0
- package/dist/esm/lib/validation/types/SchemaLikeWithoutArray.js +1 -0
- package/dist/esm/lib/validation/types/SchemaMap.js +1 -0
- package/dist/esm/lib/validation/types/StrictSchemaMap.js +1 -0
- package/dist/esm/lib/validation/types/Types.js +1 -0
- package/dist/esm/lib/validation/types/UnwrapSchemaLikeWithoutArray.js +1 -0
- package/dist/esm/lib/validation/types/ValidationErrorFunction.js +1 -0
- package/dist/esm/options/ApplicationOptions.js +71 -0
- package/dist/esm/options/LoadAnonymousObjectOptions.js +48 -0
- package/dist/esm/options/LoadNamedObjectOptions.js +39 -0
- package/dist/esm/options/LoadObjectOptions.js +50 -0
- package/dist/esm/options/ModuleLoadObjectsOptions.js +57 -0
- package/dist/esm/options/ModuleOptions.js +82 -0
- package/dist/esm/options/OverridableNamedObjectOptions.js +34 -0
- package/dist/esm/options/OverridableObjectOptions.js +49 -0
- package/dist/esm/types/ActionPattern.js +1 -0
- package/dist/esm/types/ApplicationExitReason.js +1 -0
- package/dist/esm/types/ClassDecorator.js +1 -0
- package/dist/esm/types/ComponentOptions.js +1 -0
- package/dist/esm/types/CronOptions.js +1 -0
- package/dist/esm/types/JSONSchema.js +1 -0
- package/dist/esm/types/MethodDecorator.js +1 -0
- package/dist/esm/types/ModuleOptions.js +1 -0
- package/dist/esm/types/ObjectOptions.js +1 -0
- package/dist/esm/types/PaginationMeta.js +1 -0
- package/dist/esm/types/ParameterDecorator.js +1 -0
- package/dist/esm/types/PropertyDecorator.js +1 -0
- package/dist/esm/types/ProviderOptions.js +1 -0
- package/dist/types/components/ConsoleLogger.d.ts +62 -0
- package/dist/types/constants/DIMetadataKey.d.ts +10 -0
- package/dist/types/constants/DTOMetadataKey.d.ts +5 -0
- package/dist/types/decorators/asst/After.d.ts +29 -0
- package/dist/types/decorators/asst/Before.d.ts +28 -0
- package/dist/types/decorators/di/Autoload.d.ts +33 -0
- package/dist/types/decorators/di/Configurable.d.ts +51 -0
- package/dist/types/decorators/di/Inject.d.ts +85 -0
- package/dist/types/decorators/di/Lifetime.d.ts +94 -0
- package/dist/types/decorators/dto/Accept.d.ts +38 -0
- package/dist/types/decorators/dto/Expect.d.ts +38 -0
- package/dist/types/decorators/dto/IndexSignature.d.ts +30 -0
- package/dist/types/decorators/dto/Return.d.ts +39 -0
- package/dist/types/dto/PaginationResultDTO.d.ts +33 -0
- package/dist/types/dto/PaginationSearchDTO.d.ts +33 -0
- package/dist/types/dto/Paginator.d.ts +54 -0
- package/dist/types/exceptions/DestroyRuntimeContainerException.d.ts +10 -0
- package/dist/types/exceptions/InvalidActionPatternDepthException.d.ts +8 -0
- package/dist/types/exceptions/InvalidAssistantFunctionTypeException.d.ts +9 -0
- package/dist/types/exceptions/InvalidObjectTypeException.d.ts +9 -0
- package/dist/types/exceptions/MethodNotFoundException.d.ts +8 -0
- package/dist/types/exceptions/ObjectDestroyedException.d.ts +9 -0
- package/dist/types/exceptions/alias/AliasExistsException.d.ts +8 -0
- package/dist/types/exceptions/alias/AliasNotFoundException.d.ts +8 -0
- package/dist/types/exceptions/alias/InvalidAliasNameException.d.ts +8 -0
- package/dist/types/exceptions/di/DependencyInjectionException.d.ts +9 -0
- package/dist/types/exceptions/di/InvalidObjectOptionsException.d.ts +9 -0
- package/dist/types/exceptions/di/LifetimeLockedException.d.ts +9 -0
- package/dist/types/exceptions/di/OverridableObjectTargetConfigNotFoundException.d.ts +9 -0
- package/dist/types/exceptions/dto/InvalidMethodAcceptException.d.ts +9 -0
- package/dist/types/exceptions/dto/InvalidMethodReturnException.d.ts +9 -0
- package/dist/types/exceptions/dto/InvalidValueException.d.ts +11 -0
- package/dist/types/exports/ASSTDecorators.d.ts +3 -0
- package/dist/types/exports/Core.d.ts +93 -0
- package/dist/types/exports/DIDecorators.d.ts +5 -0
- package/dist/types/exports/DTODecorators.d.ts +6 -0
- package/dist/types/exports/DTOs.d.ts +17 -0
- package/dist/types/exports/LoggerComponent.d.ts +3 -0
- package/dist/types/interfaces/IBaseObjectConstructor.d.ts +10 -0
- package/dist/types/interfaces/IConstructor.d.ts +6 -0
- package/dist/types/interfaces/ILogger.d.ts +35 -0
- package/dist/types/lib/app/Application.d.ts +346 -0
- package/dist/types/lib/app/ApplicationConfigLoader.d.ts +17 -0
- package/dist/types/lib/app/MigrationCommand.d.ts +31 -0
- package/dist/types/lib/base/BaseObject.d.ts +343 -0
- package/dist/types/lib/base/EventEmitter.d.ts +37 -0
- package/dist/types/lib/base/async-constructor/Append.d.ts +1 -0
- package/dist/types/lib/base/async-constructor/AsyncConstructor.d.ts +3 -0
- package/dist/types/lib/base/internal/ApplicationLaunch.d.ts +16 -0
- package/dist/types/lib/base/internal/ConfigurableRecordsInjection.d.ts +47 -0
- package/dist/types/lib/base/internal/EventEmitter2.d.ts +184 -0
- package/dist/types/lib/base/internal/MemberDeclarations.d.ts +23 -0
- package/dist/types/lib/base/internal/MethodAssistantFunction.d.ts +20 -0
- package/dist/types/lib/base/internal/ModuleConfigLoader.d.ts +46 -0
- package/dist/types/lib/base/internal/ModuleInitialization.d.ts +5 -0
- package/dist/types/lib/base/internal/ObjectConfiguration.d.ts +29 -0
- package/dist/types/lib/base/internal/ObjectContainer.d.ts +15 -0
- package/dist/types/lib/base/internal/ObjectInjection.d.ts +43 -0
- package/dist/types/lib/base/internal/ObjectOptionsCheck.d.ts +12 -0
- package/dist/types/lib/base/internal/ObjectStartup.d.ts +31 -0
- package/dist/types/lib/base/internal/ObjectType.d.ts +37 -0
- package/dist/types/lib/core/Alias.d.ts +48 -0
- package/dist/types/lib/core/Component.d.ts +267 -0
- package/dist/types/lib/core/Container.d.ts +341 -0
- package/dist/types/lib/core/Module.d.ts +165 -0
- package/dist/types/lib/core/Provider.d.ts +52 -0
- package/dist/types/lib/dto/CachedSchema.d.ts +7 -0
- package/dist/types/lib/dto/DTO.d.ts +278 -0
- package/dist/types/lib/dto/DataValidator.d.ts +166 -0
- package/dist/types/lib/dto/FlexibleDTO.d.ts +23 -0
- package/dist/types/lib/dto/MethodValidation.d.ts +44 -0
- package/dist/types/lib/dto/ObjectSchemaValidation.d.ts +86 -0
- package/dist/types/lib/dto/internal/CronValidator.d.ts +8 -0
- package/dist/types/lib/foundation/BasicInfo.d.ts +46 -0
- package/dist/types/lib/foundation/EndProcess.d.ts +14 -0
- package/dist/types/lib/foundation/Exception.d.ts +88 -0
- package/dist/types/lib/foundation/LifecycleErrorReporter.d.ts +26 -0
- package/dist/types/lib/foundation/Packaging.d.ts +29 -0
- package/dist/types/lib/foundation/ThrowWarning.d.ts +6 -0
- package/dist/types/lib/helpers/internal/WithCause.d.ts +6 -0
- package/dist/types/lib/ioc/ConstructorSymbol.d.ts +3 -0
- package/dist/types/lib/ioc/DependencyInjectionContainer.d.ts +178 -0
- package/dist/types/lib/ioc/Errors.d.ts +59 -0
- package/dist/types/lib/ioc/Lifetime.d.ts +12 -0
- package/dist/types/lib/ioc/ListModules.d.ts +42 -0
- package/dist/types/lib/ioc/LoadModuleNative.d.ts +1 -0
- package/dist/types/lib/ioc/LoadModules.d.ts +49 -0
- package/dist/types/lib/ioc/ObjectLifetime.d.ts +22 -0
- package/dist/types/lib/ioc/ObjectWeakRefs.d.ts +19 -0
- package/dist/types/lib/ioc/Resolvers.d.ts +136 -0
- package/dist/types/lib/ioc/Utils.d.ts +33 -0
- package/dist/types/lib/validation/JsonSchema.d.ts +127 -0
- package/dist/types/lib/validation/VLD.d.ts +275 -0
- package/dist/types/lib/validation/ValidationLanguage.d.ts +42 -0
- package/dist/types/lib/validation/ValidationMessages.d.ts +92 -0
- package/dist/types/lib/validation/engine/address/decode.d.ts +8 -0
- package/dist/types/lib/validation/engine/address/domain.d.ts +74 -0
- package/dist/types/lib/validation/engine/address/email.d.ts +27 -0
- package/dist/types/lib/validation/engine/address/errors.d.ts +48 -0
- package/dist/types/lib/validation/engine/address/index.d.ts +9 -0
- package/dist/types/lib/validation/engine/address/ip.d.ts +35 -0
- package/dist/types/lib/validation/engine/address/uri.d.ts +55 -0
- package/dist/types/lib/validation/engine/expression/index.d.ts +70 -0
- package/dist/types/lib/validation/engine/json-schema/combinations.d.ts +11 -0
- package/dist/types/lib/validation/engine/json-schema/helpers.d.ts +76 -0
- package/dist/types/lib/validation/engine/json-schema/import.d.ts +56 -0
- package/dist/types/lib/validation/engine/json-schema/index.d.ts +20 -0
- package/dist/types/lib/validation/engine/json-schema/model.d.ts +124 -0
- package/dist/types/lib/validation/engine/json-schema/parsers/json-2020-12.d.ts +9 -0
- package/dist/types/lib/validation/engine/json-schema/parsers/json-draft-04.d.ts +17 -0
- package/dist/types/lib/validation/engine/json-schema/parsers/json-draft-2019-09.d.ts +13 -0
- package/dist/types/lib/validation/engine/json-schema/parsers/json.d.ts +245 -0
- package/dist/types/lib/validation/engine/json-schema/parsers/open-api-3.1.d.ts +13 -0
- package/dist/types/lib/validation/engine/json-schema/parsers/open-api.d.ts +24 -0
- package/dist/types/lib/validation/engine/location/index.d.ts +18 -0
- package/dist/types/lib/validation/engine/schema/annotate.d.ts +13 -0
- package/dist/types/lib/validation/engine/schema/assert.d.ts +25 -0
- package/dist/types/lib/validation/engine/schema/base.d.ts +194 -0
- package/dist/types/lib/validation/engine/schema/cache.d.ts +41 -0
- package/dist/types/lib/validation/engine/schema/common.d.ts +79 -0
- package/dist/types/lib/validation/engine/schema/compile.d.ts +81 -0
- package/dist/types/lib/validation/engine/schema/errors.d.ts +94 -0
- package/dist/types/lib/validation/engine/schema/extend.d.ts +122 -0
- package/dist/types/lib/validation/engine/schema/extensions/bigint.d.ts +33 -0
- package/dist/types/lib/validation/engine/schema/fastpath.d.ts +35 -0
- package/dist/types/lib/validation/engine/schema/formats.d.ts +8 -0
- package/dist/types/lib/validation/engine/schema/index.d.ts +95 -0
- package/dist/types/lib/validation/engine/schema/lazy.d.ts +21 -0
- package/dist/types/lib/validation/engine/schema/manifest.d.ts +52 -0
- package/dist/types/lib/validation/engine/schema/messages.d.ts +37 -0
- package/dist/types/lib/validation/engine/schema/model.d.ts +196 -0
- package/dist/types/lib/validation/engine/schema/modify.d.ts +58 -0
- package/dist/types/lib/validation/engine/schema/ref.d.ts +116 -0
- package/dist/types/lib/validation/engine/schema/schemas.d.ts +6 -0
- package/dist/types/lib/validation/engine/schema/state.d.ts +48 -0
- package/dist/types/lib/validation/engine/schema/template.d.ts +72 -0
- package/dist/types/lib/validation/engine/schema/trace.d.ts +121 -0
- package/dist/types/lib/validation/engine/schema/types/alternatives.d.ts +36 -0
- package/dist/types/lib/validation/engine/schema/types/any.d.ts +37 -0
- package/dist/types/lib/validation/engine/schema/types/array.d.ts +46 -0
- package/dist/types/lib/validation/engine/schema/types/binary.d.ts +20 -0
- package/dist/types/lib/validation/engine/schema/types/boolean.d.ts +29 -0
- package/dist/types/lib/validation/engine/schema/types/date.d.ts +27 -0
- package/dist/types/lib/validation/engine/schema/types/function.d.ts +12 -0
- package/dist/types/lib/validation/engine/schema/types/keys.d.ts +119 -0
- package/dist/types/lib/validation/engine/schema/types/link.d.ts +21 -0
- package/dist/types/lib/validation/engine/schema/types/number.d.ts +46 -0
- package/dist/types/lib/validation/engine/schema/types/object.d.ts +10 -0
- package/dist/types/lib/validation/engine/schema/types/string.d.ts +115 -0
- package/dist/types/lib/validation/engine/schema/types/symbol.d.ts +23 -0
- package/dist/types/lib/validation/engine/schema/validator.d.ts +114 -0
- package/dist/types/lib/validation/engine/schema/values.d.ts +51 -0
- package/dist/types/lib/validation/engine/sorter/index.d.ts +54 -0
- package/dist/types/lib/validation/engine/tlds/index.d.ts +1 -0
- package/dist/types/lib/validation/engine/tlds/tlds.d.ts +4 -0
- package/dist/types/lib/validation/engine/utils/applyToDefaults.d.ts +17 -0
- package/dist/types/lib/validation/engine/utils/assert.d.ts +6 -0
- package/dist/types/lib/validation/engine/utils/assertError.d.ts +10 -0
- package/dist/types/lib/validation/engine/utils/clone.d.ts +25 -0
- package/dist/types/lib/validation/engine/utils/deepEqual.d.ts +29 -0
- package/dist/types/lib/validation/engine/utils/escapeHtml.d.ts +8 -0
- package/dist/types/lib/validation/engine/utils/escapeRegex.d.ts +8 -0
- package/dist/types/lib/validation/engine/utils/ignore.d.ts +8 -0
- package/dist/types/lib/validation/engine/utils/index.d.ts +16 -0
- package/dist/types/lib/validation/engine/utils/merge.d.ts +21 -0
- package/dist/types/lib/validation/engine/utils/reach.d.ts +30 -0
- package/dist/types/lib/validation/engine/utils/stringify.d.ts +8 -0
- package/dist/types/lib/validation/engine/utils/types.d.ts +26 -0
- package/dist/types/lib/validation/engine/utils/utils.d.ts +24 -0
- package/dist/types/lib/validation/exceptions/SchemaConversionException.d.ts +7 -0
- package/dist/types/lib/validation/exceptions/SchemaDefinitionException.d.ts +7 -0
- package/dist/types/lib/validation/exceptions/SchemaException.d.ts +6 -0
- package/dist/types/lib/validation/exceptions/SchemaValidationException.d.ts +36 -0
- package/dist/types/lib/validation/interfaces/AlternativesSchema.d.ts +45 -0
- package/dist/types/lib/validation/interfaces/AnySchema.d.ts +399 -0
- package/dist/types/lib/validation/interfaces/ArraySchema.d.ts +106 -0
- package/dist/types/lib/validation/interfaces/ArraySortOptions.d.ts +8 -0
- package/dist/types/lib/validation/interfaces/ArrayUniqueOptions.d.ts +9 -0
- package/dist/types/lib/validation/interfaces/Base64Options.d.ts +9 -0
- package/dist/types/lib/validation/interfaces/BaseValidationOptions.d.ts +97 -0
- package/dist/types/lib/validation/interfaces/BigIntSchema.d.ts +67 -0
- package/dist/types/lib/validation/interfaces/BinarySchema.d.ts +33 -0
- package/dist/types/lib/validation/interfaces/BooleanSchema.d.ts +29 -0
- package/dist/types/lib/validation/interfaces/Cache.d.ts +14 -0
- package/dist/types/lib/validation/interfaces/CacheConfiguration.d.ts +15 -0
- package/dist/types/lib/validation/interfaces/CompileOptions.d.ts +9 -0
- package/dist/types/lib/validation/interfaces/Context.d.ts +9 -0
- package/dist/types/lib/validation/interfaces/CustomHelpers.d.ts +15 -0
- package/dist/types/lib/validation/interfaces/DataUriOptions.d.ts +8 -0
- package/dist/types/lib/validation/interfaces/DateSchema.d.ts +48 -0
- package/dist/types/lib/validation/interfaces/DependencyOptions.d.ts +9 -0
- package/dist/types/lib/validation/interfaces/Description.d.ts +20 -0
- package/dist/types/lib/validation/interfaces/DomainOptions.d.ts +33 -0
- package/dist/types/lib/validation/interfaces/EmailOptions.d.ts +51 -0
- package/dist/types/lib/validation/interfaces/ErrorFormattingOptions.d.ts +60 -0
- package/dist/types/lib/validation/interfaces/ErrorReport.d.ts +14 -0
- package/dist/types/lib/validation/interfaces/ErrorValidationOptions.d.ts +5 -0
- package/dist/types/lib/validation/interfaces/Extension.d.ts +100 -0
- package/dist/types/lib/validation/interfaces/ExtensionFlag.d.ts +4 -0
- package/dist/types/lib/validation/interfaces/ExternalHelpers.d.ts +16 -0
- package/dist/types/lib/validation/interfaces/FunctionSchema.d.ts +31 -0
- package/dist/types/lib/validation/interfaces/GuidOptions.d.ts +6 -0
- package/dist/types/lib/validation/interfaces/HexOptions.d.ts +16 -0
- package/dist/types/lib/validation/interfaces/HierarchySeparatorOptions.d.ts +7 -0
- package/dist/types/lib/validation/interfaces/IpOptions.d.ts +11 -0
- package/dist/types/lib/validation/interfaces/LanguageMessageTemplate.d.ts +4 -0
- package/dist/types/lib/validation/interfaces/LinkSchema.d.ts +26 -0
- package/dist/types/lib/validation/interfaces/NumberSchema.d.ts +134 -0
- package/dist/types/lib/validation/interfaces/ObjectPatternOptions.d.ts +6 -0
- package/dist/types/lib/validation/interfaces/ObjectSchema.d.ts +173 -0
- package/dist/types/lib/validation/interfaces/Reference.d.ts +38 -0
- package/dist/types/lib/validation/interfaces/ReferenceOptions.d.ts +59 -0
- package/dist/types/lib/validation/interfaces/RenameOptions.d.ts +26 -0
- package/dist/types/lib/validation/interfaces/RuleOptions.d.ts +22 -0
- package/dist/types/lib/validation/interfaces/SchemaInternals.d.ts +103 -0
- package/dist/types/lib/validation/interfaces/State.d.ts +8 -0
- package/dist/types/lib/validation/interfaces/StringRegexOptions.d.ts +12 -0
- package/dist/types/lib/validation/interfaces/StringSchema.d.ts +220 -0
- package/dist/types/lib/validation/interfaces/SwitchCases.d.ts +11 -0
- package/dist/types/lib/validation/interfaces/SwitchDefault.d.ts +8 -0
- package/dist/types/lib/validation/interfaces/SymbolSchema.d.ts +16 -0
- package/dist/types/lib/validation/interfaces/TopLevelDomainOptions.d.ts +12 -0
- package/dist/types/lib/validation/interfaces/UriOptions.d.ts +31 -0
- package/dist/types/lib/validation/interfaces/ValidationErrorItem.d.ts +7 -0
- package/dist/types/lib/validation/interfaces/ValidationOptions.d.ts +21 -0
- package/dist/types/lib/validation/interfaces/WhenOptions.d.ts +30 -0
- package/dist/types/lib/validation/interfaces/WhenSchemaOptions.d.ts +11 -0
- package/dist/types/lib/validation/messages/ar.d.ts +5 -0
- package/dist/types/lib/validation/messages/de.d.ts +5 -0
- package/dist/types/lib/validation/messages/es.d.ts +5 -0
- package/dist/types/lib/validation/messages/fr.d.ts +5 -0
- package/dist/types/lib/validation/messages/hi.d.ts +5 -0
- package/dist/types/lib/validation/messages/id.d.ts +5 -0
- package/dist/types/lib/validation/messages/it.d.ts +5 -0
- package/dist/types/lib/validation/messages/ja.d.ts +5 -0
- package/dist/types/lib/validation/messages/ko.d.ts +5 -0
- package/dist/types/lib/validation/messages/nl.d.ts +5 -0
- package/dist/types/lib/validation/messages/pl.d.ts +5 -0
- package/dist/types/lib/validation/messages/pt-BR.d.ts +5 -0
- package/dist/types/lib/validation/messages/ru.d.ts +5 -0
- package/dist/types/lib/validation/messages/th.d.ts +5 -0
- package/dist/types/lib/validation/messages/tr.d.ts +5 -0
- package/dist/types/lib/validation/messages/uk.d.ts +5 -0
- package/dist/types/lib/validation/messages/vi.d.ts +5 -0
- package/dist/types/lib/validation/messages/zh-CN.d.ts +5 -0
- package/dist/types/lib/validation/messages/zh-TW.d.ts +5 -0
- package/dist/types/lib/validation/types/BasicType.d.ts +4 -0
- package/dist/types/lib/validation/types/ComparatorFunction.d.ts +4 -0
- package/dist/types/lib/validation/types/CustomValidator.d.ts +9 -0
- package/dist/types/lib/validation/types/ExtensionBoundSchema.d.ts +2 -0
- package/dist/types/lib/validation/types/ExternalValidationFunction.d.ts +8 -0
- package/dist/types/lib/validation/types/IsNonPrimitiveSubsetUnion.d.ts +3 -0
- package/dist/types/lib/validation/types/IsPrimitiveSubset.d.ts +3 -0
- package/dist/types/lib/validation/types/IsUnion.d.ts +1 -0
- package/dist/types/lib/validation/types/LanguageMessages.d.ts +5 -0
- package/dist/types/lib/validation/types/NoNestedArrays.d.ts +5 -0
- package/dist/types/lib/validation/types/NullableType.d.ts +1 -0
- package/dist/types/lib/validation/types/ObjectPropertiesSchema.d.ts +12 -0
- package/dist/types/lib/validation/types/PartialSchemaMap.d.ts +4 -0
- package/dist/types/lib/validation/types/PresenceMode.d.ts +4 -0
- package/dist/types/lib/validation/types/Primitives.d.ts +4 -0
- package/dist/types/lib/validation/types/Schema.d.ts +17 -0
- package/dist/types/lib/validation/types/SchemaFunction.d.ts +6 -0
- package/dist/types/lib/validation/types/SchemaLike.d.ts +6 -0
- package/dist/types/lib/validation/types/SchemaLikeWithoutArray.d.ts +7 -0
- package/dist/types/lib/validation/types/SchemaMap.d.ts +7 -0
- package/dist/types/lib/validation/types/StrictSchemaMap.d.ts +4 -0
- package/dist/types/lib/validation/types/Types.d.ts +4 -0
- package/dist/types/lib/validation/types/UnwrapSchemaLikeWithoutArray.d.ts +5 -0
- package/dist/types/lib/validation/types/ValidationErrorFunction.d.ts +7 -0
- package/dist/types/options/ApplicationOptions.d.ts +60 -0
- package/dist/types/options/LoadAnonymousObjectOptions.d.ts +33 -0
- package/dist/types/options/LoadNamedObjectOptions.d.ts +29 -0
- package/dist/types/options/LoadObjectOptions.d.ts +30 -0
- package/dist/types/options/ModuleLoadObjectsOptions.d.ts +44 -0
- package/dist/types/options/ModuleOptions.d.ts +74 -0
- package/dist/types/options/OverridableNamedObjectOptions.d.ts +26 -0
- package/dist/types/options/OverridableObjectOptions.d.ts +34 -0
- package/dist/types/types/ActionPattern.d.ts +6 -0
- package/dist/types/types/ApplicationExitReason.d.ts +13 -0
- package/dist/types/types/ClassDecorator.d.ts +6 -0
- package/dist/types/types/ComponentOptions.d.ts +20 -0
- package/dist/types/types/CronOptions.d.ts +25 -0
- package/dist/types/types/JSONSchema.d.ts +284 -0
- package/dist/types/types/MethodDecorator.d.ts +5 -0
- package/dist/types/types/ModuleOptions.d.ts +20 -0
- package/dist/types/types/ObjectOptions.d.ts +20 -0
- package/dist/types/types/PaginationMeta.d.ts +21 -0
- package/dist/types/types/ParameterDecorator.d.ts +5 -0
- package/dist/types/types/PropertyDecorator.d.ts +4 -0
- package/dist/types/types/ProviderOptions.d.ts +20 -0
- package/package.json +93 -95
- package/tsconfig.base.json +32 -0
- package/.eslintrc.json +0 -47
- package/.idea/codeStyles/Project.xml +0 -41
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/inspectionProfiles/Project_Default.xml +0 -10
- package/.idea/lakutata-core.iml +0 -13
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/LICENSE +0 -21
- package/assets/lakutata-banner.png +0 -0
- package/assets/lakutata_logo.jpg +0 -0
- package/build/Application.d.ts +0 -33
- package/build/Application.js +0 -89
- package/build/Application.js.map +0 -1
- package/build/ApplicationManagement.d.ts +0 -4
- package/build/ApplicationManagement.js +0 -46
- package/build/ApplicationManagement.js.map +0 -1
- package/build/Core.d.ts +0 -46
- package/build/Core.js +0 -80
- package/build/Core.js.map +0 -1
- package/build/base/BaseObject.d.ts +0 -14
- package/build/base/BaseObject.js +0 -114
- package/build/base/BaseObject.js.map +0 -1
- package/build/base/Container.d.ts +0 -43
- package/build/base/Container.js +0 -269
- package/build/base/Container.js.map +0 -1
- package/build/base/MetadataReader.d.ts +0 -6
- package/build/base/MetadataReader.js +0 -14
- package/build/base/MetadataReader.js.map +0 -1
- package/build/base/Plugin.d.ts +0 -4
- package/build/base/Plugin.js +0 -10
- package/build/base/Plugin.js.map +0 -1
- package/build/base/ValidatorClass.d.ts +0 -305
- package/build/base/ValidatorClass.js +0 -514
- package/build/base/ValidatorClass.js.map +0 -1
- package/build/base/abstracts/Component.d.ts +0 -4
- package/build/base/abstracts/Component.js +0 -8
- package/build/base/abstracts/Component.js.map +0 -1
- package/build/base/abstracts/Exception.d.ts +0 -11
- package/build/base/abstracts/Exception.js +0 -55
- package/build/base/abstracts/Exception.js.map +0 -1
- package/build/base/abstracts/Module.d.ts +0 -88
- package/build/base/abstracts/Module.js +0 -390
- package/build/base/abstracts/Module.js.map +0 -1
- package/build/base/abstracts/Workflow.d.ts +0 -9
- package/build/base/abstracts/Workflow.js +0 -17
- package/build/base/abstracts/Workflow.js.map +0 -1
- package/build/base/process/Process.d.ts +0 -6
- package/build/base/process/Process.js +0 -15
- package/build/base/process/Process.js.map +0 -1
- package/build/base/process/ProcessManager.d.ts +0 -10
- package/build/base/process/ProcessManager.js +0 -34
- package/build/base/process/ProcessManager.js.map +0 -1
- package/build/base/thread/Thread.d.ts +0 -6
- package/build/base/thread/Thread.js +0 -14
- package/build/base/thread/Thread.js.map +0 -1
- package/build/base/thread/ThreadManager.d.ts +0 -10
- package/build/base/thread/ThreadManager.js +0 -34
- package/build/base/thread/ThreadManager.js.map +0 -1
- package/build/constants/MetadataKeys.d.ts +0 -2
- package/build/constants/MetadataKeys.js +0 -6
- package/build/constants/MetadataKeys.js.map +0 -1
- package/build/decorators/DependencyInjection.d.ts +0 -3
- package/build/decorators/DependencyInjection.js +0 -18
- package/build/decorators/DependencyInjection.js.map +0 -1
- package/build/decorators/MethodValidation.d.ts +0 -9
- package/build/decorators/MethodValidation.js +0 -75
- package/build/decorators/MethodValidation.js.map +0 -1
- package/build/exceptions/ComponentNotFoundException.d.ts +0 -6
- package/build/exceptions/ComponentNotFoundException.js +0 -17
- package/build/exceptions/ComponentNotFoundException.js.map +0 -1
- package/build/exceptions/CryptoException.d.ts +0 -5
- package/build/exceptions/CryptoException.js +0 -12
- package/build/exceptions/CryptoException.js.map +0 -1
- package/build/exceptions/FatalException.d.ts +0 -5
- package/build/exceptions/FatalException.js +0 -12
- package/build/exceptions/FatalException.js.map +0 -1
- package/build/exceptions/HttpRequestException.d.ts +0 -6
- package/build/exceptions/HttpRequestException.js +0 -20
- package/build/exceptions/HttpRequestException.js.map +0 -1
- package/build/exceptions/InvalidMethodAcceptException.d.ts +0 -5
- package/build/exceptions/InvalidMethodAcceptException.js +0 -12
- package/build/exceptions/InvalidMethodAcceptException.js.map +0 -1
- package/build/exceptions/InvalidMethodReturnException.d.ts +0 -5
- package/build/exceptions/InvalidMethodReturnException.js +0 -12
- package/build/exceptions/InvalidMethodReturnException.js.map +0 -1
- package/build/exceptions/ModuleNotFoundException.d.ts +0 -6
- package/build/exceptions/ModuleNotFoundException.js +0 -17
- package/build/exceptions/ModuleNotFoundException.js.map +0 -1
- package/build/exceptions/ProcessException.d.ts +0 -5
- package/build/exceptions/ProcessException.js +0 -12
- package/build/exceptions/ProcessException.js.map +0 -1
- package/build/exceptions/ThreadException.d.ts +0 -5
- package/build/exceptions/ThreadException.js +0 -12
- package/build/exceptions/ThreadException.js.map +0 -1
- package/build/exceptions/TimeoutException.d.ts +0 -5
- package/build/exceptions/TimeoutException.js +0 -12
- package/build/exceptions/TimeoutException.js.map +0 -1
- package/build/exceptions/ValidationException.d.ts +0 -5
- package/build/exceptions/ValidationException.js +0 -12
- package/build/exceptions/ValidationException.js.map +0 -1
- package/build/interfaces/IApplicationConfig.d.ts +0 -20
- package/build/interfaces/IApplicationConfig.js +0 -3
- package/build/interfaces/IApplicationConfig.js.map +0 -1
- package/build/interfaces/IComponentsConfig.d.ts +0 -8
- package/build/interfaces/IComponentsConfig.js +0 -3
- package/build/interfaces/IComponentsConfig.js.map +0 -1
- package/build/interfaces/IConstructor.d.ts +0 -4
- package/build/interfaces/IConstructor.js +0 -3
- package/build/interfaces/IConstructor.js.map +0 -1
- package/build/interfaces/IModulesConfig.d.ts +0 -17
- package/build/interfaces/IModulesConfig.js +0 -3
- package/build/interfaces/IModulesConfig.js.map +0 -1
- package/build/interfaces/IProcessConstructor.d.ts +0 -5
- package/build/interfaces/IProcessConstructor.js +0 -3
- package/build/interfaces/IProcessConstructor.js.map +0 -1
- package/build/interfaces/IThreadConstructor.d.ts +0 -5
- package/build/interfaces/IThreadConstructor.js +0 -3
- package/build/interfaces/IThreadConstructor.js.map +0 -1
- package/build/interfaces/ShellJsInterfaces.d.ts +0 -162
- package/build/interfaces/ShellJsInterfaces.js +0 -3
- package/build/interfaces/ShellJsInterfaces.js.map +0 -1
- package/build/lib/minified/ShellJs.d.ts +0 -2
- package/build/lib/minified/ShellJs.js +0 -3699
- package/build/lib/minified/ShellJs.js.map +0 -1
- package/build/lib/multipleRunner/constants/Channel.d.ts +0 -5
- package/build/lib/multipleRunner/constants/Channel.js +0 -9
- package/build/lib/multipleRunner/constants/Channel.js.map +0 -1
- package/build/lib/multipleRunner/constants/MetadataKey.d.ts +0 -2
- package/build/lib/multipleRunner/constants/MetadataKey.js +0 -6
- package/build/lib/multipleRunner/constants/MetadataKey.js.map +0 -1
- package/build/lib/multipleRunner/containers/ContainerVolume.d.ts +0 -4
- package/build/lib/multipleRunner/containers/ContainerVolume.js +0 -85
- package/build/lib/multipleRunner/containers/ContainerVolume.js.map +0 -1
- package/build/lib/multipleRunner/definitions/interfaces/ClassConstructor.d.ts +0 -3
- package/build/lib/multipleRunner/definitions/interfaces/ClassConstructor.js +0 -3
- package/build/lib/multipleRunner/definitions/interfaces/ClassConstructor.js.map +0 -1
- package/build/lib/multipleRunner/definitions/interfaces/MultipleRunnerBaseClassConstructor.d.ts +0 -4
- package/build/lib/multipleRunner/definitions/interfaces/MultipleRunnerBaseClassConstructor.js +0 -3
- package/build/lib/multipleRunner/definitions/interfaces/MultipleRunnerBaseClassConstructor.js.map +0 -1
- package/build/lib/multipleRunner/definitions/interfaces/ProcessClassConstructor.d.ts +0 -7
- package/build/lib/multipleRunner/definitions/interfaces/ProcessClassConstructor.js +0 -3
- package/build/lib/multipleRunner/definitions/interfaces/ProcessClassConstructor.js.map +0 -1
- package/build/lib/multipleRunner/definitions/interfaces/ProxyClass.d.ts +0 -3
- package/build/lib/multipleRunner/definitions/interfaces/ProxyClass.js +0 -3
- package/build/lib/multipleRunner/definitions/interfaces/ProxyClass.js.map +0 -1
- package/build/lib/multipleRunner/definitions/interfaces/ThreadClassConstructor.d.ts +0 -7
- package/build/lib/multipleRunner/definitions/interfaces/ThreadClassConstructor.js +0 -3
- package/build/lib/multipleRunner/definitions/interfaces/ThreadClassConstructor.js.map +0 -1
- package/build/lib/multipleRunner/lib/Process.d.ts +0 -5
- package/build/lib/multipleRunner/lib/Process.js +0 -45
- package/build/lib/multipleRunner/lib/Process.js.map +0 -1
- package/build/lib/multipleRunner/lib/Thread.d.ts +0 -5
- package/build/lib/multipleRunner/lib/Thread.js +0 -52
- package/build/lib/multipleRunner/lib/Thread.js.map +0 -1
- package/build/lib/multipleRunner/lib/bridges/BaseBridge.d.ts +0 -32
- package/build/lib/multipleRunner/lib/bridges/BaseBridge.js +0 -107
- package/build/lib/multipleRunner/lib/bridges/BaseBridge.js.map +0 -1
- package/build/lib/multipleRunner/lib/bridges/ProcessBridge.d.ts +0 -5
- package/build/lib/multipleRunner/lib/bridges/ProcessBridge.js +0 -23
- package/build/lib/multipleRunner/lib/bridges/ProcessBridge.js.map +0 -1
- package/build/lib/multipleRunner/lib/bridges/ThreadBridge.d.ts +0 -5
- package/build/lib/multipleRunner/lib/bridges/ThreadBridge.js +0 -22
- package/build/lib/multipleRunner/lib/bridges/ThreadBridge.js.map +0 -1
- package/build/lib/multipleRunner/lib/cores/GenerateExecArgv.d.ts +0 -2
- package/build/lib/multipleRunner/lib/cores/GenerateExecArgv.js +0 -35
- package/build/lib/multipleRunner/lib/cores/GenerateExecArgv.js.map +0 -1
- package/build/lib/multipleRunner/lib/cores/IsElectron.d.ts +0 -1
- package/build/lib/multipleRunner/lib/cores/IsElectron.js +0 -8
- package/build/lib/multipleRunner/lib/cores/IsElectron.js.map +0 -1
- package/build/lib/multipleRunner/lib/cores/ProcessClass.d.ts +0 -5
- package/build/lib/multipleRunner/lib/cores/ProcessClass.js +0 -12
- package/build/lib/multipleRunner/lib/cores/ProcessClass.js.map +0 -1
- package/build/lib/multipleRunner/lib/cores/ThreadClass.d.ts +0 -5
- package/build/lib/multipleRunner/lib/cores/ThreadClass.js +0 -12
- package/build/lib/multipleRunner/lib/cores/ThreadClass.js.map +0 -1
- package/build/lib/multipleRunner/lib/cores/UniParentBridgeHandler.d.ts +0 -2
- package/build/lib/multipleRunner/lib/cores/UniParentBridgeHandler.js +0 -104
- package/build/lib/multipleRunner/lib/cores/UniParentBridgeHandler.js.map +0 -1
- package/build/lib/multipleRunner/lib/prototypes/MultipleRunnerBaseClass.d.ts +0 -17
- package/build/lib/multipleRunner/lib/prototypes/MultipleRunnerBaseClass.js +0 -57
- package/build/lib/multipleRunner/lib/prototypes/MultipleRunnerBaseClass.js.map +0 -1
- package/build/plugins/Crypto.d.ts +0 -18
- package/build/plugins/Crypto.js +0 -131
- package/build/plugins/Crypto.js.map +0 -1
- package/build/plugins/Formatter.d.ts +0 -19
- package/build/plugins/Formatter.js +0 -53
- package/build/plugins/Formatter.js.map +0 -1
- package/build/plugins/HttpRequest.d.ts +0 -45
- package/build/plugins/HttpRequest.js +0 -171
- package/build/plugins/HttpRequest.js.map +0 -1
- package/build/plugins/JSON.d.ts +0 -10
- package/build/plugins/JSON.js +0 -71
- package/build/plugins/JSON.js.map +0 -1
- package/build/plugins/Logger.d.ts +0 -25
- package/build/plugins/Logger.js +0 -112
- package/build/plugins/Logger.js.map +0 -1
- package/build/plugins/MessagePack.d.ts +0 -12
- package/build/plugins/MessagePack.js +0 -20
- package/build/plugins/MessagePack.js.map +0 -1
- package/build/plugins/Security.d.ts +0 -32
- package/build/plugins/Security.js +0 -153
- package/build/plugins/Security.js.map +0 -1
- package/build/plugins/Shell.d.ts +0 -39
- package/build/plugins/Shell.js +0 -58
- package/build/plugins/Shell.js.map +0 -1
- package/build/types/TPluginsConfig.d.ts +0 -7
- package/build/types/TPluginsConfig.js +0 -3
- package/build/types/TPluginsConfig.js.map +0 -1
- package/build/types/TProcessesConfig.d.ts +0 -3
- package/build/types/TProcessesConfig.js +0 -3
- package/build/types/TProcessesConfig.js.map +0 -1
- package/build/types/TThreadsConfig.d.ts +0 -3
- package/build/types/TThreadsConfig.js +0 -3
- package/build/types/TThreadsConfig.js.map +0 -1
- package/build/types/TWorkflowsConfig.d.ts +0 -4
- package/build/types/TWorkflowsConfig.js +0 -3
- package/build/types/TWorkflowsConfig.js.map +0 -1
- package/build/utils/Delay.d.ts +0 -1
- package/build/utils/Delay.js +0 -13
- package/build/utils/Delay.js.map +0 -1
- package/build/utils/Timeout.d.ts +0 -2
- package/build/utils/Timeout.js +0 -27
- package/build/utils/Timeout.js.map +0 -1
- package/build/utils/ValidDataUrl.d.ts +0 -1
- package/build/utils/ValidDataUrl.js +0 -8
- package/build/utils/ValidDataUrl.js.map +0 -1
- package/build/utils/Validator.d.ts +0 -2
- package/build/utils/Validator.js +0 -6
- package/build/utils/Validator.js.map +0 -1
- package/docs/component.md +0 -1
- package/docs/exception.md +0 -1
- package/docs/faq.md +0 -1
- package/docs/introduction.md +0 -1
- package/docs/module.md +0 -1
- package/docs/plugin.md +0 -1
- package/docs/process.md +0 -1
- package/docs/thread.md +0 -1
- package/docs/utilities.md +0 -1
- package/docs/workflow.md +0 -1
- package/src/Application.ts +0 -178
- package/src/ApplicationManagement.ts +0 -48
- package/src/Core.ts +0 -83
- package/src/base/BaseObject.ts +0 -146
- package/src/base/Container.ts +0 -375
- package/src/base/MetadataReader.ts +0 -12
- package/src/base/Plugin.ts +0 -11
- package/src/base/ValidatorClass.ts +0 -707
- package/src/base/abstracts/Component.ts +0 -5
- package/src/base/abstracts/Exception.ts +0 -64
- package/src/base/abstracts/Module.ts +0 -528
- package/src/base/abstracts/Workflow.ts +0 -35
- package/src/base/process/Process.ts +0 -23
- package/src/base/process/ProcessManager.ts +0 -54
- package/src/base/thread/Thread.ts +0 -23
- package/src/base/thread/ThreadManager.ts +0 -54
- package/src/constants/MetadataKeys.ts +0 -2
- package/src/decorators/DependencyInjection.ts +0 -17
- package/src/decorators/MethodValidation.ts +0 -80
- package/src/exceptions/ComponentNotFoundException.ts +0 -12
- package/src/exceptions/CryptoException.ts +0 -6
- package/src/exceptions/FatalException.ts +0 -6
- package/src/exceptions/HttpRequestException.ts +0 -15
- package/src/exceptions/InvalidMethodAcceptException.ts +0 -6
- package/src/exceptions/InvalidMethodReturnException.ts +0 -6
- package/src/exceptions/ModuleNotFoundException.ts +0 -12
- package/src/exceptions/ProcessException.ts +0 -6
- package/src/exceptions/ThreadException.ts +0 -6
- package/src/exceptions/TimeoutException.ts +0 -6
- package/src/exceptions/ValidationException.ts +0 -6
- package/src/interfaces/IApplicationConfig.ts +0 -21
- package/src/interfaces/IComponentsConfig.ts +0 -9
- package/src/interfaces/IConstructor.ts +0 -5
- package/src/interfaces/IModulesConfig.ts +0 -18
- package/src/interfaces/IProcessConstructor.ts +0 -6
- package/src/interfaces/IThreadConstructor.ts +0 -6
- package/src/interfaces/ShellJsInterfaces.ts +0 -858
- package/src/lib/minified/ShellJs.js +0 -1
- package/src/lib/multipleRunner/constants/Channel.ts +0 -5
- package/src/lib/multipleRunner/constants/MetadataKey.ts +0 -2
- package/src/lib/multipleRunner/containers/ContainerVolume.ts +0 -83
- package/src/lib/multipleRunner/definitions/interfaces/ClassConstructor.ts +0 -3
- package/src/lib/multipleRunner/definitions/interfaces/MultipleRunnerBaseClassConstructor.ts +0 -5
- package/src/lib/multipleRunner/definitions/interfaces/ProcessClassConstructor.ts +0 -10
- package/src/lib/multipleRunner/definitions/interfaces/ProxyClass.ts +0 -3
- package/src/lib/multipleRunner/definitions/interfaces/ThreadClassConstructor.ts +0 -10
- package/src/lib/multipleRunner/lib/Process.ts +0 -45
- package/src/lib/multipleRunner/lib/Thread.ts +0 -52
- package/src/lib/multipleRunner/lib/bridges/BaseBridge.ts +0 -118
- package/src/lib/multipleRunner/lib/bridges/ProcessBridge.ts +0 -22
- package/src/lib/multipleRunner/lib/bridges/ThreadBridge.ts +0 -20
- package/src/lib/multipleRunner/lib/cores/GenerateExecArgv.ts +0 -28
- package/src/lib/multipleRunner/lib/cores/IsElectron.ts +0 -3
- package/src/lib/multipleRunner/lib/cores/ProcessClass.ts +0 -8
- package/src/lib/multipleRunner/lib/cores/ThreadClass.ts +0 -8
- package/src/lib/multipleRunner/lib/cores/UniParentBridgeHandler.ts +0 -97
- package/src/lib/multipleRunner/lib/prototypes/MultipleRunnerBaseClass.ts +0 -70
- package/src/plugins/Crypto.ts +0 -140
- package/src/plugins/Formatter.ts +0 -83
- package/src/plugins/HttpRequest.ts +0 -241
- package/src/plugins/JSON.ts +0 -77
- package/src/plugins/Logger.ts +0 -154
- package/src/plugins/MessagePack.ts +0 -30
- package/src/plugins/Security.ts +0 -273
- package/src/plugins/Shell.ts +0 -371
- package/src/tests/Main.spec.ts +0 -175
- package/src/tests/components/TestComponent1.ts +0 -11
- package/src/tests/exceptions/TestException.ts +0 -6
- package/src/tests/modules/Test1.ts +0 -88
- package/src/tests/modules/Test2.ts +0 -65
- package/src/tests/modules/Test3.ts +0 -54
- package/src/tests/modules/Test4.ts +0 -28
- package/src/tests/plugins/TestPlugin1.ts +0 -22
- package/src/tests/processes/TestProcess.ts +0 -11
- package/src/tests/threads/TestThread.ts +0 -13
- package/src/tests/workflows/TestWorkflow.ts +0 -7
- package/src/types/TPluginsConfig.ts +0 -5
- package/src/types/TProcessesConfig.ts +0 -4
- package/src/types/TThreadsConfig.ts +0 -4
- package/src/types/TWorkflowsConfig.ts +0 -6
- package/src/utils/Delay.ts +0 -14
- package/src/utils/Timeout.ts +0 -27
- package/src/utils/ValidDataUrl.ts +0 -8
- package/src/utils/Validator.ts +0 -3
- package/tsconfig.json +0 -35
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import { __destroy, __init } from '../base/BaseObject.js';
|
|
2
|
+
import { type event, type ListenerFn, type EventAndListener } from '../base/EventEmitter.js';
|
|
3
|
+
import { Provider } from './Provider.js';
|
|
4
|
+
import { Container } from './Container.js';
|
|
5
|
+
/**
|
|
6
|
+
* The base class of the components: the long-lived objects shared by the whole application (a logger, a database
|
|
7
|
+
* connection, a cache, an entrypoint). Its lifetime is `@Singleton`, locked: one instance per container registering
|
|
8
|
+
* it, and a subclass declaring another lifetime throws a {@link LifetimeLockedException}.
|
|
9
|
+
*
|
|
10
|
+
* Declare it in the `components` of the application or module options, under a name, with its options; it is created
|
|
11
|
+
* on first request (`@Inject`, `getObject()`), or at launch when its name is listed in `bootstrap`. A component is an
|
|
12
|
+
* event emitter: its events support namespaces (`'order.paid'`) and wildcards (`'order.*'`), and its listeners added
|
|
13
|
+
* by `on()`, `once()`, `many()` and their prepended forms run asynchronously after the emitting. Its listeners are
|
|
14
|
+
* removed at its teardown.
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* import {Application, Component, Module} from 'lakutata'
|
|
18
|
+
*
|
|
19
|
+
* export class Orders extends Component {
|
|
20
|
+
* public async pay(id: number): Promise<void> {
|
|
21
|
+
* //...
|
|
22
|
+
* this.emit('order.paid', id)
|
|
23
|
+
* }
|
|
24
|
+
* }
|
|
25
|
+
*
|
|
26
|
+
* Application.run({
|
|
27
|
+
* id: 'shop.app',
|
|
28
|
+
* name: 'Shop',
|
|
29
|
+
* components: {
|
|
30
|
+
* orders: {class: Orders}
|
|
31
|
+
* },
|
|
32
|
+
* bootstrap: [
|
|
33
|
+
* async (app: Module): Promise<void> => {
|
|
34
|
+
* const orders: Orders = await app.getObject<Orders>('orders')
|
|
35
|
+
* orders.on('order.*', (id: number): void => console.log(`Order ${id} changed`))
|
|
36
|
+
* }
|
|
37
|
+
* ]
|
|
38
|
+
* })
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare class Component extends Provider {
|
|
42
|
+
#private;
|
|
43
|
+
/**
|
|
44
|
+
* The number of listeners of one event above which a possible memory leak is warned of (0: no warning); the
|
|
45
|
+
* listeners are never limited. A subclass gives its own default by an initializer
|
|
46
|
+
* (`protected readonly maxListeners: number = 0`).
|
|
47
|
+
* @default 11
|
|
48
|
+
* @protected
|
|
49
|
+
*/
|
|
50
|
+
protected readonly maxListeners: number;
|
|
51
|
+
/**
|
|
52
|
+
* The framework's initializer, see {@link BaseObject}; override `init()` instead.
|
|
53
|
+
* @param hooks The steps the framework's subclasses run before `init()`.
|
|
54
|
+
* @returns Resolves once the component is ready.
|
|
55
|
+
* @protected
|
|
56
|
+
*/
|
|
57
|
+
protected [__init](...hooks: (() => Promise<void>)[]): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* The framework's destroyer, see {@link BaseObject}: it also removes all the listeners; override `beforeDestroy()`
|
|
60
|
+
* and `destroy()` instead.
|
|
61
|
+
* @param hooks The steps the framework's subclasses run before `destroy()`.
|
|
62
|
+
* @returns Resolves once the component is destroyed.
|
|
63
|
+
* @protected
|
|
64
|
+
*/
|
|
65
|
+
protected [__destroy](...hooks: (() => Promise<void>)[]): Promise<void>;
|
|
66
|
+
/**
|
|
67
|
+
* The component's own container: the objects it registers or creates there are destroyed with it.
|
|
68
|
+
* @protected
|
|
69
|
+
*/
|
|
70
|
+
protected get container(): Container;
|
|
71
|
+
/**
|
|
72
|
+
* Create a scope from the component's container (see {@link Container.createScope}), such as one per request:
|
|
73
|
+
* the scoped objects got from it are its own instances. Destroy it once done; it is destroyed with the component
|
|
74
|
+
* otherwise.
|
|
75
|
+
* @returns The new scope.
|
|
76
|
+
* @throws {ObjectDestroyedException} When the component's container has been destroyed.
|
|
77
|
+
* @protected
|
|
78
|
+
*/
|
|
79
|
+
protected createScope(): Container;
|
|
80
|
+
/**
|
|
81
|
+
* Emit an event: the listeners added by `addListener()` and `onAny()` are called now, in order; the ones added by
|
|
82
|
+
* `on()`, `once()`, `many()` and their prepended forms are scheduled (an error they throw is an unhandled
|
|
83
|
+
* rejection). Use `emitRequest()` to wait for the listeners and their results.
|
|
84
|
+
* @param event The event: a name (`'order.paid'`, the parts separated by dots, with the wildcards `*` for one part
|
|
85
|
+
* and `**` for any parts) or the parts as an array (`['order', 'paid']`). A symbol is an event of
|
|
86
|
+
* its own (matched by the wildcard `*` as a name of one part).
|
|
87
|
+
* @param values The values passed to the listeners.
|
|
88
|
+
* @returns true when the event has listeners.
|
|
89
|
+
* @throws {Error} The error emitted as an `'error'` event which has no listener.
|
|
90
|
+
*/
|
|
91
|
+
emit(event: string | symbol | event[], ...values: any[]): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Emit an event and wait for its listeners (the asynchronous ones included).
|
|
94
|
+
* @param event The event: a name (`'order.paid'`, the parts separated by dots, with the wildcards `*` for one part
|
|
95
|
+
* and `**` for any parts) or the parts as an array (`['order', 'paid']`). A symbol is an event of
|
|
96
|
+
* its own (matched by the wildcard `*` as a name of one part).
|
|
97
|
+
* @param values The values passed to the listeners.
|
|
98
|
+
* @returns The results of the listeners, in their order (an empty array without listener).
|
|
99
|
+
* @throws {Error} The first error thrown by a listener, or the error emitted as an `'error'` event which has no
|
|
100
|
+
* listener.
|
|
101
|
+
*/
|
|
102
|
+
emitRequest(event: string | symbol | event[], ...values: any[]): Promise<any[]>;
|
|
103
|
+
/**
|
|
104
|
+
* Add a listener called synchronously, at the emitting, after the event's other listeners. Unlike `on()`, its
|
|
105
|
+
* listener runs before `emit()` returns.
|
|
106
|
+
* @param event The event: a name (`'order.paid'`, the parts separated by dots, with the wildcards `*` for one part
|
|
107
|
+
* and `**` for any parts) or the parts as an array (`['order', 'paid']`). A symbol is an event of
|
|
108
|
+
* its own (matched by the wildcard `*` as a name of one part).
|
|
109
|
+
* @param listener The function called with the event's values.
|
|
110
|
+
* @returns The component, for chaining.
|
|
111
|
+
*/
|
|
112
|
+
addListener(event: string | symbol | event[], listener: ListenerFn): this;
|
|
113
|
+
/**
|
|
114
|
+
* Add a listener, after the event's other listeners.
|
|
115
|
+
* @param event The event: a name (`'order.paid'`, the parts separated by dots, with the wildcards `*` for one part
|
|
116
|
+
* and `**` for any parts) or the parts as an array (`['order', 'paid']`). A symbol is an event of
|
|
117
|
+
* its own (matched by the wildcard `*` as a name of one part).
|
|
118
|
+
* @param listener The function called with the event's values, asynchronously after the emitting (in a later turn of
|
|
119
|
+
* the event loop); its result (or the promise it returns) is collected by `emitRequest()`.
|
|
120
|
+
* @returns The component, for chaining.
|
|
121
|
+
*/
|
|
122
|
+
on(event: string | symbol | event[], listener: ListenerFn): this;
|
|
123
|
+
/**
|
|
124
|
+
* Add a listener before the event's other listeners.
|
|
125
|
+
* @param event The event: a name (`'order.paid'`, the parts separated by dots, with the wildcards `*` for one part
|
|
126
|
+
* and `**` for any parts) or the parts as an array (`['order', 'paid']`). A symbol is an event of
|
|
127
|
+
* its own (matched by the wildcard `*` as a name of one part).
|
|
128
|
+
* @param listener The function called with the event's values, asynchronously after the emitting (in a later turn of
|
|
129
|
+
* the event loop); its result (or the promise it returns) is collected by `emitRequest()`.
|
|
130
|
+
* @returns The component, for chaining.
|
|
131
|
+
*/
|
|
132
|
+
prependListener(event: string | symbol | event[], listener: ListenerFn): this;
|
|
133
|
+
/**
|
|
134
|
+
* Add a listener called for the event's next emitting only, then removed.
|
|
135
|
+
* @param event The event: a name (`'order.paid'`, the parts separated by dots, with the wildcards `*` for one part
|
|
136
|
+
* and `**` for any parts) or the parts as an array (`['order', 'paid']`). A symbol is an event of
|
|
137
|
+
* its own (matched by the wildcard `*` as a name of one part).
|
|
138
|
+
* @param listener The function called with the event's values, asynchronously after the emitting (in a later turn of
|
|
139
|
+
* the event loop); its result (or the promise it returns) is collected by `emitRequest()`.
|
|
140
|
+
* @returns The component, for chaining.
|
|
141
|
+
*/
|
|
142
|
+
once(event: string | symbol | event[], listener: ListenerFn): this;
|
|
143
|
+
/**
|
|
144
|
+
* Add a listener called for the event's next emitting only, then removed; it is placed before the event's other
|
|
145
|
+
* listeners.
|
|
146
|
+
* @param event The event: a name (`'order.paid'`, the parts separated by dots, with the wildcards `*` for one part
|
|
147
|
+
* and `**` for any parts) or the parts as an array (`['order', 'paid']`). A symbol is an event of
|
|
148
|
+
* its own (matched by the wildcard `*` as a name of one part).
|
|
149
|
+
* @param listener The function called with the event's values, asynchronously after the emitting (in a later turn of
|
|
150
|
+
* the event loop); its result (or the promise it returns) is collected by `emitRequest()`.
|
|
151
|
+
* @returns The component, for chaining.
|
|
152
|
+
*/
|
|
153
|
+
prependOnceListener(event: string | symbol | event[], listener: ListenerFn): this;
|
|
154
|
+
/**
|
|
155
|
+
* Add a listener called for the event's next emittings, then removed.
|
|
156
|
+
* @param event The event: a name (`'order.paid'`, the parts separated by dots, with the wildcards `*` for one part
|
|
157
|
+
* and `**` for any parts) or the parts as an array (`['order', 'paid']`). A symbol is an event of
|
|
158
|
+
* its own (matched by the wildcard `*` as a name of one part).
|
|
159
|
+
* @param timesToListen The number of emittings the listener is called for.
|
|
160
|
+
* @param listener The function called with the event's values, asynchronously after the emitting (in a later turn of
|
|
161
|
+
* the event loop); its result (or the promise it returns) is collected by `emitRequest()`.
|
|
162
|
+
* @returns The component, for chaining.
|
|
163
|
+
*/
|
|
164
|
+
many(event: string | symbol | event[], timesToListen: number, listener: ListenerFn): this;
|
|
165
|
+
/**
|
|
166
|
+
* Add a listener called for the event's next emittings, then removed; it is placed before the event's other
|
|
167
|
+
* listeners.
|
|
168
|
+
* @param event The event: a name (`'order.paid'`, the parts separated by dots, with the wildcards `*` for one part
|
|
169
|
+
* and `**` for any parts) or the parts as an array (`['order', 'paid']`). A symbol is an event of
|
|
170
|
+
* its own (matched by the wildcard `*` as a name of one part).
|
|
171
|
+
* @param timesToListen The number of emittings the listener is called for.
|
|
172
|
+
* @param listener The function called with the event's values, asynchronously after the emitting (in a later turn of
|
|
173
|
+
* the event loop); its result (or the promise it returns) is collected by `emitRequest()`.
|
|
174
|
+
* @returns The component, for chaining.
|
|
175
|
+
*/
|
|
176
|
+
prependMany(event: string | symbol | event[], timesToListen: number, listener: ListenerFn): this;
|
|
177
|
+
/**
|
|
178
|
+
* Add a listener of every event, called synchronously at the emitting, before the event's own listeners.
|
|
179
|
+
* @param listener The function called with the event name, then the event's values.
|
|
180
|
+
* @returns The component, for chaining.
|
|
181
|
+
*/
|
|
182
|
+
onAny(listener: EventAndListener): this;
|
|
183
|
+
/**
|
|
184
|
+
* Add a listener of every event, before the other listeners of every event, called synchronously at the emitting.
|
|
185
|
+
* @param listener The function called with the event name, then the event's values.
|
|
186
|
+
* @returns The component, for chaining.
|
|
187
|
+
*/
|
|
188
|
+
prependAny(listener: EventAndListener): this;
|
|
189
|
+
/**
|
|
190
|
+
* Remove a listener of every event added by `onAny()` or `prependAny()`.
|
|
191
|
+
* @param listener The listener to remove.
|
|
192
|
+
* @returns The component, for chaining.
|
|
193
|
+
*/
|
|
194
|
+
offAny(listener: ListenerFn): this;
|
|
195
|
+
/**
|
|
196
|
+
* Remove a listener of an event, as `off()`.
|
|
197
|
+
* @param event The event the listener was added for.
|
|
198
|
+
* @param listener The listener to remove.
|
|
199
|
+
* @returns The component, for chaining.
|
|
200
|
+
*/
|
|
201
|
+
removeListener(event: string | symbol | event[], listener: ListenerFn): this;
|
|
202
|
+
/**
|
|
203
|
+
* Remove a listener of an event; nothing happens when it was not added.
|
|
204
|
+
* @param event The event the listener was added for.
|
|
205
|
+
* @param listener The listener to remove.
|
|
206
|
+
* @returns The component, for chaining.
|
|
207
|
+
*/
|
|
208
|
+
off(event: string | symbol | event[], listener: ListenerFn): this;
|
|
209
|
+
/**
|
|
210
|
+
* Remove the listeners of an event, or all the listeners.
|
|
211
|
+
* @param event The event whose listeners are removed; all the listeners when omitted.
|
|
212
|
+
* @returns The component, for chaining.
|
|
213
|
+
*/
|
|
214
|
+
removeAllListeners(event?: string | symbol | event[] | undefined): this;
|
|
215
|
+
/**
|
|
216
|
+
* Set the number of listeners of one event above which a possible memory leak is warned of (the
|
|
217
|
+
* `maxListeners` option, 11 by default); the listeners are never limited.
|
|
218
|
+
* @param n The number, 0 for no warning.
|
|
219
|
+
*/
|
|
220
|
+
setMaxListeners(n: number): void;
|
|
221
|
+
/**
|
|
222
|
+
* The number of listeners of one event above which a possible memory leak is warned of.
|
|
223
|
+
* @returns The number, 0 for no warning.
|
|
224
|
+
*/
|
|
225
|
+
getMaxListeners(): number;
|
|
226
|
+
/**
|
|
227
|
+
* The events having listeners, in no guaranteed order.
|
|
228
|
+
* @param nsAsArray Return each namespaced event as the array of its parts (`['order', 'paid']`) instead of its
|
|
229
|
+
* name (`'order.paid'`); false by default.
|
|
230
|
+
* @returns The events.
|
|
231
|
+
*/
|
|
232
|
+
eventNames(nsAsArray?: boolean | undefined): (string | symbol | event[])[];
|
|
233
|
+
/**
|
|
234
|
+
* The number of listeners of an event (the wildcard listeners matching it included), or of every event (the
|
|
235
|
+
* listeners of `onAny()` excluded).
|
|
236
|
+
* @param event The event name or its parts as an array; every event when omitted.
|
|
237
|
+
* @returns The number of listeners.
|
|
238
|
+
*/
|
|
239
|
+
listenerCount(event?: string | symbol | event[] | undefined): number;
|
|
240
|
+
/**
|
|
241
|
+
* The listeners of an event, or of every event.
|
|
242
|
+
* @param event The event name (the wildcard listeners matching it included), its parts as an array, or a symbol;
|
|
243
|
+
* every event when omitted (the listeners of `onAny()` excluded).
|
|
244
|
+
* @returns A copy of the listeners; changing it does not change the listeners.
|
|
245
|
+
*/
|
|
246
|
+
listeners(event?: string | symbol | event[] | undefined): ListenerFn[];
|
|
247
|
+
/**
|
|
248
|
+
* The listeners of every event, added by `onAny()` and `prependAny()`.
|
|
249
|
+
* @returns A copy of these listeners; changing it does not change the listeners.
|
|
250
|
+
*/
|
|
251
|
+
listenersAny(): ListenerFn[];
|
|
252
|
+
/**
|
|
253
|
+
* Whether an event has listeners (the wildcard listeners matching it included; the listeners of `onAny()`
|
|
254
|
+
* excluded).
|
|
255
|
+
* @param event The event name, its parts as an array, or a symbol; any event when omitted.
|
|
256
|
+
* @returns true when there are listeners.
|
|
257
|
+
*/
|
|
258
|
+
hasListeners(event?: string | symbol | event[] | undefined): boolean;
|
|
259
|
+
/**
|
|
260
|
+
* Destroy the component and initialize it again (same instance): its dependencies are injected again and its
|
|
261
|
+
* `init()` runs again; its listeners are removed by the teardown. Its configured values are kept.
|
|
262
|
+
* @returns Resolves once the component is ready again.
|
|
263
|
+
* @throws {ObjectDestroyedException} When its parent has been destroyed.
|
|
264
|
+
* @throws {Error} The error of its teardown or of its initialization.
|
|
265
|
+
*/
|
|
266
|
+
reload(): Promise<void>;
|
|
267
|
+
}
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Component = void 0;
|
|
13
|
+
const BaseObject_js_1 = require("../base/BaseObject.js");
|
|
14
|
+
const Lifetime_js_1 = require("../../decorators/di/Lifetime.js");
|
|
15
|
+
const EventEmitter_js_1 = require("../base/EventEmitter.js");
|
|
16
|
+
const Provider_js_1 = require("./Provider.js");
|
|
17
|
+
const ObjectType_js_1 = require("../base/internal/ObjectType.js");
|
|
18
|
+
const ObjectContainer_js_1 = require("../base/internal/ObjectContainer.js");
|
|
19
|
+
const Configurable_js_1 = require("../../decorators/di/Configurable.js");
|
|
20
|
+
const DTO_js_1 = require("../dto/DTO.js");
|
|
21
|
+
/**
|
|
22
|
+
* The base class of the components: the long-lived objects shared by the whole application (a logger, a database
|
|
23
|
+
* connection, a cache, an entrypoint). Its lifetime is `@Singleton`, locked: one instance per container registering
|
|
24
|
+
* it, and a subclass declaring another lifetime throws a {@link LifetimeLockedException}.
|
|
25
|
+
*
|
|
26
|
+
* Declare it in the `components` of the application or module options, under a name, with its options; it is created
|
|
27
|
+
* on first request (`@Inject`, `getObject()`), or at launch when its name is listed in `bootstrap`. A component is an
|
|
28
|
+
* event emitter: its events support namespaces (`'order.paid'`) and wildcards (`'order.*'`), and its listeners added
|
|
29
|
+
* by `on()`, `once()`, `many()` and their prepended forms run asynchronously after the emitting. Its listeners are
|
|
30
|
+
* removed at its teardown.
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* import {Application, Component, Module} from 'lakutata'
|
|
34
|
+
*
|
|
35
|
+
* export class Orders extends Component {
|
|
36
|
+
* public async pay(id: number): Promise<void> {
|
|
37
|
+
* //...
|
|
38
|
+
* this.emit('order.paid', id)
|
|
39
|
+
* }
|
|
40
|
+
* }
|
|
41
|
+
*
|
|
42
|
+
* Application.run({
|
|
43
|
+
* id: 'shop.app',
|
|
44
|
+
* name: 'Shop',
|
|
45
|
+
* components: {
|
|
46
|
+
* orders: {class: Orders}
|
|
47
|
+
* },
|
|
48
|
+
* bootstrap: [
|
|
49
|
+
* async (app: Module): Promise<void> => {
|
|
50
|
+
* const orders: Orders = await app.getObject<Orders>('orders')
|
|
51
|
+
* orders.on('order.*', (id: number): void => console.log(`Order ${id} changed`))
|
|
52
|
+
* }
|
|
53
|
+
* ]
|
|
54
|
+
* })
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
let Component = class Component extends Provider_js_1.Provider {
|
|
58
|
+
/**
|
|
59
|
+
* Internal event emitter
|
|
60
|
+
* @private
|
|
61
|
+
*/
|
|
62
|
+
#eventEmitter = new EventEmitter_js_1.EventEmitter();
|
|
63
|
+
/**
|
|
64
|
+
* The framework's initializer, see {@link BaseObject}; override `init()` instead.
|
|
65
|
+
* @param hooks The steps the framework's subclasses run before `init()`.
|
|
66
|
+
* @returns Resolves once the component is ready.
|
|
67
|
+
* @protected
|
|
68
|
+
*/
|
|
69
|
+
async [BaseObject_js_1.__init](...hooks) {
|
|
70
|
+
await super[BaseObject_js_1.__init](...hooks);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The framework's destroyer, see {@link BaseObject}: it also removes all the listeners; override `beforeDestroy()`
|
|
74
|
+
* and `destroy()` instead.
|
|
75
|
+
* @param hooks The steps the framework's subclasses run before `destroy()`.
|
|
76
|
+
* @returns Resolves once the component is destroyed.
|
|
77
|
+
* @protected
|
|
78
|
+
*/
|
|
79
|
+
async [BaseObject_js_1.__destroy](...hooks) {
|
|
80
|
+
await super[BaseObject_js_1.__destroy](async () => {
|
|
81
|
+
this.#eventEmitter.removeAllListeners();
|
|
82
|
+
}, ...hooks);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* The component's own container: the objects it registers or creates there are destroyed with it.
|
|
86
|
+
* @protected
|
|
87
|
+
*/
|
|
88
|
+
get container() {
|
|
89
|
+
return (0, ObjectContainer_js_1.getObjectContainer)(this);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Create a scope from the component's container (see {@link Container.createScope}), such as one per request:
|
|
93
|
+
* the scoped objects got from it are its own instances. Destroy it once done; it is destroyed with the component
|
|
94
|
+
* otherwise.
|
|
95
|
+
* @returns The new scope.
|
|
96
|
+
* @throws {ObjectDestroyedException} When the component's container has been destroyed.
|
|
97
|
+
* @protected
|
|
98
|
+
*/
|
|
99
|
+
createScope() {
|
|
100
|
+
return (0, ObjectContainer_js_1.getObjectContainer)(this).createScope();
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Emit an event: the listeners added by `addListener()` and `onAny()` are called now, in order; the ones added by
|
|
104
|
+
* `on()`, `once()`, `many()` and their prepended forms are scheduled (an error they throw is an unhandled
|
|
105
|
+
* rejection). Use `emitRequest()` to wait for the listeners and their results.
|
|
106
|
+
* @param event The event: a name (`'order.paid'`, the parts separated by dots, with the wildcards `*` for one part
|
|
107
|
+
* and `**` for any parts) or the parts as an array (`['order', 'paid']`). A symbol is an event of
|
|
108
|
+
* its own (matched by the wildcard `*` as a name of one part).
|
|
109
|
+
* @param values The values passed to the listeners.
|
|
110
|
+
* @returns true when the event has listeners.
|
|
111
|
+
* @throws {Error} The error emitted as an `'error'` event which has no listener.
|
|
112
|
+
*/
|
|
113
|
+
emit(event, ...values) {
|
|
114
|
+
return this.#eventEmitter.emit(event, ...values);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Emit an event and wait for its listeners (the asynchronous ones included).
|
|
118
|
+
* @param event The event: a name (`'order.paid'`, the parts separated by dots, with the wildcards `*` for one part
|
|
119
|
+
* and `**` for any parts) or the parts as an array (`['order', 'paid']`). A symbol is an event of
|
|
120
|
+
* its own (matched by the wildcard `*` as a name of one part).
|
|
121
|
+
* @param values The values passed to the listeners.
|
|
122
|
+
* @returns The results of the listeners, in their order (an empty array without listener).
|
|
123
|
+
* @throws {Error} The first error thrown by a listener, or the error emitted as an `'error'` event which has no
|
|
124
|
+
* listener.
|
|
125
|
+
*/
|
|
126
|
+
async emitRequest(event, ...values) {
|
|
127
|
+
return this.#eventEmitter.emitRequest(event, ...values);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Add a listener called synchronously, at the emitting, after the event's other listeners. Unlike `on()`, its
|
|
131
|
+
* listener runs before `emit()` returns.
|
|
132
|
+
* @param event The event: a name (`'order.paid'`, the parts separated by dots, with the wildcards `*` for one part
|
|
133
|
+
* and `**` for any parts) or the parts as an array (`['order', 'paid']`). A symbol is an event of
|
|
134
|
+
* its own (matched by the wildcard `*` as a name of one part).
|
|
135
|
+
* @param listener The function called with the event's values.
|
|
136
|
+
* @returns The component, for chaining.
|
|
137
|
+
*/
|
|
138
|
+
addListener(event, listener) {
|
|
139
|
+
this.#eventEmitter.addListener(event, listener);
|
|
140
|
+
return this;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Add a listener, after the event's other listeners.
|
|
144
|
+
* @param event The event: a name (`'order.paid'`, the parts separated by dots, with the wildcards `*` for one part
|
|
145
|
+
* and `**` for any parts) or the parts as an array (`['order', 'paid']`). A symbol is an event of
|
|
146
|
+
* its own (matched by the wildcard `*` as a name of one part).
|
|
147
|
+
* @param listener The function called with the event's values, asynchronously after the emitting (in a later turn of
|
|
148
|
+
* the event loop); its result (or the promise it returns) is collected by `emitRequest()`.
|
|
149
|
+
* @returns The component, for chaining.
|
|
150
|
+
*/
|
|
151
|
+
on(event, listener) {
|
|
152
|
+
this.#eventEmitter.on(event, listener);
|
|
153
|
+
return this;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Add a listener before the event's other listeners.
|
|
157
|
+
* @param event The event: a name (`'order.paid'`, the parts separated by dots, with the wildcards `*` for one part
|
|
158
|
+
* and `**` for any parts) or the parts as an array (`['order', 'paid']`). A symbol is an event of
|
|
159
|
+
* its own (matched by the wildcard `*` as a name of one part).
|
|
160
|
+
* @param listener The function called with the event's values, asynchronously after the emitting (in a later turn of
|
|
161
|
+
* the event loop); its result (or the promise it returns) is collected by `emitRequest()`.
|
|
162
|
+
* @returns The component, for chaining.
|
|
163
|
+
*/
|
|
164
|
+
prependListener(event, listener) {
|
|
165
|
+
this.#eventEmitter.prependListener(event, listener);
|
|
166
|
+
return this;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Add a listener called for the event's next emitting only, then removed.
|
|
170
|
+
* @param event The event: a name (`'order.paid'`, the parts separated by dots, with the wildcards `*` for one part
|
|
171
|
+
* and `**` for any parts) or the parts as an array (`['order', 'paid']`). A symbol is an event of
|
|
172
|
+
* its own (matched by the wildcard `*` as a name of one part).
|
|
173
|
+
* @param listener The function called with the event's values, asynchronously after the emitting (in a later turn of
|
|
174
|
+
* the event loop); its result (or the promise it returns) is collected by `emitRequest()`.
|
|
175
|
+
* @returns The component, for chaining.
|
|
176
|
+
*/
|
|
177
|
+
once(event, listener) {
|
|
178
|
+
this.#eventEmitter.once(event, listener);
|
|
179
|
+
return this;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Add a listener called for the event's next emitting only, then removed; it is placed before the event's other
|
|
183
|
+
* listeners.
|
|
184
|
+
* @param event The event: a name (`'order.paid'`, the parts separated by dots, with the wildcards `*` for one part
|
|
185
|
+
* and `**` for any parts) or the parts as an array (`['order', 'paid']`). A symbol is an event of
|
|
186
|
+
* its own (matched by the wildcard `*` as a name of one part).
|
|
187
|
+
* @param listener The function called with the event's values, asynchronously after the emitting (in a later turn of
|
|
188
|
+
* the event loop); its result (or the promise it returns) is collected by `emitRequest()`.
|
|
189
|
+
* @returns The component, for chaining.
|
|
190
|
+
*/
|
|
191
|
+
prependOnceListener(event, listener) {
|
|
192
|
+
this.#eventEmitter.prependOnceListener(event, listener);
|
|
193
|
+
return this;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Add a listener called for the event's next emittings, then removed.
|
|
197
|
+
* @param event The event: a name (`'order.paid'`, the parts separated by dots, with the wildcards `*` for one part
|
|
198
|
+
* and `**` for any parts) or the parts as an array (`['order', 'paid']`). A symbol is an event of
|
|
199
|
+
* its own (matched by the wildcard `*` as a name of one part).
|
|
200
|
+
* @param timesToListen The number of emittings the listener is called for.
|
|
201
|
+
* @param listener The function called with the event's values, asynchronously after the emitting (in a later turn of
|
|
202
|
+
* the event loop); its result (or the promise it returns) is collected by `emitRequest()`.
|
|
203
|
+
* @returns The component, for chaining.
|
|
204
|
+
*/
|
|
205
|
+
many(event, timesToListen, listener) {
|
|
206
|
+
this.#eventEmitter.many(event, timesToListen, listener);
|
|
207
|
+
return this;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Add a listener called for the event's next emittings, then removed; it is placed before the event's other
|
|
211
|
+
* listeners.
|
|
212
|
+
* @param event The event: a name (`'order.paid'`, the parts separated by dots, with the wildcards `*` for one part
|
|
213
|
+
* and `**` for any parts) or the parts as an array (`['order', 'paid']`). A symbol is an event of
|
|
214
|
+
* its own (matched by the wildcard `*` as a name of one part).
|
|
215
|
+
* @param timesToListen The number of emittings the listener is called for.
|
|
216
|
+
* @param listener The function called with the event's values, asynchronously after the emitting (in a later turn of
|
|
217
|
+
* the event loop); its result (or the promise it returns) is collected by `emitRequest()`.
|
|
218
|
+
* @returns The component, for chaining.
|
|
219
|
+
*/
|
|
220
|
+
prependMany(event, timesToListen, listener) {
|
|
221
|
+
this.#eventEmitter.prependMany(event, timesToListen, listener);
|
|
222
|
+
return this;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Add a listener of every event, called synchronously at the emitting, before the event's own listeners.
|
|
226
|
+
* @param listener The function called with the event name, then the event's values.
|
|
227
|
+
* @returns The component, for chaining.
|
|
228
|
+
*/
|
|
229
|
+
onAny(listener) {
|
|
230
|
+
this.#eventEmitter.onAny(listener);
|
|
231
|
+
return this;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Add a listener of every event, before the other listeners of every event, called synchronously at the emitting.
|
|
235
|
+
* @param listener The function called with the event name, then the event's values.
|
|
236
|
+
* @returns The component, for chaining.
|
|
237
|
+
*/
|
|
238
|
+
prependAny(listener) {
|
|
239
|
+
this.#eventEmitter.prependAny(listener);
|
|
240
|
+
return this;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Remove a listener of every event added by `onAny()` or `prependAny()`.
|
|
244
|
+
* @param listener The listener to remove.
|
|
245
|
+
* @returns The component, for chaining.
|
|
246
|
+
*/
|
|
247
|
+
offAny(listener) {
|
|
248
|
+
this.#eventEmitter.offAny(listener);
|
|
249
|
+
return this;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Remove a listener of an event, as `off()`.
|
|
253
|
+
* @param event The event the listener was added for.
|
|
254
|
+
* @param listener The listener to remove.
|
|
255
|
+
* @returns The component, for chaining.
|
|
256
|
+
*/
|
|
257
|
+
removeListener(event, listener) {
|
|
258
|
+
this.#eventEmitter.removeListener(event, listener);
|
|
259
|
+
return this;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Remove a listener of an event; nothing happens when it was not added.
|
|
263
|
+
* @param event The event the listener was added for.
|
|
264
|
+
* @param listener The listener to remove.
|
|
265
|
+
* @returns The component, for chaining.
|
|
266
|
+
*/
|
|
267
|
+
off(event, listener) {
|
|
268
|
+
this.#eventEmitter.off(event, listener);
|
|
269
|
+
return this;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Remove the listeners of an event, or all the listeners.
|
|
273
|
+
* @param event The event whose listeners are removed; all the listeners when omitted.
|
|
274
|
+
* @returns The component, for chaining.
|
|
275
|
+
*/
|
|
276
|
+
removeAllListeners(event) {
|
|
277
|
+
this.#eventEmitter.removeAllListeners(event);
|
|
278
|
+
return this;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Set the number of listeners of one event above which a possible memory leak is warned of (the
|
|
282
|
+
* `maxListeners` option, 11 by default); the listeners are never limited.
|
|
283
|
+
* @param n The number, 0 for no warning.
|
|
284
|
+
*/
|
|
285
|
+
setMaxListeners(n) {
|
|
286
|
+
this.#eventEmitter.setMaxListeners(n);
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* The number of listeners of one event above which a possible memory leak is warned of.
|
|
290
|
+
* @returns The number, 0 for no warning.
|
|
291
|
+
*/
|
|
292
|
+
getMaxListeners() {
|
|
293
|
+
return this.#eventEmitter.getMaxListeners();
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* The events having listeners, in no guaranteed order.
|
|
297
|
+
* @param nsAsArray Return each namespaced event as the array of its parts (`['order', 'paid']`) instead of its
|
|
298
|
+
* name (`'order.paid'`); false by default.
|
|
299
|
+
* @returns The events.
|
|
300
|
+
*/
|
|
301
|
+
eventNames(nsAsArray) {
|
|
302
|
+
return this.#eventEmitter.eventNames(nsAsArray);
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* The number of listeners of an event (the wildcard listeners matching it included), or of every event (the
|
|
306
|
+
* listeners of `onAny()` excluded).
|
|
307
|
+
* @param event The event name or its parts as an array; every event when omitted.
|
|
308
|
+
* @returns The number of listeners.
|
|
309
|
+
*/
|
|
310
|
+
listenerCount(event) {
|
|
311
|
+
return this.#eventEmitter.listenerCount(event);
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* The listeners of an event, or of every event.
|
|
315
|
+
* @param event The event name (the wildcard listeners matching it included), its parts as an array, or a symbol;
|
|
316
|
+
* every event when omitted (the listeners of `onAny()` excluded).
|
|
317
|
+
* @returns A copy of the listeners; changing it does not change the listeners.
|
|
318
|
+
*/
|
|
319
|
+
listeners(event) {
|
|
320
|
+
return this.#eventEmitter.listeners(event);
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* The listeners of every event, added by `onAny()` and `prependAny()`.
|
|
324
|
+
* @returns A copy of these listeners; changing it does not change the listeners.
|
|
325
|
+
*/
|
|
326
|
+
listenersAny() {
|
|
327
|
+
return this.#eventEmitter.listenersAny();
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Whether an event has listeners (the wildcard listeners matching it included; the listeners of `onAny()`
|
|
331
|
+
* excluded).
|
|
332
|
+
* @param event The event name, its parts as an array, or a symbol; any event when omitted.
|
|
333
|
+
* @returns true when there are listeners.
|
|
334
|
+
*/
|
|
335
|
+
hasListeners(event) {
|
|
336
|
+
return this.#eventEmitter.hasListeners(event);
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Destroy the component and initialize it again (same instance): its dependencies are injected again and its
|
|
340
|
+
* `init()` runs again; its listeners are removed by the teardown. Its configured values are kept.
|
|
341
|
+
* @returns Resolves once the component is ready again.
|
|
342
|
+
* @throws {ObjectDestroyedException} When its parent has been destroyed.
|
|
343
|
+
* @throws {Error} The error of its teardown or of its initialization.
|
|
344
|
+
*/
|
|
345
|
+
async reload() {
|
|
346
|
+
await this[BaseObject_js_1.__destroy]();
|
|
347
|
+
this[BaseObject_js_1.__revive]();
|
|
348
|
+
await this[BaseObject_js_1.__init]();
|
|
349
|
+
}
|
|
350
|
+
};
|
|
351
|
+
exports.Component = Component;
|
|
352
|
+
__decorate([
|
|
353
|
+
(0, Configurable_js_1.Configurable)(DTO_js_1.DTO.Number().integer().min(0).optional().default(11), function (maxListeners) {
|
|
354
|
+
this.setMaxListeners(maxListeners);
|
|
355
|
+
return maxListeners;
|
|
356
|
+
}),
|
|
357
|
+
__metadata("design:type", Number)
|
|
358
|
+
], Component.prototype, "maxListeners", void 0);
|
|
359
|
+
exports.Component = Component = __decorate([
|
|
360
|
+
(0, Lifetime_js_1.Singleton)(true),
|
|
361
|
+
(0, ObjectType_js_1.DefineObjectType)(ObjectType_js_1.ObjectType.Component)
|
|
362
|
+
], Component);
|