@dudousxd/nestjs-codegen 0.20.0 → 0.21.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 CHANGED
@@ -3771,7 +3771,7 @@ function extractFilterForHints(classDecl, project) {
3771
3771
  }
3772
3772
  return hints;
3773
3773
  }
3774
- function extractApplyFilterInfo(method, sourceFile, project, mixin) {
3774
+ function extractApplyFilterInfo(method, sourceFile, project, mixin, controllerClass) {
3775
3775
  const declFile = method.getSourceFile();
3776
3776
  const mixinEntity = resolveMixinEntityClass(mixin, project);
3777
3777
  for (const param of method.getParameters()) {
@@ -3797,7 +3797,7 @@ function extractApplyFilterInfo(method, sourceFile, project, mixin) {
3797
3797
  const filterClassName = filterClassArg.getText();
3798
3798
  const resolved = factoryStaticClass ? void 0 : findType(filterClassName, declFile, project);
3799
3799
  const declaredClass = factoryStaticClass ?? (resolved?.kind === "class" ? resolved.decl : resolveLocalClassDeclaration(filterClassArg));
3800
- const ownRoute = !mixin || declFile.getFilePath() !== mixin.factoryFilePath;
3800
+ const ownRoute = !mixin || (controllerClass ? method.getParent() === controllerClass : declFile.getFilePath() !== mixin.factoryFilePath);
3801
3801
  const namedByRoute = ownRoute && import_ts_morph7.Node.isIdentifier(filterClassArg) ? declaredClass : void 0;
3802
3802
  for (const candidate of orderFilterCandidates({
3803
3803
  namedByRoute,
@@ -4388,9 +4388,9 @@ function unwrapNamedContainer(node, names) {
4388
4388
  }
4389
4389
  return node;
4390
4390
  }
4391
- function extractDtoContract(method, sourceFile, project, mixin) {
4391
+ function extractDtoContract(method, sourceFile, project, mixin, controllerClass) {
4392
4392
  let body = extractBodyType(method, sourceFile, project);
4393
- const filterInfo = extractApplyFilterInfo(method, sourceFile, project, mixin);
4393
+ const filterInfo = extractApplyFilterInfo(method, sourceFile, project, mixin, controllerClass);
4394
4394
  const query = extractQueryType(method, sourceFile, project);
4395
4395
  const uploads = extractUploadedFiles(method);
4396
4396
  const multipartBody = uploads.fields ? `{ ${uploads.fields} }` : null;
@@ -4953,7 +4953,7 @@ function extractDtoRoute(args) {
4953
4953
  const methodName = method.getName();
4954
4954
  const classAs = readAsDecorator(cls, `class ${className}`);
4955
4955
  const methodAs = readAsDecorator(method, `${className}.${methodName}`);
4956
- const dtoContract = extractDtoContract(method, sourceFile, project, mixin);
4956
+ const dtoContract = extractDtoContract(method, sourceFile, project, mixin, cls);
4957
4957
  const mixinResponse = mixin ? resolveInstantiatedReturnType(cls, methodName) : void 0;
4958
4958
  return buildRoute({
4959
4959
  className,
@@ -5317,7 +5317,7 @@ function createChainModuleRenderer(opts) {
5317
5317
  }
5318
5318
 
5319
5319
  // src/index.ts
5320
- var VERSION = "0.20.0";
5320
+ var VERSION = "0.21.0";
5321
5321
  // Annotate the CommonJS export names for ESM import in node:
5322
5322
  0 && (module.exports = {
5323
5323
  CodegenError,