@itgorillaz/configify 4.0.2 → 4.1.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/README.md CHANGED
@@ -9,21 +9,25 @@
9
9
  <a href="https://buymeacoffee.com/tommelo" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>
10
10
  </p>
11
11
 
12
- ## Description
12
+ # configify
13
13
 
14
- **configify** is a NestJS configuration module that makes it easier to deal with configuration files and secrets.
14
+ **configify** is a NestJS configuration module that simplifies loading, validating, and injecting configuration from environment variables, config files, and remote secret managers.
15
15
 
16
16
  ## Installation
17
17
 
18
18
  ```bash
19
- $ npm install --save @itgorillaz/configify
19
+ npm install --save @itgorillaz/configify
20
20
  ```
21
21
 
22
- ## Usage
22
+ ---
23
23
 
24
- To start using the <b>configify</b> module in your application import the module by calling the `forRootAsync` function:
24
+ ## Quick Start
25
+
26
+ Import `ConfigifyModule` into your root module using `forRootAsync()`:
27
+
28
+ ```typescript
29
+ import { ConfigifyModule } from '@itgorillaz/configify';
25
30
 
26
- ```js
27
31
  @Module({
28
32
  imports: [ConfigifyModule.forRootAsync()],
29
33
  controllers: [AppController],
@@ -32,44 +36,63 @@ To start using the <b>configify</b> module in your application import the module
32
36
  export class AppModule {}
33
37
  ```
34
38
 
35
- **Important Note**: When working with strict mode enabled `"strict": true`(tsconfig.json) it's necessary to set the option `strictPropertyInitialization` to `false` since the module will initialize the configuration class properties during runtime after resolving the values of the environment variables.
39
+ > **TypeScript strict mode:** If you have `"strict": true` in your `tsconfig.json` and you are not using [constructor configuration injection](#mapping-configuration-classes-with-constructor-injection), you must also set `"strictPropertyInitialization": false`. This is required because configify initializes configuration properties at runtime.
40
+ >
41
+ > ```json
42
+ > {
43
+ > "compilerOptions": {
44
+ > "strict": true,
45
+ > "strictPropertyInitialization": false
46
+ > }
47
+ > }
48
+ > ```
49
+
50
+ ---
36
51
 
37
- By default, when bootstraping, the module will lookup for a `.env`, an `application.yml` and an `application.json` file at the root folder of the project:
52
+ ## Configuration File Discovery
53
+
54
+ By default, configify looks for the following files in the **root of your project**:
38
55
 
39
56
  ```
40
- my-web-app
41
- | .env
42
- | application.yml
43
- | application.json
57
+ my-app/
58
+ ├── .env
59
+ ├── application.yml
60
+ └── application.json
44
61
  ```
45
62
 
46
- You can also provide the location of the configuration files by overriding the configuration options.
63
+ All three formats are supported and can be used together. You can also [customize the file paths](#overriding-default-options).
47
64
 
48
- ### Mapping Configuration Classes
65
+ ---
49
66
 
50
- This module will lookup for every class decorated with `@Configuration` and it will make its instance globally available for the application.
67
+ ## Mapping Configuration Classes
51
68
 
52
- Example of a `.env` file mapped to a class:
69
+ Decorate any class with `@Configuration()` and configify will automatically discover it, populate its properties, and make the instance available for dependency injection throughout your application.
53
70
 
54
- ```
71
+ ### From a `.env` file
72
+
73
+ ```bash
74
+ # .env
55
75
  APPLICATION_CLIENT_ID=ABC
56
76
  APPLICATION_CLIENT_TOKEN=TEST
57
77
  ```
58
78
 
59
- ```js
79
+ ```typescript
80
+ import { Configuration, Value } from '@itgorillaz/configify';
81
+
60
82
  @Configuration()
61
83
  export class ApplicationClientConfig {
62
84
  @Value('APPLICATION_CLIENT_ID')
63
85
  appClientId: string;
64
86
 
65
87
  @Value('APPLICATION_CLIENT_TOKEN')
66
- appClientToken: string
88
+ appClientToken: string;
67
89
  }
68
90
  ```
69
91
 
70
- Example of a `.yml` file mapped to a class:
92
+ ### From a `.yml` file
71
93
 
72
- ```
94
+ ```yaml
95
+ # application.yml
73
96
  database:
74
97
  host: localhost
75
98
  port: 3306
@@ -81,112 +104,164 @@ database:
81
104
  }
82
105
  ```
83
106
 
84
- ```js
107
+ ```typescript
108
+ import { Configuration, Value } from '@itgorillaz/configify';
109
+
110
+ interface DatabaseMetadata {
111
+ label: string;
112
+ }
113
+
85
114
  @Configuration()
86
115
  export class DatabaseConfiguration {
87
116
  @Value('database.host')
88
117
  host: string;
89
118
 
90
- @Value('database.port', {
91
- parse: parseInt
92
- })
119
+ @Value('database.port', { parse: parseInt })
93
120
  port: number;
94
121
 
95
- @Value('database.metadata', {
96
- parse: JSON.parse
97
- })
98
- metadata: MetadataType;
122
+ @Value('database.metadata', { parse: JSON.parse })
123
+ metadata: DatabaseMetadata;
99
124
  }
100
125
  ```
101
126
 
102
- You can map your configuration file to multiple configuration classes:
127
+ ### Splitting one file into multiple configuration classes
103
128
 
104
- ```
105
- # database config
129
+ A single config file can be split across multiple configuration classes to keep concerns separated:
130
+
131
+ ```bash
132
+ # .env
106
133
  DATABASE_HOST=localhost
107
134
  DATABASE_USER=test
108
135
  DATABASE_PASSWORD=test
109
136
 
110
- # okta config
111
137
  OKTA_API_TOKEN=test
112
138
  OKTA_CLIENT_ID=test
113
139
  ```
114
140
 
115
- ```js
141
+ ```typescript
116
142
  @Configuration()
117
143
  export class DatabaseConfiguration {
118
- // database configuration attributes
144
+ @Value('DATABASE_HOST')
145
+ host: string;
146
+
147
+ @Value('DATABASE_USER')
148
+ user: string;
149
+
150
+ @Value('DATABASE_PASSWORD')
151
+ password: string;
119
152
  }
120
- ```
121
153
 
122
- ```js
123
154
  @Configuration()
124
155
  export class OktaConfiguration {
125
- // okta configuration attributes
156
+ @Value('OKTA_API_TOKEN')
157
+ apiToken: string;
158
+
159
+ @Value('OKTA_CLIENT_ID')
160
+ clientId: string;
126
161
  }
127
162
  ```
128
163
 
129
- ### Dependency Injection
164
+ ### Mapping Configuration Classes with Constructor Injection
130
165
 
131
- This module makes all the configuration instances globally available to the application, to access it you just need to declare the configuration class as an argument in the class constructor:
166
+ Decorate your configuration class with `@RequiredArgsConstructor()` and configify will automatically create the instance of the configuration class passing the configuration values as an object to the constructor.
132
167
 
133
- ```js
134
- export class AppService {
135
- private readonly LOGGER = new Logger(AppService.name);
168
+ ```bash
169
+ # .env
170
+ DATABASE_HOST=localhost
171
+ DATABASE_USER=test
172
+ DATABASE_PASSWORD=test
173
+ ```
136
174
 
137
- constructor(private readonly config: MyConfig) {
138
- this.LOGGER.log(JSON.stringify(config));
139
- }
175
+ ```typescript
176
+ @Configuration()
177
+ @RequiredArgsConstructor()
178
+ export class DatabaseConfiguration {
179
+ @Value('DATABASE_HOST')
180
+ host: string;
181
+
182
+ @Value('DATABASE_USER')
183
+ user: string;
140
184
 
185
+ @Value('DATABASE_PASSWORD')
186
+ password: string;
187
+
188
+ constructor(config: Required<DatabaseConfiguration>) {
189
+ this.host = config.host;
190
+ this.user = config.user;
191
+ this.password = config.password;
192
+ }
141
193
  }
142
194
  ```
143
195
 
144
- ### Variables Expansion
196
+ ---
145
197
 
146
- You can make use of variable expansion in your configuration files:
198
+ ## Dependency Injection
147
199
 
200
+ All `@Configuration()` classes are registered globally. Inject them into any provider via the constructor:
201
+
202
+ ```typescript
203
+ import { Injectable, Logger } from '@nestjs/common';
204
+ import { DatabaseConfiguration } from './database.configuration';
205
+
206
+ @Injectable()
207
+ export class AppService {
208
+ private readonly logger = new Logger(AppService.name);
209
+
210
+ constructor(private readonly dbConfig: DatabaseConfiguration) {
211
+ this.logger.log(
212
+ `Connecting to database at ${dbConfig.host}:${dbConfig.port}`,
213
+ );
214
+ }
215
+ }
148
216
  ```
149
- MY_API_KEY=${MY_SECRET} // --> MY_API_KEY=TEST
150
- ANY_OTHER_CONFIG=TEST
151
- MY_SECRET=TEST
152
- APP_CLIENT_ID=${NON_EXISTING_ENV:-DEFAULT_ID} // --> APP_CLIENT_ID=DEFAULT_ID
153
- ```
154
217
 
155
- ### Defining Default Configuration Values
218
+ ---
219
+
220
+ ## Default Values
156
221
 
157
- Other than defining default values with variables expansion, you can also define a default value to an attribute using the `default` option provided by the `@Value()` decorator:
222
+ You can provide fallback values in two ways:
158
223
 
159
- ```js
224
+ **Option 1 — Variable expansion syntax (in the config file):**
225
+
226
+ ```bash
227
+ # .env
228
+ APP_CLIENT_ID=${NON_EXISTING_VAR:-DEFAULT_ID} # resolves to DEFAULT_ID
229
+ ```
230
+
231
+ **Option 2 — `@Value()` decorator option:**
232
+
233
+ ```typescript
160
234
  @Configuration()
161
235
  export class DatabaseConfiguration {
162
236
  @Value('DB_HOST', { default: 'localhost' })
163
237
  host: string;
164
238
 
165
- @Value('DB_PORT', {
166
- parse: parseInt,
167
- default: 3306
168
- })
239
+ @Value('DB_PORT', { parse: parseInt, default: 3306 })
169
240
  port: number;
170
241
  }
171
242
  ```
172
243
 
173
- ### Dealing with Secrets
244
+ ---
174
245
 
175
- Out of the box, this module can resolve secrets from:
246
+ ## Variable Expansion
176
247
 
177
- - AWS Secrets Manager and AWS Parameter Store
178
- - Azure Key Vault
179
- - Bitwarden Secrets Manager
180
- - Google Cloud Secret Manager
181
- - Custom Remote Configuration Resolver(your own implementation)
248
+ configify supports variable expansion in config files, including cross-variable references and default fallbacks:
182
249
 
183
- Check the [examples](/examples/) and their documentation to learn how to use them.
250
+ ```bash
251
+ # .env
252
+ MY_SECRET=TEST
253
+ MY_API_KEY=${MY_SECRET} # resolves to: TEST
254
+ APP_CLIENT_ID=${NON_EXISTING:-DEFAULT_ID} # resolves to: DEFAULT_ID
255
+ ```
256
+
257
+ ---
184
258
 
185
- ### Parsing Configuration Values
259
+ ## Parsing Configuration Values
186
260
 
187
- Parsing a configuration value can be easily done by using a parse callback function available as argument of the `@Value()` decorator:
261
+ Use the `parse` option to transform raw string values into the types your application needs:
188
262
 
189
263
  ```yaml
264
+ # application.yml
190
265
  db-json-config: |
191
266
  {
192
267
  "host": "localhost",
@@ -195,71 +270,99 @@ db-json-config: |
195
270
  }
196
271
  ```
197
272
 
198
- ```js
199
- export interface MyDBConfig {
273
+ ```typescript
274
+ interface DbConfig {
200
275
  host: string;
201
276
  user: string;
202
277
  password: string;
203
278
  }
204
279
 
205
280
  @Configuration()
206
- export class SuperSecretConfiguration {
207
- @Value('db-json-config', {
208
- parse: JSON.parse
209
- })
210
- myDbConfig: MyDBConfig;
281
+ export class DatabaseConfiguration {
282
+ @Value('db-json-config', { parse: JSON.parse })
283
+ dbConfig: DbConfig;
211
284
  }
212
285
  ```
213
286
 
214
- ### Validating Configuration Classes
287
+ The `parse` option accepts any function with the signature `(value: string) => T`, so you can use built-ins like `parseInt`, `JSON.parse`, or your own custom parser.
288
+
289
+ ---
215
290
 
216
- Depending on how critical a configuration is, you may want to validate it before starting the application, for that you can use [class-validator](https://github.com/typestack/class-validator) to make sure your configuration is loaded correctly:
291
+ ## Validating Configuration
292
+
293
+ Use [`class-validator`](https://github.com/typestack/class-validator) decorators alongside `@Value()` to validate configuration at startup — before your application begins serving requests:
294
+
295
+ ```bash
296
+ npm install --save class-validator
297
+ ```
298
+
299
+ ```typescript
300
+ import { IsEmail, IsNotEmpty, IsUrl } from 'class-validator';
301
+ import { Configuration, Value } from '@itgorillaz/configify';
217
302
 
218
- ```js
219
303
  @Configuration()
220
- export class MyConfiguration {
304
+ export class NotificationConfiguration {
221
305
  @IsEmail()
222
306
  @Value('SENDER_EMAIL')
223
307
  senderEmail: string;
224
308
 
225
309
  @IsNotEmpty()
226
- @Value('my-api-token')
227
- myApiToken: string;
310
+ @Value('API_TOKEN')
311
+ apiToken: string;
312
+
313
+ @IsUrl()
314
+ @Value('WEBHOOK_URL')
315
+ webhookUrl: string;
228
316
  }
229
317
  ```
230
318
 
231
- ### Overwrite Default Options
232
-
233
- You can overwrite default module options by providing an object as argument to the `forRootAsync()` method:
234
-
235
- ```js
236
- /**
237
- * Ignores any config file.
238
- * The default value is false;
239
- */
240
- ignoreConfigFile?: boolean;
241
-
242
- /**
243
- * Ignores environment variables
244
- * The default value is false;
245
- */
246
- ignoreEnvVars?: boolean;
247
-
248
- /**
249
- * The path of the configuration files
250
- */
251
- configFilePath?: string | string[];
252
-
253
- /**
254
- * Expands variables
255
- * The default value is true
256
- */
257
- expandConfig?: boolean;
258
-
259
- /**
260
- * The secrets resolvers strategies
261
- */
262
- secretsResolverStrategies?: ConfigurationResolver[];
319
+ If validation fails, the application will throw an error on startup with a clear message describing which values are missing or invalid.
320
+
321
+ ---
322
+
323
+ ## Secrets Management
324
+
325
+ configify has built-in support for resolving secrets from external providers:
326
+
327
+ | Provider | Notes |
328
+ | --------------------------- | ------------------------------------------ |
329
+ | AWS Secrets Manager | |
330
+ | AWS Parameter Store | |
331
+ | Azure Key Vault | |
332
+ | Bitwarden Secrets Manager | |
333
+ | Google Cloud Secret Manager | |
334
+ | Custom resolver | Implement your own `ConfigurationResolver` |
335
+
336
+ See the [examples directory](/examples/) for provider-specific setup instructions.
337
+
338
+ ---
339
+
340
+ ## Overriding Default Options
341
+
342
+ Pass an options object to `forRootAsync()` to customize module behavior:
343
+
344
+ ```typescript
345
+ ConfigifyModule.forRootAsync({
346
+ // Ignore all config files (.env, application.yml, application.json)
347
+ // Default: false
348
+ ignoreConfigFile: false,
349
+
350
+ // Ignore environment variables
351
+ // Default: false
352
+ ignoreEnvVars: false,
353
+
354
+ // Path(s) to configuration files (overrides default discovery)
355
+ configFilePath: './config/app.yml',
356
+ // or multiple files:
357
+ // configFilePath: ['./config/database.yml', './config/app.env'],
358
+
359
+ // Enable/disable variable expansion
360
+ // Default: true
361
+ expandConfig: true,
362
+
363
+ // Custom secrets resolver strategies
364
+ secretsResolverStrategies: [],
365
+ });
263
366
  ```
264
367
 
265
368
  ## License
@@ -13,6 +13,7 @@ const class_validator_1 = require("class-validator");
13
13
  const fs = require("fs");
14
14
  const path_1 = require("path");
15
15
  const configuration_1 = require("./configuration");
16
+ const decorators_1 = require("./decorators");
16
17
  const variables_1 = require("./interpolation/variables");
17
18
  let ConfigifyModule = ConfigifyModule_1 = class ConfigifyModule {
18
19
  static async forRootAsync(options = {}) {
@@ -55,15 +56,21 @@ let ConfigifyModule = ConfigifyModule_1 = class ConfigifyModule {
55
56
  const providers = [];
56
57
  const registry = configuration_1.ConfigurationRegistry.getRegistry();
57
58
  for (const ConfigType of registry) {
58
- const instance = new ConfigType();
59
- const attributes = configuration_1.ConfigurationRegistry.getValueDecoratedAttributes(instance);
59
+ const prototype = ConfigType.prototype;
60
+ const requiresArgsConstructor = !!Reflect.getMetadata(decorators_1.REQUIRED_ARGS_CONSTRUCTOR_METADATA, ConfigType);
61
+ const attributes = configuration_1.ConfigurationRegistry.getValueDecoratedAttributes(prototype);
62
+ const ctorArgs = {};
63
+ const target = requiresArgsConstructor ? ctorArgs : new ConfigType();
60
64
  for (const attribute of attributes) {
61
- const metadata = configuration_1.ConfigurationRegistry.getValueDecoratedKey(instance, attribute);
65
+ const metadata = configuration_1.ConfigurationRegistry.getValueDecoratedKey(prototype, attribute);
62
66
  const parse = (_a = metadata.options) === null || _a === void 0 ? void 0 : _a.parse;
63
67
  const defaultValue = process.env[metadata.key] || ((_b = metadata.options) === null || _b === void 0 ? void 0 : _b.default);
64
68
  const value = parse ? parse(defaultValue) : defaultValue;
65
- instance[attribute] = value;
69
+ target[attribute] = value;
66
70
  }
71
+ const instance = requiresArgsConstructor
72
+ ? new ConfigType(target)
73
+ : target;
67
74
  const errors = (0, class_validator_1.validateSync)(instance, this.VALIDATION_OPTIONS);
68
75
  if (errors && errors.length) {
69
76
  throw new Error(`validation constraints violated:\n${errors
@@ -1 +1 @@
1
- {"version":3,"file":"configify.module.js","sourceRoot":"","sources":["../src/configify.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAiE;AACjE,qDAAiE;AACjE,yBAAyB;AACzB,+BAA+B;AAC/B,mDAMyB;AACzB,yDAAsD;AAmB/C,IAAM,eAAe,uBAArB,MAAM,eAAe;IAkC1B,MAAM,CAAC,KAAK,CAAC,YAAY,CACvB,UAAkC,EAAE;QAEpC,MAAM,QAAQ,mCAAQ,OAAO,GAAK,6CAA6B,CAAE,CAAC;QAClE,MAAM,KAAK,GAAG,IAAI,CAAC,yBAAyB,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QAEtE,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC;QAC1D,MAAM,QAAQ,GAAG,QAA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AAC,CAAC;QAChC,CAAC;QAED,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QAEvC,OAAO,EAAE,CAAC;IACZ,CAAC;IAUO,MAAM,CAAC,yBAAyB,CAAC,IAAwB;QAC/D,OAAQ,EAAe;aACpB,MAAM,CAAC,IAAI,IAAI,EAAE,EAAE,IAAI,CAAC,oBAAoB,CAAC;aAC7C,MAAM,CACL,CAAC,IAAI,EAAE,EAAE,CACP,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,0CAA0B,CAAC,QAAQ,CAAC,IAAI,CAAC,CACnE,CAAC;IACN,CAAC;;AAlNU,0CAAe;AAMF,kCAAkB,GAAqB;IAC7D,mBAAmB,EAAE,KAAK;CAC3B,AAFyC,CAExC;AAQsB,oCAAoB,GAAG;IAC7C,IAAA,cAAO,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC;IAC9B,IAAA,cAAO,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,iBAAiB,CAAC;IACzC,IAAA,cAAO,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,kBAAkB,CAAC;CAC3C,AAJ2C,CAI1C;0BApBS,eAAe;IAD3B,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,eAAe,CAmN3B"}
@@ -1,2 +1,3 @@
1
1
  export * from './configuration.decorator';
2
+ export * from './required-args-constructor.decorator';
2
3
  export * from './value.decorator';
@@ -15,5 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./configuration.decorator"), exports);
18
+ __exportStar(require("./required-args-constructor.decorator"), exports);
18
19
  __exportStar(require("./value.decorator"), exports);
19
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,oDAAkC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,wEAAsD;AACtD,oDAAkC"}
@@ -0,0 +1,2 @@
1
+ export declare const REQUIRED_ARGS_CONSTRUCTOR_METADATA: unique symbol;
2
+ export declare function RequiredArgsConstructor(): ClassDecorator;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.REQUIRED_ARGS_CONSTRUCTOR_METADATA = void 0;
4
+ exports.RequiredArgsConstructor = RequiredArgsConstructor;
5
+ exports.REQUIRED_ARGS_CONSTRUCTOR_METADATA = Symbol.for('REQUIRED_ARGS_CONSTRUCTOR_METADATA');
6
+ function RequiredArgsConstructor() {
7
+ return (target) => {
8
+ Reflect.defineMetadata(exports.REQUIRED_ARGS_CONSTRUCTOR_METADATA, true, target);
9
+ };
10
+ }
11
+ //# sourceMappingURL=required-args-constructor.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"required-args-constructor.decorator.js","sourceRoot":"","sources":["../../src/decorators/required-args-constructor.decorator.ts"],"names":[],"mappings":";;;AAaA,0DAIC;AAbY,QAAA,kCAAkC,GAAG,MAAM,CAAC,GAAG,CAC1D,oCAAoC,CACrC,CAAC;AAOF,SAAgB,uBAAuB;IACrC,OAAO,CAAC,MAAc,EAAE,EAAE;QACxB,OAAO,CAAC,cAAc,CAAC,0CAAkC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAC3E,CAAC,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -20,8 +20,8 @@
20
20
  "@nestjs/testing": "^11.0.5",
21
21
  "@types/jest": "30.0.0",
22
22
  "@types/js-yaml": "^4.0.9",
23
- "@types/node": "24.10.1",
24
- "@types/supertest": "^6.0.2",
23
+ "@types/node": "25.3.2",
24
+ "@types/supertest": "^7.2.0",
25
25
  "@typescript-eslint/eslint-plugin": "^8.1.0",
26
26
  "@typescript-eslint/parser": "^8.1.0",
27
27
  "eslint": "^8.0.0 || ^9.0.0",
@@ -82,5 +82,5 @@
82
82
  "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
83
83
  "test": "jest --config ./test/jest.config.json --coverage --silent=false --verbose --runInBand"
84
84
  },
85
- "version": "4.0.2"
85
+ "version": "4.1.0"
86
86
  }