@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/CHANGELOG.md +27 -0
- package/dist/cli/main.cjs +6 -6
- package/dist/cli/main.cjs.map +1 -1
- package/dist/cli/main.js +6 -6
- package/dist/cli/main.js.map +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/nest/index.cjs +6 -6
- package/dist/nest/index.cjs.map +1 -1
- package/dist/nest/index.js +6 -6
- package/dist/nest/index.js.map +1 -1
- package/package.json +1 -1
package/dist/nest/index.cjs
CHANGED
|
@@ -3553,7 +3553,7 @@ function extractFilterForHints(classDecl, project) {
|
|
|
3553
3553
|
}
|
|
3554
3554
|
return hints;
|
|
3555
3555
|
}
|
|
3556
|
-
function extractApplyFilterInfo(method, sourceFile, project, mixin) {
|
|
3556
|
+
function extractApplyFilterInfo(method, sourceFile, project, mixin, controllerClass) {
|
|
3557
3557
|
const declFile = method.getSourceFile();
|
|
3558
3558
|
const mixinEntity = resolveMixinEntityClass(mixin, project);
|
|
3559
3559
|
for (const param of method.getParameters()) {
|
|
@@ -3579,7 +3579,7 @@ function extractApplyFilterInfo(method, sourceFile, project, mixin) {
|
|
|
3579
3579
|
const filterClassName = filterClassArg.getText();
|
|
3580
3580
|
const resolved = factoryStaticClass ? void 0 : findType(filterClassName, declFile, project);
|
|
3581
3581
|
const declaredClass = factoryStaticClass ?? (resolved?.kind === "class" ? resolved.decl : resolveLocalClassDeclaration(filterClassArg));
|
|
3582
|
-
const ownRoute = !mixin || declFile.getFilePath() !== mixin.factoryFilePath;
|
|
3582
|
+
const ownRoute = !mixin || (controllerClass ? method.getParent() === controllerClass : declFile.getFilePath() !== mixin.factoryFilePath);
|
|
3583
3583
|
const namedByRoute = ownRoute && import_ts_morph7.Node.isIdentifier(filterClassArg) ? declaredClass : void 0;
|
|
3584
3584
|
for (const candidate of orderFilterCandidates({
|
|
3585
3585
|
namedByRoute,
|
|
@@ -4170,9 +4170,9 @@ function unwrapNamedContainer(node, names) {
|
|
|
4170
4170
|
}
|
|
4171
4171
|
return node;
|
|
4172
4172
|
}
|
|
4173
|
-
function extractDtoContract(method, sourceFile, project, mixin) {
|
|
4173
|
+
function extractDtoContract(method, sourceFile, project, mixin, controllerClass) {
|
|
4174
4174
|
let body = extractBodyType(method, sourceFile, project);
|
|
4175
|
-
const filterInfo = extractApplyFilterInfo(method, sourceFile, project, mixin);
|
|
4175
|
+
const filterInfo = extractApplyFilterInfo(method, sourceFile, project, mixin, controllerClass);
|
|
4176
4176
|
const query = extractQueryType(method, sourceFile, project);
|
|
4177
4177
|
const uploads = extractUploadedFiles(method);
|
|
4178
4178
|
const multipartBody = uploads.fields ? `{ ${uploads.fields} }` : null;
|
|
@@ -4716,7 +4716,7 @@ function extractDtoRoute(args) {
|
|
|
4716
4716
|
const methodName = method.getName();
|
|
4717
4717
|
const classAs = readAsDecorator(cls, `class ${className}`);
|
|
4718
4718
|
const methodAs = readAsDecorator(method, `${className}.${methodName}`);
|
|
4719
|
-
const dtoContract = extractDtoContract(method, sourceFile, project, mixin);
|
|
4719
|
+
const dtoContract = extractDtoContract(method, sourceFile, project, mixin, cls);
|
|
4720
4720
|
const mixinResponse = mixin ? resolveInstantiatedReturnType(cls, methodName) : void 0;
|
|
4721
4721
|
return buildRoute({
|
|
4722
4722
|
className,
|
|
@@ -4997,7 +4997,7 @@ async function watch(config, onChange, options = {}) {
|
|
|
4997
4997
|
}
|
|
4998
4998
|
|
|
4999
4999
|
// src/index.ts
|
|
5000
|
-
var VERSION = "0.
|
|
5000
|
+
var VERSION = "0.21.0";
|
|
5001
5001
|
|
|
5002
5002
|
// src/generate-manifest.ts
|
|
5003
5003
|
var MANIFEST_FILE = ".codegen-manifest.json";
|