@lark-apaas/fullstack-nestjs-core 1.1.6-alpha.0 → 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 +9 -23
- package/dist/index.js +9 -23
- 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
|
}
|
|
@@ -742,7 +728,6 @@ var PlatformModule = class _PlatformModule {
|
|
|
742
728
|
return {
|
|
743
729
|
module: _PlatformModule,
|
|
744
730
|
imports: [
|
|
745
|
-
HttpInterceptorService,
|
|
746
731
|
import_config2.ConfigModule.forRoot({
|
|
747
732
|
isGlobal: true,
|
|
748
733
|
envFilePath: [
|
|
@@ -807,20 +792,21 @@ var PlatformModule = class _PlatformModule {
|
|
|
807
792
|
provide: import_nestjs_common3.OBSERVABLE_SERVICE,
|
|
808
793
|
useClass: import_nestjs_observable.Observable
|
|
809
794
|
},
|
|
795
|
+
PlatformHttpClientService,
|
|
810
796
|
{
|
|
811
797
|
provide: import_nestjs_common4.PLATFORM_HTTP_CLIENT,
|
|
812
798
|
useFactory: /* @__PURE__ */ __name((svc) => svc.instance, "useFactory"),
|
|
813
799
|
inject: [
|
|
814
800
|
PlatformHttpClientService
|
|
815
801
|
]
|
|
816
|
-
}
|
|
802
|
+
},
|
|
803
|
+
HttpInterceptorService
|
|
817
804
|
],
|
|
818
805
|
exports: [
|
|
819
806
|
import_config2.ConfigModule,
|
|
820
807
|
import_nestjs_logger2.LoggerModule,
|
|
821
808
|
import_nestjs_common3.CommonModule,
|
|
822
809
|
import_nestjs_common3.OBSERVABLE_SERVICE,
|
|
823
|
-
PlatformHttpClientService,
|
|
824
810
|
import_nestjs_common4.PLATFORM_HTTP_CLIENT
|
|
825
811
|
]
|
|
826
812
|
};
|
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
|
}
|
|
@@ -700,7 +686,6 @@ var PlatformModule = class _PlatformModule {
|
|
|
700
686
|
return {
|
|
701
687
|
module: _PlatformModule,
|
|
702
688
|
imports: [
|
|
703
|
-
HttpInterceptorService,
|
|
704
689
|
ConfigModule.forRoot({
|
|
705
690
|
isGlobal: true,
|
|
706
691
|
envFilePath: [
|
|
@@ -765,20 +750,21 @@ var PlatformModule = class _PlatformModule {
|
|
|
765
750
|
provide: OBSERVABLE_SERVICE,
|
|
766
751
|
useClass: Observable
|
|
767
752
|
},
|
|
753
|
+
PlatformHttpClientService,
|
|
768
754
|
{
|
|
769
755
|
provide: PLATFORM_HTTP_CLIENT2,
|
|
770
756
|
useFactory: /* @__PURE__ */ __name((svc) => svc.instance, "useFactory"),
|
|
771
757
|
inject: [
|
|
772
758
|
PlatformHttpClientService
|
|
773
759
|
]
|
|
774
|
-
}
|
|
760
|
+
},
|
|
761
|
+
HttpInterceptorService
|
|
775
762
|
],
|
|
776
763
|
exports: [
|
|
777
764
|
ConfigModule,
|
|
778
765
|
LoggerModule,
|
|
779
766
|
CommonModule,
|
|
780
767
|
OBSERVABLE_SERVICE,
|
|
781
|
-
PlatformHttpClientService,
|
|
782
768
|
PLATFORM_HTTP_CLIENT2
|
|
783
769
|
]
|
|
784
770
|
};
|
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",
|