@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.
- package/constants.d.ts +0 -2
- package/constants.js +1 -3
- package/context/{external/creator.d.ts → context.d.ts} +12 -9
- package/context/{external/creator.js → context.js} +23 -26
- package/context/execution-host.d.ts +1 -1
- package/context/index.d.ts +4 -0
- package/context/index.js +20 -0
- package/context/proxy.d.ts +6 -0
- package/context/proxy.js +33 -0
- package/decorators/catch.decorator.d.ts +1 -1
- package/errors/exceptions/invalid-class-scope.exception.d.ts +1 -1
- package/errors/exceptions/undefined-forwardref.exception.d.ts +1 -1
- package/errors/messages.d.ts +1 -1
- package/exceptions/handler.d.ts +10 -0
- package/exceptions/{external/handler.js → handler.js} +14 -11
- package/exceptions/index.d.ts +2 -0
- package/exceptions/index.js +18 -0
- package/exceptions/zone/index.d.ts +2 -0
- package/exceptions/zone/index.js +18 -0
- package/{exceptions/filter-context.d.ts → filters/context-creator.d.ts} +3 -3
- package/{exceptions/filter-context.js → filters/context-creator.js} +8 -15
- package/filters/context.d.ts +12 -0
- package/{exceptions/external/filter-context.js → filters/context.js} +10 -6
- package/filters/filter.d.ts +6 -0
- package/filters/filter.js +16 -0
- package/filters/index.d.ts +3 -0
- package/filters/index.js +19 -0
- package/guards/context-creator.d.ts +1 -1
- package/injector/container.d.ts +7 -7
- package/injector/helpers/class-scope.helper.d.ts +1 -1
- package/injector/helpers/is-durable.helper.d.ts +1 -1
- package/injector/injector.d.ts +2 -2
- package/injector/internal-core-module/internal-core-module-factory.js +10 -5
- package/injector/module/compiler.d.ts +5 -5
- package/injector/module/lazy/loader.d.ts +1 -1
- package/injector/module/module.d.ts +2 -2
- package/injector/module/token-factory.d.ts +3 -3
- package/inspector/serialized-graph.js +1 -1
- package/interceptors/context-creator.d.ts +1 -1
- package/interfaces/context/index.d.ts +2 -0
- package/interfaces/context/index.js +18 -0
- package/interfaces/features/index.d.ts +4 -0
- package/interfaces/features/index.js +20 -0
- package/interfaces/features/pipes.interface.d.ts +1 -1
- package/interfaces/index.d.ts +2 -0
- package/interfaces/index.js +2 -0
- package/interfaces/modules/definition.interface.d.ts +1 -1
- package/interfaces/modules/dynamic-module.interface.d.ts +1 -1
- package/interfaces/modules/module-metadata.interface.d.ts +1 -1
- package/interfaces/modules/provider.interface.d.ts +1 -1
- package/package.json +1 -1
- package/pipes/context-creator.d.ts +1 -1
- package/scanner.d.ts +9 -9
- package/services/reflector.service.d.ts +8 -8
- package/test/context/{external/creator.spec.js → creator.spec.js} +4 -4
- package/test/context/{external/proxy.spec.js → proxy.spec.js} +10 -9
- package/test/exceptions/{external/handler.spec.js → handler.spec.js} +6 -5
- package/test/{exceptions/filter-context.spec.js → filters/context-creator.spec.js} +3 -3
- package/test/injector/internal-core-module/internal-core-module-factory.spec.js +3 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/context/external/proxy.d.ts +0 -5
- package/context/external/proxy.js +0 -19
- package/exceptions/external/filter-context.d.ts +0 -10
- package/exceptions/external/filter.d.ts +0 -5
- package/exceptions/external/filter.js +0 -16
- package/exceptions/external/handler.d.ts +0 -9
- package/exceptions/select-exception-filter-metadata.d.ts +0 -2
- package/exceptions/select-exception-filter-metadata.js +0 -6
- /package/test/context/{external/creator.spec.d.ts → creator.spec.d.ts} +0 -0
- /package/test/context/{external/proxy.spec.d.ts → proxy.spec.d.ts} +0 -0
- /package/test/exceptions/{external/handler.spec.d.ts → handler.spec.d.ts} +0 -0
- /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,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,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;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|