@pegasusheavy/nestjs-prisma-graphql 1.0.2 → 1.1.1
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/generate.js +8 -10
- package/dist/generate.js.map +1 -1
- package/dist/index.js +8 -10
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/dist/generate.js
CHANGED
|
@@ -559,7 +559,7 @@ function getPropertyType(args) {
|
|
|
559
559
|
return ["Date", "string"];
|
|
560
560
|
}
|
|
561
561
|
case "Decimal": {
|
|
562
|
-
return ["Decimal"];
|
|
562
|
+
return ["Prisma.Decimal"];
|
|
563
563
|
}
|
|
564
564
|
case "Json": {
|
|
565
565
|
return ["any"];
|
|
@@ -728,8 +728,8 @@ function inputType(args) {
|
|
|
728
728
|
classStructure.properties.push(property);
|
|
729
729
|
if (propertySettings) {
|
|
730
730
|
importDeclarations.create({ ...propertySettings });
|
|
731
|
-
} else if (propertyType.includes("Decimal")) {
|
|
732
|
-
importDeclarations.add("
|
|
731
|
+
} else if (propertyType.some((p) => p.includes("Prisma.Decimal"))) {
|
|
732
|
+
importDeclarations.add("Prisma", config.prismaClientImport);
|
|
733
733
|
} else if (propertyType.some((p) => p.startsWith("Prisma."))) {
|
|
734
734
|
importDeclarations.add("Prisma", config.prismaClientImport);
|
|
735
735
|
}
|
|
@@ -1389,8 +1389,8 @@ function modelOutputType(outputType2, args) {
|
|
|
1389
1389
|
classStructure.properties?.push(property);
|
|
1390
1390
|
if (propertySettings) {
|
|
1391
1391
|
importDeclarations.create({ ...propertySettings });
|
|
1392
|
-
} else if (propertyType.includes("Decimal")) {
|
|
1393
|
-
importDeclarations.add("
|
|
1392
|
+
} else if (propertyType.some((p) => p.includes("Prisma.Decimal"))) {
|
|
1393
|
+
importDeclarations.add("Prisma", config.prismaClientImport);
|
|
1394
1394
|
}
|
|
1395
1395
|
ok(property.decorators, "property.decorators is undefined");
|
|
1396
1396
|
const shouldHideField = settings?.shouldHideField({ name: outputType2.name, output: true }) || config.decorate.some(
|
|
@@ -1590,8 +1590,8 @@ function outputType(outputTypeArg, args) {
|
|
|
1590
1590
|
classStructure.properties?.push(property);
|
|
1591
1591
|
if (propertySettings) {
|
|
1592
1592
|
importDeclarations.create({ ...propertySettings });
|
|
1593
|
-
} else if (propertyType.includes("Decimal")) {
|
|
1594
|
-
importDeclarations.add("
|
|
1593
|
+
} else if (propertyType.some((p) => p.includes("Prisma.Decimal"))) {
|
|
1594
|
+
importDeclarations.add("Prisma", config.prismaClientImport);
|
|
1595
1595
|
}
|
|
1596
1596
|
let graphqlType;
|
|
1597
1597
|
const shouldHideField = settings?.shouldHideField({
|
|
@@ -2124,9 +2124,7 @@ function createConfig(data) {
|
|
|
2124
2124
|
const configOutputFilePattern = String(
|
|
2125
2125
|
config.outputFilePattern || `{model}/{name}.{type}.ts`
|
|
2126
2126
|
);
|
|
2127
|
-
let outputFilePattern = filenamify(
|
|
2128
|
-
replacement: "/"
|
|
2129
|
-
}).replaceAll("..", "/").replaceAll(/\/+/g, "/");
|
|
2127
|
+
let outputFilePattern = configOutputFilePattern.split("/").map((segment) => filenamify(segment, { replacement: "-" })).join("/").replaceAll("..", "/").replaceAll(/\/+/g, "/");
|
|
2130
2128
|
outputFilePattern = trim(outputFilePattern, "/");
|
|
2131
2129
|
if (outputFilePattern !== configOutputFilePattern) {
|
|
2132
2130
|
$warnings.push(
|