Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug?]: Prisma Migrate isn't properly migrating enums #7890

Closed
1 task
codewriter3000 opened this issue Mar 23, 2023 · 6 comments
Closed
1 task

[Bug?]: Prisma Migrate isn't properly migrating enums #7890

codewriter3000 opened this issue Mar 23, 2023 · 6 comments
Labels
bug/needs-info More information is needed for reproduction

Comments

@codewriter3000
Copy link

What's not working?

I have an enum in my schema but it's not being recognized when I try to import it. Inside of /api/src/services/sportOptions/sportOptions.ts when I use this line:

import { Sport } from '@prisma/client'

I get the error: Module '"@prisma/client"' has no exported member 'Sport'.

How do we reproduce the bug?

  1. Make a type in schema.prisma with an enum (this is the one I made):
enum Sport {
  BASEBALL
  BASKETBALL
  DODGEBALL
  FOOTBALL
  LACROSSE
  SOFTBALL
}
  1. Run yarn rw prisma migrate dev
  2. Try to import Sport and you'll get an error.

What's your environment? (If it applies)

System:
    OS: Windows 10 10.0.19044
  Binaries:
    Node: 16.19.0 - ~\AppData\Local\Temp\xfs-880a4f99\node.CMD
    Yarn: 3.4.1 - ~\AppData\Local\Temp\xfs-880a4f99\yarn.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (111.0.1661.51)
  npmPackages:
    @redwoodjs/auth-dbauth-setup: 4.3.1 => 4.3.1
    @redwoodjs/core: 4.3.1 => 4.3.1
  Database:
    PostgreSQL 15.2 (remote server on local intranet)

Are you interested in working on this?

  • I'm interested in working on this
@codewriter3000 codewriter3000 added the bug/needs-info More information is needed for reproduction label Mar 23, 2023
@codewriter3000
Copy link
Author

codewriter3000 commented Mar 23, 2023

This is my graphql.d.ts file:

``` import { Prisma } from '@prisma/client' import { User as PrismaUser, UserCredential as PrismaUserCredential, League as PrismaLeague, } from '@prisma/client' import { GraphQLResolveInfo, GraphQLScalarType, GraphQLScalarTypeConfig, } from 'graphql'

import { MergePrismaWithSdlTypes, MakeRelationsOptional } from '@redwoodjs/api'
import { RedwoodGraphQLContext } from '@redwoodjs/graphql-server/dist/functions/types'
export type Maybe = T | null
export type InputMaybe = Maybe
export type Exact<T extends { [key: string]: unknown }> = {
[K in keyof T]: T[K]
}
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
[SubKey in K]?: Maybe<T[SubKey]>
}
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {
[SubKey in K]: Maybe<T[SubKey]>
}
export type ResolverFn<TResult, TParent, TContext, TArgs> = (
args?: TArgs,
obj?: { root: TParent; context: TContext; info: GraphQLResolveInfo }
) => TResult | Promise
export type RequireFields<T, K extends keyof T> = Omit<T, K> & {
[P in K]-?: NonNullable<T[P]>
}
export type OptArgsResolverFn<
TResult,
TParent = {},
TContext = {},
TArgs = {}

= (
args?: TArgs,
obj?: { root: TParent; context: TContext; info: GraphQLResolveInfo }
) => TResult | Promise

export type RequiredResolverFn<
TResult,
TParent = {},
TContext = {},
TArgs = {}

= (
args: TArgs,
obj: { root: TParent; context: TContext; info: GraphQLResolveInfo }
) => TResult | Promise
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string
String: string
Boolean: boolean
Int: number
Float: number
BigInt: number
Date: Date | string
DateTime: Date | string
JSON: Prisma.JsonValue
JSONObject: Prisma.JsonObject
Time: Date | string
}

export type CreateLeagueInput = {
description: Scalars['String']
name: Scalars['String']
sport: Scalars['Int']
}

export type League = {
__typename?: 'League'
description: Scalars['String']
id: Scalars['Int']
name: Scalars['String']
sport: Scalars['Int']
}

export type Mutation = {
__typename?: 'Mutation'
createLeague: League
deleteLeague: League
updateLeague: League
}

export type MutationcreateLeagueArgs = {
input: CreateLeagueInput
}

export type MutationdeleteLeagueArgs = {
id: Scalars['Int']
}

export type MutationupdateLeagueArgs = {
id: Scalars['Int']
input: UpdateLeagueInput
}

/** About the Redwood queries. /
export type Query = {
__typename?: 'Query'
league?: Maybe
leagues: Array
/
* Fetches the Redwood root schema. */
redwood?: Maybe
}

/** About the Redwood queries. */
export type QueryleagueArgs = {
id: Scalars['Int']
}

/**

  • The RedwoodJS Root Schema
  • Defines details about RedwoodJS such as the current user and version information.
    /
    export type Redwood = {
    __typename?: 'Redwood'
    /
    * The current user. /
    currentUser?: Maybe<Scalars['JSON']>
    /
    * The version of Prisma. /
    prismaVersion?: Maybe<Scalars['String']>
    /
    * The version of Redwood. */
    version?: Maybe<Scalars['String']>
    }

export type UpdateLeagueInput = {
description?: InputMaybe<Scalars['String']>
name?: InputMaybe<Scalars['String']>
sport?: InputMaybe<Scalars['Int']>
}

type MaybeOrArrayOfMaybe = T | Maybe | Maybe[]
type AllMappedModels = MaybeOrArrayOfMaybe

export type ResolverTypeWrapper = Promise | T

export type Resolver<
TResult,
TParent = {},
TContext = {},
TArgs = {}

= ResolverFn<TResult, TParent, TContext, TArgs>

export type SubscriptionSubscribeFn<TResult, TParent, TContext, TArgs> = (
parent: TParent,
args: TArgs,
context: TContext,
info: GraphQLResolveInfo
) => AsyncIterable | Promise<AsyncIterable>

export type SubscriptionResolveFn<TResult, TParent, TContext, TArgs> = (
parent: TParent,
args: TArgs,
context: TContext,
info: GraphQLResolveInfo
) => TResult | Promise

export interface SubscriptionSubscriberObject<
TResult,
TKey extends string,
TParent,
TContext,
TArgs

{
subscribe: SubscriptionSubscribeFn<
{ [key in TKey]: TResult },
TParent,
TContext,
TArgs

resolve?: SubscriptionResolveFn<
TResult,
{ [key in TKey]: TResult },
TContext,
TArgs

}

export interface SubscriptionResolverObject<TResult, TParent, TContext, TArgs> {
subscribe: SubscriptionSubscribeFn<any, TParent, TContext, TArgs>
resolve: SubscriptionResolveFn<TResult, any, TContext, TArgs>
}

export type SubscriptionObject<
TResult,
TKey extends string,
TParent,
TContext,
TArgs

=
| SubscriptionSubscriberObject<TResult, TKey, TParent, TContext, TArgs>
| SubscriptionResolverObject<TResult, TParent, TContext, TArgs>

export type SubscriptionResolver<
TResult,
TKey extends string,
TParent = {},
TContext = {},
TArgs = {}

=
| ((
...args: any[]
) => SubscriptionObject<TResult, TKey, TParent, TContext, TArgs>)
| SubscriptionObject<TResult, TKey, TParent, TContext, TArgs>

export type TypeResolveFn<TTypes, TParent = {}, TContext = {}> = (
parent: TParent,
context: TContext,
info: GraphQLResolveInfo
) => Maybe | Promise<Maybe>

export type IsTypeOfResolverFn<T = {}, TContext = {}> = (
obj: T,
context: TContext,
info: GraphQLResolveInfo
) => boolean | Promise

export type NextResolverFn = () => Promise

export type DirectiveResolverFn<
TResult = {},
TParent = {},
TContext = {},
TArgs = {}

= (
next: NextResolverFn,
parent: TParent,
args: TArgs,
context: TContext,
info: GraphQLResolveInfo
) => TResult | Promise

/** Mapping between all available schema types and the resolvers types */
export type ResolversTypes = {
BigInt: ResolverTypeWrapper<Scalars['BigInt']>
Boolean: ResolverTypeWrapper<Scalars['Boolean']>
CreateLeagueInput: CreateLeagueInput
Date: ResolverTypeWrapper<Scalars['Date']>
DateTime: ResolverTypeWrapper<Scalars['DateTime']>
Int: ResolverTypeWrapper<Scalars['Int']>
JSON: ResolverTypeWrapper<Scalars['JSON']>
JSONObject: ResolverTypeWrapper<Scalars['JSONObject']>
League: ResolverTypeWrapper<
MergePrismaWithSdlTypes<
PrismaLeague,
MakeRelationsOptional<League, AllMappedModels>,
AllMappedModels
>

Mutation: ResolverTypeWrapper<{}>
Query: ResolverTypeWrapper<{}>
Redwood: ResolverTypeWrapper
String: ResolverTypeWrapper<Scalars['String']>
Time: ResolverTypeWrapper<Scalars['Time']>
UpdateLeagueInput: UpdateLeagueInput
}

/** Mapping between all available schema types and the resolvers parents */
export type ResolversParentTypes = {
BigInt: Scalars['BigInt']
Boolean: Scalars['Boolean']
CreateLeagueInput: CreateLeagueInput
Date: Scalars['Date']
DateTime: Scalars['DateTime']
Int: Scalars['Int']
JSON: Scalars['JSON']
JSONObject: Scalars['JSONObject']
League: MergePrismaWithSdlTypes<
PrismaLeague,
MakeRelationsOptional<League, AllMappedModels>,
AllMappedModels

Mutation: {}
Query: {}
Redwood: Redwood
String: Scalars['String']
Time: Scalars['Time']
UpdateLeagueInput: UpdateLeagueInput
}

export type requireAuthDirectiveArgs = {
roles?: Maybe<Array<Maybe<Scalars['String']>>>
}

export type requireAuthDirectiveResolver<
Result,
Parent,
ContextType = RedwoodGraphQLContext,
Args = requireAuthDirectiveArgs

= DirectiveResolverFn<Result, Parent, ContextType, Args>

export type skipAuthDirectiveArgs = {}

export type skipAuthDirectiveResolver<
Result,
Parent,
ContextType = RedwoodGraphQLContext,
Args = skipAuthDirectiveArgs

= DirectiveResolverFn<Result, Parent, ContextType, Args>

export interface BigIntScalarConfig
extends GraphQLScalarTypeConfig<ResolversTypes['BigInt'], any> {
name: 'BigInt'
}

export interface DateScalarConfig
extends GraphQLScalarTypeConfig<ResolversTypes['Date'], any> {
name: 'Date'
}

export interface DateTimeScalarConfig
extends GraphQLScalarTypeConfig<ResolversTypes['DateTime'], any> {
name: 'DateTime'
}

export interface JSONScalarConfig
extends GraphQLScalarTypeConfig<ResolversTypes['JSON'], any> {
name: 'JSON'
}

export interface JSONObjectScalarConfig
extends GraphQLScalarTypeConfig<ResolversTypes['JSONObject'], any> {
name: 'JSONObject'
}

export type LeagueResolvers<
ContextType = RedwoodGraphQLContext,
ParentType extends ResolversParentTypes['League'] = ResolversParentTypes['League']

= {
description: OptArgsResolverFn<
ResolversTypes['String'],
ParentType,
ContextType

id: OptArgsResolverFn<ResolversTypes['Int'], ParentType, ContextType>
name: OptArgsResolverFn<ResolversTypes['String'], ParentType, ContextType>
sport: OptArgsResolverFn<ResolversTypes['Int'], ParentType, ContextType>
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>
}

export type LeagueRelationResolvers<
ContextType = RedwoodGraphQLContext,
ParentType extends ResolversParentTypes['League'] = ResolversParentTypes['League']

= {
description?: RequiredResolverFn<
ResolversTypes['String'],
ParentType,
ContextType

id?: RequiredResolverFn<ResolversTypes['Int'], ParentType, ContextType>
name?: RequiredResolverFn<ResolversTypes['String'], ParentType, ContextType>
sport?: RequiredResolverFn<ResolversTypes['Int'], ParentType, ContextType>
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>
}

export type MutationResolvers<
ContextType = RedwoodGraphQLContext,
ParentType extends ResolversParentTypes['Mutation'] = ResolversParentTypes['Mutation']

= {
createLeague: Resolver<
ResolversTypes['League'],
ParentType,
ContextType,
RequireFields<MutationcreateLeagueArgs, 'input'>

deleteLeague: Resolver<
ResolversTypes['League'],
ParentType,
ContextType,
RequireFields<MutationdeleteLeagueArgs, 'id'>

updateLeague: Resolver<
ResolversTypes['League'],
ParentType,
ContextType,
RequireFields<MutationupdateLeagueArgs, 'id' | 'input'>

}

export type MutationRelationResolvers<
ContextType = RedwoodGraphQLContext,
ParentType extends ResolversParentTypes['Mutation'] = ResolversParentTypes['Mutation']

= {
createLeague?: RequiredResolverFn<
ResolversTypes['League'],
ParentType,
ContextType,
RequireFields<MutationcreateLeagueArgs, 'input'>

deleteLeague?: RequiredResolverFn<
ResolversTypes['League'],
ParentType,
ContextType,
RequireFields<MutationdeleteLeagueArgs, 'id'>

updateLeague?: RequiredResolverFn<
ResolversTypes['League'],
ParentType,
ContextType,
RequireFields<MutationupdateLeagueArgs, 'id' | 'input'>

}

export type QueryResolvers<
ContextType = RedwoodGraphQLContext,
ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query']

= {
league: Resolver<
Maybe<ResolversTypes['League']>,
ParentType,
ContextType,
RequireFields<QueryleagueArgs, 'id'>

leagues: OptArgsResolverFn<
Array<ResolversTypes['League']>,
ParentType,
ContextType

redwood: OptArgsResolverFn<
Maybe<ResolversTypes['Redwood']>,
ParentType,
ContextType

}

export type QueryRelationResolvers<
ContextType = RedwoodGraphQLContext,
ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query']

= {
league?: RequiredResolverFn<
Maybe<ResolversTypes['League']>,
ParentType,
ContextType,
RequireFields<QueryleagueArgs, 'id'>

leagues?: RequiredResolverFn<
Array<ResolversTypes['League']>,
ParentType,
ContextType

redwood?: RequiredResolverFn<
Maybe<ResolversTypes['Redwood']>,
ParentType,
ContextType

}

export type RedwoodResolvers<
ContextType = RedwoodGraphQLContext,
ParentType extends ResolversParentTypes['Redwood'] = ResolversParentTypes['Redwood']

= {
currentUser: OptArgsResolverFn<
Maybe<ResolversTypes['JSON']>,
ParentType,
ContextType

prismaVersion: OptArgsResolverFn<
Maybe<ResolversTypes['String']>,
ParentType,
ContextType

version: OptArgsResolverFn<
Maybe<ResolversTypes['String']>,
ParentType,
ContextType

__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>
}

export type RedwoodRelationResolvers<
ContextType = RedwoodGraphQLContext,
ParentType extends ResolversParentTypes['Redwood'] = ResolversParentTypes['Redwood']

= {
currentUser?: RequiredResolverFn<
Maybe<ResolversTypes['JSON']>,
ParentType,
ContextType

prismaVersion?: RequiredResolverFn<
Maybe<ResolversTypes['String']>,
ParentType,
ContextType

version?: RequiredResolverFn<
Maybe<ResolversTypes['String']>,
ParentType,
ContextType

__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>
}

export interface TimeScalarConfig
extends GraphQLScalarTypeConfig<ResolversTypes['Time'], any> {
name: 'Time'
}

export type Resolvers<ContextType = RedwoodGraphQLContext> = {
BigInt: GraphQLScalarType
Date: GraphQLScalarType
DateTime: GraphQLScalarType
JSON: GraphQLScalarType
JSONObject: GraphQLScalarType
League: LeagueResolvers
Mutation: MutationResolvers
Query: QueryResolvers
Redwood: RedwoodResolvers
Time: GraphQLScalarType
}

export type DirectiveResolvers<ContextType = RedwoodGraphQLContext> = {
requireAuth: requireAuthDirectiveResolver<any, any, ContextType>
skipAuth: skipAuthDirectiveResolver<any, any, ContextType>
}

</details>

@codewriter3000
Copy link
Author

codewriter3000 commented Mar 23, 2023

Here is my node_modules/.prisma/client/index.js file:

```js

Object.defineProperty(exports, "__esModule", { value: true });

const {
PrismaClientKnownRequestError,
PrismaClientUnknownRequestError,
PrismaClientRustPanicError,
PrismaClientInitializationError,
PrismaClientValidationError,
NotFoundError,
decompressFromBase64,
getPrismaClient,
sqltag,
empty,
join,
raw,
Decimal,
Debug,
objectEnumValues,
makeStrictEnum,
Extensions,
findSync
} = require('@prisma/client/runtime/library')

const Prisma = {}

exports.Prisma = Prisma

/**

  • Prisma Client JS version: 4.11.0
  • Query Engine version: 8fde8fef4033376662cad983758335009d522acb
    */
    Prisma.prismaVersion = {
    client: "4.11.0",
    engine: "8fde8fef4033376662cad983758335009d522acb"
    }

Prisma.PrismaClientKnownRequestError = PrismaClientKnownRequestError;
Prisma.PrismaClientUnknownRequestError = PrismaClientUnknownRequestError
Prisma.PrismaClientRustPanicError = PrismaClientRustPanicError
Prisma.PrismaClientInitializationError = PrismaClientInitializationError
Prisma.PrismaClientValidationError = PrismaClientValidationError
Prisma.NotFoundError = NotFoundError
Prisma.Decimal = Decimal

/**

  • Re-export of sql-template-tag
    */
    Prisma.sql = sqltag
    Prisma.empty = empty
    Prisma.join = join
    Prisma.raw = raw
    Prisma.validator = () => (val) => val

/**

  • Shorthand utilities for JSON filtering
    */
    Prisma.DbNull = objectEnumValues.instances.DbNull
    Prisma.JsonNull = objectEnumValues.instances.JsonNull
    Prisma.AnyNull = objectEnumValues.instances.AnyNull

Prisma.NullTypes = {
DbNull: objectEnumValues.classes.DbNull,
JsonNull: objectEnumValues.classes.JsonNull,
AnyNull: objectEnumValues.classes.AnyNull
}

const path = require('path')

const fs = require('fs')

// some frameworks or bundlers replace or totally remove __dirname
const hasDirname = typeof __dirname !== 'undefined' && __dirname !== '/'

