@lark-apaas/fullstack-nestjs-core 1.1.6-alpha.1 → 1.1.6-alpha.4
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 +13 -21
- package/dist/index.js +13 -21
- package/package.json +6 -6
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
|
}
|
|
@@ -224,6 +224,9 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
224
224
|
csrfToken: csrfToken ?? "",
|
|
225
225
|
userId: userId ?? "",
|
|
226
226
|
appId: appId ?? "",
|
|
227
|
+
appName: appInfo?.app_name ?? "",
|
|
228
|
+
appAvatar: appInfo?.app_avatar ?? "",
|
|
229
|
+
appDescription: appInfo?.app_description ?? "",
|
|
227
230
|
tenantId
|
|
228
231
|
};
|
|
229
232
|
res.locals = {
|
|
@@ -231,7 +234,10 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
231
234
|
csrfToken: csrfToken ?? "",
|
|
232
235
|
userId: userId ?? "",
|
|
233
236
|
tenantId: tenantId ?? "",
|
|
234
|
-
appId: appId ?? ""
|
|
237
|
+
appId: appId ?? "",
|
|
238
|
+
appName: appInfo?.app_name ?? "\u5999\u642D\u5E94\u7528",
|
|
239
|
+
appAvatar: appInfo?.app_avatar ?? "",
|
|
240
|
+
appDescription: appInfo?.app_description ?? ""
|
|
235
241
|
};
|
|
236
242
|
next();
|
|
237
243
|
}
|
|
@@ -683,36 +689,22 @@ var PlatformHttpClientService = class _PlatformHttpClientService {
|
|
|
683
689
|
*/
|
|
684
690
|
registerGlobalInterceptors() {
|
|
685
691
|
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");
|
|
692
|
+
this.logger.log(`HTTP Request: ${config.method?.toUpperCase()} ${config.url}`);
|
|
693
693
|
return config;
|
|
694
694
|
}, (error) => {
|
|
695
695
|
this.logger.error("HTTP Request Error", error, "HttpService");
|
|
696
696
|
return Promise.reject(error);
|
|
697
697
|
});
|
|
698
698
|
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");
|
|
699
|
+
this.logger.log(`HTTP Response: ${response.status} ${response.url}`);
|
|
706
700
|
return response;
|
|
707
701
|
}, (error) => {
|
|
708
|
-
|
|
709
|
-
method: error.config?.method?.toUpperCase(),
|
|
710
|
-
url: error.config?.url,
|
|
702
|
+
const errorLog = {
|
|
711
703
|
status: error.response?.status,
|
|
712
704
|
statusText: error.response?.statusText,
|
|
713
|
-
data: error.response?.data,
|
|
714
705
|
message: error.message
|
|
715
|
-
}
|
|
706
|
+
};
|
|
707
|
+
this.logger.error(`HTTP Response Error: ${error.config?.method?.toUpperCase()} ${error.config?.url} ${JSON.stringify(errorLog)}`);
|
|
716
708
|
return Promise.reject(error);
|
|
717
709
|
});
|
|
718
710
|
}
|
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
|
}
|
|
@@ -182,6 +182,9 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
182
182
|
csrfToken: csrfToken ?? "",
|
|
183
183
|
userId: userId ?? "",
|
|
184
184
|
appId: appId ?? "",
|
|
185
|
+
appName: appInfo?.app_name ?? "",
|
|
186
|
+
appAvatar: appInfo?.app_avatar ?? "",
|
|
187
|
+
appDescription: appInfo?.app_description ?? "",
|
|
185
188
|
tenantId
|
|
186
189
|
};
|
|
187
190
|
res.locals = {
|
|
@@ -189,7 +192,10 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
189
192
|
csrfToken: csrfToken ?? "",
|
|
190
193
|
userId: userId ?? "",
|
|
191
194
|
tenantId: tenantId ?? "",
|
|
192
|
-
appId: appId ?? ""
|
|
195
|
+
appId: appId ?? "",
|
|
196
|
+
appName: appInfo?.app_name ?? "\u5999\u642D\u5E94\u7528",
|
|
197
|
+
appAvatar: appInfo?.app_avatar ?? "",
|
|
198
|
+
appDescription: appInfo?.app_description ?? ""
|
|
193
199
|
};
|
|
194
200
|
next();
|
|
195
201
|
}
|
|
@@ -641,36 +647,22 @@ var PlatformHttpClientService = class _PlatformHttpClientService {
|
|
|
641
647
|
*/
|
|
642
648
|
registerGlobalInterceptors() {
|
|
643
649
|
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");
|
|
650
|
+
this.logger.log(`HTTP Request: ${config.method?.toUpperCase()} ${config.url}`);
|
|
651
651
|
return config;
|
|
652
652
|
}, (error) => {
|
|
653
653
|
this.logger.error("HTTP Request Error", error, "HttpService");
|
|
654
654
|
return Promise.reject(error);
|
|
655
655
|
});
|
|
656
656
|
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");
|
|
657
|
+
this.logger.log(`HTTP Response: ${response.status} ${response.url}`);
|
|
664
658
|
return response;
|
|
665
659
|
}, (error) => {
|
|
666
|
-
|
|
667
|
-
method: error.config?.method?.toUpperCase(),
|
|
668
|
-
url: error.config?.url,
|
|
660
|
+
const errorLog = {
|
|
669
661
|
status: error.response?.status,
|
|
670
662
|
statusText: error.response?.statusText,
|
|
671
|
-
data: error.response?.data,
|
|
672
663
|
message: error.message
|
|
673
|
-
}
|
|
664
|
+
};
|
|
665
|
+
this.logger.error(`HTTP Response Error: ${error.config?.method?.toUpperCase()} ${error.config?.url} ${JSON.stringify(errorLog)}`);
|
|
674
666
|
return Promise.reject(error);
|
|
675
667
|
});
|
|
676
668
|
}
|
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.4",
|
|
4
4
|
"description": "FullStack Nestjs Core",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -39,14 +39,14 @@
|
|
|
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
|
-
"@lark-apaas/nestjs-common": "0.1.0",
|
|
44
|
+
"@lark-apaas/nestjs-common": "^0.1.0",
|
|
45
45
|
"@lark-apaas/nestjs-datapaas": "^1.0.5",
|
|
46
|
-
"@lark-apaas/nestjs-logger": "
|
|
47
|
-
"@lark-apaas/nestjs-observable": "0.0.1-alpha.
|
|
46
|
+
"@lark-apaas/nestjs-logger": "1.0.3-alpha.0",
|
|
47
|
+
"@lark-apaas/nestjs-observable": "0.0.1-alpha.30",
|
|
48
48
|
"@lark-apaas/nestjs-openapi-devtools": "^1.0.9",
|
|
49
|
-
"@lark-apaas/nestjs-trigger": "0.0.1-alpha.
|
|
49
|
+
"@lark-apaas/nestjs-trigger": "0.0.1-alpha.3",
|
|
50
50
|
"@nestjs/axios": "^4.0.1",
|
|
51
51
|
"axios": "^1.13.2",
|
|
52
52
|
"cookie-parser": "^1.4.7"
|