@lark-apaas/fullstack-nestjs-core 1.1.47-alpha.1 → 1.1.47-beta.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 +3 -28
- package/dist/index.js +4 -29
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -34946,8 +34946,7 @@ var app_config_default = (0, import_config.registerAs)(NAMESPACE, () => {
|
|
|
34946
34946
|
return {
|
|
34947
34947
|
host: process.env.SERVER_HOST ?? "localhost",
|
|
34948
34948
|
port: Number(process.env.SERVER_PORT ?? 3e3),
|
|
34949
|
-
clientBasePath: process.env.CLIENT_BASE_PATH ?? "/"
|
|
34950
|
-
databaseUrl: process.env.SUDA_DATABASE_URL ?? ""
|
|
34949
|
+
clientBasePath: process.env.CLIENT_BASE_PATH ?? "/"
|
|
34951
34950
|
};
|
|
34952
34951
|
});
|
|
34953
34952
|
|
|
@@ -35209,27 +35208,6 @@ var PlatformHttpClientService = class _PlatformHttpClientService {
|
|
|
35209
35208
|
"x-tt-env": ttEnv
|
|
35210
35209
|
};
|
|
35211
35210
|
}
|
|
35212
|
-
const userId = this.requestContext.get("userId");
|
|
35213
|
-
const tenantIdRaw = this.requestContext.get("tenantId");
|
|
35214
|
-
const contextClaims = {};
|
|
35215
|
-
if (userId) {
|
|
35216
|
-
contextClaims.user_id = userId;
|
|
35217
|
-
}
|
|
35218
|
-
if (tenantIdRaw !== void 0 && tenantIdRaw !== "") {
|
|
35219
|
-
const tenantIdNum = typeof tenantIdRaw === "number" ? tenantIdRaw : Number(tenantIdRaw);
|
|
35220
|
-
if (Number.isFinite(tenantIdNum)) {
|
|
35221
|
-
contextClaims.tenant_id = tenantIdNum;
|
|
35222
|
-
}
|
|
35223
|
-
}
|
|
35224
|
-
if (contextClaims.user_id !== void 0 || contextClaims.tenant_id !== void 0) {
|
|
35225
|
-
config.platformAuth = {
|
|
35226
|
-
...config.platformAuth,
|
|
35227
|
-
customClaims: {
|
|
35228
|
-
...contextClaims,
|
|
35229
|
-
...config.platformAuth?.customClaims || {}
|
|
35230
|
-
}
|
|
35231
|
-
};
|
|
35232
|
-
}
|
|
35233
35211
|
return config;
|
|
35234
35212
|
}, (error) => {
|
|
35235
35213
|
this.logger.error("Server SDK HTTP Request Error", error, "HttpService");
|
|
@@ -36359,16 +36337,13 @@ var PlatformModule = class _PlatformModule {
|
|
|
36359
36337
|
...DISABLE_DATAPASS ? [] : [
|
|
36360
36338
|
import_nestjs_datapaas.DataPaasModule.forRootAsync({
|
|
36361
36339
|
imports: [
|
|
36362
|
-
import_config2.ConfigModule,
|
|
36363
36340
|
import_nestjs_logger2.LoggerModule
|
|
36364
36341
|
],
|
|
36365
36342
|
inject: [
|
|
36366
|
-
import_config2.ConfigService,
|
|
36367
36343
|
import_nestjs_logger2.AppLogger
|
|
36368
36344
|
],
|
|
36369
36345
|
useFactory: /* @__PURE__ */ __name(async (...args) => {
|
|
36370
|
-
const
|
|
36371
|
-
const appLogger = args[1];
|
|
36346
|
+
const appLogger = args[0];
|
|
36372
36347
|
const drizzleLogger = {
|
|
36373
36348
|
logQuery(query, params) {
|
|
36374
36349
|
if (process.env.NODE_ENV === "development") {
|
|
@@ -36380,7 +36355,7 @@ var PlatformModule = class _PlatformModule {
|
|
|
36380
36355
|
}
|
|
36381
36356
|
};
|
|
36382
36357
|
return {
|
|
36383
|
-
connectionString:
|
|
36358
|
+
connectionString: process.env.SUDA_DATABASE_URL ?? "",
|
|
36384
36359
|
logger: drizzleLogger,
|
|
36385
36360
|
connectionTokenFilePath: "/var/run/secrets/zti/credential"
|
|
36386
36361
|
};
|
package/dist/index.js
CHANGED
|
@@ -34404,7 +34404,7 @@ var require_express2 = __commonJS({
|
|
|
34404
34404
|
import { Global, Module as Module3, ValidationPipe } from "@nestjs/common";
|
|
34405
34405
|
import { APP_INTERCEPTOR, APP_PIPE } from "@nestjs/core";
|
|
34406
34406
|
import { CommonModule, OBSERVABLE_SERVICE as OBSERVABLE_SERVICE2, HTTP_CLIENT_FACTORY } from "@lark-apaas/nestjs-common";
|
|
34407
|
-
import { ConfigModule
|
|
34407
|
+
import { ConfigModule } from "@nestjs/config";
|
|
34408
34408
|
import { NestjsObservableModule as ObservableModule, Observable, ObservableTraceMiddleware, TraceInterceptor } from "@lark-apaas/nestjs-observable";
|
|
34409
34409
|
import { HttpModule } from "@nestjs/axios";
|
|
34410
34410
|
import { LoggerModule, AppLogger as AppLogger2, LoggerContextMiddleware } from "@lark-apaas/nestjs-logger";
|
|
@@ -34919,8 +34919,7 @@ var app_config_default = registerAs(NAMESPACE, () => {
|
|
|
34919
34919
|
return {
|
|
34920
34920
|
host: process.env.SERVER_HOST ?? "localhost",
|
|
34921
34921
|
port: Number(process.env.SERVER_PORT ?? 3e3),
|
|
34922
|
-
clientBasePath: process.env.CLIENT_BASE_PATH ?? "/"
|
|
34923
|
-
databaseUrl: process.env.SUDA_DATABASE_URL ?? ""
|
|
34922
|
+
clientBasePath: process.env.CLIENT_BASE_PATH ?? "/"
|
|
34924
34923
|
};
|
|
34925
34924
|
});
|
|
34926
34925
|
|
|
@@ -35182,27 +35181,6 @@ var PlatformHttpClientService = class _PlatformHttpClientService {
|
|
|
35182
35181
|
"x-tt-env": ttEnv
|
|
35183
35182
|
};
|
|
35184
35183
|
}
|
|
35185
|
-
const userId = this.requestContext.get("userId");
|
|
35186
|
-
const tenantIdRaw = this.requestContext.get("tenantId");
|
|
35187
|
-
const contextClaims = {};
|
|
35188
|
-
if (userId) {
|
|
35189
|
-
contextClaims.user_id = userId;
|
|
35190
|
-
}
|
|
35191
|
-
if (tenantIdRaw !== void 0 && tenantIdRaw !== "") {
|
|
35192
|
-
const tenantIdNum = typeof tenantIdRaw === "number" ? tenantIdRaw : Number(tenantIdRaw);
|
|
35193
|
-
if (Number.isFinite(tenantIdNum)) {
|
|
35194
|
-
contextClaims.tenant_id = tenantIdNum;
|
|
35195
|
-
}
|
|
35196
|
-
}
|
|
35197
|
-
if (contextClaims.user_id !== void 0 || contextClaims.tenant_id !== void 0) {
|
|
35198
|
-
config.platformAuth = {
|
|
35199
|
-
...config.platformAuth,
|
|
35200
|
-
customClaims: {
|
|
35201
|
-
...contextClaims,
|
|
35202
|
-
...config.platformAuth?.customClaims || {}
|
|
35203
|
-
}
|
|
35204
|
-
};
|
|
35205
|
-
}
|
|
35206
35184
|
return config;
|
|
35207
35185
|
}, (error) => {
|
|
35208
35186
|
this.logger.error("Server SDK HTTP Request Error", error, "HttpService");
|
|
@@ -36332,16 +36310,13 @@ var PlatformModule = class _PlatformModule {
|
|
|
36332
36310
|
...DISABLE_DATAPASS ? [] : [
|
|
36333
36311
|
DataPaasModule.forRootAsync({
|
|
36334
36312
|
imports: [
|
|
36335
|
-
ConfigModule,
|
|
36336
36313
|
LoggerModule
|
|
36337
36314
|
],
|
|
36338
36315
|
inject: [
|
|
36339
|
-
ConfigService,
|
|
36340
36316
|
AppLogger2
|
|
36341
36317
|
],
|
|
36342
36318
|
useFactory: /* @__PURE__ */ __name(async (...args) => {
|
|
36343
|
-
const
|
|
36344
|
-
const appLogger = args[1];
|
|
36319
|
+
const appLogger = args[0];
|
|
36345
36320
|
const drizzleLogger = {
|
|
36346
36321
|
logQuery(query, params) {
|
|
36347
36322
|
if (process.env.NODE_ENV === "development") {
|
|
@@ -36353,7 +36328,7 @@ var PlatformModule = class _PlatformModule {
|
|
|
36353
36328
|
}
|
|
36354
36329
|
};
|
|
36355
36330
|
return {
|
|
36356
|
-
connectionString:
|
|
36331
|
+
connectionString: process.env.SUDA_DATABASE_URL ?? "",
|
|
36357
36332
|
logger: drizzleLogger,
|
|
36358
36333
|
connectionTokenFilePath: "/var/run/secrets/zti/credential"
|
|
36359
36334
|
};
|