framework-do-dede 0.0.31 → 0.0.32

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.
@@ -34,3 +34,4 @@ export declare function Delete(config?: {
34
34
  }): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
35
35
  export declare function Validator(validationClass: new () => Validation): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
36
36
  export declare function Metrics(...handlers: (new (...args: any[]) => RequestMetricsHandler)[]): MethodDecorator;
37
+ export declare function OffConsoleLog(): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
@@ -86,3 +86,8 @@ export function Metrics(...handlers) {
86
86
  Reflect.defineMetadata('metricsHandlers', handlers, target, propertyKey);
87
87
  };
88
88
  }
89
+ export function OffConsoleLog() {
90
+ return function (target, propertyKey, descriptor) {
91
+ Reflect.defineMetadata('offConsoleLog', true, target, propertyKey);
92
+ };
93
+ }
@@ -1,5 +1,5 @@
1
- import { Controller, Post, Get, Put, Delete, Patch, Validator, Middleware } from './controller';
1
+ import { Controller, Post, Get, Put, Delete, Patch, Validator, Middleware, Metrics, OffConsoleLog } from './controller';
2
2
  import { Auth } from './usecase';
3
3
  import { Inject } from './di';
4
4
  import { Restrict } from './entity';
5
- export { Controller, Middleware, Validator, Post, Get, Put, Delete, Patch, Auth, Inject, Restrict };
5
+ export { Controller, Middleware, Validator, Metrics, OffConsoleLog, Post, Get, Put, Delete, Patch, Auth, Inject, Restrict };
@@ -1,5 +1,5 @@
1
- import { Controller, Post, Get, Put, Delete, Patch, Validator, Middleware } from './controller';
1
+ import { Controller, Post, Get, Put, Delete, Patch, Validator, Middleware, Metrics, OffConsoleLog } from './controller';
2
2
  import { Auth } from './usecase';
3
3
  import { Inject } from './di';
4
4
  import { Restrict } from './entity';
5
- export { Controller, Middleware, Validator, Post, Get, Put, Delete, Patch, Auth, Inject, Restrict };
5
+ export { Controller, Middleware, Validator, Metrics, OffConsoleLog, Post, Get, Put, Delete, Patch, Auth, Inject, Restrict };
@@ -82,6 +82,7 @@ export default class ControllerHandler {
82
82
  const routeConfig = Reflect.getMetadata('route', controller.prototype, methodName);
83
83
  const middlewares = Reflect.getMetadata('middlewares', controller.prototype, methodName);
84
84
  const metricsHandlers = Reflect.getMetadata('metricsHandlers', controller.prototype, methodName);
85
+ const offConsoleLog = Reflect.getMetadata('offConsoleLog', controller.prototype, methodName) || false;
85
86
  controllers.push({
86
87
  method: routeConfig.method,
87
88
  route: basePath + routeConfig.path,
@@ -93,6 +94,7 @@ export default class ControllerHandler {
93
94
  middlewares: middlewares ? middlewares.map(middleware => Registry.classLoader(middleware)) : [],
94
95
  validation,
95
96
  metricsHandlers: metricsHandlers ? metricsHandlers.map(metricsHandler => Registry.classLoader(metricsHandler)) : [],
97
+ offLogs: offConsoleLog
96
98
  });
97
99
  }
98
100
  }
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Dede, Register as DedeRegister, Options as DedeOptions } from './dede';
2
- import { Controller, Post, Put, Get, Delete, Patch, Validator, Middleware, Auth, Inject, Restrict } from './decorators';
2
+ import { Controller, Post, Put, Get, Delete, Patch, Validator, Middleware, Auth, Inject, Restrict, Metrics, OffConsoleLog } from './decorators';
3
3
  import { BadRequest, Conflict, Forbidden, HttpServer, NotFound, ServerError, Unauthorized, UnprocessableEntity } from './http';
4
4
  import { Validation, HttpMiddleware, UseCase, CreateRepository, DeleteRepository, UpdateRepository, RestoreRepository, RequestMetricsHandler } from './protocols';
5
5
  import { Entity } from './domain/Entity';
@@ -12,4 +12,4 @@ declare class RequestData {
12
12
  declare class UseCaseHandler {
13
13
  static load<T extends UseCase<any, any>>(useCaseClass: new (...args: any[]) => T, request?: RequestData): T;
14
14
  }
15
- export { UseCase, HttpMiddleware, Validation, RequestMetricsHandler, CreateRepository, DeleteRepository, UpdateRepository, RestoreRepository, RequestData, Dede, DedeRegister, DedeOptions, UseCaseHandler, ServerError, BadRequest, Conflict, Forbidden, HttpServer, NotFound, Unauthorized, UnprocessableEntity, Controller, Post, Put, Get, Delete, Patch, Validator, Middleware, Auth, Inject, Entity, Restrict };
15
+ export { UseCase, HttpMiddleware, Validation, RequestMetricsHandler, CreateRepository, DeleteRepository, UpdateRepository, RestoreRepository, RequestData, Dede, DedeRegister, DedeOptions, UseCaseHandler, ServerError, BadRequest, Conflict, Forbidden, HttpServer, NotFound, Unauthorized, UnprocessableEntity, Controller, Post, Put, Get, Delete, Patch, Validator, Middleware, Auth, Inject, Entity, Restrict, Metrics, OffConsoleLog };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Dede } from './dede';
2
- import { Controller, Post, Put, Get, Delete, Patch, Validator, Middleware, Auth, Inject, Restrict } from './decorators';
2
+ import { Controller, Post, Put, Get, Delete, Patch, Validator, Middleware, Auth, Inject, Restrict, Metrics, OffConsoleLog } from './decorators';
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';
@@ -24,4 +24,4 @@ class UseCaseHandler {
24
24
  return instance;
25
25
  }
26
26
  }
27
- export { RequestData, Dede, UseCaseHandler, ServerError, BadRequest, Conflict, Forbidden, HttpServer, NotFound, Unauthorized, UnprocessableEntity, Controller, Post, Put, Get, Delete, Patch, Validator, Middleware, Auth, Inject, Entity, Restrict };
27
+ export { RequestData, Dede, UseCaseHandler, ServerError, BadRequest, Conflict, Forbidden, HttpServer, NotFound, Unauthorized, UnprocessableEntity, Controller, Post, Put, Get, Delete, Patch, Validator, Middleware, Auth, Inject, Entity, Restrict, Metrics, OffConsoleLog };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framework-do-dede",
3
- "version": "0.0.31",
3
+ "version": "0.0.32",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",