@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.
@@ -3529,7 +3529,7 @@ function extractFilterForHints(classDecl, project) {
3529
3529
  }
3530
3530
  return hints;
3531
3531
  }
3532
- function extractApplyFilterInfo(method, sourceFile, project, mixin) {
3532
+ function extractApplyFilterInfo(method, sourceFile, project, mixin, controllerClass) {
3533
3533
  const declFile = method.getSourceFile();
3534
3534
  const mixinEntity = resolveMixinEntityClass(mixin, project);
3535
3535
  for (const param of method.getParameters()) {
@@ -3555,7 +3555,7 @@ function extractApplyFilterInfo(method, sourceFile, project, mixin) {
3555
3555
  const filterClassName = filterClassArg.getText();
3556
3556
  const resolved = factoryStaticClass ? void 0 : findType(filterClassName, declFile, project);
3557
3557
  const declaredClass = factoryStaticClass ?? (resolved?.kind === "class" ? resolved.decl : resolveLocalClassDeclaration(filterClassArg));
3558
- const ownRoute = !mixin || declFile.getFilePath() !== mixin.factoryFilePath;
3558
+ const ownRoute = !mixin || (controllerClass ? method.getParent() === controllerClass : declFile.getFilePath() !== mixin.factoryFilePath);
3559
3559
  const namedByRoute = ownRoute && Node6.isIdentifier(filterClassArg) ? declaredClass : void 0;
3560
3560
  for (const candidate of orderFilterCandidates({
3561
3561
  namedByRoute,
@@ -4146,9 +4146,9 @@ function unwrapNamedContainer(node, names) {
4146
4146
  }
4147
4147
  return node;
4148
4148
  }
4149
- function extractDtoContract(method, sourceFile, project, mixin) {
4149
+ function extractDtoContract(method, sourceFile, project, mixin, controllerClass) {
4150
4150
  let body = extractBodyType(method, sourceFile, project);
4151
- const filterInfo = extractApplyFilterInfo(method, sourceFile, project, mixin);
4151
+ const filterInfo = extractApplyFilterInfo(method, sourceFile, project, mixin, controllerClass);
4152
4152
  const query = extractQueryType(method, sourceFile, project);
4153
4153
  const uploads = extractUploadedFiles(method);
4154
4154
  const multipartBody = uploads.fields ? `{ ${uploads.fields} }` : null;
@@ -4692,7 +4692,7 @@ function extractDtoRoute(args) {
4692
4692
  const methodName = method.getName();
4693
4693
  const classAs = readAsDecorator(cls, `class ${className}`);
4694
4694
  const methodAs = readAsDecorator(method, `${className}.${methodName}`);
4695
- const dtoContract = extractDtoContract(method, sourceFile, project, mixin);
4695
+ const dtoContract = extractDtoContract(method, sourceFile, project, mixin, cls);
4696
4696
  const mixinResponse = mixin ? resolveInstantiatedReturnType(cls, methodName) : void 0;
4697
4697
  return buildRoute({
4698
4698
  className,
@@ -4973,7 +4973,7 @@ async function watch(config, onChange, options = {}) {
4973
4973
  }
4974
4974
 
4975
4975
  // src/index.ts
4976
- var VERSION = "0.20.0";
4976
+ var VERSION = "0.21.0";
4977
4977
 
4978
4978
  // src/generate-manifest.ts
4979
4979
  var MANIFEST_FILE = ".codegen-manifest.json";