Skip to content

Commit 620432b

Browse files
committed
fix(prisma): Update @prisma/client to version 5.22.0 and refactor ModelAction enum in utils.ts
1 parent 844972a commit 620432b

4 files changed

Lines changed: 44 additions & 57 deletions

File tree

package-lock.json

Lines changed: 17 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk_contrib/prisma/package-lock.json

Lines changed: 4 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk_contrib/prisma/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
"aws-xray-sdk-core": "^3.5.0"
2525
},
2626
"scripts": {
27+
"prepare": "npm run compile",
28+
"compile": "tsc",
2729
"test": "mocha --recursive ./test/ -R spec && tsd",
2830
"test-d": "tsd",
2931
"lint": "eslint .",
@@ -44,7 +46,7 @@
4446
"access": "public"
4547
},
4648
"devDependencies": {
47-
"@prisma/client": "^5.4.2",
49+
"@prisma/client": "^5.22.0",
4850
"eslint-plugin-promise": "^6.1.1"
4951
}
5052
}

sdk_contrib/prisma/src/utils.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,25 @@
1-
import { DMMF } from '@prisma/client/runtime/binary';
21
import { PrismaPromise } from './types';
32

4-
const { ModelAction } = DMMF;
3+
enum ModelAction {
4+
findUnique = 'findUnique',
5+
findUniqueOrThrow = 'findUniqueOrThrow',
6+
findFirst = 'findFirst',
7+
findFirstOrThrow = 'findFirstOrThrow',
8+
findMany = 'findMany',
9+
create = 'create',
10+
createMany = 'createMany',
11+
createManyAndReturn = 'createManyAndReturn',
12+
update = 'update',
13+
updateMany = 'updateMany',
14+
upsert = 'upsert',
15+
delete = 'delete',
16+
deleteMany = 'deleteMany',
17+
groupBy = 'groupBy',
18+
count = 'count', // TODO: count does not actually exist, why?
19+
aggregate = 'aggregate',
20+
findRaw = 'findRaw',
21+
aggregateRaw = 'aggregateRaw',
22+
}
523

624
export const isAction = (action: any): action is keyof typeof ModelAction =>
725
!!ModelAction[action as keyof typeof ModelAction];

0 commit comments

Comments
 (0)