@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,8 @@
|
|
|
1
|
+
export * from './unknown-bootstrap.exception';
|
|
2
|
+
export * from './no-http.exception';
|
|
3
|
+
export * from './duplicate-protocol.exception';
|
|
4
|
+
export * from './no-matching-transport.exception';
|
|
5
|
+
export * from './sequence.exception';
|
|
6
|
+
export * from './double-init.exception';
|
|
7
|
+
export * from './no-init.exception';
|
|
8
|
+
export * from './symbol-key-decoration.exception';
|
|
@@ -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 you use some HTTP routing decorators (ex: Get, Post etc.)
|
|
9
|
+
but there is no HTTP-tranport in you application.
|
|
10
|
+
`,
|
|
11
|
+
})
|
|
12
|
+
export class NoHttpException extends BootstrapException {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(text`
|
|
15
|
+
It is impossible to register HTTP route because there is
|
|
16
|
+
no HTTP-transport in your application. Please add
|
|
17
|
+
HTTP-transport or remove HTTP routing decorators:
|
|
18
|
+
@Get(), @Post(), @Put(), etc.
|
|
19
|
+
`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -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 were called
|
|
9
|
+
was not registered properly.
|
|
10
|
+
`,
|
|
11
|
+
})
|
|
12
|
+
export class NoInitException extends BootstrapException {
|
|
13
|
+
constructor(type: string, name: string, hint?: string) {
|
|
14
|
+
const parts = [`${type} <${name}> is not registered/initialized!`];
|
|
15
|
+
if (hint) {
|
|
16
|
+
parts.push(`Hint: ${hint}`);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
super(parts.join(' '));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { text } from '@rsdk/common';
|
|
2
|
+
|
|
3
|
+
import { PlatformAppPlugin } from '../../../types';
|
|
4
|
+
import { BootstrapException } from '../../base';
|
|
5
|
+
import { Exception } from '../../metadata';
|
|
6
|
+
|
|
7
|
+
@Exception({
|
|
8
|
+
description: text`
|
|
9
|
+
Plugins are attached to transports. This exception means that
|
|
10
|
+
there is no appropriate tranport for the plugin you are trying
|
|
11
|
+
to attach.
|
|
12
|
+
`,
|
|
13
|
+
})
|
|
14
|
+
export class NoMatchingTransportException extends BootstrapException {
|
|
15
|
+
constructor(plugin: PlatformAppPlugin<Readonly<string[]>>) {
|
|
16
|
+
const name = plugin.constructor.name;
|
|
17
|
+
const transports = plugin.forTransports().join(', ');
|
|
18
|
+
|
|
19
|
+
super(text`
|
|
20
|
+
Plugin ${name} requires one of the following transports:
|
|
21
|
+
${transports} (no one is supported by the app).
|
|
22
|
+
`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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 bootstrap operations were mixed in wrong
|
|
9
|
+
order or were repeated incorrectly.
|
|
10
|
+
`,
|
|
11
|
+
})
|
|
12
|
+
export class SequenceException extends BootstrapException {
|
|
13
|
+
constructor(message: string) {
|
|
14
|
+
super(message, { code: 'SEQUENCE' });
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { text } from '@rsdk/common';
|
|
2
|
+
|
|
3
|
+
import { BootstrapException } from '../../base';
|
|
4
|
+
import { Exception } from '../../metadata';
|
|
5
|
+
|
|
6
|
+
@Exception({
|
|
7
|
+
description: text`
|
|
8
|
+
Occurs when decorator is applied to non string (symbol) property/method.
|
|
9
|
+
`,
|
|
10
|
+
})
|
|
11
|
+
export class SymbolKeyDecorationException extends BootstrapException {
|
|
12
|
+
constructor() {
|
|
13
|
+
super("Can't apply decorator to property or method with symbol key");
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BootstrapException } from '../../base';
|
|
2
|
+
import { Exception } from '../../metadata';
|
|
3
|
+
|
|
4
|
+
@Exception({
|
|
5
|
+
description: 'Something fatal happened on rsdk app intialization phase',
|
|
6
|
+
})
|
|
7
|
+
export class UnknownBootstrapException extends BootstrapException {
|
|
8
|
+
constructor(message: string, cause?: Error) {
|
|
9
|
+
super(`Failed to init rsdk app: ${message}`, { cause });
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { text } from '@rsdk/common';
|
|
2
|
+
|
|
3
|
+
import { ExceptionsProps, PipelineException } from '../../base';
|
|
4
|
+
import { Exception } from '../../metadata';
|
|
5
|
+
import { ExceptionKind } from '../../types';
|
|
6
|
+
|
|
7
|
+
@Exception({
|
|
8
|
+
description: text`
|
|
9
|
+
General AuthenticationException. Means that system was unable to
|
|
10
|
+
recognize user or credentials are invalid.
|
|
11
|
+
|
|
12
|
+
Will be translated into 401 (Unauthorized) in HTTP
|
|
13
|
+
or into 16 (UNAUTHENTICATED) in gRPC context.
|
|
14
|
+
`,
|
|
15
|
+
})
|
|
16
|
+
export class AuthException extends PipelineException {
|
|
17
|
+
constructor(message: string, props: ExceptionsProps = {}) {
|
|
18
|
+
super(ExceptionKind.AUTHENTICATION, message, props);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { text } from '@rsdk/common';
|
|
2
|
+
|
|
3
|
+
import { ExceptionsProps, PipelineException } from '../../base';
|
|
4
|
+
import { Exception } from '../../metadata';
|
|
5
|
+
import { ExceptionKind } from '../../types';
|
|
6
|
+
|
|
7
|
+
@Exception({
|
|
8
|
+
description: text`
|
|
9
|
+
General ConflictException. Means that request was correct by itself, but
|
|
10
|
+
business rules doesn't allow to peform operation. When it's appropriate
|
|
11
|
+
use DuplicateEntityException instead (more specific)
|
|
12
|
+
|
|
13
|
+
Will be translated into 409 (Conflict) in HTTP (just as DuplicateEntityException)
|
|
14
|
+
or into 9 (FAILED_PRECONDITION) in gRPC context.
|
|
15
|
+
`,
|
|
16
|
+
})
|
|
17
|
+
export class ConflictException extends PipelineException {
|
|
18
|
+
constructor(message: string, props: ExceptionsProps = {}) {
|
|
19
|
+
super(ExceptionKind.CONFLICT, message, props);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { text } from '@rsdk/common';
|
|
2
|
+
|
|
3
|
+
import { ExceptionsProps, PipelineException } from '../../base';
|
|
4
|
+
import { Exception } from '../../metadata';
|
|
5
|
+
import { ExceptionKind } from '../../types';
|
|
6
|
+
|
|
7
|
+
@Exception({
|
|
8
|
+
description: text`
|
|
9
|
+
General DuplicateEntityException. Means that requested operation
|
|
10
|
+
will lead to duplication, which is forbidden by business rules.
|
|
11
|
+
|
|
12
|
+
Will be translated into 409 (Conflict) in HTTP (just as ConflictException)
|
|
13
|
+
or into (ALREADY_EXISTS) in gRPC context.
|
|
14
|
+
`,
|
|
15
|
+
})
|
|
16
|
+
export class DuplicateEntityException extends PipelineException {
|
|
17
|
+
constructor(message: string, props: ExceptionsProps = {}) {
|
|
18
|
+
super(ExceptionKind.DUPLICATION, message, props);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './authentication.exception';
|
|
2
|
+
export * from './conflict.exception';
|
|
3
|
+
export * from './duplicate-entity.exception';
|
|
4
|
+
export * from './input.exception';
|
|
5
|
+
export * from './internal.exception';
|
|
6
|
+
export * from './not-allowed.exception';
|
|
7
|
+
export * from './not-found.exception';
|
|
8
|
+
export * from './timeout.exception';
|
|
9
|
+
export * from './validation.exception';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { text } from '@rsdk/common';
|
|
2
|
+
|
|
3
|
+
import { ExceptionsProps, PipelineException } from '../../base';
|
|
4
|
+
import { Exception } from '../../metadata';
|
|
5
|
+
import { ExceptionKind } from '../../types';
|
|
6
|
+
|
|
7
|
+
@Exception({
|
|
8
|
+
description: text`
|
|
9
|
+
General InputException. Means that user input was incorrect.
|
|
10
|
+
It could be called ValidationException as well.
|
|
11
|
+
|
|
12
|
+
Will be translated into 400 (BadRequest) in HTTP
|
|
13
|
+
or into 3 (INVALID_ARGUMENT) in gRPC context.
|
|
14
|
+
`,
|
|
15
|
+
})
|
|
16
|
+
export class InputException extends PipelineException {
|
|
17
|
+
constructor(message: string, props: ExceptionsProps = {}) {
|
|
18
|
+
super(ExceptionKind.INPUT, message, props);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { text } from '@rsdk/common';
|
|
2
|
+
|
|
3
|
+
import { ExceptionsProps, PipelineException } from '../../base';
|
|
4
|
+
import { Exception } from '../../metadata';
|
|
5
|
+
import { ExceptionKind } from '../../types';
|
|
6
|
+
|
|
7
|
+
@Exception({
|
|
8
|
+
description: text`
|
|
9
|
+
General InternalException. Something happened which was caused by internal
|
|
10
|
+
problems (user did everything right).
|
|
11
|
+
|
|
12
|
+
Will be translated into 500 (Internal) in HTTP
|
|
13
|
+
or into 13 (INTERNAL) in gRPC context.
|
|
14
|
+
`,
|
|
15
|
+
})
|
|
16
|
+
export class InternalException extends PipelineException {
|
|
17
|
+
constructor(message: string, props: ExceptionsProps = {}) {
|
|
18
|
+
super(ExceptionKind.INTERNAL, message, props);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { text } from '@rsdk/common';
|
|
2
|
+
|
|
3
|
+
import { ExceptionsProps, PipelineException } from '../../base';
|
|
4
|
+
import { Exception } from '../../metadata';
|
|
5
|
+
import { ExceptionKind } from '../../types';
|
|
6
|
+
|
|
7
|
+
@Exception({
|
|
8
|
+
description: text`
|
|
9
|
+
General NotAllowedException. Means that this user can't access specific
|
|
10
|
+
resource or functionality.
|
|
11
|
+
|
|
12
|
+
Will be translated into 403 (Forbidden) in HTTP
|
|
13
|
+
or into 7 (PERMISSION_DENIED) in gRPC context.
|
|
14
|
+
`,
|
|
15
|
+
})
|
|
16
|
+
export class NotAllowedException extends PipelineException {
|
|
17
|
+
constructor(message: string, props: ExceptionsProps = {}) {
|
|
18
|
+
super(ExceptionKind.NOT_ALLOWED, message, props);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { text } from '@rsdk/common';
|
|
2
|
+
|
|
3
|
+
import { ExceptionsProps, PipelineException } from '../../base';
|
|
4
|
+
import { Exception } from '../../metadata';
|
|
5
|
+
import { ExceptionKind } from '../../types';
|
|
6
|
+
|
|
7
|
+
@Exception({
|
|
8
|
+
description: text`
|
|
9
|
+
General NotFoundException. It's recommended to create more specific
|
|
10
|
+
exceptions by deriving BaseException class.
|
|
11
|
+
|
|
12
|
+
Will be translated into 404 (NotFound) in HTTP
|
|
13
|
+
or into 5 (NOT_FOUND) in gRPC context.
|
|
14
|
+
`,
|
|
15
|
+
})
|
|
16
|
+
export class NotFoundException extends PipelineException {
|
|
17
|
+
constructor(message: string, props: ExceptionsProps = {}) {
|
|
18
|
+
super(ExceptionKind.NOT_FOUND, message, props);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { text } from '@rsdk/common';
|
|
2
|
+
|
|
3
|
+
import { ExceptionsProps, PipelineException } from '../../base';
|
|
4
|
+
import { Exception } from '../../metadata';
|
|
5
|
+
import { ExceptionKind } from '../../types';
|
|
6
|
+
|
|
7
|
+
@Exception({
|
|
8
|
+
description: text`
|
|
9
|
+
General TimeoutException.
|
|
10
|
+
|
|
11
|
+
Will be translated into 408 (Request Timeout) in HTTP
|
|
12
|
+
or into 4 (DEADLINE_EXCEEDED) in gRPC context.
|
|
13
|
+
`,
|
|
14
|
+
})
|
|
15
|
+
export class TimeoutException extends PipelineException {
|
|
16
|
+
constructor(message: string, props: ExceptionsProps = {}) {
|
|
17
|
+
super(ExceptionKind.TIMEOUT, message, props);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ExceptionMetadata } from '../exceptions.registry';
|
|
2
|
+
import { ExceptionsRegistry } from '../exceptions.registry';
|
|
3
|
+
|
|
4
|
+
export const Exception = (metadata: ExceptionMetadata): ClassDecorator => {
|
|
5
|
+
// TODO: таргет нужно использовать при регистрации!
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7
|
+
return function (target: object): void {
|
|
8
|
+
ExceptionsRegistry.getInstance().register(metadata);
|
|
9
|
+
};
|
|
10
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Constructor } from '@rsdk/common';
|
|
2
|
+
import { LoggerFactory } from '@rsdk/logging';
|
|
3
|
+
|
|
4
|
+
import type { PipelineException } from '../../base';
|
|
5
|
+
import { ExceptionsRegistry } from '../exceptions.registry';
|
|
6
|
+
|
|
7
|
+
const logger = LoggerFactory.create('ExceptionsRegistry');
|
|
8
|
+
|
|
9
|
+
export const Throws = (
|
|
10
|
+
...ex: Constructor<PipelineException>[]
|
|
11
|
+
): MethodDecorator => {
|
|
12
|
+
return function (ctor: object, methodName: string | symbol) {
|
|
13
|
+
logger.debug(
|
|
14
|
+
`Method ${ctor.constructor.name}.${methodName.toString()} throws: ${ex
|
|
15
|
+
.map((x) => x.name)
|
|
16
|
+
.join(', ')}`,
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
ExceptionsRegistry.getInstance().register({
|
|
20
|
+
class: ctor.constructor,
|
|
21
|
+
exceptions: ex,
|
|
22
|
+
method: methodName.toString(),
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Constructor } from '@rsdk/common';
|
|
2
|
+
|
|
3
|
+
import type { PipelineException } from '../base';
|
|
4
|
+
|
|
5
|
+
export interface ExceptionMetadata {
|
|
6
|
+
description: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface ThrowsMetadata {
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
11
|
+
class: Function;
|
|
12
|
+
method: string;
|
|
13
|
+
exceptions: Constructor<PipelineException>[];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const isExceptionMeta = (
|
|
17
|
+
arg: ExceptionMetadata | ThrowsMetadata,
|
|
18
|
+
): arg is ExceptionMetadata => !!(arg as any).description;
|
|
19
|
+
|
|
20
|
+
export class ExceptionsRegistry {
|
|
21
|
+
private static _instance: ExceptionsRegistry;
|
|
22
|
+
|
|
23
|
+
private exceptions: ExceptionMetadata[] = [];
|
|
24
|
+
private throws: ThrowsMetadata[] = [];
|
|
25
|
+
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
27
|
+
private constructor() {}
|
|
28
|
+
|
|
29
|
+
static getInstance(): ExceptionsRegistry {
|
|
30
|
+
if (!this._instance) {
|
|
31
|
+
this._instance = new ExceptionsRegistry();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return this._instance;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
register(meta: ThrowsMetadata): void;
|
|
38
|
+
register(meta: ExceptionMetadata): void;
|
|
39
|
+
register(meta: ThrowsMetadata | ExceptionMetadata): void {
|
|
40
|
+
if (isExceptionMeta(meta)) {
|
|
41
|
+
this.exceptions.push(meta);
|
|
42
|
+
} else {
|
|
43
|
+
this.throws.push(meta);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
getAll(): { exceptions: ExceptionMetadata[]; throws: ThrowsMetadata[] } {
|
|
48
|
+
return { exceptions: this.exceptions, throws: this.throws };
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kind helps exception handlers to map exception
|
|
3
|
+
* to transport-specific one. For example InputException
|
|
4
|
+
* probably will result 400 HTTP status, while InternalException
|
|
5
|
+
* - 500
|
|
6
|
+
*/
|
|
7
|
+
export enum ExceptionKind {
|
|
8
|
+
INPUT = 0,
|
|
9
|
+
CONFLICT = 1,
|
|
10
|
+
DUPLICATION = 2,
|
|
11
|
+
AUTHENTICATION = 3,
|
|
12
|
+
NOT_ALLOWED = 4,
|
|
13
|
+
NOT_FOUND = 5,
|
|
14
|
+
INTERNAL = 6,
|
|
15
|
+
TIMEOUT = 7,
|
|
16
|
+
UNAVAILABLE = 8,
|
|
17
|
+
UNKNOWN = 9,
|
|
18
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { text } from '@rsdk/common';
|
|
2
|
+
|
|
3
|
+
import { BoolParser, Config, ConfigSection, Property } from '../config';
|
|
4
|
+
|
|
5
|
+
@ConfigSection()
|
|
6
|
+
export class GlobalExceptionsConfig extends Config {
|
|
7
|
+
@Property('VERBOSE_ERRORS', new BoolParser(), {
|
|
8
|
+
defaultValue: true,
|
|
9
|
+
description: text`
|
|
10
|
+
If set "true" all exception messages will be returned to client.
|
|
11
|
+
If false, only 4XX will contain messages, others - just status codes.
|
|
12
|
+
`,
|
|
13
|
+
})
|
|
14
|
+
readonly verbose!: boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { ArgumentsHost, ExceptionFilter } from '@nestjs/common';
|
|
2
|
+
import { Catch, Inject } from '@nestjs/common';
|
|
3
|
+
import { normalizer, sortErrorKeys } from '@rsdk/common';
|
|
4
|
+
import { ILogger } from '@rsdk/logging';
|
|
5
|
+
import type { Observable } from 'rxjs';
|
|
6
|
+
import { throwError } from 'rxjs';
|
|
7
|
+
|
|
8
|
+
import { InternalException, PipelineException } from '../exceptions';
|
|
9
|
+
import { InjectLogger } from '../logging';
|
|
10
|
+
|
|
11
|
+
import { FORMATTERS, SENDERS, TRANSFORMERS } from './constants';
|
|
12
|
+
import { GlobalExceptionsConfig } from './global-exceptions.config';
|
|
13
|
+
import type {
|
|
14
|
+
IErrorsFormatter,
|
|
15
|
+
IErrorsSender,
|
|
16
|
+
IErrorsTransformer,
|
|
17
|
+
} from './types';
|
|
18
|
+
|
|
19
|
+
@Catch()
|
|
20
|
+
export class GlobalExceptionsFilter implements ExceptionFilter {
|
|
21
|
+
constructor(
|
|
22
|
+
@Inject(FORMATTERS) private readonly formatters: IErrorsFormatter[],
|
|
23
|
+
@Inject(TRANSFORMERS) private readonly transformers: IErrorsTransformer[],
|
|
24
|
+
@Inject(SENDERS) private readonly senders: IErrorsSender[],
|
|
25
|
+
@InjectLogger(GlobalExceptionsFilter)
|
|
26
|
+
private readonly logger: ILogger,
|
|
27
|
+
private readonly config: GlobalExceptionsConfig,
|
|
28
|
+
) {}
|
|
29
|
+
|
|
30
|
+
catch(ex: any, host: ArgumentsHost): Observable<any> {
|
|
31
|
+
const transformed =
|
|
32
|
+
ex instanceof PipelineException ? ex : this.transform(ex);
|
|
33
|
+
|
|
34
|
+
// Error is transformed to standard PipelineException
|
|
35
|
+
this.logger.error(transformed);
|
|
36
|
+
|
|
37
|
+
const formatted = this.format(host, transformed);
|
|
38
|
+
|
|
39
|
+
return this.send(host, formatted);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
private transform(ex: any): PipelineException {
|
|
43
|
+
const transformer = this.transformers.find((x) => x.match(ex));
|
|
44
|
+
if (transformer) {
|
|
45
|
+
return transformer.transform(ex);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const err = new InternalException(ex.message ?? 'UNKNOWN ERROR', ex);
|
|
49
|
+
|
|
50
|
+
err.stack = ex.stack;
|
|
51
|
+
|
|
52
|
+
return err;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
private format(host: ArgumentsHost, ex: unknown): unknown {
|
|
56
|
+
const formatter = this.formatters.find((x) => x.match(host, ex));
|
|
57
|
+
if (formatter) {
|
|
58
|
+
this.logger.trace(`Found formatter: ${formatter.constructor.name}`);
|
|
59
|
+
|
|
60
|
+
return formatter.format(ex, this.config.verbose);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
this.logger.trace('No formatter for error!');
|
|
64
|
+
|
|
65
|
+
if (this.config.verbose) {
|
|
66
|
+
return normalizer()(ex, {
|
|
67
|
+
// This means stacktrace will never be sent to user
|
|
68
|
+
filterKeys: ['stack'],
|
|
69
|
+
sortKeys: sortErrorKeys,
|
|
70
|
+
}) as object;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return { message: 'NO FORMATTER' };
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
private send(host: ArgumentsHost, ex: any): Observable<unknown> {
|
|
77
|
+
const sender = this.senders.find((x) => x.match(host));
|
|
78
|
+
|
|
79
|
+
return sender?.send(host, ex) ?? throwError(() => ex);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { DynamicModule } from '@nestjs/common';
|
|
2
|
+
import { Module } from '@nestjs/common';
|
|
3
|
+
import { APP_FILTER } from '@nestjs/core';
|
|
4
|
+
|
|
5
|
+
import { PlatformConfigModule } from '../config';
|
|
6
|
+
|
|
7
|
+
import { FORMATTERS, SENDERS, TRANSFORMERS } from './constants';
|
|
8
|
+
import { GlobalExceptionsConfig } from './global-exceptions.config';
|
|
9
|
+
import { GlobalExceptionsFilter } from './global-exceptions.filter';
|
|
10
|
+
import type {
|
|
11
|
+
IErrorsFormatter,
|
|
12
|
+
IErrorsSender,
|
|
13
|
+
IErrorsTransformer,
|
|
14
|
+
} from './types';
|
|
15
|
+
|
|
16
|
+
export interface GlobalExceptionModuleOptions {
|
|
17
|
+
/**
|
|
18
|
+
* Formatters are used to transform exceptions to transport specific
|
|
19
|
+
* final implementations. Usually formatter expects transport agnostic
|
|
20
|
+
* subclasses of BaseException.
|
|
21
|
+
*/
|
|
22
|
+
formatters: IErrorsFormatter[];
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Senders are used to actually respond to client (algorithm
|
|
26
|
+
* is transport specific)
|
|
27
|
+
*/
|
|
28
|
+
senders: IErrorsSender[];
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Sometimes application throws a lot of unconventional
|
|
32
|
+
* (not inheriting BaseExceptions). Usually they are throw by
|
|
33
|
+
* libraries: typeorm, axios, etc. Transformers are used to
|
|
34
|
+
* catch them and convert to any subtype of BaseException which
|
|
35
|
+
* will be processed further by transport specific formatters.
|
|
36
|
+
*/
|
|
37
|
+
transformers?: IErrorsTransformer[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@Module({})
|
|
41
|
+
export class GlobalExceptionsModule {
|
|
42
|
+
static forRoot(options: GlobalExceptionModuleOptions): DynamicModule {
|
|
43
|
+
return {
|
|
44
|
+
module: GlobalExceptionsModule,
|
|
45
|
+
|
|
46
|
+
imports: [PlatformConfigModule.forFeature(GlobalExceptionsConfig)],
|
|
47
|
+
providers: [
|
|
48
|
+
{
|
|
49
|
+
provide: APP_FILTER,
|
|
50
|
+
useClass: GlobalExceptionsFilter,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
provide: FORMATTERS,
|
|
54
|
+
useValue: options.formatters,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
provide: SENDERS,
|
|
58
|
+
useValue: options.senders,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
provide: TRANSFORMERS,
|
|
62
|
+
useValue: options.transformers || [],
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}
|