@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/cli/main.js
CHANGED
|
@@ -3717,7 +3717,7 @@ function extractFilterForHints(classDecl, project) {
|
|
|
3717
3717
|
}
|
|
3718
3718
|
return hints;
|
|
3719
3719
|
}
|
|
3720
|
-
function extractApplyFilterInfo(method, sourceFile, project, mixin) {
|
|
3720
|
+
function extractApplyFilterInfo(method, sourceFile, project, mixin, controllerClass) {
|
|
3721
3721
|
const declFile = method.getSourceFile();
|
|
3722
3722
|
const mixinEntity = resolveMixinEntityClass(mixin, project);
|
|
3723
3723
|
for (const param of method.getParameters()) {
|
|
@@ -3743,7 +3743,7 @@ function extractApplyFilterInfo(method, sourceFile, project, mixin) {
|
|
|
3743
3743
|
const filterClassName = filterClassArg.getText();
|
|
3744
3744
|
const resolved = factoryStaticClass ? void 0 : findType(filterClassName, declFile, project);
|
|
3745
3745
|
const declaredClass = factoryStaticClass ?? (resolved?.kind === "class" ? resolved.decl : resolveLocalClassDeclaration(filterClassArg));
|
|
3746
|
-
const ownRoute = !mixin || declFile.getFilePath() !== mixin.factoryFilePath;
|
|
3746
|
+
const ownRoute = !mixin || (controllerClass ? method.getParent() === controllerClass : declFile.getFilePath() !== mixin.factoryFilePath);
|
|
3747
3747
|
const namedByRoute = ownRoute && Node6.isIdentifier(filterClassArg) ? declaredClass : void 0;
|
|
3748
3748
|
for (const candidate of orderFilterCandidates({
|
|
3749
3749
|
namedByRoute,
|
|
@@ -4334,9 +4334,9 @@ function unwrapNamedContainer(node, names) {
|
|
|
4334
4334
|
}
|
|
4335
4335
|
return node;
|
|
4336
4336
|
}
|
|
4337
|
-
function extractDtoContract(method, sourceFile, project, mixin) {
|
|
4337
|
+
function extractDtoContract(method, sourceFile, project, mixin, controllerClass) {
|
|
4338
4338
|
let body = extractBodyType(method, sourceFile, project);
|
|
4339
|
-
const filterInfo = extractApplyFilterInfo(method, sourceFile, project, mixin);
|
|
4339
|
+
const filterInfo = extractApplyFilterInfo(method, sourceFile, project, mixin, controllerClass);
|
|
4340
4340
|
const query = extractQueryType(method, sourceFile, project);
|
|
4341
4341
|
const uploads = extractUploadedFiles(method);
|
|
4342
4342
|
const multipartBody = uploads.fields ? `{ ${uploads.fields} }` : null;
|
|
@@ -4899,7 +4899,7 @@ function extractDtoRoute(args) {
|
|
|
4899
4899
|
const methodName = method.getName();
|
|
4900
4900
|
const classAs = readAsDecorator(cls, `class ${className}`);
|
|
4901
4901
|
const methodAs = readAsDecorator(method, `${className}.${methodName}`);
|
|
4902
|
-
const dtoContract = extractDtoContract(method, sourceFile, project, mixin);
|
|
4902
|
+
const dtoContract = extractDtoContract(method, sourceFile, project, mixin, cls);
|
|
4903
4903
|
const mixinResponse = mixin ? resolveInstantiatedReturnType(cls, methodName) : void 0;
|
|
4904
4904
|
return buildRoute({
|
|
4905
4905
|
className,
|
|
@@ -5180,7 +5180,7 @@ async function watch(config, onChange, options = {}) {
|
|
|
5180
5180
|
}
|
|
5181
5181
|
|
|
5182
5182
|
// src/index.ts
|
|
5183
|
-
var VERSION = "0.
|
|
5183
|
+
var VERSION = "0.21.0";
|
|
5184
5184
|
|
|
5185
5185
|
// src/cli/codegen.ts
|
|
5186
5186
|
async function runCodegen(opts = {}) {
|