@lark-apaas/fullstack-nestjs-core 1.1.6-alpha.1 → 1.1.6-alpha.2
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 +6 -20
- package/dist/index.js +6 -20
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -201,7 +201,7 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
201
201
|
return null;
|
|
202
202
|
}
|
|
203
203
|
try {
|
|
204
|
-
const resp = await this.client.get(
|
|
204
|
+
const resp = await this.client.get(`/b/${appId}/get_published_v2`);
|
|
205
205
|
if (resp.status !== 200) {
|
|
206
206
|
throw new Error(`Failed to get app info, status: ${resp.status}`);
|
|
207
207
|
}
|
|
@@ -683,36 +683,22 @@ var PlatformHttpClientService = class _PlatformHttpClientService {
|
|
|
683
683
|
*/
|
|
684
684
|
registerGlobalInterceptors() {
|
|
685
685
|
this.client.interceptors.request.use((config) => {
|
|
686
|
-
this.logger.log(
|
|
687
|
-
method: config.method?.toUpperCase(),
|
|
688
|
-
url: config.url,
|
|
689
|
-
headers: config.headers,
|
|
690
|
-
params: config.params,
|
|
691
|
-
data: config.data
|
|
692
|
-
}, "HttpService");
|
|
686
|
+
this.logger.log(`HTTP Request: ${config.method?.toUpperCase()} ${config.url}`);
|
|
693
687
|
return config;
|
|
694
688
|
}, (error) => {
|
|
695
689
|
this.logger.error("HTTP Request Error", error, "HttpService");
|
|
696
690
|
return Promise.reject(error);
|
|
697
691
|
});
|
|
698
692
|
this.client.interceptors.response.use((response) => {
|
|
699
|
-
this.logger.log(
|
|
700
|
-
method: response.config.method?.toUpperCase(),
|
|
701
|
-
url: response.config.url,
|
|
702
|
-
status: response.status,
|
|
703
|
-
statusText: response.statusText,
|
|
704
|
-
data: response.data
|
|
705
|
-
}, "HttpService");
|
|
693
|
+
this.logger.log(`HTTP Response: ${response.status} ${response.url}`);
|
|
706
694
|
return response;
|
|
707
695
|
}, (error) => {
|
|
708
|
-
|
|
709
|
-
method: error.config?.method?.toUpperCase(),
|
|
710
|
-
url: error.config?.url,
|
|
696
|
+
const errorLog = {
|
|
711
697
|
status: error.response?.status,
|
|
712
698
|
statusText: error.response?.statusText,
|
|
713
|
-
data: error.response?.data,
|
|
714
699
|
message: error.message
|
|
715
|
-
}
|
|
700
|
+
};
|
|
701
|
+
this.logger.error(`HTTP Response Error: ${error.config?.method?.toUpperCase()} ${error.config?.url} ${JSON.stringify(errorLog)}`);
|
|
716
702
|
return Promise.reject(error);
|
|
717
703
|
});
|
|
718
704
|
}
|
package/dist/index.js
CHANGED
|
@@ -159,7 +159,7 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
159
159
|
return null;
|
|
160
160
|
}
|
|
161
161
|
try {
|
|
162
|
-
const resp = await this.client.get(
|
|
162
|
+
const resp = await this.client.get(`/b/${appId}/get_published_v2`);
|
|
163
163
|
if (resp.status !== 200) {
|
|
164
164
|
throw new Error(`Failed to get app info, status: ${resp.status}`);
|
|
165
165
|
}
|
|
@@ -641,36 +641,22 @@ var PlatformHttpClientService = class _PlatformHttpClientService {
|
|
|
641
641
|
*/
|
|
642
642
|
registerGlobalInterceptors() {
|
|
643
643
|
this.client.interceptors.request.use((config) => {
|
|
644
|
-
this.logger.log(
|
|
645
|
-
method: config.method?.toUpperCase(),
|
|
646
|
-
url: config.url,
|
|
647
|
-
headers: config.headers,
|
|
648
|
-
params: config.params,
|
|
649
|
-
data: config.data
|
|
650
|
-
}, "HttpService");
|
|
644
|
+
this.logger.log(`HTTP Request: ${config.method?.toUpperCase()} ${config.url}`);
|
|
651
645
|
return config;
|
|
652
646
|
}, (error) => {
|
|
653
647
|
this.logger.error("HTTP Request Error", error, "HttpService");
|
|
654
648
|
return Promise.reject(error);
|
|
655
649
|
});
|
|
656
650
|
this.client.interceptors.response.use((response) => {
|
|
657
|
-
this.logger.log(
|
|
658
|
-
method: response.config.method?.toUpperCase(),
|
|
659
|
-
url: response.config.url,
|
|
660
|
-
status: response.status,
|
|
661
|
-
statusText: response.statusText,
|
|
662
|
-
data: response.data
|
|
663
|
-
}, "HttpService");
|
|
651
|
+
this.logger.log(`HTTP Response: ${response.status} ${response.url}`);
|
|
664
652
|
return response;
|
|
665
653
|
}, (error) => {
|
|
666
|
-
|
|
667
|
-
method: error.config?.method?.toUpperCase(),
|
|
668
|
-
url: error.config?.url,
|
|
654
|
+
const errorLog = {
|
|
669
655
|
status: error.response?.status,
|
|
670
656
|
statusText: error.response?.statusText,
|
|
671
|
-
data: error.response?.data,
|
|
672
657
|
message: error.message
|
|
673
|
-
}
|
|
658
|
+
};
|
|
659
|
+
this.logger.error(`HTTP Response Error: ${error.config?.method?.toUpperCase()} ${error.config?.url} ${JSON.stringify(errorLog)}`);
|
|
674
660
|
return Promise.reject(error);
|
|
675
661
|
});
|
|
676
662
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-apaas/fullstack-nestjs-core",
|
|
3
|
-
"version": "1.1.6-alpha.
|
|
3
|
+
"version": "1.1.6-alpha.2",
|
|
4
4
|
"description": "FullStack Nestjs Core",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"prepublishOnly": "npm run build"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@lark-apaas/http-client": "0.1.
|
|
42
|
+
"@lark-apaas/http-client": "0.1.1",
|
|
43
43
|
"@lark-apaas/nestjs-authnpaas": "^1.0.2",
|
|
44
44
|
"@lark-apaas/nestjs-common": "0.1.0",
|
|
45
45
|
"@lark-apaas/nestjs-datapaas": "^1.0.5",
|