@tsed/prisma 8.31.0 → 8.31.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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { toMap } from "@tsed/core";
|
|
3
|
-
import {
|
|
3
|
+
import { pascalCase } from "change-case";
|
|
4
4
|
import pluralize from "pluralize";
|
|
5
5
|
import { Scope } from "ts-morph";
|
|
6
6
|
import { DmmfModel } from "../domain/DmmfModel.js";
|
|
@@ -88,7 +88,7 @@ export function generateRepositories(dmmf, project, baseDirPath) {
|
|
|
88
88
|
.addGetAccessor({
|
|
89
89
|
name: "collection"
|
|
90
90
|
})
|
|
91
|
-
.setBodyText(`return this.prisma.${
|
|
91
|
+
.setBodyText(`return this.prisma.${uncapitalize(model.name)}`);
|
|
92
92
|
repository
|
|
93
93
|
.addGetAccessor({
|
|
94
94
|
name: "groupBy"
|
|
@@ -166,10 +166,13 @@ export function generateRepositories(dmmf, project, baseDirPath) {
|
|
|
166
166
|
addDelegatedMethod({
|
|
167
167
|
repository,
|
|
168
168
|
name: "aggregate",
|
|
169
|
-
model:
|
|
169
|
+
model: model.name,
|
|
170
170
|
isAsync: false
|
|
171
171
|
});
|
|
172
172
|
return name;
|
|
173
173
|
});
|
|
174
174
|
generateOutputsBarrelFile(repositoriesIndex, exportedModels);
|
|
175
175
|
}
|
|
176
|
+
function uncapitalize(str) {
|
|
177
|
+
return str.substring(0, 1).toLowerCase() + str.substring(1);
|
|
178
|
+
}
|
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.31.
|
|
5
|
+
"version": "8.31.2",
|
|
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.31.
|
|
45
|
-
"@tsed/core": "8.31.
|
|
46
|
-
"@tsed/di": "8.31.
|
|
47
|
-
"@tsed/json-mapper": "8.31.
|
|
44
|
+
"@tsed/barrels": "8.31.2",
|
|
45
|
+
"@tsed/core": "8.31.2",
|
|
46
|
+
"@tsed/di": "8.31.2",
|
|
47
|
+
"@tsed/json-mapper": "8.31.2",
|
|
48
48
|
"@tsed/monorepo-utils": "3.0.0",
|
|
49
|
-
"@tsed/schema": "8.31.
|
|
50
|
-
"@tsed/typescript": "8.31.
|
|
49
|
+
"@tsed/schema": "8.31.2",
|
|
50
|
+
"@tsed/typescript": "8.31.2",
|
|
51
51
|
"@types/change-case": "^2.3.1",
|
|
52
52
|
"@types/pluralize": "0.0.33",
|
|
53
53
|
"eslint": "9.12.0",
|