// will work in most cases, ie. if the client has not been bundled
const regularDirname = hasDirname && fs.existsSync(path.join(__dirname, 'schema.prisma')) && __dirname

// if the client has been bundled, we need to look for the folders
const foundDirname = !regularDirname && findSync(process.cwd(), [
"node_modules\.prisma\client",
".prisma\client",
], ['d'], ['d'], 1)[0]

const dirname = regularDirname || foundDirname || __dirname

/**

exports.Prisma.LeagueScalarFieldEnum = makeEnum({
id: 'id',
name: 'name',
description: 'description',
sport: 'sport'
});

exports.Prisma.QueryMode = makeEnum({
default: 'default',
insensitive: 'insensitive'
});

exports.Prisma.SortOrder = makeEnum({
asc: 'asc',
desc: 'desc'
});

exports.Prisma.TransactionIsolationLevel = makeStrictEnum({
ReadUncommitted: 'ReadUncommitted',
ReadCommitted: 'ReadCommitted',
RepeatableRead: 'RepeatableRead',
Serializable: 'Serializable'
});

exports.Prisma.UserCredentialScalarFieldEnum = makeEnum({
id: 'id',
userId: 'userId',
publicKey: 'publicKey',
transports: 'transports',
counter: 'counter'
});

exports.Prisma.UserScalarFieldEnum = makeEnum({
id: 'id',
username: 'username',
email: 'email',
hashedPassword: 'hashedPassword',
salt: 'salt',
resetToken: 'resetToken',
resetTokenExpiresAt: 'resetTokenExpiresAt',
webAuthnChallenge: 'webAuthnChallenge'
});
exports.Sport = makeEnum({
BASEBALL: 'BASEBALL',
BASKETBALL: 'BASKETBALL',
DODGEBALL: 'DODGEBALL',
FOOTBALL: 'FOOTBALL',
LACROSSE: 'LACROSSE',
SOFTBALL: 'SOFTBALL'
});

exports.Prisma.ModelName = makeEnum({
User: 'User',
UserCredential: 'UserCredential',
League: 'League'
});

const dmmfString = "{"datamodel":{"enums":[{"name":"Sport","values":[{"name":"BASEBALL","dbName":null},{"name":"BASKETBALL","dbName":null},{"name":"DODGEBALL","dbName":null},{"name":"FOOTBALL","dbName":null},{"name":"LACROSSE","dbName":null},{"name":"SOFTBALL","dbName":null}],"dbName":null}],"models":[{"name":"User","dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":true,"isReadOnly":false,"hasDefaultValue":true,"type":"Int","default":{"name":"autoincrement","args":[]},"isGenerated":false,"isUpdatedAt":false},{"name":"username","kind":"scalar","isList":false,"isRequired":true,"isUnique":true,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"email","kind":"scalar","isList":false,"isRequired":true,"isUnique":true,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"hashedPassword","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"salt","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"resetToken","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"resetTokenExpiresAt","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DateTime","isGenerated":false,"isUpdatedAt":false},{"name":"webAuthnChallenge","kind":"scalar","isList":false,"isRequired":false,"isUnique":true,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"credentials","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"UserCredential","relationName":"UserToUserCredential","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":null,"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},{"name":"UserCredential","dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":true,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"userId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"user","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"User","relationName":"UserToUserCredential","relationFromFields":["userId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"publicKey","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Bytes","isGenerated":false,"isUpdatedAt":false},{"name":"transports","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"counter","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"BigInt","isGenerated":false,"isUpdatedAt":false}],"primaryKey":null,"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},{"name":"League","dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":true,"isReadOnly":false,"hasDefaultValue":true,"type":"Int","default":{"name":"autoincrement","args":[]},"isGenerated":false,"isUpdatedAt":false},{"name":"name","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"description","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sport","kind":"enum","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Sport","isGenerated":false,"isUpdatedAt":false}],"primaryKey":null,"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false}],"types":[]},"mappings":{"modelOperations":[{"model":"User","plural":"users","findUnique":"findUniqueUser","findUniqueOrThrow":"findUniqueUserOrThrow","findFirst":"findFirstUser","findFirstOrThrow":"findFirstUserOrThrow","findMany":"findManyUser","create":"createOneUser","createMany":"createManyUser","delete":"deleteOneUser","update":"updateOneUser","deleteMany":"deleteManyUser","updateMany":"updateManyUser","upsert":"upsertOneUser","aggregate":"aggregateUser","groupBy":"groupByUser"},{"model":"UserCredential","plural":"userCredentials","findUnique":"findUniqueUserCredential","findUniqueOrThrow":"findUniqueUserCredentialOrThrow","findFirst":"findFirstUserCredential","findFirstOrThrow":"findFirstUserCredentialOrThrow","findMany":"findManyUserCredential","create":"createOneUserCredential","createMany":"createManyUserCredential","delete":"deleteOneUserCredential","update":"updateOneUserCredential","deleteMany":"deleteManyUserCredential","updateMany":"updateManyUserCredential","upsert":"upsertOneUserCredential","aggregate":"aggregateUserCredential","groupBy":"groupByUserCredential"},{"model":"League","plural":"leagues","findUnique":"findUniqueLeague","findUniqueOrThrow":"findUniqueLeagueOrThrow","findFirst":"findFirstLeague","findFirstOrThrow":"findFirstLeagueOrThrow","findMany":"findManyLeague","create":"createOneLeague","createMany":"createManyLeague","delete":"deleteOneLeague","update":"updateOneLeague","deleteMany":"deleteManyLeague","updateMany":"updateManyLeague","upsert":"upsertOneLeague","aggregate":"aggregateLeague","groupBy":"groupByLeague"}],"otherOperations":{"read":[],"write":["executeRaw","queryRaw"]}}}"
const dmmf = JSON.parse(dmmfString)
exports.Prisma.dmmf = JSON.parse(dmmfString)

/**

  • Create the Client
    */
    const config = {
    "generator": {
    "name": "client",
    "provider": {
    "fromEnvVar": null,
    "value": "prisma-client-js"
    },
    "output": {
    "value": "A:\Node\profrec\node_modules\@prisma\client",
    "fromEnvVar": null
    },
    "config": {
    "engineType": "library"
    },
    "binaryTargets": [
    {
    "fromEnvVar": null,
    "value": "windows"
    }
    ],
    "previewFeatures": []
    },
    "relativeEnvPaths": {
    "rootEnvPath": "..\..\..\.env",
    "schemaEnvPath": "..\..\..\.env"
    },
    "relativePath": "..\..\..\api\db",
    "clientVersion": "4.11.0",
    "engineVersion": "8fde8fef4033376662cad983758335009d522acb",
    "datasourceNames": [
    "db"
    ],
    "activeProvider": "postgresql",
    "dataProxy": false
    }
    config.dirname = dirname
    config.document = dmmf

const { warnEnvConflicts } = require('@prisma/client/runtime/library')

warnEnvConflicts({
rootEnvPath: config.relativeEnvPaths.rootEnvPath && path.resolve(dirname, config.relativeEnvPaths.rootEnvPath),
schemaEnvPath: config.relativeEnvPaths.schemaEnvPath && path.resolve(dirname, config.relativeEnvPaths.schemaEnvPath)
})

const PrismaClient = getPrismaClient(config)
exports.PrismaClient = PrismaClient
Object.assign(exports, Prisma)

path.join(__dirname, "query_engine-windows.dll.node");
path.join(process.cwd(), "node_modules\.prisma\client\query_engine-windows.dll.node")
path.join(__dirname, "schema.prisma");
path.join(process.cwd(), "node_modules\.prisma\client\schema.prisma")

</details>

@codewriter3000 codewriter3000 changed the title [Bug?]: Prisma Migrate isn't migrating enums [Bug?]: Prisma Migrate isn't properly migrating enums Mar 23, 2023
@codewriter3000
Copy link
Author

codewriter3000 commented Mar 23, 2023

node_modules/.prisma/client/index.d.ts:

