@lark-apaas/fullstack-nestjs-core 1.0.13 → 1.0.15-alpha.0
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 +12 -4
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +12 -4
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -91,7 +91,8 @@ var UserContextMiddleware = class {
|
|
|
91
91
|
userId: webUser?.user_id,
|
|
92
92
|
tenantId: webUser?.tenant_id,
|
|
93
93
|
appId: webUser?.app_id ?? "",
|
|
94
|
-
loginUrl: webUser?.login_url ?? ""
|
|
94
|
+
loginUrl: webUser?.login_url ?? "",
|
|
95
|
+
userType: webUser?.user_type ?? ""
|
|
95
96
|
};
|
|
96
97
|
next();
|
|
97
98
|
}
|
|
@@ -170,12 +171,14 @@ var ViewContextMiddleware = class {
|
|
|
170
171
|
__name(this, "ViewContextMiddleware");
|
|
171
172
|
}
|
|
172
173
|
use(req, res, next) {
|
|
173
|
-
const { userId, tenantId, appId } = req.userContext;
|
|
174
|
+
const { userId, tenantId, appId, loginUrl, userType } = req.userContext;
|
|
174
175
|
const csrfToken = req.csrfToken;
|
|
175
176
|
req.__platform_data__ = {
|
|
176
177
|
csrfToken: csrfToken ?? "",
|
|
177
178
|
userId: userId ?? "",
|
|
178
179
|
appId: appId ?? "",
|
|
180
|
+
loginUrl: loginUrl ?? "",
|
|
181
|
+
userType: userType ?? "",
|
|
179
182
|
tenantId
|
|
180
183
|
};
|
|
181
184
|
res.locals = {
|
|
@@ -183,7 +186,9 @@ var ViewContextMiddleware = class {
|
|
|
183
186
|
csrfToken: csrfToken ?? "",
|
|
184
187
|
userId: userId ?? "",
|
|
185
188
|
tenantId: tenantId ?? "",
|
|
186
|
-
appId: appId ?? ""
|
|
189
|
+
appId: appId ?? "",
|
|
190
|
+
loginUrl: loginUrl ?? "",
|
|
191
|
+
userType: userType ?? ""
|
|
187
192
|
};
|
|
188
193
|
next();
|
|
189
194
|
}
|
|
@@ -335,7 +340,10 @@ var PlatformModule = class _PlatformModule {
|
|
|
335
340
|
{
|
|
336
341
|
provide: import_core.APP_PIPE,
|
|
337
342
|
useValue: new import_common5.ValidationPipe({
|
|
338
|
-
transform: true
|
|
343
|
+
transform: true,
|
|
344
|
+
transformOptions: {
|
|
345
|
+
enableImplicitConversion: true
|
|
346
|
+
}
|
|
339
347
|
})
|
|
340
348
|
}
|
|
341
349
|
],
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -49,7 +49,8 @@ var UserContextMiddleware = class {
|
|
|
49
49
|
userId: webUser?.user_id,
|
|
50
50
|
tenantId: webUser?.tenant_id,
|
|
51
51
|
appId: webUser?.app_id ?? "",
|
|
52
|
-
loginUrl: webUser?.login_url ?? ""
|
|
52
|
+
loginUrl: webUser?.login_url ?? "",
|
|
53
|
+
userType: webUser?.user_type ?? ""
|
|
53
54
|
};
|
|
54
55
|
next();
|
|
55
56
|
}
|
|
@@ -128,12 +129,14 @@ var ViewContextMiddleware = class {
|
|
|
128
129
|
__name(this, "ViewContextMiddleware");
|
|
129
130
|
}
|
|
130
131
|
use(req, res, next) {
|
|
131
|
-
const { userId, tenantId, appId } = req.userContext;
|
|
132
|
+
const { userId, tenantId, appId, loginUrl, userType } = req.userContext;
|
|
132
133
|
const csrfToken = req.csrfToken;
|
|
133
134
|
req.__platform_data__ = {
|
|
134
135
|
csrfToken: csrfToken ?? "",
|
|
135
136
|
userId: userId ?? "",
|
|
136
137
|
appId: appId ?? "",
|
|
138
|
+
loginUrl: loginUrl ?? "",
|
|
139
|
+
userType: userType ?? "",
|
|
137
140
|
tenantId
|
|
138
141
|
};
|
|
139
142
|
res.locals = {
|
|
@@ -141,7 +144,9 @@ var ViewContextMiddleware = class {
|
|
|
141
144
|
csrfToken: csrfToken ?? "",
|
|
142
145
|
userId: userId ?? "",
|
|
143
146
|
tenantId: tenantId ?? "",
|
|
144
|
-
appId: appId ?? ""
|
|
147
|
+
appId: appId ?? "",
|
|
148
|
+
loginUrl: loginUrl ?? "",
|
|
149
|
+
userType: userType ?? ""
|
|
145
150
|
};
|
|
146
151
|
next();
|
|
147
152
|
}
|
|
@@ -293,7 +298,10 @@ var PlatformModule = class _PlatformModule {
|
|
|
293
298
|
{
|
|
294
299
|
provide: APP_PIPE,
|
|
295
300
|
useValue: new ValidationPipe({
|
|
296
|
-
transform: true
|
|
301
|
+
transform: true,
|
|
302
|
+
transformOptions: {
|
|
303
|
+
enableImplicitConversion: true
|
|
304
|
+
}
|
|
297
305
|
})
|
|
298
306
|
}
|
|
299
307
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-apaas/fullstack-nestjs-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15-alpha.0",
|
|
4
4
|
"description": "FullStack Nestjs Core",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@lark-apaas/nestjs-authnpaas": "^1.0.0",
|
|
42
|
-
"@lark-apaas/nestjs-datapaas": "
|
|
42
|
+
"@lark-apaas/nestjs-datapaas": "1.0.6-alpha.0",
|
|
43
43
|
"@lark-apaas/nestjs-logger": "^1.0.2",
|
|
44
44
|
"@lark-apaas/nestjs-openapi-devtools": "^1.0.7",
|
|
45
45
|
"cookie-parser": "^1.4.7"
|