@venok/core 1.0.0 → 1.0.1-canary.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.
Files changed (72) hide show
  1. package/constants.d.ts +0 -2
  2. package/constants.js +1 -3
  3. package/context/{external/creator.d.ts → context.d.ts} +12 -9
  4. package/context/{external/creator.js → context.js} +23 -26
  5. package/context/execution-host.d.ts +1 -1
  6. package/context/index.d.ts +4 -0
  7. package/context/index.js +20 -0
  8. package/context/proxy.d.ts +6 -0
  9. package/context/proxy.js +33 -0
  10. package/decorators/catch.decorator.d.ts +1 -1
  11. package/errors/exceptions/invalid-class-scope.exception.d.ts +1 -1
  12. package/errors/exceptions/undefined-forwardref.exception.d.ts +1 -1
  13. package/errors/messages.d.ts +1 -1
  14. package/exceptions/handler.d.ts +10 -0
  15. package/exceptions/{external/handler.js → handler.js} +14 -11
  16. package/exceptions/index.d.ts +2 -0
  17. package/exceptions/index.js +18 -0
  18. package/exceptions/zone/index.d.ts +2 -0
  19. package/exceptions/zone/index.js +18 -0
  20. package/{exceptions/filter-context.d.ts → filters/context-creator.d.ts} +3 -3
  21. package/{exceptions/filter-context.js → filters/context-creator.js} +8 -15
  22. package/filters/context.d.ts +12 -0
  23. package/{exceptions/external/filter-context.js → filters/context.js} +10 -6
  24. package/filters/filter.d.ts +6 -0
  25. package/filters/filter.js +16 -0
  26. package/filters/index.d.ts +3 -0
  27. package/filters/index.js +19 -0
  28. package/guards/context-creator.d.ts +1 -1
  29. package/injector/container.d.ts +7 -7
  30. package/injector/helpers/class-scope.helper.d.ts +1 -1
  31. package/injector/helpers/is-durable.helper.d.ts +1 -1
  32. package/injector/injector.d.ts +2 -2
  33. package/injector/internal-core-module/internal-core-module-factory.js +10 -5
  34. package/injector/module/compiler.d.ts +5 -5
  35. package/injector/module/lazy/loader.d.ts +1 -1
  36. package/injector/module/module.d.ts +2 -2
  37. package/injector/module/token-factory.d.ts +3 -3
  38. package/inspector/serialized-graph.js +1 -1
  39. package/interceptors/context-creator.d.ts +1 -1
  40. package/interfaces/context/index.d.ts +2 -0
  41. package/interfaces/context/index.js +18 -0
  42. package/interfaces/features/index.d.ts +4 -0
  43. package/interfaces/features/index.js +20 -0
  44. package/interfaces/features/pipes.interface.d.ts +1 -1
  45. package/interfaces/index.d.ts +2 -0
  46. package/interfaces/index.js +2 -0
  47. package/interfaces/modules/definition.interface.d.ts +1 -1
  48. package/interfaces/modules/dynamic-module.interface.d.ts +1 -1
  49. package/interfaces/modules/module-metadata.interface.d.ts +1 -1
  50. package/interfaces/modules/provider.interface.d.ts +1 -1
  51. package/package.json +1 -1
  52. package/pipes/context-creator.d.ts +1 -1
  53. package/scanner.d.ts +9 -9
  54. package/services/reflector.service.d.ts +8 -8
  55. package/test/context/{external/creator.spec.js → creator.spec.js} +4 -4
  56. package/test/context/{external/proxy.spec.js → proxy.spec.js} +10 -9
  57. package/test/exceptions/{external/handler.spec.js → handler.spec.js} +6 -5
  58. package/test/{exceptions/filter-context.spec.js → filters/context-creator.spec.js} +3 -3
  59. package/test/injector/internal-core-module/internal-core-module-factory.spec.js +3 -3
  60. package/tsconfig.tsbuildinfo +1 -1
  61. package/context/external/proxy.d.ts +0 -5
  62. package/context/external/proxy.js +0 -19
  63. package/exceptions/external/filter-context.d.ts +0 -10
  64. package/exceptions/external/filter.d.ts +0 -5
  65. package/exceptions/external/filter.js +0 -16
  66. package/exceptions/external/handler.d.ts +0 -9
  67. package/exceptions/select-exception-filter-metadata.d.ts +0 -2
  68. package/exceptions/select-exception-filter-metadata.js +0 -6
  69. /package/test/context/{external/creator.spec.d.ts → creator.spec.d.ts} +0 -0
  70. /package/test/context/{external/proxy.spec.d.ts → proxy.spec.d.ts} +0 -0
  71. /package/test/exceptions/{external/handler.spec.d.ts → handler.spec.d.ts} +0 -0
  72. /package/test/{exceptions/filter-context.spec.d.ts → filters/context-creator.spec.d.ts} +0 -0
