@lenne.tech/nest-server 10.8.0 → 10.8.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lenne.tech/nest-server",
3
- "version": "10.8.0",
3
+ "version": "10.8.3",
4
4
  "description": "Modern, fast, powerful Node.js web framework in TypeScript based on Nest with a GraphQL API and a connection to MongoDB (or other databases).",
5
5
  "keywords": [
6
6
  "node",
@@ -62,7 +62,7 @@
62
62
  "node": ">= 20"
63
63
  },
64
64
  "dependencies": {
65
- "@apollo/gateway": "2.9.3",
65
+ "@apollo/gateway": "2.10.0",
66
66
  "@getbrevo/brevo": "1.0.1",
67
67
  "@lenne.tech/mongoose-gridfs": "1.4.2",
68
68
  "@lenne.tech/multer-gridfs-storage": "5.0.6",
@@ -75,36 +75,36 @@
75
75
  "@nestjs/passport": "10.0.3",
76
76
  "@nestjs/platform-express": "10.4.15",
77
77
  "@nestjs/schedule": "4.1.2",
78
- "@nestjs/terminus": "10.2.3",
78
+ "@nestjs/terminus": "10.3.0",
79
79
  "apollo-server-core": "3.13.0",
80
80
  "apollo-server-express": "3.13.0",
81
81
  "bcrypt": "5.1.1",
82
82
  "class-transformer": "0.5.1",
83
83
  "class-validator": "0.14.1",
84
- "compression": "1.7.5",
84
+ "compression": "1.8.0",
85
85
  "cookie-parser": "1.4.7",
86
86
  "dotenv": "16.4.7",
87
87
  "ejs": "3.1.10",
88
- "graphql": "16.9.0",
88
+ "graphql": "16.10.0",
89
89
  "graphql-query-complexity": "1.0.0",
90
90
  "graphql-subscriptions": "3.0.0",
91
91
  "graphql-upload": "15.0.2",
92
92
  "js-sha256": "0.11.0",
93
93
  "json-to-graphql-query": "2.3.0",
94
- "light-my-request": "6.3.0",
94
+ "light-my-request": "6.6.0",
95
95
  "lodash": "4.17.21",
96
- "mongodb": "6.11.0",
97
- "mongoose": "7.8.3",
96
+ "mongodb": "6.13.1",
97
+ "mongoose": "7.8.6",
98
98
  "multer": "1.4.5-lts.1",
99
99
  "node-mailjet": "6.0.6",
100
- "nodemailer": "6.9.16",
101
- "nodemon": "3.1.7",
100
+ "nodemailer": "6.10.0",
101
+ "nodemon": "3.1.9",
102
102
  "passport": "0.7.0",
103
103
  "passport-jwt": "4.0.1",
104
104
  "reflect-metadata": "0.2.2",
105
105
  "rfdc": "1.4.1",
106
106
  "rimraf": "6.0.1",
107
- "rxjs": "7.8.1",
107
+ "rxjs": "7.8.2",
108
108
  "yuml-diagram": "1.2.0"
109
109
  },
110
110
  "devDependencies": {
@@ -115,16 +115,16 @@
115
115
  "@nestjs/schematics": "10.2.3",
116
116
  "@nestjs/testing": "10.4.15",
117
117
  "@swc/cli": "0.5.2",
118
- "@swc/core": "1.10.1",
118
+ "@swc/core": "1.10.18",
119
119
  "@swc/jest": "0.2.37",
120
120
  "@types/compression": "1.7.5",
121
121
  "@types/cookie-parser": "1.4.8",
122
122
  "@types/ejs": "3.1.5",
123
123
  "@types/express": "4.17.21",
124
124
  "@types/jest": "29.5.14",
125
- "@types/lodash": "4.17.13",
125
+ "@types/lodash": "4.17.15",
126
126
  "@types/multer": "1.4.12",
127
- "@types/node": "22.10.1",
127
+ "@types/node": "22.13.5",
128
128
  "@types/nodemailer": "6.4.17",
129
129
  "@types/passport": "1.0.17",
130
130
  "@types/supertest": "6.0.2",
@@ -144,15 +144,15 @@
144
144
  "jest": "29.7.0",
145
145
  "npm-watch": "0.13.0",
146
146
  "pm2": "5.4.3",
147
- "prettier": "3.4.2",
147
+ "prettier": "3.5.2",
148
148
  "pretty-quick": "4.0.0",
149
149
  "supertest": "7.0.0",
150
- "ts-jest": "29.2.5",
151
- "ts-loader": "9.5.1",
150
+ "ts-jest": "29.2.6",
151
+ "ts-loader": "9.5.2",
152
152
  "ts-morph": "24.0.0",
153
153
  "ts-node": "10.9.2",
154
154
  "tsconfig-paths": "4.2.0",
155
- "typescript": "5.7.2",
155
+ "typescript": "5.7.3",
156
156
  "yalc": "1.0.0-pre.53"
157
157
  },
158
158
  "overrides": {
@@ -1,4 +1,5 @@
1
1
  import * as dotenv from 'dotenv';
2
+ import * as process from 'node:process';
2
3
  import { join } from 'path';
3
4
 
4
5
  import _ = require('lodash');
@@ -60,15 +61,21 @@ export function merge(obj: Record<string, any>, ...sources: any[]): any {
60
61
  * @param options options for processing
61
62
  * @param options.config config object with different environments as main keys (see config.env.ts) to merge environment configurations into (default: {})
62
63
  * @param options.defaultEnv default environment to use if no NODE_ENV is set (default: 'local')
64
+ * @param options.envPath path to .env file (default: undefined => default of dotenv)
63
65
  */
64
- export function getEnvironmentConfig(options: { config?: Record<string, any>; defaultEnv?: string }) {
65
- const { config, defaultEnv } = {
66
+ export function getEnvironmentConfig(options: { config?: Record<string, any>; defaultEnv?: string; envPath?: string }) {
67
+ const { config, defaultEnv, envPath } = {
66
68
  config: {},
67
69
  defaultEnv: 'local',
68
70
  ...options,
69
71
  };
70
72
 
71
- dotenv.config();
73
+ if (envPath) {
74
+ dotenv.config({ path: envPath });
75
+ } else {
76
+ dotenv.config();
77
+ }
78
+
72
79
  const env = process.env['NODE' + '_ENV'] || defaultEnv;
73
80
  const envConfig = config[env] || config.local || {};
74
81
 
@@ -138,7 +145,10 @@ export function getEnvironmentConfig(options: { config?: Record<string, any>; de
138
145
  /**
139
146
  * Get environment object from environment variables
140
147
  */
141
- export function getEnvironmentObject(options?: { prefix?: string; processEnv?: Record<string, number | string> }) {
148
+ export function getEnvironmentObject(options?: {
149
+ prefix?: string;
150
+ processEnv?: Record<string, boolean | number | string>;
151
+ }) {
142
152
  const config = {
143
153
  prefix: 'NSC__',
144
154
  processEnv: process.env,
@@ -165,6 +175,15 @@ export function getEnvironmentObject(options?: { prefix?: string; processEnv?: R
165
175
  for (let i = 0; i < path.length; i++) {
166
176
  const segment = path[i];
167
177
  if (i === path.length - 1) {
178
+ // value preparation
179
+ if (value === 'true') {
180
+ value = true;
181
+ } else if (value === 'false') {
182
+ value = false;
183
+ } else if (!isNaN(Number(value))) {
184
+ value = Number(value);
185
+ }
186
+
168
187
  current[segment] = value;
169
188
  } else {
170
189
  current = current[segment] = current[segment] || {};