@takentrade/takentrade-libs 1.2.61 → 1.2.62
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/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/filters/http-exception.filter.js +0 -1
- package/dist/utils/interceptors/response.interceptor.js +0 -5
- package/dist/utils/interfaces/interceptor.interface.d.ts +0 -1
- package/dist/utils/interfaces/response.interface.d.ts +0 -2
- package/dist/utils/utils/response.utils.d.ts +0 -1
- package/dist/utils/utils/response.utils.js +0 -3
- package/package.json +1 -1
|
@@ -16,7 +16,6 @@ let ResponseInterceptor = ResponseInterceptor_1 = class ResponseInterceptor {
|
|
|
16
16
|
config;
|
|
17
17
|
constructor(config = {}) {
|
|
18
18
|
this.config = {
|
|
19
|
-
includeTimestamp: true,
|
|
20
19
|
includePath: true,
|
|
21
20
|
includeRequestId: true,
|
|
22
21
|
includeVersion: false,
|
|
@@ -40,9 +39,6 @@ let ResponseInterceptor = ResponseInterceptor_1 = class ResponseInterceptor {
|
|
|
40
39
|
}
|
|
41
40
|
buildMetadata(request, startTime) {
|
|
42
41
|
const metadata = {};
|
|
43
|
-
if (this.config.includeTimestamp) {
|
|
44
|
-
metadata.timestamp = new Date().toISOString();
|
|
45
|
-
}
|
|
46
42
|
if (this.config.includePath) {
|
|
47
43
|
metadata.path = `${request.method} ${request.url}`;
|
|
48
44
|
}
|
|
@@ -58,7 +54,6 @@ let ResponseInterceptor = ResponseInterceptor_1 = class ResponseInterceptor {
|
|
|
58
54
|
if (this.config.includeExecutionTime) {
|
|
59
55
|
response.executionTime = Date.now() - startTime;
|
|
60
56
|
}
|
|
61
|
-
response.timestamp = response.timestamp || metadata.timestamp;
|
|
62
57
|
response.path = response.path || metadata.path;
|
|
63
58
|
response.requestId = response.requestId || metadata.requestId;
|
|
64
59
|
response.version = response.version || metadata.version;
|
|
@@ -5,7 +5,6 @@ export interface IResponseInterceptor<T> {
|
|
|
5
5
|
intercept(context: ExecutionContext, next: any): Observable<IAppResponse<T>>;
|
|
6
6
|
}
|
|
7
7
|
export interface IInterceptorConfig {
|
|
8
|
-
includeTimestamp?: boolean;
|
|
9
8
|
includePath?: boolean;
|
|
10
9
|
includeRequestId?: boolean;
|
|
11
10
|
includeVersion?: boolean;
|
|
@@ -2,13 +2,11 @@ export interface IAppResponse<T = any> {
|
|
|
2
2
|
status: ResponseStatus;
|
|
3
3
|
message: string;
|
|
4
4
|
data: T;
|
|
5
|
-
timestamp?: string;
|
|
6
5
|
path?: string;
|
|
7
6
|
requestId?: string;
|
|
8
7
|
version?: string;
|
|
9
8
|
}
|
|
10
9
|
export interface IResponseMetadata {
|
|
11
|
-
timestamp: string;
|
|
12
10
|
path: string;
|
|
13
11
|
requestId?: string;
|
|
14
12
|
version?: string;
|
|
@@ -6,7 +6,6 @@ class AppResponse {
|
|
|
6
6
|
status;
|
|
7
7
|
message;
|
|
8
8
|
data;
|
|
9
|
-
timestamp;
|
|
10
9
|
path;
|
|
11
10
|
requestId;
|
|
12
11
|
version;
|
|
@@ -15,8 +14,6 @@ class AppResponse {
|
|
|
15
14
|
this.status = status;
|
|
16
15
|
this.message = message;
|
|
17
16
|
this.data = data;
|
|
18
|
-
if (metadata?.timestamp)
|
|
19
|
-
this.timestamp = metadata.timestamp;
|
|
20
17
|
if (metadata?.path)
|
|
21
18
|
this.path = metadata.path;
|
|
22
19
|
if (metadata?.requestId)
|