nest-prisma_doc-gen 1.0.14 → 1.0.15
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.
|
@@ -9,7 +9,7 @@ export class DocGenDto {
|
|
|
9
9
|
imports = new Set([
|
|
10
10
|
`${Static.AUTO_GENERATED_COMMENT}`,
|
|
11
11
|
`import { ApiProperty, IntersectionType } from '@nestjs/swagger'`,
|
|
12
|
-
`import {
|
|
12
|
+
`import { DefaultIdDtoDG } from '../generic.dto'`,
|
|
13
13
|
]);
|
|
14
14
|
classValidators = new Set();
|
|
15
15
|
enums = new Set();
|
|
@@ -49,12 +49,12 @@ export class DocGenDto {
|
|
|
49
49
|
this.imports.add(`import { ${Array.from(this.classValidators)} } from 'src/_core/validators';`);
|
|
50
50
|
return [
|
|
51
51
|
`${Array.from(this.imports).join("\n")}`,
|
|
52
|
-
`export class ${this.name}
|
|
52
|
+
`export class ${this.name}DtoDG {
|
|
53
53
|
${sanitizedFields}
|
|
54
54
|
}`,
|
|
55
|
-
`export class ${this.name}
|
|
56
|
-
${this.name}
|
|
57
|
-
|
|
55
|
+
`export class ${this.name}WithIdDtoDG extends IntersectionType(
|
|
56
|
+
${this.name}DtoDG,
|
|
57
|
+
DefaultIdDtoDG,
|
|
58
58
|
) {}`,
|
|
59
59
|
].join("\n\n");
|
|
60
60
|
}
|
package/dist/entities/field.js
CHANGED
|
@@ -79,7 +79,7 @@ export class DocGenField {
|
|
|
79
79
|
}
|
|
80
80
|
else if (this.kind === "object") {
|
|
81
81
|
this.isResponse = true;
|
|
82
|
-
this.type = `${this.scalarType}
|
|
82
|
+
this.type = `${this.scalarType}ResDG`;
|
|
83
83
|
}
|
|
84
84
|
else if (this.kind === "scalar") {
|
|
85
85
|
this.type = Helper.prismaScalarToTs(this.scalarType);
|
package/dist/entities/generic.js
CHANGED
|
@@ -7,7 +7,7 @@ export class DocGenGeneric {
|
|
|
7
7
|
import { IsString, IsNotEmpty } from 'src/_core/validators';
|
|
8
8
|
`;
|
|
9
9
|
const validatorProps = `
|
|
10
|
-
export class
|
|
10
|
+
export class DefaultIdDtoDG {
|
|
11
11
|
@ApiProperty({ type: 'string', example: 'cmfxu4njg000008l52v7t8qze', required: true })
|
|
12
12
|
@IsString()
|
|
13
13
|
@IsNotEmpty()
|