@lark-apaas/fullstack-nestjs-core 1.0.15-alpha.2 → 1.0.16
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 +3 -10
- package/dist/index.d.cts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +3 -10
- package/package.json +3 -4
package/dist/index.cjs
CHANGED
|
@@ -91,8 +91,7 @@ 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 ?? ""
|
|
95
|
-
userType: webUser?.user_type ?? ""
|
|
94
|
+
loginUrl: webUser?.login_url ?? ""
|
|
96
95
|
};
|
|
97
96
|
next();
|
|
98
97
|
}
|
|
@@ -171,14 +170,12 @@ var ViewContextMiddleware = class {
|
|
|
171
170
|
__name(this, "ViewContextMiddleware");
|
|
172
171
|
}
|
|
173
172
|
use(req, res, next) {
|
|
174
|
-
const { userId, tenantId, appId
|
|
173
|
+
const { userId, tenantId, appId } = req.userContext;
|
|
175
174
|
const csrfToken = req.csrfToken;
|
|
176
175
|
req.__platform_data__ = {
|
|
177
176
|
csrfToken: csrfToken ?? "",
|
|
178
177
|
userId: userId ?? "",
|
|
179
178
|
appId: appId ?? "",
|
|
180
|
-
loginUrl: loginUrl ?? "",
|
|
181
|
-
userType: userType ?? "",
|
|
182
179
|
tenantId
|
|
183
180
|
};
|
|
184
181
|
res.locals = {
|
|
@@ -186,8 +183,6 @@ var ViewContextMiddleware = class {
|
|
|
186
183
|
csrfToken: csrfToken ?? "",
|
|
187
184
|
userId: userId ?? "",
|
|
188
185
|
tenantId: tenantId ?? "",
|
|
189
|
-
loginUrl: loginUrl ?? "",
|
|
190
|
-
userType: userType ?? "",
|
|
191
186
|
appId: appId ?? ""
|
|
192
187
|
};
|
|
193
188
|
next();
|
|
@@ -275,7 +270,6 @@ var app_config_default = (0, import_config.registerAs)(NAMESPACE, () => {
|
|
|
275
270
|
});
|
|
276
271
|
|
|
277
272
|
// src/modules/platform/module.ts
|
|
278
|
-
var import_nestjs_authzpaas = require("@lark-apaas/nestjs-authzpaas");
|
|
279
273
|
function _ts_decorate5(decorators, target, key, desc) {
|
|
280
274
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
281
275
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -331,8 +325,7 @@ var PlatformModule = class _PlatformModule {
|
|
|
331
325
|
};
|
|
332
326
|
}, "useFactory")
|
|
333
327
|
}),
|
|
334
|
-
import_nestjs_authnpaas.AuthNPaasModule.forRoot()
|
|
335
|
-
import_nestjs_authzpaas.AuthZPaasModule.forRoot()
|
|
328
|
+
import_nestjs_authnpaas.AuthNPaasModule.forRoot()
|
|
336
329
|
],
|
|
337
330
|
providers: [
|
|
338
331
|
{
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -49,8 +49,7 @@ 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 ?? ""
|
|
53
|
-
userType: webUser?.user_type ?? ""
|
|
52
|
+
loginUrl: webUser?.login_url ?? ""
|
|
54
53
|
};
|
|
55
54
|
next();
|
|
56
55
|
}
|
|
@@ -129,14 +128,12 @@ var ViewContextMiddleware = class {
|
|
|
129
128
|
__name(this, "ViewContextMiddleware");
|
|
130
129
|
}
|
|
131
130
|
use(req, res, next) {
|
|
132
|
-
const { userId, tenantId, appId
|
|
131
|
+
const { userId, tenantId, appId } = req.userContext;
|
|
133
132
|
const csrfToken = req.csrfToken;
|
|
134
133
|
req.__platform_data__ = {
|
|
135
134
|
csrfToken: csrfToken ?? "",
|
|
136
135
|
userId: userId ?? "",
|
|
137
136
|
appId: appId ?? "",
|
|
138
|
-
loginUrl: loginUrl ?? "",
|
|
139
|
-
userType: userType ?? "",
|
|
140
137
|
tenantId
|
|
141
138
|
};
|
|
142
139
|
res.locals = {
|
|
@@ -144,8 +141,6 @@ var ViewContextMiddleware = class {
|
|
|
144
141
|
csrfToken: csrfToken ?? "",
|
|
145
142
|
userId: userId ?? "",
|
|
146
143
|
tenantId: tenantId ?? "",
|
|
147
|
-
loginUrl: loginUrl ?? "",
|
|
148
|
-
userType: userType ?? "",
|
|
149
144
|
appId: appId ?? ""
|
|
150
145
|
};
|
|
151
146
|
next();
|
|
@@ -233,7 +228,6 @@ var app_config_default = registerAs(NAMESPACE, () => {
|
|
|
233
228
|
});
|
|
234
229
|
|
|
235
230
|
// src/modules/platform/module.ts
|
|
236
|
-
import { AuthZPaasModule } from "@lark-apaas/nestjs-authzpaas";
|
|
237
231
|
function _ts_decorate5(decorators, target, key, desc) {
|
|
238
232
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
239
233
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -289,8 +283,7 @@ var PlatformModule = class _PlatformModule {
|
|
|
289
283
|
};
|
|
290
284
|
}, "useFactory")
|
|
291
285
|
}),
|
|
292
|
-
AuthNPaasModule.forRoot()
|
|
293
|
-
AuthZPaasModule.forRoot()
|
|
286
|
+
AuthNPaasModule.forRoot()
|
|
294
287
|
],
|
|
295
288
|
providers: [
|
|
296
289
|
{
|
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.16",
|
|
4
4
|
"description": "FullStack Nestjs Core",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -38,9 +38,8 @@
|
|
|
38
38
|
"lint:fix": "eslint src --ext .ts --fix"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@lark-apaas/nestjs-authnpaas": "^1.0.
|
|
42
|
-
"@lark-apaas/nestjs-
|
|
43
|
-
"@lark-apaas/nestjs-datapaas": "1.0.6-alpha.3",
|
|
41
|
+
"@lark-apaas/nestjs-authnpaas": "^1.0.1",
|
|
42
|
+
"@lark-apaas/nestjs-datapaas": "^1.0.5",
|
|
44
43
|
"@lark-apaas/nestjs-logger": "^1.0.2",
|
|
45
44
|
"@lark-apaas/nestjs-openapi-devtools": "^1.0.7",
|
|
46
45
|
"cookie-parser": "^1.4.7"
|