@@ -1,5 +0,0 @@
1
- import { ContextType } from "@venok/core/interfaces/context/arguments-host.interface";
2
- import { ExternalExceptionsHandler } from "@venok/core/exceptions/external/handler";
3
- export declare class ExternalErrorProxy {
4
- createProxy<TContext extends string = ContextType>(targetCallback: (...args: any[]) => any, exceptionsHandler: ExternalExceptionsHandler, type?: TContext): (...args: any[]) => Promise<any>;
5
- }
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ExternalErrorProxy = void 0;
4
- const execution_host_1 = require("@venok/core/context/execution-host");
5
- class ExternalErrorProxy {
6
- createProxy(targetCallback, exceptionsHandler, type) {
7
- return async (...args) => {
8
- try {
9
- return await targetCallback(...args);
10
- }
11
- catch (e) {
12
- const host = new execution_host_1.ExecutionContextHost(args);
13
- host.setType(type);
14
- return exceptionsHandler.next(e, host);
15
- }
16
- };
17
- }
18
- }
19
- exports.ExternalErrorProxy = ExternalErrorProxy;
@@ -1,10 +0,0 @@
1
- import { VenokContainer } from "@venok/core/injector/container";
2
- import { ApplicationConfig } from "@venok/core/application/config";
3
- import { BaseExceptionFilterContext } from "@venok/core/exceptions/filter-context";
4
- import { ExternalExceptionsHandler } from "@venok/core/exceptions/external/handler";
5
- export declare class ExternalExceptionFilterContext extends BaseExceptionFilterContext {
6
- private readonly config?;
7
- constructor(container: VenokContainer, config?: ApplicationConfig | undefined);
8
- create(instance: object, callback: () => void, module: string, contextId?: import("@venok/core/injector/instance/wrapper").ContextId, inquirerId?: string): ExternalExceptionsHandler;
9
- getGlobalMetadata<T extends any[]>(contextId?: import("@venok/core/injector/instance/wrapper").ContextId, inquirerId?: string): T;
10
- }
@@ -1,5 +0,0 @@
1
- import { ArgumentsHost } from "@venok/core/interfaces/context/arguments-host.interface";
2
- export declare class ExternalExceptionFilter<T = any, R = any> {
3
- private static readonly logger;
4
- catch(exception: T, host: ArgumentsHost): void;
5
- }
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ExternalExceptionFilter = void 0;
4
- const logger_service_1 = require("@venok/core/services/logger.service");
5
- const exceptions_1 = require("@venok/core/errors/exceptions");
6
- class ExternalExceptionFilter {
7
- catch(exception, host) {
8
- if (exception instanceof exceptions_1.RuntimeException) {
9
- return ExternalExceptionFilter.logger.error(exception.what(), exception.stack);
10
- }
11
- if (exception instanceof Error)
12
- return ExternalExceptionFilter.logger.error(exception.message, exception.stack);
13
- }
14
- }
15
- exports.ExternalExceptionFilter = ExternalExceptionFilter;
16
- ExternalExceptionFilter.logger = new logger_service_1.Logger("ExternalExceptionsHandler");
@@ -1,9 +0,0 @@
1
- import { ExternalExceptionFilter } from "@venok/core/exceptions/external/filter";
2
- import { ArgumentsHost } from "@venok/core/interfaces/context/arguments-host.interface";
3
- import { ExceptionFilterMetadata } from "@venok/core/interfaces/features/exception-filter.interface";
4
- export declare class ExternalExceptionsHandler extends ExternalExceptionFilter {
5
- private filters;
6
- next(exception: Error | any, host: ArgumentsHost): void | Promise<any>;
7
- setCustomFilters(filters: ExceptionFilterMetadata[]): void;
8
- invokeCustomFilters<T = any>(exception: T, host: ArgumentsHost): Promise<any> | null;
9
- }
@@ -1,2 +0,0 @@
1
- import { ExceptionFilterMetadata } from "@venok/core/interfaces/features/exception-filter.interface";
2
- export declare const selectExceptionFilterMetadata: <T = any>(filters: ExceptionFilterMetadata[], exception: T) => ExceptionFilterMetadata | undefined;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.selectExceptionFilterMetadata = void 0;
4
- const selectExceptionFilterMetadata = (filters, exception) => filters.find(({ exceptionMetatypes }) => !exceptionMetatypes.length ||
5
- exceptionMetatypes.some((ExceptionMetaType) => exception instanceof ExceptionMetaType));
6
- exports.selectExceptionFilterMetadata = selectExceptionFilterMetadata;