@rsdk/core 0.14.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/.eslintignore +4 -0
- package/.eslintrc.js +4 -0
- package/.prettierignore +1 -0
- package/.prettierrc.json +1 -0
- package/dist/app/platform.app.d.ts +28 -0
- package/dist/app/platform.app.js +49 -0
- package/dist/app/platform.app.js.map +1 -0
- package/dist/app-metadata/app-metadata.const.d.ts +3 -0
- package/dist/app-metadata/app-metadata.const.js +7 -0
- package/dist/app-metadata/app-metadata.const.js.map +1 -0
- package/dist/app-metadata/app-metadata.module.d.ts +5 -0
- package/dist/app-metadata/app-metadata.module.js +41 -0
- package/dist/app-metadata/app-metadata.module.js.map +1 -0
- package/dist/app-metadata/app-name.const.d.ts +1 -0
- package/dist/app-metadata/app-name.const.js +5 -0
- package/dist/app-metadata/app-name.const.js.map +1 -0
- package/dist/app-metadata/app-name.validator.d.ts +2 -0
- package/dist/app-metadata/app-name.validator.js +14 -0
- package/dist/app-metadata/app-name.validator.js.map +1 -0
- package/dist/app-metadata/decorators/app-name.decorator.d.ts +1 -0
- package/dist/app-metadata/decorators/app-name.decorator.js +8 -0
- package/dist/app-metadata/decorators/app-name.decorator.js.map +1 -0
- package/dist/app-metadata/decorators/index.d.ts +1 -0
- package/dist/app-metadata/decorators/index.js +18 -0
- package/dist/app-metadata/decorators/index.js.map +1 -0
- package/dist/app-metadata/exceptions/app-name-validation.exception.d.ts +4 -0
- package/dist/app-metadata/exceptions/app-name-validation.exception.js +38 -0
- package/dist/app-metadata/exceptions/app-name-validation.exception.js.map +1 -0
- package/dist/app-metadata/exceptions/index.d.ts +1 -0
- package/dist/app-metadata/exceptions/index.js +18 -0
- package/dist/app-metadata/exceptions/index.js.map +1 -0
- package/dist/app-metadata/index.d.ts +2 -0
- package/dist/app-metadata/index.js +19 -0
- package/dist/app-metadata/index.js.map +1 -0
- package/dist/config/additional-source/additional-source.initializer.d.ts +38 -0
- package/dist/config/additional-source/additional-source.initializer.js +130 -0
- package/dist/config/additional-source/additional-source.initializer.js.map +1 -0
- package/dist/config/additional-source/additional-source.module.d.ts +24 -0
- package/dist/config/additional-source/additional-source.module.js +32 -0
- package/dist/config/additional-source/additional-source.module.js.map +1 -0
- package/dist/config/config-reload.indicator.d.ts +8 -0
- package/dist/config/config-reload.indicator.js +42 -0
- package/dist/config/config-reload.indicator.js.map +1 -0
- package/dist/config/config.abstract.d.ts +19 -0
- package/dist/config/config.abstract.js +57 -0
- package/dist/config/config.abstract.js.map +1 -0
- package/dist/config/config.module.d.ts +121 -0
- package/dist/config/config.module.js +271 -0
- package/dist/config/config.module.js.map +1 -0
- package/dist/config/exceptions/config-not-bootstrapped.exception.d.ts +4 -0
- package/dist/config/exceptions/config-not-bootstrapped.exception.js +30 -0
- package/dist/config/exceptions/config-not-bootstrapped.exception.js.map +1 -0
- package/dist/config/exceptions/config-property-metadata-not-found.d.ts +4 -0
- package/dist/config/exceptions/config-property-metadata-not-found.js +13 -0
- package/dist/config/exceptions/config-property-metadata-not-found.js.map +1 -0
- package/dist/config/exceptions/index.d.ts +3 -0
- package/dist/config/exceptions/index.js +22 -0
- package/dist/config/exceptions/index.js.map +1 -0
- package/dist/config/exceptions/property.exception.d.ts +5 -0
- package/dist/config/exceptions/property.exception.js +18 -0
- package/dist/config/exceptions/property.exception.js.map +1 -0
- package/dist/config/index.d.ts +10 -0
- package/dist/config/index.js +29 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/metadata/config-metadata.registry.d.ts +17 -0
- package/dist/config/metadata/config-metadata.registry.js +46 -0
- package/dist/config/metadata/config-metadata.registry.js.map +1 -0
- package/dist/config/metadata/decorators/config-section.decorator.d.ts +10 -0
- package/dist/config/metadata/decorators/config-section.decorator.js +19 -0
- package/dist/config/metadata/decorators/config-section.decorator.js.map +1 -0
- package/dist/config/metadata/decorators/declare-property.decorator.d.ts +17 -0
- package/dist/config/metadata/decorators/declare-property.decorator.js +37 -0
- package/dist/config/metadata/decorators/declare-property.decorator.js.map +1 -0
- package/dist/config/metadata/decorators/index.d.ts +4 -0
- package/dist/config/metadata/decorators/index.js +21 -0
- package/dist/config/metadata/decorators/index.js.map +1 -0
- package/dist/config/metadata/decorators/inject-property.decorator.d.ts +19 -0
- package/dist/config/metadata/decorators/inject-property.decorator.js +26 -0
- package/dist/config/metadata/decorators/inject-property.decorator.js.map +1 -0
- package/dist/config/metadata/decorators/property.decorator.d.ts +12 -0
- package/dist/config/metadata/decorators/property.decorator.js +27 -0
- package/dist/config/metadata/decorators/property.decorator.js.map +1 -0
- package/dist/config/metadata/exceptions/duplicate-property.exception.d.ts +4 -0
- package/dist/config/metadata/exceptions/duplicate-property.exception.js +27 -0
- package/dist/config/metadata/exceptions/duplicate-property.exception.js.map +1 -0
- package/dist/config/metadata/exceptions/duplicate-section.exception.d.ts +6 -0
- package/dist/config/metadata/exceptions/duplicate-section.exception.js +27 -0
- package/dist/config/metadata/exceptions/duplicate-section.exception.js.map +1 -0
- package/dist/config/metadata/exceptions/duplicate-source.exception.d.ts +6 -0
- package/dist/config/metadata/exceptions/duplicate-source.exception.js +27 -0
- package/dist/config/metadata/exceptions/duplicate-source.exception.js.map +1 -0
- package/dist/config/metadata/exceptions/index.d.ts +3 -0
- package/dist/config/metadata/exceptions/index.js +20 -0
- package/dist/config/metadata/exceptions/index.js.map +1 -0
- package/dist/config/metadata/index.d.ts +2 -0
- package/dist/config/metadata/index.js +19 -0
- package/dist/config/metadata/index.js.map +1 -0
- package/dist/config/parsers/array.parser.d.ts +11 -0
- package/dist/config/parsers/array.parser.js +33 -0
- package/dist/config/parsers/array.parser.js.map +1 -0
- package/dist/config/parsers/boolean/bool.parser.d.ts +6 -0
- package/dist/config/parsers/boolean/bool.parser.js +20 -0
- package/dist/config/parsers/boolean/bool.parser.js.map +1 -0
- package/dist/config/parsers/boolean/index.d.ts +1 -0
- package/dist/config/parsers/boolean/index.js +18 -0
- package/dist/config/parsers/boolean/index.js.map +1 -0
- package/dist/config/parsers/enum/enum.parser.d.ts +9 -0
- package/dist/config/parsers/enum/enum.parser.js +24 -0
- package/dist/config/parsers/enum/enum.parser.js.map +1 -0
- package/dist/config/parsers/enum/index.d.ts +1 -0
- package/dist/config/parsers/enum/index.js +18 -0
- package/dist/config/parsers/enum/index.js.map +1 -0
- package/dist/config/parsers/index.d.ts +10 -0
- package/dist/config/parsers/index.js +27 -0
- package/dist/config/parsers/index.js.map +1 -0
- package/dist/config/parsers/int/index.d.ts +1 -0
- package/dist/config/parsers/int/index.js +18 -0
- package/dist/config/parsers/int/index.js.map +1 -0
- package/dist/config/parsers/int/int.parser.d.ts +6 -0
- package/dist/config/parsers/int/int.parser.js +20 -0
- package/dist/config/parsers/int/int.parser.js.map +1 -0
- package/dist/config/parsers/number/index.d.ts +1 -0
- package/dist/config/parsers/number/index.js +18 -0
- package/dist/config/parsers/number/index.js.map +1 -0
- package/dist/config/parsers/number/number.parser.d.ts +6 -0
- package/dist/config/parsers/number/number.parser.js +23 -0
- package/dist/config/parsers/number/number.parser.js.map +1 -0
- package/dist/config/parsers/path/fspath.parser.d.ts +8 -0
- package/dist/config/parsers/path/fspath.parser.js +56 -0
- package/dist/config/parsers/path/fspath.parser.js.map +1 -0
- package/dist/config/parsers/path/index.d.ts +1 -0
- package/dist/config/parsers/path/index.js +18 -0
- package/dist/config/parsers/path/index.js.map +1 -0
- package/dist/config/parsers/size/index.d.ts +1 -0
- package/dist/config/parsers/size/index.js +18 -0
- package/dist/config/parsers/size/index.js.map +1 -0
- package/dist/config/parsers/size/size.parser.d.ts +7 -0
- package/dist/config/parsers/size/size.parser.js +21 -0
- package/dist/config/parsers/size/size.parser.js.map +1 -0
- package/dist/config/parsers/string/index.d.ts +1 -0
- package/dist/config/parsers/string/index.js +18 -0
- package/dist/config/parsers/string/index.js.map +1 -0
- package/dist/config/parsers/string/string.parser.d.ts +6 -0
- package/dist/config/parsers/string/string.parser.js +18 -0
- package/dist/config/parsers/string/string.parser.js.map +1 -0
- package/dist/config/parsers/timespan/index.d.ts +1 -0
- package/dist/config/parsers/timespan/index.js +18 -0
- package/dist/config/parsers/timespan/index.js.map +1 -0
- package/dist/config/parsers/timespan/timespan.parser.d.ts +7 -0
- package/dist/config/parsers/timespan/timespan.parser.js +21 -0
- package/dist/config/parsers/timespan/timespan.parser.js.map +1 -0
- package/dist/config/parsers/url/index.d.ts +1 -0
- package/dist/config/parsers/url/index.js +18 -0
- package/dist/config/parsers/url/index.js.map +1 -0
- package/dist/config/parsers/url/url.parser.d.ts +6 -0
- package/dist/config/parsers/url/url.parser.js +18 -0
- package/dist/config/parsers/url/url.parser.js.map +1 -0
- package/dist/config/reload/config-reload.events.d.ts +22 -0
- package/dist/config/reload/config-reload.events.js +19 -0
- package/dist/config/reload/config-reload.events.js.map +1 -0
- package/dist/config/reload/index.d.ts +1 -0
- package/dist/config/reload/index.js +18 -0
- package/dist/config/reload/index.js.map +1 -0
- package/dist/config/sources/base/config-source.abstract.d.ts +23 -0
- package/dist/config/sources/base/config-source.abstract.js +73 -0
- package/dist/config/sources/base/config-source.abstract.js.map +1 -0
- package/dist/config/sources/base/index.d.ts +2 -0
- package/dist/config/sources/base/index.js +19 -0
- package/dist/config/sources/base/index.js.map +1 -0
- package/dist/config/sources/base/reloadable-config-source.abstract.d.ts +12 -0
- package/dist/config/sources/base/reloadable-config-source.abstract.js +30 -0
- package/dist/config/sources/base/reloadable-config-source.abstract.js.map +1 -0
- package/dist/config/sources/config-source.decorator.d.ts +12 -0
- package/dist/config/sources/config-source.decorator.js +22 -0
- package/dist/config/sources/config-source.decorator.js.map +1 -0
- package/dist/config/sources/exceptions/config-source-di.exception.d.ts +6 -0
- package/dist/config/sources/exceptions/config-source-di.exception.js +34 -0
- package/dist/config/sources/exceptions/config-source-di.exception.js.map +1 -0
- package/dist/config/sources/exceptions/config-source.exception.d.ts +4 -0
- package/dist/config/sources/exceptions/config-source.exception.js +11 -0
- package/dist/config/sources/exceptions/config-source.exception.js.map +1 -0
- package/dist/config/sources/exceptions/index.d.ts +2 -0
- package/dist/config/sources/exceptions/index.js +19 -0
- package/dist/config/sources/exceptions/index.js.map +1 -0
- package/dist/config/sources/implementations/json-file.source.d.ts +9 -0
- package/dist/config/sources/implementations/json-file.source.js +46 -0
- package/dist/config/sources/implementations/json-file.source.js.map +1 -0
- package/dist/config/sources/implementations/relodable-json-file.source.d.ts +8 -0
- package/dist/config/sources/implementations/relodable-json-file.source.js +55 -0
- package/dist/config/sources/implementations/relodable-json-file.source.js.map +1 -0
- package/dist/config/sources/index.d.ts +3 -0
- package/dist/config/sources/index.js +20 -0
- package/dist/config/sources/index.js.map +1 -0
- package/dist/config/types.d.ts +65 -0
- package/dist/config/types.js +3 -0
- package/dist/config/types.js.map +1 -0
- package/dist/config/vars.class.d.ts +19 -0
- package/dist/config/vars.class.js +79 -0
- package/dist/config/vars.class.js.map +1 -0
- package/dist/exceptions/base/bootstrap-exception.abstract.d.ts +15 -0
- package/dist/exceptions/base/bootstrap-exception.abstract.js +22 -0
- package/dist/exceptions/base/bootstrap-exception.abstract.js.map +1 -0
- package/dist/exceptions/base/index.d.ts +3 -0
- package/dist/exceptions/base/index.js +20 -0
- package/dist/exceptions/base/index.js.map +1 -0
- package/dist/exceptions/base/pipeline-exception.abstract.d.ts +21 -0
- package/dist/exceptions/base/pipeline-exception.abstract.js +29 -0
- package/dist/exceptions/base/pipeline-exception.abstract.js.map +1 -0
- package/dist/exceptions/base/platform-exception.absract.d.ts +48 -0
- package/dist/exceptions/base/platform-exception.absract.js +49 -0
- package/dist/exceptions/base/platform-exception.absract.js.map +1 -0
- package/dist/exceptions/implementations/bootstrap/double-init.exception.d.ts +4 -0
- package/dist/exceptions/implementations/bootstrap/double-init.exception.js +35 -0
- package/dist/exceptions/implementations/bootstrap/double-init.exception.js.map +1 -0
- package/dist/exceptions/implementations/bootstrap/duplicate-protocol.exception.d.ts +4 -0
- package/dist/exceptions/implementations/bootstrap/duplicate-protocol.exception.js +34 -0
- package/dist/exceptions/implementations/bootstrap/duplicate-protocol.exception.js.map +1 -0
- package/dist/exceptions/implementations/bootstrap/index.d.ts +8 -0
- package/dist/exceptions/implementations/bootstrap/index.js +25 -0
- package/dist/exceptions/implementations/bootstrap/index.js.map +1 -0
- package/dist/exceptions/implementations/bootstrap/no-http.exception.d.ts +4 -0
- package/dist/exceptions/implementations/bootstrap/no-http.exception.js +36 -0
- package/dist/exceptions/implementations/bootstrap/no-http.exception.js.map +1 -0
- package/dist/exceptions/implementations/bootstrap/no-init.exception.d.ts +4 -0
- package/dist/exceptions/implementations/bootstrap/no-init.exception.js +35 -0
- package/dist/exceptions/implementations/bootstrap/no-init.exception.js.map +1 -0
- package/dist/exceptions/implementations/bootstrap/no-matching-transport.exception.d.ts +5 -0
- package/dist/exceptions/implementations/bootstrap/no-matching-transport.exception.js +37 -0
- package/dist/exceptions/implementations/bootstrap/no-matching-transport.exception.js.map +1 -0
- package/dist/exceptions/implementations/bootstrap/sequence.exception.d.ts +4 -0
- package/dist/exceptions/implementations/bootstrap/sequence.exception.js +31 -0
- package/dist/exceptions/implementations/bootstrap/sequence.exception.js.map +1 -0
- package/dist/exceptions/implementations/bootstrap/symbol-key-decoration.exception.d.ts +4 -0
- package/dist/exceptions/implementations/bootstrap/symbol-key-decoration.exception.js +30 -0
- package/dist/exceptions/implementations/bootstrap/symbol-key-decoration.exception.js.map +1 -0
- package/dist/exceptions/implementations/bootstrap/unknown-bootstrap.exception.d.ts +4 -0
- package/dist/exceptions/implementations/bootstrap/unknown-bootstrap.exception.js +27 -0
- package/dist/exceptions/implementations/bootstrap/unknown-bootstrap.exception.js.map +1 -0
- package/dist/exceptions/implementations/index.d.ts +2 -0
- package/dist/exceptions/implementations/index.js +19 -0
- package/dist/exceptions/implementations/index.js.map +1 -0
- package/dist/exceptions/implementations/pipeline/authentication.exception.d.ts +4 -0
- package/dist/exceptions/implementations/pipeline/authentication.exception.js +35 -0
- package/dist/exceptions/implementations/pipeline/authentication.exception.js.map +1 -0
- package/dist/exceptions/implementations/pipeline/conflict.exception.d.ts +4 -0
- package/dist/exceptions/implementations/pipeline/conflict.exception.js +36 -0
- package/dist/exceptions/implementations/pipeline/conflict.exception.js.map +1 -0
- package/dist/exceptions/implementations/pipeline/duplicate-entity.exception.d.ts +4 -0
- package/dist/exceptions/implementations/pipeline/duplicate-entity.exception.js +35 -0
- package/dist/exceptions/implementations/pipeline/duplicate-entity.exception.js.map +1 -0
- package/dist/exceptions/implementations/pipeline/index.d.ts +9 -0
- package/dist/exceptions/implementations/pipeline/index.js +26 -0
- package/dist/exceptions/implementations/pipeline/index.js.map +1 -0
- package/dist/exceptions/implementations/pipeline/input.exception.d.ts +4 -0
- package/dist/exceptions/implementations/pipeline/input.exception.js +35 -0
- package/dist/exceptions/implementations/pipeline/input.exception.js.map +1 -0
- package/dist/exceptions/implementations/pipeline/internal.exception.d.ts +4 -0
- package/dist/exceptions/implementations/pipeline/internal.exception.js +35 -0
- package/dist/exceptions/implementations/pipeline/internal.exception.js.map +1 -0
- package/dist/exceptions/implementations/pipeline/not-allowed.exception.d.ts +4 -0
- package/dist/exceptions/implementations/pipeline/not-allowed.exception.js +35 -0
- package/dist/exceptions/implementations/pipeline/not-allowed.exception.js.map +1 -0
- package/dist/exceptions/implementations/pipeline/not-found.exception.d.ts +4 -0
- package/dist/exceptions/implementations/pipeline/not-found.exception.js +35 -0
- package/dist/exceptions/implementations/pipeline/not-found.exception.js.map +1 -0
- package/dist/exceptions/implementations/pipeline/timeout.exception.d.ts +4 -0
- package/dist/exceptions/implementations/pipeline/timeout.exception.js +34 -0
- package/dist/exceptions/implementations/pipeline/timeout.exception.js.map +1 -0
- package/dist/exceptions/implementations/pipeline/validation.exception.d.ts +4 -0
- package/dist/exceptions/implementations/pipeline/validation.exception.js +13 -0
- package/dist/exceptions/implementations/pipeline/validation.exception.js.map +1 -0
- package/dist/exceptions/index.d.ts +5 -0
- package/dist/exceptions/index.js +24 -0
- package/dist/exceptions/index.js.map +1 -0
- package/dist/exceptions/metadata/decorators/exception.decorator.d.ts +2 -0
- package/dist/exceptions/metadata/decorators/exception.decorator.js +13 -0
- package/dist/exceptions/metadata/decorators/exception.decorator.js.map +1 -0
- package/dist/exceptions/metadata/decorators/index.d.ts +2 -0
- package/dist/exceptions/metadata/decorators/index.js +19 -0
- package/dist/exceptions/metadata/decorators/index.js.map +1 -0
- package/dist/exceptions/metadata/decorators/throws.decorator.d.ts +3 -0
- package/dist/exceptions/metadata/decorators/throws.decorator.js +20 -0
- package/dist/exceptions/metadata/decorators/throws.decorator.js.map +1 -0
- package/dist/exceptions/metadata/exceptions.registry.d.ts +23 -0
- package/dist/exceptions/metadata/exceptions.registry.js +30 -0
- package/dist/exceptions/metadata/exceptions.registry.js.map +1 -0
- package/dist/exceptions/metadata/index.d.ts +2 -0
- package/dist/exceptions/metadata/index.js +19 -0
- package/dist/exceptions/metadata/index.js.map +1 -0
- package/dist/exceptions/types.d.ts +18 -0
- package/dist/exceptions/types.js +23 -0
- package/dist/exceptions/types.js.map +1 -0
- package/dist/exceptions/validation/exception.d.ts +4 -0
- package/dist/exceptions/validation/exception.js +13 -0
- package/dist/exceptions/validation/exception.js.map +1 -0
- package/dist/exceptions.handling/constants.d.ts +3 -0
- package/dist/exceptions.handling/constants.js +7 -0
- package/dist/exceptions.handling/constants.js.map +1 -0
- package/dist/exceptions.handling/global-exceptions.config.d.ts +4 -0
- package/dist/exceptions.handling/global-exceptions.config.js +32 -0
- package/dist/exceptions.handling/global-exceptions.config.js.map +1 -0
- package/dist/exceptions.handling/global-exceptions.filter.d.ts +17 -0
- package/dist/exceptions.handling/global-exceptions.filter.js +83 -0
- package/dist/exceptions.handling/global-exceptions.filter.js.map +1 -0
- package/dist/exceptions.handling/global-exceptions.module.d.ts +26 -0
- package/dist/exceptions.handling/global-exceptions.module.js +47 -0
- package/dist/exceptions.handling/global-exceptions.module.js.map +1 -0
- package/dist/exceptions.handling/index.d.ts +2 -0
- package/dist/exceptions.handling/index.js +19 -0
- package/dist/exceptions.handling/index.js.map +1 -0
- package/dist/exceptions.handling/types.d.ts +81 -0
- package/dist/exceptions.handling/types.js +3 -0
- package/dist/exceptions.handling/types.js.map +1 -0
- package/dist/health/exceptions/health-check.exception.d.ts +5 -0
- package/dist/health/exceptions/health-check.exception.js +24 -0
- package/dist/health/exceptions/health-check.exception.js.map +1 -0
- package/dist/health/exceptions/index.d.ts +1 -0
- package/dist/health/exceptions/index.js +18 -0
- package/dist/health/exceptions/index.js.map +1 -0
- package/dist/health/health.const.d.ts +2 -0
- package/dist/health/health.const.js +6 -0
- package/dist/health/health.const.js.map +1 -0
- package/dist/health/health.module.d.ts +5 -0
- package/dist/health/health.module.js +33 -0
- package/dist/health/health.module.js.map +1 -0
- package/dist/health/health.service.d.ts +14 -0
- package/dist/health/health.service.js +118 -0
- package/dist/health/health.service.js.map +1 -0
- package/dist/health/helpers/check-result.class.d.ts +37 -0
- package/dist/health/helpers/check-result.class.js +49 -0
- package/dist/health/helpers/check-result.class.js.map +1 -0
- package/dist/health/helpers/index.d.ts +1 -0
- package/dist/health/helpers/index.js +18 -0
- package/dist/health/helpers/index.js.map +1 -0
- package/dist/health/index.d.ts +6 -0
- package/dist/health/index.js +23 -0
- package/dist/health/index.js.map +1 -0
- package/dist/health/indicators.abstract/fs-access.indicator.d.ts +27 -0
- package/dist/health/indicators.abstract/fs-access.indicator.js +36 -0
- package/dist/health/indicators.abstract/fs-access.indicator.js.map +1 -0
- package/dist/health/indicators.abstract/index.d.ts +2 -0
- package/dist/health/indicators.abstract/index.js +19 -0
- package/dist/health/indicators.abstract/index.js.map +1 -0
- package/dist/health/indicators.abstract/ping.indicator.d.ts +21 -0
- package/dist/health/indicators.abstract/ping.indicator.js +28 -0
- package/dist/health/indicators.abstract/ping.indicator.js.map +1 -0
- package/dist/health/metadata/index.d.ts +2 -0
- package/dist/health/metadata/index.js +19 -0
- package/dist/health/metadata/index.js.map +1 -0
- package/dist/health/metadata/indicator.decorator.d.ts +5 -0
- package/dist/health/metadata/indicator.decorator.js +16 -0
- package/dist/health/metadata/indicator.decorator.js.map +1 -0
- package/dist/health/metadata/indicators.registry.d.ts +12 -0
- package/dist/health/metadata/indicators.registry.js +26 -0
- package/dist/health/metadata/indicators.registry.js.map +1 -0
- package/dist/health/types.d.ts +45 -0
- package/dist/health/types.js +3 -0
- package/dist/health/types.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/logging/adapters/index.d.ts +1 -0
- package/dist/logging/adapters/index.js +18 -0
- package/dist/logging/adapters/index.js.map +1 -0
- package/dist/logging/adapters/nest-logger.adapter.d.ts +11 -0
- package/dist/logging/adapters/nest-logger.adapter.js +27 -0
- package/dist/logging/adapters/nest-logger.adapter.js.map +1 -0
- package/dist/logging/decorators/index.d.ts +1 -0
- package/dist/logging/decorators/index.js +18 -0
- package/dist/logging/decorators/index.js.map +1 -0
- package/dist/logging/decorators/inject-logger.decorator.d.ts +2 -0
- package/dist/logging/decorators/inject-logger.decorator.js +13 -0
- package/dist/logging/decorators/inject-logger.decorator.js.map +1 -0
- package/dist/logging/helpers.d.ts +2 -0
- package/dist/logging/helpers.js +7 -0
- package/dist/logging/helpers.js.map +1 -0
- package/dist/logging/index.d.ts +4 -0
- package/dist/logging/index.js +21 -0
- package/dist/logging/index.js.map +1 -0
- package/dist/logging/logging.config.d.ts +6 -0
- package/dist/logging/logging.config.js +38 -0
- package/dist/logging/logging.config.js.map +1 -0
- package/dist/logging/logging.module.d.ts +10 -0
- package/dist/logging/logging.module.js +54 -0
- package/dist/logging/logging.module.js.map +1 -0
- package/dist/logging/types.d.ts +2 -0
- package/dist/logging/types.js +3 -0
- package/dist/logging/types.js.map +1 -0
- package/dist/manifest/manifest.d.ts +7 -0
- package/dist/manifest/manifest.js +23 -0
- package/dist/manifest/manifest.js.map +1 -0
- package/dist/metrics/index.d.ts +4 -0
- package/dist/metrics/index.js +27 -0
- package/dist/metrics/index.js.map +1 -0
- package/dist/metrics/metadata/decorators/index.d.ts +1 -0
- package/dist/metrics/metadata/decorators/index.js +18 -0
- package/dist/metrics/metadata/decorators/index.js.map +1 -0
- package/dist/metrics/metadata/decorators/metric.decorator.d.ts +13 -0
- package/dist/metrics/metadata/decorators/metric.decorator.js +11 -0
- package/dist/metrics/metadata/decorators/metric.decorator.js.map +1 -0
- package/dist/metrics/metadata/index.d.ts +2 -0
- package/dist/metrics/metadata/index.js +19 -0
- package/dist/metrics/metadata/index.js.map +1 -0
- package/dist/metrics/metadata/metrics.registry.d.ts +8 -0
- package/dist/metrics/metadata/metrics.registry.js +26 -0
- package/dist/metrics/metadata/metrics.registry.js.map +1 -0
- package/dist/metrics/metrics.config.d.ts +5 -0
- package/dist/metrics/metrics.config.js +36 -0
- package/dist/metrics/metrics.config.js.map +1 -0
- package/dist/metrics/metrics.module.d.ts +35 -0
- package/dist/metrics/metrics.module.js +98 -0
- package/dist/metrics/metrics.module.js.map +1 -0
- package/dist/metrics/types.d.ts +21 -0
- package/dist/metrics/types.js +12 -0
- package/dist/metrics/types.js.map +1 -0
- package/dist/noop.http-adapter.d.ts +32 -0
- package/dist/noop.http-adapter.js +100 -0
- package/dist/noop.http-adapter.js.map +1 -0
- package/dist/platform.context.d.ts +55 -0
- package/dist/platform.context.js +162 -0
- package/dist/platform.context.js.map +1 -0
- package/dist/platform.module.d.ts +8 -0
- package/dist/platform.module.js +61 -0
- package/dist/platform.module.js.map +1 -0
- package/dist/plugin/plugin.module.d.ts +5 -0
- package/dist/plugin/plugin.module.js +22 -0
- package/dist/plugin/plugin.module.js.map +1 -0
- package/dist/tracing/auto-instrumentations.config.d.ts +1 -0
- package/dist/tracing/auto-instrumentations.config.js +35 -0
- package/dist/tracing/auto-instrumentations.config.js.map +1 -0
- package/dist/tracing/constants.d.ts +5 -0
- package/dist/tracing/constants.js +10 -0
- package/dist/tracing/constants.js.map +1 -0
- package/dist/tracing/decorators/index.d.ts +2 -0
- package/dist/tracing/decorators/index.js +19 -0
- package/dist/tracing/decorators/index.js.map +1 -0
- package/dist/tracing/decorators/no-span.decorator.d.ts +5 -0
- package/dist/tracing/decorators/no-span.decorator.js +12 -0
- package/dist/tracing/decorators/no-span.decorator.js.map +1 -0
- package/dist/tracing/decorators/span.decorator.d.ts +6 -0
- package/dist/tracing/decorators/span.decorator.js +18 -0
- package/dist/tracing/decorators/span.decorator.js.map +1 -0
- package/dist/tracing/index.d.ts +1 -0
- package/dist/tracing/index.js +18 -0
- package/dist/tracing/index.js.map +1 -0
- package/dist/tracing/services/index.d.ts +3 -0
- package/dist/tracing/services/index.js +20 -0
- package/dist/tracing/services/index.js.map +1 -0
- package/dist/tracing/services/instrumentation.service.d.ts +10 -0
- package/dist/tracing/services/instrumentation.service.js +138 -0
- package/dist/tracing/services/instrumentation.service.js.map +1 -0
- package/dist/tracing/services/metadata.scanner.d.ts +11 -0
- package/dist/tracing/services/metadata.scanner.js +50 -0
- package/dist/tracing/services/metadata.scanner.js.map +1 -0
- package/dist/tracing/services/trace.injector.d.ts +12 -0
- package/dist/tracing/services/trace.injector.js +119 -0
- package/dist/tracing/services/trace.injector.js.map +1 -0
- package/dist/tracing/tracing.config.d.ts +5 -0
- package/dist/tracing/tracing.config.js +36 -0
- package/dist/tracing/tracing.config.js.map +1 -0
- package/dist/tracing/tracing.module.d.ts +22 -0
- package/dist/tracing/tracing.module.js +118 -0
- package/dist/tracing/tracing.module.js.map +1 -0
- package/dist/transport/transport.module.d.ts +8 -0
- package/dist/transport/transport.module.js +55 -0
- package/dist/transport/transport.module.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.js +21 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/metadata.d.ts +38 -0
- package/dist/types/metadata.js +30 -0
- package/dist/types/metadata.js.map +1 -0
- package/dist/types/options.d.ts +68 -0
- package/dist/types/options.js +3 -0
- package/dist/types/options.js.map +1 -0
- package/dist/types/plugins.d.ts +51 -0
- package/dist/types/plugins.js +6 -0
- package/dist/types/plugins.js.map +1 -0
- package/dist/types/transports.d.ts +85 -0
- package/dist/types/transports.js +11 -0
- package/dist/types/transports.js.map +1 -0
- package/package.json +53 -0
- package/src/app/platform.app.ts +52 -0
- package/src/app-metadata/app-metadata.const.ts +3 -0
- package/src/app-metadata/app-metadata.module.ts +34 -0
- package/src/app-metadata/app-name.const.ts +1 -0
- package/src/app-metadata/app-name.validator.ts +11 -0
- package/src/app-metadata/decorators/app-name.decorator.ts +5 -0
- package/src/app-metadata/decorators/index.ts +1 -0
- package/src/app-metadata/exceptions/app-name-validation.exception.ts +23 -0
- package/src/app-metadata/exceptions/index.ts +1 -0
- package/src/app-metadata/index.ts +2 -0
- package/src/config/additional-source/additional-source.initializer.ts +165 -0
- package/src/config/additional-source/additional-source.module.ts +48 -0
- package/src/config/config-reload.indicator.ts +36 -0
- package/src/config/config.abstract.ts +70 -0
- package/src/config/config.module.ts +330 -0
- package/src/config/exceptions/config-not-bootstrapped.exception.ts +15 -0
- package/src/config/exceptions/config-property-metadata-not-found.ts +9 -0
- package/src/config/exceptions/index.ts +3 -0
- package/src/config/exceptions/property.exception.ts +15 -0
- package/src/config/index.ts +10 -0
- package/src/config/metadata/config-metadata.registry.ts +76 -0
- package/src/config/metadata/decorators/config-section.decorator.ts +30 -0
- package/src/config/metadata/decorators/declare-property.decorator.ts +37 -0
- package/src/config/metadata/decorators/index.ts +4 -0
- package/src/config/metadata/decorators/inject-property.decorator.ts +29 -0
- package/src/config/metadata/decorators/property.decorator.ts +42 -0
- package/src/config/metadata/exceptions/duplicate-property.exception.ts +12 -0
- package/src/config/metadata/exceptions/duplicate-section.exception.ts +13 -0
- package/src/config/metadata/exceptions/duplicate-source.exception.ts +13 -0
- package/src/config/metadata/exceptions/index.ts +3 -0
- package/src/config/metadata/index.ts +2 -0
- package/src/config/parsers/array.parser.ts +40 -0
- package/src/config/parsers/boolean/bool.parser.ts +20 -0
- package/src/config/parsers/boolean/bool.spec.ts +4 -0
- package/src/config/parsers/boolean/index.ts +1 -0
- package/src/config/parsers/enum/enum.parser.ts +23 -0
- package/src/config/parsers/enum/enum.spec.ts +5 -0
- package/src/config/parsers/enum/index.ts +1 -0
- package/src/config/parsers/index.ts +10 -0
- package/src/config/parsers/int/index.ts +1 -0
- package/src/config/parsers/int/int.parser.ts +20 -0
- package/src/config/parsers/int/int.spec.ts +5 -0
- package/src/config/parsers/number/index.ts +1 -0
- package/src/config/parsers/number/number.parser.ts +23 -0
- package/src/config/parsers/number/number.spec.ts +5 -0
- package/src/config/parsers/path/fspath.parser.ts +65 -0
- package/src/config/parsers/path/index.ts +1 -0
- package/src/config/parsers/size/index.ts +1 -0
- package/src/config/parsers/size/size.parser.ts +22 -0
- package/src/config/parsers/size/size.spec.ts +4 -0
- package/src/config/parsers/string/index.ts +1 -0
- package/src/config/parsers/string/string.parser.ts +19 -0
- package/src/config/parsers/timespan/index.ts +1 -0
- package/src/config/parsers/timespan/timespan.parser.ts +27 -0
- package/src/config/parsers/timespan/timespan.spec.ts +4 -0
- package/src/config/parsers/url/index.ts +1 -0
- package/src/config/parsers/url/url.parser.ts +19 -0
- package/src/config/reload/config-reload.events.ts +43 -0
- package/src/config/reload/index.ts +1 -0
- package/src/config/sources/base/config-source.abstract.ts +90 -0
- package/src/config/sources/base/index.ts +2 -0
- package/src/config/sources/base/reloadable-config-source.abstract.ts +39 -0
- package/src/config/sources/config-source.decorator.ts +37 -0
- package/src/config/sources/exceptions/config-source-di.exception.ts +20 -0
- package/src/config/sources/exceptions/config-source.exception.ts +7 -0
- package/src/config/sources/exceptions/index.ts +2 -0
- package/src/config/sources/implementations/json-file.source.ts +29 -0
- package/src/config/sources/implementations/relodable-json-file.source.ts +39 -0
- package/src/config/sources/index.ts +3 -0
- package/src/config/types.ts +87 -0
- package/src/config/vars.class.ts +103 -0
- package/src/exceptions/base/bootstrap-exception.abstract.ts +20 -0
- package/src/exceptions/base/index.ts +3 -0
- package/src/exceptions/base/pipeline-exception.abstract.ts +29 -0
- package/src/exceptions/base/platform-exception.absract.ts +72 -0
- package/src/exceptions/implementations/bootstrap/double-init.exception.ts +21 -0
- package/src/exceptions/implementations/bootstrap/duplicate-protocol.exception.ts +19 -0
- package/src/exceptions/implementations/bootstrap/index.ts +8 -0
- package/src/exceptions/implementations/bootstrap/no-http.exception.ts +21 -0
- package/src/exceptions/implementations/bootstrap/no-init.exception.ts +21 -0
- package/src/exceptions/implementations/bootstrap/no-matching-transport.exception.ts +24 -0
- package/src/exceptions/implementations/bootstrap/sequence.exception.ts +16 -0
- package/src/exceptions/implementations/bootstrap/symbol-key-decoration.exception.ts +15 -0
- package/src/exceptions/implementations/bootstrap/unknown-bootstrap.exception.ts +11 -0
- package/src/exceptions/implementations/index.ts +2 -0
- package/src/exceptions/implementations/pipeline/authentication.exception.ts +20 -0
- package/src/exceptions/implementations/pipeline/conflict.exception.ts +21 -0
- package/src/exceptions/implementations/pipeline/duplicate-entity.exception.ts +20 -0
- package/src/exceptions/implementations/pipeline/index.ts +9 -0
- package/src/exceptions/implementations/pipeline/input.exception.ts +20 -0
- package/src/exceptions/implementations/pipeline/internal.exception.ts +20 -0
- package/src/exceptions/implementations/pipeline/not-allowed.exception.ts +20 -0
- package/src/exceptions/implementations/pipeline/not-found.exception.ts +20 -0
- package/src/exceptions/implementations/pipeline/timeout.exception.ts +19 -0
- package/src/exceptions/implementations/pipeline/validation.exception.ts +9 -0
- package/src/exceptions/index.ts +5 -0
- package/src/exceptions/metadata/decorators/exception.decorator.ts +10 -0
- package/src/exceptions/metadata/decorators/index.ts +2 -0
- package/src/exceptions/metadata/decorators/throws.decorator.ts +25 -0
- package/src/exceptions/metadata/exceptions.registry.ts +50 -0
- package/src/exceptions/metadata/index.ts +2 -0
- package/src/exceptions/types.ts +18 -0
- package/src/exceptions/validation/exception.ts +9 -0
- package/src/exceptions.handling/constants.ts +3 -0
- package/src/exceptions.handling/global-exceptions.config.ts +15 -0
- package/src/exceptions.handling/global-exceptions.filter.ts +81 -0
- package/src/exceptions.handling/global-exceptions.module.ts +67 -0
- package/src/exceptions.handling/index.ts +2 -0
- package/src/exceptions.handling/types.ts +88 -0
- package/src/health/exceptions/health-check.exception.ts +9 -0
- package/src/health/exceptions/index.ts +1 -0
- package/src/health/health.const.ts +2 -0
- package/src/health/health.module.ts +23 -0
- package/src/health/health.service.ts +125 -0
- package/src/health/helpers/check-result.class.ts +52 -0
- package/src/health/helpers/index.ts +1 -0
- package/src/health/index.ts +6 -0
- package/src/health/indicators.abstract/fs-access.indicator.ts +47 -0
- package/src/health/indicators.abstract/index.ts +2 -0
- package/src/health/indicators.abstract/ping.indicator.ts +36 -0
- package/src/health/metadata/index.ts +2 -0
- package/src/health/metadata/indicator.decorator.ts +25 -0
- package/src/health/metadata/indicators.registry.ts +38 -0
- package/src/health/types.ts +50 -0
- package/src/index.ts +32 -0
- package/src/logging/adapters/index.ts +1 -0
- package/src/logging/adapters/nest-logger.adapter.ts +32 -0
- package/src/logging/decorators/index.ts +1 -0
- package/src/logging/decorators/inject-logger.decorator.ts +15 -0
- package/src/logging/helpers.ts +5 -0
- package/src/logging/index.ts +4 -0
- package/src/logging/logging.config.ts +26 -0
- package/src/logging/logging.module.ts +48 -0
- package/src/logging/types.ts +3 -0
- package/src/manifest/manifest.ts +23 -0
- package/src/metrics/index.ts +4 -0
- package/src/metrics/metadata/decorators/index.ts +1 -0
- package/src/metrics/metadata/decorators/metric.decorator.ts +45 -0
- package/src/metrics/metadata/index.ts +2 -0
- package/src/metrics/metadata/metrics.registry.ts +35 -0
- package/src/metrics/metrics.config.ts +16 -0
- package/src/metrics/metrics.module.ts +100 -0
- package/src/metrics/types.ts +39 -0
- package/src/noop.http-adapter.ts +126 -0
- package/src/platform.context.ts +214 -0
- package/src/platform.module.ts +65 -0
- package/src/plugin/plugin.module.ts +24 -0
- package/src/tracing/auto-instrumentations.config.ts +35 -0
- package/src/tracing/constants.ts +6 -0
- package/src/tracing/decorators/index.ts +2 -0
- package/src/tracing/decorators/no-span.decorator.ts +10 -0
- package/src/tracing/decorators/span.decorator.ts +20 -0
- package/src/tracing/index.ts +1 -0
- package/src/tracing/services/index.ts +3 -0
- package/src/tracing/services/instrumentation.service.ts +145 -0
- package/src/tracing/services/metadata.scanner.ts +40 -0
- package/src/tracing/services/trace.injector.ts +147 -0
- package/src/tracing/tracing.config.ts +22 -0
- package/src/tracing/tracing.module.ts +120 -0
- package/src/transport/transport.module.ts +64 -0
- package/src/types/index.ts +4 -0
- package/src/types/metadata.ts +88 -0
- package/src/types/options.ts +83 -0
- package/src/types/plugins.ts +68 -0
- package/src/types/transports.ts +110 -0
- package/tsconfig.json +10 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/* eslint-disable prettier/prettier */
|
|
2
|
+
import EventEmitter from 'events';
|
|
3
|
+
|
|
4
|
+
import type { Config } from '../config.abstract';
|
|
5
|
+
import type { PropertyException } from '../exceptions';
|
|
6
|
+
import type { ConfigSource, ConfigSourceException } from '../sources';
|
|
7
|
+
import type { Changes, RawValues } from '../types';
|
|
8
|
+
|
|
9
|
+
export class ReloadEvents extends EventEmitter {
|
|
10
|
+
private static instance: ReloadEvents;
|
|
11
|
+
|
|
12
|
+
static getInstance(): ReloadEvents {
|
|
13
|
+
if (!this.instance) {
|
|
14
|
+
this.instance = new ReloadEvents();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return this.instance;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export declare interface ReloadEvents {
|
|
22
|
+
on(e: 'reload', fn: (source: ConfigSource, values: RawValues) => void): this;
|
|
23
|
+
on(
|
|
24
|
+
e: 'reload_failure',
|
|
25
|
+
fn: (source: ConfigSource, err: ConfigSourceException) => void,
|
|
26
|
+
): this;
|
|
27
|
+
on(e: 'merge', fn: (source: ConfigSource, changes: Changes) => void): this;
|
|
28
|
+
on(e: 'update', fn: (section: Config, keys: string[]) => void): this;
|
|
29
|
+
on(
|
|
30
|
+
e: 'update_failure',
|
|
31
|
+
fn: (section: Config, err: PropertyException) => void,
|
|
32
|
+
): this;
|
|
33
|
+
|
|
34
|
+
emit(e: 'reload', source: ConfigSource, values: RawValues): boolean;
|
|
35
|
+
emit(
|
|
36
|
+
e: 'reload_failure',
|
|
37
|
+
source: ConfigSource,
|
|
38
|
+
err: ConfigSourceException,
|
|
39
|
+
): boolean;
|
|
40
|
+
emit(e: 'merge', source: ConfigSource, changes: Changes): boolean;
|
|
41
|
+
emit(e: 'update', section: Config, keys: string[]): boolean;
|
|
42
|
+
emit(e: 'update_failure', section: Config, err: PropertyException): boolean;
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './config-reload.events';
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { isPrimitive, isRecord } from '@rsdk/common';
|
|
2
|
+
|
|
3
|
+
import type { RawConfigValue, RawValues, SourceType } from '../../types';
|
|
4
|
+
import { ConfigSourceException } from '../exceptions';
|
|
5
|
+
|
|
6
|
+
export abstract class ConfigSource {
|
|
7
|
+
/**
|
|
8
|
+
* Wrapped .loadRaw() method which should be implemented in
|
|
9
|
+
* derived class and enforces basic validation and error transforming.
|
|
10
|
+
*
|
|
11
|
+
* NOTE: Guarantees that only ConfigSourceException can't be thrown
|
|
12
|
+
* @returns Promise<Vars>
|
|
13
|
+
*/
|
|
14
|
+
async load(): Promise<RawValues> {
|
|
15
|
+
try {
|
|
16
|
+
/**
|
|
17
|
+
* Need to handle error on reload because
|
|
18
|
+
* otherwise application will go down (just as
|
|
19
|
+
* on reading step)
|
|
20
|
+
*
|
|
21
|
+
* TODO: Add negative health check when last
|
|
22
|
+
* 3 configuration updates fail
|
|
23
|
+
*/
|
|
24
|
+
const raw = await this.loadRaw();
|
|
25
|
+
|
|
26
|
+
return this.flattenEndValidate(raw);
|
|
27
|
+
} catch (err) {
|
|
28
|
+
if (err instanceof ConfigSourceException) {
|
|
29
|
+
throw err;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
throw new ConfigSourceException(
|
|
33
|
+
'Failed to load configuration from file',
|
|
34
|
+
err as Error,
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Flattens raw configuration and validates that each property is
|
|
41
|
+
* either primitive or array of primitives.
|
|
42
|
+
*
|
|
43
|
+
* @param obj Raw configuration object obtained from source
|
|
44
|
+
* @param prefix recursive calls chain path in for of string
|
|
45
|
+
* @returns Vars
|
|
46
|
+
*/
|
|
47
|
+
private flattenEndValidate(obj: unknown, prefix = ''): RawValues {
|
|
48
|
+
if (!isRecord(obj)) {
|
|
49
|
+
throw new ConfigSourceException(
|
|
50
|
+
prefix
|
|
51
|
+
? `Value at key: ${prefix} should be an object, primitive or array of primitives`
|
|
52
|
+
: `Value at root sould be an object`,
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return Object.entries(obj).reduce((acc: RawValues, [key, value]) => {
|
|
57
|
+
if (isPrimitive(value)) {
|
|
58
|
+
acc.set(key, value);
|
|
59
|
+
|
|
60
|
+
return acc;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const pre = (prefix.length > 0 ? `${prefix}.` : '') + key;
|
|
64
|
+
|
|
65
|
+
if (Array.isArray(value)) {
|
|
66
|
+
if (!value.every(isPrimitive)) {
|
|
67
|
+
throw new ConfigSourceException(`Non primitive array at key: ${pre}`);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
acc.set(key, value);
|
|
71
|
+
|
|
72
|
+
return acc;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Value is not primitive and is not array which means
|
|
77
|
+
* it is object. So: do recursion
|
|
78
|
+
*/
|
|
79
|
+
for (const [key, v] of this.flattenEndValidate(value, pre).entries()) {
|
|
80
|
+
acc.set(key, v);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return acc;
|
|
84
|
+
}, new Map<string, RawConfigValue>());
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
abstract name(): string;
|
|
88
|
+
abstract type(): SourceType;
|
|
89
|
+
abstract loadRaw(): Promise<unknown>;
|
|
90
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ILogger } from '@rsdk/logging';
|
|
2
|
+
|
|
3
|
+
import { ReloadEvents } from '../../reload';
|
|
4
|
+
import type { SourceType } from '../../types';
|
|
5
|
+
|
|
6
|
+
import { ConfigSource } from './config-source.abstract';
|
|
7
|
+
|
|
8
|
+
export abstract class ReloadableConfigSource extends ConfigSource {
|
|
9
|
+
protected readonly logger: ILogger;
|
|
10
|
+
private readonly events = ReloadEvents.getInstance();
|
|
11
|
+
|
|
12
|
+
constructor(logger: ILogger) {
|
|
13
|
+
super();
|
|
14
|
+
this.logger = logger;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
type(): SourceType {
|
|
18
|
+
return 'reloadable';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async reload(): Promise<void> {
|
|
22
|
+
try {
|
|
23
|
+
const vars = await this.load();
|
|
24
|
+
|
|
25
|
+
this.events.emit('reload', this, vars);
|
|
26
|
+
} catch (err: any) {
|
|
27
|
+
this.logger.error(
|
|
28
|
+
`Failed to reload configuration (${this.constructor.name})`,
|
|
29
|
+
err,
|
|
30
|
+
);
|
|
31
|
+
this.events.emit('reload_failure', this, err);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
abstract init(): void;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const isReloadable = (s: ConfigSource): s is ReloadableConfigSource =>
|
|
39
|
+
s.type() === 'reloadable';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/ban-types */
|
|
2
|
+
import type { Constructor } from '@rsdk/common';
|
|
3
|
+
|
|
4
|
+
import { ConfigMetadataRegistry } from '../metadata';
|
|
5
|
+
import type { SourceType } from '../types';
|
|
6
|
+
|
|
7
|
+
const SOURCE_METADATA_KEY = 'CONFIG_SOURCE_METADATA_KEY';
|
|
8
|
+
|
|
9
|
+
export interface SourceOptions {
|
|
10
|
+
description?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const DEFAULT_OPTIONS = {};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* This decorator is used to register additional configuration
|
|
18
|
+
* sourcePropertyParser
|
|
19
|
+
* @param options Metadata used mostly for docs generation
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
export const Source = (
|
|
23
|
+
type: SourceType,
|
|
24
|
+
options: SourceOptions = {},
|
|
25
|
+
): ClassDecorator => {
|
|
26
|
+
return function (target: Function): void {
|
|
27
|
+
const name = options.name || target.name;
|
|
28
|
+
const effectiveOptions = { ...DEFAULT_OPTIONS, ...options, name, type };
|
|
29
|
+
|
|
30
|
+
Reflect.defineMetadata(SOURCE_METADATA_KEY, effectiveOptions, target);
|
|
31
|
+
|
|
32
|
+
ConfigMetadataRegistry.registerSource(
|
|
33
|
+
target as Constructor,
|
|
34
|
+
effectiveOptions,
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Constructor, text } from '@rsdk/common';
|
|
2
|
+
|
|
3
|
+
import { BootstrapException, Exception } from '../../../exceptions';
|
|
4
|
+
import type { ConfigSource } from '../base';
|
|
5
|
+
|
|
6
|
+
@Exception({
|
|
7
|
+
description: text`
|
|
8
|
+
Wrong usage of DI in custom configuration source.
|
|
9
|
+
See @rsdk/core docs.
|
|
10
|
+
`,
|
|
11
|
+
})
|
|
12
|
+
export class ConfigSourceDIException extends BootstrapException {
|
|
13
|
+
constructor(source: Constructor<ConfigSource>, param: unknown) {
|
|
14
|
+
super(text`
|
|
15
|
+
Only standalone properties (from env) and some special values (ex. application name)
|
|
16
|
+
can be injected into ConfigSource constructor. You are trying to inject
|
|
17
|
+
<${param}> to ${source.constructor.name}.
|
|
18
|
+
`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { readObj } from '@rsdk/common';
|
|
2
|
+
|
|
3
|
+
import { DeclareProperty, InjectProperty } from '../../metadata';
|
|
4
|
+
import { FsPathParser } from '../../parsers';
|
|
5
|
+
import type { SourceType } from '../../types';
|
|
6
|
+
import { ConfigSource } from '../base';
|
|
7
|
+
import { Source } from '../config-source.decorator';
|
|
8
|
+
|
|
9
|
+
@Source('static')
|
|
10
|
+
@DeclareProperty(`CONFIG_PATH`, new FsPathParser('file'), {
|
|
11
|
+
description: 'Path to some configuration file',
|
|
12
|
+
})
|
|
13
|
+
export class StaticFileSource extends ConfigSource {
|
|
14
|
+
constructor(@InjectProperty('CONFIG_PATH') private readonly path: string) {
|
|
15
|
+
super();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
override type(): SourceType {
|
|
19
|
+
return 'static';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
override name(): string {
|
|
23
|
+
return `Static conf file: ${this.path}`;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
override loadRaw(): Promise<unknown> {
|
|
27
|
+
return readObj(this.path);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { watch } from 'fs';
|
|
2
|
+
|
|
3
|
+
import { readObj } from '@rsdk/common';
|
|
4
|
+
import { LoggerFactory } from '@rsdk/logging';
|
|
5
|
+
|
|
6
|
+
import { DeclareProperty, InjectProperty } from '../../metadata';
|
|
7
|
+
import { FsPathParser } from '../../parsers';
|
|
8
|
+
import { ReloadableConfigSource } from '../base';
|
|
9
|
+
import { Source } from '../config-source.decorator';
|
|
10
|
+
|
|
11
|
+
@Source('reloadable')
|
|
12
|
+
@DeclareProperty('CONFIG_PATH', new FsPathParser('file'), {
|
|
13
|
+
description: 'Path to some configuration file',
|
|
14
|
+
})
|
|
15
|
+
export class ReloadableFileSource extends ReloadableConfigSource {
|
|
16
|
+
constructor(@InjectProperty('CONFIG_PATH') private readonly path: string) {
|
|
17
|
+
super(LoggerFactory.create(ReloadableFileSource));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
override name(): string {
|
|
21
|
+
return `Configuration file: ${this.path}`;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
override loadRaw(): Promise<unknown> {
|
|
25
|
+
return readObj(this.path);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
override init(): void {
|
|
29
|
+
watch(this.path, (event) => {
|
|
30
|
+
if (event !== 'change') {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
this.logger.info('Changes detected', { source: this.name });
|
|
35
|
+
|
|
36
|
+
this.reload();
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { EnumValue, Primitive, Size, Timespan } from '@rsdk/common';
|
|
2
|
+
|
|
3
|
+
export type SourceType = 'static' | 'reloadable';
|
|
4
|
+
export type RawConfigValue = Primitive | Primitive[];
|
|
5
|
+
|
|
6
|
+
export type SingleConfigValue =
|
|
7
|
+
| string
|
|
8
|
+
| number
|
|
9
|
+
| boolean
|
|
10
|
+
| Timespan
|
|
11
|
+
| Size
|
|
12
|
+
| EnumValue
|
|
13
|
+
| URL;
|
|
14
|
+
|
|
15
|
+
export type ConfigValue = SingleConfigValue | SingleConfigValue[];
|
|
16
|
+
|
|
17
|
+
export interface Changes {
|
|
18
|
+
createdKeys: string[];
|
|
19
|
+
updatedKeys: string[];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface PropertyOptions<T extends ConfigValue> {
|
|
23
|
+
/**
|
|
24
|
+
* Description of configuration property. Will automatically
|
|
25
|
+
* appear in documentation.
|
|
26
|
+
*/
|
|
27
|
+
description: string;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Providing default value for property effectively makes it optional
|
|
31
|
+
*/
|
|
32
|
+
defaultValue?: T | undefined;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface PropertyMetadata<T extends ConfigValue = ConfigValue> {
|
|
36
|
+
key: string;
|
|
37
|
+
parser: PropertyParser<T>;
|
|
38
|
+
description: string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Expect that this property will be in env, not in extra source.
|
|
42
|
+
*/
|
|
43
|
+
expectedInEnv: boolean;
|
|
44
|
+
defaultValue?: T | undefined;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface SectionMetadata {
|
|
48
|
+
name: string;
|
|
49
|
+
// TODO: Why use Record instead of map here
|
|
50
|
+
// TODO: Why symbol here
|
|
51
|
+
properties: Record<string | symbol, PropertyMetadata>;
|
|
52
|
+
description?: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface SourceMetadata {
|
|
56
|
+
type: SourceType;
|
|
57
|
+
name: string;
|
|
58
|
+
description?: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface ParserMetadata {
|
|
62
|
+
type: string;
|
|
63
|
+
description: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Implement this interface to create more parsers.
|
|
68
|
+
* For example: email, BigInt, guid etc.
|
|
69
|
+
*
|
|
70
|
+
* NOTE: In other modules it is more common to define metadata
|
|
71
|
+
* via decorators. But this case is a bit different.
|
|
72
|
+
*
|
|
73
|
+
* 1. Parser implementations can have constructors with parameters
|
|
74
|
+
* which will affect it's behaviour. It's will be nice to have it
|
|
75
|
+
* in metadata, and decorators won't provide this.
|
|
76
|
+
*
|
|
77
|
+
* 2. Metadata will be extracted via type() and description() methods
|
|
78
|
+
* mostly during decorator factories (such as @Property()) code is
|
|
79
|
+
* executed. Thus output **can** be used in autodoc
|
|
80
|
+
*/
|
|
81
|
+
export interface PropertyParser<T extends ConfigValue = ConfigValue> {
|
|
82
|
+
type(): string;
|
|
83
|
+
description(): string;
|
|
84
|
+
parse(value: RawConfigValue): T;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export type RawValues = Map<string, RawConfigValue>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { cloneDeep, isEqual } from 'lodash';
|
|
2
|
+
|
|
3
|
+
import { PropertyException } from './exceptions';
|
|
4
|
+
import type {
|
|
5
|
+
Changes,
|
|
6
|
+
ConfigValue,
|
|
7
|
+
PropertyMetadata,
|
|
8
|
+
RawConfigValue,
|
|
9
|
+
RawValues,
|
|
10
|
+
} from './types';
|
|
11
|
+
|
|
12
|
+
export enum SetResult {
|
|
13
|
+
CREATED,
|
|
14
|
+
UPDATED,
|
|
15
|
+
UNCHANGED,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export class Vars {
|
|
19
|
+
private readonly values = new Map<string, RawConfigValue>();
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Expecting prefix is already converted to upper snake case
|
|
23
|
+
* @param prefix
|
|
24
|
+
*/
|
|
25
|
+
constructor(private readonly prefix: string) {}
|
|
26
|
+
|
|
27
|
+
set(key: string, value: RawConfigValue): [SetResult, string] {
|
|
28
|
+
const preparedKey = this.toUpperSnakeCase(key);
|
|
29
|
+
const preparedValue = Array.isArray(value)
|
|
30
|
+
? cloneDeep(value).sort()
|
|
31
|
+
: value;
|
|
32
|
+
|
|
33
|
+
const existing = this.values.get(preparedKey);
|
|
34
|
+
|
|
35
|
+
if (existing === undefined) {
|
|
36
|
+
this.values.set(preparedKey, preparedValue);
|
|
37
|
+
|
|
38
|
+
return [SetResult.CREATED, preparedKey];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (isEqual(preparedValue, existing)) {
|
|
42
|
+
return [SetResult.UNCHANGED, preparedKey];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
this.values.set(preparedKey, preparedValue);
|
|
46
|
+
|
|
47
|
+
return [SetResult.UPDATED, preparedKey];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
merge(values: RawValues): Changes {
|
|
51
|
+
const createdKeys: string[] = [];
|
|
52
|
+
const updatedKeys: string[] = [];
|
|
53
|
+
|
|
54
|
+
for (const [key, value] of values.entries()) {
|
|
55
|
+
const [result, preparedKey] = this.set(key, value);
|
|
56
|
+
|
|
57
|
+
switch (result) {
|
|
58
|
+
case SetResult.CREATED:
|
|
59
|
+
createdKeys.push(preparedKey);
|
|
60
|
+
|
|
61
|
+
break;
|
|
62
|
+
case SetResult.UPDATED:
|
|
63
|
+
updatedKeys.push(preparedKey);
|
|
64
|
+
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return { createdKeys, updatedKeys };
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
extract<T extends ConfigValue>(propMeta: PropertyMetadata<T>): T | undefined {
|
|
73
|
+
const { key, parser } = propMeta;
|
|
74
|
+
const preparedKey = this.toUpperSnakeCase(key);
|
|
75
|
+
|
|
76
|
+
const withPrefix = this.prefix
|
|
77
|
+
? `${this.toUpperSnakeCase(this.prefix)}_${preparedKey}`
|
|
78
|
+
: preparedKey;
|
|
79
|
+
|
|
80
|
+
const raw = this.values.get(withPrefix) ?? this.values.get(preparedKey);
|
|
81
|
+
|
|
82
|
+
if (raw === undefined) {
|
|
83
|
+
if ('defaultValue' in propMeta) {
|
|
84
|
+
return propMeta.defaultValue;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
throw new PropertyException(
|
|
88
|
+
preparedKey,
|
|
89
|
+
'No value by key ' + propMeta.key + ' was provided!',
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
try {
|
|
94
|
+
return parser.parse(raw);
|
|
95
|
+
} catch (err) {
|
|
96
|
+
throw PropertyException.fromError(err, preparedKey);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
private toUpperSnakeCase(key: string): string {
|
|
101
|
+
return key.replace(/[^a-zA-Z0-9]+/g, '_').toUpperCase();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ExceptionsProps } from './platform-exception.absract';
|
|
2
|
+
import { PlatformException } from './platform-exception.absract';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Bootstrap exception is one that happens on application
|
|
6
|
+
* startup (bootstrap). Exceptions of this kind should kill the
|
|
7
|
+
* application completely.
|
|
8
|
+
*/
|
|
9
|
+
export abstract class BootstrapException extends PlatformException {
|
|
10
|
+
/**
|
|
11
|
+
* @param kind kind of pipeline error
|
|
12
|
+
* @param message error message
|
|
13
|
+
* @param props additional properties
|
|
14
|
+
*/
|
|
15
|
+
constructor(message: string, props?: ExceptionsProps) {
|
|
16
|
+
const { code, ...other } = props || {};
|
|
17
|
+
|
|
18
|
+
super(code ?? `BOOTSTRAP`, message, other);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ExceptionKind } from '../types';
|
|
2
|
+
|
|
3
|
+
import type { ExceptionsProps } from './platform-exception.absract';
|
|
4
|
+
import { PlatformException } from './platform-exception.absract';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* PipelineException is exception that occurs during request
|
|
8
|
+
* or event handling. In both cases it raises inside Nest.js
|
|
9
|
+
* pipeline and is meant to be caught by GlobalExceptionsFilter
|
|
10
|
+
*/
|
|
11
|
+
export abstract class PipelineException extends PlatformException {
|
|
12
|
+
/**
|
|
13
|
+
* All pipeline exceptions have "kind" field which allows to
|
|
14
|
+
* map them to any specific transport exception.
|
|
15
|
+
*/
|
|
16
|
+
readonly kind: ExceptionKind;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @param kind kind of pipeline error
|
|
20
|
+
* @param message error message
|
|
21
|
+
* @param props additional properties
|
|
22
|
+
*/
|
|
23
|
+
constructor(kind: ExceptionKind, message: string, props?: ExceptionsProps) {
|
|
24
|
+
const { code, ...other } = props || {};
|
|
25
|
+
|
|
26
|
+
super(code ?? `KIND:${ExceptionKind[kind]}`, message, other);
|
|
27
|
+
this.kind = kind;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export type ExceptionCode = string | number;
|
|
2
|
+
|
|
3
|
+
export interface ExceptionsProps<T = any> {
|
|
4
|
+
/**
|
|
5
|
+
* Custom exception code
|
|
6
|
+
*/
|
|
7
|
+
code?: ExceptionCode | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* Wrapped original error
|
|
10
|
+
*/
|
|
11
|
+
cause?: Error | undefined;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Additional structured details
|
|
15
|
+
*/
|
|
16
|
+
details?: T | undefined;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Every error thrown in platform based application
|
|
21
|
+
* should be derivitives of PlatformException. This doesn't
|
|
22
|
+
* mean that thowing just new Error() will ruin production.
|
|
23
|
+
* But there will be no automatic nice handling in this case.
|
|
24
|
+
*/
|
|
25
|
+
export abstract class PlatformException<T = any> extends Error {
|
|
26
|
+
/**
|
|
27
|
+
* Class name of exception
|
|
28
|
+
*/
|
|
29
|
+
readonly metatype: string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Required!
|
|
33
|
+
*/
|
|
34
|
+
readonly code: ExceptionCode;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* PlatformException has ability to wrap original errors. Such an option exists
|
|
38
|
+
* in many other languages and frameworks: .NET, Java, Go etc.
|
|
39
|
+
*/
|
|
40
|
+
readonly cause: Error | undefined;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Any custom attributes developer is willing to
|
|
44
|
+
* attach. Very useful for creating structured validation
|
|
45
|
+
* errors
|
|
46
|
+
*/
|
|
47
|
+
readonly details: T | undefined;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @param message error message
|
|
51
|
+
* @param props additional properties
|
|
52
|
+
*/
|
|
53
|
+
constructor(
|
|
54
|
+
code: ExceptionCode,
|
|
55
|
+
message: string,
|
|
56
|
+
props?: Omit<ExceptionsProps<T>, 'code'>,
|
|
57
|
+
) {
|
|
58
|
+
super(message);
|
|
59
|
+
this.metatype = this.constructor.name;
|
|
60
|
+
this.code = code;
|
|
61
|
+
this.cause = props?.cause;
|
|
62
|
+
this.details = props?.details;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
static innerMessages(ex: Error): string[] {
|
|
66
|
+
if (!ex || !(ex instanceof PlatformException) || !ex.cause) {
|
|
67
|
+
return [];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return [ex.cause.message, ...PlatformException.innerMessages(ex.cause)];
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { text } from '@rsdk/common';
|
|
2
|
+
|
|
3
|
+
import { BootstrapException } from '../../base';
|
|
4
|
+
import { Exception } from '../../metadata';
|
|
5
|
+
|
|
6
|
+
@Exception({
|
|
7
|
+
description: text`
|
|
8
|
+
Means that some provider or other object that registered or
|
|
9
|
+
initialized twice.
|
|
10
|
+
`,
|
|
11
|
+
})
|
|
12
|
+
export class DoubleInitException extends BootstrapException {
|
|
13
|
+
constructor(type: string, name: string, hint?: string) {
|
|
14
|
+
const parts = [`${type} <${name}> is already registered or initialized!`];
|
|
15
|
+
if (hint) {
|
|
16
|
+
parts.push(`Hint: ${hint}`);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
super(parts.join(' '));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { text } from '@rsdk/common';
|
|
2
|
+
|
|
3
|
+
import { BootstrapException } from '../../base';
|
|
4
|
+
import { Exception } from '../../metadata';
|
|
5
|
+
|
|
6
|
+
@Exception({
|
|
7
|
+
description: text`
|
|
8
|
+
Means that you added more than one transport implementations
|
|
9
|
+
for one protocol.
|
|
10
|
+
`,
|
|
11
|
+
})
|
|
12
|
+
export class DuplicateProtocolException extends BootstrapException {
|
|
13
|
+
constructor(protocol: string, duplicates: number) {
|
|
14
|
+
super(text`
|
|
15
|
+
You should provide only one transport for each protocol.
|
|
16
|
+
Protocol ${protocol} has ${duplicates} implementations!
|
|
17
|
+
`);
|
|
18
|
+
}
|
|
19
|
+
}
|