@tsed/prisma 8.0.0-beta.9 → 8.0.0-rc.2
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.
|
@@ -24,6 +24,10 @@ export function transformScalarToType(field, ctx) {
|
|
|
24
24
|
if (isList) {
|
|
25
25
|
TSType += "[]";
|
|
26
26
|
}
|
|
27
|
+
if (!isList && hasCircularRef && ["inputObjectTypes", "enumTypes"].includes(location)) {
|
|
28
|
+
hasCircularRef && !isList && field.model.addImportDeclaration("@tsed/core", "Relation", true);
|
|
29
|
+
TSType = `Relation<${TSType}>`;
|
|
30
|
+
}
|
|
27
31
|
if (!isRequired) {
|
|
28
32
|
if (model.isInputType) {
|
|
29
33
|
TSType += " | undefined";
|
|
@@ -35,10 +39,6 @@ export function transformScalarToType(field, ctx) {
|
|
|
35
39
|
else if (isNullable && !isList) {
|
|
36
40
|
TSType += " | null";
|
|
37
41
|
}
|
|
38
|
-
if (isRequired && !isList && !isNullable && hasCircularRef && ["inputObjectTypes", "enumTypes"].includes(location)) {
|
|
39
|
-
hasCircularRef && !isList && field.model.addImportDeclaration("@tsed/core", "Relation", true);
|
|
40
|
-
TSType = `Relation<${TSType}>`;
|
|
41
|
-
}
|
|
42
42
|
return TSType;
|
|
43
43
|
}
|
|
44
44
|
//# sourceMappingURL=transformScalarToType.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformScalarToType.js","sourceRoot":"","sources":["../../../../src/generator/transform/transformScalarToType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAE/C,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAC,aAAa,EAAC,MAAM,2BAA2B,CAAC;AAExD,MAAM,UAAU,qBAAqB,CAAC,KAAgB,EAAE,GAAqB;IAC3E,MAAM,EAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAC,GAAG,KAAK,CAAC;IACtE,IAAI,MAAM,GAAW,IAAI,CAAC;IAC1B,MAAM,cAAc,GAAG,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAExE,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,QAAQ;YACX,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACnC,MAAM;QACR,KAAK,WAAW;YACd,MAAM,GAAG,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YACnC,KAAK,CAAC,KAAK,CAAC,oBAAoB,CAAC,gBAAgB,EAAE,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;YACpF,MAAM;QACR,KAAK,kBAAkB;YACrB,MAAM,GAAG,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YAEpC,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC;gBACpC,KAAK,CAAC,KAAK,CAAC,oBAAoB,CAAC,KAAK,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;YAC9G,CAAC;YACD,MAAM;IACV,CAAC;IAED,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,IAAI,IAAI,CAAC;IACjB,CAAC;IAED,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"transformScalarToType.js","sourceRoot":"","sources":["../../../../src/generator/transform/transformScalarToType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAE/C,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;AACj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AkB,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACtF,cAAc,IAAI,CAAC,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,oBAAoB,CAAC,YAAY,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;QAC9F,MAAM,GAAG,YAAY,MAAM,GAAG,CAAC;IACjC,CAAC;IAED,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;YACtB,MAAM,IAAI,cAAc,CAAC;QAC3B,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,SAAS,CAAC;QACtB,CAAC;IACH,CAAC;SAAM,IAAI,UAAU,IAAI,CAAC,MAAM,EAAE,CAAC;QACjC,MAAM,IAAI,SAAS,CAAC;IACtB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
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.0.0-
|
|
5
|
+
"version": "8.0.0-rc.2",
|
|
6
6
|
"source": "./src/index.ts",
|
|
7
7
|
"main": "./lib/esm/index.js",
|
|
8
8
|
"module": "./lib/esm/index.js",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"test": "vitest run",
|
|
26
26
|
"generate:postgres:esm": "yarn build && cd test/postgres-esm && prisma -v && prisma generate",
|
|
27
27
|
"generate:mongo:esm": "yarn build && cd test/mongo-esm && prisma -v && prisma generate",
|
|
28
|
+
"generate:circular:esm": "yarn build && cd test/circular-ref && prisma -v && prisma generate",
|
|
28
29
|
"test:ci": "vitest run --coverage.thresholds.autoUpdate=true"
|
|
29
30
|
},
|
|
30
31
|
"dependencies": {
|
|
@@ -38,13 +39,13 @@
|
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
40
41
|
"@prisma/client": "^5.20.0",
|
|
41
|
-
"@tsed/barrels": "8.0.0-
|
|
42
|
-
"@tsed/core": "8.0.0-
|
|
43
|
-
"@tsed/di": "8.0.0-
|
|
44
|
-
"@tsed/json-mapper": "8.0.0-
|
|
42
|
+
"@tsed/barrels": "8.0.0-rc.2",
|
|
43
|
+
"@tsed/core": "8.0.0-rc.2",
|
|
44
|
+
"@tsed/di": "8.0.0-rc.2",
|
|
45
|
+
"@tsed/json-mapper": "8.0.0-rc.2",
|
|
45
46
|
"@tsed/monorepo-utils": "2.3.9",
|
|
46
|
-
"@tsed/schema": "8.0.0-
|
|
47
|
-
"@tsed/typescript": "8.0.0-
|
|
47
|
+
"@tsed/schema": "8.0.0-rc.2",
|
|
48
|
+
"@tsed/typescript": "8.0.0-rc.2",
|
|
48
49
|
"@types/change-case": "^2.3.1",
|
|
49
50
|
"@types/pluralize": "0.0.33",
|
|
50
51
|
"eslint": "9.12.0",
|
|
@@ -54,10 +55,10 @@
|
|
|
54
55
|
},
|
|
55
56
|
"peerDependencies": {
|
|
56
57
|
"@prisma/client": ">=5.0.0",
|
|
57
|
-
"@tsed/core": "8.0.0-
|
|
58
|
-
"@tsed/di": "8.0.0-
|
|
59
|
-
"@tsed/json-mapper": "8.0.0-
|
|
60
|
-
"@tsed/schema": "8.0.0-
|
|
58
|
+
"@tsed/core": "8.0.0-rc.2",
|
|
59
|
+
"@tsed/di": "8.0.0-rc.2",
|
|
60
|
+
"@tsed/json-mapper": "8.0.0-rc.2",
|
|
61
|
+
"@tsed/schema": "8.0.0-rc.2"
|
|
61
62
|
},
|
|
62
63
|
"keywords": [
|
|
63
64
|
"TypeScript",
|
|
@@ -78,6 +79,6 @@
|
|
|
78
79
|
"author": "Romain Lenzotti",
|
|
79
80
|
"license": "MIT",
|
|
80
81
|
"publishConfig": {
|
|
81
|
-
"tag": "
|
|
82
|
+
"tag": "rc"
|
|
82
83
|
}
|
|
83
84
|
}
|