@lark-apaas/fullstack-nestjs-core 1.1.1-alpha.43 → 1.1.1-alpha.45
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/index.cjs +24 -16
- package/dist/index.js +24 -16
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -429,26 +429,30 @@ var HttpInterceptorService = class {
|
|
|
429
429
|
setupInterceptors() {
|
|
430
430
|
const axiosInstance = this.httpService.axiosRef;
|
|
431
431
|
axiosInstance.interceptors.request.use((config) => {
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
432
|
+
if (process.env.NODE_ENV === "development") {
|
|
433
|
+
this.logger.log("HTTP Request", {
|
|
434
|
+
method: config.method?.toUpperCase(),
|
|
435
|
+
url: config.url,
|
|
436
|
+
headers: config.headers,
|
|
437
|
+
params: config.params,
|
|
438
|
+
data: config.data
|
|
439
|
+
}, "HttpService");
|
|
440
|
+
}
|
|
439
441
|
return config;
|
|
440
442
|
}, (error) => {
|
|
441
443
|
this.logger.error("HTTP Request Error", error, "HttpService");
|
|
442
444
|
return Promise.reject(error);
|
|
443
445
|
});
|
|
444
446
|
axiosInstance.interceptors.response.use((response) => {
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
447
|
+
if (process.env.NODE_ENV === "development") {
|
|
448
|
+
this.logger.log("HTTP Response", {
|
|
449
|
+
method: response.config.method?.toUpperCase(),
|
|
450
|
+
url: response.config.url,
|
|
451
|
+
status: response.status,
|
|
452
|
+
statusText: response.statusText,
|
|
453
|
+
data: response.data
|
|
454
|
+
}, "HttpService");
|
|
455
|
+
}
|
|
452
456
|
return response;
|
|
453
457
|
}, (error) => {
|
|
454
458
|
this.logger.error("HTTP Response Error", {
|
|
@@ -691,14 +695,18 @@ var PlatformHttpClientService = class _PlatformHttpClientService {
|
|
|
691
695
|
*/
|
|
692
696
|
registerGlobalInterceptors() {
|
|
693
697
|
this.client.interceptors.request.use((config) => {
|
|
694
|
-
|
|
698
|
+
if (process.env.NODE_ENV === "development") {
|
|
699
|
+
this.logger.log(`HTTP Request: ${config.method?.toUpperCase()} ${config.url}`);
|
|
700
|
+
}
|
|
695
701
|
return config;
|
|
696
702
|
}, (error) => {
|
|
697
703
|
this.logger.error("HTTP Request Error", error, "HttpService");
|
|
698
704
|
return Promise.reject(error);
|
|
699
705
|
});
|
|
700
706
|
this.client.interceptors.response.use((response) => {
|
|
701
|
-
|
|
707
|
+
if (process.env.NODE_ENV === "development") {
|
|
708
|
+
this.logger.log(`HTTP Response: ${response.status} ${response.url}`);
|
|
709
|
+
}
|
|
702
710
|
return response;
|
|
703
711
|
}, (error) => {
|
|
704
712
|
const errorLog = {
|
package/dist/index.js
CHANGED
|
@@ -386,26 +386,30 @@ var HttpInterceptorService = class {
|
|
|
386
386
|
setupInterceptors() {
|
|
387
387
|
const axiosInstance = this.httpService.axiosRef;
|
|
388
388
|
axiosInstance.interceptors.request.use((config) => {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
389
|
+
if (process.env.NODE_ENV === "development") {
|
|
390
|
+
this.logger.log("HTTP Request", {
|
|
391
|
+
method: config.method?.toUpperCase(),
|
|
392
|
+
url: config.url,
|
|
393
|
+
headers: config.headers,
|
|
394
|
+
params: config.params,
|
|
395
|
+
data: config.data
|
|
396
|
+
}, "HttpService");
|
|
397
|
+
}
|
|
396
398
|
return config;
|
|
397
399
|
}, (error) => {
|
|
398
400
|
this.logger.error("HTTP Request Error", error, "HttpService");
|
|
399
401
|
return Promise.reject(error);
|
|
400
402
|
});
|
|
401
403
|
axiosInstance.interceptors.response.use((response) => {
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
404
|
+
if (process.env.NODE_ENV === "development") {
|
|
405
|
+
this.logger.log("HTTP Response", {
|
|
406
|
+
method: response.config.method?.toUpperCase(),
|
|
407
|
+
url: response.config.url,
|
|
408
|
+
status: response.status,
|
|
409
|
+
statusText: response.statusText,
|
|
410
|
+
data: response.data
|
|
411
|
+
}, "HttpService");
|
|
412
|
+
}
|
|
409
413
|
return response;
|
|
410
414
|
}, (error) => {
|
|
411
415
|
this.logger.error("HTTP Response Error", {
|
|
@@ -648,14 +652,18 @@ var PlatformHttpClientService = class _PlatformHttpClientService {
|
|
|
648
652
|
*/
|
|
649
653
|
registerGlobalInterceptors() {
|
|
650
654
|
this.client.interceptors.request.use((config) => {
|
|
651
|
-
|
|
655
|
+
if (process.env.NODE_ENV === "development") {
|
|
656
|
+
this.logger.log(`HTTP Request: ${config.method?.toUpperCase()} ${config.url}`);
|
|
657
|
+
}
|
|
652
658
|
return config;
|
|
653
659
|
}, (error) => {
|
|
654
660
|
this.logger.error("HTTP Request Error", error, "HttpService");
|
|
655
661
|
return Promise.reject(error);
|
|
656
662
|
});
|
|
657
663
|
this.client.interceptors.response.use((response) => {
|
|
658
|
-
|
|
664
|
+
if (process.env.NODE_ENV === "development") {
|
|
665
|
+
this.logger.log(`HTTP Response: ${response.status} ${response.url}`);
|
|
666
|
+
}
|
|
659
667
|
return response;
|
|
660
668
|
}, (error) => {
|
|
661
669
|
const errorLog = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-apaas/fullstack-nestjs-core",
|
|
3
|
-
"version": "1.1.1-alpha.
|
|
3
|
+
"version": "1.1.1-alpha.45",
|
|
4
4
|
"description": "FullStack Nestjs Core",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"@lark-apaas/http-client": "0.1.2",
|
|
43
43
|
"@lark-apaas/nestjs-authnpaas": "^1.0.2",
|
|
44
44
|
"@lark-apaas/nestjs-common": "0.1.0-alpha.1",
|
|
45
|
-
"@lark-apaas/nestjs-datapaas": "1.0.6-alpha.
|
|
46
|
-
"@lark-apaas/nestjs-logger": "1.0.2-alpha.
|
|
47
|
-
"@lark-apaas/nestjs-observable": "0.0.1-alpha.
|
|
45
|
+
"@lark-apaas/nestjs-datapaas": "^1.0.6-alpha.5",
|
|
46
|
+
"@lark-apaas/nestjs-logger": "1.0.2-alpha.34",
|
|
47
|
+
"@lark-apaas/nestjs-observable": "0.0.1-alpha.36",
|
|
48
48
|
"@lark-apaas/nestjs-openapi-devtools": "^1.0.9",
|
|
49
49
|
"@lark-apaas/nestjs-trigger": "^0.0.1",
|
|
50
50
|
"@nestjs/axios": "^4.0.1",
|
|
@@ -72,4 +72,4 @@
|
|
|
72
72
|
"class-validator": "^0.14.2",
|
|
73
73
|
"drizzle-orm": "0.44.6"
|
|
74
74
|
}
|
|
75
|
-
}
|
|
75
|
+
}
|