```ts

/**

  • Client
    **/

import * as runtime from '@prisma/client/runtime/library';
type UnwrapPromise

= P extends Promise ? R : P
type UnwrapTuple<Tuple extends readonly unknown[]> = {
[K in keyof Tuple]: K extends ${number} ? Tuple[K] extends Prisma.PrismaPromise ? X : UnwrapPromise<Tuple[K]> : UnwrapPromise<Tuple[K]>
};

/**

  • Model User

*/
export type User = {
id: number
username: string
email: string
hashedPassword: string
salt: string
resetToken: string | null
resetTokenExpiresAt: Date | null
webAuthnChallenge: string | null
}

/**

  • Model UserCredential

*/
export type UserCredential = {
id: string
userId: number
publicKey: Buffer
transports: string | null
counter: bigint
}

/**

  • Model League

*/
export type League = {
id: number
name: string
description: string
sport: Sport[]
}

/**

  • Enums
    */

// Based on
// microsoft/TypeScript#3192 (comment)

export const Sport: {
BASEBALL: 'BASEBALL',
BASKETBALL: 'BASKETBALL',
DODGEBALL: 'DODGEBALL',
FOOTBALL: 'FOOTBALL',
LACROSSE: 'LACROSSE',
SOFTBALL: 'SOFTBALL'
};

export type Sport = (typeof Sport)[keyof typeof Sport]

/**

  • Prisma Client ʲˢ

  • Type-safe database client for TypeScript & Node.js
  • @example
  • const prisma = new PrismaClient()
  • // Fetch zero or more Users
  • const users = await prisma.user.findMany()
  • Read more in our docs.
    */
    export class PrismaClient<
    T extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions,
    U = 'log' extends keyof T ? T['log'] extends Array<Prisma.LogLevel | Prisma.LogDefinition> ? Prisma.GetEvents<T['log']> : never : never,
    GlobalReject extends Prisma.RejectOnNotFound | Prisma.RejectPerOperation | false | undefined = 'rejectOnNotFound' extends keyof T
    ? T['rejectOnNotFound']
    : false

    {
    /**

    • Prisma Client ʲˢ

    • Type-safe database client for TypeScript & Node.js
    • @example
    • const prisma = new PrismaClient()
    • // Fetch zero or more Users
    • const users = await prisma.user.findMany()
    • Read more in our docs.
      */

constructor(optionsArg ?: Prisma.Subset<T, Prisma.PrismaClientOptions>);
$on<V extends (U | 'beforeExit')>(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : V extends 'beforeExit' ? () => Promise : Prisma.LogEvent) => void): void;

/**

  • Connect with the database
    */
    $connect(): Promise;

/**

  • Disconnect from the database
    */
    $disconnect(): Promise;

/**

  • Add a middleware
    */
    $use(cb: Prisma.Middleware): void

/**

  • Executes a prepared raw query and returns the number of affected rows.
  • @example
  • const result = await prisma.$executeRawUPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};
  • Read more in our docs.
    */
    $executeRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise;

/**

  • Executes a raw query and returns the number of affected rows.
  • Susceptible to SQL injections, see documentation.
  • @example
  • const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com')
  • Read more in our docs.
    */
    $executeRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise;

/**

  • Performs a prepared raw query and returns the SELECT data.
  • @example
  • const result = await prisma.$queryRawSELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};
  • Read more in our docs.
    */
    $queryRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise;

/**

  • Performs a raw query and returns the SELECT data.
  • Susceptible to SQL injections, see documentation.
  • @example
  • const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com')
  • Read more in our docs.
    */
    $queryRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise;

/**

  • Allows the running of a sequence of read/write operations that are guaranteed to either succeed or fail as a whole.
  • @example
  • const [george, bob, alice] = await prisma.$transaction([
  • prisma.user.create({ data: { name: 'George' } }),
  • prisma.user.create({ data: { name: 'Bob' } }),
  • prisma.user.create({ data: { name: 'Alice' } }),
  • ])
  • Read more in our docs.
    */
    $transaction<P extends Prisma.PrismaPromise[]>(arg: [...P], options?: { isolationLevel?: Prisma.TransactionIsolationLevel }): Promise<UnwrapTuple

    >

$transaction(fn: (prisma: Omit<this, "$connect" | "$disconnect" | "$on" | "$transaction" | "$use">) => Promise, options?: { maxWait?: number, timeout?: number, isolationLevel?: Prisma.TransactionIsolationLevel }): Promise

  /**
  • prisma.user: Exposes CRUD operations for the User model.
    * Example usage:
    * ts * // Fetch zero or more Users * const users = await prisma.user.findMany() *
    */
    get user(): Prisma.UserDelegate;

/**

  • prisma.userCredential: Exposes CRUD operations for the UserCredential model.
    * Example usage:
    * ts * // Fetch zero or more UserCredentials * const userCredentials = await prisma.userCredential.findMany() *
    */
    get userCredential(): Prisma.UserCredentialDelegate;

/**

  • prisma.league: Exposes CRUD operations for the League model.
    * Example usage:
    * ts * // Fetch zero or more Leagues * const leagues = await prisma.league.findMany() *
    */
    get league(): Prisma.LeagueDelegate;
    }

export namespace Prisma {
export import DMMF = runtime.DMMF

export type PrismaPromise = runtime.Types.Public.PrismaPromise

/**

  • Prisma Errors
    */
    export import PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError
    export import PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError
    export import PrismaClientRustPanicError = runtime.PrismaClientRustPanicError
    export import PrismaClientInitializationError = runtime.PrismaClientInitializationError
    export import PrismaClientValidationError = runtime.PrismaClientValidationError
    export import NotFoundError = runtime.NotFoundError

/**

  • Re-export of sql-template-tag
    */
    export import sql = runtime.sqltag
    export import empty = runtime.empty
    export import join = runtime.join
    export import raw = runtime.raw
    export import Sql = runtime.Sql

/**

  • Decimal.js
    */
    export import Decimal = runtime.Decimal

export type DecimalJsLike = runtime.DecimalJsLike

/**

  • Metrics
    */
    export type Metrics = runtime.Metrics
    export type Metric = runtime.Metric
    export type MetricHistogram = runtime.MetricHistogram
    export type MetricHistogramBucket = runtime.MetricHistogramBucket

/**

  • Prisma Client JS version: 4.11.0
  • Query Engine version: 8fde8fef4033376662cad983758335009d522acb
    */
    export type PrismaVersion = {
    client: string
    }

export const prismaVersion: PrismaVersion

/**

  • Utility Types
    */

/**

  • From https://github.com/sindresorhus/type-fest/
  • Matches a JSON object.
  • This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from.
    */
    export type JsonObject = {[Key in string]?: JsonValue}

/**

/**

/**

  • Matches a JSON object.
  • Unlike JsonObject, this type allows undefined and read-only properties.
    */
    export type InputJsonObject = {readonly [Key in string]?: InputJsonValue | null}

/**

  • Matches a JSON array.
  • Unlike JsonArray, readonly arrays are assignable to this type.
    */
    export interface InputJsonArray extends ReadonlyArray<InputJsonValue | null> {}

/**

  • Matches any valid value that can be used as an input for operations like
  • create and update as the value of a JSON field. Unlike JsonValue, this
  • type allows read-only arrays and read-only object properties and disallows
  • null at the top level.
  • null cannot be used as the value of a JSON field because its meaning
  • would be ambiguous. Use Prisma.JsonNull to store the JSON null value or
  • Prisma.DbNull to clear the JSON value and set the field to the database
  • NULL value instead.
  • @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-by-null-values
    */
    export type InputJsonValue = string | number | boolean | InputJsonObject | InputJsonArray

/**

/**
* Type of `Prisma.JsonNull`.
* 
* You cannot use other instances of this class. Please use the `Prisma.JsonNull` value.
* 
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
*/
class JsonNull {
  private JsonNull: never
  private constructor()
}

/**
* Type of `Prisma.AnyNull`.
* 
* You cannot use other instances of this class. Please use the `Prisma.AnyNull` value.
* 
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
*/
class AnyNull {
  private AnyNull: never
  private constructor()
}

}

/**

/**

/**

type SelectAndInclude = {
select: any
include: any
}
type HasSelect = {
select: any
}
type HasInclude = {
include: any
}
type CheckSelect<T, S, U> = T extends SelectAndInclude
? 'Please either choose select or include'
: T extends HasSelect
? U
: T extends HasInclude
? U
: S

/**

  • Get the type of the value, that the Promise holds.
    */
    export type PromiseType<T extends PromiseLike> = T extends PromiseLike ? U : T;

/**

  • Get the return type of a function which returns a Promise.
    */
    export type PromiseReturnType<T extends (...args: any) => Promise> = PromiseType<ReturnType>

/**

  • From T, pick a set of properties whose keys are in the union K
    */
    type Prisma__Pick<T, K extends keyof T> = {
    [P in K]: T[P];
    };

export type Enumerable = T | Array;

export type RequiredKeys = {
[K in keyof T]-?: {} extends Prisma__Pick<T, K> ? never : K
}[keyof T]

export type TruthyKeys = keyof {
[K in keyof T as T[K] extends false | undefined | null ? never : K]: K
}

export type TrueKeys = TruthyKeys<Prisma__Pick<T, RequiredKeys>>

/**

  • Subset
  • @desc From T pick properties that exist in U. Simple version of Intersection
    */
    export type Subset<T, U> = {
    [key in keyof T]: key extends keyof U ? T[key] : never;
    };

/**

  • SelectSubset
  • @desc From T pick properties that exist in U. Simple version of Intersection.
  • Additionally, it validates, if both select and include are present. If the case, it errors.
    */
    export type SelectSubset<T, U> = {
    [key in keyof T]: key extends keyof U ? T[key] : never
    } &
    (T extends SelectAndInclude
    ? 'Please either choose select or include.'
    : {})

/**

  • Subset + Intersection
  • @desc From T pick properties that exist in U and intersect K
    */
    export type SubsetIntersection<T, U, K> = {
    [key in keyof T]: key extends keyof U ? T[key] : never
    } &
    K

type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never };

/**

/**

  • Is T a Record?
    */
    type IsObject = T extends Array
    ? False
    : T extends Date
    ? False
    : T extends Uint8Array
    ? False
    : T extends BigInt
    ? False
    : T extends object
    ? True
    : False

/**

  • If it's T[], return T
    */
    export type UnEnumerate = T extends Array ? U : T

/**

  • From ts-toolbelt
    */

type __Either<O extends object, K extends Key> = Omit<O, K> &
{
// Merge all but K
[P in K]: Prisma__Pick<O, P & keyof O> // With K possibilities
}[K]

type EitherStrict<O extends object, K extends Key> = Strict<__Either<O, K>>

type EitherLoose<O extends object, K extends Key> = ComputeRaw<__Either<O, K>>

type _Either<
O extends object,
K extends Key,
strict extends Boolean

= {
1: EitherStrict<O, K>
0: EitherLoose<O, K>
}[strict]

type Either<
O extends object,
K extends Key,
strict extends Boolean = 1

= O extends unknown ? _Either<O, K, strict> : never

export type Union = any

type PatchUndefined<O extends object, O1 extends object> = {
[K in keyof O]: O[K] extends undefined ? At<O1, K> : O[K]
} & {}

/** Helper Types for "Merge" **/
export type IntersectOf = (
U extends unknown ? (k: U) => void : never
) extends (k: infer I) => void
? I
: never

export type Overwrite<O extends object, O1 extends object> = {
[K in keyof O]: K extends keyof O1 ? O1[K] : O[K];
} & {};

type _Merge = IntersectOf<Overwrite<U, {
[K in keyof U]-?: At<U, K>;
}>>;

type Key = string | number | symbol;
type AtBasic<O extends object, K extends Key> = K extends keyof O ? O[K] : never;
type AtStrict<O extends object, K extends Key> = O[K & keyof O];
type AtLoose<O extends object, K extends Key> = O extends unknown ? AtStrict<O, K> : never;
export type At<O extends object, K extends Key, strict extends Boolean = 1> = {
1: AtStrict<O, K>;
0: AtLoose<O, K>;
}[strict];

export type ComputeRaw = A extends Function ? A : {
[K in keyof A]: A[K];
} & {};

export type OptionalFlat = {
[K in keyof O]?: O[K];
} & {};

type _Record<K extends keyof any, T> = {
[P in K]: T;
};

// cause typescript not to expand types and preserve names
type NoExpand = T extends unknown ? T : never;

// this type assumes the passed object is entirely optional
type AtLeast<O extends object, K extends string> = NoExpand<
O extends unknown
? | (K extends keyof O ? { [P in K]: O[P] } & O : O)
| {[P in keyof O as P extends K ? K : never]-?: O[P]} & O
: never>;

type _Strict<U, _U = U> = U extends unknown ? U & OptionalFlat<_Record<Exclude<Keys<_U>, keyof U>, never>> : never;

export type Strict = ComputeRaw<_Strict>;
/** End Helper Types for "Merge" **/

export type Merge = ComputeRaw<_Merge<Strict>>;

/**
A [[Boolean]]
*/
export type Boolean = True | False

// /**
// 1
// */
export type True = 1

/**
0
*/
export type False = 0

export type Not = {
0: 1
1: 0
}[B]

export type Extends<A1 extends any, A2 extends any> = [A1] extends [never]
? 0 // anything never is false
: A1 extends A2
? 1
: 0

export type Has<U extends Union, U1 extends Union> = Not<
Extends<Exclude<U1, U>, U1>

export type Or<B1 extends Boolean, B2 extends Boolean> = {
0: {
0: 0
1: 1
}
1: {
0: 1
1: 1
}
}[B1][B2]

export type Keys = U extends unknown ? keyof U : never

type Cast<A, B> = A extends B ? A : B;

export const type: unique symbol;

export function validator(): (select: runtime.Types.Utils.LegacyExact<S, V>) => S;

/**

  • Used by group by
    */

export type GetScalarType<T, O> = O extends object ? {
[P in keyof T]: P extends keyof O
? O[P]
: never
} : never

type FieldPaths<
T,
U = Omit<T, '_avg' | '_sum' | '_count' | '_min' | '_max'>

= IsObject extends True ? U : T

type GetHavingFields = {
[K in keyof T]: Or<
Or<Extends<'OR', K>, Extends<'AND', K>>,
Extends<'NOT', K>
> extends True
? // infer is only needed to not hit TS limit
// based on the brilliant idea of Pierre-Antoine Mills
// microsoft/TypeScript#30188 (comment)
T[K] extends infer TK
? GetHavingFields<UnEnumerate extends object ? Merge<UnEnumerate> : never>
: never
: {} extends FieldPaths<T[K]>
? never
: K
}[keyof T]

/**

  • Convert tuple to union
    */
    type _TupleToUnion = T extends (infer E)[] ? E : never
    type TupleToUnion<K extends readonly any[]> = _TupleToUnion
    type MaybeTupleToUnion = T extends any[] ? TupleToUnion : T

/**

  • Like Pick, but with an array
    */
    type PickArray<T, K extends Array> = Prisma__Pick<T, TupleToUnion>

/**

  • Exclude all keys with underscores
    */
    type ExcludeUnderscoreKeys = T extends _${string} ? never : T

export type FieldRef<Model, FieldType> = runtime.FieldRef<Model, FieldType>

type FieldRefInputType<Model, FieldType> = Model extends never ? never : FieldRef<Model, FieldType>

export const ModelName: {
User: 'User',
UserCredential: 'UserCredential',
League: 'League'
};

export type ModelName = (typeof ModelName)[keyof typeof ModelName]

export type Datasources = {
db?: Datasource
}

export type DefaultPrismaClient = PrismaClient
export type RejectOnNotFound = boolean | ((error: Error) => Error)
export type RejectPerModel = { [P in ModelName]?: RejectOnNotFound }
export type RejectPerOperation = { [P in "findUnique" | "findFirst"]?: RejectPerModel | RejectOnNotFound }
type IsReject = T extends true ? True : T extends (err: Error) => Error ? True : False
export type HasReject<
GlobalRejectSettings extends Prisma.PrismaClientOptions['rejectOnNotFound'],
LocalRejectSettings,
Action extends PrismaAction,
Model extends ModelName

= LocalRejectSettings extends RejectOnNotFound
? IsReject
: GlobalRejectSettings extends RejectPerOperation
? Action extends keyof GlobalRejectSettings
? GlobalRejectSettings[Action] extends RejectOnNotFound
? IsReject<GlobalRejectSettings[Action]>
: GlobalRejectSettings[Action] extends RejectPerModel
? Model extends keyof GlobalRejectSettings[Action]
? IsReject<GlobalRejectSettings[Action][Model]>
: False
: False
: False
: IsReject
export type ErrorFormat = 'pretty' | 'colorless' | 'minimal'

export interface PrismaClientOptions {
/**
* Configure findUnique/findFirst to throw an error if the query returns null.
* @deprecated since 4.0.0. Use findUniqueOrThrow/findFirstOrThrow methods instead.
* @example
* * // Reject on both findUnique/findFirst * rejectOnNotFound: true * // Reject only on findFirst with a custom error * rejectOnNotFound: { findFirst: (err) => new Error("Custom Error")} * // Reject on user.findUnique with a custom error * rejectOnNotFound: { findUnique: {User: (err) => new Error("User not found")}} *
/
rejectOnNotFound?: RejectOnNotFound | RejectPerOperation
/
*
* Overwrites the datasource url from your schema.prisma file
*/
datasources?: Datasources

/**
 * @default "colorless"
 */
errorFormat?: ErrorFormat

/**
 * @example
 * ```
 * // Defaults to stdout
 * log: ['query', 'info', 'warn', 'error']
 * 
 * // Emit as events
 * log: [
 *  { emit: 'stdout', level: 'query' },
 *  { emit: 'stdout', level: 'info' },
 *  { emit: 'stdout', level: 'warn' }
 *  { emit: 'stdout', level: 'error' }
 * ]
 * ```
 * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option).
 */
log?: Array<LogLevel | LogDefinition>

}

/* Types for Logging */
export type LogLevel = 'info' | 'query' | 'warn' | 'error'
export type LogDefinition = {
level: LogLevel
emit: 'stdout' | 'event'
}

export type GetLogType<T extends LogLevel | LogDefinition> = T extends LogDefinition ? T['emit'] extends 'event' ? T['level'] : never : never
export type GetEvents = T extends Array<LogLevel | LogDefinition> ?
GetLogType<T[0]> | GetLogType<T[1]> | GetLogType<T[2]> | GetLogType<T[3]>
: never

export type QueryEvent = {
timestamp: Date
query: string
params: string
duration: number
target: string
}

export type LogEvent = {
timestamp: Date
message: string
target: string
}
/* End Types for Logging */

export type PrismaAction =
| 'findUnique'
| 'findMany'
| 'findFirst'
| 'create'
| 'createMany'
| 'update'
| 'updateMany'
| 'upsert'
| 'delete'
| 'deleteMany'
| 'executeRaw'
| 'queryRaw'
| 'aggregate'
| 'count'
| 'runCommandRaw'
| 'findRaw'

/**

  • These options are being passed into the middleware as "params"
    */
    export type MiddlewareParams = {
    model?: ModelName
    action: PrismaAction
    args: any
    dataPath: string[]
    runInTransaction: boolean
    }

/**

  • The T type makes sure, that the return proceed is not forgotten in the middleware implementation
    */
    export type Middleware<T = any> = (
    params: MiddlewareParams,
    next: (params: MiddlewareParams) => Promise,
    ) => Promise

// tested in getLogLevel.test.ts
export function getLogLevel(log: Array<LogLevel | LogDefinition>): LogLevel | undefined;

/**

  • PrismaClient proxy available in interactive transactions.
    */
    export type TransactionClient = Omit<Prisma.DefaultPrismaClient, '$connect' | '$disconnect' | '$on' | '$transaction' | '$use'>

export type Datasource = {
url?: string
}

/**

  • Count Types
    */

/**

  • Count Type UserCountOutputType
    */

export type UserCountOutputType = {
credentials: number
}

export type UserCountOutputTypeSelect = {
credentials?: boolean
}

export type UserCountOutputTypeGetPayload<S extends boolean | null | undefined | UserCountOutputTypeArgs> =
S extends { select: any, include: any } ? 'Please either choose select or include' :
S extends true ? UserCountOutputType :
S extends undefined ? never :
S extends { include: any } & (UserCountOutputTypeArgs)
? UserCountOutputType
: S extends { select: any } & (UserCountOutputTypeArgs)
? {
[P in TruthyKeys<S['select']>]:
P extends keyof UserCountOutputType ? UserCountOutputType[P] : never
}
: UserCountOutputType

// Custom InputTypes

/**

  • UserCountOutputType without action
    /
    export type UserCountOutputTypeArgs = {
    /
    *
    • Select specific fields to fetch from the UserCountOutputType
      */
      select?: UserCountOutputTypeSelect | null
      }

/**

  • Models
    */

/**

  • Model User
    */

export type AggregateUser = {
_count: UserCountAggregateOutputType | null
_avg: UserAvgAggregateOutputType | null
_sum: UserSumAggregateOutputType | null
_min: UserMinAggregateOutputType | null
_max: UserMaxAggregateOutputType | null
}

export type UserAvgAggregateOutputType = {
id: number | null
}

export type UserSumAggregateOutputType = {
id: number | null
}

export type UserMinAggregateOutputType = {
id: number | null
username: string | null
email: string | null
hashedPassword: string | null
salt: string | null
resetToken: string | null
resetTokenExpiresAt: Date | null
webAuthnChallenge: string | null
}

export type UserMaxAggregateOutputType = {
id: number | null
username: string | null
email: string | null
hashedPassword: string | null
salt: string | null
resetToken: string | null
resetTokenExpiresAt: Date | null
webAuthnChallenge: string | null
}

export type UserCountAggregateOutputType = {
id: number
username: number
email: number
hashedPassword: number
salt: number
resetToken: number
resetTokenExpiresAt: number
webAuthnChallenge: number
_all: number
}

export type UserAvgAggregateInputType = {
id?: true
}

export type UserSumAggregateInputType = {
id?: true
}

export type UserMinAggregateInputType = {
id?: true
username?: true
email?: true
hashedPassword?: true
salt?: true
resetToken?: true
resetTokenExpiresAt?: true
webAuthnChallenge?: true
}

export type UserMaxAggregateInputType = {
id?: true
username?: true
email?: true
hashedPassword?: true
salt?: true
resetToken?: true
resetTokenExpiresAt?: true
webAuthnChallenge?: true
}

export type UserCountAggregateInputType = {
id?: true
username?: true
email?: true
hashedPassword?: true
salt?: true
resetToken?: true
resetTokenExpiresAt?: true
webAuthnChallenge?: true
_all?: true
}

export type UserAggregateArgs = {
/**
* Filter which User to aggregate.
/
where?: UserWhereInput
/
*
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
*
* Determine the order of Users to fetch.
/
orderBy?: Enumerable
/
*
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
*
* Sets the start position
/
cursor?: UserWhereUniqueInput
/
*
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
*
* Take ±n Users from the position of the cursor.
/
take?: number
/
*
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
*
* Skip the first n Users.
/
skip?: number
/
*
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Count returned Users
/
_count?: true | UserCountAggregateInputType
/

* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Select which fields to average
/
_avg?: UserAvgAggregateInputType
/

* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Select which fields to sum
/
_sum?: UserSumAggregateInputType
/

* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Select which fields to find the minimum value
/
_min?: UserMinAggregateInputType
/

* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Select which fields to find the maximum value
**/
_max?: UserMaxAggregateInputType
}

export type GetUserAggregateType = {
[P in keyof T & keyof AggregateUser]: P extends '_count' | 'count'
? T[P] extends true
? number
: GetScalarType<T[P], AggregateUser[P]>
: GetScalarType<T[P], AggregateUser[P]>
}

export type UserGroupByArgs = {
where?: UserWhereInput
orderBy?: Enumerable
by: UserScalarFieldEnum[]
having?: UserScalarWhereWithAggregatesInput
take?: number
skip?: number
_count?: UserCountAggregateInputType | true
_avg?: UserAvgAggregateInputType
_sum?: UserSumAggregateInputType
_min?: UserMinAggregateInputType
_max?: UserMaxAggregateInputType
}

export type UserGroupByOutputType = {
id: number
username: string
email: string
hashedPassword: string
salt: string
resetToken: string | null
resetTokenExpiresAt: Date | null
webAuthnChallenge: string | null
_count: UserCountAggregateOutputType | null
_avg: UserAvgAggregateOutputType | null
_sum: UserSumAggregateOutputType | null
_min: UserMinAggregateOutputType | null
_max: UserMaxAggregateOutputType | null
}

type GetUserGroupByPayload = Prisma.PrismaPromise<
Array<
PickArray<UserGroupByOutputType, T['by']> &
{
[P in ((keyof T) & (keyof UserGroupByOutputType))]: P extends '_count'
? T[P] extends boolean
? number
: GetScalarType<T[P], UserGroupByOutputType[P]>
: GetScalarType<T[P], UserGroupByOutputType[P]>
}
>
>

export type UserSelect = {
id?: boolean
username?: boolean
email?: boolean
hashedPassword?: boolean
salt?: boolean
resetToken?: boolean
resetTokenExpiresAt?: boolean
webAuthnChallenge?: boolean
credentials?: boolean | User$credentialsArgs
_count?: boolean | UserCountOutputTypeArgs
}

export type UserInclude = {
credentials?: boolean | User$credentialsArgs
_count?: boolean | UserCountOutputTypeArgs
}

export type UserGetPayload<S extends boolean | null | undefined | UserArgs> =
S extends { select: any, include: any } ? 'Please either choose select or include' :
S extends true ? User :
S extends undefined ? never :
S extends { include: any } & (UserArgs | UserFindManyArgs)
? User & {
[P in TruthyKeys<S['include']>]:
P extends 'credentials' ? Array < UserCredentialGetPayload<S['include'][P]>> :
P extends '_count' ? UserCountOutputTypeGetPayload<S['include'][P]> : never
}
: S extends { select: any } & (UserArgs | UserFindManyArgs)
? {
[P in TruthyKeys<S['select']>]:
P extends 'credentials' ? Array < UserCredentialGetPayload<S['select'][P]>> :
P extends '_count' ? UserCountOutputTypeGetPayload<S['select'][P]> : P extends keyof User ? User[P] : never
}
: User

type UserCountArgs =
Omit<UserFindManyArgs, 'select' | 'include'> & {
select?: UserCountAggregateInputType | true
}

export interface UserDelegate<GlobalRejectSettings extends Prisma.RejectOnNotFound | Prisma.RejectPerOperation | false | undefined> {

/**
 * Find zero or one User that matches the filter.
 * @param {UserFindUniqueArgs} args - Arguments to find a User
 * @example
 * // Get one User
 * const user = await prisma.user.findUnique({
 *   where: {
 *     // ... provide filter here
 *   }
 * })
**/
findUnique<T extends UserFindUniqueArgs,  LocalRejectSettings = T["rejectOnNotFound"] extends RejectOnNotFound ? T['rejectOnNotFound'] : undefined>(
  args: SelectSubset<T, UserFindUniqueArgs>
): HasReject<GlobalRejectSettings, LocalRejectSettings, 'findUnique', 'User'> extends True ? Prisma__UserClient<UserGetPayload<T>> : Prisma__UserClient<UserGetPayload<T> | null, null>

/**
 * Find one User that matches the filter or throw an error  with `error.code='P2025'` 
 *     if no matches were found.
 * @param {UserFindUniqueOrThrowArgs} args - Arguments to find a User
 * @example
 * // Get one User
 * const user = await prisma.user.findUniqueOrThrow({
 *   where: {
 *     // ... provide filter here
 *   }
 * })
**/
findUniqueOrThrow<T extends UserFindUniqueOrThrowArgs>(
  args?: SelectSubset<T, UserFindUniqueOrThrowArgs>
): Prisma__UserClient<UserGetPayload<T>>

/**
 * Find the first User that matches the filter.
 * Note, that providing `undefined` is treated as the value not being there.
 * Read more here: https://pris.ly/d/null-undefined
 * @param {UserFindFirstArgs} args - Arguments to find a User
 * @example
 * // Get one User
 * const user = await prisma.user.findFirst({
 *   where: {
 *     // ... provide filter here
 *   }
 * })
**/
findFirst<T extends UserFindFirstArgs,  LocalRejectSettings = T["rejectOnNotFound"] extends RejectOnNotFound ? T['rejectOnNotFound'] : undefined>(
  args?: SelectSubset<T, UserFindFirstArgs>
): HasReject<GlobalRejectSettings, LocalRejectSettings, 'findFirst', 'User'> extends True ? Prisma__UserClient<UserGetPayload<T>> : Prisma__UserClient<UserGetPayload<T> | null, null>

/**
 * Find the first User that matches the filter or
 * throw `NotFoundError` if no matches were found.
 * Note, that providing `undefined` is treated as the value not being there.
 * Read more here: https://pris.ly/d/null-undefined
 * @param {UserFindFirstOrThrowArgs} args - Arguments to find a User
 * @example
 * // Get one User
 * const user = await prisma.user.findFirstOrThrow({
 *   where: {
 *     // ... provide filter here
 *   }
 * })
**/
findFirstOrThrow<T extends UserFindFirstOrThrowArgs>(
  args?: SelectSubset<T, UserFindFirstOrThrowArgs>
): Prisma__UserClient<UserGetPayload<T>>

/**
 * Find zero or more Users that matches the filter.
 * Note, that providing `undefined` is treated as the value not being there.
 * Read more here: https://pris.ly/d/null-undefined
 * @param {UserFindManyArgs=} args - Arguments to filter and select certain fields only.
 * @example
 * // Get all Users
 * const users = await prisma.user.findMany()
 * 
 * // Get first 10 Users
 * const users = await prisma.user.findMany({ take: 10 })
 * 
 * // Only select the `id`
 * const userWithIdOnly = await prisma.user.findMany({ select: { id: true } })
 * 
**/
findMany<T extends UserFindManyArgs>(
  args?: SelectSubset<T, UserFindManyArgs>
): Prisma.PrismaPromise<Array<UserGetPayload<T>>>

/**
 * Create a User.
 * @param {UserCreateArgs} args - Arguments to create a User.
 * @example
 * // Create one User
 * const User = await prisma.user.create({
 *   data: {
 *     // ... data to create a User
 *   }
 * })
 * 
**/
create<T extends UserCreateArgs>(
  args: SelectSubset<T, UserCreateArgs>
): Prisma__UserClient<UserGetPayload<T>>

/**
 * Create many Users.
 *     @param {UserCreateManyArgs} args - Arguments to create many Users.
 *     @example
 *     // Create many Users
 *     const user = await prisma.user.createMany({
 *       data: {
 *         // ... provide data here
 *       }
 *     })
 *     
**/
createMany<T extends UserCreateManyArgs>(
  args?: SelectSubset<T, UserCreateManyArgs>
): Prisma.PrismaPromise<BatchPayload>

/**
 * Delete a User.
 * @param {UserDeleteArgs} args - Arguments to delete one User.
 * @example
 * // Delete one User
 * const User = await prisma.user.delete({
 *   where: {
 *     // ... filter to delete one User
 *   }
 * })
 * 
**/
delete<T extends UserDeleteArgs>(
  args: SelectSubset<T, UserDeleteArgs>
): Prisma__UserClient<UserGetPayload<T>>

/**
 * Update one User.
 * @param {UserUpdateArgs} args - Arguments to update one User.
 * @example
 * // Update one User
 * const user = await prisma.user.update({
 *   where: {
 *     // ... provide filter here
 *   },
 *   data: {
 *     // ... provide data here
 *   }
 * })
 * 
**/
update<T extends UserUpdateArgs>(
  args: SelectSubset<T, UserUpdateArgs>
): Prisma__UserClient<UserGetPayload<T>>

/**
 * Delete zero or more Users.
 * @param {UserDeleteManyArgs} args - Arguments to filter Users to delete.
 * @example
 * // Delete a few Users
 * const { count } = await prisma.user.deleteMany({
 *   where: {
 *     // ... provide filter here
 *   }
 * })
 * 
**/
deleteMany<T extends UserDeleteManyArgs>(
  args?: SelectSubset<T, UserDeleteManyArgs>
): Prisma.PrismaPromise<BatchPayload>

/**
 * Update zero or more Users.
 * Note, that providing `undefined` is treated as the value not being there.
 * Read more here: https://pris.ly/d/null-undefined
 * @param {UserUpdateManyArgs} args - Arguments to update one or more rows.
 * @example
 * // Update many Users
 * const user = await prisma.user.updateMany({
 *   where: {
 *     // ... provide filter here
 *   },
 *   data: {
 *     // ... provide data here
 *   }
 * })
 * 
**/
updateMany<T extends UserUpdateManyArgs>(
  args: SelectSubset<T, UserUpdateManyArgs>
): Prisma.PrismaPromise<BatchPayload>

/**
 * Create or update one User.
 * @param {UserUpsertArgs} args - Arguments to update or create a User.
 * @example
 * // Update or create a User
 * const user = await prisma.user.upsert({
 *   create: {
 *     // ... data to create a User
 *   },
 *   update: {
 *     // ... in case it already exists, update
 *   },
 *   where: {
 *     // ... the filter for the User we want to update
 *   }
 * })
**/
upsert<T extends UserUpsertArgs>(
  args: SelectSubset<T, UserUpsertArgs>
): Prisma__UserClient<UserGetPayload<T>>

/**
 * Count the number of Users.
 * Note, that providing `undefined` is treated as the value not being there.
 * Read more here: https://pris.ly/d/null-undefined
 * @param {UserCountArgs} args - Arguments to filter Users to count.
 * @example
 * // Count the number of Users
 * const count = await prisma.user.count({
 *   where: {
 *     // ... the filter for the Users we want to count
 *   }
 * })
**/
count<T extends UserCountArgs>(
  args?: Subset<T, UserCountArgs>,
): Prisma.PrismaPromise<
  T extends _Record<'select', any>
    ? T['select'] extends true
      ? number
      : GetScalarType<T['select'], UserCountAggregateOutputType>
    : number
>

/**
 * Allows you to perform aggregations operations on a User.
 * Note, that providing `undefined` is treated as the value not being there.
 * Read more here: https://pris.ly/d/null-undefined
 * @param {UserAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
 * @example
 * // Ordered by age ascending
 * // Where email contains prisma.io
 * // Limited to the 10 users
 * const aggregations = await prisma.user.aggregate({
 *   _avg: {
 *     age: true,
 *   },
 *   where: {
 *     email: {
 *       contains: "prisma.io",
 *     },
 *   },
 *   orderBy: {
 *     age: "asc",
 *   },
 *   take: 10,
 * })
**/
aggregate<T extends UserAggregateArgs>(args: Subset<T, UserAggregateArgs>): Prisma.PrismaPromise<GetUserAggregateType<T>>

/**
 * Group by User.
 * Note, that providing `undefined` is treated as the value not being there.
 * Read more here: https://pris.ly/d/null-undefined
 * @param {UserGroupByArgs} args - Group by arguments.
 * @example
 * // Group by city, order by createdAt, get count
 * const result = await prisma.user.groupBy({
 *   by: ['city', 'createdAt'],
 *   orderBy: {
 *     createdAt: true
 *   },
 *   _count: {
 *     _all: true
 *   },
 * })
 * 
**/
groupBy<
  T extends UserGroupByArgs,
  HasSelectOrTake extends Or<
    Extends<'skip', Keys<T>>,
    Extends<'take', Keys<T>>
  >,
  OrderByArg extends True extends HasSelectOrTake
    ? { orderBy: UserGroupByArgs['orderBy'] }
    : { orderBy?: UserGroupByArgs['orderBy'] },
  OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
  ByFields extends TupleToUnion<T['by']>,
  ByValid extends Has<ByFields, OrderFields>,
  HavingFields extends GetHavingFields<T['having']>,
  HavingValid extends Has<ByFields, HavingFields>,
  ByEmpty extends T['by'] extends never[] ? True : False,
  InputErrors extends ByEmpty extends True
  ? `Error: "by" must not be empty.`
  : HavingValid extends False
  ? {
      [P in HavingFields]: P extends ByFields
        ? never
        : P extends string
        ? `Error: Field "${P}" used in "having" needs to be provided in "by".`
        : [
            Error,
            'Field ',
            P,
            ` in "having" needs to be provided in "by"`,
          ]
    }[HavingFields]
  : 'take' extends Keys<T>
  ? 'orderBy' extends Keys<T>
    ? ByValid extends True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    : 'Error: If you provide "take", you also need to provide "orderBy"'
  : 'skip' extends Keys<T>
  ? 'orderBy' extends Keys<T>
    ? ByValid extends True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    : 'Error: If you provide "skip", you also need to provide "orderBy"'
  : ByValid extends True
  ? {}
  : {
      [P in OrderFields]: P extends ByFields
        ? never
        : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
    }[OrderFields]
>(args: SubsetIntersection<T, UserGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetUserGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>

}

/**

  • The delegate class that acts as a "Promise-like" for User.
  • Why is this prefixed with Prisma__?
  • Because we want to prevent naming conflicts as mentioned in
  • Adapt a more conflict resistant naming for Prisma client's types prisma/prisma-client-js#707
    */
    export class Prisma__UserClient<T, Null = never> implements Prisma.PrismaPromise {
    private readonly _dmmf;
    private readonly _queryType;
    private readonly _rootField;
    private readonly _clientMethod;
    private readonly _args;
    private readonly _dataPath;
    private readonly _errorFormat;
    private readonly _measurePerformance?;
    private _isList;
    private _callsite;
    private _requestPromise?;
    readonly [Symbol.toStringTag]: 'PrismaPromise';
    constructor(_dmmf: runtime.DMMFClass, _queryType: 'query' | 'mutation', _rootField: string, _clientMethod: string, _args: any, _dataPath: string[], _errorFormat: ErrorFormat, _measurePerformance?: boolean | undefined, _isList?: boolean);
credentials<T extends User$credentialsArgs= {}>(args?: Subset<T, User$credentialsArgs>): Prisma.PrismaPromise<Array<UserCredentialGetPayload<T>>| Null>;

private get _document();
/**
 * Attaches callbacks for the resolution and/or rejection of the Promise.
 * @param onfulfilled The callback to execute when the Promise is resolved.
 * @param onrejected The callback to execute when the Promise is rejected.
 * @returns A Promise for the completion of which ever callback is executed.
 */
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
/**
 * Attaches a callback for only the rejection of the Promise.
 * @param onrejected The callback to execute when the Promise is rejected.
 * @returns A Promise for the completion of the callback.
 */
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
/**
 * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
 * resolved value cannot be modified from the callback.
 * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
 * @returns A Promise for the completion of the callback.
 */
finally(onfinally?: (() => void) | undefined | null): Promise<T>;

}

// Custom InputTypes

/**

  • User base type for findUnique actions
    /
    export type UserFindUniqueArgsBase = {
    /
    *
    • Select specific fields to fetch from the User
      /
      select?: UserSelect | null
      /
      *
    • Choose, which related nodes to fetch as well.
      /
      include?: UserInclude | null
      /
      *
    • Filter, which User to fetch.
      */
      where: UserWhereUniqueInput
      }

/**

  • User findUnique
    /
    export interface UserFindUniqueArgs extends UserFindUniqueArgsBase {
    /
    *
    * Throw an Error if query returns no results
    * @deprecated since 4.0.0: use findUniqueOrThrow method instead
    */
    rejectOnNotFound?: RejectOnNotFound
    }

/**

  • User findUniqueOrThrow
    /
    export type UserFindUniqueOrThrowArgs = {
    /
    *
    • Select specific fields to fetch from the User
      /
      select?: UserSelect | null
      /
      *
    • Choose, which related nodes to fetch as well.
      /
      include?: UserInclude | null
      /
      *
    • Filter, which User to fetch.
      */
      where: UserWhereUniqueInput
      }

/**

/**

  • User findFirst
    /
    export interface UserFindFirstArgs extends UserFindFirstArgsBase {
    /
    *
    * Throw an Error if query returns no results
    * @deprecated since 4.0.0: use findFirstOrThrow method instead
    */
    rejectOnNotFound?: RejectOnNotFound
    }

/**

/**

/**

  • User create
    /
    export type UserCreateArgs = {
    /
    *
    • Select specific fields to fetch from the User
      /
      select?: UserSelect | null
      /
      *
    • Choose, which related nodes to fetch as well.
      /
      include?: UserInclude | null
      /
      *
    • The data needed to create a User.
      */
      data: XOR<UserCreateInput, UserUncheckedCreateInput>
      }

/**

  • User createMany
    /
    export type UserCreateManyArgs = {
    /
    *
    • The data used to create many Users.
      */
      data: Enumerable
      skipDuplicates?: boolean
      }

/**

  • User update
    /
    export type UserUpdateArgs = {
    /
    *
    • Select specific fields to fetch from the User
      /
      select?: UserSelect | null
      /
      *
    • Choose, which related nodes to fetch as well.
      /
      include?: UserInclude | null
      /
      *
    • The data needed to update a User.
      /
      data: XOR<UserUpdateInput, UserUncheckedUpdateInput>
      /
      *
    • Choose, which User to update.
      */
      where: UserWhereUniqueInput
      }

/**

  • User updateMany
    /
    export type UserUpdateManyArgs = {
    /
    *
    • The data used to update Users.
      /
      data: XOR<UserUpdateManyMutationInput, UserUncheckedUpdateManyInput>
      /
      *
    • Filter which Users to update
      */
      where?: UserWhereInput
      }

/**

  • User upsert
    /
    export type UserUpsertArgs = {
    /
    *
    • Select specific fields to fetch from the User
      /
      select?: UserSelect | null
      /
      *
    • Choose, which related nodes to fetch as well.
      /
      include?: UserInclude | null
      /
      *
    • The filter to search for the User to update in case it exists.
      /
      where: UserWhereUniqueInput
      /
      *
    • In case the User found by the where argument doesn't exist, create a new User with this data.
      /
      create: XOR<UserCreateInput, UserUncheckedCreateInput>
      /
      *
    • In case the User was found with the provided where argument, update it with this data.
      */
      update: XOR<UserUpdateInput, UserUncheckedUpdateInput>
      }

/**

  • User delete
    /
    export type UserDeleteArgs = {
    /
    *
    • Select specific fields to fetch from the User
      /
      select?: UserSelect | null
      /
      *
    • Choose, which related nodes to fetch as well.
      /
      include?: UserInclude | null
      /
      *
    • Filter which User to delete.
      */
      where: UserWhereUniqueInput
      }

/**

  • User deleteMany
    /
    export type UserDeleteManyArgs = {
    /
    *
    • Filter which Users to delete
      */
      where?: UserWhereInput
      }

/**

  • User.credentials
    /
    export type User$credentialsArgs = {
    /
    *
    • Select specific fields to fetch from the UserCredential
      /
      select?: UserCredentialSelect | null
      /
      *
    • Choose, which related nodes to fetch as well.
      */
      include?: UserCredentialInclude | null
      where?: UserCredentialWhereInput
      orderBy?: Enumerable
      cursor?: UserCredentialWhereUniqueInput
      take?: number
      skip?: number
      distinct?: Enumerable
      }

/**

  • User without action
    /
    export type UserArgs = {
    /
    *
    • Select specific fields to fetch from the User
      /
      select?: UserSelect | null
      /
      *
    • Choose, which related nodes to fetch as well.
      */
      include?: UserInclude | null
      }

/**

  • Model UserCredential
    */

export type AggregateUserCredential = {
_count: UserCredentialCountAggregateOutputType | null
_avg: UserCredentialAvgAggregateOutputType | null
_sum: UserCredentialSumAggregateOutputType | null
_min: UserCredentialMinAggregateOutputType | null
_max: UserCredentialMaxAggregateOutputType | null
}

export type UserCredentialAvgAggregateOutputType = {
userId: number | null
counter: number | null
}

export type UserCredentialSumAggregateOutputType = {
userId: number | null
counter: bigint | null
}

export type UserCredentialMinAggregateOutputType = {
id: string | null
userId: number | null
publicKey: Buffer | null
transports: string | null
counter: bigint | null
}

export type UserCredentialMaxAggregateOutputType = {
id: string | null
userId: number | null
publicKey: Buffer | null
transports: string | null
counter: bigint | null
}

export type UserCredentialCountAggregateOutputType = {
id: number
userId: number
publicKey: number
transports: number
counter: number
_all: number
}

export type UserCredentialAvgAggregateInputType = {
userId?: true
counter?: true
}

export type UserCredentialSumAggregateInputType = {
userId?: true
counter?: true
}

export type UserCredentialMinAggregateInputType = {
id?: true
userId?: true
publicKey?: true
transports?: true
counter?: true
}

export type UserCredentialMaxAggregateInputType = {
id?: true
userId?: true
publicKey?: true
transports?: true
counter?: true
}

export type UserCredentialCountAggregateInputType = {
id?: true
userId?: true
publicKey?: true
transports?: true
counter?: true
_all?: true
}

export type UserCredentialAggregateArgs = {
/**
* Filter which UserCredential to aggregate.
/
where?: UserCredentialWhereInput
/
*
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
*
* Determine the order of UserCredentials to fetch.
/
orderBy?: Enumerable
/
*
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
*
* Sets the start position
/
cursor?: UserCredentialWhereUniqueInput
/
*
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
*
* Take ±n UserCredentials from the position of the cursor.
/
take?: number
/
*
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
*
* Skip the first n UserCredentials.
/
skip?: number
/
*
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Count returned UserCredentials
/
_count?: true | UserCredentialCountAggregateInputType
/

* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Select which fields to average
/
_avg?: UserCredentialAvgAggregateInputType
/

* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Select which fields to sum
/
_sum?: UserCredentialSumAggregateInputType
/

* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Select which fields to find the minimum value
/
_min?: UserCredentialMinAggregateInputType
/

* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Select which fields to find the maximum value
**/
_max?: UserCredentialMaxAggregateInputType
}

export type GetUserCredentialAggregateType = {
[P in keyof T & keyof AggregateUserCredential]: P extends '_count' | 'count'
? T[P] extends true
? number
: GetScalarType<T[P], AggregateUserCredential[P]>
: GetScalarType<T[P], AggregateUserCredential[P]>
}

export type UserCredentialGroupByArgs = {
where?: UserCredentialWhereInput
orderBy?: Enumerable
by: UserCredentialScalarFieldEnum[]
having?: UserCredentialScalarWhereWithAggregatesInput
take?: number
skip?: number
_count?: UserCredentialCountAggregateInputType | true
_avg?: UserCredentialAvgAggregateInputType
_sum?: UserCredentialSumAggregateInputType
_min?: UserCredentialMinAggregateInputType
_max?: UserCredentialMaxAggregateInputType
}

export type UserCredentialGroupByOutputType = {
id: string
userId: number
publicKey: Buffer
transports: string | null
counter: bigint
_count: UserCredentialCountAggregateOutputType | null
_avg: UserCredentialAvgAggregateOutputType | null
_sum: UserCredentialSumAggregateOutputType | null
_min: UserCredentialMinAggregateOutputType | null
_max: UserCredentialMaxAggregateOutputType | null
}

type GetUserCredentialGroupByPayload = Prisma.PrismaPromise<
Array<
PickArray<UserCredentialGroupByOutputType, T['by']> &
{
[P in ((keyof T) & (keyof UserCredentialGroupByOutputType))]: P extends '_count'
? T[P] extends boolean
? number
: GetScalarType<T[P], UserCredentialGroupByOutputType[P]>
: GetScalarType<T[P], UserCredentialGroupByOutputType[P]>
}
>
>

export type UserCredentialSelect = {
id?: boolean
userId?: boolean
publicKey?: boolean
transports?: boolean
counter?: boolean
user?: boolean | UserArgs
}

export type UserCredentialInclude = {
user?: boolean | UserArgs
}

export type UserCredentialGetPayload<S extends boolean | null | undefined | UserCredentialArgs> =
S extends { select: any, include: any } ? 'Please either choose select or include' :
S extends true ? UserCredential :
S extends undefined ? never :
S extends { include: any } & (UserCredentialArgs | UserCredentialFindManyArgs)
? UserCredential & {
[P in TruthyKeys<S['include']>]:
P extends 'user' ? UserGetPayload<S['include'][P]> : never
}
: S extends { select: any } & (UserCredentialArgs | UserCredentialFindManyArgs)
? {
[P in TruthyKeys<S['select']>]:
P extends 'user' ? UserGetPayload<S['select'][P]> : P extends keyof UserCredential ? UserCredential[P] : never
}
: UserCredential

type UserCredentialCountArgs =
Omit<UserCredentialFindManyArgs, 'select' | 'include'> & {
select?: UserCredentialCountAggregateInputType | true
}

export interface UserCredentialDelegate<GlobalRejectSettings extends Prisma.RejectOnNotFound | Prisma.RejectPerOperation | false | undefined> {

/**
 * Find zero or one UserCredential that matches the filter.
 * @param {UserCredentialFindUniqueArgs} args - Arguments to find a UserCredential
 * @example
 * // Get one UserCredential
 * const userCredential = await prisma.userCredential.findUnique({
 *   where: {
 *     // ... provide filter here
 *   }
 * })
**/
findUnique<T extends UserCredentialFindUniqueArgs,  LocalRejectSettings = T["rejectOnNotFound"] extends RejectOnNotFound ? T['rejectOnNotFound'] : undefined>(
  args: SelectSubset<T, UserCredentialFindUniqueArgs>
): HasReject<GlobalRejectSettings, LocalRejectSettings, 'findUnique', 'UserCredential'> extends True ? Prisma__UserCredentialClient<UserCredentialGetPayload<T>> : Prisma__UserCredentialClient<UserCredentialGetPayload<T> | null, null>

/**
 * Find one UserCredential that matches the filter or throw an error  with `error.code='P2025'` 
 *     if no matches were found.
 * @param {UserCredentialFindUniqueOrThrowArgs} args - Arguments to find a UserCredential
 * @example
 * // Get one UserCredential
 * const userCredential = await prisma.userCredential.findUniqueOrThrow({
 *   where: {
 *     // ... provide filter here
 *   }
 * })
**/
findUniqueOrThrow<T extends UserCredentialFindUniqueOrThrowArgs>(
  args?: SelectSubset<T, UserCredentialFindUniqueOrThrowArgs>
): Prisma__UserCredentialClient<UserCredentialGetPayload<T>>

/**
 * Find the first UserCredential that matches the filter.
 * Note, that providing `undefined` is treated as the value not being there.
 * Read more here: https://pris.ly/d/null-undefined
 * @param {UserCredentialFindFirstArgs} args - Arguments to find a UserCredential
 * @example
 * // Get one UserCredential
 * const userCredential = await prisma.userCredential.findFirst({
 *   where: {
 *     // ... provide filter here
 *   }
 * })
**/
findFirst<T extends UserCredentialFindFirstArgs,  LocalRejectSettings = T["rejectOnNotFound"] extends RejectOnNotFound ? T['rejectOnNotFound'] : undefined>(
  args?: SelectSubset<T, UserCredentialFindFirstArgs>
): HasReject<GlobalRejectSettings, LocalRejectSettings, 'findFirst', 'UserCredential'> extends True ? Prisma__UserCredentialClient<UserCredentialGetPayload<T>> : Prisma__UserCredentialClient<UserCredentialGetPayload<T> | null, null>

/**
 * Find the first UserCredential that matches the filter or
 * throw `NotFoundError` if no matches were found.
 * Note, that providing `undefined` is treated as the value not being there.
 * Read more here: https://pris.ly/d/null-undefined
 * @param {UserCredentialFindFirstOrThrowArgs} args - Arguments to find a UserCredential
 * @example
 * // Get one UserCredential
 * const userCredential = await prisma.userCredential.findFirstOrThrow({
 *   where: {
 *     // ... provide filter here
 *   }
 * })
**/
findFirstOrThrow<T extends UserCredentialFindFirstOrThrowArgs>(
  args?: SelectSubset<T, UserCredentialFindFirstOrThrowArgs>
): Prisma__UserCredentialClient<UserCredentialGetPayload<T>>

/**
 * Find zero or more UserCredentials that matches the filter.
 * Note, that providing `undefined` is treated as the value not being there.
 * Read more here: https://pris.ly/d/null-undefined
 * @param {UserCredentialFindManyArgs=} args - Arguments to filter and select certain fields only.
 * @example
 * // Get all UserCredentials
 * const userCredentials = await prisma.userCredential.findMany()
 * 
 * // Get first 10 UserCredentials
 * const userCredentials = await prisma.userCredential.findMany({ take: 10 })
 * 
 * // Only select the `id`
 * const userCredentialWithIdOnly = await prisma.userCredential.findMany({ select: { id: true } })
 * 
**/
findMany<T extends UserCredentialFindManyArgs>(
  args?: SelectSubset<T, UserCredentialFindManyArgs>
): Prisma.PrismaPromise<Array<UserCredentialGetPayload<T>>>

/**
 * Create a UserCredential.
 * @param {UserCredentialCreateArgs} args - Arguments to create a UserCredential.
 * @example
 * // Create one UserCredential
 * const UserCredential = await prisma.userCredential.create({
 *   data: {
 *     // ... data to create a UserCredential
 *   }
 * })
 * 
**/
create<T extends UserCredentialCreateArgs>(
  args: SelectSubset<T, UserCredentialCreateArgs>
): Prisma__UserCredentialClient<UserCredentialGetPayload<T>>

/**
 * Create many UserCredentials.
 *     @param {UserCredentialCreateManyArgs} args - Arguments to create many UserCredentials.
 *     @example
 *     // Create many UserCredentials
 *     const userCredential = await prisma.userCredential.createMany({
 *       data: {
 *         // ... provide data here
 *       }
 *     })
 *     
**/
createMany<T extends UserCredentialCreateManyArgs>(
  args?: SelectSubset<T, UserCredentialCreateManyArgs>
): Prisma.PrismaPromise<BatchPayload>

/**
 * Delete a UserCredential.
 * @param {UserCredentialDeleteArgs} args - Arguments to delete one UserCredential.
 * @example
 * // Delete one UserCredential
 * const UserCredential = await prisma.userCredential.delete({
 *   where: {
 *     // ... filter to delete one UserCredential
 *   }
 * })
 * 
**/
delete<T extends UserCredentialDeleteArgs>(
  args: SelectSubset<T, UserCredentialDeleteArgs>
): Prisma__UserCredentialClient<UserCredentialGetPayload<T>>

/**
 * Update one UserCredential.
 * @param {UserCredentialUpdateArgs} args - Arguments to update one UserCredential.
 * @example
 * // Update one UserCredential
 * const userCredential = await prisma.userCredential.update({
 *   where: {
 *     // ... provide filter here
 *   },
 *   data: {
 *     // ... provide data here
 *   }
 * })
 * 
**/
update<T extends UserCredentialUpdateArgs>(
  args: SelectSubset<T, UserCredentialUpdateArgs>
): Prisma__UserCredentialClient<UserCredentialGetPayload<T>>

/**
 * Delete zero or more UserCredentials.
 * @param {UserCredentialDeleteManyArgs} args - Arguments to filter UserCredentials to delete.
 * @example
 * // Delete a few UserCredentials
 * const { count } = await prisma.userCredential.deleteMany({
 *   where: {
 *     // ... provide filter here
 *   }
 * })
 * 
**/
deleteMany<T extends UserCredentialDeleteManyArgs>(
  args?: SelectSubset<T, UserCredentialDeleteManyArgs>
): Prisma.PrismaPromise<BatchPayload>

/**
 * Update zero or more UserCredentials.
 * Note, that providing `undefined` is treated as the value not being there.
 * Read more here: https://pris.ly/d/null-undefined
 * @param {UserCredentialUpdateManyArgs} args - Arguments to update one or more rows.
 * @example
 * // Update many UserCredentials
 * const userCredential = await prisma.userCredential.updateMany({
 *   where: {
 *     // ... provide filter here
 *   },
 *   data: {
 *     // ... provide data here
 *   }
 * })
 * 
**/
updateMany<T extends UserCredentialUpdateManyArgs>(
  args: SelectSubset<T, UserCredentialUpdateManyArgs>
): Prisma.PrismaPromise<BatchPayload>

/**
 * Create or update one UserCredential.
 * @param {UserCredentialUpsertArgs} args - Arguments to update or create a UserCredential.
 * @example
 * // Update or create a UserCredential
 * const userCredential = await prisma.userCredential.upsert({
 *   create: {
 *     // ... data to create a UserCredential
 *   },
 *   update: {
 *     // ... in case it already exists, update
 *   },
 *   where: {
 *     // ... the filter for the UserCredential we want to update
 *   }
 * })
**/
upsert<T extends UserCredentialUpsertArgs>(
  args: SelectSubset<T, UserCredentialUpsertArgs>
): Prisma__UserCredentialClient<UserCredentialGetPayload<T>>

/**
 * Count the number of UserCredentials.
 * Note, that providing `undefined` is treated as the value not being there.
 * Read more here: https://pris.ly/d/null-undefined
 * @param {UserCredentialCountArgs} args - Arguments to filter UserCredentials to count.
 * @example
 * // Count the number of UserCredentials
 * const count = await prisma.userCredential.count({
 *   where: {
 *     // ... the filter for the UserCredentials we want to count
 *   }
 * })
**/
count<T extends UserCredentialCountArgs>(
  args?: Subset<T, UserCredentialCountArgs>,
): Prisma.PrismaPromise<
  T extends _Record<'select', any>
    ? T['select'] extends true
      ? number
      : GetScalarType<T['select'], UserCredentialCountAggregateOutputType>
    : number
>

/**
 * Allows you to perform aggregations operations on a UserCredential.
 * Note, that providing `undefined` is treated as the value not being there.
 * Read more here: https://pris.ly/d/null-undefined
 * @param {UserCredentialAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
 * @example
 * // Ordered by age ascending
 * // Where email contains prisma.io
 * // Limited to the 10 users
 * const aggregations = await prisma.user.aggregate({
 *   _avg: {
 *     age: true,
 *   },
 *   where: {
 *     email: {
 *       contains: "prisma.io",
 *     },
 *   },
 *   orderBy: {
 *     age: "asc",
 *   },
 *   take: 10,
 * })
**/
aggregate<T extends UserCredentialAggregateArgs>(args: Subset<T, UserCredentialAggregateArgs>): Prisma.PrismaPromise<GetUserCredentialAggregateType<T>>

/**
 * Group by UserCredential.
 * Note, that providing `undefined` is treated as the value not being there.
 * Read more here: https://pris.ly/d/null-undefined
 * @param {UserCredentialGroupByArgs} args - Group by arguments.
 * @example
 * // Group by city, order by createdAt, get count
 * const result = await prisma.user.groupBy({
 *   by: ['city', 'createdAt'],
 *   orderBy: {
 *     createdAt: true
 *   },
 *   _count: {
 *     _all: true
 *   },
 * })
 * 
**/
groupBy<
  T extends UserCredentialGroupByArgs,
  HasSelectOrTake extends Or<
    Extends<'skip', Keys<T>>,
    Extends<'take', Keys<T>>
  >,
  OrderByArg extends True extends HasSelectOrTake
    ? { orderBy: UserCredentialGroupByArgs['orderBy'] }
    : { orderBy?: UserCredentialGroupByArgs['orderBy'] },
  OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
  ByFields extends TupleToUnion<T['by']>,
  ByValid extends Has<ByFields, OrderFields>,
  HavingFields extends GetHavingFields<T['having']>,
  HavingValid extends Has<ByFields, HavingFields>,
  ByEmpty extends T['by'] extends never[] ? True : False,
  InputErrors extends ByEmpty extends True
  ? `Error: "by" must not be empty.`
  : HavingValid extends False
  ? {
      [P in HavingFields]: P extends ByFields
        ? never
        : P extends string
        ? `Error: Field "${P}" used in "having" needs to be provided in "by".`
        : [
            Error,
            'Field ',
            P,
            ` in "having" needs to be provided in "by"`,
          ]
    }[HavingFields]
  : 'take' extends Keys<T>
  ? 'orderBy' extends Keys<T>
    ? ByValid extends True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    : 'Error: If you provide "take", you also need to provide "orderBy"'
  : 'skip' extends Keys<T>
  ? 'orderBy' extends Keys<T>
    ? ByValid extends True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    : 'Error: If you provide "skip", you also need to provide "orderBy"'
  : ByValid extends True
  ? {}
  : {
      [P in OrderFields]: P extends ByFields
        ? never
        : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
    }[OrderFields]
>(args: SubsetIntersection<T, UserCredentialGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetUserCredentialGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>

}

/**

  • The delegate class that acts as a "Promise-like" for UserCredential.
  • Why is this prefixed with Prisma__?
  • Because we want to prevent naming conflicts as mentioned in
  • Adapt a more conflict resistant naming for Prisma client's types prisma/prisma-client-js#707
    */
    export class Prisma__UserCredentialClient<T, Null = never> implements Prisma.PrismaPromise {
    private readonly _dmmf;
    private readonly _queryType;
    private readonly _rootField;
    private readonly _clientMethod;
    private readonly _args;
    private readonly _dataPath;
    private readonly _errorFormat;
    private readonly _measurePerformance?;
    private _isList;
    private _callsite;
    private _requestPromise?;
    readonly [Symbol.toStringTag]: 'PrismaPromise';
    constructor(_dmmf: runtime.DMMFClass, _queryType: 'query' | 'mutation', _rootField: string, _clientMethod: string, _args: any, _dataPath: string[], _errorFormat: ErrorFormat, _measurePerformance?: boolean | undefined, _isList?: boolean);
user<T extends UserArgs= {}>(args?: Subset<T, UserArgs>): Prisma__UserClient<UserGetPayload<T> | Null>;

private get _document();
/**
 * Attaches callbacks for the resolution and/or rejection of the Promise.
 * @param onfulfilled The callback to execute when the Promise is resolved.
 * @param onrejected The callback to execute when the Promise is rejected.
 * @returns A Promise for the completion of which ever callback is executed.
 */
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
/**
 * Attaches a callback for only the rejection of the Promise.
 * @param onrejected The callback to execute when the Promise is rejected.
 * @returns A Promise for the completion of the callback.
 */
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
/**
 * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
 * resolved value cannot be modified from the callback.
 * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
 * @returns A Promise for the completion of the callback.
 */
finally(onfinally?: (() => void) | undefined | null): Promise<T>;

}

// Custom InputTypes

/**

  • UserCredential base type for findUnique actions
    /
    export type UserCredentialFindUniqueArgsBase = {
    /
    *
    • Select specific fields to fetch from the UserCredential
      /
      select?: UserCredentialSelect | null
      /
      *
    • Choose, which related nodes to fetch as well.
      /
      include?: UserCredentialInclude | null
      /
      *
    • Filter, which UserCredential to fetch.
      */
      where: UserCredentialWhereUniqueInput
      }

/**

  • UserCredential findUnique
    /
    export interface UserCredentialFindUniqueArgs extends UserCredentialFindUniqueArgsBase {
    /
    *
    * Throw an Error if query returns no results
    * @deprecated since 4.0.0: use findUniqueOrThrow method instead
    */
    rejectOnNotFound?: RejectOnNotFound
    }

/**

  • UserCredential findUniqueOrThrow
    /
    export type UserCredentialFindUniqueOrThrowArgs = {
    /
    *
    • Select specific fields to fetch from the UserCredential
      /
      select?: UserCredentialSelect | null
      /
      *
    • Choose, which related nodes to fetch as well.
      /
      include?: UserCredentialInclude | null
      /
      *
    • Filter, which UserCredential to fetch.
      */
      where: UserCredentialWhereUniqueInput
      }

/**

/**

  • UserCredential findFirst
    /
    export interface UserCredentialFindFirstArgs extends UserCredentialFindFirstArgsBase {
    /
    *
    * Throw an Error if query returns no results
    * @deprecated since 4.0.0: use findFirstOrThrow method instead
    */
    rejectOnNotFound?: RejectOnNotFound
    }

/**

/**

/**

  • UserCredential create
    /
    export type UserCredentialCreateArgs = {
    /
    *
    • Select specific fields to fetch from the UserCredential
      /
      select?: UserCredentialSelect | null
      /
      *
    • Choose, which related nodes to fetch as well.
      /
      include?: UserCredentialInclude | null
      /
      *
    • The data needed to create a UserCredential.
      */
      data: XOR<UserCredentialCreateInput, UserCredentialUncheckedCreateInput>
      }

/**

  • UserCredential createMany
    /
    export type UserCredentialCreateManyArgs = {
    /
    *
    • The data used to create many UserCredentials.
      */
      data: Enumerable
      skipDuplicates?: boolean
      }

/**

  • UserCredential update
    /
    export type UserCredentialUpdateArgs = {
    /
    *
    • Select specific fields to fetch from the UserCredential
      /
      select?: UserCredentialSelect | null
      /
      *
    • Choose, which related nodes to fetch as well.
      /
      include?: UserCredentialInclude | null
      /
      *
    • The data needed to update a UserCredential.
      /
      data: XOR<UserCredentialUpdateInput, UserCredentialUncheckedUpdateInput>
      /
      *
    • Choose, which UserCredential to update.
      */
      where: UserCredentialWhereUniqueInput
      }

/**

  • UserCredential updateMany
    /
    export type UserCredentialUpdateManyArgs = {
    /
    *
    • The data used to update UserCredentials.
      /
      data: XOR<UserCredentialUpdateManyMutationInput, UserCredentialUncheckedUpdateManyInput>
      /
      *
    • Filter which UserCredentials to update
      */
      where?: UserCredentialWhereInput
      }

/**

  • UserCredential upsert
    /
    export type UserCredentialUpsertArgs = {
    /
    *
    • Select specific fields to fetch from the UserCredential
      /
      select?: UserCredentialSelect | null
      /
      *
    • Choose, which related nodes to fetch as well.
      /
      include?: UserCredentialInclude | null
      /
      *
    • The filter to search for the UserCredential to update in case it exists.
      /
      where: UserCredentialWhereUniqueInput
      /
      *
    • In case the UserCredential found by the where argument doesn't exist, create a new UserCredential with this data.
      /
      create: XOR<UserCredentialCreateInput, UserCredentialUncheckedCreateInput>
      /
      *
    • In case the UserCredential was found with the provided where argument, update it with this data.
      */
      update: XOR<UserCredentialUpdateInput, UserCredentialUncheckedUpdateInput>
      }

/**

  • UserCredential delete
    /
    export type UserCredentialDeleteArgs = {
    /
    *
    • Select specific fields to fetch from the UserCredential
      /
      select?: UserCredentialSelect | null
      /
      *
    • Choose, which related nodes to fetch as well.
      /
      include?: UserCredentialInclude | null
      /
      *
    • Filter which UserCredential to delete.
      */
      where: UserCredentialWhereUniqueInput
      }

/**

  • UserCredential deleteMany
    /
    export type UserCredentialDeleteManyArgs = {
    /
    *
    • Filter which UserCredentials to delete
      */
      where?: UserCredentialWhereInput
      }

/**

  • UserCredential without action
    /
    export type UserCredentialArgs = {
    /
    *
    • Select specific fields to fetch from the UserCredential
      /
      select?: UserCredentialSelect | null
      /
      *
    • Choose, which related nodes to fetch as well.
      */
      include?: UserCredentialInclude | null
      }

/**

  • Model League
    */

export type AggregateLeague = {
_count: LeagueCountAggregateOutputType | null
_avg: LeagueAvgAggregateOutputType | null
_sum: LeagueSumAggregateOutputType | null
_min: LeagueMinAggregateOutputType | null
_max: LeagueMaxAggregateOutputType | null
}

export type LeagueAvgAggregateOutputType = {
id: number | null
}

export type LeagueSumAggregateOutputType = {
id: number | null
}

export type LeagueMinAggregateOutputType = {
id: number | null
name: string | null
description: string | null
}

export type LeagueMaxAggregateOutputType = {
id: number | null
name: string | null
description: string | null
}

export type LeagueCountAggregateOutputType = {
id: number
name: number
description: number
sport: number
_all: number
}

export type LeagueAvgAggregateInputType = {
id?: true
}

export type LeagueSumAggregateInputType = {
id?: true
}

export type LeagueMinAggregateInputType = {
id?: true
name?: true
description?: true
}

export type LeagueMaxAggregateInputType = {
id?: true
name?: true
description?: true
}

export type LeagueCountAggregateInputType = {
id?: true
name?: true
description?: true
sport?: true
_all?: true
}

export type LeagueAggregateArgs = {
/**
* Filter which League to aggregate.
/
where?: LeagueWhereInput
/
*
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
*
* Determine the order of Leagues to fetch.
/
orderBy?: Enumerable
/
*
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
*
* Sets the start position
/
cursor?: LeagueWhereUniqueInput
/
*
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
*
* Take ±n Leagues from the position of the cursor.
/
take?: number
/
*
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
*
* Skip the first n Leagues.
/
skip?: number
/
*
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Count returned Leagues
/
_count?: true | LeagueCountAggregateInputType
/

* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Select which fields to average
/
_avg?: LeagueAvgAggregateInputType
/

* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Select which fields to sum
/
_sum?: LeagueSumAggregateInputType
/

* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Select which fields to find the minimum value
/
_min?: LeagueMinAggregateInputType
/

* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Select which fields to find the maximum value
**/
_max?: LeagueMaxAggregateInputType
}

export type GetLeagueAggregateType = {
[P in keyof T & keyof AggregateLeague]: P extends '_count' | 'count'
? T[P] extends true
? number
: GetScalarType<T[P], AggregateLeague[P]>
: GetScalarType<T[P], AggregateLeague[P]>
}

export type LeagueGroupByArgs = {
where?: LeagueWhereInput
orderBy?: Enumerable
by: LeagueScalarFieldEnum[]
having?: LeagueScalarWhereWithAggregatesInput
take?: number
skip?: number
_count?: LeagueCountAggregateInputType | true
_avg?: LeagueAvgAggregateInputType
_sum?: LeagueSumAggregateInputType
_min?: LeagueMinAggregateInputType
_max?: LeagueMaxAggregateInputType
}

export type LeagueGroupByOutputType = {
id: number
name: string
description: string
sport: Sport[]
_count: LeagueCountAggregateOutputType | null
_avg: LeagueAvgAggregateOutputType | null
_sum: LeagueSumAggregateOutputType | null
_min: LeagueMinAggregateOutputType | null
_max: LeagueMaxAggregateOutputType | null
}

type GetLeagueGroupByPayload = Prisma.PrismaPromise<
Array<
PickArray<LeagueGroupByOutputType, T['by']> &
{
[P in ((keyof T) & (keyof LeagueGroupByOutputType))]: P extends '_count'
? T[P] extends boolean
? number
: GetScalarType<T[P], LeagueGroupByOutputType[P]>
: GetScalarType<T[P], LeagueGroupByOutputType[P]>
}
>
>

export type LeagueSelect = {
id?: boolean
name?: boolean
description?: boolean
sport?: boolean
}

export type LeagueGetPayload<S extends boolean | null | undefined | LeagueArgs> =
S extends { select: any, include: any } ? 'Please either choose select or include' :
S extends true ? League :
S extends undefined ? never :
S extends { include: any } & (LeagueArgs | LeagueFindManyArgs)
? League
: S extends { select: any } & (LeagueArgs | LeagueFindManyArgs)
? {
[P in TruthyKeys<S['select']>]:
P extends keyof League ? League[P] : never
}
: League

type LeagueCountArgs =
Omit<LeagueFindManyArgs, 'select' | 'include'> & {
select?: LeagueCountAggregateInputType | true
}

export interface LeagueDelegate<GlobalRejectSettings extends Prisma.RejectOnNotFound | Prisma.RejectPerOperation | false | undefined> {

/**
 * Find zero or one League that matches the filter.
 * @param {LeagueFindUniqueArgs} args - Arguments to find a League
 * @example
 * // Get one League
 * const league = await prisma.league.findUnique({
 *   where: {
 *     // ... provide filter here
 *   }
 * })
**/
findUnique<T extends LeagueFindUniqueArgs,  LocalRejectSettings = T["rejectOnNotFound"] extends RejectOnNotFound ? T['rejectOnNotFound'] : undefined>(
  args: SelectSubset<T, LeagueFindUniqueArgs>
): HasReject<GlobalRejectSettings, LocalRejectSettings, 'findUnique', 'League'> extends True ? Prisma__LeagueClient<LeagueGetPayload<T>> : Prisma__LeagueClient<LeagueGetPayload<T> | null, null>

/**
 * Find one League that matches the filter or throw an error  with `error.code='P2025'` 
 *     if no matches were found.
 * @param {LeagueFindUniqueOrThrowArgs} args - Arguments to find a League
 * @example
 * // Get one League
 * const league = await prisma.league.findUniqueOrThrow({
 *   where: {
 *     // ... provide filter here
 *   }
 * })
**/
findUniqueOrThrow<T extends LeagueFindUniqueOrThrowArgs>(
  args?: SelectSubset<T, LeagueFindUniqueOrThrowArgs>
): Prisma__LeagueClient<LeagueGetPayload<T>>

/**
 * Find the first League that matches the filter.
 * Note, that providing `undefined` is treated as the value not being there.
 * Read more here: https://pris.ly/d/null-undefined
 * @param {LeagueFindFirstArgs} args - Arguments to find a League
 * @example
 * // Get one League
 * const league = await prisma.league.findFirst({
 *   where: {
 *     // ... provide filter here
 *   }
 * })
**/
findFirst<T extends LeagueFindFirstArgs,  LocalRejectSettings = T["rejectOnNotFound"] extends RejectOnNotFound ? T['rejectOnNotFound'] : undefined>(
  args?: SelectSubset<T, LeagueFindFirstArgs>
): HasReject<GlobalRejectSettings, LocalRejectSettings, 'findFirst', 'League'> extends True ? Prisma__LeagueClient<LeagueGetPayload<T>> : Prisma__LeagueClient<LeagueGetPayload<T> | null, null>

/**
 * Find the first League that matches the filter or
 * throw `NotFoundError` if no matches were found.
 * Note, that providing `undefined` is treated as the value not being there.
 * Read more here: https://pris.ly/d/null-undefined
 * @param {LeagueFindFirstOrThrowArgs} args - Arguments to find a League
 * @example
 * // Get one League
 * const league = await prisma.league.findFirstOrThrow({
 *   where: {
 *     // ... provide filter here
 *   }
 * })
**/
findFirstOrThrow<T extends LeagueFindFirstOrThrowArgs>(
  args?: SelectSubset<T, LeagueFindFirstOrThrowArgs>
): Prisma__LeagueClient<LeagueGetPayload<T>>

/**
 * Find zero or more Leagues that matches the filter.
 * Note, that providing `undefined` is treated as the value not being there.
 * Read more here: https://pris.ly/d/null-undefined
 * @param {LeagueFindManyArgs=} args - Arguments to filter and select certain fields only.
 * @example
 * // Get all Leagues
 * const leagues = await prisma.league.findMany()
 * 
 * // Get first 10 Leagues
 * const leagues = await prisma.league.findMany({ take: 10 })
 * 
 * // Only select the `id`
 * const leagueWithIdOnly = await prisma.league.findMany({ select: { id: true } })
 * 
**/
findMany<T extends LeagueFindManyArgs>(
  args?: SelectSubset<T, LeagueFindManyArgs>
): Prisma.PrismaPromise<Array<LeagueGetPayload<T>>>

/**
 * Create a League.
 * @param {LeagueCreateArgs} args - Arguments to create a League.
 * @example
 * // Create one League
 * const League = await prisma.league.create({
 *   data: {
 *     // ... data to create a League
 *   }
 * })
 * 
**/
create<T extends LeagueCreateArgs>(
  args: SelectSubset<T, LeagueCreateArgs>
): Prisma__LeagueClient<LeagueGetPayload<T>>

/**
 * Create many Leagues.
 *     @param {LeagueCreateManyArgs} args - Arguments to create many Leagues.
 *     @example
 *     // Create many Leagues
 *     const league = await prisma.league.createMany({
 *       data: {
 *         // ... provide data here
 *       }
 *     })
 *     
**/
createMany<T extends LeagueCreateManyArgs>(
  args?: SelectSubset<T, LeagueCreateManyArgs>
): Prisma.PrismaPromise<BatchPayload>

/**
 * Delete a League.
 * @param {LeagueDeleteArgs} args - Arguments to delete one League.
 * @example
 * // Delete one League
 * const League = await prisma.league.delete({
 *   where: {
 *     // ... filter to delete one League
 *   }
 * })
 * 
**/
delete<T extends LeagueDeleteArgs>(
  args: SelectSubset<T, LeagueDeleteArgs>
): Prisma__LeagueClient<LeagueGetPayload<T>>

/**
 * Update one League.
 * @param {LeagueUpdateArgs} args - Arguments to update one League.
 * @example
 * // Update one League
 * const league = await prisma.league.update({
 *   where: {
 *     // ... provide filter here
 *   },
 *   data: {
 *     // ... provide data here
 *   }
 * })
 * 
**/
update<T extends LeagueUpdateArgs>(
  args: SelectSubset<T, LeagueUpdateArgs>
): Prisma__LeagueClient<LeagueGetPayload<T>>

/**
 * Delete zero or more Leagues.
 * @param {LeagueDeleteManyArgs} args - Arguments to filter Leagues to delete.
 * @example
 * // Delete a few Leagues
 * const { count } = await prisma.league.deleteMany({
 *   where: {
 *     // ... provide filter here
 *   }
 * })
 * 
**/
deleteMany<T extends LeagueDeleteManyArgs>(
  args?: SelectSubset<T, LeagueDeleteManyArgs>
): Prisma.PrismaPromise<BatchPayload>

/**
 * Update zero or more Leagues.
 * Note, that providing `undefined` is treated as the value not being there.
 * Read more here: https://pris.ly/d/null-undefined
 * @param {LeagueUpdateManyArgs} args - Arguments to update one or more rows.
 * @example
 * // Update many Leagues
 * const league = await prisma.league.updateMany({
 *   where: {
 *     // ... provide filter here
 *   },
 *   data: {
 *     // ... provide data here
 *   }
 * })
 * 
**/
updateMany<T extends LeagueUpdateManyArgs>(
  args: SelectSubset<T, LeagueUpdateManyArgs>
): Prisma.PrismaPromise<BatchPayload>

/**
 * Create or update one League.
 * @param {LeagueUpsertArgs} args - Arguments to update or create a League.
 * @example
 * // Update or create a League
 * const league = await prisma.league.upsert({
 *   create: {
 *     // ... data to create a League
 *   },
 *   update: {
 *     // ... in case it already exists, update
 *   },
 *   where: {
 *     // ... the filter for the League we want to update
 *   }
 * })
**/
upsert<T extends LeagueUpsertArgs>(
  args: SelectSubset<T, LeagueUpsertArgs>
): Prisma__LeagueClient<LeagueGetPayload<T>>

/**
 * Count the number of Leagues.
 * Note, that providing `undefined` is treated as the value not being there.
 * Read more here: https://pris.ly/d/null-undefined
 * @param {LeagueCountArgs} args - Arguments to filter Leagues to count.
 * @example
 * // Count the number of Leagues
 * const count = await prisma.league.count({
 *   where: {
 *     // ... the filter for the Leagues we want to count
 *   }
 * })
**/
count<T extends LeagueCountArgs>(
  args?: Subset<T, LeagueCountArgs>,
): Prisma.PrismaPromise<
  T extends _Record<'select', any>
    ? T['select'] extends true
      ? number
      : GetScalarType<T['select'], LeagueCountAggregateOutputType>
    : number
>

/**
 * Allows you to perform aggregations operations on a League.
 * Note, that providing `undefined` is treated as the value not being there.
 * Read more here: https://pris.ly/d/null-undefined
 * @param {LeagueAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
 * @example
 * // Ordered by age ascending
 * // Where email contains prisma.io
 * // Limited to the 10 users
 * const aggregations = await prisma.user.aggregate({
 *   _avg: {
 *     age: true,
 *   },
 *   where: {
 *     email: {
 *       contains: "prisma.io",
 *     },
 *   },
 *   orderBy: {
 *     age: "asc",
 *   },
 *   take: 10,
 * })
**/
aggregate<T extends LeagueAggregateArgs>(args: Subset<T, LeagueAggregateArgs>): Prisma.PrismaPromise<GetLeagueAggregateType<T>>

/**
 * Group by League.
 * Note, that providing `undefined` is treated as the value not being there.
 * Read more here: https://pris.ly/d/null-undefined
 * @param {LeagueGroupByArgs} args - Group by arguments.
 * @example
 * // Group by city, order by createdAt, get count
 * const result = await prisma.user.groupBy({
 *   by: ['city', 'createdAt'],
 *   orderBy: {
 *     createdAt: true
 *   },
 *   _count: {
 *     _all: true
 *   },
 * })
 * 
**/
groupBy<
  T extends LeagueGroupByArgs,
  HasSelectOrTake extends Or<
    Extends<'skip', Keys<T>>,
    Extends<'take', Keys<T>>
  >,
  OrderByArg extends True extends HasSelectOrTake
    ? { orderBy: LeagueGroupByArgs['orderBy'] }
    : { orderBy?: LeagueGroupByArgs['orderBy'] },
  OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
  ByFields extends TupleToUnion<T['by']>,
  ByValid extends Has<ByFields, OrderFields>,
  HavingFields extends GetHavingFields<T['having']>,
  HavingValid extends Has<ByFields, HavingFields>,
  ByEmpty extends T['by'] extends never[] ? True : False,
  InputErrors extends ByEmpty extends True
  ? `Error: "by" must not be empty.`
  : HavingValid extends False
  ? {
      [P in HavingFields]: P extends ByFields
        ? never
        : P extends string
        ? `Error: Field "${P}" used in "having" needs to be provided in "by".`
        : [
            Error,
            'Field ',
            P,
            ` in "having" needs to be provided in "by"`,
          ]
    }[HavingFields]
  : 'take' extends Keys<T>
  ? 'orderBy' extends Keys<T>
    ? ByValid extends True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    : 'Error: If you provide "take", you also need to provide "orderBy"'
  : 'skip' extends Keys<T>
  ? 'orderBy' extends Keys<T>
    ? ByValid extends True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    : 'Error: If you provide "skip", you also need to provide "orderBy"'
  : ByValid extends True
  ? {}
  : {
      [P in OrderFields]: P extends ByFields
        ? never
        : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
    }[OrderFields]
>(args: SubsetIntersection<T, LeagueGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetLeagueGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>

}

/**

  • The delegate class that acts as a "Promise-like" for League.
  • Why is this prefixed with Prisma__?
  • Because we want to prevent naming conflicts as mentioned in
  • Adapt a more conflict resistant naming for Prisma client's types prisma/prisma-client-js#707
    */
    export class Prisma__LeagueClient<T, Null = never> implements Prisma.PrismaPromise {
    private readonly _dmmf;
    private readonly _queryType;
    private readonly _rootField;
    private readonly _clientMethod;
    private readonly _args;
    private readonly _dataPath;
    private readonly _errorFormat;
    private readonly _measurePerformance?;
    private _isList;
    private _callsite;
    private _requestPromise?;
    readonly [Symbol.toStringTag]: 'PrismaPromise';
    constructor(_dmmf: runtime.DMMFClass, _queryType: 'query' | 'mutation', _rootField: string, _clientMethod: string, _args: any, _dataPath: string[], _errorFormat: ErrorFormat, _measurePerformance?: boolean | undefined, _isList?: boolean);
private get _document();
/**
 * Attaches callbacks for the resolution and/or rejection of the Promise.
 * @param onfulfilled The callback to execute when the Promise is resolved.
 * @param onrejected The callback to execute when the Promise is rejected.
 * @returns A Promise for the completion of which ever callback is executed.
 */
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
/**
 * Attaches a callback for only the rejection of the Promise.
 * @param onrejected The callback to execute when the Promise is rejected.
 * @returns A Promise for the completion of the callback.
 */
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
/**
 * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
 * resolved value cannot be modified from the callback.
 * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
 * @returns A Promise for the completion of the callback.
 */
finally(onfinally?: (() => void) | undefined | null): Promise<T>;

}

// Custom InputTypes

/**

  • League base type for findUnique actions
    /
    export type LeagueFindUniqueArgsBase = {
    /
    *
    • Select specific fields to fetch from the League
      /
      select?: LeagueSelect | null
      /
      *
    • Filter, which League to fetch.
      */
      where: LeagueWhereUniqueInput
      }

/**

  • League findUnique
    /
    export interface LeagueFindUniqueArgs extends LeagueFindUniqueArgsBase {
    /
    *
    * Throw an Error if query returns no results
    * @deprecated since 4.0.0: use findUniqueOrThrow method instead
    */
    rejectOnNotFound?: RejectOnNotFound
    }

/**

  • League findUniqueOrThrow
    /
    export type LeagueFindUniqueOrThrowArgs = {
    /
    *
    • Select specific fields to fetch from the League
      /
      select?: LeagueSelect | null
      /
      *
    • Filter, which League to fetch.
      */
      where: LeagueWhereUniqueInput
      }

/**

/**

  • League findFirst
    /
    export interface LeagueFindFirstArgs extends LeagueFindFirstArgsBase {
    /
    *
    * Throw an Error if query returns no results
    * @deprecated since 4.0.0: use findFirstOrThrow method instead
    */
    rejectOnNotFound?: RejectOnNotFound
    }

/**

/**

/**

  • League create
    /
    export type LeagueCreateArgs = {
    /
    *
    • Select specific fields to fetch from the League
      /
      select?: LeagueSelect | null
      /
      *
    • The data needed to create a League.
      */
      data: XOR<LeagueCreateInput, LeagueUncheckedCreateInput>
      }

/**

  • League createMany
    /
    export type LeagueCreateManyArgs = {
    /
    *
    • The data used to create many Leagues.
      */
      data: Enumerable
      skipDuplicates?: boolean
      }

/**

  • League update
    /
    export type LeagueUpdateArgs = {
    /
    *
    • Select specific fields to fetch from the League
      /
      select?: LeagueSelect | null
      /
      *
    • The data needed to update a League.
      /
      data: XOR<LeagueUpdateInput, LeagueUncheckedUpdateInput>
      /
      *
    • Choose, which League to update.
      */
      where: LeagueWhereUniqueInput
      }

/**

  • League updateMany
    /
    export type LeagueUpdateManyArgs = {
    /
    *
    • The data used to update Leagues.
      /
      data: XOR<LeagueUpdateManyMutationInput, LeagueUncheckedUpdateManyInput>
      /
      *
    • Filter which Leagues to update
      */
      where?: LeagueWhereInput
      }

/**

  • League upsert
    /
    export type LeagueUpsertArgs = {
    /
    *
    • Select specific fields to fetch from the League
      /
      select?: LeagueSelect | null
      /
      *
    • The filter to search for the League to update in case it exists.
      /
      where: LeagueWhereUniqueInput
      /
      *
    • In case the League found by the where argument doesn't exist, create a new League with this data.
      /
      create: XOR<LeagueCreateInput, LeagueUncheckedCreateInput>
      /
      *
    • In case the League was found with the provided where argument, update it with this data.
      */
      update: XOR<LeagueUpdateInput, LeagueUncheckedUpdateInput>
      }

/**

  • League delete
    /
    export type LeagueDeleteArgs = {
    /
    *
    • Select specific fields to fetch from the League
      /
      select?: LeagueSelect | null
      /
      *
    • Filter which League to delete.
      */
      where: LeagueWhereUniqueInput
      }

/**

  • League deleteMany
    /
    export type LeagueDeleteManyArgs = {
    /
    *
    • Filter which Leagues to delete
      */
      where?: LeagueWhereInput
      }

/**

  • League without action
    /
    export type LeagueArgs = {
    /
    *
    • Select specific fields to fetch from the League
      */
      select?: LeagueSelect | null
      }

/**

  • Enums
    */

// Based on
// microsoft/TypeScript#3192 (comment)

export const LeagueScalarFieldEnum: {
id: 'id',
name: 'name',
description: 'description',
sport: 'sport'
};

export type LeagueScalarFieldEnum = (typeof LeagueScalarFieldEnum)[keyof typeof LeagueScalarFieldEnum]

export const QueryMode: {
default: 'default',
insensitive: 'insensitive'
};

export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode]

export const SortOrder: {
asc: 'asc',
desc: 'desc'
};

export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder]

export const TransactionIsolationLevel: {
ReadUncommitted: 'ReadUncommitted',
ReadCommitted: 'ReadCommitted',
RepeatableRead: 'RepeatableRead',
Serializable: 'Serializable'
};

export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel]

export const UserCredentialScalarFieldEnum: {
id: 'id',
userId: 'userId',
publicKey: 'publicKey',
transports: 'transports',
counter: 'counter'
};

export type UserCredentialScalarFieldEnum = (typeof UserCredentialScalarFieldEnum)[keyof typeof UserCredentialScalarFieldEnum]

export const UserScalarFieldEnum: {
id: 'id',
username: 'username',
email: 'email',
hashedPassword: 'hashedPassword',
salt: 'salt',
resetToken: 'resetToken',
resetTokenExpiresAt: 'resetTokenExpiresAt',
webAuthnChallenge: 'webAuthnChallenge'
};

export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum]

/**

  • Deep Input Types
    */

export type UserWhereInput = {
AND?: Enumerable
OR?: Enumerable
NOT?: Enumerable
id?: IntFilter | number
username?: StringFilter | string
email?: StringFilter | string
hashedPassword?: StringFilter | string
salt?: StringFilter | string
resetToken?: StringNullableFilter | string | null
resetTokenExpiresAt?: DateTimeNullableFilter | Date | string | null
webAuthnChallenge?: StringNullableFilter | string | null
credentials?: UserCredentialListRelationFilter
}

export type UserOrderByWithRelationInput = {
id?: SortOrder
username?: SortOrder
email?: SortOrder
hashedPassword?: SortOrder
salt?: SortOrder
resetToken?: SortOrder
resetTokenExpiresAt?: SortOrder
webAuthnChallenge?: SortOrder
credentials?: UserCredentialOrderByRelationAggregateInput
}

export type UserWhereUniqueInput = {
id?: number
username?: string
email?: string
webAuthnChallenge?: string
}

export type UserOrderByWithAggregationInput = {
id?: SortOrder
username?: SortOrder
email?: SortOrder
hashedPassword?: SortOrder
salt?: SortOrder
resetToken?: SortOrder
resetTokenExpiresAt?: SortOrder
webAuthnChallenge?: SortOrder
_count?: UserCountOrderByAggregateInput
_avg?: UserAvgOrderByAggregateInput
_max?: UserMaxOrderByAggregateInput
_min?: UserMinOrderByAggregateInput
_sum?: UserSumOrderByAggregateInput
}

export type UserScalarWhereWithAggregatesInput = {
AND?: Enumerable
OR?: Enumerable
NOT?: Enumerable
id?: IntWithAggregatesFilter | number
username?: StringWithAggregatesFilter | string
email?: StringWithAggregatesFilter | string
hashedPassword?: StringWithAggregatesFilter | string
salt?: StringWithAggregatesFilter | string
resetToken?: StringNullableWithAggregatesFilter | string | null
resetTokenExpiresAt?: DateTimeNullableWithAggregatesFilter | Date | string | null
webAuthnChallenge?: StringNullableWithAggregatesFilter | string | null
}

export type UserCredentialWhereInput = {
AND?: Enumerable
OR?: Enumerable
NOT?: Enumerable
id?: StringFilter | string
userId?: IntFilter | number
publicKey?: BytesFilter | Buffer
transports?: StringNullableFilter | string | null
counter?: BigIntFilter | bigint | number
user?: XOR<UserRelationFilter, UserWhereInput>
}

export type UserCredentialOrderByWithRelationInput = {
id?: SortOrder
userId?: SortOrder
publicKey?: SortOrder
transports?: SortOrder
counter?: SortOrder
user?: UserOrderByWithRelationInput
}

export type UserCredentialWhereUniqueInput = {
id?: string
}

export type UserCredentialOrderByWithAggregationInput = {
id?: SortOrder
userId?: SortOrder
publicKey?: SortOrder
transports?: SortOrder
counter?: SortOrder
_count?: UserCredentialCountOrderByAggregateInput
_avg?: UserCredentialAvgOrderByAggregateInput
_max?: UserCredentialMaxOrderByAggregateInput
_min?: UserCredentialMinOrderByAggregateInput
_sum?: UserCredentialSumOrderByAggregateInput
}

export type UserCredentialScalarWhereWithAggregatesInput = {
AND?: Enumerable
OR?: Enumerable
NOT?: Enumerable
id?: StringWithAggregatesFilter | string
userId?: IntWithAggregatesFilter | number
publicKey?: BytesWithAggregatesFilter | Buffer
transports?: StringNullableWithAggregatesFilter | string | null
counter?: BigIntWithAggregatesFilter | bigint | number
}

export type LeagueWhereInput = {
AND?: Enumerable
OR?: Enumerable
NOT?: Enumerable
id?: IntFilter | number
name?: StringFilter | string
description?: StringFilter | string
sport?: EnumSportNullableListFilter
}

export type LeagueOrderByWithRelationInput = {
id?: SortOrder
name?: SortOrder
description?: SortOrder
sport?: SortOrder
}

export type LeagueWhereUniqueInput = {
id?: number
}

export type LeagueOrderByWithAggregationInput = {
id?: SortOrder
name?: SortOrder
description?: SortOrder
sport?: SortOrder
_count?: LeagueCountOrderByAggregateInput
_avg?: LeagueAvgOrderByAggregateInput
_max?: LeagueMaxOrderByAggregateInput
_min?: LeagueMinOrderByAggregateInput
_sum?: LeagueSumOrderByAggregateInput
}

export type LeagueScalarWhereWithAggregatesInput = {
AND?: Enumerable
OR?: Enumerable
NOT?: Enumerable
id?: IntWithAggregatesFilter | number
name?: StringWithAggregatesFilter | string
description?: StringWithAggregatesFilter | string
sport?: EnumSportNullableListFilter
}

export type UserCreateInput = {
username: string
email: string
hashedPassword: string
salt: string
resetToken?: string | null
resetTokenExpiresAt?: Date | string | null
webAuthnChallenge?: string | null
credentials?: UserCredentialCreateNestedManyWithoutUserInput
}

export type UserUncheckedCreateInput = {
id?: number
username: string
email: string
hashedPassword: string
salt: string
resetToken?: string | null
resetTokenExpiresAt?: Date | string | null
webAuthnChallenge?: string | null
credentials?: UserCredentialUncheckedCreateNestedManyWithoutUserInput
}

export type UserUpdateInput = {
username?: StringFieldUpdateOperationsInput | string
email?: StringFieldUpdateOperationsInput | string
hashedPassword?: StringFieldUpdateOperationsInput | string
salt?: StringFieldUpdateOperationsInput | string
resetToken?: NullableStringFieldUpdateOperationsInput | string | null
resetTokenExpiresAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
webAuthnChallenge?: NullableStringFieldUpdateOperationsInput | string | null
credentials?: UserCredentialUpdateManyWithoutUserNestedInput
}

export type UserUncheckedUpdateInput = {
id?: IntFieldUpdateOperationsInput | number
username?: StringFieldUpdateOperationsInput | string
email?: StringFieldUpdateOperationsInput | string
hashedPassword?: StringFieldUpdateOperationsInput | string
salt?: StringFieldUpdateOperationsInput | string
resetToken?: NullableStringFieldUpdateOperationsInput | string | null
resetTokenExpiresAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
webAuthnChallenge?: NullableStringFieldUpdateOperationsInput | string | null
credentials?: UserCredentialUncheckedUpdateManyWithoutUserNestedInput
}

export type UserCreateManyInput = {
id?: number
username: string
email: string
hashedPassword: string
salt: string
resetToken?: string | null
resetTokenExpiresAt?: Date | string | null
webAuthnChallenge?: string | null
}

export type UserUpdateManyMutationInput = {
username?: StringFieldUpdateOperationsInput | string
email?: StringFieldUpdateOperationsInput | string
hashedPassword?: StringFieldUpdateOperationsInput | string
salt?: StringFieldUpdateOperationsInput | string
resetToken?: NullableStringFieldUpdateOperationsInput | string | null
resetTokenExpiresAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
webAuthnChallenge?: NullableStringFieldUpdateOperationsInput | string | null
}

export type UserUncheckedUpdateManyInput = {
id?: IntFieldUpdateOperationsInput | number
username?: StringFieldUpdateOperationsInput | string
email?: StringFieldUpdateOperationsInput | string
hashedPassword?: StringFieldUpdateOperationsInput | string
salt?: StringFieldUpdateOperationsInput | string
resetToken?: NullableStringFieldUpdateOperationsInput | string | null
resetTokenExpiresAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
webAuthnChallenge?: NullableStringFieldUpdateOperationsInput | string | null
}

export type UserCredentialCreateInput = {
id: string
publicKey: Buffer
transports?: string | null
counter: bigint | number
user: UserCreateNestedOneWithoutCredentialsInput
}

export type UserCredentialUncheckedCreateInput = {
id: string
userId: number
publicKey: Buffer
transports?: string | null
counter: bigint | number
}

export type UserCredentialUpdateInput = {
id?: StringFieldUpdateOperationsInput | string
publicKey?: BytesFieldUpdateOperationsInput | Buffer
transports?: NullableStringFieldUpdateOperationsInput | string | null
counter?: BigIntFieldUpdateOperationsInput | bigint | number
user?: UserUpdateOneRequiredWithoutCredentialsNestedInput
}

export type UserCredentialUncheckedUpdateInput = {
id?: StringFieldUpdateOperationsInput | string
userId?: IntFieldUpdateOperationsInput | number
publicKey?: BytesFieldUpdateOperationsInput | Buffer
transports?: NullableStringFieldUpdateOperationsInput | string | null
counter?: BigIntFieldUpdateOperationsInput | bigint | number
}

export type UserCredentialCreateManyInput = {
id: string
userId: number
publicKey: Buffer
transports?: string | null
counter: bigint | number
}

export type UserCredentialUpdateManyMutationInput = {
id?: StringFieldUpdateOperationsInput | string
publicKey?: BytesFieldUpdateOperationsInput | Buffer
transports?: NullableStringFieldUpdateOperationsInput | string | null
counter?: BigIntFieldUpdateOperationsInput | bigint | number
}

export type UserCredentialUncheckedUpdateManyInput = {
id?: StringFieldUpdateOperationsInput | string
userId?: IntFieldUpdateOperationsInput | number
publicKey?: BytesFieldUpdateOperationsInput | Buffer
transports?: NullableStringFieldUpdateOperationsInput | string | null
counter?: BigIntFieldUpdateOperationsInput | bigint | number
}

export type LeagueCreateInput = {
name: string
description: string
sport?: LeagueCreatesportInput | Enumerable
}

export type LeagueUncheckedCreateInput = {
id?: number
name: string
description: string
sport?: LeagueCreatesportInput | Enumerable
}

export type LeagueUpdateInput = {
name?: StringFieldUpdateOperationsInput | string
description?: StringFieldUpdateOperationsInput | string
sport?: LeagueUpdatesportInput | Enumerable
}

export type LeagueUncheckedUpdateInput = {
id?: IntFieldUpdateOperationsInput | number
name?: StringFieldUpdateOperationsInput | string
description?: StringFieldUpdateOperationsInput | string
sport?: LeagueUpdatesportInput | Enumerable
}

export type LeagueCreateManyInput = {
id?: number
name: string
description: string
sport?: LeagueCreatesportInput | Enumerable
}

export type LeagueUpdateManyMutationInput = {
name?: StringFieldUpdateOperationsInput | string
description?: StringFieldUpdateOperationsInput | string
sport?: LeagueUpdatesportInput | Enumerable
}

export type LeagueUncheckedUpdateManyInput = {
id?: IntFieldUpdateOperationsInput | number
name?: StringFieldUpdateOperationsInput | string
description?: StringFieldUpdateOperationsInput | string
sport?: LeagueUpdatesportInput | Enumerable
}

export type IntFilter = {
equals?: number
in?: Enumerable
notIn?: Enumerable
lt?: number
lte?: number
gt?: number
gte?: number
not?: NestedIntFilter | number
}

export type StringFilter = {
equals?: string
in?: Enumerable
notIn?: Enumerable
lt?: string
lte?: string
gt?: string
gte?: string
contains?: string
startsWith?: string
endsWith?: string
mode?: QueryMode
not?: NestedStringFilter | string
}

export type StringNullableFilter = {
equals?: string | null
in?: Enumerable | null
notIn?: Enumerable | null
lt?: string
lte?: string
gt?: string
gte?: string
contains?: string
startsWith?: string
endsWith?: string
mode?: QueryMode
not?: NestedStringNullableFilter | string | null
}

export type DateTimeNullableFilter = {
equals?: Date | string | null
in?: Enumerable | Enumerable | null
notIn?: Enumerable | Enumerable | null
lt?: Date | string
lte?: Date | string
gt?: Date | string
gte?: Date | string
not?: NestedDateTimeNullableFilter | Date | string | null
}

export type UserCredentialListRelationFilter = {
every?: UserCredentialWhereInput
some?: UserCredentialWhereInput
none?: UserCredentialWhereInput
}

export type UserCredentialOrderByRelationAggregateInput = {
_count?: SortOrder
}

export type UserCountOrderByAggregateInput = {
id?: SortOrder
username?: SortOrder
email?: SortOrder
hashedPassword?: SortOrder
salt?: SortOrder
resetToken?: SortOrder
resetTokenExpiresAt?: SortOrder
webAuthnChallenge?: SortOrder
}

export type UserAvgOrderByAggregateInput = {
id?: SortOrder
}

export type UserMaxOrderByAggregateInput = {
id?: SortOrder
username?: SortOrder
email?: SortOrder
hashedPassword?: SortOrder
salt?: SortOrder
resetToken?: SortOrder
resetTokenExpiresAt?: SortOrder
webAuthnChallenge?: SortOrder
}

export type UserMinOrderByAggregateInput = {
id?: SortOrder
username?: SortOrder
email?: SortOrder
hashedPassword?: SortOrder
salt?: SortOrder
resetToken?: SortOrder
resetTokenExpiresAt?: SortOrder
webAuthnChallenge?: SortOrder
}

export type UserSumOrderByAggregateInput = {
id?: SortOrder
}

export type IntWithAggregatesFilter = {
equals?: number
in?: Enumerable
notIn?: Enumerable
lt?: number
lte?: number
gt?: number
gte?: number
not?: NestedIntWithAggregatesFilter | number
_count?: NestedIntFilter
_avg?: NestedFloatFilter
_sum?: NestedIntFilter
_min?: NestedIntFilter
_max?: NestedIntFilter
}

export type StringWithAggregatesFilter = {
equals?: string
in?: Enumerable
notIn?: Enumerable
lt?: string
lte?: string
gt?: string
gte?: string
contains?: string
startsWith?: string
endsWith?: string
mode?: QueryMode
not?: NestedStringWithAggregatesFilter | string
_count?: NestedIntFilter
_min?: NestedStringFilter
_max?: NestedStringFilter
}

export type StringNullableWithAggregatesFilter = {
equals?: string | null
in?: Enumerable | null
notIn?: Enumerable | null
lt?: string
lte?: string
gt?: string
gte?: string
contains?: string
startsWith?: string
endsWith?: string
mode?: QueryMode
not?: NestedStringNullableWithAggregatesFilter | string | null
_count?: NestedIntNullableFilter
_min?: NestedStringNullableFilter
_max?: NestedStringNullableFilter
}

export type DateTimeNullableWithAggregatesFilter = {
equals?: Date | string | null
in?: Enumerable | Enumerable | null
notIn?: Enumerable | Enumerable | null
lt?: Date | string
lte?: Date | string
gt?: Date | string
gte?: Date | string
not?: NestedDateTimeNullableWithAggregatesFilter | Date | string | null
_count?: NestedIntNullableFilter
_min?: NestedDateTimeNullableFilter
_max?: NestedDateTimeNullableFilter
}

export type BytesFilter = {
equals?: Buffer
in?: Enumerable
notIn?: Enumerable
not?: NestedBytesFilter | Buffer
}

export type BigIntFilter = {
equals?: bigint | number
in?: Enumerable | Enumerable
notIn?: Enumerable | Enumerable
lt?: bigint | number
lte?: bigint | number
gt?: bigint | number
gte?: bigint | number
not?: NestedBigIntFilter | bigint | number
}

export type UserRelationFilter = {
is?: UserWhereInput
isNot?: UserWhereInput
}

export type UserCredentialCountOrderByAggregateInput = {
id?: SortOrder
userId?: SortOrder
publicKey?: SortOrder
transports?: SortOrder
counter?: SortOrder
}

export type UserCredentialAvgOrderByAggregateInput = {
userId?: SortOrder
counter?: SortOrder
}

export type UserCredentialMaxOrderByAggregateInput = {
id?: SortOrder
userId?: SortOrder
publicKey?: SortOrder
transports?: SortOrder
counter?: SortOrder
}

export type UserCredentialMinOrderByAggregateInput = {
id?: SortOrder
userId?: SortOrder
publicKey?: SortOrder
transports?: SortOrder
counter?: SortOrder
}

export type UserCredentialSumOrderByAggregateInput = {
userId?: SortOrder
counter?: SortOrder
}

export type BytesWithAggregatesFilter = {
equals?: Buffer
in?: Enumerable
notIn?: Enumerable
not?: NestedBytesWithAggregatesFilter | Buffer
_count?: NestedIntFilter
_min?: NestedBytesFilter
_max?: NestedBytesFilter
}

export type BigIntWithAggregatesFilter = {
equals?: bigint | number
in?: Enumerable | Enumerable
notIn?: Enumerable | Enumerable
lt?: bigint | number
lte?: bigint | number
gt?: bigint | number
gte?: bigint | number
not?: NestedBigIntWithAggregatesFilter | bigint | number
_count?: NestedIntFilter
_avg?: NestedFloatFilter
_sum?: NestedBigIntFilter
_min?: NestedBigIntFilter
_max?: NestedBigIntFilter
}

export type EnumSportNullableListFilter = {
equals?: Enumerable | null
has?: Sport | null
hasEvery?: Enumerable
hasSome?: Enumerable
isEmpty?: boolean
}

export type LeagueCountOrderByAggregateInput = {
id?: SortOrder
name?: SortOrder
description?: SortOrder
sport?: SortOrder
}

export type LeagueAvgOrderByAggregateInput = {
id?: SortOrder
}

export type LeagueMaxOrderByAggregateInput = {
id?: SortOrder
name?: SortOrder
description?: SortOrder
}

export type LeagueMinOrderByAggregateInput = {
id?: SortOrder
name?: SortOrder
description?: SortOrder
}

export type LeagueSumOrderByAggregateInput = {
id?: SortOrder
}

export type UserCredentialCreateNestedManyWithoutUserInput = {
create?: XOR<Enumerable, Enumerable>
connectOrCreate?: Enumerable
createMany?: UserCredentialCreateManyUserInputEnvelope
connect?: Enumerable
}

export type UserCredentialUncheckedCreateNestedManyWithoutUserInput = {
create?: XOR<Enumerable, Enumerable>
connectOrCreate?: Enumerable
createMany?: UserCredentialCreateManyUserInputEnvelope
connect?: Enumerable
}

export type StringFieldUpdateOperationsInput = {
set?: string
}

export type NullableStringFieldUpdateOperationsInput = {
set?: string | null
}

export type NullableDateTimeFieldUpdateOperationsInput = {
set?: Date | string | null
}

export type UserCredentialUpdateManyWithoutUserNestedInput = {
create?: XOR<Enumerable, Enumerable>
connectOrCreate?: Enumerable
upsert?: Enumerable
createMany?: UserCredentialCreateManyUserInputEnvelope
set?: Enumerable
disconnect?: Enumerable
delete?: Enumerable
connect?: Enumerable
update?: Enumerable
updateMany?: Enumerable
deleteMany?: Enumerable
}

export type IntFieldUpdateOperationsInput = {
set?: number
increment?: number
decrement?: number
multiply?: number
divide?: number
}

export type UserCredentialUncheckedUpdateManyWithoutUserNestedInput = {
create?: XOR<Enumerable, Enumerable>
connectOrCreate?: Enumerable
upsert?: Enumerable
createMany?: UserCredentialCreateManyUserInputEnvelope
set?: Enumerable
disconnect?: Enumerable
delete?: Enumerable
connect?: Enumerable
update?: Enumerable
updateMany?: Enumerable
deleteMany?: Enumerable
}

export type UserCreateNestedOneWithoutCredentialsInput = {
create?: XOR<UserCreateWithoutCredentialsInput, UserUncheckedCreateWithoutCredentialsInput>
connectOrCreate?: UserCreateOrConnectWithoutCredentialsInput
connect?: UserWhereUniqueInput
}

export type BytesFieldUpdateOperationsInput = {
set?: Buffer
}

export type BigIntFieldUpdateOperationsInput = {
set?: bigint | number
increment?: bigint | number
decrement?: bigint | number
multiply?: bigint | number
divide?: bigint | number
}

export type UserUpdateOneRequiredWithoutCredentialsNestedInput = {
create?: XOR<UserCreateWithoutCredentialsInput, UserUncheckedCreateWithoutCredentialsInput>
connectOrCreate?: UserCreateOrConnectWithoutCredentialsInput
upsert?: UserUpsertWithoutCredentialsInput
connect?: UserWhereUniqueInput
update?: XOR<UserUpdateWithoutCredentialsInput, UserUncheckedUpdateWithoutCredentialsInput>
}

export type LeagueCreatesportInput = {
set: Enumerable
}

export type LeagueUpdatesportInput = {
set?: Enumerable
push?: Enumerable
}

export type NestedIntFilter = {
equals?: number
in?: Enumerable
notIn?: Enumerable
lt?: number
lte?: number
gt?: number
gte?: number
not?: NestedIntFilter | number
}

export type NestedStringFilter = {
equals?: string
in?: Enumerable
notIn?: Enumerable
lt?: string
lte?: string
gt?: string
gte?: string
contains?: string
startsWith?: string
endsWith?: string
not?: NestedStringFilter | string
}

export type NestedStringNullableFilter = {
equals?: string | null
in?: Enumerable | null
notIn?: Enumerable | null
lt?: string
lte?: string
gt?: string
gte?: string
contains?: string
startsWith?: string
endsWith?: string
not?: NestedStringNullableFilter | string | null
}

export type NestedDateTimeNullableFilter = {
equals?: Date | string | null
in?: Enumerable | Enumerable | null
notIn?: Enumerable | Enumerable | null
lt?: Date | string
lte?: Date | string
gt?: Date | string
gte?: Date | string
not?: NestedDateTimeNullableFilter | Date | string | null
}

export type NestedIntWithAggregatesFilter = {
equals?: number
in?: Enumerable
notIn?: Enumerable
lt?: number
lte?: number
gt?: number
gte?: number
not?: NestedIntWithAggregatesFilter | number
_count?: NestedIntFilter
_avg?: NestedFloatFilter
_sum?: NestedIntFilter
_min?: NestedIntFilter
_max?: NestedIntFilter
}

export type NestedFloatFilter = {
equals?: number
in?: Enumerable
notIn?: Enumerable
lt?: number
lte?: number
gt?: number
gte?: number
not?: NestedFloatFilter | number
}

export type NestedStringWithAggregatesFilter = {
equals?: string
in?: Enumerable
notIn?: Enumerable
lt?: string
lte?: string
gt?: string
gte?: string
contains?: string
startsWith?: string
endsWith?: string
not?: NestedStringWithAggregatesFilter | string
_count?: NestedIntFilter
_min?: NestedStringFilter
_max?: NestedStringFilter
}

export type NestedStringNullableWithAggregatesFilter = {
equals?: string | null
in?: Enumerable | null
notIn?: Enumerable | null
lt?: string
lte?: string
gt?: string
gte?: string
contains?: string
startsWith?: string
endsWith?: string
not?: NestedStringNullableWithAggregatesFilter | string | null
_count?: NestedIntNullableFilter
_min?: NestedStringNullableFilter
_max?: NestedStringNullableFilter
}

export type NestedIntNullableFilter = {
equals?: number | null
in?: Enumerable | null
notIn?: Enumerable | null
lt?: number
lte?: number
gt?: number
gte?: number
not?: NestedIntNullableFilter | number | null
}

export type NestedDateTimeNullableWithAggregatesFilter = {
equals?: Date | string | null
in?: Enumerable | Enumerable | null
notIn?: Enumerable | Enumerable | null
lt?: Date | string
lte?: Date | string
gt?: Date | string
gte?: Date | string
not?: NestedDateTimeNullableWithAggregatesFilter | Date | string | null
_count?: NestedIntNullableFilter
_min?: NestedDateTimeNullableFilter
_max?: NestedDateTimeNullableFilter
}

export type NestedBytesFilter = {
equals?: Buffer
in?: Enumerable
notIn?: Enumerable
not?: NestedBytesFilter | Buffer
}

export type NestedBigIntFilter = {
equals?: bigint | number
in?: Enumerable | Enumerable
notIn?: Enumerable | Enumerable
lt?: bigint | number
lte?: bigint | number
gt?: bigint | number
gte?: bigint | number
not?: NestedBigIntFilter | bigint | number
}

export type NestedBytesWithAggregatesFilter = {
equals?: Buffer
in?: Enumerable
notIn?: Enumerable
not?: NestedBytesWithAggregatesFilter | Buffer
_count?: NestedIntFilter
_min?: NestedBytesFilter
_max?: NestedBytesFilter
}

export type NestedBigIntWithAggregatesFilter = {
equals?: bigint | number
in?: Enumerable | Enumerable
notIn?: Enumerable | Enumerable
lt?: bigint | number
lte?: bigint | number
gt?: bigint | number
gte?: bigint | number
not?: NestedBigIntWithAggregatesFilter | bigint | number
_count?: NestedIntFilter
_avg?: NestedFloatFilter
_sum?: NestedBigIntFilter
_min?: NestedBigIntFilter
_max?: NestedBigIntFilter
}

export type UserCredentialCreateWithoutUserInput = {
id: string
publicKey: Buffer
transports?: string | null
counter: bigint | number
}

export type UserCredentialUncheckedCreateWithoutUserInput = {
id: string
publicKey: Buffer
transports?: string | null
counter: bigint | number
}

export type UserCredentialCreateOrConnectWithoutUserInput = {
where: UserCredentialWhereUniqueInput
create: XOR<UserCredentialCreateWithoutUserInput, UserCredentialUncheckedCreateWithoutUserInput>
}

export type UserCredentialCreateManyUserInputEnvelope = {
data: Enumerable
skipDuplicates?: boolean
}

export type UserCredentialUpsertWithWhereUniqueWithoutUserInput = {
where: UserCredentialWhereUniqueInput
update: XOR<UserCredentialUpdateWithoutUserInput, UserCredentialUncheckedUpdateWithoutUserInput>
create: XOR<UserCredentialCreateWithoutUserInput, UserCredentialUncheckedCreateWithoutUserInput>
}

export type UserCredentialUpdateWithWhereUniqueWithoutUserInput = {
where: UserCredentialWhereUniqueInput
data: XOR<UserCredentialUpdateWithoutUserInput, UserCredentialUncheckedUpdateWithoutUserInput>
}

export type UserCredentialUpdateManyWithWhereWithoutUserInput = {
where: UserCredentialScalarWhereInput
data: XOR<UserCredentialUpdateManyMutationInput, UserCredentialUncheckedUpdateManyWithoutCredentialsInput>
}

export type UserCredentialScalarWhereInput = {
AND?: Enumerable
OR?: Enumerable
NOT?: Enumerable
id?: StringFilter | string
userId?: IntFilter | number
publicKey?: BytesFilter | Buffer
transports?: StringNullableFilter | string | null
counter?: BigIntFilter | bigint | number
}

export type UserCreateWithoutCredentialsInput = {
username: string
email: string
hashedPassword: string
salt: string
resetToken?: string | null
resetTokenExpiresAt?: Date | string | null
webAuthnChallenge?: string | null
}

export type UserUncheckedCreateWithoutCredentialsInput = {
id?: number
username: string
email: string
hashedPassword: string
salt: string
resetToken?: string | null
resetTokenExpiresAt?: Date | string | null
webAuthnChallenge?: string | null
}

export type UserCreateOrConnectWithoutCredentialsInput = {
where: UserWhereUniqueInput
create: XOR<UserCreateWithoutCredentialsInput, UserUncheckedCreateWithoutCredentialsInput>
}

export type UserUpsertWithoutCredentialsInput = {
update: XOR<UserUpdateWithoutCredentialsInput, UserUncheckedUpdateWithoutCredentialsInput>
create: XOR<UserCreateWithoutCredentialsInput, UserUncheckedCreateWithoutCredentialsInput>
}

export type UserUpdateWithoutCredentialsInput = {
username?: StringFieldUpdateOperationsInput | string
email?: StringFieldUpdateOperationsInput | string
hashedPassword?: StringFieldUpdateOperationsInput | string
salt?: StringFieldUpdateOperationsInput | string
resetToken?: NullableStringFieldUpdateOperationsInput | string | null
resetTokenExpiresAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
webAuthnChallenge?: NullableStringFieldUpdateOperationsInput | string | null
}

export type UserUncheckedUpdateWithoutCredentialsInput = {
id?: IntFieldUpdateOperationsInput | number
username?: StringFieldUpdateOperationsInput | string
email?: StringFieldUpdateOperationsInput | string
hashedPassword?: StringFieldUpdateOperationsInput | string
salt?: StringFieldUpdateOperationsInput | string
resetToken?: NullableStringFieldUpdateOperationsInput | string | null
resetTokenExpiresAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
webAuthnChallenge?: NullableStringFieldUpdateOperationsInput | string | null
}

export type UserCredentialCreateManyUserInput = {
id: string
publicKey: Buffer
transports?: string | null
counter: bigint | number
}

export type UserCredentialUpdateWithoutUserInput = {
id?: StringFieldUpdateOperationsInput | string
publicKey?: BytesFieldUpdateOperationsInput | Buffer
transports?: NullableStringFieldUpdateOperationsInput | string | null
counter?: BigIntFieldUpdateOperationsInput | bigint | number
}

export type UserCredentialUncheckedUpdateWithoutUserInput = {
id?: StringFieldUpdateOperationsInput | string
publicKey?: BytesFieldUpdateOperationsInput | Buffer
transports?: NullableStringFieldUpdateOperationsInput | string | null
counter?: BigIntFieldUpdateOperationsInput | bigint | number
}

export type UserCredentialUncheckedUpdateManyWithoutCredentialsInput = {
id?: StringFieldUpdateOperationsInput | string
publicKey?: BytesFieldUpdateOperationsInput | Buffer
transports?: NullableStringFieldUpdateOperationsInput | string | null
counter?: BigIntFieldUpdateOperationsInput | bigint | number
}

/**

  • Batch Payload for updateMany & deleteMany & createMany
    */

export type BatchPayload = {
count: number
}

/**

  • DMMF
    */
    export const dmmf: runtime.BaseDMMF
    }
</details

@mc-spieczynski
Copy link

Is migrate reset --force failing before even touching seed file / main function? I am asking since I have the same issue and it may be related since we just added an enum type to schema.

@codewriter3000
Copy link
Author

It works fine for me.

@thedavidprice
Copy link
Contributor

I just tried it on my Mac (Redwood v5-canary and prisma 4.11) and it works. (steps: add to schema, yarn rw prisma generate, import in service)

Could you confirm your version of Prisma? It should be 4.11 on Redwood v4

Because you're on Windows, I do wonder if there's an OS-specific bug. If so, the best place to get help with this will be the Prisma repo: https://github.com/prisma/prisma Doing a quick search for "ENUM" showed a few recent issues.

Keep us posted here. We can try and nudge things from our end.


Note: there's a problem with Enum and GraphQL type gen, but I don't think that's what you're dealing with here: #6025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/needs-info More information is needed for reproduction
Projects
None yet
Development

No branches or pull requests

3 participants