@nestjs/core 11.1.11 → 11.1.13

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2017-2025 Kamil Mysliwiec <https://kamilmysliwiec.com>
3
+ Copyright (c) 2017-present Kamil Mysliwiec <https://kamilmysliwiec.com>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
package/Readme.md CHANGED
@@ -63,6 +63,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
63
63
  <td><a href="https://microsoft.com/" target="_blank"><img src="https://nestjs.com/img/logos/microsoft-logo.png" width="180" valign="middle" /></a></td>
64
64
  <td><a href="https://mojam.co" target="_blank"><img src="https://nestjs.com/img/logos/mojam-logo.png" width="80" valign="middle" /></a></td>
65
65
  <td><a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="170" valign="middle" /></a></td>
66
+ <td><a href="https://serpapi.com/" target="_blank"><img src="https://nestjs.com/img/logos/serpapi-logo.png" width="150" valign="middle" /></a></td>
66
67
  </tr>
67
68
  </table>
68
69
 
@@ -72,7 +72,7 @@ export declare class Injector {
72
72
  resolveComponentHost<T>(moduleRef: Module, instanceWrapper: InstanceWrapper<T | Promise<T>>, contextId?: ContextId, inquirer?: InstanceWrapper): Promise<InstanceWrapper>;
73
73
  lookupComponent<T = any>(providers: Map<Function | string | symbol, InstanceWrapper>, moduleRef: Module, dependencyContext: InjectorDependencyContext, wrapper: InstanceWrapper<T>, contextId?: ContextId, inquirer?: InstanceWrapper, keyOrIndex?: symbol | string | number): Promise<InstanceWrapper<T>>;
74
74
  lookupComponentInParentModules<T = any>(dependencyContext: InjectorDependencyContext, moduleRef: Module, wrapper: InstanceWrapper<T>, contextId?: ContextId, inquirer?: InstanceWrapper, keyOrIndex?: symbol | string | number): Promise<any>;
75
- lookupComponentInImports(moduleRef: Module, name: InjectionToken, wrapper: InstanceWrapper, moduleRegistry?: any[], contextId?: ContextId, inquirer?: InstanceWrapper, keyOrIndex?: symbol | string | number, isTraversing?: boolean): Promise<any>;
75
+ lookupComponentInImports(moduleRef: Module, name: InjectionToken, wrapper: InstanceWrapper, moduleRegistry?: Set<string>, contextId?: ContextId, inquirer?: InstanceWrapper, keyOrIndex?: symbol | string | number, isTraversing?: boolean): Promise<any>;
76
76
  resolveProperties<T>(wrapper: InstanceWrapper<T>, moduleRef: Module, inject?: InjectorDependency[], contextId?: ContextId, inquirer?: InstanceWrapper, parentInquirer?: InstanceWrapper): Promise<PropertyDependency[]>;
77
77
  reflectProperties<T>(type: Type<T>): PropertyDependency[];
78
78
  applyProperties<T = any>(instance: T, properties: PropertyDependency[]): void;
@@ -285,13 +285,13 @@ class Injector {
285
285
  return this.lookupComponentInParentModules(dependencyContext, moduleRef, wrapper, contextId, inquirer, keyOrIndex);
286
286
  }
287
287
  async lookupComponentInParentModules(dependencyContext, moduleRef, wrapper, contextId = constants_2.STATIC_CONTEXT, inquirer, keyOrIndex) {
288
- const instanceWrapper = await this.lookupComponentInImports(moduleRef, dependencyContext.name, wrapper, [], contextId, inquirer, keyOrIndex);
288
+ const instanceWrapper = await this.lookupComponentInImports(moduleRef, dependencyContext.name, wrapper, new Set(), contextId, inquirer, keyOrIndex);
289
289
  if ((0, shared_utils_1.isNil)(instanceWrapper)) {
290
290
  throw new unknown_dependencies_exception_1.UnknownDependenciesException(wrapper.name, dependencyContext, moduleRef, { id: wrapper.id });
291
291
  }
292
292
  return instanceWrapper;
293
293
  }
294
- async lookupComponentInImports(moduleRef, name, wrapper, moduleRegistry = [], contextId = constants_2.STATIC_CONTEXT, inquirer, keyOrIndex, isTraversing) {
294
+ async lookupComponentInImports(moduleRef, name, wrapper, moduleRegistry = new Set(), contextId = constants_2.STATIC_CONTEXT, inquirer, keyOrIndex, isTraversing) {
295
295
  let instanceWrapperRef = null;
296
296
  const imports = moduleRef.imports || new Set();
297
297
  const identity = (item) => item;
@@ -301,11 +301,11 @@ class Injector {
301
301
  children = children.filter(child => contextModuleExports.has(child.metatype));
302
302
  }
303
303
  for (const relatedModule of children) {
304
- if (moduleRegistry.includes(relatedModule.id)) {
304
+ if (moduleRegistry.has(relatedModule.id)) {
305
305
  continue;
306
306
  }
307
307
  this.printLookingForProviderLog(name, relatedModule);
308
- moduleRegistry.push(relatedModule.id);
308
+ moduleRegistry.add(relatedModule.id);
309
309
  const { providers, exports } = relatedModule;
310
310
  if (!exports.has(name) || !providers.has(name)) {
311
311
  const instanceRef = await this.lookupComponentInImports(relatedModule, name, wrapper, moduleRegistry, contextId, inquirer, keyOrIndex, true);
@@ -60,4 +60,5 @@ export declare class NestApplication extends NestApplicationContext<NestApplicat
60
60
  private host;
61
61
  private getProtocol;
62
62
  private registerMiddleware;
63
+ private applyInstanceDecoratorIfRegistered;
63
64
  }
@@ -256,6 +256,7 @@ class NestApplication extends nest_application_context_1.NestApplicationContext
256
256
  return this;
257
257
  }
258
258
  useGlobalFilters(...filters) {
259
+ filters = this.applyInstanceDecoratorIfRegistered(...filters);
259
260
  this.config.useGlobalFilters(...filters);
260
261
  filters.forEach(item => this.graphInspector.insertOrphanedEnhancer({
261
262
  subtype: 'filter',
@@ -264,6 +265,7 @@ class NestApplication extends nest_application_context_1.NestApplicationContext
264
265
  return this;
265
266
  }
266
267
  useGlobalPipes(...pipes) {
268
+ pipes = this.applyInstanceDecoratorIfRegistered(...pipes);
267
269
  this.config.useGlobalPipes(...pipes);
268
270
  pipes.forEach(item => this.graphInspector.insertOrphanedEnhancer({
269
271
  subtype: 'pipe',
@@ -272,6 +274,7 @@ class NestApplication extends nest_application_context_1.NestApplicationContext
272
274
  return this;
273
275
  }
274
276
  useGlobalInterceptors(...interceptors) {
277
+ interceptors = this.applyInstanceDecoratorIfRegistered(...interceptors);
275
278
  this.config.useGlobalInterceptors(...interceptors);
276
279
  interceptors.forEach(item => this.graphInspector.insertOrphanedEnhancer({
277
280
  subtype: 'interceptor',
@@ -280,6 +283,7 @@ class NestApplication extends nest_application_context_1.NestApplicationContext
280
283
  return this;
281
284
  }
282
285
  useGlobalGuards(...guards) {
286
+ guards = this.applyInstanceDecoratorIfRegistered(...guards);
283
287
  this.config.useGlobalGuards(...guards);
284
288
  guards.forEach(item => this.graphInspector.insertOrphanedEnhancer({
285
289
  subtype: 'guard',
@@ -314,5 +318,11 @@ class NestApplication extends nest_application_context_1.NestApplicationContext
314
318
  async registerMiddleware(instance) {
315
319
  await this.middlewareModule.registerMiddleware(this.middlewareContainer, instance);
316
320
  }
321
+ applyInstanceDecoratorIfRegistered(...instances) {
322
+ if (this.appOptions.instrument?.instanceDecorator) {
323
+ return instances.map(instance => this.appOptions.instrument.instanceDecorator(instance));
324
+ }
325
+ return instances;
326
+ }
317
327
  }
318
328
  exports.NestApplication = NestApplication;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/core",
3
- "version": "11.1.11",
3
+ "version": "11.1.13",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@core)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "license": "MIT",
@@ -39,7 +39,7 @@
39
39
  "uid": "2.0.2"
40
40
  },
41
41
  "devDependencies": {
42
- "@nestjs/common": "11.1.11"
42
+ "@nestjs/common": "11.1.13"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "@nestjs/common": "^11.0.0",
@@ -60,5 +60,5 @@
60
60
  "optional": true
61
61
  }
62
62
  },
63
- "gitHead": "20529c07e3cc6647fa7611ef6eb776ad5507a325"
63
+ "gitHead": "e3a958ac3efebe7995e6d487e00bbc6fd6267fd5"
64
64
  }
package/repl/repl.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { DynamicModule, Type } from '@nestjs/common';
2
2
  import type { ReplOptions } from 'repl';
3
- export declare function repl(module: Type | DynamicModule, replOptions?: ReplOptions): Promise<import("repl").REPLServer>;
3
+ export declare function repl(module: Type | DynamicModule, replOptions?: ReplOptions): Promise<import("node:repl").REPLServer>;