framework-do-dede 1.0.23 → 1.0.24
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/decorators/services.js +6 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/utils/Testing.d.ts +6 -0
- package/dist/utils/Testing.js +12 -0
- package/package.json +1 -1
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { Registry } from "../di/registry";
|
|
2
2
|
import { StorageGateway } from "../protocols/StorageGateway";
|
|
3
|
+
import { Log } from "../utils/Log";
|
|
4
|
+
import { Testing } from "../utils/Testing";
|
|
3
5
|
export function Storage(gatewayName) {
|
|
4
6
|
return function (target, propertyKey) {
|
|
7
|
+
if (Testing.isEnabled()) {
|
|
8
|
+
Log.info(`@Storage ${gatewayName} is ignored in testing mode`);
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
5
11
|
// Verifica se a classe está registrada
|
|
6
12
|
if (!Registry.has(gatewayName)) {
|
|
7
13
|
throw new Error(`StorageGateway ${gatewayName} not registered`);
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ import { Controller, Post, Put, Get, Delete, Patch, Validator, Middleware, Conte
|
|
|
3
3
|
import { BadRequest, Conflict, Forbidden, HttpServer, NotFound, ServerError, Unauthorized, UnprocessableEntity } from './http';
|
|
4
4
|
import { Validation, HttpMiddleware, UseCase, CreateRepository, ExistsById, DeleteRepository, UpdateRepository, RestoreRepository, RestoreManyRepository, RequestMetricsHandler, RequestData, RequestMetrics, HttpServerError, StorageGateway } from './protocols';
|
|
5
5
|
import { Entity } from './domain/Entity';
|
|
6
|
+
import { Testing } from './utils/Testing';
|
|
6
7
|
declare class UseCaseHandler {
|
|
7
8
|
static load<T extends UseCase<any, any>>(useCaseClass: new (...args: any[]) => T, request?: RequestData): T;
|
|
8
9
|
}
|
|
9
|
-
export { UseCase, HttpMiddleware, Validation, RequestMetricsHandler, RequestMetrics, HttpServerError, CreateRepository, DeleteRepository, UpdateRepository, RestoreRepository, ExistsById, RestoreManyRepository, RequestData, Dede, DedeRegister, DedeOptions, UseCaseHandler, ServerError, BadRequest, Conflict, Forbidden, HttpServer, NotFound, Unauthorized, UnprocessableEntity, Controller, Post, Put, Get, Delete, Patch, Validator, Middleware, Context, Inject, Entity, Restrict, DbColumn, VirtualProperty, Metrics, OffConsoleLog, StorageGateway, Storage };
|
|
10
|
+
export { UseCase, HttpMiddleware, Validation, RequestMetricsHandler, RequestMetrics, HttpServerError, CreateRepository, DeleteRepository, UpdateRepository, RestoreRepository, ExistsById, RestoreManyRepository, RequestData, Dede, DedeRegister, DedeOptions, UseCaseHandler, ServerError, BadRequest, Conflict, Forbidden, HttpServer, NotFound, Unauthorized, UnprocessableEntity, Controller, Post, Put, Get, Delete, Patch, Validator, Middleware, Context, Inject, Entity, Restrict, DbColumn, VirtualProperty, Metrics, OffConsoleLog, StorageGateway, Storage, Testing };
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { Controller, Post, Put, Get, Delete, Patch, Validator, Middleware, Conte
|
|
|
3
3
|
import { BadRequest, Conflict, Forbidden, HttpServer, NotFound, ServerError, Unauthorized, UnprocessableEntity } from './http';
|
|
4
4
|
import { Registry } from './di/registry';
|
|
5
5
|
import { Entity } from './domain/Entity';
|
|
6
|
+
import { Testing } from './utils/Testing';
|
|
6
7
|
class UseCaseHandler {
|
|
7
8
|
static load(useCaseClass, request) {
|
|
8
9
|
const instance = Registry.classLoader(useCaseClass);
|
|
@@ -16,4 +17,4 @@ class UseCaseHandler {
|
|
|
16
17
|
return instance;
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
|
-
export { Dede, UseCaseHandler, ServerError, BadRequest, Conflict, Forbidden, HttpServer, NotFound, Unauthorized, UnprocessableEntity, Controller, Post, Put, Get, Delete, Patch, Validator, Middleware, Context, Inject, Entity, Restrict, DbColumn, VirtualProperty, Metrics, OffConsoleLog, Storage };
|
|
20
|
+
export { Dede, UseCaseHandler, ServerError, BadRequest, Conflict, Forbidden, HttpServer, NotFound, Unauthorized, UnprocessableEntity, Controller, Post, Put, Get, Delete, Patch, Validator, Middleware, Context, Inject, Entity, Restrict, DbColumn, VirtualProperty, Metrics, OffConsoleLog, Storage, Testing };
|