@venok/core 1.1.0 → 2.0.1-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/application/config.js +92 -0
- package/dist/application/context.js +252 -0
- package/dist/application/factory.js +136 -0
- package/dist/constants.js +100 -0
- package/dist/context/context-id.factory.js +58 -0
- package/dist/context/context.js +186 -0
- package/dist/context/creator.js +49 -0
- package/dist/context/execution-host.js +51 -0
- package/dist/context/proxy.js +43 -0
- package/dist/decorators/apply.decorator.js +33 -0
- package/dist/decorators/bind.decorator.js +28 -0
- package/dist/decorators/catch.decorator.js +29 -0
- package/dist/decorators/dependencies.decorator.js +30 -0
- package/dist/decorators/exception-filters.decorator.js +40 -0
- package/dist/decorators/global.decorator.js +28 -0
- package/dist/decorators/inject.decorator.js +42 -0
- package/dist/decorators/injectable.decorator.js +38 -0
- package/dist/decorators/module.decorator.js +42 -0
- package/dist/decorators/optional.decorator.js +35 -0
- package/dist/decorators/set-metadata.decorator.js +35 -0
- package/dist/decorators/use-guards.decorator.js +39 -0
- package/dist/decorators/use-interceptors.decorator.js +39 -0
- package/dist/decorators/use-pipes.decorator.js +38 -0
- package/dist/enums/scope.enum.js +28 -0
- package/dist/enums/shutdown-signal.enum.js +36 -0
- package/dist/errors/exceptions/circular-dependency.exception.js +30 -0
- package/dist/errors/exceptions/invalid-class-module.exception.js +30 -0
- package/dist/errors/exceptions/invalid-class-scope.exception.js +33 -0
- package/dist/errors/exceptions/invalid-class.exception.js +30 -0
- package/dist/errors/exceptions/invalid-exception-filter.exception.js +30 -0
- package/dist/errors/exceptions/invalid-module.exception.js +30 -0
- package/dist/errors/exceptions/runtime.exception.js +30 -0
- package/dist/errors/exceptions/undefined-dependency.exception.js +30 -0
- package/dist/errors/exceptions/undefined-forwardref.exception.js +30 -0
- package/dist/errors/exceptions/undefined-module.exception.js +30 -0
- package/dist/errors/exceptions/unknown-dependencies.exception.js +38 -0
- package/dist/errors/exceptions/unknown-element.exception.js +31 -0
- package/dist/errors/exceptions/unknown-export.exception.js +30 -0
- package/dist/errors/exceptions/unknown-module.exception.js +29 -0
- package/dist/errors/messages.js +134 -0
- package/dist/exceptions/handler.js +53 -0
- package/dist/exceptions/zone/handler.js +30 -0
- package/dist/exceptions/zone/zone.js +49 -0
- package/dist/filters/context-creator.js +65 -0
- package/dist/filters/context.js +58 -0
- package/dist/filters/filter.js +36 -0
- package/dist/guards/consumer.js +54 -0
- package/dist/guards/context-creator.js +76 -0
- package/dist/helpers/color.helper.js +35 -0
- package/dist/helpers/context-id-factory.helper.js +25 -0
- package/dist/helpers/context.helper.js +65 -0
- package/dist/helpers/create-param-decorator.helper.js +73 -0
- package/dist/helpers/filter-log-levels.util.js +38 -0
- package/dist/helpers/flatten.helper.js +26 -0
- package/dist/helpers/is-log-level-enabled.util.js +39 -0
- package/dist/helpers/is-log-level.util.js +26 -0
- package/dist/helpers/messages.helper.js +23 -0
- package/dist/helpers/metadata.helper.js +51 -0
- package/dist/helpers/noop.helper.js +23 -0
- package/dist/helpers/random-string-generator.helper.js +24 -0
- package/dist/helpers/rethrow.helper.js +25 -0
- package/dist/helpers/shared.helper.js +49 -0
- package/dist/helpers/silent.helper.js +34 -0
- package/dist/helpers/transient.helper.js +30 -0
- package/dist/helpers/uuid.helper.js +60 -0
- package/dist/helpers/validate-each.helper.js +42 -0
- package/dist/hooks/before-app-shutdown.hook.js +43 -0
- package/dist/hooks/on-app-bootstrap.hook.js +43 -0
- package/dist/hooks/on-app-shutdown.hook.js +43 -0
- package/dist/hooks/on-module-destroy.hook.js +43 -0
- package/dist/hooks/on-module-init.hook.js +43 -0
- package/dist/index.d.ts +3141 -0
- package/dist/index.js +117 -0
- package/dist/injector/constants.js +28 -0
- package/dist/injector/container.js +229 -0
- package/dist/injector/helpers/barrier.js +48 -0
- package/dist/injector/helpers/class-scope.helper.js +27 -0
- package/dist/injector/helpers/classifier.helper.js +35 -0
- package/dist/injector/helpers/is-durable.helper.js +27 -0
- package/dist/injector/injector.js +490 -0
- package/dist/injector/instance/links-host.js +68 -0
- package/dist/injector/instance/loader.js +95 -0
- package/dist/injector/instance/resolver.js +61 -0
- package/dist/injector/instance/wrapper.js +324 -0
- package/dist/injector/internal-core-module/core-providers.js +42 -0
- package/dist/injector/internal-core-module/internal-core-module-factory.js +66 -0
- package/dist/injector/internal-core-module/internal-core-module.js +46 -0
- package/dist/injector/module/compiler.js +47 -0
- package/dist/injector/module/container.js +33 -0
- package/dist/injector/module/lazy/loader.js +71 -0
- package/dist/injector/module/module.js +395 -0
- package/dist/injector/module/ref.js +78 -0
- package/dist/injector/module/token-factory.js +82 -0
- package/dist/injector/settlement-signal.js +50 -0
- package/dist/injector/topology-tree/topology-tree.js +68 -0
- package/dist/injector/topology-tree/tree-node.js +68 -0
- package/dist/inspector/graph-inspector.js +182 -0
- package/dist/inspector/initialize-on-preview.allowlist.js +31 -0
- package/dist/inspector/noop-graph-inspector.js +27 -0
- package/dist/inspector/partial-graph.host.js +34 -0
- package/dist/inspector/serialized-graph.js +128 -0
- package/dist/interceptors/consumer.js +54 -0
- package/dist/interceptors/context-creator.js +75 -0
- package/dist/interfaces/application/context-options.interface.js +31 -0
- package/dist/interfaces/application/context.interface.js +0 -0
- package/dist/interfaces/application/index.js +3 -0
- package/dist/interfaces/context/arguments-host.interface.js +0 -0
- package/dist/interfaces/context/context-id-factory.interface.js +0 -0
- package/dist/interfaces/context/context.interface.js +0 -0
- package/dist/interfaces/context/creator.interface.js +0 -0
- package/dist/interfaces/context/execution.interface.js +0 -0
- package/dist/interfaces/context/index.js +7 -0
- package/dist/interfaces/context/params.interface.js +0 -0
- package/dist/interfaces/features/exception-filter.interface.js +0 -0
- package/dist/interfaces/features/guards.interface.js +0 -0
- package/dist/interfaces/features/index.js +5 -0
- package/dist/interfaces/features/interceptor.interface.js +0 -0
- package/dist/interfaces/features/pipes.interface.js +0 -0
- package/dist/interfaces/helper.interface.js +0 -0
- package/dist/interfaces/hooks/before-application-shutdown.interface.js +0 -0
- package/dist/interfaces/hooks/index.js +6 -0
- package/dist/interfaces/hooks/on-application-bootstrap.interface.js +0 -0
- package/dist/interfaces/hooks/on-application-shutdown.interface.js +0 -0
- package/dist/interfaces/hooks/on-destroy.interface.js +0 -0
- package/dist/interfaces/hooks/on-init.interface.js +0 -0
- package/dist/interfaces/index.js +16 -0
- package/dist/interfaces/injectable.interface.js +0 -0
- package/dist/interfaces/injector/index.js +6 -0
- package/dist/interfaces/injector/injector.interface.js +0 -0
- package/dist/interfaces/injector/instance-wrapper.interface.js +0 -0
- package/dist/interfaces/injector/lazy-module-options.interface.js +0 -0
- package/dist/interfaces/injector/module-compiler.interface.js +0 -0
- package/dist/interfaces/injector/module-ref.interface.js +0 -0
- package/dist/interfaces/inspector/edge.interface.js +0 -0
- package/dist/interfaces/inspector/enhancer-metadata-cache-entry.interface.js +0 -0
- package/dist/interfaces/inspector/entrypoint.interface.js +0 -0
- package/dist/interfaces/inspector/extras.interface.js +0 -0
- package/dist/interfaces/inspector/index.js +8 -0
- package/dist/interfaces/inspector/node.interface.js +0 -0
- package/dist/interfaces/inspector/serialized-graph-json.interface.js +0 -0
- package/dist/interfaces/inspector/serialized-graph-metadata.interface.js +0 -0
- package/dist/interfaces/modules/definition.interface.js +0 -0
- package/dist/interfaces/modules/dynamic-module.interface.js +0 -0
- package/dist/interfaces/modules/forward-reference.interface.js +0 -0
- package/dist/interfaces/modules/index.js +10 -0
- package/dist/interfaces/modules/injection-token.interface.js +0 -0
- package/dist/interfaces/modules/introspection-result.interface.js +0 -0
- package/dist/interfaces/modules/module-metadata.interface.js +0 -0
- package/dist/interfaces/modules/module.interface.js +0 -0
- package/dist/interfaces/modules/optional-factory-dependency.interface.js +0 -0
- package/dist/interfaces/modules/override.interface.js +0 -0
- package/dist/interfaces/modules/provider.interface.js +0 -0
- package/dist/interfaces/param-decorator.interface.js +0 -0
- package/dist/interfaces/scope.interface.js +0 -0
- package/dist/interfaces/services/console.interface.js +0 -0
- package/dist/interfaces/services/index.js +4 -0
- package/dist/interfaces/services/logger.interface.js +0 -0
- package/dist/interfaces/services/reflector.interface.js +0 -0
- package/dist/interfaces/set-metadata.interface.js +0 -0
- package/dist/interfaces/type.interface.js +0 -0
- package/dist/metadata-scanner.js +50 -0
- package/dist/pipes/consumer.js +33 -0
- package/dist/pipes/context-creator.js +78 -0
- package/dist/scanner.js +371 -0
- package/dist/services/console.service.js +347 -0
- package/dist/services/logger.service.js +276 -0
- package/dist/services/reflector.service.js +82 -0
- package/dist/storage/handler-metadata.storage.js +42 -0
- package/dist/storage/meta-host.storage.js +62 -0
- package/package.json +52 -40
- package/application/config.d.ts +0 -35
- package/application/config.js +0 -85
- package/application/context.d.ts +0 -198
- package/application/context.js +0 -325
- package/application/factory.d.ts +0 -43
- package/application/factory.js +0 -147
- package/constants.d.ts +0 -44
- package/constants.js +0 -51
- package/context/context.d.ts +0 -66
- package/context/context.js +0 -156
- package/context/creator.d.ts +0 -9
- package/context/creator.js +0 -32
- package/context/execution-host.d.ts +0 -16
- package/context/execution-host.js +0 -30
- package/context/index.d.ts +0 -4
- package/context/index.js +0 -20
- package/context/proxy.d.ts +0 -6
- package/context/proxy.js +0 -33
- package/decorators/apply.decorator.d.ts +0 -10
- package/decorators/apply.decorator.js +0 -24
- package/decorators/bind.decorator.d.ts +0 -11
- package/decorators/bind.decorator.js +0 -20
- package/decorators/catch.decorator.d.ts +0 -17
- package/decorators/catch.decorator.js +0 -26
- package/decorators/create-param.decorator.d.ts +0 -29
- package/decorators/create-param.decorator.js +0 -51
- package/decorators/dependencies.decorator.d.ts +0 -6
- package/decorators/dependencies.decorator.js +0 -17
- package/decorators/exception-filters.decorator.d.ts +0 -21
- package/decorators/exception-filters.decorator.js +0 -41
- package/decorators/global.decorator.d.ts +0 -10
- package/decorators/global.decorator.js +0 -19
- package/decorators/index.d.ts +0 -15
- package/decorators/index.js +0 -31
- package/decorators/inject.decorator.d.ts +0 -26
- package/decorators/inject.decorator.js +0 -45
- package/decorators/injectable.decorator.d.ts +0 -40
- package/decorators/injectable.decorator.js +0 -51
- package/decorators/module.decorator.d.ts +0 -14
- package/decorators/module.decorator.js +0 -38
- package/decorators/optional.decorator.d.ts +0 -14
- package/decorators/optional.decorator.js +0 -30
- package/decorators/set-metadata.decorator.d.ts +0 -18
- package/decorators/set-metadata.decorator.js +0 -30
- package/decorators/use-guards.decorator.d.ts +0 -21
- package/decorators/use-guards.decorator.js +0 -40
- package/decorators/use-interceptors.decorator.d.ts +0 -21
- package/decorators/use-interceptors.decorator.js +0 -40
- package/decorators/use-pipes.decorator.d.ts +0 -21
- package/decorators/use-pipes.decorator.js +0 -39
- package/discovery/meta-host-collection.d.ts +0 -32
- package/discovery/meta-host-collection.js +0 -79
- package/discovery/module.d.ts +0 -5
- package/discovery/module.js +0 -24
- package/discovery/service.d.ts +0 -68
- package/discovery/service.js +0 -90
- package/errors/exceptions/circular-dependency.exception.d.ts +0 -4
- package/errors/exceptions/circular-dependency.exception.js +0 -11
- package/errors/exceptions/index.d.ts +0 -8
- package/errors/exceptions/index.js +0 -24
- package/errors/exceptions/invalid-class-module.exception.d.ts +0 -4
- package/errors/exceptions/invalid-class-module.exception.js +0 -11
- package/errors/exceptions/invalid-class-scope.exception.d.ts +0 -5
- package/errors/exceptions/invalid-class-scope.exception.js +0 -14
- package/errors/exceptions/invalid-class.exception.d.ts +0 -4
- package/errors/exceptions/invalid-class.exception.js +0 -11
- package/errors/exceptions/invalid-exception-filter.exception.d.ts +0 -4
- package/errors/exceptions/invalid-exception-filter.exception.js +0 -11
- package/errors/exceptions/invalid-module.exception.d.ts +0 -4
- package/errors/exceptions/invalid-module.exception.js +0 -11
- package/errors/exceptions/runtime.exception.d.ts +0 -4
- package/errors/exceptions/runtime.exception.js +0 -12
- package/errors/exceptions/undefined-dependency.exception.d.ts +0 -6
- package/errors/exceptions/undefined-dependency.exception.js +0 -11
- package/errors/exceptions/undefined-forwardref.exception.d.ts +0 -5
- package/errors/exceptions/undefined-forwardref.exception.js +0 -11
- package/errors/exceptions/undefined-module.exception.d.ts +0 -4
- package/errors/exceptions/undefined-module.exception.js +0 -11
- package/errors/exceptions/unknown-dependencies.exception.d.ts +0 -16
- package/errors/exceptions/unknown-dependencies.exception.js +0 -15
- package/errors/exceptions/unknown-element.exception.d.ts +0 -4
- package/errors/exceptions/unknown-element.exception.js +0 -12
- package/errors/exceptions/unknown-export.exception.d.ts +0 -4
- package/errors/exceptions/unknown-export.exception.js +0 -11
- package/errors/exceptions/unknown-module.exception.d.ts +0 -4
- package/errors/exceptions/unknown-module.exception.js +0 -10
- package/errors/messages.d.ts +0 -15
- package/errors/messages.js +0 -126
- package/exceptions/handler.d.ts +0 -10
- package/exceptions/handler.js +0 -34
- package/exceptions/index.d.ts +0 -2
- package/exceptions/index.js +0 -18
- package/exceptions/zone/handler.d.ts +0 -5
- package/exceptions/zone/handler.js +0 -15
- package/exceptions/zone/index.d.ts +0 -2
- package/exceptions/zone/index.js +0 -18
- package/exceptions/zone/zone.d.ts +0 -5
- package/exceptions/zone/zone.js +0 -32
- package/filters/context-creator.d.ts +0 -14
- package/filters/context-creator.js +0 -48
- package/filters/context.d.ts +0 -12
- package/filters/context.js +0 -41
- package/filters/filter.d.ts +0 -6
- package/filters/filter.js +0 -16
- package/filters/index.d.ts +0 -3
- package/filters/index.js +0 -19
- package/guards/consumer.d.ts +0 -9
- package/guards/consumer.js +0 -33
- package/guards/context-creator.d.ts +0 -17
- package/guards/context-creator.js +0 -69
- package/guards/index.d.ts +0 -2
- package/guards/index.js +0 -18
- package/helpers/color.helper.d.ts +0 -9
- package/helpers/color.helper.js +0 -14
- package/helpers/context-id-factory.helper.d.ts +0 -2
- package/helpers/context-id-factory.helper.js +0 -15
- package/helpers/context.helper.d.ts +0 -23
- package/helpers/context.helper.js +0 -49
- package/helpers/extends-metadata.helper.d.ts +0 -1
- package/helpers/extends-metadata.helper.js +0 -9
- package/helpers/flatten.helper.d.ts +0 -1
- package/helpers/flatten.helper.js +0 -9
- package/helpers/messages.helper.d.ts +0 -2
- package/helpers/messages.helper.js +0 -7
- package/helpers/noop.helper.d.ts +0 -1
- package/helpers/noop.helper.js +0 -5
- package/helpers/random-string-generator.helper.d.ts +0 -1
- package/helpers/random-string-generator.helper.js +0 -6
- package/helpers/rethrow.helper.d.ts +0 -1
- package/helpers/rethrow.helper.js +0 -7
- package/helpers/shared.helper.d.ts +0 -10
- package/helpers/shared.helper.js +0 -33
- package/helpers/silent.helper.d.ts +0 -10
- package/helpers/silent.helper.js +0 -18
- package/helpers/transient.helper.d.ts +0 -12
- package/helpers/transient.helper.js +0 -26
- package/helpers/uuid.helper.d.ts +0 -15
- package/helpers/uuid.helper.js +0 -54
- package/helpers/validate-each.helper.d.ts +0 -8
- package/helpers/validate-each.helper.js +0 -25
- package/hooks/before-app-shutdown.hook.d.ts +0 -9
- package/hooks/before-app-shutdown.hook.js +0 -45
- package/hooks/index.d.ts +0 -5
- package/hooks/index.js +0 -21
- package/hooks/on-app-bootstrap.hook.d.ts +0 -8
- package/hooks/on-app-bootstrap.hook.js +0 -45
- package/hooks/on-app-shutdown.hook.d.ts +0 -9
- package/hooks/on-app-shutdown.hook.js +0 -46
- package/hooks/on-module-destroy.hook.d.ts +0 -8
- package/hooks/on-module-destroy.hook.js +0 -45
- package/hooks/on-module-init.hook.d.ts +0 -8
- package/hooks/on-module-init.hook.js +0 -45
- package/index.d.ts +0 -10
- package/index.js +0 -32
- package/injector/constants.d.ts +0 -2
- package/injector/constants.js +0 -7
- package/injector/container.d.ts +0 -61
- package/injector/container.js +0 -194
- package/injector/helpers/class-scope.helper.d.ts +0 -2
- package/injector/helpers/class-scope.helper.js +0 -9
- package/injector/helpers/classifier.helper.d.ts +0 -4
- package/injector/helpers/classifier.helper.js +0 -17
- package/injector/helpers/is-durable.helper.d.ts +0 -2
- package/injector/helpers/is-durable.helper.js +0 -9
- package/injector/index.d.ts +0 -5
- package/injector/index.js +0 -20
- package/injector/injector.d.ts +0 -87
- package/injector/injector.js +0 -452
- package/injector/instance/links-host.d.ts +0 -22
- package/injector/instance/links-host.js +0 -50
- package/injector/instance/loader.d.ts +0 -21
- package/injector/instance/loader.js +0 -73
- package/injector/instance/resolver.d.ts +0 -16
- package/injector/instance/resolver.js +0 -43
- package/injector/instance/wrapper.d.ts +0 -90
- package/injector/instance/wrapper.js +0 -272
- package/injector/internal-core-module/core-providers.d.ts +0 -4
- package/injector/internal-core-module/core-providers.js +0 -21
- package/injector/internal-core-module/internal-core-module-factory.d.ts +0 -8
- package/injector/internal-core-module/internal-core-module-factory.js +0 -47
- package/injector/internal-core-module/internal-core-module.d.ts +0 -4
- package/injector/internal-core-module/internal-core-module.js +0 -31
- package/injector/module/compiler.d.ts +0 -19
- package/injector/module/compiler.js +0 -27
- package/injector/module/container.d.ts +0 -6
- package/injector/module/container.js +0 -24
- package/injector/module/lazy/loader.d.ts +0 -21
- package/injector/module/lazy/loader.js +0 -49
- package/injector/module/lazy/options.d.ts +0 -6
- package/injector/module/lazy/options.js +0 -2
- package/injector/module/module.d.ts +0 -74
- package/injector/module/module.js +0 -383
- package/injector/module/ref.d.ts +0 -106
- package/injector/module/ref.js +0 -62
- package/injector/module/token-factory.d.ts +0 -13
- package/injector/module/token-factory.js +0 -71
- package/injector/settlement-signal.d.ts +0 -37
- package/injector/settlement-signal.js +0 -55
- package/inspector/graph-inspector.d.ts +0 -26
- package/inspector/graph-inspector.js +0 -163
- package/inspector/initialize-on-preview.allowlist.d.ts +0 -6
- package/inspector/initialize-on-preview.allowlist.js +0 -13
- package/inspector/interfaces/edge.interface.d.ts +0 -28
- package/inspector/interfaces/edge.interface.js +0 -2
- package/inspector/interfaces/enhancer-metadata-cache-entry.interface.d.ts +0 -12
- package/inspector/interfaces/enhancer-metadata-cache-entry.interface.js +0 -2
- package/inspector/interfaces/entrypoint.interface.d.ts +0 -10
- package/inspector/interfaces/entrypoint.interface.js +0 -2
- package/inspector/interfaces/extras.interface.d.ts +0 -18
- package/inspector/interfaces/extras.interface.js +0 -2
- package/inspector/interfaces/node.interface.d.ts +0 -49
- package/inspector/interfaces/node.interface.js +0 -2
- package/inspector/interfaces/serialized-graph-json.interface.d.ts +0 -14
- package/inspector/interfaces/serialized-graph-json.interface.js +0 -2
- package/inspector/interfaces/serialized-graph-metadata.interface.d.ts +0 -10
- package/inspector/interfaces/serialized-graph-metadata.interface.js +0 -2
- package/inspector/noop-graph-inspector.d.ts +0 -2
- package/inspector/noop-graph-inspector.js +0 -8
- package/inspector/partial-graph.host.d.ts +0 -7
- package/inspector/partial-graph.host.js +0 -15
- package/inspector/serialized-graph.d.ts +0 -52
- package/inspector/serialized-graph.js +0 -121
- package/interceptors/consumer.d.ts +0 -9
- package/interceptors/consumer.js +0 -37
- package/interceptors/context-creator.d.ts +0 -17
- package/interceptors/context-creator.js +0 -67
- package/interceptors/index.d.ts +0 -2
- package/interceptors/index.js +0 -18
- package/interfaces/abstract.interface.d.ts +0 -3
- package/interfaces/abstract.interface.js +0 -2
- package/interfaces/application/context-options.interface.d.ts +0 -41
- package/interfaces/application/context-options.interface.js +0 -9
- package/interfaces/application/context.interface.d.ts +0 -162
- package/interfaces/application/context.interface.js +0 -2
- package/interfaces/application/index.d.ts +0 -1
- package/interfaces/application/index.js +0 -17
- package/interfaces/context/arguments-host.interface.d.ts +0 -22
- package/interfaces/context/arguments-host.interface.js +0 -2
- package/interfaces/context/execution.interface.d.ts +0 -18
- package/interfaces/context/execution.interface.js +0 -2
- package/interfaces/context/index.d.ts +0 -2
- package/interfaces/context/index.js +0 -18
- package/interfaces/features/exception-filter.interface.d.ts +0 -21
- package/interfaces/features/exception-filter.interface.js +0 -2
- package/interfaces/features/guards.interface.d.ts +0 -20
- package/interfaces/features/guards.interface.js +0 -2
- package/interfaces/features/index.d.ts +0 -4
- package/interfaces/features/index.js +0 -20
- package/interfaces/features/interceptor.interface.d.ts +0 -30
- package/interfaces/features/interceptor.interface.js +0 -2
- package/interfaces/features/pipes.interface.d.ts +0 -37
- package/interfaces/features/pipes.interface.js +0 -2
- package/interfaces/helper.interface.d.ts +0 -3
- package/interfaces/helper.interface.js +0 -2
- package/interfaces/hooks/before-application-shutdown.interface.d.ts +0 -3
- package/interfaces/hooks/before-application-shutdown.interface.js +0 -2
- package/interfaces/hooks/index.d.ts +0 -5
- package/interfaces/hooks/index.js +0 -21
- package/interfaces/hooks/on-application-bootstrap.interface.d.ts +0 -9
- package/interfaces/hooks/on-application-bootstrap.interface.js +0 -2
- package/interfaces/hooks/on-application-shutdown.interface.d.ts +0 -9
- package/interfaces/hooks/on-application-shutdown.interface.js +0 -2
- package/interfaces/hooks/on-destroy.interface.d.ts +0 -10
- package/interfaces/hooks/on-destroy.interface.js +0 -2
- package/interfaces/hooks/on-init.interface.d.ts +0 -8
- package/interfaces/hooks/on-init.interface.js +0 -2
- package/interfaces/index.d.ts +0 -8
- package/interfaces/index.js +0 -24
- package/interfaces/injectable.interface.d.ts +0 -1
- package/interfaces/injectable.interface.js +0 -2
- package/interfaces/modules/configurable/async-options.interface.d.ts +0 -42
- package/interfaces/modules/configurable/async-options.interface.js +0 -2
- package/interfaces/modules/configurable/cls.interface.d.ts +0 -13
- package/interfaces/modules/configurable/cls.interface.js +0 -2
- package/interfaces/modules/configurable/host.interface.d.ts +0 -62
- package/interfaces/modules/configurable/host.interface.js +0 -2
- package/interfaces/modules/configurable/index.d.ts +0 -3
- package/interfaces/modules/configurable/index.js +0 -19
- package/interfaces/modules/definition.interface.d.ts +0 -4
- package/interfaces/modules/definition.interface.js +0 -2
- package/interfaces/modules/dynamic-module.interface.d.ts +0 -23
- package/interfaces/modules/dynamic-module.interface.js +0 -2
- package/interfaces/modules/forward-reference.interface.d.ts +0 -3
- package/interfaces/modules/forward-reference.interface.js +0 -2
- package/interfaces/modules/index.d.ts +0 -9
- package/interfaces/modules/index.js +0 -25
- package/interfaces/modules/injection-token.interface.d.ts +0 -5
- package/interfaces/modules/injection-token.interface.js +0 -2
- package/interfaces/modules/introspection-result.interface.d.ts +0 -10
- package/interfaces/modules/introspection-result.interface.js +0 -2
- package/interfaces/modules/module-metadata.interface.d.ts +0 -24
- package/interfaces/modules/module-metadata.interface.js +0 -2
- package/interfaces/modules/module.interface.d.ts +0 -2
- package/interfaces/modules/module.interface.js +0 -2
- package/interfaces/modules/optional-factory-dependency.interface.d.ts +0 -8
- package/interfaces/modules/optional-factory-dependency.interface.js +0 -2
- package/interfaces/modules/override.interface.d.ts +0 -5
- package/interfaces/modules/override.interface.js +0 -2
- package/interfaces/modules/provider.interface.d.ts +0 -142
- package/interfaces/modules/provider.interface.js +0 -2
- package/interfaces/scope.interface.d.ts +0 -35
- package/interfaces/scope.interface.js +0 -23
- package/interfaces/type.interface.d.ts +0 -3
- package/interfaces/type.interface.js +0 -2
- package/metadata-scanner.d.ts +0 -4
- package/metadata-scanner.js +0 -34
- package/module/configurable-module.builder.d.ts +0 -93
- package/module/configurable-module.builder.js +0 -204
- package/module/constants.d.ts +0 -4
- package/module/constants.js +0 -7
- package/module/helpers/generate-options-injection-token.helper.d.ts +0 -1
- package/module/helpers/generate-options-injection-token.helper.js +0 -9
- package/module/helpers/get-injection-providers.helper.d.ts +0 -8
- package/module/helpers/get-injection-providers.helper.js +0 -36
- package/module/helpers/index.d.ts +0 -2
- package/module/helpers/index.js +0 -18
- package/module/index.d.ts +0 -2
- package/module/index.js +0 -18
- package/pipes/consumer.d.ts +0 -9
- package/pipes/consumer.js +0 -15
- package/pipes/context-creator.d.ts +0 -18
- package/pipes/context-creator.js +0 -70
- package/pipes/index.d.ts +0 -2
- package/pipes/index.js +0 -18
- package/scanner.d.ts +0 -81
- package/scanner.js +0 -374
- package/services/console.service.d.ts +0 -86
- package/services/console.service.js +0 -233
- package/services/index.d.ts +0 -1
- package/services/index.js +0 -17
- package/services/logger.service.d.ts +0 -157
- package/services/logger.service.js +0 -269
- package/services/reflector.service.d.ts +0 -110
- package/services/reflector.service.js +0 -87
- package/test/context/creator.spec.d.ts +0 -1
- package/test/context/creator.spec.js +0 -149
- package/test/context/execution-host.spec.d.ts +0 -1
- package/test/context/execution-host.spec.js +0 -31
- package/test/context/proxy.spec.d.ts +0 -1
- package/test/context/proxy.spec.js +0 -46
- package/test/exceptions/handler.spec.d.ts +0 -1
- package/test/exceptions/handler.spec.js +0 -90
- package/test/exceptions/messages.spec.js +0 -201
- package/test/exceptions/zona/handler.spec.d.ts +0 -1
- package/test/exceptions/zona/handler.spec.js +0 -51
- package/test/exceptions/zona/zone.spec.d.ts +0 -1
- package/test/exceptions/zona/zone.spec.js +0 -66
- package/test/filters/context-creator.spec.d.ts +0 -2
- package/test/filters/context-creator.spec.js +0 -91
- package/test/guards/consumer.spec.d.ts +0 -1
- package/test/guards/consumer.spec.js +0 -47
- package/test/guards/context-creator.spec.d.ts +0 -1
- package/test/guards/context-creator.spec.js +0 -138
- package/test/helpers/context-id-factory.spec.d.ts +0 -1
- package/test/helpers/context-id-factory.spec.js +0 -9
- package/test/helpers/shared.spec.d.ts +0 -1
- package/test/helpers/shared.spec.js +0 -122
- package/test/hooks/before-app-shutdown.hook.spec.d.ts +0 -1
- package/test/hooks/before-app-shutdown.hook.spec.js +0 -44
- package/test/hooks/on-app-bootstrap.hook.spec.d.ts +0 -1
- package/test/hooks/on-app-bootstrap.hook.spec.js +0 -43
- package/test/hooks/on-app-shutdown.hook.spec.d.ts +0 -1
- package/test/hooks/on-app-shutdown.hook.spec.js +0 -43
- package/test/hooks/on-module-destroy.hook.spec.d.ts +0 -1
- package/test/hooks/on-module-destroy.hook.spec.js +0 -43
- package/test/hooks/on-module-init.hook.spec.d.ts +0 -1
- package/test/hooks/on-module-init.hook.spec.js +0 -43
- package/test/injector/compiler.spec.d.ts +0 -1
- package/test/injector/compiler.spec.js +0 -42
- package/test/injector/container.spec.d.ts +0 -1
- package/test/injector/container.spec.js +0 -203
- package/test/injector/helpers/classifier.spec.d.ts +0 -1
- package/test/injector/helpers/classifier.spec.js +0 -102
- package/test/injector/injector.spec.d.ts +0 -1
- package/test/injector/injector.spec.js +0 -678
- package/test/injector/instance/loader.spec.d.ts +0 -1
- package/test/injector/instance/loader.spec.js +0 -108
- package/test/injector/instance/wrapper.spec.d.ts +0 -1
- package/test/injector/instance/wrapper.spec.js +0 -772
- package/test/injector/internal-core-module/internal-core-module-factory.spec.d.ts +0 -1
- package/test/injector/internal-core-module/internal-core-module-factory.spec.js +0 -27
- package/test/injector/module/lazy/loader.spec.d.ts +0 -1
- package/test/injector/module/lazy/loader.spec.js +0 -71
- package/test/injector/module/module.spec.d.ts +0 -1
- package/test/injector/module/module.spec.js +0 -410
- package/test/injector/module/token-factory.spec.d.ts +0 -1
- package/test/injector/module/token-factory.spec.js +0 -84
- package/test/interceptors/consumer.spec.d.ts +0 -1
- package/test/interceptors/consumer.spec.js +0 -136
- package/test/interceptors/context-creator.spec.d.ts +0 -1
- package/test/interceptors/context-creator.spec.js +0 -139
- package/test/metadata-scanner.spec.d.ts +0 -1
- package/test/metadata-scanner.spec.js +0 -41
- package/test/module/configurable-module.builder.spec.d.ts +0 -1
- package/test/module/configurable-module.builder.spec.js +0 -102
- package/test/module/helpers/get-injection-providers.helper.spec.d.ts +0 -1
- package/test/module/helpers/get-injection-providers.helper.spec.js +0 -49
- package/test/pipes/consumer.spec.d.ts +0 -1
- package/test/pipes/consumer.spec.js +0 -42
- package/test/pipes/context-creator.spec.d.ts +0 -1
- package/test/pipes/context-creator.spec.js +0 -108
- package/test/scanner.spec.d.ts +0 -1
- package/test/scanner.spec.js +0 -620
- package/test/services/logger.service.spec.d.ts +0 -1
- package/test/services/logger.service.spec.js +0 -487
- package/test/services/reflector.service.spec.d.ts +0 -1
- package/test/services/reflector.service.spec.js +0 -105
- package/tsconfig.tsbuildinfo +0 -1
- /package/{test/exceptions/messages.spec.d.ts → dist/interfaces/abstract.interface.js} +0 -0
package/errors/messages.js
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MICROSERVICES_PACKAGE_NOT_FOUND_EXCEPTION = exports.INVALID_EXCEPTION_FILTER = exports.UNHANDLED_RUNTIME_EXCEPTION = exports.INVALID_CLASS_SCOPE_MESSAGE = exports.INVALID_CLASS_MESSAGE = exports.UNKNOWN_EXPORT_MESSAGE = exports.UNDEFINED_MODULE_MESSAGE = exports.USING_INVALID_CLASS_AS_A_MODULE_MESSAGE = exports.INVALID_MODULE_MESSAGE = exports.UNDEFINED_FORWARDREF_MESSAGE = exports.UNKNOWN_DEPENDENCIES_MESSAGE = void 0;
|
|
4
|
-
const shared_helper_1 = require("@venok/core/helpers/shared.helper");
|
|
5
|
-
/**
|
|
6
|
-
* Returns the name of an instance or `undefined`
|
|
7
|
-
* @param instance The instance which should get the name from
|
|
8
|
-
*/
|
|
9
|
-
const getInstanceName = (instance) => {
|
|
10
|
-
if (instance?.forwardRef)
|
|
11
|
-
return instance.forwardRef()?.name;
|
|
12
|
-
if (instance?.module)
|
|
13
|
-
return instance.module?.name;
|
|
14
|
-
return instance?.name;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Returns the name of the dependency
|
|
18
|
-
* Tries to get the class name, otherwise the string value
|
|
19
|
-
* (= injection token). As fallback, it returns '+'
|
|
20
|
-
* @param dependency The name of the dependency to be displayed
|
|
21
|
-
*/
|
|
22
|
-
const getDependencyName = (dependency) =>
|
|
23
|
-
// use class name
|
|
24
|
-
getInstanceName(dependency) ||
|
|
25
|
-
// use injection token (symbol)
|
|
26
|
-
((0, shared_helper_1.isSymbol)(dependency) && dependency.toString()) ||
|
|
27
|
-
// use string directly
|
|
28
|
-
dependency ||
|
|
29
|
-
// otherwise
|
|
30
|
-
"+";
|
|
31
|
-
/**
|
|
32
|
-
* Returns the name of the module
|
|
33
|
-
* Tries to get the class name. As fallback, it returns 'current'.
|
|
34
|
-
* @param module The module which should get displayed
|
|
35
|
-
*/
|
|
36
|
-
const getModuleName = (module) => (module && getInstanceName(module.metatype)) || "current";
|
|
37
|
-
const stringifyScope = (scope) => (scope || []).map(getInstanceName).join(" -> ");
|
|
38
|
-
const UNKNOWN_DEPENDENCIES_MESSAGE = (type, unknownDependencyContext, module) => {
|
|
39
|
-
const { index, name = "dependency", dependencies, key } = unknownDependencyContext;
|
|
40
|
-
const moduleName = getModuleName(module);
|
|
41
|
-
const dependencyName = getDependencyName(name);
|
|
42
|
-
const potentialSolutions =
|
|
43
|
-
// If module's name is well-defined
|
|
44
|
-
moduleName !== "current"
|
|
45
|
-
? `\n
|
|
46
|
-
Potential solutions:
|
|
47
|
-
- Is ${moduleName} a valid Venok module?
|
|
48
|
-
- If ${dependencyName} is a provider, is it part of the current ${moduleName}?
|
|
49
|
-
- If ${dependencyName} is exported from a separate @Module, is that module imported within ${moduleName}?
|
|
50
|
-
@Module({
|
|
51
|
-
imports: [ /* the Module containing ${dependencyName} */ ]
|
|
52
|
-
})
|
|
53
|
-
`
|
|
54
|
-
: `\n
|
|
55
|
-
Potential solutions:
|
|
56
|
-
- If ${dependencyName} is a provider, is it part of the current Module?
|
|
57
|
-
- If ${dependencyName} is exported from a separate @Module, is that module imported within Module?
|
|
58
|
-
@Module({
|
|
59
|
-
imports: [ /* the Module containing ${dependencyName} */ ]
|
|
60
|
-
})
|
|
61
|
-
`;
|
|
62
|
-
let message = `Venok can't resolve dependencies of the ${type.toString()}`;
|
|
63
|
-
if ((0, shared_helper_1.isNull)(index) && key) {
|
|
64
|
-
message += `. Please make sure that the "${key.toString()}" property is available in the current context.${potentialSolutions}`;
|
|
65
|
-
return message;
|
|
66
|
-
}
|
|
67
|
-
const dependenciesName = (dependencies || []).map(getDependencyName);
|
|
68
|
-
// @ts-ignore
|
|
69
|
-
dependenciesName[index] = "?";
|
|
70
|
-
message += ` (`;
|
|
71
|
-
message += dependenciesName.join(", ");
|
|
72
|
-
message += `). Please make sure that the argument ${dependencyName} at index [${index}] is available in the ${moduleName} context.`;
|
|
73
|
-
message += potentialSolutions;
|
|
74
|
-
return message;
|
|
75
|
-
};
|
|
76
|
-
exports.UNKNOWN_DEPENDENCIES_MESSAGE = UNKNOWN_DEPENDENCIES_MESSAGE;
|
|
77
|
-
const UNDEFINED_FORWARDREF_MESSAGE = (scope) => `Venok cannot create the module instance. Often, this is because of a circular dependency between modules. Use forwardRef() to avoid it.
|
|
78
|
-
|
|
79
|
-
Scope [${stringifyScope(scope)}]
|
|
80
|
-
`;
|
|
81
|
-
exports.UNDEFINED_FORWARDREF_MESSAGE = UNDEFINED_FORWARDREF_MESSAGE;
|
|
82
|
-
const INVALID_MODULE_MESSAGE = (parentModule, index, scope) => {
|
|
83
|
-
const parentModuleName = parentModule?.name || "module";
|
|
84
|
-
return `Venok cannot create the ${parentModuleName} instance.
|
|
85
|
-
Received an unexpected value at index [${index}] of the ${parentModuleName} "imports" array.
|
|
86
|
-
|
|
87
|
-
Scope [${stringifyScope(scope)}]`;
|
|
88
|
-
};
|
|
89
|
-
exports.INVALID_MODULE_MESSAGE = INVALID_MODULE_MESSAGE;
|
|
90
|
-
const USING_INVALID_CLASS_AS_A_MODULE_MESSAGE = (metatypeUsedAsAModule, scope) => {
|
|
91
|
-
const metatypeNameQuote = `"${getInstanceName(metatypeUsedAsAModule)}"` || "that class";
|
|
92
|
-
return `Classes annotated with @Injectable(), @Catch(), and @Controller() decorators must not appear in the "imports" array of a module.
|
|
93
|
-
Please remove ${metatypeNameQuote} (including forwarded occurrences, if any) from all of the "imports" arrays.
|
|
94
|
-
|
|
95
|
-
Scope [${stringifyScope(scope)}]
|
|
96
|
-
`;
|
|
97
|
-
};
|
|
98
|
-
exports.USING_INVALID_CLASS_AS_A_MODULE_MESSAGE = USING_INVALID_CLASS_AS_A_MODULE_MESSAGE;
|
|
99
|
-
const UNDEFINED_MODULE_MESSAGE = (parentModule, index, scope) => {
|
|
100
|
-
const parentModuleName = parentModule?.name || "module";
|
|
101
|
-
return `Venok cannot create the ${parentModuleName} instance.
|
|
102
|
-
The module at index [${index}] of the ${parentModuleName} "imports" array is undefined.
|
|
103
|
-
|
|
104
|
-
Potential causes:
|
|
105
|
-
- A circular dependency between modules. Use forwardRef() to avoid it.
|
|
106
|
-
- The module at index [${index}] is of type "undefined". Check your import statements and the type of the module.
|
|
107
|
-
|
|
108
|
-
Scope [${stringifyScope(scope)}]`;
|
|
109
|
-
};
|
|
110
|
-
exports.UNDEFINED_MODULE_MESSAGE = UNDEFINED_MODULE_MESSAGE;
|
|
111
|
-
const UNKNOWN_EXPORT_MESSAGE = (token = "item", module) => {
|
|
112
|
-
token = (0, shared_helper_1.isSymbol)(token) ? token.toString() : token;
|
|
113
|
-
return `Venok cannot export a provider/module that is not a part of the currently processed module (${module}). Please verify whether the exported ${token} is available in this particular context.
|
|
114
|
-
|
|
115
|
-
Possible Solutions:
|
|
116
|
-
- Is ${token} part of the relevant providers/imports within ${module}?
|
|
117
|
-
`;
|
|
118
|
-
};
|
|
119
|
-
exports.UNKNOWN_EXPORT_MESSAGE = UNKNOWN_EXPORT_MESSAGE;
|
|
120
|
-
const INVALID_CLASS_MESSAGE = (text, value) => `ModuleRef cannot instantiate class (${value} is not constructable).`;
|
|
121
|
-
exports.INVALID_CLASS_MESSAGE = INVALID_CLASS_MESSAGE;
|
|
122
|
-
const INVALID_CLASS_SCOPE_MESSAGE = (text, name) => `${name || "This class"} is marked as a scoped provider. Request and transient-scoped providers can't be used in combination with "get()" method. Please, use "resolve()" instead.`;
|
|
123
|
-
exports.INVALID_CLASS_SCOPE_MESSAGE = INVALID_CLASS_SCOPE_MESSAGE;
|
|
124
|
-
exports.UNHANDLED_RUNTIME_EXCEPTION = `Unhandled Runtime Exception.`;
|
|
125
|
-
exports.INVALID_EXCEPTION_FILTER = `Invalid exception filters (@UseFilters()).`;
|
|
126
|
-
exports.MICROSERVICES_PACKAGE_NOT_FOUND_EXCEPTION = `Unable to load @Venok/microservices package. (Please make sure that it's already installed.)`;
|
package/exceptions/handler.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ArgumentsHost, ExceptionFilter, ExceptionFilterMetadata } from "@venok/core";
|
|
2
|
-
export declare class VenokExceptionsHandler {
|
|
3
|
-
private readonly exceptionsFilter;
|
|
4
|
-
private filters;
|
|
5
|
-
constructor(exceptionsFilter: ExceptionFilter);
|
|
6
|
-
next(exception: Error | any, host: ArgumentsHost): any;
|
|
7
|
-
setCustomFilters(filters: ExceptionFilterMetadata[]): void;
|
|
8
|
-
invokeCustomFilters<T = any>(exception: T, host: ArgumentsHost): boolean;
|
|
9
|
-
protected selectExceptionFilterMetadata<T = any>(filters: ExceptionFilterMetadata[], exception: T): ExceptionFilterMetadata | undefined;
|
|
10
|
-
}
|
package/exceptions/handler.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VenokExceptionsHandler = void 0;
|
|
4
|
-
const invalid_exception_filter_exception_1 = require("@venok/core/errors/exceptions/invalid-exception-filter.exception");
|
|
5
|
-
const shared_helper_1 = require("@venok/core/helpers/shared.helper");
|
|
6
|
-
class VenokExceptionsHandler {
|
|
7
|
-
constructor(exceptionsFilter) {
|
|
8
|
-
this.exceptionsFilter = exceptionsFilter;
|
|
9
|
-
this.filters = [];
|
|
10
|
-
}
|
|
11
|
-
next(exception, host) {
|
|
12
|
-
const result = this.invokeCustomFilters(exception, host);
|
|
13
|
-
if (result)
|
|
14
|
-
return result;
|
|
15
|
-
return this.exceptionsFilter.catch(exception, host);
|
|
16
|
-
}
|
|
17
|
-
setCustomFilters(filters) {
|
|
18
|
-
if (!Array.isArray(filters))
|
|
19
|
-
throw new invalid_exception_filter_exception_1.InvalidExceptionFilterException();
|
|
20
|
-
this.filters = filters;
|
|
21
|
-
}
|
|
22
|
-
invokeCustomFilters(exception, host) {
|
|
23
|
-
if ((0, shared_helper_1.isEmpty)(this.filters))
|
|
24
|
-
return false;
|
|
25
|
-
const filter = this.selectExceptionFilterMetadata(this.filters, exception);
|
|
26
|
-
filter && filter.func(exception, host);
|
|
27
|
-
return !!filter;
|
|
28
|
-
}
|
|
29
|
-
selectExceptionFilterMetadata(filters, exception) {
|
|
30
|
-
return filters.find(({ exceptionMetatypes }) => !exceptionMetatypes.length ||
|
|
31
|
-
exceptionMetatypes.some((ExceptionMetaType) => exception instanceof ExceptionMetaType));
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.VenokExceptionsHandler = VenokExceptionsHandler;
|
package/exceptions/index.d.ts
DELETED
package/exceptions/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./zone"), exports);
|
|
18
|
-
__exportStar(require("./handler"), exports);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ExceptionHandler = void 0;
|
|
4
|
-
const logger_service_1 = require("@venok/core/services/logger.service");
|
|
5
|
-
const exceptions_1 = require("@venok/core/errors/exceptions");
|
|
6
|
-
class ExceptionHandler {
|
|
7
|
-
handle(exception) {
|
|
8
|
-
if (!(exception instanceof exceptions_1.RuntimeException)) {
|
|
9
|
-
return ExceptionHandler.logger.error(exception.message, exception.stack);
|
|
10
|
-
}
|
|
11
|
-
return ExceptionHandler.logger.error(exception.what(), exception.stack);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
exports.ExceptionHandler = ExceptionHandler;
|
|
15
|
-
ExceptionHandler.logger = new logger_service_1.Logger(ExceptionHandler.name);
|
package/exceptions/zone/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./handler"), exports);
|
|
18
|
-
__exportStar(require("./zone"), exports);
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare class ExceptionsZone {
|
|
2
|
-
private static readonly exceptionHandler;
|
|
3
|
-
static run(callback: () => void, teardown?: (err: any) => void, autoFlushLogs?: boolean): void;
|
|
4
|
-
static asyncRun(callback: () => Promise<void>, teardown?: (err: any) => void, autoFlushLogs?: boolean): Promise<void>;
|
|
5
|
-
}
|
package/exceptions/zone/zone.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ExceptionsZone = void 0;
|
|
4
|
-
const handler_1 = require("@venok/core/exceptions/zone/handler");
|
|
5
|
-
const logger_service_1 = require("@venok/core/services/logger.service");
|
|
6
|
-
const DEFAULT_TEARDOWN = () => process.exit(1);
|
|
7
|
-
class ExceptionsZone {
|
|
8
|
-
static run(callback, teardown = DEFAULT_TEARDOWN, autoFlushLogs) {
|
|
9
|
-
try {
|
|
10
|
-
callback();
|
|
11
|
-
}
|
|
12
|
-
catch (e) {
|
|
13
|
-
this.exceptionHandler.handle(e);
|
|
14
|
-
if (autoFlushLogs)
|
|
15
|
-
logger_service_1.Logger.flush();
|
|
16
|
-
teardown(e);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
static async asyncRun(callback, teardown = DEFAULT_TEARDOWN, autoFlushLogs) {
|
|
20
|
-
try {
|
|
21
|
-
await callback();
|
|
22
|
-
}
|
|
23
|
-
catch (e) {
|
|
24
|
-
this.exceptionHandler.handle(e);
|
|
25
|
-
if (autoFlushLogs)
|
|
26
|
-
logger_service_1.Logger.flush();
|
|
27
|
-
teardown(e);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.ExceptionsZone = ExceptionsZone;
|
|
32
|
-
ExceptionsZone.exceptionHandler = new handler_1.ExceptionHandler();
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { VenokContainer } from "@venok/core/injector/container";
|
|
2
|
-
import { ContextCreator } from "@venok/core/context/creator";
|
|
3
|
-
import { Type } from "@venok/core/interfaces";
|
|
4
|
-
import { InstanceWrapper } from "@venok/core/injector/instance/wrapper";
|
|
5
|
-
import { ExceptionFilter } from "@venok/core/interfaces/features/exception-filter.interface";
|
|
6
|
-
export declare class ExceptionFilterContextCreator extends ContextCreator {
|
|
7
|
-
private readonly container;
|
|
8
|
-
protected moduleContext: string;
|
|
9
|
-
constructor(container: VenokContainer);
|
|
10
|
-
createConcreteContext<T extends any[], R extends any[]>(metadata: T, contextId?: import("@venok/core/injector/instance/wrapper").ContextId, inquirerId?: string): R;
|
|
11
|
-
getFilterInstance(filter: Function | ExceptionFilter, contextId?: import("@venok/core/injector/instance/wrapper").ContextId, inquirerId?: string): ExceptionFilter | null;
|
|
12
|
-
getInstanceByMetatype(metatype: Type): InstanceWrapper | undefined;
|
|
13
|
-
reflectCatchExceptions(instance: ExceptionFilter): Type[];
|
|
14
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ExceptionFilterContextCreator = void 0;
|
|
4
|
-
const creator_1 = require("@venok/core/context/creator");
|
|
5
|
-
const constants_1 = require("@venok/core/injector/constants");
|
|
6
|
-
const shared_helper_1 = require("@venok/core/helpers/shared.helper");
|
|
7
|
-
const constants_2 = require("@venok/core/constants");
|
|
8
|
-
class ExceptionFilterContextCreator extends creator_1.ContextCreator {
|
|
9
|
-
constructor(container) {
|
|
10
|
-
super();
|
|
11
|
-
this.container = container;
|
|
12
|
-
}
|
|
13
|
-
createConcreteContext(metadata, contextId = constants_1.STATIC_CONTEXT, inquirerId) {
|
|
14
|
-
if ((0, shared_helper_1.isEmpty)(metadata))
|
|
15
|
-
return [];
|
|
16
|
-
return metadata
|
|
17
|
-
.filter((instance) => instance && ((0, shared_helper_1.isFunction)(instance.catch) || instance.name))
|
|
18
|
-
.map((filter) => this.getFilterInstance(filter, contextId, inquirerId))
|
|
19
|
-
.filter(Boolean)
|
|
20
|
-
.map((instance) => ({
|
|
21
|
-
func: instance.catch.bind(instance),
|
|
22
|
-
exceptionMetatypes: this.reflectCatchExceptions(instance),
|
|
23
|
-
}));
|
|
24
|
-
}
|
|
25
|
-
getFilterInstance(filter, contextId = constants_1.STATIC_CONTEXT, inquirerId) {
|
|
26
|
-
if ("catch" in filter)
|
|
27
|
-
return filter;
|
|
28
|
-
const instanceWrapper = this.getInstanceByMetatype(filter);
|
|
29
|
-
if (!instanceWrapper)
|
|
30
|
-
return null;
|
|
31
|
-
const instanceHost = instanceWrapper.getInstanceByContextId(this.getContextId(contextId, instanceWrapper), inquirerId);
|
|
32
|
-
return instanceHost && instanceHost.instance;
|
|
33
|
-
}
|
|
34
|
-
getInstanceByMetatype(metatype) {
|
|
35
|
-
if (!this.moduleContext)
|
|
36
|
-
return;
|
|
37
|
-
const collection = this.container.getModules();
|
|
38
|
-
const moduleRef = collection.get(this.moduleContext);
|
|
39
|
-
if (!moduleRef)
|
|
40
|
-
return;
|
|
41
|
-
return moduleRef.injectables.get(metatype);
|
|
42
|
-
}
|
|
43
|
-
reflectCatchExceptions(instance) {
|
|
44
|
-
const prototype = Object.getPrototypeOf(instance);
|
|
45
|
-
return Reflect.getMetadata(constants_2.FILTER_CATCH_EXCEPTIONS, prototype.constructor) || [];
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
exports.ExceptionFilterContextCreator = ExceptionFilterContextCreator;
|
package/filters/context.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { VenokContainer } from "@venok/core/injector/container";
|
|
2
|
-
import { ApplicationConfig } from "@venok/core/application/config";
|
|
3
|
-
import { ExceptionFilterContextCreator } from "@venok/core/filters/context-creator";
|
|
4
|
-
import { ExceptionFilter } from "@venok/core/interfaces/features/exception-filter.interface";
|
|
5
|
-
import { VenokExceptionsHandler } from "@venok/core/exceptions/handler";
|
|
6
|
-
export declare class VenokExceptionFilterContext extends ExceptionFilterContextCreator {
|
|
7
|
-
private readonly config?;
|
|
8
|
-
constructor(container: VenokContainer, config?: ApplicationConfig | undefined);
|
|
9
|
-
create(instance: object, callback: (...args: any) => void, module: string, contextId?: import("@venok/core/injector/instance/wrapper").ContextId, inquirerId?: string): VenokExceptionsHandler;
|
|
10
|
-
getExceptionFilter(): ExceptionFilter;
|
|
11
|
-
getGlobalMetadata<T extends any[]>(contextId?: import("@venok/core/injector/instance/wrapper").ContextId, inquirerId?: string): T;
|
|
12
|
-
}
|
package/filters/context.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VenokExceptionFilterContext = void 0;
|
|
4
|
-
const context_creator_1 = require("@venok/core/filters/context-creator");
|
|
5
|
-
const constants_1 = require("@venok/core/injector/constants");
|
|
6
|
-
const constants_2 = require("@venok/core/constants");
|
|
7
|
-
const shared_helper_1 = require("@venok/core/helpers/shared.helper");
|
|
8
|
-
const handler_1 = require("@venok/core/exceptions/handler");
|
|
9
|
-
const filter_1 = require("@venok/core/filters/filter");
|
|
10
|
-
class VenokExceptionFilterContext extends context_creator_1.ExceptionFilterContextCreator {
|
|
11
|
-
constructor(container, config) {
|
|
12
|
-
super(container);
|
|
13
|
-
this.config = config;
|
|
14
|
-
}
|
|
15
|
-
create(instance, callback, module, contextId = constants_1.STATIC_CONTEXT, inquirerId) {
|
|
16
|
-
this.moduleContext = module;
|
|
17
|
-
const exceptionHandler = new handler_1.VenokExceptionsHandler(this.getExceptionFilter());
|
|
18
|
-
const filters = this.createContext(instance, callback, constants_2.EXCEPTION_FILTERS_METADATA, contextId, inquirerId);
|
|
19
|
-
if ((0, shared_helper_1.isEmpty)(filters))
|
|
20
|
-
return exceptionHandler;
|
|
21
|
-
exceptionHandler.setCustomFilters(filters.reverse());
|
|
22
|
-
return exceptionHandler;
|
|
23
|
-
}
|
|
24
|
-
getExceptionFilter() {
|
|
25
|
-
return new filter_1.VenokExceptionFilter();
|
|
26
|
-
}
|
|
27
|
-
getGlobalMetadata(contextId = constants_1.STATIC_CONTEXT, inquirerId) {
|
|
28
|
-
if (!this.config)
|
|
29
|
-
return [];
|
|
30
|
-
const globalFilters = this.config.getGlobalFilters();
|
|
31
|
-
if (contextId === constants_1.STATIC_CONTEXT && !inquirerId)
|
|
32
|
-
return globalFilters;
|
|
33
|
-
const scopedFilterWrappers = this.config.getGlobalRequestFilters();
|
|
34
|
-
const scopedFilters = scopedFilterWrappers
|
|
35
|
-
.map((wrapper) => wrapper.getInstanceByContextId(contextId, inquirerId))
|
|
36
|
-
.filter((host) => !!host)
|
|
37
|
-
.map((host) => host.instance);
|
|
38
|
-
return globalFilters.concat(scopedFilters);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.VenokExceptionFilterContext = VenokExceptionFilterContext;
|
package/filters/filter.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ArgumentsHost } from "@venok/core/interfaces/context/arguments-host.interface";
|
|
2
|
-
import { ExceptionFilter } from "@venok/core/interfaces/features/exception-filter.interface";
|
|
3
|
-
export declare class VenokExceptionFilter<T = any, R = any> implements ExceptionFilter {
|
|
4
|
-
private static readonly logger;
|
|
5
|
-
catch(exception: T, host: ArgumentsHost): void;
|
|
6
|
-
}
|
package/filters/filter.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VenokExceptionFilter = void 0;
|
|
4
|
-
const logger_service_1 = require("@venok/core/services/logger.service");
|
|
5
|
-
const exceptions_1 = require("@venok/core/errors/exceptions");
|
|
6
|
-
class VenokExceptionFilter {
|
|
7
|
-
catch(exception, host) {
|
|
8
|
-
if (exception instanceof exceptions_1.RuntimeException) {
|
|
9
|
-
return VenokExceptionFilter.logger.error(exception.what(), exception.stack);
|
|
10
|
-
}
|
|
11
|
-
if (exception instanceof Error)
|
|
12
|
-
return VenokExceptionFilter.logger.error(exception.message, exception.stack);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.VenokExceptionFilter = VenokExceptionFilter;
|
|
16
|
-
VenokExceptionFilter.logger = new logger_service_1.Logger("ExternalExceptionsHandler");
|
package/filters/index.d.ts
DELETED
package/filters/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./context"), exports);
|
|
18
|
-
__exportStar(require("./context-creator"), exports);
|
|
19
|
-
__exportStar(require("./filter"), exports);
|
package/guards/consumer.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ContextType } from "@venok/core/interfaces/context/arguments-host.interface";
|
|
2
|
-
import { ExecutionContextHost } from "@venok/core/context/execution-host";
|
|
3
|
-
import { Observable } from "rxjs";
|
|
4
|
-
import { CanActivate } from "@venok/core/interfaces/features/guards.interface";
|
|
5
|
-
export declare class GuardsConsumer {
|
|
6
|
-
tryActivate<TContext extends string = ContextType>(guards: CanActivate[], args: unknown[], instance: object, callback: (...args: unknown[]) => unknown, type?: TContext): Promise<boolean>;
|
|
7
|
-
createContext(args: unknown[], instance: object, callback: (...args: unknown[]) => unknown): ExecutionContextHost;
|
|
8
|
-
pickResult(result: boolean | Promise<boolean> | Observable<boolean>): Promise<boolean>;
|
|
9
|
-
}
|
package/guards/consumer.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GuardsConsumer = void 0;
|
|
4
|
-
const shared_helper_1 = require("@venok/core/helpers/shared.helper");
|
|
5
|
-
const execution_host_1 = require("@venok/core/context/execution-host");
|
|
6
|
-
const rxjs_1 = require("rxjs");
|
|
7
|
-
class GuardsConsumer {
|
|
8
|
-
async tryActivate(guards, args, instance, callback, type) {
|
|
9
|
-
if (!guards || (0, shared_helper_1.isEmpty)(guards)) {
|
|
10
|
-
return true;
|
|
11
|
-
}
|
|
12
|
-
const context = this.createContext(args, instance, callback);
|
|
13
|
-
context.setType(type);
|
|
14
|
-
for (const guard of guards) {
|
|
15
|
-
const result = guard.canActivate(context);
|
|
16
|
-
if (await this.pickResult(result)) {
|
|
17
|
-
continue;
|
|
18
|
-
}
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
createContext(args, instance, callback) {
|
|
24
|
-
return new execution_host_1.ExecutionContextHost(args, instance.constructor, callback);
|
|
25
|
-
}
|
|
26
|
-
async pickResult(result) {
|
|
27
|
-
if (result instanceof rxjs_1.Observable) {
|
|
28
|
-
return (0, rxjs_1.lastValueFrom)(result);
|
|
29
|
-
}
|
|
30
|
-
return result;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.GuardsConsumer = GuardsConsumer;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { VenokContainer } from "@venok/core/injector/container";
|
|
2
|
-
import { ApplicationConfig } from "@venok/core/application/config";
|
|
3
|
-
import { ContextCreator } from "@venok/core/context/creator";
|
|
4
|
-
import { CanActivate } from "@venok/core/interfaces/features/guards.interface";
|
|
5
|
-
import { Type } from "@venok/core/interfaces";
|
|
6
|
-
import { InstanceWrapper } from "@venok/core/injector/instance/wrapper";
|
|
7
|
-
export declare class GuardsContextCreator extends ContextCreator {
|
|
8
|
-
private readonly container;
|
|
9
|
-
private readonly config?;
|
|
10
|
-
private moduleContext;
|
|
11
|
-
constructor(container: VenokContainer, config?: ApplicationConfig | undefined);
|
|
12
|
-
create(instance: object, callback: (...args: unknown[]) => unknown, module: string, contextId?: import("@venok/core/injector/instance/wrapper").ContextId, inquirerId?: string): CanActivate[];
|
|
13
|
-
createConcreteContext<T extends unknown[], R extends unknown[]>(metadata: T, contextId?: import("@venok/core/injector/instance/wrapper").ContextId, inquirerId?: string): R;
|
|
14
|
-
getGuardInstance(metatype: Function | CanActivate, contextId?: import("@venok/core/injector/instance/wrapper").ContextId, inquirerId?: string): CanActivate | null;
|
|
15
|
-
getInstanceByMetatype(metatype: Type): InstanceWrapper | undefined;
|
|
16
|
-
getGlobalMetadata<T extends unknown[]>(contextId?: import("@venok/core/injector/instance/wrapper").ContextId, inquirerId?: string): T;
|
|
17
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GuardsContextCreator = void 0;
|
|
4
|
-
const creator_1 = require("@venok/core/context/creator");
|
|
5
|
-
const constants_1 = require("@venok/core/injector/constants");
|
|
6
|
-
const constants_2 = require("@venok/core/constants");
|
|
7
|
-
const shared_helper_1 = require("@venok/core/helpers/shared.helper");
|
|
8
|
-
class GuardsContextCreator extends creator_1.ContextCreator {
|
|
9
|
-
constructor(container, config) {
|
|
10
|
-
super();
|
|
11
|
-
this.container = container;
|
|
12
|
-
this.config = config;
|
|
13
|
-
}
|
|
14
|
-
create(instance, callback, module, contextId = constants_1.STATIC_CONTEXT, inquirerId) {
|
|
15
|
-
this.moduleContext = module;
|
|
16
|
-
return this.createContext(instance, callback, constants_2.GUARDS_METADATA, contextId, inquirerId);
|
|
17
|
-
}
|
|
18
|
-
createConcreteContext(metadata, contextId = constants_1.STATIC_CONTEXT, inquirerId) {
|
|
19
|
-
if ((0, shared_helper_1.isEmpty)(metadata)) {
|
|
20
|
-
return [];
|
|
21
|
-
}
|
|
22
|
-
return metadata
|
|
23
|
-
.filter((guard) => guard && (guard.name || guard.canActivate))
|
|
24
|
-
.map((guard) => this.getGuardInstance(guard, contextId, inquirerId))
|
|
25
|
-
.filter((guard) => guard && (0, shared_helper_1.isFunction)(guard.canActivate));
|
|
26
|
-
}
|
|
27
|
-
getGuardInstance(metatype, contextId = constants_1.STATIC_CONTEXT, inquirerId) {
|
|
28
|
-
const isObject = metatype.canActivate;
|
|
29
|
-
// Maybe error
|
|
30
|
-
// @ts-ignore
|
|
31
|
-
if (isObject) {
|
|
32
|
-
return metatype;
|
|
33
|
-
}
|
|
34
|
-
const instanceWrapper = this.getInstanceByMetatype(metatype);
|
|
35
|
-
if (!instanceWrapper) {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
const instanceHost = instanceWrapper.getInstanceByContextId(this.getContextId(contextId, instanceWrapper), inquirerId);
|
|
39
|
-
return instanceHost && instanceHost.instance;
|
|
40
|
-
}
|
|
41
|
-
getInstanceByMetatype(metatype) {
|
|
42
|
-
if (!this.moduleContext) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
const collection = this.container.getModules();
|
|
46
|
-
const moduleRef = collection.get(this.moduleContext);
|
|
47
|
-
if (!moduleRef) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
const injectables = moduleRef.injectables;
|
|
51
|
-
return injectables.get(metatype);
|
|
52
|
-
}
|
|
53
|
-
getGlobalMetadata(contextId = constants_1.STATIC_CONTEXT, inquirerId) {
|
|
54
|
-
if (!this.config) {
|
|
55
|
-
return [];
|
|
56
|
-
}
|
|
57
|
-
const globalGuards = this.config.getGlobalGuards();
|
|
58
|
-
if (contextId === constants_1.STATIC_CONTEXT && !inquirerId) {
|
|
59
|
-
return globalGuards;
|
|
60
|
-
}
|
|
61
|
-
const scopedGuardWrappers = this.config.getGlobalRequestGuards();
|
|
62
|
-
const scopedGuards = scopedGuardWrappers
|
|
63
|
-
.map((wrapper) => wrapper.getInstanceByContextId(this.getContextId(contextId, wrapper), inquirerId))
|
|
64
|
-
.filter((host) => !!host)
|
|
65
|
-
.map((host) => host.instance);
|
|
66
|
-
return globalGuards.concat(scopedGuards);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
exports.GuardsContextCreator = GuardsContextCreator;
|
package/guards/index.d.ts
DELETED
package/guards/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./consumer"), exports);
|
|
18
|
-
__exportStar(require("./context-creator"), exports);
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const colors: {
|
|
2
|
-
bold: (text: string) => string;
|
|
3
|
-
green: (text: string) => string;
|
|
4
|
-
yellow: (text: string) => string;
|
|
5
|
-
red: (text: string) => string;
|
|
6
|
-
magentaBright: (text: string) => string;
|
|
7
|
-
cyanBright: (text: string) => string;
|
|
8
|
-
};
|
|
9
|
-
export declare const yellow: (text: string) => string;
|
package/helpers/color.helper.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.yellow = exports.colors = void 0;
|
|
4
|
-
const isColorAllowed = () => !process.env.NO_COLOR;
|
|
5
|
-
const colorIfAllowed = (colorFn) => (text) => (isColorAllowed() ? colorFn(text) : text);
|
|
6
|
-
exports.colors = {
|
|
7
|
-
bold: colorIfAllowed((text) => `\x1B[1m${text}\x1B[0m`),
|
|
8
|
-
green: colorIfAllowed((text) => `\x1B[32m${text}\x1B[39m`),
|
|
9
|
-
yellow: colorIfAllowed((text) => `\x1B[33m${text}\x1B[39m`),
|
|
10
|
-
red: colorIfAllowed((text) => `\x1B[31m${text}\x1B[39m`),
|
|
11
|
-
magentaBright: colorIfAllowed((text) => `\x1B[95m${text}\x1B[39m`),
|
|
12
|
-
cyanBright: colorIfAllowed((text) => `\x1B[96m${text}\x1B[39m`),
|
|
13
|
-
};
|
|
14
|
-
exports.yellow = colorIfAllowed((text) => `\x1B[38;5;3m${text}\x1B[39m`);
|