framework-do-dede 1.0.25 → 1.0.26
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.
|
@@ -1,13 +1,7 @@
|
|
|
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";
|
|
5
3
|
export function Storage(gatewayName) {
|
|
6
4
|
return function (target, propertyKey) {
|
|
7
|
-
if (Testing.isEnabled()) {
|
|
8
|
-
Log.info(`@Storage ${gatewayName} is ignored in testing mode`);
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
5
|
// Verifica se a classe está registrada
|
|
12
6
|
if (!Registry.has(gatewayName)) {
|
|
13
7
|
throw new Error(`StorageGateway ${gatewayName} not registered`);
|
|
@@ -112,7 +112,7 @@ export default class ControllerHandler {
|
|
|
112
112
|
if (middlewareData)
|
|
113
113
|
request.middlewareData = middlewareData;
|
|
114
114
|
try {
|
|
115
|
-
const response = await instance[instanceMethod](mergedParams, request);
|
|
115
|
+
const response = await instance[instanceMethod]({ input: mergedParams, request });
|
|
116
116
|
if (!offLogs) {
|
|
117
117
|
const endTime = performance.now();
|
|
118
118
|
Log.success(`✅ [LOG] Finish: "${logger.handler.instance}.${logger.handler.method}" - in: ${(endTime - startTime).toFixed(2)} ms`);
|
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +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 { 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';
|
|
7
6
|
declare class UseCaseHandler {
|
|
8
7
|
static load<T extends UseCase<any, any>>(useCaseClass: new (...args: any[]) => T, request?: RequestData): T;
|
|
9
8
|
}
|
|
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, Expose
|
|
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, Expose };
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,6 @@ 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';
|
|
7
6
|
class UseCaseHandler {
|
|
8
7
|
static load(useCaseClass, request) {
|
|
9
8
|
const instance = Registry.classLoader(useCaseClass);
|
|
@@ -17,4 +16,4 @@ class UseCaseHandler {
|
|
|
17
16
|
return instance;
|
|
18
17
|
}
|
|
19
18
|
}
|
|
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, Expose
|
|
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, Expose };
|
package/package.json
CHANGED
package/dist/utils/Testing.d.ts
DELETED