@tsed/prisma 8.28.2 → 8.28.5
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.
|
@@ -15,7 +15,7 @@ export const ScalarTsTypes = {
|
|
|
15
15
|
[PrismaScalars.Boolean]: "boolean",
|
|
16
16
|
[PrismaScalars.Int]: "number",
|
|
17
17
|
[PrismaScalars.Float]: "number",
|
|
18
|
-
[PrismaScalars.Decimal]: "
|
|
18
|
+
[PrismaScalars.Decimal]: "Prisma.Decimal",
|
|
19
19
|
[PrismaScalars.BigInt]: "bigint",
|
|
20
20
|
[PrismaScalars.DateTime]: "Date",
|
|
21
21
|
[PrismaScalars.Json]: "any",
|
|
@@ -26,7 +26,7 @@ export const ScalarJsClasses = {
|
|
|
26
26
|
[PrismaScalars.Boolean]: "Boolean",
|
|
27
27
|
[PrismaScalars.Int]: "Number",
|
|
28
28
|
[PrismaScalars.Float]: "Number",
|
|
29
|
-
[PrismaScalars.Decimal]: "
|
|
29
|
+
[PrismaScalars.Decimal]: "Prisma.Decimal",
|
|
30
30
|
[PrismaScalars.BigInt]: "BigInt",
|
|
31
31
|
[PrismaScalars.DateTime]: "Date",
|
|
32
32
|
[PrismaScalars.Json]: "Object",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DmmfEnum } from "../domain/DmmfEnum.js";
|
|
2
2
|
import { DmmfModel } from "../domain/DmmfModel.js";
|
|
3
|
-
import { ScalarTsTypes } from "../domain/ScalarTsTypes.js";
|
|
3
|
+
import { PrismaScalars, ScalarTsTypes } from "../domain/ScalarTsTypes.js";
|
|
4
4
|
import { isCircularRef } from "../utils/isCircularRef.js";
|
|
5
5
|
export function transformScalarToType(field, ctx) {
|
|
6
6
|
const { isRequired, isNullable, type, isList, location, model } = field;
|
|
@@ -9,6 +9,10 @@ export function transformScalarToType(field, ctx) {
|
|
|
9
9
|
switch (location) {
|
|
10
10
|
case "scalar":
|
|
11
11
|
TSType = ScalarTsTypes[field.type];
|
|
12
|
+
// Import Prisma namespace when Decimal is used
|
|
13
|
+
if (field.type === PrismaScalars.Decimal) {
|
|
14
|
+
field.model.addImportDeclaration("@prisma/client", "Prisma");
|
|
15
|
+
}
|
|
12
16
|
break;
|
|
13
17
|
case "enumTypes":
|
|
14
18
|
TSType = DmmfEnum.symbolName(type);
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@tsed/prisma",
|
|
3
3
|
"description": "Generate Ts.ED JsonSchema based on Prisma models",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "8.28.
|
|
5
|
+
"version": "8.28.5",
|
|
6
6
|
"source": "./src/index.ts",
|
|
7
7
|
"main": "./lib/esm/index.js",
|
|
8
8
|
"module": "./lib/esm/index.js",
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@prisma/client": "^7.3.0",
|
|
44
|
-
"@tsed/barrels": "8.28.
|
|
45
|
-
"@tsed/core": "8.28.
|
|
46
|
-
"@tsed/di": "8.28.
|
|
47
|
-
"@tsed/json-mapper": "8.28.
|
|
44
|
+
"@tsed/barrels": "8.28.5",
|
|
45
|
+
"@tsed/core": "8.28.5",
|
|
46
|
+
"@tsed/di": "8.28.5",
|
|
47
|
+
"@tsed/json-mapper": "8.28.5",
|
|
48
48
|
"@tsed/monorepo-utils": "3.0.0",
|
|
49
|
-
"@tsed/schema": "8.28.
|
|
50
|
-
"@tsed/typescript": "8.28.
|
|
49
|
+
"@tsed/schema": "8.28.5",
|
|
50
|
+
"@tsed/typescript": "8.28.5",
|
|
51
51
|
"@types/change-case": "^2.3.1",
|
|
52
52
|
"@types/pluralize": "0.0.33",
|
|
53
53
|
"eslint": "9.12.0",
|