refactor: replace @prisma/client/runtime imports with public API (#23087)
- Replace PrismaClientKnownRequestError and other error classes with Prisma namespace equivalents - Remove internal DefaultArgs and InternalArgs type imports from Prisma extensions - Ensure all error handling uses stable public API exports - Maintain compatibility with future Prisma versions by avoiding runtime dependencies Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Keith Williams <[email protected]>
This commit is contained in:
6 files changed
+29
-38
No files matched your search
@@ -1,5 +1,4 @@
|
||||
import { Prisma } from "@prisma/client";
|
||||
import type { DefaultArgs, InternalArgs } from "@prisma/client/runtime/library";
|
||||
|
||||
export function excludeLockedUsersExtension() {
|
||||
return Prisma.defineExtension({
|
||||
@@ -35,11 +34,11 @@ function safeJSONStringify(x: any) {
|
||||
|
||||
async function excludeLockedUsers(
|
||||
args:
|
||||
| Prisma.UserFindUniqueArgs<InternalArgs & DefaultArgs>
|
||||
| Prisma.UserFindFirstArgs<InternalArgs & DefaultArgs>
|
||||
| Prisma.UserFindManyArgs<InternalArgs & DefaultArgs>
|
||||
| Prisma.UserFindUniqueOrThrowArgs<InternalArgs & DefaultArgs>
|
||||
| Prisma.UserFindFirstOrThrowArgs<InternalArgs & DefaultArgs>,
|
||||
| Prisma.UserFindUniqueArgs
|
||||
| Prisma.UserFindFirstArgs
|
||||
| Prisma.UserFindManyArgs
|
||||
| Prisma.UserFindUniqueOrThrowArgs
|
||||
| Prisma.UserFindFirstOrThrowArgs,
|
||||
query: <T>(args: T) => Promise<unknown>
|
||||
) {
|
||||
args.where = args.where || {};
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Prisma } from "@prisma/client";
|
||||
import type { DefaultArgs, InternalArgs } from "@prisma/client/runtime/library";
|
||||
|
||||
export function excludePendingPaymentsExtension() {
|
||||
return Prisma.defineExtension({
|
||||
@@ -27,11 +26,11 @@ export function excludePendingPaymentsExtension() {
|
||||
|
||||
async function excludePendingPayments(
|
||||
args:
|
||||
| Prisma.TeamFindUniqueArgs<InternalArgs & DefaultArgs>
|
||||
| Prisma.TeamFindFirstArgs<InternalArgs & DefaultArgs>
|
||||
| Prisma.TeamFindManyArgs<InternalArgs & DefaultArgs>
|
||||
| Prisma.TeamFindUniqueOrThrowArgs<InternalArgs & DefaultArgs>
|
||||
| Prisma.TeamFindFirstOrThrowArgs<InternalArgs & DefaultArgs>,
|
||||
| Prisma.TeamFindUniqueArgs
|
||||
| Prisma.TeamFindFirstArgs
|
||||
| Prisma.TeamFindManyArgs
|
||||
| Prisma.TeamFindUniqueOrThrowArgs
|
||||
| Prisma.TeamFindFirstOrThrowArgs,
|
||||
query: <T>(args: T) => Promise<unknown>
|
||||
) {
|
||||
args.where = args.where || {};
|
||||
|
||||
Reference in new issue
Block a user