framework-do-dede 3.0.15 → 3.0.17

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.
@@ -15,15 +15,15 @@ export interface TracerData {
15
15
  error?: any;
16
16
  headers: Record<string, string>;
17
17
  }
18
- export interface Tracer {
19
- trace(data: TracerData): Promise<any>;
18
+ export interface Tracer<R> {
19
+ trace(data: TracerData): R;
20
20
  }
21
21
  export interface Input<T, K = any> {
22
22
  data: T;
23
23
  context?: K;
24
24
  }
25
25
  export declare function Controller(basePath?: string): (target: any) => void;
26
- export declare function Tracing(tracer: Tracer): (target: any, propertyKey?: string) => void;
26
+ export declare function Tracing<R>(tracer: Tracer<R>): (target: any, propertyKey?: string) => void;
27
27
  export declare function getControllers(): any[];
28
28
  export declare function flushControllers(): void;
29
29
  export declare function UseMiddleware(middlewareClass: new (...args: any[]) => Middleware): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
@@ -96,22 +96,12 @@ export class Entity {
96
96
  this[`get${property[0].toUpperCase()}${property.slice(1)}`] = () => this[property];
97
97
  continue;
98
98
  }
99
- if (!this[property]) {
100
- // @ts-ignore
101
- const prefixName = this.constructor.propertiesConfigs[property].prefix;
102
- const getterName = `${prefixName}${property[0].toUpperCase()}${property.slice(1)}`;
103
- if (this[getterName])
104
- continue;
105
- this[getterName] = () => this[property];
106
- }
107
- else {
108
- // @ts-ignore
109
- const prefixName = this.constructor.propertiesConfigs[property]?.prefix || (typeof this[property] === 'boolean' ? 'is' : 'get');
110
- const getterName = `${prefixName}${property[0].toUpperCase()}${property.slice(1)}`;
111
- if (this[getterName])
112
- continue;
113
- this[getterName] = () => this[property];
114
- }
99
+ // @ts-ignore
100
+ const prefixName = this.constructor.propertiesConfigs[property]?.prefix || (typeof this[property] === 'boolean' ? 'is' : 'get');
101
+ const getterName = `${prefixName}${property[0].toUpperCase()}${property.slice(1)}`;
102
+ if (this[getterName])
103
+ continue;
104
+ this[getterName] = () => this[property];
115
105
  }
116
106
  }
117
107
  constructor() {
@@ -11,7 +11,7 @@ export type HttpServerParams = {
11
11
  handler: {
12
12
  instance: any;
13
13
  methodName: string;
14
- tracer?: Tracer;
14
+ tracer?: Tracer<any>;
15
15
  };
16
16
  responseType: 'json' | 'text' | 'html';
17
17
  middlewares?: Middleware[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framework-do-dede",
3
- "version": "3.0.15",
3
+ "version": "3.0.17",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",