diff --git a/front-end/user-app/src/app/app-routing.module.ts b/front-end/user-app/src/app/app-routing.module.ts index f4735c4..c762a3f 100644 --- a/front-end/user-app/src/app/app-routing.module.ts +++ b/front-end/user-app/src/app/app-routing.module.ts @@ -26,6 +26,28 @@ const routes: Routes = [ path: 'dashboard', component: DashboardComponent, canActivate: [AuthGuard], + }, + { + path: '', + component: UserListComponent, + }, + { + path: 'about-us', + component: AboutUsComponent, + }, + { + path: 'contact', + component: ContactComponent, + }, + { + path: 'user-detail', + component: UserDetailComponent, + canActivate: [AuthGuard], + }, + { + path: 'create-user', + component: CreateUserComponent, + canActivate: [AuthGuard], } ]; diff --git a/front-end/user-app/src/app/guards/auth.guard.ts b/front-end/user-app/src/app/guards/auth.guard.ts index 092a104..5acee85 100644 --- a/front-end/user-app/src/app/guards/auth.guard.ts +++ b/front-end/user-app/src/app/guards/auth.guard.ts @@ -14,6 +14,12 @@ import { Router } from '@angular/router'; export class AuthGuard implements CanActivate { constructor(private authService: AuthService, private router: Router){} canActivate(): boolean { - return true; + let isAuthenticated = this.authService.isAuthenticated(); + if (isAuthenticated) { + return true; + } else { + this.authService.logout(); + return false; + } } } diff --git a/front-end/user-app/src/app/interceptors/auth.interceptor.ts b/front-end/user-app/src/app/interceptors/auth.interceptor.ts index 8d72b76..fb985b2 100644 --- a/front-end/user-app/src/app/interceptors/auth.interceptor.ts +++ b/front-end/user-app/src/app/interceptors/auth.interceptor.ts @@ -26,7 +26,15 @@ export class AuthInterceptor implements HttpInterceptor { } //copy paste the code here - + if (this.authService.isAuthenticated()) { + request = request.clone({ + setHeaders: { + Authorization: `Bearer ${this.authService.getAuthToken()}` + } + }); + } else { + this.authService.logout(); + } return next.handle(request).pipe( catchError((error) => { diff --git a/front-end/user-app/src/app/pages/dashboard/dashboard.component.html b/front-end/user-app/src/app/pages/dashboard/dashboard.component.html index d920124..d3c47d8 100644 --- a/front-end/user-app/src/app/pages/dashboard/dashboard.component.html +++ b/front-end/user-app/src/app/pages/dashboard/dashboard.component.html @@ -1,3 +1,24 @@ - -

You are logged into dashboard

- + + + + + Welcome Page + + + + +

You are logged into the dashboard

+

Welcome

+ + + + + + diff --git a/front-end/user-app/src/app/pages/login/login.component.html b/front-end/user-app/src/app/pages/login/login.component.html index 3b6092e..e1d1cdc 100644 --- a/front-end/user-app/src/app/pages/login/login.component.html +++ b/front-end/user-app/src/app/pages/login/login.component.html @@ -8,7 +8,7 @@

Welcome to Address Book

- +
diff --git a/front-end/user-app/src/app/pages/login/login.component.ts b/front-end/user-app/src/app/pages/login/login.component.ts index 07d0496..be2d312 100644 --- a/front-end/user-app/src/app/pages/login/login.component.ts +++ b/front-end/user-app/src/app/pages/login/login.component.ts @@ -16,11 +16,25 @@ export class LoginComponent { password: formBuilder.control('', [Validators.required]), }); } - async onSubmit(){ if(this.loginForm.valid){ + await this.authService.login(this.loginForm.value) + .then( + (response:any)=>{ + if(response){ + localStorage.setItem('jwt', response.Authorization); + this.authService.setLogedInUser(); + this.router.navigateByUrl('/dashboard'); + }else{ + alert("Invalid email id password"); + } + },(error)=>{ + console.log(error); + } + ); } } + } diff --git a/front-end/user-app/src/app/pages/sign-up/sign-up.component.html b/front-end/user-app/src/app/pages/sign-up/sign-up.component.html index cf4b8f9..ba9338b 100644 --- a/front-end/user-app/src/app/pages/sign-up/sign-up.component.html +++ b/front-end/user-app/src/app/pages/sign-up/sign-up.component.html @@ -7,11 +7,11 @@

SignUp to Address Book

logo
- + - - - + + +
diff --git a/front-end/user-app/src/app/services/auth.service.ts b/front-end/user-app/src/app/services/auth.service.ts index c6d18b4..6185f6a 100644 --- a/front-end/user-app/src/app/services/auth.service.ts +++ b/front-end/user-app/src/app/services/auth.service.ts @@ -40,6 +40,7 @@ export class AuthService { } async login(data: any){ + return await this.http.post(this.baseUrl+'/auth/login',data).toPromise() } logout() { @@ -67,6 +68,7 @@ export class AuthService { let decodedToken:any = jwt_decode(token); console.log(decodedToken); // Set the loged in user data. + this.loggedInUser['firstName']=decodedToken?.firstName; this.loggedInUser['emailId'] = decodedToken?.userEmailId; this.loggedInUser['id']= decodedToken.userId; } else{ diff --git a/tempCodeRunnerFile b/tempCodeRunnerFile new file mode 100755 index 0000000..fd0e89c Binary files /dev/null and b/tempCodeRunnerFile differ diff --git a/uc-controller-user/controller-user/prisma/migrations/20230922050352_init/migration.sql b/uc-controller-user/controller-user/prisma/migrations/20230922050352_init/migration.sql new file mode 100644 index 0000000..e674b5a --- /dev/null +++ b/uc-controller-user/controller-user/prisma/migrations/20230922050352_init/migration.sql @@ -0,0 +1,35 @@ +-- CreateEnum +CREATE TYPE "Role" AS ENUM ('CLIENT', 'ADMIN', 'ROOT'); + +-- CreateTable +CREATE TABLE "user" ( + "id" SERIAL NOT NULL, + "first_name" TEXT NOT NULL, + "email_id" TEXT NOT NULL, + "last_name" TEXT NOT NULL, + "password" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "user_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "contact" ( + "id" SERIAL NOT NULL, + "name" TEXT NOT NULL, + "email_id" TEXT NOT NULL, + "street" TEXT NOT NULL, + "city" TEXT NOT NULL, + "zipcode" INTEGER NOT NULL, + "company_name" TEXT NOT NULL, + "phone_number" TEXT NOT NULL, + "userId" INTEGER NOT NULL, + + CONSTRAINT "contact_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE UNIQUE INDEX "user_email_id_key" ON "user"("email_id"); + +-- AddForeignKey +ALTER TABLE "contact" ADD CONSTRAINT "contact_userId_fkey" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/uc-controller-user/controller-user/prisma/migrations/migration_lock.toml b/uc-controller-user/controller-user/prisma/migrations/migration_lock.toml new file mode 100644 index 0000000..fbffa92 --- /dev/null +++ b/uc-controller-user/controller-user/prisma/migrations/migration_lock.toml @@ -0,0 +1,3 @@ +# Please do not edit this file manually +# It should be added in your version-control system (i.e. Git) +provider = "postgresql" \ No newline at end of file diff --git a/uc-controller-user/controller-user/prisma/prismaAuthUserClient/index-browser.js b/uc-controller-user/controller-user/prisma/prismaAuthUserClient/index-browser.js new file mode 100644 index 0000000..8ba5c1d --- /dev/null +++ b/uc-controller-user/controller-user/prisma/prismaAuthUserClient/index-browser.js @@ -0,0 +1,158 @@ + +Object.defineProperty(exports, "__esModule", { value: true }); + +const { + Decimal, + objectEnumValues, + makeStrictEnum, + Public, +} = require('./runtime/index-browser') + + +const Prisma = {} + +exports.Prisma = Prisma + +/** + * Prisma Client JS version: 4.16.2 + * Query Engine version: 4bc8b6e1b66cb932731fb1bdbbc550d1e010de81 + */ +Prisma.prismaVersion = { + client: "4.16.2", + engine: "4bc8b6e1b66cb932731fb1bdbbc550d1e010de81" +} + +Prisma.PrismaClientKnownRequestError = () => { + throw new Error(`PrismaClientKnownRequestError is unable to be run in the browser. +In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, +)}; +Prisma.PrismaClientUnknownRequestError = () => { + throw new Error(`PrismaClientUnknownRequestError is unable to be run in the browser. +In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, +)} +Prisma.PrismaClientRustPanicError = () => { + throw new Error(`PrismaClientRustPanicError is unable to be run in the browser. +In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, +)} +Prisma.PrismaClientInitializationError = () => { + throw new Error(`PrismaClientInitializationError is unable to be run in the browser. +In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, +)} +Prisma.PrismaClientValidationError = () => { + throw new Error(`PrismaClientValidationError is unable to be run in the browser. +In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, +)} +Prisma.NotFoundError = () => { + throw new Error(`NotFoundError is unable to be run in the browser. +In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, +)} +Prisma.Decimal = Decimal + +/** + * Re-export of sql-template-tag + */ +Prisma.sql = () => { + throw new Error(`sqltag is unable to be run in the browser. +In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, +)} +Prisma.empty = () => { + throw new Error(`empty is unable to be run in the browser. +In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, +)} +Prisma.join = () => { + throw new Error(`join is unable to be run in the browser. +In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, +)} +Prisma.raw = () => { + throw new Error(`raw is unable to be run in the browser. +In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, +)} +Prisma.validator = Public.validator + +/** +* Extensions +*/ +Prisma.getExtensionContext = () => { + throw new Error(`Extensions.getExtensionContext is unable to be run in the browser. +In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, +)} +Prisma.defineExtension = () => { + throw new Error(`Extensions.defineExtension is unable to be run in the browser. +In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, +)} + +/** + * 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 +} + +/** + * Enums + */ + +exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', + Serializable: 'Serializable' +}); + +exports.Prisma.UserScalarFieldEnum = { + id: 'id', + firstName: 'firstName', + emailId: 'emailId', + lastName: 'lastName', + password: 'password', + createdAt: 'createdAt' +}; + +exports.Prisma.ContactScalarFieldEnum = { + id: 'id', + name: 'name', + emailId: 'emailId', + street: 'street', + city: 'city', + zipcode: 'zipcode', + companyName: 'companyName', + phoneNumber: 'phoneNumber', + userId: 'userId' +}; + +exports.Prisma.SortOrder = { + asc: 'asc', + desc: 'desc' +}; + +exports.Prisma.QueryMode = { + default: 'default', + insensitive: 'insensitive' +}; + + +exports.Prisma.ModelName = { + User: 'User', + Contact: 'Contact' +}; + +/** + * Create the Client + */ +class PrismaClient { + constructor() { + throw new Error( + `PrismaClient is unable to be run in the browser. +In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, + ) + } +} +exports.PrismaClient = PrismaClient + +Object.assign(exports, Prisma) diff --git a/uc-controller-user/controller-user/prisma/prismaAuthUserClient/index.d.ts b/uc-controller-user/controller-user/prisma/prismaAuthUserClient/index.d.ts new file mode 100644 index 0000000..ac4ae67 --- /dev/null +++ b/uc-controller-user/controller-user/prisma/prismaAuthUserClient/index.d.ts @@ -0,0 +1,3884 @@ + +/** + * Client +**/ + +import * as runtime from './runtime/library'; +import $Types = runtime.Types // general types +import $Public = runtime.Types.Public +import $Utils = runtime.Types.Utils +import $Extensions = runtime.Types.Extensions + +export type PrismaPromise = $Public.PrismaPromise + + +export type UserPayload = { + name: "User" + objects: { + contacts: ContactPayload[] + } + scalars: $Extensions.GetResult<{ + id: number + firstName: string + emailId: string + lastName: string + password: string + createdAt: Date + }, ExtArgs["result"]["user"]> + composites: {} +} + +/** + * Model User + * + */ +export type User = runtime.Types.DefaultSelection +export type ContactPayload = { + name: "Contact" + objects: { + user: UserPayload + } + scalars: $Extensions.GetResult<{ + id: number + name: string + emailId: string + street: string + city: string + zipcode: number + companyName: string + phoneNumber: string + userId: number + }, ExtArgs["result"]["contact"]> + composites: {} +} + +/** + * Model Contact + * + */ +export type Contact = runtime.Types.DefaultSelection + +/** + * ## 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](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). + */ +export class PrismaClient< + T extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions, + U = 'log' extends keyof T ? T['log'] extends Array ? Prisma.GetEvents : never : never, + GlobalReject extends Prisma.RejectOnNotFound | Prisma.RejectPerOperation | false | undefined = 'rejectOnNotFound' extends keyof T + ? T['rejectOnNotFound'] + : false, + ExtArgs extends $Extensions.Args = $Extensions.DefaultArgs +> { + [K: symbol]: { types: Prisma.TypeMap['other'] } + + /** + * ## 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](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). + */ + + constructor(optionsArg ?: Prisma.Subset); + $on(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 + * @deprecated since 4.16.0. For new code, prefer client extensions instead. + * @see https://pris.ly/d/extensions + */ + $use(cb: Prisma.Middleware): void + +/** + * Executes a prepared raw query and returns the number of affected rows. + * @example + * ``` + * const result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};` + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). + */ + $executeRaw(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](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). + */ + $executeRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise; + + /** + * Performs a prepared raw query and returns the `SELECT` data. + * @example + * ``` + * const result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};` + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). + */ + $queryRaw(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](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). + */ + $queryRawUnsafe(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](https://www.prisma.io/docs/concepts/components/prisma-client/transactions). + */ + $transaction

[]>(arg: [...P], options?: { isolationLevel?: Prisma.TransactionIsolationLevel }): Promise> + + $transaction(fn: (prisma: Omit) => Promise, options?: { maxWait?: number, timeout?: number, isolationLevel?: Prisma.TransactionIsolationLevel }): Promise + + + $extends: $Extensions.ExtendsHook<'extends', Prisma.TypeMapCb, ExtArgs> + + /** + * `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.contact`: Exposes CRUD operations for the **Contact** model. + * Example usage: + * ```ts + * // Fetch zero or more Contacts + * const contacts = await prisma.contact.findMany() + * ``` + */ + get contact(): Prisma.ContactDelegate; +} + +export namespace Prisma { + export import DMMF = runtime.DMMF + + export type PrismaPromise = $Public.PrismaPromise + + /** + * Validator + */ + export import validator = runtime.Public.validator + + /** + * 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 + + /** + * Extensions + */ + export type Extension = $Extensions.UserArgs + export import getExtensionContext = runtime.Extensions.getExtensionContext + export type Args = $Public.Args + export type Payload = $Public.Payload + export type Result = $Public.Result + export type Exact = $Public.Exact + + /** + * Prisma Client JS version: 4.16.2 + * Query Engine version: 4bc8b6e1b66cb932731fb1bdbbc550d1e010de81 + */ + 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} + + /** + * From https://github.com/sindresorhus/type-fest/ + * Matches a JSON array. + */ + export interface JsonArray extends Array {} + + /** + * From https://github.com/sindresorhus/type-fest/ + * Matches any valid JSON value. + */ + export type JsonValue = string | number | boolean | JsonObject | JsonArray | null + + /** + * 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 {} + + /** + * 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 + + /** + * Types of the values used to represent different kinds of `null` values when working with JSON fields. + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field + */ + namespace NullTypes { + /** + * Type of `Prisma.DbNull`. + * + * You cannot use other instances of this class. Please use the `Prisma.DbNull` value. + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field + */ + class DbNull { + private DbNull: never + private constructor() + } + + /** + * 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() + } + } + + /** + * Helper for filtering JSON entries that have `null` on the database (empty on the db) + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field + */ + export const DbNull: NullTypes.DbNull + + /** + * Helper for filtering JSON entries that have JSON `null` values (not empty on the db) + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field + */ + export const JsonNull: NullTypes.JsonNull + + /** + * Helper for filtering JSON entries that are `Prisma.DbNull` or `Prisma.JsonNull` + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field + */ + export const AnyNull: NullTypes.AnyNull + + type SelectAndInclude = { + select: any + include: any + } + type HasSelect = { + select: any + } + type HasInclude = { + include: any + } + type CheckSelect = 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 ? U : T; + + /** + * Get the return type of a function which returns a Promise. + */ + export type PromiseReturnType Promise> = PromiseType> + + /** + * From T, pick a set of properties whose keys are in the union K + */ + type Prisma__Pick = { + [P in K]: T[P]; + }; + + + export type Enumerable = T | Array; + + export type RequiredKeys = { + [K in keyof T]-?: {} extends Prisma__Pick ? 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>> + + /** + * Subset + * @desc From `T` pick properties that exist in `U`. Simple version of Intersection + */ + export type Subset = { + [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 = { + [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 = { + [key in keyof T]: key extends keyof U ? T[key] : never + } & + K + + type Without = { [P in Exclude]?: never }; + + /** + * XOR is needed to have a real mutually exclusive union type + * https://stackoverflow.com/questions/42123407/does-typescript-support-mutually-exclusive-types + */ + type XOR = + T extends object ? + U extends object ? + (Without & U) | (Without & T) + : U : T + + + /** + * 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 = Omit & + { + // Merge all but K + [P in K]: Prisma__Pick // With K possibilities + }[K] + + type EitherStrict = Strict<__Either> + + type EitherLoose = ComputeRaw<__Either> + + type _Either< + O extends object, + K extends Key, + strict extends Boolean + > = { + 1: EitherStrict + 0: EitherLoose + }[strict] + + type Either< + O extends object, + K extends Key, + strict extends Boolean = 1 + > = O extends unknown ? _Either : never + + export type Union = any + + type PatchUndefined = { + [K in keyof O]: O[K] extends undefined ? At : 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 = { + [K in keyof O]: K extends keyof O1 ? O1[K] : O[K]; + } & {}; + + type _Merge = IntersectOf; + }>>; + + type Key = string | number | symbol; + type AtBasic = K extends keyof O ? O[K] : never; + type AtStrict = O[K & keyof O]; + type AtLoose = O extends unknown ? AtStrict : never; + export type At = { + 1: AtStrict; + 0: AtLoose; + }[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 = { + [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 = 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 extends unknown ? U & OptionalFlat<_Record, keyof U>, never>> : never; + + export type Strict = ComputeRaw<_Strict>; + /** End Helper Types for "Merge" **/ + + export type Merge = ComputeRaw<_Merge>>; + + /** + 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 [never] + ? 0 // anything `never` is false + : A1 extends A2 + ? 1 + : 0 + + export type Has = Not< + Extends, U1> + > + + export type Or = { + 0: { + 0: 0 + 1: 1 + } + 1: { + 0: 1 + 1: 1 + } + }[B1][B2] + + export type Keys = U extends unknown ? keyof U : never + + type Cast = A extends B ? A : B; + + export const type: unique symbol; + + + + /** + * Used by group by + */ + + export type GetScalarType = O extends object ? { + [P in keyof T]: P extends keyof O + ? O[P] + : never + } : never + + type FieldPaths< + T, + U = Omit + > = IsObject extends True ? U : T + + type GetHavingFields = { + [K in keyof T]: Or< + Or, 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 + // https://github.com/microsoft/TypeScript/issues/30188#issuecomment-478938437 + T[K] extends infer TK + ? GetHavingFields extends object ? Merge> : never> + : never + : {} extends FieldPaths + ? never + : K + }[keyof T] + + /** + * Convert tuple to union + */ + type _TupleToUnion = T extends (infer E)[] ? E : never + type TupleToUnion = _TupleToUnion + type MaybeTupleToUnion = T extends any[] ? TupleToUnion : T + + /** + * Like `Pick`, but with an array + */ + type PickArray> = Prisma__Pick> + + /** + * Exclude all keys with underscores + */ + type ExcludeUnderscoreKeys = T extends `_${string}` ? never : T + + + export type FieldRef = runtime.FieldRef + + type FieldRefInputType = Model extends never ? never : FieldRef + + + export const ModelName: { + User: 'User', + Contact: 'Contact' + }; + + export type ModelName = (typeof ModelName)[keyof typeof ModelName] + + + export type Datasources = { + db?: Datasource + } + + + interface TypeMapCb extends $Utils.Fn<{extArgs: $Extensions.Args}, $Utils.Record> { + returns: Prisma.TypeMap + } + + export type TypeMap = { + meta: { + modelProps: 'user' | 'contact' + txIsolationLevel: Prisma.TransactionIsolationLevel + }, + model: { + User: { + payload: UserPayload + operations: { + findUnique: { + args: Prisma.UserFindUniqueArgs, + result: $Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.UserFindUniqueOrThrowArgs, + result: $Utils.PayloadToResult + } + findFirst: { + args: Prisma.UserFindFirstArgs, + result: $Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.UserFindFirstOrThrowArgs, + result: $Utils.PayloadToResult + } + findMany: { + args: Prisma.UserFindManyArgs, + result: $Utils.PayloadToResult[] + } + create: { + args: Prisma.UserCreateArgs, + result: $Utils.PayloadToResult + } + createMany: { + args: Prisma.UserCreateManyArgs, + result: Prisma.BatchPayload + } + delete: { + args: Prisma.UserDeleteArgs, + result: $Utils.PayloadToResult + } + update: { + args: Prisma.UserUpdateArgs, + result: $Utils.PayloadToResult + } + deleteMany: { + args: Prisma.UserDeleteManyArgs, + result: Prisma.BatchPayload + } + updateMany: { + args: Prisma.UserUpdateManyArgs, + result: Prisma.BatchPayload + } + upsert: { + args: Prisma.UserUpsertArgs, + result: $Utils.PayloadToResult + } + aggregate: { + args: Prisma.UserAggregateArgs, + result: $Utils.Optional + } + groupBy: { + args: Prisma.UserGroupByArgs, + result: $Utils.Optional[] + } + count: { + args: Prisma.UserCountArgs, + result: $Utils.Optional | number + } + } + } + Contact: { + payload: ContactPayload + operations: { + findUnique: { + args: Prisma.ContactFindUniqueArgs, + result: $Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.ContactFindUniqueOrThrowArgs, + result: $Utils.PayloadToResult + } + findFirst: { + args: Prisma.ContactFindFirstArgs, + result: $Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.ContactFindFirstOrThrowArgs, + result: $Utils.PayloadToResult + } + findMany: { + args: Prisma.ContactFindManyArgs, + result: $Utils.PayloadToResult[] + } + create: { + args: Prisma.ContactCreateArgs, + result: $Utils.PayloadToResult + } + createMany: { + args: Prisma.ContactCreateManyArgs, + result: Prisma.BatchPayload + } + delete: { + args: Prisma.ContactDeleteArgs, + result: $Utils.PayloadToResult + } + update: { + args: Prisma.ContactUpdateArgs, + result: $Utils.PayloadToResult + } + deleteMany: { + args: Prisma.ContactDeleteManyArgs, + result: Prisma.BatchPayload + } + updateMany: { + args: Prisma.ContactUpdateManyArgs, + result: Prisma.BatchPayload + } + upsert: { + args: Prisma.ContactUpsertArgs, + result: $Utils.PayloadToResult + } + aggregate: { + args: Prisma.ContactAggregateArgs, + result: $Utils.Optional + } + groupBy: { + args: Prisma.ContactGroupByArgs, + result: $Utils.Optional[] + } + count: { + args: Prisma.ContactCountArgs, + result: $Utils.Optional | number + } + } + } + } + } & { + other: { + payload: any + operations: { + $executeRawUnsafe: { + args: [query: string, ...values: any[]], + result: any + } + $executeRaw: { + args: [query: TemplateStringsArray | Prisma.Sql, ...values: any[]], + result: any + } + $queryRawUnsafe: { + args: [query: string, ...values: any[]], + result: any + } + $queryRaw: { + args: [query: TemplateStringsArray | Prisma.Sql, ...values: any[]], + result: any + } + } + } + } + export const defineExtension: $Extensions.ExtendsHook<'define', Prisma.TypeMapCb, $Extensions.DefaultArgs> + 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] extends RejectPerModel + ? Model extends keyof GlobalRejectSettings[Action] + ? IsReject + : 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 + } + + /* Types for Logging */ + export type LogLevel = 'info' | 'query' | 'warn' | 'error' + export type LogDefinition = { + level: LogLevel + emit: 'stdout' | 'event' + } + + export type GetLogType = T extends LogDefinition ? T['emit'] extends 'event' ? T['level'] : never : never + export type GetEvents = T extends Array ? + GetLogType | GetLogType | GetLogType | GetLogType + : 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 = ( + params: MiddlewareParams, + next: (params: MiddlewareParams) => Promise, + ) => Promise + + // tested in getLogLevel.test.ts + export function getLogLevel(log: Array): LogLevel | undefined; + + /** + * `PrismaClient` proxy available in interactive transactions. + */ + export type TransactionClient = Omit + + export type Datasource = { + url?: string + } + + /** + * Count Types + */ + + + /** + * Count Type UserCountOutputType + */ + + + export type UserCountOutputType = { + contacts: number + } + + export type UserCountOutputTypeSelect = { + contacts?: boolean | UserCountOutputTypeCountContactsArgs + } + + // Custom InputTypes + + /** + * UserCountOutputType without action + */ + export type UserCountOutputTypeArgs = { + /** + * Select specific fields to fetch from the UserCountOutputType + */ + select?: UserCountOutputTypeSelect | null + } + + + /** + * UserCountOutputType without action + */ + export type UserCountOutputTypeCountContactsArgs = { + where?: ContactWhereInput + } + + + + /** + * 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 + firstName: string | null + emailId: string | null + lastName: string | null + password: string | null + createdAt: Date | null + } + + export type UserMaxAggregateOutputType = { + id: number | null + firstName: string | null + emailId: string | null + lastName: string | null + password: string | null + createdAt: Date | null + } + + export type UserCountAggregateOutputType = { + id: number + firstName: number + emailId: number + lastName: number + password: number + createdAt: number + _all: number + } + + + export type UserAvgAggregateInputType = { + id?: true + } + + export type UserSumAggregateInputType = { + id?: true + } + + export type UserMinAggregateInputType = { + id?: true + firstName?: true + emailId?: true + lastName?: true + password?: true + createdAt?: true + } + + export type UserMaxAggregateInputType = { + id?: true + firstName?: true + emailId?: true + lastName?: true + password?: true + createdAt?: true + } + + export type UserCountAggregateInputType = { + id?: true + firstName?: true + emailId?: true + lastName?: true + password?: true + createdAt?: 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 + : GetScalarType + } + + + + + 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 + firstName: string + emailId: string + lastName: string + password: string + createdAt: Date + _count: UserCountAggregateOutputType | null + _avg: UserAvgAggregateOutputType | null + _sum: UserSumAggregateOutputType | null + _min: UserMinAggregateOutputType | null + _max: UserMaxAggregateOutputType | null + } + + type GetUserGroupByPayload = Prisma.PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof UserGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type UserSelect = $Extensions.GetSelect<{ + id?: boolean + firstName?: boolean + emailId?: boolean + lastName?: boolean + password?: boolean + createdAt?: boolean + contacts?: boolean | User$contactsArgs + _count?: boolean | UserCountOutputTypeArgs + }, ExtArgs["result"]["user"]> + + export type UserSelectScalar = { + id?: boolean + firstName?: boolean + emailId?: boolean + lastName?: boolean + password?: boolean + createdAt?: boolean + } + + export type UserInclude = { + contacts?: boolean | User$contactsArgs + _count?: boolean | UserCountOutputTypeArgs + } + + + type UserGetPayload = $Types.GetResult + + type UserCountArgs = + Omit & { + select?: UserCountAggregateInputType | true + } + + export interface UserDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['User'], meta: { name: 'User' } } + /** + * 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, LocalRejectSettings = T["rejectOnNotFound"] extends RejectOnNotFound ? T['rejectOnNotFound'] : undefined>( + args: SelectSubset> + ): HasReject extends True ? Prisma__UserClient<$Types.GetResult, T, 'findUnique', never>, never, ExtArgs> : Prisma__UserClient<$Types.GetResult, T, 'findUnique', never> | null, null, ExtArgs> + + /** + * 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>( + args?: SelectSubset> + ): Prisma__UserClient<$Types.GetResult, T, 'findUniqueOrThrow', never>, never, ExtArgs> + + /** + * 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, LocalRejectSettings = T["rejectOnNotFound"] extends RejectOnNotFound ? T['rejectOnNotFound'] : undefined>( + args?: SelectSubset> + ): HasReject extends True ? Prisma__UserClient<$Types.GetResult, T, 'findFirst', never>, never, ExtArgs> : Prisma__UserClient<$Types.GetResult, T, 'findFirst', never> | null, null, ExtArgs> + + /** + * 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>( + args?: SelectSubset> + ): Prisma__UserClient<$Types.GetResult, T, 'findFirstOrThrow', never>, never, ExtArgs> + + /** + * 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>( + args?: SelectSubset> + ): Prisma.PrismaPromise<$Types.GetResult, T, 'findMany', never>> + + /** + * 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>( + args: SelectSubset> + ): Prisma__UserClient<$Types.GetResult, T, 'create', never>, never, ExtArgs> + + /** + * 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>( + args?: SelectSubset> + ): Prisma.PrismaPromise + + /** + * 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>( + args: SelectSubset> + ): Prisma__UserClient<$Types.GetResult, T, 'delete', never>, never, ExtArgs> + + /** + * 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>( + args: SelectSubset> + ): Prisma__UserClient<$Types.GetResult, T, 'update', never>, never, ExtArgs> + + /** + * 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>( + args?: SelectSubset> + ): Prisma.PrismaPromise + + /** + * 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>( + args: SelectSubset> + ): Prisma.PrismaPromise + + /** + * 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>( + args: SelectSubset> + ): Prisma__UserClient<$Types.GetResult, T, 'upsert', never>, never, ExtArgs> + + /** + * 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( + args?: Subset, + ): Prisma.PrismaPromise< + T extends $Utils.Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : 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(args: Subset): Prisma.PrismaPromise> + + /** + * 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>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: UserGroupByArgs['orderBy'] } + : { orderBy?: UserGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends TupleToUnion, + ByValid extends Has, + HavingFields extends GetHavingFields, + HavingValid extends Has, + 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 + ? 'orderBy' extends Keys + ? 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 + ? 'orderBy' extends Keys + ? 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 & InputErrors): {} extends InputErrors ? GetUserGroupByPayload : Prisma.PrismaPromise + + } + + /** + * 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 + * https://github.com/prisma/prisma-client-js/issues/707 + */ + export class Prisma__UserClient 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); + + contacts = {}>(args?: Subset>): Prisma.PrismaPromise<$Types.GetResult, T, 'findMany', never>| 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(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise; + /** + * 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(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; + /** + * 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; + } + + + + // 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 base type for findFirst actions + */ + export type UserFindFirstArgsBase = { + /** + * 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?: 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 position for searching for Users. + */ + 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/distinct Distinct Docs} + * + * Filter by unique combinations of Users. + */ + distinct?: Enumerable + } + + /** + * 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 findFirstOrThrow + */ + export type UserFindFirstOrThrowArgs = { + /** + * 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?: 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 position for searching for Users. + */ + 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/distinct Distinct Docs} + * + * Filter by unique combinations of Users. + */ + distinct?: Enumerable + } + + + /** + * User findMany + */ + export type UserFindManyArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: UserSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: UserInclude | null + /** + * Filter, which Users to fetch. + */ + 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 position for listing Users. + */ + 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 + distinct?: Enumerable + } + + + /** + * 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 + } + + + /** + * 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 + /** + * Choose, which User to update. + */ + where: UserWhereUniqueInput + } + + + /** + * User updateMany + */ + export type UserUpdateManyArgs = { + /** + * The data used to update Users. + */ + data: XOR + /** + * 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 + /** + * In case the User was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + + /** + * 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.contacts + */ + export type User$contactsArgs = { + /** + * Select specific fields to fetch from the Contact + */ + select?: ContactSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ContactInclude | null + where?: ContactWhereInput + orderBy?: Enumerable + cursor?: ContactWhereUniqueInput + 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 Contact + */ + + + export type AggregateContact = { + _count: ContactCountAggregateOutputType | null + _avg: ContactAvgAggregateOutputType | null + _sum: ContactSumAggregateOutputType | null + _min: ContactMinAggregateOutputType | null + _max: ContactMaxAggregateOutputType | null + } + + export type ContactAvgAggregateOutputType = { + id: number | null + zipcode: number | null + userId: number | null + } + + export type ContactSumAggregateOutputType = { + id: number | null + zipcode: number | null + userId: number | null + } + + export type ContactMinAggregateOutputType = { + id: number | null + name: string | null + emailId: string | null + street: string | null + city: string | null + zipcode: number | null + companyName: string | null + phoneNumber: string | null + userId: number | null + } + + export type ContactMaxAggregateOutputType = { + id: number | null + name: string | null + emailId: string | null + street: string | null + city: string | null + zipcode: number | null + companyName: string | null + phoneNumber: string | null + userId: number | null + } + + export type ContactCountAggregateOutputType = { + id: number + name: number + emailId: number + street: number + city: number + zipcode: number + companyName: number + phoneNumber: number + userId: number + _all: number + } + + + export type ContactAvgAggregateInputType = { + id?: true + zipcode?: true + userId?: true + } + + export type ContactSumAggregateInputType = { + id?: true + zipcode?: true + userId?: true + } + + export type ContactMinAggregateInputType = { + id?: true + name?: true + emailId?: true + street?: true + city?: true + zipcode?: true + companyName?: true + phoneNumber?: true + userId?: true + } + + export type ContactMaxAggregateInputType = { + id?: true + name?: true + emailId?: true + street?: true + city?: true + zipcode?: true + companyName?: true + phoneNumber?: true + userId?: true + } + + export type ContactCountAggregateInputType = { + id?: true + name?: true + emailId?: true + street?: true + city?: true + zipcode?: true + companyName?: true + phoneNumber?: true + userId?: true + _all?: true + } + + export type ContactAggregateArgs = { + /** + * Filter which Contact to aggregate. + */ + where?: ContactWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Contacts 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?: ContactWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Contacts 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` Contacts. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Contacts + **/ + _count?: true | ContactCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: ContactAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: ContactSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: ContactMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: ContactMaxAggregateInputType + } + + export type GetContactAggregateType = { + [P in keyof T & keyof AggregateContact]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type ContactGroupByArgs = { + where?: ContactWhereInput + orderBy?: Enumerable + by: ContactScalarFieldEnum[] + having?: ContactScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: ContactCountAggregateInputType | true + _avg?: ContactAvgAggregateInputType + _sum?: ContactSumAggregateInputType + _min?: ContactMinAggregateInputType + _max?: ContactMaxAggregateInputType + } + + + export type ContactGroupByOutputType = { + id: number + name: string + emailId: string + street: string + city: string + zipcode: number + companyName: string + phoneNumber: string + userId: number + _count: ContactCountAggregateOutputType | null + _avg: ContactAvgAggregateOutputType | null + _sum: ContactSumAggregateOutputType | null + _min: ContactMinAggregateOutputType | null + _max: ContactMaxAggregateOutputType | null + } + + type GetContactGroupByPayload = Prisma.PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof ContactGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type ContactSelect = $Extensions.GetSelect<{ + id?: boolean + name?: boolean + emailId?: boolean + street?: boolean + city?: boolean + zipcode?: boolean + companyName?: boolean + phoneNumber?: boolean + userId?: boolean + user?: boolean | UserArgs + }, ExtArgs["result"]["contact"]> + + export type ContactSelectScalar = { + id?: boolean + name?: boolean + emailId?: boolean + street?: boolean + city?: boolean + zipcode?: boolean + companyName?: boolean + phoneNumber?: boolean + userId?: boolean + } + + export type ContactInclude = { + user?: boolean | UserArgs + } + + + type ContactGetPayload = $Types.GetResult + + type ContactCountArgs = + Omit & { + select?: ContactCountAggregateInputType | true + } + + export interface ContactDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Contact'], meta: { name: 'Contact' } } + /** + * Find zero or one Contact that matches the filter. + * @param {ContactFindUniqueArgs} args - Arguments to find a Contact + * @example + * // Get one Contact + * const contact = await prisma.contact.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUnique, LocalRejectSettings = T["rejectOnNotFound"] extends RejectOnNotFound ? T['rejectOnNotFound'] : undefined>( + args: SelectSubset> + ): HasReject extends True ? Prisma__ContactClient<$Types.GetResult, T, 'findUnique', never>, never, ExtArgs> : Prisma__ContactClient<$Types.GetResult, T, 'findUnique', never> | null, null, ExtArgs> + + /** + * Find one Contact that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {ContactFindUniqueOrThrowArgs} args - Arguments to find a Contact + * @example + * // Get one Contact + * const contact = await prisma.contact.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUniqueOrThrow>( + args?: SelectSubset> + ): Prisma__ContactClient<$Types.GetResult, T, 'findUniqueOrThrow', never>, never, ExtArgs> + + /** + * Find the first Contact 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 {ContactFindFirstArgs} args - Arguments to find a Contact + * @example + * // Get one Contact + * const contact = await prisma.contact.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirst, LocalRejectSettings = T["rejectOnNotFound"] extends RejectOnNotFound ? T['rejectOnNotFound'] : undefined>( + args?: SelectSubset> + ): HasReject extends True ? Prisma__ContactClient<$Types.GetResult, T, 'findFirst', never>, never, ExtArgs> : Prisma__ContactClient<$Types.GetResult, T, 'findFirst', never> | null, null, ExtArgs> + + /** + * Find the first Contact 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 {ContactFindFirstOrThrowArgs} args - Arguments to find a Contact + * @example + * // Get one Contact + * const contact = await prisma.contact.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirstOrThrow>( + args?: SelectSubset> + ): Prisma__ContactClient<$Types.GetResult, T, 'findFirstOrThrow', never>, never, ExtArgs> + + /** + * Find zero or more Contacts 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 {ContactFindManyArgs=} args - Arguments to filter and select certain fields only. + * @example + * // Get all Contacts + * const contacts = await prisma.contact.findMany() + * + * // Get first 10 Contacts + * const contacts = await prisma.contact.findMany({ take: 10 }) + * + * // Only select the `id` + * const contactWithIdOnly = await prisma.contact.findMany({ select: { id: true } }) + * + **/ + findMany>( + args?: SelectSubset> + ): Prisma.PrismaPromise<$Types.GetResult, T, 'findMany', never>> + + /** + * Create a Contact. + * @param {ContactCreateArgs} args - Arguments to create a Contact. + * @example + * // Create one Contact + * const Contact = await prisma.contact.create({ + * data: { + * // ... data to create a Contact + * } + * }) + * + **/ + create>( + args: SelectSubset> + ): Prisma__ContactClient<$Types.GetResult, T, 'create', never>, never, ExtArgs> + + /** + * Create many Contacts. + * @param {ContactCreateManyArgs} args - Arguments to create many Contacts. + * @example + * // Create many Contacts + * const contact = await prisma.contact.createMany({ + * data: { + * // ... provide data here + * } + * }) + * + **/ + createMany>( + args?: SelectSubset> + ): Prisma.PrismaPromise + + /** + * Delete a Contact. + * @param {ContactDeleteArgs} args - Arguments to delete one Contact. + * @example + * // Delete one Contact + * const Contact = await prisma.contact.delete({ + * where: { + * // ... filter to delete one Contact + * } + * }) + * + **/ + delete>( + args: SelectSubset> + ): Prisma__ContactClient<$Types.GetResult, T, 'delete', never>, never, ExtArgs> + + /** + * Update one Contact. + * @param {ContactUpdateArgs} args - Arguments to update one Contact. + * @example + * // Update one Contact + * const contact = await prisma.contact.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + update>( + args: SelectSubset> + ): Prisma__ContactClient<$Types.GetResult, T, 'update', never>, never, ExtArgs> + + /** + * Delete zero or more Contacts. + * @param {ContactDeleteManyArgs} args - Arguments to filter Contacts to delete. + * @example + * // Delete a few Contacts + * const { count } = await prisma.contact.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + **/ + deleteMany>( + args?: SelectSubset> + ): Prisma.PrismaPromise + + /** + * Update zero or more Contacts. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ContactUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Contacts + * const contact = await prisma.contact.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + updateMany>( + args: SelectSubset> + ): Prisma.PrismaPromise + + /** + * Create or update one Contact. + * @param {ContactUpsertArgs} args - Arguments to update or create a Contact. + * @example + * // Update or create a Contact + * const contact = await prisma.contact.upsert({ + * create: { + * // ... data to create a Contact + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Contact we want to update + * } + * }) + **/ + upsert>( + args: SelectSubset> + ): Prisma__ContactClient<$Types.GetResult, T, 'upsert', never>, never, ExtArgs> + + /** + * Count the number of Contacts. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ContactCountArgs} args - Arguments to filter Contacts to count. + * @example + * // Count the number of Contacts + * const count = await prisma.contact.count({ + * where: { + * // ... the filter for the Contacts we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends $Utils.Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Contact. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ContactAggregateArgs} 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(args: Subset): Prisma.PrismaPromise> + + /** + * Group by Contact. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ContactGroupByArgs} 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 ContactGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: ContactGroupByArgs['orderBy'] } + : { orderBy?: ContactGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends TupleToUnion, + ByValid extends Has, + HavingFields extends GetHavingFields, + HavingValid extends Has, + 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 + ? 'orderBy' extends Keys + ? 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 + ? 'orderBy' extends Keys + ? 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 & InputErrors): {} extends InputErrors ? GetContactGroupByPayload : Prisma.PrismaPromise + + } + + /** + * The delegate class that acts as a "Promise-like" for Contact. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ + export class Prisma__ContactClient 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 = {}>(args?: Subset>): Prisma__UserClient<$Types.GetResult, T, 'findUnique', never> | Null, never, ExtArgs>; + + 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(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise; + /** + * 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(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; + /** + * 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; + } + + + + // Custom InputTypes + + /** + * Contact base type for findUnique actions + */ + export type ContactFindUniqueArgsBase = { + /** + * Select specific fields to fetch from the Contact + */ + select?: ContactSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ContactInclude | null + /** + * Filter, which Contact to fetch. + */ + where: ContactWhereUniqueInput + } + + /** + * Contact findUnique + */ + export interface ContactFindUniqueArgs extends ContactFindUniqueArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findUniqueOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Contact findUniqueOrThrow + */ + export type ContactFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Contact + */ + select?: ContactSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ContactInclude | null + /** + * Filter, which Contact to fetch. + */ + where: ContactWhereUniqueInput + } + + + /** + * Contact base type for findFirst actions + */ + export type ContactFindFirstArgsBase = { + /** + * Select specific fields to fetch from the Contact + */ + select?: ContactSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ContactInclude | null + /** + * Filter, which Contact to fetch. + */ + where?: ContactWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Contacts to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Contacts. + */ + cursor?: ContactWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Contacts 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` Contacts. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Contacts. + */ + distinct?: Enumerable + } + + /** + * Contact findFirst + */ + export interface ContactFindFirstArgs extends ContactFindFirstArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findFirstOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Contact findFirstOrThrow + */ + export type ContactFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Contact + */ + select?: ContactSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ContactInclude | null + /** + * Filter, which Contact to fetch. + */ + where?: ContactWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Contacts to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Contacts. + */ + cursor?: ContactWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Contacts 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` Contacts. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Contacts. + */ + distinct?: Enumerable + } + + + /** + * Contact findMany + */ + export type ContactFindManyArgs = { + /** + * Select specific fields to fetch from the Contact + */ + select?: ContactSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ContactInclude | null + /** + * Filter, which Contacts to fetch. + */ + where?: ContactWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Contacts to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Contacts. + */ + cursor?: ContactWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Contacts 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` Contacts. + */ + skip?: number + distinct?: Enumerable + } + + + /** + * Contact create + */ + export type ContactCreateArgs = { + /** + * Select specific fields to fetch from the Contact + */ + select?: ContactSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ContactInclude | null + /** + * The data needed to create a Contact. + */ + data: XOR + } + + + /** + * Contact createMany + */ + export type ContactCreateManyArgs = { + /** + * The data used to create many Contacts. + */ + data: Enumerable + skipDuplicates?: boolean + } + + + /** + * Contact update + */ + export type ContactUpdateArgs = { + /** + * Select specific fields to fetch from the Contact + */ + select?: ContactSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ContactInclude | null + /** + * The data needed to update a Contact. + */ + data: XOR + /** + * Choose, which Contact to update. + */ + where: ContactWhereUniqueInput + } + + + /** + * Contact updateMany + */ + export type ContactUpdateManyArgs = { + /** + * The data used to update Contacts. + */ + data: XOR + /** + * Filter which Contacts to update + */ + where?: ContactWhereInput + } + + + /** + * Contact upsert + */ + export type ContactUpsertArgs = { + /** + * Select specific fields to fetch from the Contact + */ + select?: ContactSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ContactInclude | null + /** + * The filter to search for the Contact to update in case it exists. + */ + where: ContactWhereUniqueInput + /** + * In case the Contact found by the `where` argument doesn't exist, create a new Contact with this data. + */ + create: XOR + /** + * In case the Contact was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + + /** + * Contact delete + */ + export type ContactDeleteArgs = { + /** + * Select specific fields to fetch from the Contact + */ + select?: ContactSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ContactInclude | null + /** + * Filter which Contact to delete. + */ + where: ContactWhereUniqueInput + } + + + /** + * Contact deleteMany + */ + export type ContactDeleteManyArgs = { + /** + * Filter which Contacts to delete + */ + where?: ContactWhereInput + } + + + /** + * Contact without action + */ + export type ContactArgs = { + /** + * Select specific fields to fetch from the Contact + */ + select?: ContactSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ContactInclude | null + } + + + + /** + * Enums + */ + + export const TransactionIsolationLevel: { + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', + Serializable: 'Serializable' + }; + + export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] + + + export const UserScalarFieldEnum: { + id: 'id', + firstName: 'firstName', + emailId: 'emailId', + lastName: 'lastName', + password: 'password', + createdAt: 'createdAt' + }; + + export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum] + + + export const ContactScalarFieldEnum: { + id: 'id', + name: 'name', + emailId: 'emailId', + street: 'street', + city: 'city', + zipcode: 'zipcode', + companyName: 'companyName', + phoneNumber: 'phoneNumber', + userId: 'userId' + }; + + export type ContactScalarFieldEnum = (typeof ContactScalarFieldEnum)[keyof typeof ContactScalarFieldEnum] + + + export const SortOrder: { + asc: 'asc', + desc: 'desc' + }; + + export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] + + + export const QueryMode: { + default: 'default', + insensitive: 'insensitive' + }; + + export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode] + + + /** + * Deep Input Types + */ + + + export type UserWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: IntFilter | number + firstName?: StringFilter | string + emailId?: StringFilter | string + lastName?: StringFilter | string + password?: StringFilter | string + createdAt?: DateTimeFilter | Date | string + contacts?: ContactListRelationFilter + } + + export type UserOrderByWithRelationInput = { + id?: SortOrder + firstName?: SortOrder + emailId?: SortOrder + lastName?: SortOrder + password?: SortOrder + createdAt?: SortOrder + contacts?: ContactOrderByRelationAggregateInput + } + + export type UserWhereUniqueInput = { + id?: number + emailId?: string + } + + export type UserOrderByWithAggregationInput = { + id?: SortOrder + firstName?: SortOrder + emailId?: SortOrder + lastName?: SortOrder + password?: SortOrder + createdAt?: SortOrder + _count?: UserCountOrderByAggregateInput + _avg?: UserAvgOrderByAggregateInput + _max?: UserMaxOrderByAggregateInput + _min?: UserMinOrderByAggregateInput + _sum?: UserSumOrderByAggregateInput + } + + export type UserScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: IntWithAggregatesFilter | number + firstName?: StringWithAggregatesFilter | string + emailId?: StringWithAggregatesFilter | string + lastName?: StringWithAggregatesFilter | string + password?: StringWithAggregatesFilter | string + createdAt?: DateTimeWithAggregatesFilter | Date | string + } + + export type ContactWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: IntFilter | number + name?: StringFilter | string + emailId?: StringFilter | string + street?: StringFilter | string + city?: StringFilter | string + zipcode?: IntFilter | number + companyName?: StringFilter | string + phoneNumber?: StringFilter | string + userId?: IntFilter | number + user?: XOR + } + + export type ContactOrderByWithRelationInput = { + id?: SortOrder + name?: SortOrder + emailId?: SortOrder + street?: SortOrder + city?: SortOrder + zipcode?: SortOrder + companyName?: SortOrder + phoneNumber?: SortOrder + userId?: SortOrder + user?: UserOrderByWithRelationInput + } + + export type ContactWhereUniqueInput = { + id?: number + } + + export type ContactOrderByWithAggregationInput = { + id?: SortOrder + name?: SortOrder + emailId?: SortOrder + street?: SortOrder + city?: SortOrder + zipcode?: SortOrder + companyName?: SortOrder + phoneNumber?: SortOrder + userId?: SortOrder + _count?: ContactCountOrderByAggregateInput + _avg?: ContactAvgOrderByAggregateInput + _max?: ContactMaxOrderByAggregateInput + _min?: ContactMinOrderByAggregateInput + _sum?: ContactSumOrderByAggregateInput + } + + export type ContactScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: IntWithAggregatesFilter | number + name?: StringWithAggregatesFilter | string + emailId?: StringWithAggregatesFilter | string + street?: StringWithAggregatesFilter | string + city?: StringWithAggregatesFilter | string + zipcode?: IntWithAggregatesFilter | number + companyName?: StringWithAggregatesFilter | string + phoneNumber?: StringWithAggregatesFilter | string + userId?: IntWithAggregatesFilter | number + } + + export type UserCreateInput = { + firstName: string + emailId: string + lastName: string + password: string + createdAt?: Date | string + contacts?: ContactCreateNestedManyWithoutUserInput + } + + export type UserUncheckedCreateInput = { + id?: number + firstName: string + emailId: string + lastName: string + password: string + createdAt?: Date | string + contacts?: ContactUncheckedCreateNestedManyWithoutUserInput + } + + export type UserUpdateInput = { + firstName?: StringFieldUpdateOperationsInput | string + emailId?: StringFieldUpdateOperationsInput | string + lastName?: StringFieldUpdateOperationsInput | string + password?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + contacts?: ContactUpdateManyWithoutUserNestedInput + } + + export type UserUncheckedUpdateInput = { + id?: IntFieldUpdateOperationsInput | number + firstName?: StringFieldUpdateOperationsInput | string + emailId?: StringFieldUpdateOperationsInput | string + lastName?: StringFieldUpdateOperationsInput | string + password?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + contacts?: ContactUncheckedUpdateManyWithoutUserNestedInput + } + + export type UserCreateManyInput = { + id?: number + firstName: string + emailId: string + lastName: string + password: string + createdAt?: Date | string + } + + export type UserUpdateManyMutationInput = { + firstName?: StringFieldUpdateOperationsInput | string + emailId?: StringFieldUpdateOperationsInput | string + lastName?: StringFieldUpdateOperationsInput | string + password?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type UserUncheckedUpdateManyInput = { + id?: IntFieldUpdateOperationsInput | number + firstName?: StringFieldUpdateOperationsInput | string + emailId?: StringFieldUpdateOperationsInput | string + lastName?: StringFieldUpdateOperationsInput | string + password?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type ContactCreateInput = { + name: string + emailId: string + street: string + city: string + zipcode: number + companyName: string + phoneNumber: string + user: UserCreateNestedOneWithoutContactsInput + } + + export type ContactUncheckedCreateInput = { + id?: number + name: string + emailId: string + street: string + city: string + zipcode: number + companyName: string + phoneNumber: string + userId: number + } + + export type ContactUpdateInput = { + name?: StringFieldUpdateOperationsInput | string + emailId?: StringFieldUpdateOperationsInput | string + street?: StringFieldUpdateOperationsInput | string + city?: StringFieldUpdateOperationsInput | string + zipcode?: IntFieldUpdateOperationsInput | number + companyName?: StringFieldUpdateOperationsInput | string + phoneNumber?: StringFieldUpdateOperationsInput | string + user?: UserUpdateOneRequiredWithoutContactsNestedInput + } + + export type ContactUncheckedUpdateInput = { + id?: IntFieldUpdateOperationsInput | number + name?: StringFieldUpdateOperationsInput | string + emailId?: StringFieldUpdateOperationsInput | string + street?: StringFieldUpdateOperationsInput | string + city?: StringFieldUpdateOperationsInput | string + zipcode?: IntFieldUpdateOperationsInput | number + companyName?: StringFieldUpdateOperationsInput | string + phoneNumber?: StringFieldUpdateOperationsInput | string + userId?: IntFieldUpdateOperationsInput | number + } + + export type ContactCreateManyInput = { + id?: number + name: string + emailId: string + street: string + city: string + zipcode: number + companyName: string + phoneNumber: string + userId: number + } + + export type ContactUpdateManyMutationInput = { + name?: StringFieldUpdateOperationsInput | string + emailId?: StringFieldUpdateOperationsInput | string + street?: StringFieldUpdateOperationsInput | string + city?: StringFieldUpdateOperationsInput | string + zipcode?: IntFieldUpdateOperationsInput | number + companyName?: StringFieldUpdateOperationsInput | string + phoneNumber?: StringFieldUpdateOperationsInput | string + } + + export type ContactUncheckedUpdateManyInput = { + id?: IntFieldUpdateOperationsInput | number + name?: StringFieldUpdateOperationsInput | string + emailId?: StringFieldUpdateOperationsInput | string + street?: StringFieldUpdateOperationsInput | string + city?: StringFieldUpdateOperationsInput | string + zipcode?: IntFieldUpdateOperationsInput | number + companyName?: StringFieldUpdateOperationsInput | string + phoneNumber?: StringFieldUpdateOperationsInput | string + userId?: IntFieldUpdateOperationsInput | number + } + + export type IntFilter = { + equals?: number + in?: Enumerable | number + notIn?: Enumerable | number + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedIntFilter | number + } + + export type StringFilter = { + equals?: string + in?: Enumerable | string + notIn?: Enumerable | string + lt?: string + lte?: string + gt?: string + gte?: string + contains?: string + startsWith?: string + endsWith?: string + mode?: QueryMode + not?: NestedStringFilter | string + } + + export type DateTimeFilter = { + equals?: Date | string + in?: Enumerable | Enumerable | Date | string + notIn?: Enumerable | Enumerable | Date | string + lt?: Date | string + lte?: Date | string + gt?: Date | string + gte?: Date | string + not?: NestedDateTimeFilter | Date | string + } + + export type ContactListRelationFilter = { + every?: ContactWhereInput + some?: ContactWhereInput + none?: ContactWhereInput + } + + export type ContactOrderByRelationAggregateInput = { + _count?: SortOrder + } + + export type UserCountOrderByAggregateInput = { + id?: SortOrder + firstName?: SortOrder + emailId?: SortOrder + lastName?: SortOrder + password?: SortOrder + createdAt?: SortOrder + } + + export type UserAvgOrderByAggregateInput = { + id?: SortOrder + } + + export type UserMaxOrderByAggregateInput = { + id?: SortOrder + firstName?: SortOrder + emailId?: SortOrder + lastName?: SortOrder + password?: SortOrder + createdAt?: SortOrder + } + + export type UserMinOrderByAggregateInput = { + id?: SortOrder + firstName?: SortOrder + emailId?: SortOrder + lastName?: SortOrder + password?: SortOrder + createdAt?: SortOrder + } + + export type UserSumOrderByAggregateInput = { + id?: SortOrder + } + + export type IntWithAggregatesFilter = { + equals?: number + in?: Enumerable | number + notIn?: Enumerable | number + 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 | string + notIn?: Enumerable | string + 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 DateTimeWithAggregatesFilter = { + equals?: Date | string + in?: Enumerable | Enumerable | Date | string + notIn?: Enumerable | Enumerable | Date | string + lt?: Date | string + lte?: Date | string + gt?: Date | string + gte?: Date | string + not?: NestedDateTimeWithAggregatesFilter | Date | string + _count?: NestedIntFilter + _min?: NestedDateTimeFilter + _max?: NestedDateTimeFilter + } + + export type UserRelationFilter = { + is?: UserWhereInput | null + isNot?: UserWhereInput | null + } + + export type ContactCountOrderByAggregateInput = { + id?: SortOrder + name?: SortOrder + emailId?: SortOrder + street?: SortOrder + city?: SortOrder + zipcode?: SortOrder + companyName?: SortOrder + phoneNumber?: SortOrder + userId?: SortOrder + } + + export type ContactAvgOrderByAggregateInput = { + id?: SortOrder + zipcode?: SortOrder + userId?: SortOrder + } + + export type ContactMaxOrderByAggregateInput = { + id?: SortOrder + name?: SortOrder + emailId?: SortOrder + street?: SortOrder + city?: SortOrder + zipcode?: SortOrder + companyName?: SortOrder + phoneNumber?: SortOrder + userId?: SortOrder + } + + export type ContactMinOrderByAggregateInput = { + id?: SortOrder + name?: SortOrder + emailId?: SortOrder + street?: SortOrder + city?: SortOrder + zipcode?: SortOrder + companyName?: SortOrder + phoneNumber?: SortOrder + userId?: SortOrder + } + + export type ContactSumOrderByAggregateInput = { + id?: SortOrder + zipcode?: SortOrder + userId?: SortOrder + } + + export type ContactCreateNestedManyWithoutUserInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + createMany?: ContactCreateManyUserInputEnvelope + connect?: Enumerable + } + + export type ContactUncheckedCreateNestedManyWithoutUserInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + createMany?: ContactCreateManyUserInputEnvelope + connect?: Enumerable + } + + export type StringFieldUpdateOperationsInput = { + set?: string + } + + export type DateTimeFieldUpdateOperationsInput = { + set?: Date | string + } + + export type ContactUpdateManyWithoutUserNestedInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + upsert?: Enumerable + createMany?: ContactCreateManyUserInputEnvelope + 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 ContactUncheckedUpdateManyWithoutUserNestedInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + upsert?: Enumerable + createMany?: ContactCreateManyUserInputEnvelope + set?: Enumerable + disconnect?: Enumerable + delete?: Enumerable + connect?: Enumerable + update?: Enumerable + updateMany?: Enumerable + deleteMany?: Enumerable + } + + export type UserCreateNestedOneWithoutContactsInput = { + create?: XOR + connectOrCreate?: UserCreateOrConnectWithoutContactsInput + connect?: UserWhereUniqueInput + } + + export type UserUpdateOneRequiredWithoutContactsNestedInput = { + create?: XOR + connectOrCreate?: UserCreateOrConnectWithoutContactsInput + upsert?: UserUpsertWithoutContactsInput + connect?: UserWhereUniqueInput + update?: XOR + } + + export type NestedIntFilter = { + equals?: number + in?: Enumerable | number + notIn?: Enumerable | number + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedIntFilter | number + } + + export type NestedStringFilter = { + equals?: string + in?: Enumerable | string + notIn?: Enumerable | string + lt?: string + lte?: string + gt?: string + gte?: string + contains?: string + startsWith?: string + endsWith?: string + not?: NestedStringFilter | string + } + + export type NestedDateTimeFilter = { + equals?: Date | string + in?: Enumerable | Enumerable | Date | string + notIn?: Enumerable | Enumerable | Date | string + lt?: Date | string + lte?: Date | string + gt?: Date | string + gte?: Date | string + not?: NestedDateTimeFilter | Date | string + } + + export type NestedIntWithAggregatesFilter = { + equals?: number + in?: Enumerable | number + notIn?: Enumerable | number + 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 | number + notIn?: Enumerable | number + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedFloatFilter | number + } + + export type NestedStringWithAggregatesFilter = { + equals?: string + in?: Enumerable | string + notIn?: Enumerable | string + 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 NestedDateTimeWithAggregatesFilter = { + equals?: Date | string + in?: Enumerable | Enumerable | Date | string + notIn?: Enumerable | Enumerable | Date | string + lt?: Date | string + lte?: Date | string + gt?: Date | string + gte?: Date | string + not?: NestedDateTimeWithAggregatesFilter | Date | string + _count?: NestedIntFilter + _min?: NestedDateTimeFilter + _max?: NestedDateTimeFilter + } + + export type ContactCreateWithoutUserInput = { + name: string + emailId: string + street: string + city: string + zipcode: number + companyName: string + phoneNumber: string + } + + export type ContactUncheckedCreateWithoutUserInput = { + id?: number + name: string + emailId: string + street: string + city: string + zipcode: number + companyName: string + phoneNumber: string + } + + export type ContactCreateOrConnectWithoutUserInput = { + where: ContactWhereUniqueInput + create: XOR + } + + export type ContactCreateManyUserInputEnvelope = { + data: Enumerable + skipDuplicates?: boolean + } + + export type ContactUpsertWithWhereUniqueWithoutUserInput = { + where: ContactWhereUniqueInput + update: XOR + create: XOR + } + + export type ContactUpdateWithWhereUniqueWithoutUserInput = { + where: ContactWhereUniqueInput + data: XOR + } + + export type ContactUpdateManyWithWhereWithoutUserInput = { + where: ContactScalarWhereInput + data: XOR + } + + export type ContactScalarWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: IntFilter | number + name?: StringFilter | string + emailId?: StringFilter | string + street?: StringFilter | string + city?: StringFilter | string + zipcode?: IntFilter | number + companyName?: StringFilter | string + phoneNumber?: StringFilter | string + userId?: IntFilter | number + } + + export type UserCreateWithoutContactsInput = { + firstName: string + emailId: string + lastName: string + password: string + createdAt?: Date | string + } + + export type UserUncheckedCreateWithoutContactsInput = { + id?: number + firstName: string + emailId: string + lastName: string + password: string + createdAt?: Date | string + } + + export type UserCreateOrConnectWithoutContactsInput = { + where: UserWhereUniqueInput + create: XOR + } + + export type UserUpsertWithoutContactsInput = { + update: XOR + create: XOR + } + + export type UserUpdateWithoutContactsInput = { + firstName?: StringFieldUpdateOperationsInput | string + emailId?: StringFieldUpdateOperationsInput | string + lastName?: StringFieldUpdateOperationsInput | string + password?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type UserUncheckedUpdateWithoutContactsInput = { + id?: IntFieldUpdateOperationsInput | number + firstName?: StringFieldUpdateOperationsInput | string + emailId?: StringFieldUpdateOperationsInput | string + lastName?: StringFieldUpdateOperationsInput | string + password?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type ContactCreateManyUserInput = { + id?: number + name: string + emailId: string + street: string + city: string + zipcode: number + companyName: string + phoneNumber: string + } + + export type ContactUpdateWithoutUserInput = { + name?: StringFieldUpdateOperationsInput | string + emailId?: StringFieldUpdateOperationsInput | string + street?: StringFieldUpdateOperationsInput | string + city?: StringFieldUpdateOperationsInput | string + zipcode?: IntFieldUpdateOperationsInput | number + companyName?: StringFieldUpdateOperationsInput | string + phoneNumber?: StringFieldUpdateOperationsInput | string + } + + export type ContactUncheckedUpdateWithoutUserInput = { + id?: IntFieldUpdateOperationsInput | number + name?: StringFieldUpdateOperationsInput | string + emailId?: StringFieldUpdateOperationsInput | string + street?: StringFieldUpdateOperationsInput | string + city?: StringFieldUpdateOperationsInput | string + zipcode?: IntFieldUpdateOperationsInput | number + companyName?: StringFieldUpdateOperationsInput | string + phoneNumber?: StringFieldUpdateOperationsInput | string + } + + export type ContactUncheckedUpdateManyWithoutContactsInput = { + id?: IntFieldUpdateOperationsInput | number + name?: StringFieldUpdateOperationsInput | string + emailId?: StringFieldUpdateOperationsInput | string + street?: StringFieldUpdateOperationsInput | string + city?: StringFieldUpdateOperationsInput | string + zipcode?: IntFieldUpdateOperationsInput | number + companyName?: StringFieldUpdateOperationsInput | string + phoneNumber?: StringFieldUpdateOperationsInput | string + } + + + + /** + * Batch Payload for updateMany & deleteMany & createMany + */ + + export type BatchPayload = { + count: number + } + + /** + * DMMF + */ + export const dmmf: runtime.BaseDMMF +} \ No newline at end of file diff --git a/uc-controller-user/controller-user/prisma/prismaAuthUserClient/index.js b/uc-controller-user/controller-user/prisma/prismaAuthUserClient/index.js new file mode 100644 index 0000000..e63215b --- /dev/null +++ b/uc-controller-user/controller-user/prisma/prismaAuthUserClient/index.js @@ -0,0 +1,197 @@ + +Object.defineProperty(exports, "__esModule", { value: true }); + +const { + PrismaClientKnownRequestError, + PrismaClientUnknownRequestError, + PrismaClientRustPanicError, + PrismaClientInitializationError, + PrismaClientValidationError, + NotFoundError, + decompressFromBase64, + getPrismaClient, + sqltag, + empty, + join, + raw, + Decimal, + Debug, + objectEnumValues, + makeStrictEnum, + Extensions, + warnOnce, + defineDmmfProperty, + Public, +} = require('./runtime/library') + + +const Prisma = {} + +exports.Prisma = Prisma + +/** + * Prisma Client JS version: 4.16.2 + * Query Engine version: 4bc8b6e1b66cb932731fb1bdbbc550d1e010de81 + */ +Prisma.prismaVersion = { + client: "4.16.2", + engine: "4bc8b6e1b66cb932731fb1bdbbc550d1e010de81" +} + +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 = Public.validator + +/** +* Extensions +*/ +Prisma.getExtensionContext = Extensions.getExtensionContext +Prisma.defineExtension = Extensions.defineExtension + +/** + * 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') + +/** + * Enums + */ + +exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', + Serializable: 'Serializable' +}); + +exports.Prisma.UserScalarFieldEnum = { + id: 'id', + firstName: 'firstName', + emailId: 'emailId', + lastName: 'lastName', + password: 'password', + createdAt: 'createdAt' +}; + +exports.Prisma.ContactScalarFieldEnum = { + id: 'id', + name: 'name', + emailId: 'emailId', + street: 'street', + city: 'city', + zipcode: 'zipcode', + companyName: 'companyName', + phoneNumber: 'phoneNumber', + userId: 'userId' +}; + +exports.Prisma.SortOrder = { + asc: 'asc', + desc: 'desc' +}; + +exports.Prisma.QueryMode = { + default: 'default', + insensitive: 'insensitive' +}; + + +exports.Prisma.ModelName = { + User: 'User', + Contact: 'Contact' +}; +/** + * Create the Client + */ +const config = { + "generator": { + "name": "client", + "provider": { + "fromEnvVar": null, + "value": "prisma-client-js" + }, + "output": { + "value": "/home/uc_user/controller-user/prisma/prismaAuthUserClient", + "fromEnvVar": null + }, + "config": { + "engineType": "library" + }, + "binaryTargets": [ + { + "fromEnvVar": null, + "value": "linux-musl-openssl-3.0.x", + "native": true + } + ], + "previewFeatures": [], + "isCustomOutput": true + }, + "relativeEnvPaths": { + "rootEnvPath": null + }, + "relativePath": "..", + "clientVersion": "4.16.2", + "engineVersion": "4bc8b6e1b66cb932731fb1bdbbc550d1e010de81", + "datasourceNames": [ + "db" + ], + "activeProvider": "postgresql", + "dataProxy": false +} + +const fs = require('fs') + +config.dirname = __dirname +if (!fs.existsSync(path.join(__dirname, 'schema.prisma'))) { + config.dirname = path.join(process.cwd(), "prisma/prismaAuthUserClient") + config.isBundled = true +} + +config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"dbName\":\"user\",\"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\":\"firstName\",\"dbName\":\"first_name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"emailId\",\"dbName\":\"email_id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastName\",\"dbName\":\"last_name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"password\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"contacts\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Contact\",\"relationName\":\"ContactToUser\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Contact\":{\"dbName\":\"contact\",\"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\":\"emailId\",\"dbName\":\"email_id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"street\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"zipcode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"companyName\",\"dbName\":\"company_name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"phoneNumber\",\"dbName\":\"phone_number\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"user\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"relationName\":\"ContactToUser\",\"relationFromFields\":[\"userId\"],\"relationToFields\":[\"id\"],\"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}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false}},\"enums\":{\"Role\":{\"values\":[{\"name\":\"CLIENT\",\"dbName\":null},{\"name\":\"ADMIN\",\"dbName\":null},{\"name\":\"ROOT\",\"dbName\":null}],\"dbName\":null}},\"types\":{}}") +defineDmmfProperty(exports.Prisma, config.runtimeDataModel) + + + + + +const { warnEnvConflicts } = require('./runtime/library') + +warnEnvConflicts({ + rootEnvPath: config.relativeEnvPaths.rootEnvPath && path.resolve(config.dirname, config.relativeEnvPaths.rootEnvPath), + schemaEnvPath: config.relativeEnvPaths.schemaEnvPath && path.resolve(config.dirname, config.relativeEnvPaths.schemaEnvPath) +}) + + +const PrismaClient = getPrismaClient(config) +exports.PrismaClient = PrismaClient +Object.assign(exports, Prisma) + +path.join(__dirname, "libquery_engine-linux-musl-openssl-3.0.x.so.node"); +path.join(process.cwd(), "prisma/prismaAuthUserClient/libquery_engine-linux-musl-openssl-3.0.x.so.node") +path.join(__dirname, "schema.prisma"); +path.join(process.cwd(), "prisma/prismaAuthUserClient/schema.prisma") diff --git a/uc-controller-user/controller-user/prisma/prismaAuthUserClient/libquery_engine-linux-musl-openssl-3.0.x.so.node b/uc-controller-user/controller-user/prisma/prismaAuthUserClient/libquery_engine-linux-musl-openssl-3.0.x.so.node new file mode 100755 index 0000000..ec8d2ab Binary files /dev/null and b/uc-controller-user/controller-user/prisma/prismaAuthUserClient/libquery_engine-linux-musl-openssl-3.0.x.so.node differ diff --git a/uc-controller-user/controller-user/prisma/prismaAuthUserClient/package.json b/uc-controller-user/controller-user/prisma/prismaAuthUserClient/package.json new file mode 100644 index 0000000..da6bb21 --- /dev/null +++ b/uc-controller-user/controller-user/prisma/prismaAuthUserClient/package.json @@ -0,0 +1,7 @@ +{ + "name": ".prisma/client", + "main": "index.js", + "types": "index.d.ts", + "browser": "index-browser.js", + "sideEffects": false +} \ No newline at end of file diff --git a/uc-controller-user/controller-user/prisma/prismaAuthUserClient/runtime/index-browser.d.ts b/uc-controller-user/controller-user/prisma/prismaAuthUserClient/runtime/index-browser.d.ts new file mode 100644 index 0000000..f7103ad --- /dev/null +++ b/uc-controller-user/controller-user/prisma/prismaAuthUserClient/runtime/index-browser.d.ts @@ -0,0 +1,355 @@ +declare class AnyNull extends NullTypesEnumValue { +} + +declare type Args = T extends { + [K: symbol]: { + types: { + operations: { + [K in F]: { + args: any; + }; + }; + }; + }; +} ? T[symbol]['types']['operations'][F]['args'] : never; + +declare class DbNull extends NullTypesEnumValue { +} + +export declare namespace Decimal { + export type Constructor = typeof Decimal; + export type Instance = Decimal; + export type Rounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; + export type Modulo = Rounding | 9; + export type Value = string | number | Decimal; + + // http://mikemcl.github.io/decimal.js/#constructor-properties + export interface Config { + precision?: number; + rounding?: Rounding; + toExpNeg?: number; + toExpPos?: number; + minE?: number; + maxE?: number; + crypto?: boolean; + modulo?: Modulo; + defaults?: boolean; + } +} + +export declare class Decimal { + readonly d: number[]; + readonly e: number; + readonly s: number; + + constructor(n: Decimal.Value); + + absoluteValue(): Decimal; + abs(): Decimal; + + ceil(): Decimal; + + clampedTo(min: Decimal.Value, max: Decimal.Value): Decimal; + clamp(min: Decimal.Value, max: Decimal.Value): Decimal; + + comparedTo(n: Decimal.Value): number; + cmp(n: Decimal.Value): number; + + cosine(): Decimal; + cos(): Decimal; + + cubeRoot(): Decimal; + cbrt(): Decimal; + + decimalPlaces(): number; + dp(): number; + + dividedBy(n: Decimal.Value): Decimal; + div(n: Decimal.Value): Decimal; + + dividedToIntegerBy(n: Decimal.Value): Decimal; + divToInt(n: Decimal.Value): Decimal; + + equals(n: Decimal.Value): boolean; + eq(n: Decimal.Value): boolean; + + floor(): Decimal; + + greaterThan(n: Decimal.Value): boolean; + gt(n: Decimal.Value): boolean; + + greaterThanOrEqualTo(n: Decimal.Value): boolean; + gte(n: Decimal.Value): boolean; + + hyperbolicCosine(): Decimal; + cosh(): Decimal; + + hyperbolicSine(): Decimal; + sinh(): Decimal; + + hyperbolicTangent(): Decimal; + tanh(): Decimal; + + inverseCosine(): Decimal; + acos(): Decimal; + + inverseHyperbolicCosine(): Decimal; + acosh(): Decimal; + + inverseHyperbolicSine(): Decimal; + asinh(): Decimal; + + inverseHyperbolicTangent(): Decimal; + atanh(): Decimal; + + inverseSine(): Decimal; + asin(): Decimal; + + inverseTangent(): Decimal; + atan(): Decimal; + + isFinite(): boolean; + + isInteger(): boolean; + isInt(): boolean; + + isNaN(): boolean; + + isNegative(): boolean; + isNeg(): boolean; + + isPositive(): boolean; + isPos(): boolean; + + isZero(): boolean; + + lessThan(n: Decimal.Value): boolean; + lt(n: Decimal.Value): boolean; + + lessThanOrEqualTo(n: Decimal.Value): boolean; + lte(n: Decimal.Value): boolean; + + logarithm(n?: Decimal.Value): Decimal; + log(n?: Decimal.Value): Decimal; + + minus(n: Decimal.Value): Decimal; + sub(n: Decimal.Value): Decimal; + + modulo(n: Decimal.Value): Decimal; + mod(n: Decimal.Value): Decimal; + + naturalExponential(): Decimal; + exp(): Decimal; + + naturalLogarithm(): Decimal; + ln(): Decimal; + + negated(): Decimal; + neg(): Decimal; + + plus(n: Decimal.Value): Decimal; + add(n: Decimal.Value): Decimal; + + precision(includeZeros?: boolean): number; + sd(includeZeros?: boolean): number; + + round(): Decimal; + + sine() : Decimal; + sin() : Decimal; + + squareRoot(): Decimal; + sqrt(): Decimal; + + tangent() : Decimal; + tan() : Decimal; + + times(n: Decimal.Value): Decimal; + mul(n: Decimal.Value) : Decimal; + + toBinary(significantDigits?: number): string; + toBinary(significantDigits: number, rounding: Decimal.Rounding): string; + + toDecimalPlaces(decimalPlaces?: number): Decimal; + toDecimalPlaces(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; + toDP(decimalPlaces?: number): Decimal; + toDP(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; + + toExponential(decimalPlaces?: number): string; + toExponential(decimalPlaces: number, rounding: Decimal.Rounding): string; + + toFixed(decimalPlaces?: number): string; + toFixed(decimalPlaces: number, rounding: Decimal.Rounding): string; + + toFraction(max_denominator?: Decimal.Value): Decimal[]; + + toHexadecimal(significantDigits?: number): string; + toHexadecimal(significantDigits: number, rounding: Decimal.Rounding): string; + toHex(significantDigits?: number): string; + toHex(significantDigits: number, rounding?: Decimal.Rounding): string; + + toJSON(): string; + + toNearest(n: Decimal.Value, rounding?: Decimal.Rounding): Decimal; + + toNumber(): number; + + toOctal(significantDigits?: number): string; + toOctal(significantDigits: number, rounding: Decimal.Rounding): string; + + toPower(n: Decimal.Value): Decimal; + pow(n: Decimal.Value): Decimal; + + toPrecision(significantDigits?: number): string; + toPrecision(significantDigits: number, rounding: Decimal.Rounding): string; + + toSignificantDigits(significantDigits?: number): Decimal; + toSignificantDigits(significantDigits: number, rounding: Decimal.Rounding): Decimal; + toSD(significantDigits?: number): Decimal; + toSD(significantDigits: number, rounding: Decimal.Rounding): Decimal; + + toString(): string; + + truncated(): Decimal; + trunc(): Decimal; + + valueOf(): string; + + static abs(n: Decimal.Value): Decimal; + static acos(n: Decimal.Value): Decimal; + static acosh(n: Decimal.Value): Decimal; + static add(x: Decimal.Value, y: Decimal.Value): Decimal; + static asin(n: Decimal.Value): Decimal; + static asinh(n: Decimal.Value): Decimal; + static atan(n: Decimal.Value): Decimal; + static atanh(n: Decimal.Value): Decimal; + static atan2(y: Decimal.Value, x: Decimal.Value): Decimal; + static cbrt(n: Decimal.Value): Decimal; + static ceil(n: Decimal.Value): Decimal; + static clamp(n: Decimal.Value, min: Decimal.Value, max: Decimal.Value): Decimal; + static clone(object?: Decimal.Config): Decimal.Constructor; + static config(object: Decimal.Config): Decimal.Constructor; + static cos(n: Decimal.Value): Decimal; + static cosh(n: Decimal.Value): Decimal; + static div(x: Decimal.Value, y: Decimal.Value): Decimal; + static exp(n: Decimal.Value): Decimal; + static floor(n: Decimal.Value): Decimal; + static hypot(...n: Decimal.Value[]): Decimal; + static isDecimal(object: any): object is Decimal; + static ln(n: Decimal.Value): Decimal; + static log(n: Decimal.Value, base?: Decimal.Value): Decimal; + static log2(n: Decimal.Value): Decimal; + static log10(n: Decimal.Value): Decimal; + static max(...n: Decimal.Value[]): Decimal; + static min(...n: Decimal.Value[]): Decimal; + static mod(x: Decimal.Value, y: Decimal.Value): Decimal; + static mul(x: Decimal.Value, y: Decimal.Value): Decimal; + static noConflict(): Decimal.Constructor; // Browser only + static pow(base: Decimal.Value, exponent: Decimal.Value): Decimal; + static random(significantDigits?: number): Decimal; + static round(n: Decimal.Value): Decimal; + static set(object: Decimal.Config): Decimal.Constructor; + static sign(n: Decimal.Value): number; + static sin(n: Decimal.Value): Decimal; + static sinh(n: Decimal.Value): Decimal; + static sqrt(n: Decimal.Value): Decimal; + static sub(x: Decimal.Value, y: Decimal.Value): Decimal; + static sum(...n: Decimal.Value[]): Decimal; + static tan(n: Decimal.Value): Decimal; + static tanh(n: Decimal.Value): Decimal; + static trunc(n: Decimal.Value): Decimal; + + static readonly default?: Decimal.Constructor; + static readonly Decimal?: Decimal.Constructor; + + static readonly precision: number; + static readonly rounding: Decimal.Rounding; + static readonly toExpNeg: number; + static readonly toExpPos: number; + static readonly minE: number; + static readonly maxE: number; + static readonly crypto: boolean; + static readonly modulo: Decimal.Modulo; + + static readonly ROUND_UP: 0; + static readonly ROUND_DOWN: 1; + static readonly ROUND_CEIL: 2; + static readonly ROUND_FLOOR: 3; + static readonly ROUND_HALF_UP: 4; + static readonly ROUND_HALF_DOWN: 5; + static readonly ROUND_HALF_EVEN: 6; + static readonly ROUND_HALF_CEIL: 7; + static readonly ROUND_HALF_FLOOR: 8; + static readonly EUCLID: 9; +} + +declare type Exact = (W extends A ? { + [K in keyof W]: K extends keyof A ? Exact : never; +} : W) | (A extends Narrowable ? A : never); + +declare class JsonNull extends NullTypesEnumValue { +} + +/** + * Generates more strict variant of an enum which, unlike regular enum, + * throws on non-existing property access. This can be useful in following situations: + * - we have an API, that accepts both `undefined` and `SomeEnumType` as an input + * - enum values are generated dynamically from DMMF. + * + * In that case, if using normal enums and no compile-time typechecking, using non-existing property + * will result in `undefined` value being used, which will be accepted. Using strict enum + * in this case will help to have a runtime exception, telling you that you are probably doing something wrong. + * + * Note: if you need to check for existence of a value in the enum you can still use either + * `in` operator or `hasOwnProperty` function. + * + * @param definition + * @returns + */ +export declare function makeStrictEnum>(definition: T): T; + +declare type Narrowable = string | number | bigint | boolean | []; + +declare class NullTypesEnumValue extends ObjectEnumValue { + _getNamespace(): string; +} + +/** + * Base class for unique values of object-valued enums. + */ +declare abstract class ObjectEnumValue { + constructor(arg?: symbol); + abstract _getNamespace(): string; + _getName(): string; + toString(): string; +} + +export declare const objectEnumValues: { + classes: { + DbNull: typeof DbNull; + JsonNull: typeof JsonNull; + AnyNull: typeof AnyNull; + }; + instances: { + DbNull: DbNull; + JsonNull: JsonNull; + AnyNull: AnyNull; + }; +}; + +declare type Operation = 'findFirst' | 'findFirstOrThrow' | 'findUnique' | 'findUniqueOrThrow' | 'findMany' | 'create' | 'createMany' | 'update' | 'updateMany' | 'upsert' | 'delete' | 'deleteMany' | 'aggregate' | 'count' | 'groupBy' | '$queryRaw' | '$executeRaw' | '$queryRawUnsafe' | '$executeRawUnsafe' | 'findRaw' | 'aggregateRaw' | '$runCommandRaw'; + +declare namespace Public { + export { + validator + } +} +export { Public } + +declare function validator(): (select: Exact) => S; + +declare function validator, O extends keyof C[M] & Operation>(client: C, model: M, operation: O): (select: Exact>) => S; + +declare function validator, O extends keyof C[M] & Operation, P extends keyof Args>(client: C, model: M, operation: O, prop: P): (select: Exact[P]>) => S; + +export { } diff --git a/uc-controller-user/controller-user/prisma/prismaAuthUserClient/runtime/index-browser.js b/uc-controller-user/controller-user/prisma/prismaAuthUserClient/runtime/index-browser.js new file mode 100644 index 0000000..f0c1cb1 --- /dev/null +++ b/uc-controller-user/controller-user/prisma/prismaAuthUserClient/runtime/index-browser.js @@ -0,0 +1,2424 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod2) => __copyProps(__defProp({}, "__esModule", { value: true }), mod2); + +// src/runtime/index-browser.ts +var index_browser_exports = {}; +__export(index_browser_exports, { + Decimal: () => decimal_default, + Public: () => public_exports, + makeStrictEnum: () => makeStrictEnum, + objectEnumValues: () => objectEnumValues +}); +module.exports = __toCommonJS(index_browser_exports); + +// src/runtime/core/public/index.ts +var public_exports = {}; +__export(public_exports, { + validator: () => validator +}); + +// src/runtime/core/public/validator.ts +function validator(..._args) { + return (args) => args; +} + +// src/runtime/object-enums.ts +var secret = Symbol(); +var representations = /* @__PURE__ */ new WeakMap(); +var ObjectEnumValue = class { + constructor(arg) { + if (arg === secret) { + representations.set(this, `Prisma.${this._getName()}`); + } else { + representations.set(this, `new Prisma.${this._getNamespace()}.${this._getName()}()`); + } + } + _getName() { + return this.constructor.name; + } + toString() { + return representations.get(this); + } +}; +var NullTypesEnumValue = class extends ObjectEnumValue { + _getNamespace() { + return "NullTypes"; + } +}; +var DbNull = class extends NullTypesEnumValue { +}; +setClassName(DbNull, "DbNull"); +var JsonNull = class extends NullTypesEnumValue { +}; +setClassName(JsonNull, "JsonNull"); +var AnyNull = class extends NullTypesEnumValue { +}; +setClassName(AnyNull, "AnyNull"); +var objectEnumValues = { + classes: { + DbNull, + JsonNull, + AnyNull + }, + instances: { + DbNull: new DbNull(secret), + JsonNull: new JsonNull(secret), + AnyNull: new AnyNull(secret) + } +}; +function setClassName(classObject, name) { + Object.defineProperty(classObject, "name", { + value: name, + configurable: true + }); +} + +// src/runtime/strictEnum.ts +var allowList = /* @__PURE__ */ new Set([ + "toJSON", + "$$typeof", + "asymmetricMatch", + Symbol.iterator, + Symbol.toStringTag, + Symbol.isConcatSpreadable, + Symbol.toPrimitive +]); +function makeStrictEnum(definition) { + return new Proxy(definition, { + get(target, property) { + if (property in target) { + return target[property]; + } + if (allowList.has(property)) { + return void 0; + } + throw new TypeError(`Invalid enum value: ${String(property)}`); + } + }); +} + +// ../../node_modules/.pnpm/decimal.js@10.4.3/node_modules/decimal.js/decimal.mjs +var EXP_LIMIT = 9e15; +var MAX_DIGITS = 1e9; +var NUMERALS = "0123456789abcdef"; +var LN10 = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058"; +var PI = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789"; +var DEFAULTS = { + precision: 20, + rounding: 4, + modulo: 1, + toExpNeg: -7, + toExpPos: 21, + minE: -EXP_LIMIT, + maxE: EXP_LIMIT, + crypto: false +}; +var inexact; +var quadrant; +var external = true; +var decimalError = "[DecimalError] "; +var invalidArgument = decimalError + "Invalid argument: "; +var precisionLimitExceeded = decimalError + "Precision limit exceeded"; +var cryptoUnavailable = decimalError + "crypto unavailable"; +var tag = "[object Decimal]"; +var mathfloor = Math.floor; +var mathpow = Math.pow; +var isBinary = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i; +var isHex = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i; +var isOctal = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i; +var isDecimal = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i; +var BASE = 1e7; +var LOG_BASE = 7; +var MAX_SAFE_INTEGER = 9007199254740991; +var LN10_PRECISION = LN10.length - 1; +var PI_PRECISION = PI.length - 1; +var P = { toStringTag: tag }; +P.absoluteValue = P.abs = function() { + var x = new this.constructor(this); + if (x.s < 0) + x.s = 1; + return finalise(x); +}; +P.ceil = function() { + return finalise(new this.constructor(this), this.e + 1, 2); +}; +P.clampedTo = P.clamp = function(min2, max2) { + var k, x = this, Ctor = x.constructor; + min2 = new Ctor(min2); + max2 = new Ctor(max2); + if (!min2.s || !max2.s) + return new Ctor(NaN); + if (min2.gt(max2)) + throw Error(invalidArgument + max2); + k = x.cmp(min2); + return k < 0 ? min2 : x.cmp(max2) > 0 ? max2 : new Ctor(x); +}; +P.comparedTo = P.cmp = function(y) { + var i, j, xdL, ydL, x = this, xd = x.d, yd = (y = new x.constructor(y)).d, xs = x.s, ys = y.s; + if (!xd || !yd) { + return !xs || !ys ? NaN : xs !== ys ? xs : xd === yd ? 0 : !xd ^ xs < 0 ? 1 : -1; + } + if (!xd[0] || !yd[0]) + return xd[0] ? xs : yd[0] ? -ys : 0; + if (xs !== ys) + return xs; + if (x.e !== y.e) + return x.e > y.e ^ xs < 0 ? 1 : -1; + xdL = xd.length; + ydL = yd.length; + for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) { + if (xd[i] !== yd[i]) + return xd[i] > yd[i] ^ xs < 0 ? 1 : -1; + } + return xdL === ydL ? 0 : xdL > ydL ^ xs < 0 ? 1 : -1; +}; +P.cosine = P.cos = function() { + var pr, rm, x = this, Ctor = x.constructor; + if (!x.d) + return new Ctor(NaN); + if (!x.d[0]) + return new Ctor(1); + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE; + Ctor.rounding = 1; + x = cosine(Ctor, toLessThanHalfPi(Ctor, x)); + Ctor.precision = pr; + Ctor.rounding = rm; + return finalise(quadrant == 2 || quadrant == 3 ? x.neg() : x, pr, rm, true); +}; +P.cubeRoot = P.cbrt = function() { + var e, m, n, r, rep, s, sd, t, t3, t3plusx, x = this, Ctor = x.constructor; + if (!x.isFinite() || x.isZero()) + return new Ctor(x); + external = false; + s = x.s * mathpow(x.s * x, 1 / 3); + if (!s || Math.abs(s) == 1 / 0) { + n = digitsToString(x.d); + e = x.e; + if (s = (e - n.length + 1) % 3) + n += s == 1 || s == -2 ? "0" : "00"; + s = mathpow(n, 1 / 3); + e = mathfloor((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2)); + if (s == 1 / 0) { + n = "5e" + e; + } else { + n = s.toExponential(); + n = n.slice(0, n.indexOf("e") + 1) + e; + } + r = new Ctor(n); + r.s = x.s; + } else { + r = new Ctor(s.toString()); + } + sd = (e = Ctor.precision) + 3; + for (; ; ) { + t = r; + t3 = t.times(t).times(t); + t3plusx = t3.plus(x); + r = divide(t3plusx.plus(x).times(t), t3plusx.plus(t3), sd + 2, 1); + if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) { + n = n.slice(sd - 3, sd + 1); + if (n == "9999" || !rep && n == "4999") { + if (!rep) { + finalise(t, e + 1, 0); + if (t.times(t).times(t).eq(x)) { + r = t; + break; + } + } + sd += 4; + rep = 1; + } else { + if (!+n || !+n.slice(1) && n.charAt(0) == "5") { + finalise(r, e + 1, 1); + m = !r.times(r).times(r).eq(x); + } + break; + } + } + } + external = true; + return finalise(r, e, Ctor.rounding, m); +}; +P.decimalPlaces = P.dp = function() { + var w, d = this.d, n = NaN; + if (d) { + w = d.length - 1; + n = (w - mathfloor(this.e / LOG_BASE)) * LOG_BASE; + w = d[w]; + if (w) + for (; w % 10 == 0; w /= 10) + n--; + if (n < 0) + n = 0; + } + return n; +}; +P.dividedBy = P.div = function(y) { + return divide(this, new this.constructor(y)); +}; +P.dividedToIntegerBy = P.divToInt = function(y) { + var x = this, Ctor = x.constructor; + return finalise(divide(x, new Ctor(y), 0, 1, 1), Ctor.precision, Ctor.rounding); +}; +P.equals = P.eq = function(y) { + return this.cmp(y) === 0; +}; +P.floor = function() { + return finalise(new this.constructor(this), this.e + 1, 3); +}; +P.greaterThan = P.gt = function(y) { + return this.cmp(y) > 0; +}; +P.greaterThanOrEqualTo = P.gte = function(y) { + var k = this.cmp(y); + return k == 1 || k === 0; +}; +P.hyperbolicCosine = P.cosh = function() { + var k, n, pr, rm, len, x = this, Ctor = x.constructor, one = new Ctor(1); + if (!x.isFinite()) + return new Ctor(x.s ? 1 / 0 : NaN); + if (x.isZero()) + return one; + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + Math.max(x.e, x.sd()) + 4; + Ctor.rounding = 1; + len = x.d.length; + if (len < 32) { + k = Math.ceil(len / 3); + n = (1 / tinyPow(4, k)).toString(); + } else { + k = 16; + n = "2.3283064365386962890625e-10"; + } + x = taylorSeries(Ctor, 1, x.times(n), new Ctor(1), true); + var cosh2_x, i = k, d8 = new Ctor(8); + for (; i--; ) { + cosh2_x = x.times(x); + x = one.minus(cosh2_x.times(d8.minus(cosh2_x.times(d8)))); + } + return finalise(x, Ctor.precision = pr, Ctor.rounding = rm, true); +}; +P.hyperbolicSine = P.sinh = function() { + var k, pr, rm, len, x = this, Ctor = x.constructor; + if (!x.isFinite() || x.isZero()) + return new Ctor(x); + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + Math.max(x.e, x.sd()) + 4; + Ctor.rounding = 1; + len = x.d.length; + if (len < 3) { + x = taylorSeries(Ctor, 2, x, x, true); + } else { + k = 1.4 * Math.sqrt(len); + k = k > 16 ? 16 : k | 0; + x = x.times(1 / tinyPow(5, k)); + x = taylorSeries(Ctor, 2, x, x, true); + var sinh2_x, d5 = new Ctor(5), d16 = new Ctor(16), d20 = new Ctor(20); + for (; k--; ) { + sinh2_x = x.times(x); + x = x.times(d5.plus(sinh2_x.times(d16.times(sinh2_x).plus(d20)))); + } + } + Ctor.precision = pr; + Ctor.rounding = rm; + return finalise(x, pr, rm, true); +}; +P.hyperbolicTangent = P.tanh = function() { + var pr, rm, x = this, Ctor = x.constructor; + if (!x.isFinite()) + return new Ctor(x.s); + if (x.isZero()) + return new Ctor(x); + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + 7; + Ctor.rounding = 1; + return divide(x.sinh(), x.cosh(), Ctor.precision = pr, Ctor.rounding = rm); +}; +P.inverseCosine = P.acos = function() { + var halfPi, x = this, Ctor = x.constructor, k = x.abs().cmp(1), pr = Ctor.precision, rm = Ctor.rounding; + if (k !== -1) { + return k === 0 ? x.isNeg() ? getPi(Ctor, pr, rm) : new Ctor(0) : new Ctor(NaN); + } + if (x.isZero()) + return getPi(Ctor, pr + 4, rm).times(0.5); + Ctor.precision = pr + 6; + Ctor.rounding = 1; + x = x.asin(); + halfPi = getPi(Ctor, pr + 4, rm).times(0.5); + Ctor.precision = pr; + Ctor.rounding = rm; + return halfPi.minus(x); +}; +P.inverseHyperbolicCosine = P.acosh = function() { + var pr, rm, x = this, Ctor = x.constructor; + if (x.lte(1)) + return new Ctor(x.eq(1) ? 0 : NaN); + if (!x.isFinite()) + return new Ctor(x); + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + Math.max(Math.abs(x.e), x.sd()) + 4; + Ctor.rounding = 1; + external = false; + x = x.times(x).minus(1).sqrt().plus(x); + external = true; + Ctor.precision = pr; + Ctor.rounding = rm; + return x.ln(); +}; +P.inverseHyperbolicSine = P.asinh = function() { + var pr, rm, x = this, Ctor = x.constructor; + if (!x.isFinite() || x.isZero()) + return new Ctor(x); + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + 2 * Math.max(Math.abs(x.e), x.sd()) + 6; + Ctor.rounding = 1; + external = false; + x = x.times(x).plus(1).sqrt().plus(x); + external = true; + Ctor.precision = pr; + Ctor.rounding = rm; + return x.ln(); +}; +P.inverseHyperbolicTangent = P.atanh = function() { + var pr, rm, wpr, xsd, x = this, Ctor = x.constructor; + if (!x.isFinite()) + return new Ctor(NaN); + if (x.e >= 0) + return new Ctor(x.abs().eq(1) ? x.s / 0 : x.isZero() ? x : NaN); + pr = Ctor.precision; + rm = Ctor.rounding; + xsd = x.sd(); + if (Math.max(xsd, pr) < 2 * -x.e - 1) + return finalise(new Ctor(x), pr, rm, true); + Ctor.precision = wpr = xsd - x.e; + x = divide(x.plus(1), new Ctor(1).minus(x), wpr + pr, 1); + Ctor.precision = pr + 4; + Ctor.rounding = 1; + x = x.ln(); + Ctor.precision = pr; + Ctor.rounding = rm; + return x.times(0.5); +}; +P.inverseSine = P.asin = function() { + var halfPi, k, pr, rm, x = this, Ctor = x.constructor; + if (x.isZero()) + return new Ctor(x); + k = x.abs().cmp(1); + pr = Ctor.precision; + rm = Ctor.rounding; + if (k !== -1) { + if (k === 0) { + halfPi = getPi(Ctor, pr + 4, rm).times(0.5); + halfPi.s = x.s; + return halfPi; + } + return new Ctor(NaN); + } + Ctor.precision = pr + 6; + Ctor.rounding = 1; + x = x.div(new Ctor(1).minus(x.times(x)).sqrt().plus(1)).atan(); + Ctor.precision = pr; + Ctor.rounding = rm; + return x.times(2); +}; +P.inverseTangent = P.atan = function() { + var i, j, k, n, px, t, r, wpr, x2, x = this, Ctor = x.constructor, pr = Ctor.precision, rm = Ctor.rounding; + if (!x.isFinite()) { + if (!x.s) + return new Ctor(NaN); + if (pr + 4 <= PI_PRECISION) { + r = getPi(Ctor, pr + 4, rm).times(0.5); + r.s = x.s; + return r; + } + } else if (x.isZero()) { + return new Ctor(x); + } else if (x.abs().eq(1) && pr + 4 <= PI_PRECISION) { + r = getPi(Ctor, pr + 4, rm).times(0.25); + r.s = x.s; + return r; + } + Ctor.precision = wpr = pr + 10; + Ctor.rounding = 1; + k = Math.min(28, wpr / LOG_BASE + 2 | 0); + for (i = k; i; --i) + x = x.div(x.times(x).plus(1).sqrt().plus(1)); + external = false; + j = Math.ceil(wpr / LOG_BASE); + n = 1; + x2 = x.times(x); + r = new Ctor(x); + px = x; + for (; i !== -1; ) { + px = px.times(x2); + t = r.minus(px.div(n += 2)); + px = px.times(x2); + r = t.plus(px.div(n += 2)); + if (r.d[j] !== void 0) + for (i = j; r.d[i] === t.d[i] && i--; ) + ; + } + if (k) + r = r.times(2 << k - 1); + external = true; + return finalise(r, Ctor.precision = pr, Ctor.rounding = rm, true); +}; +P.isFinite = function() { + return !!this.d; +}; +P.isInteger = P.isInt = function() { + return !!this.d && mathfloor(this.e / LOG_BASE) > this.d.length - 2; +}; +P.isNaN = function() { + return !this.s; +}; +P.isNegative = P.isNeg = function() { + return this.s < 0; +}; +P.isPositive = P.isPos = function() { + return this.s > 0; +}; +P.isZero = function() { + return !!this.d && this.d[0] === 0; +}; +P.lessThan = P.lt = function(y) { + return this.cmp(y) < 0; +}; +P.lessThanOrEqualTo = P.lte = function(y) { + return this.cmp(y) < 1; +}; +P.logarithm = P.log = function(base) { + var isBase10, d, denominator, k, inf, num, sd, r, arg = this, Ctor = arg.constructor, pr = Ctor.precision, rm = Ctor.rounding, guard = 5; + if (base == null) { + base = new Ctor(10); + isBase10 = true; + } else { + base = new Ctor(base); + d = base.d; + if (base.s < 0 || !d || !d[0] || base.eq(1)) + return new Ctor(NaN); + isBase10 = base.eq(10); + } + d = arg.d; + if (arg.s < 0 || !d || !d[0] || arg.eq(1)) { + return new Ctor(d && !d[0] ? -1 / 0 : arg.s != 1 ? NaN : d ? 0 : 1 / 0); + } + if (isBase10) { + if (d.length > 1) { + inf = true; + } else { + for (k = d[0]; k % 10 === 0; ) + k /= 10; + inf = k !== 1; + } + } + external = false; + sd = pr + guard; + num = naturalLogarithm(arg, sd); + denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd); + r = divide(num, denominator, sd, 1); + if (checkRoundingDigits(r.d, k = pr, rm)) { + do { + sd += 10; + num = naturalLogarithm(arg, sd); + denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd); + r = divide(num, denominator, sd, 1); + if (!inf) { + if (+digitsToString(r.d).slice(k + 1, k + 15) + 1 == 1e14) { + r = finalise(r, pr + 1, 0); + } + break; + } + } while (checkRoundingDigits(r.d, k += 10, rm)); + } + external = true; + return finalise(r, pr, rm); +}; +P.minus = P.sub = function(y) { + var d, e, i, j, k, len, pr, rm, xd, xe, xLTy, yd, x = this, Ctor = x.constructor; + y = new Ctor(y); + if (!x.d || !y.d) { + if (!x.s || !y.s) + y = new Ctor(NaN); + else if (x.d) + y.s = -y.s; + else + y = new Ctor(y.d || x.s !== y.s ? x : NaN); + return y; + } + if (x.s != y.s) { + y.s = -y.s; + return x.plus(y); + } + xd = x.d; + yd = y.d; + pr = Ctor.precision; + rm = Ctor.rounding; + if (!xd[0] || !yd[0]) { + if (yd[0]) + y.s = -y.s; + else if (xd[0]) + y = new Ctor(x); + else + return new Ctor(rm === 3 ? -0 : 0); + return external ? finalise(y, pr, rm) : y; + } + e = mathfloor(y.e / LOG_BASE); + xe = mathfloor(x.e / LOG_BASE); + xd = xd.slice(); + k = xe - e; + if (k) { + xLTy = k < 0; + if (xLTy) { + d = xd; + k = -k; + len = yd.length; + } else { + d = yd; + e = xe; + len = xd.length; + } + i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2; + if (k > i) { + k = i; + d.length = 1; + } + d.reverse(); + for (i = k; i--; ) + d.push(0); + d.reverse(); + } else { + i = xd.length; + len = yd.length; + xLTy = i < len; + if (xLTy) + len = i; + for (i = 0; i < len; i++) { + if (xd[i] != yd[i]) { + xLTy = xd[i] < yd[i]; + break; + } + } + k = 0; + } + if (xLTy) { + d = xd; + xd = yd; + yd = d; + y.s = -y.s; + } + len = xd.length; + for (i = yd.length - len; i > 0; --i) + xd[len++] = 0; + for (i = yd.length; i > k; ) { + if (xd[--i] < yd[i]) { + for (j = i; j && xd[--j] === 0; ) + xd[j] = BASE - 1; + --xd[j]; + xd[i] += BASE; + } + xd[i] -= yd[i]; + } + for (; xd[--len] === 0; ) + xd.pop(); + for (; xd[0] === 0; xd.shift()) + --e; + if (!xd[0]) + return new Ctor(rm === 3 ? -0 : 0); + y.d = xd; + y.e = getBase10Exponent(xd, e); + return external ? finalise(y, pr, rm) : y; +}; +P.modulo = P.mod = function(y) { + var q, x = this, Ctor = x.constructor; + y = new Ctor(y); + if (!x.d || !y.s || y.d && !y.d[0]) + return new Ctor(NaN); + if (!y.d || x.d && !x.d[0]) { + return finalise(new Ctor(x), Ctor.precision, Ctor.rounding); + } + external = false; + if (Ctor.modulo == 9) { + q = divide(x, y.abs(), 0, 3, 1); + q.s *= y.s; + } else { + q = divide(x, y, 0, Ctor.modulo, 1); + } + q = q.times(y); + external = true; + return x.minus(q); +}; +P.naturalExponential = P.exp = function() { + return naturalExponential(this); +}; +P.naturalLogarithm = P.ln = function() { + return naturalLogarithm(this); +}; +P.negated = P.neg = function() { + var x = new this.constructor(this); + x.s = -x.s; + return finalise(x); +}; +P.plus = P.add = function(y) { + var carry, d, e, i, k, len, pr, rm, xd, yd, x = this, Ctor = x.constructor; + y = new Ctor(y); + if (!x.d || !y.d) { + if (!x.s || !y.s) + y = new Ctor(NaN); + else if (!x.d) + y = new Ctor(y.d || x.s === y.s ? x : NaN); + return y; + } + if (x.s != y.s) { + y.s = -y.s; + return x.minus(y); + } + xd = x.d; + yd = y.d; + pr = Ctor.precision; + rm = Ctor.rounding; + if (!xd[0] || !yd[0]) { + if (!yd[0]) + y = new Ctor(x); + return external ? finalise(y, pr, rm) : y; + } + k = mathfloor(x.e / LOG_BASE); + e = mathfloor(y.e / LOG_BASE); + xd = xd.slice(); + i = k - e; + if (i) { + if (i < 0) { + d = xd; + i = -i; + len = yd.length; + } else { + d = yd; + e = k; + len = xd.length; + } + k = Math.ceil(pr / LOG_BASE); + len = k > len ? k + 1 : len + 1; + if (i > len) { + i = len; + d.length = 1; + } + d.reverse(); + for (; i--; ) + d.push(0); + d.reverse(); + } + len = xd.length; + i = yd.length; + if (len - i < 0) { + i = len; + d = yd; + yd = xd; + xd = d; + } + for (carry = 0; i; ) { + carry = (xd[--i] = xd[i] + yd[i] + carry) / BASE | 0; + xd[i] %= BASE; + } + if (carry) { + xd.unshift(carry); + ++e; + } + for (len = xd.length; xd[--len] == 0; ) + xd.pop(); + y.d = xd; + y.e = getBase10Exponent(xd, e); + return external ? finalise(y, pr, rm) : y; +}; +P.precision = P.sd = function(z) { + var k, x = this; + if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) + throw Error(invalidArgument + z); + if (x.d) { + k = getPrecision(x.d); + if (z && x.e + 1 > k) + k = x.e + 1; + } else { + k = NaN; + } + return k; +}; +P.round = function() { + var x = this, Ctor = x.constructor; + return finalise(new Ctor(x), x.e + 1, Ctor.rounding); +}; +P.sine = P.sin = function() { + var pr, rm, x = this, Ctor = x.constructor; + if (!x.isFinite()) + return new Ctor(NaN); + if (x.isZero()) + return new Ctor(x); + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE; + Ctor.rounding = 1; + x = sine(Ctor, toLessThanHalfPi(Ctor, x)); + Ctor.precision = pr; + Ctor.rounding = rm; + return finalise(quadrant > 2 ? x.neg() : x, pr, rm, true); +}; +P.squareRoot = P.sqrt = function() { + var m, n, sd, r, rep, t, x = this, d = x.d, e = x.e, s = x.s, Ctor = x.constructor; + if (s !== 1 || !d || !d[0]) { + return new Ctor(!s || s < 0 && (!d || d[0]) ? NaN : d ? x : 1 / 0); + } + external = false; + s = Math.sqrt(+x); + if (s == 0 || s == 1 / 0) { + n = digitsToString(d); + if ((n.length + e) % 2 == 0) + n += "0"; + s = Math.sqrt(n); + e = mathfloor((e + 1) / 2) - (e < 0 || e % 2); + if (s == 1 / 0) { + n = "5e" + e; + } else { + n = s.toExponential(); + n = n.slice(0, n.indexOf("e") + 1) + e; + } + r = new Ctor(n); + } else { + r = new Ctor(s.toString()); + } + sd = (e = Ctor.precision) + 3; + for (; ; ) { + t = r; + r = t.plus(divide(x, t, sd + 2, 1)).times(0.5); + if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) { + n = n.slice(sd - 3, sd + 1); + if (n == "9999" || !rep && n == "4999") { + if (!rep) { + finalise(t, e + 1, 0); + if (t.times(t).eq(x)) { + r = t; + break; + } + } + sd += 4; + rep = 1; + } else { + if (!+n || !+n.slice(1) && n.charAt(0) == "5") { + finalise(r, e + 1, 1); + m = !r.times(r).eq(x); + } + break; + } + } + } + external = true; + return finalise(r, e, Ctor.rounding, m); +}; +P.tangent = P.tan = function() { + var pr, rm, x = this, Ctor = x.constructor; + if (!x.isFinite()) + return new Ctor(NaN); + if (x.isZero()) + return new Ctor(x); + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + 10; + Ctor.rounding = 1; + x = x.sin(); + x.s = 1; + x = divide(x, new Ctor(1).minus(x.times(x)).sqrt(), pr + 10, 0); + Ctor.precision = pr; + Ctor.rounding = rm; + return finalise(quadrant == 2 || quadrant == 4 ? x.neg() : x, pr, rm, true); +}; +P.times = P.mul = function(y) { + var carry, e, i, k, r, rL, t, xdL, ydL, x = this, Ctor = x.constructor, xd = x.d, yd = (y = new Ctor(y)).d; + y.s *= x.s; + if (!xd || !xd[0] || !yd || !yd[0]) { + return new Ctor(!y.s || xd && !xd[0] && !yd || yd && !yd[0] && !xd ? NaN : !xd || !yd ? y.s / 0 : y.s * 0); + } + e = mathfloor(x.e / LOG_BASE) + mathfloor(y.e / LOG_BASE); + xdL = xd.length; + ydL = yd.length; + if (xdL < ydL) { + r = xd; + xd = yd; + yd = r; + rL = xdL; + xdL = ydL; + ydL = rL; + } + r = []; + rL = xdL + ydL; + for (i = rL; i--; ) + r.push(0); + for (i = ydL; --i >= 0; ) { + carry = 0; + for (k = xdL + i; k > i; ) { + t = r[k] + yd[i] * xd[k - i - 1] + carry; + r[k--] = t % BASE | 0; + carry = t / BASE | 0; + } + r[k] = (r[k] + carry) % BASE | 0; + } + for (; !r[--rL]; ) + r.pop(); + if (carry) + ++e; + else + r.shift(); + y.d = r; + y.e = getBase10Exponent(r, e); + return external ? finalise(y, Ctor.precision, Ctor.rounding) : y; +}; +P.toBinary = function(sd, rm) { + return toStringBinary(this, 2, sd, rm); +}; +P.toDecimalPlaces = P.toDP = function(dp, rm) { + var x = this, Ctor = x.constructor; + x = new Ctor(x); + if (dp === void 0) + return x; + checkInt32(dp, 0, MAX_DIGITS); + if (rm === void 0) + rm = Ctor.rounding; + else + checkInt32(rm, 0, 8); + return finalise(x, dp + x.e + 1, rm); +}; +P.toExponential = function(dp, rm) { + var str, x = this, Ctor = x.constructor; + if (dp === void 0) { + str = finiteToString(x, true); + } else { + checkInt32(dp, 0, MAX_DIGITS); + if (rm === void 0) + rm = Ctor.rounding; + else + checkInt32(rm, 0, 8); + x = finalise(new Ctor(x), dp + 1, rm); + str = finiteToString(x, true, dp + 1); + } + return x.isNeg() && !x.isZero() ? "-" + str : str; +}; +P.toFixed = function(dp, rm) { + var str, y, x = this, Ctor = x.constructor; + if (dp === void 0) { + str = finiteToString(x); + } else { + checkInt32(dp, 0, MAX_DIGITS); + if (rm === void 0) + rm = Ctor.rounding; + else + checkInt32(rm, 0, 8); + y = finalise(new Ctor(x), dp + x.e + 1, rm); + str = finiteToString(y, false, dp + y.e + 1); + } + return x.isNeg() && !x.isZero() ? "-" + str : str; +}; +P.toFraction = function(maxD) { + var d, d0, d1, d2, e, k, n, n0, n1, pr, q, r, x = this, xd = x.d, Ctor = x.constructor; + if (!xd) + return new Ctor(x); + n1 = d0 = new Ctor(1); + d1 = n0 = new Ctor(0); + d = new Ctor(d1); + e = d.e = getPrecision(xd) - x.e - 1; + k = e % LOG_BASE; + d.d[0] = mathpow(10, k < 0 ? LOG_BASE + k : k); + if (maxD == null) { + maxD = e > 0 ? d : n1; + } else { + n = new Ctor(maxD); + if (!n.isInt() || n.lt(n1)) + throw Error(invalidArgument + n); + maxD = n.gt(d) ? e > 0 ? d : n1 : n; + } + external = false; + n = new Ctor(digitsToString(xd)); + pr = Ctor.precision; + Ctor.precision = e = xd.length * LOG_BASE * 2; + for (; ; ) { + q = divide(n, d, 0, 1, 1); + d2 = d0.plus(q.times(d1)); + if (d2.cmp(maxD) == 1) + break; + d0 = d1; + d1 = d2; + d2 = n1; + n1 = n0.plus(q.times(d2)); + n0 = d2; + d2 = d; + d = n.minus(q.times(d2)); + n = d2; + } + d2 = divide(maxD.minus(d0), d1, 0, 1, 1); + n0 = n0.plus(d2.times(n1)); + d0 = d0.plus(d2.times(d1)); + n0.s = n1.s = x.s; + r = divide(n1, d1, e, 1).minus(x).abs().cmp(divide(n0, d0, e, 1).minus(x).abs()) < 1 ? [n1, d1] : [n0, d0]; + Ctor.precision = pr; + external = true; + return r; +}; +P.toHexadecimal = P.toHex = function(sd, rm) { + return toStringBinary(this, 16, sd, rm); +}; +P.toNearest = function(y, rm) { + var x = this, Ctor = x.constructor; + x = new Ctor(x); + if (y == null) { + if (!x.d) + return x; + y = new Ctor(1); + rm = Ctor.rounding; + } else { + y = new Ctor(y); + if (rm === void 0) { + rm = Ctor.rounding; + } else { + checkInt32(rm, 0, 8); + } + if (!x.d) + return y.s ? x : y; + if (!y.d) { + if (y.s) + y.s = x.s; + return y; + } + } + if (y.d[0]) { + external = false; + x = divide(x, y, 0, rm, 1).times(y); + external = true; + finalise(x); + } else { + y.s = x.s; + x = y; + } + return x; +}; +P.toNumber = function() { + return +this; +}; +P.toOctal = function(sd, rm) { + return toStringBinary(this, 8, sd, rm); +}; +P.toPower = P.pow = function(y) { + var e, k, pr, r, rm, s, x = this, Ctor = x.constructor, yn = +(y = new Ctor(y)); + if (!x.d || !y.d || !x.d[0] || !y.d[0]) + return new Ctor(mathpow(+x, yn)); + x = new Ctor(x); + if (x.eq(1)) + return x; + pr = Ctor.precision; + rm = Ctor.rounding; + if (y.eq(1)) + return finalise(x, pr, rm); + e = mathfloor(y.e / LOG_BASE); + if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) { + r = intPow(Ctor, x, k, pr); + return y.s < 0 ? new Ctor(1).div(r) : finalise(r, pr, rm); + } + s = x.s; + if (s < 0) { + if (e < y.d.length - 1) + return new Ctor(NaN); + if ((y.d[e] & 1) == 0) + s = 1; + if (x.e == 0 && x.d[0] == 1 && x.d.length == 1) { + x.s = s; + return x; + } + } + k = mathpow(+x, yn); + e = k == 0 || !isFinite(k) ? mathfloor(yn * (Math.log("0." + digitsToString(x.d)) / Math.LN10 + x.e + 1)) : new Ctor(k + "").e; + if (e > Ctor.maxE + 1 || e < Ctor.minE - 1) + return new Ctor(e > 0 ? s / 0 : 0); + external = false; + Ctor.rounding = x.s = 1; + k = Math.min(12, (e + "").length); + r = naturalExponential(y.times(naturalLogarithm(x, pr + k)), pr); + if (r.d) { + r = finalise(r, pr + 5, 1); + if (checkRoundingDigits(r.d, pr, rm)) { + e = pr + 10; + r = finalise(naturalExponential(y.times(naturalLogarithm(x, e + k)), e), e + 5, 1); + if (+digitsToString(r.d).slice(pr + 1, pr + 15) + 1 == 1e14) { + r = finalise(r, pr + 1, 0); + } + } + } + r.s = s; + external = true; + Ctor.rounding = rm; + return finalise(r, pr, rm); +}; +P.toPrecision = function(sd, rm) { + var str, x = this, Ctor = x.constructor; + if (sd === void 0) { + str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos); + } else { + checkInt32(sd, 1, MAX_DIGITS); + if (rm === void 0) + rm = Ctor.rounding; + else + checkInt32(rm, 0, 8); + x = finalise(new Ctor(x), sd, rm); + str = finiteToString(x, sd <= x.e || x.e <= Ctor.toExpNeg, sd); + } + return x.isNeg() && !x.isZero() ? "-" + str : str; +}; +P.toSignificantDigits = P.toSD = function(sd, rm) { + var x = this, Ctor = x.constructor; + if (sd === void 0) { + sd = Ctor.precision; + rm = Ctor.rounding; + } else { + checkInt32(sd, 1, MAX_DIGITS); + if (rm === void 0) + rm = Ctor.rounding; + else + checkInt32(rm, 0, 8); + } + return finalise(new Ctor(x), sd, rm); +}; +P.toString = function() { + var x = this, Ctor = x.constructor, str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos); + return x.isNeg() && !x.isZero() ? "-" + str : str; +}; +P.truncated = P.trunc = function() { + return finalise(new this.constructor(this), this.e + 1, 1); +}; +P.valueOf = P.toJSON = function() { + var x = this, Ctor = x.constructor, str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos); + return x.isNeg() ? "-" + str : str; +}; +function digitsToString(d) { + var i, k, ws, indexOfLastWord = d.length - 1, str = "", w = d[0]; + if (indexOfLastWord > 0) { + str += w; + for (i = 1; i < indexOfLastWord; i++) { + ws = d[i] + ""; + k = LOG_BASE - ws.length; + if (k) + str += getZeroString(k); + str += ws; + } + w = d[i]; + ws = w + ""; + k = LOG_BASE - ws.length; + if (k) + str += getZeroString(k); + } else if (w === 0) { + return "0"; + } + for (; w % 10 === 0; ) + w /= 10; + return str + w; +} +function checkInt32(i, min2, max2) { + if (i !== ~~i || i < min2 || i > max2) { + throw Error(invalidArgument + i); + } +} +function checkRoundingDigits(d, i, rm, repeating) { + var di, k, r, rd; + for (k = d[0]; k >= 10; k /= 10) + --i; + if (--i < 0) { + i += LOG_BASE; + di = 0; + } else { + di = Math.ceil((i + 1) / LOG_BASE); + i %= LOG_BASE; + } + k = mathpow(10, LOG_BASE - i); + rd = d[di] % k | 0; + if (repeating == null) { + if (i < 3) { + if (i == 0) + rd = rd / 100 | 0; + else if (i == 1) + rd = rd / 10 | 0; + r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 5e4 || rd == 0; + } else { + r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) && (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 || (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0; + } + } else { + if (i < 4) { + if (i == 0) + rd = rd / 1e3 | 0; + else if (i == 1) + rd = rd / 100 | 0; + else if (i == 2) + rd = rd / 10 | 0; + r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999; + } else { + r = ((repeating || rm < 4) && rd + 1 == k || !repeating && rm > 3 && rd + 1 == k / 2) && (d[di + 1] / k / 1e3 | 0) == mathpow(10, i - 3) - 1; + } + } + return r; +} +function convertBase(str, baseIn, baseOut) { + var j, arr = [0], arrL, i = 0, strL = str.length; + for (; i < strL; ) { + for (arrL = arr.length; arrL--; ) + arr[arrL] *= baseIn; + arr[0] += NUMERALS.indexOf(str.charAt(i++)); + for (j = 0; j < arr.length; j++) { + if (arr[j] > baseOut - 1) { + if (arr[j + 1] === void 0) + arr[j + 1] = 0; + arr[j + 1] += arr[j] / baseOut | 0; + arr[j] %= baseOut; + } + } + } + return arr.reverse(); +} +function cosine(Ctor, x) { + var k, len, y; + if (x.isZero()) + return x; + len = x.d.length; + if (len < 32) { + k = Math.ceil(len / 3); + y = (1 / tinyPow(4, k)).toString(); + } else { + k = 16; + y = "2.3283064365386962890625e-10"; + } + Ctor.precision += k; + x = taylorSeries(Ctor, 1, x.times(y), new Ctor(1)); + for (var i = k; i--; ) { + var cos2x = x.times(x); + x = cos2x.times(cos2x).minus(cos2x).times(8).plus(1); + } + Ctor.precision -= k; + return x; +} +var divide = function() { + function multiplyInteger(x, k, base) { + var temp, carry = 0, i = x.length; + for (x = x.slice(); i--; ) { + temp = x[i] * k + carry; + x[i] = temp % base | 0; + carry = temp / base | 0; + } + if (carry) + x.unshift(carry); + return x; + } + function compare(a, b, aL, bL) { + var i, r; + if (aL != bL) { + r = aL > bL ? 1 : -1; + } else { + for (i = r = 0; i < aL; i++) { + if (a[i] != b[i]) { + r = a[i] > b[i] ? 1 : -1; + break; + } + } + } + return r; + } + function subtract(a, b, aL, base) { + var i = 0; + for (; aL--; ) { + a[aL] -= i; + i = a[aL] < b[aL] ? 1 : 0; + a[aL] = i * base + a[aL] - b[aL]; + } + for (; !a[0] && a.length > 1; ) + a.shift(); + } + return function(x, y, pr, rm, dp, base) { + var cmp, e, i, k, logBase, more, prod, prodL, q, qd, rem, remL, rem0, sd, t, xi, xL, yd0, yL, yz, Ctor = x.constructor, sign2 = x.s == y.s ? 1 : -1, xd = x.d, yd = y.d; + if (!xd || !xd[0] || !yd || !yd[0]) { + return new Ctor( + !x.s || !y.s || (xd ? yd && xd[0] == yd[0] : !yd) ? NaN : xd && xd[0] == 0 || !yd ? sign2 * 0 : sign2 / 0 + ); + } + if (base) { + logBase = 1; + e = x.e - y.e; + } else { + base = BASE; + logBase = LOG_BASE; + e = mathfloor(x.e / logBase) - mathfloor(y.e / logBase); + } + yL = yd.length; + xL = xd.length; + q = new Ctor(sign2); + qd = q.d = []; + for (i = 0; yd[i] == (xd[i] || 0); i++) + ; + if (yd[i] > (xd[i] || 0)) + e--; + if (pr == null) { + sd = pr = Ctor.precision; + rm = Ctor.rounding; + } else if (dp) { + sd = pr + (x.e - y.e) + 1; + } else { + sd = pr; + } + if (sd < 0) { + qd.push(1); + more = true; + } else { + sd = sd / logBase + 2 | 0; + i = 0; + if (yL == 1) { + k = 0; + yd = yd[0]; + sd++; + for (; (i < xL || k) && sd--; i++) { + t = k * base + (xd[i] || 0); + qd[i] = t / yd | 0; + k = t % yd | 0; + } + more = k || i < xL; + } else { + k = base / (yd[0] + 1) | 0; + if (k > 1) { + yd = multiplyInteger(yd, k, base); + xd = multiplyInteger(xd, k, base); + yL = yd.length; + xL = xd.length; + } + xi = yL; + rem = xd.slice(0, yL); + remL = rem.length; + for (; remL < yL; ) + rem[remL++] = 0; + yz = yd.slice(); + yz.unshift(0); + yd0 = yd[0]; + if (yd[1] >= base / 2) + ++yd0; + do { + k = 0; + cmp = compare(yd, rem, yL, remL); + if (cmp < 0) { + rem0 = rem[0]; + if (yL != remL) + rem0 = rem0 * base + (rem[1] || 0); + k = rem0 / yd0 | 0; + if (k > 1) { + if (k >= base) + k = base - 1; + prod = multiplyInteger(yd, k, base); + prodL = prod.length; + remL = rem.length; + cmp = compare(prod, rem, prodL, remL); + if (cmp == 1) { + k--; + subtract(prod, yL < prodL ? yz : yd, prodL, base); + } + } else { + if (k == 0) + cmp = k = 1; + prod = yd.slice(); + } + prodL = prod.length; + if (prodL < remL) + prod.unshift(0); + subtract(rem, prod, remL, base); + if (cmp == -1) { + remL = rem.length; + cmp = compare(yd, rem, yL, remL); + if (cmp < 1) { + k++; + subtract(rem, yL < remL ? yz : yd, remL, base); + } + } + remL = rem.length; + } else if (cmp === 0) { + k++; + rem = [0]; + } + qd[i++] = k; + if (cmp && rem[0]) { + rem[remL++] = xd[xi] || 0; + } else { + rem = [xd[xi]]; + remL = 1; + } + } while ((xi++ < xL || rem[0] !== void 0) && sd--); + more = rem[0] !== void 0; + } + if (!qd[0]) + qd.shift(); + } + if (logBase == 1) { + q.e = e; + inexact = more; + } else { + for (i = 1, k = qd[0]; k >= 10; k /= 10) + i++; + q.e = i + e * logBase - 1; + finalise(q, dp ? pr + q.e + 1 : pr, rm, more); + } + return q; + }; +}(); +function finalise(x, sd, rm, isTruncated) { + var digits, i, j, k, rd, roundUp, w, xd, xdi, Ctor = x.constructor; + out: + if (sd != null) { + xd = x.d; + if (!xd) + return x; + for (digits = 1, k = xd[0]; k >= 10; k /= 10) + digits++; + i = sd - digits; + if (i < 0) { + i += LOG_BASE; + j = sd; + w = xd[xdi = 0]; + rd = w / mathpow(10, digits - j - 1) % 10 | 0; + } else { + xdi = Math.ceil((i + 1) / LOG_BASE); + k = xd.length; + if (xdi >= k) { + if (isTruncated) { + for (; k++ <= xdi; ) + xd.push(0); + w = rd = 0; + digits = 1; + i %= LOG_BASE; + j = i - LOG_BASE + 1; + } else { + break out; + } + } else { + w = k = xd[xdi]; + for (digits = 1; k >= 10; k /= 10) + digits++; + i %= LOG_BASE; + j = i - LOG_BASE + digits; + rd = j < 0 ? 0 : w / mathpow(10, digits - j - 1) % 10 | 0; + } + } + isTruncated = isTruncated || sd < 0 || xd[xdi + 1] !== void 0 || (j < 0 ? w : w % mathpow(10, digits - j - 1)); + roundUp = rm < 4 ? (rd || isTruncated) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : rd > 5 || rd == 5 && (rm == 4 || isTruncated || rm == 6 && (i > 0 ? j > 0 ? w / mathpow(10, digits - j) : 0 : xd[xdi - 1]) % 10 & 1 || rm == (x.s < 0 ? 8 : 7)); + if (sd < 1 || !xd[0]) { + xd.length = 0; + if (roundUp) { + sd -= x.e + 1; + xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE); + x.e = -sd || 0; + } else { + xd[0] = x.e = 0; + } + return x; + } + if (i == 0) { + xd.length = xdi; + k = 1; + xdi--; + } else { + xd.length = xdi + 1; + k = mathpow(10, LOG_BASE - i); + xd[xdi] = j > 0 ? (w / mathpow(10, digits - j) % mathpow(10, j) | 0) * k : 0; + } + if (roundUp) { + for (; ; ) { + if (xdi == 0) { + for (i = 1, j = xd[0]; j >= 10; j /= 10) + i++; + j = xd[0] += k; + for (k = 1; j >= 10; j /= 10) + k++; + if (i != k) { + x.e++; + if (xd[0] == BASE) + xd[0] = 1; + } + break; + } else { + xd[xdi] += k; + if (xd[xdi] != BASE) + break; + xd[xdi--] = 0; + k = 1; + } + } + } + for (i = xd.length; xd[--i] === 0; ) + xd.pop(); + } + if (external) { + if (x.e > Ctor.maxE) { + x.d = null; + x.e = NaN; + } else if (x.e < Ctor.minE) { + x.e = 0; + x.d = [0]; + } + } + return x; +} +function finiteToString(x, isExp, sd) { + if (!x.isFinite()) + return nonFiniteToString(x); + var k, e = x.e, str = digitsToString(x.d), len = str.length; + if (isExp) { + if (sd && (k = sd - len) > 0) { + str = str.charAt(0) + "." + str.slice(1) + getZeroString(k); + } else if (len > 1) { + str = str.charAt(0) + "." + str.slice(1); + } + str = str + (x.e < 0 ? "e" : "e+") + x.e; + } else if (e < 0) { + str = "0." + getZeroString(-e - 1) + str; + if (sd && (k = sd - len) > 0) + str += getZeroString(k); + } else if (e >= len) { + str += getZeroString(e + 1 - len); + if (sd && (k = sd - e - 1) > 0) + str = str + "." + getZeroString(k); + } else { + if ((k = e + 1) < len) + str = str.slice(0, k) + "." + str.slice(k); + if (sd && (k = sd - len) > 0) { + if (e + 1 === len) + str += "."; + str += getZeroString(k); + } + } + return str; +} +function getBase10Exponent(digits, e) { + var w = digits[0]; + for (e *= LOG_BASE; w >= 10; w /= 10) + e++; + return e; +} +function getLn10(Ctor, sd, pr) { + if (sd > LN10_PRECISION) { + external = true; + if (pr) + Ctor.precision = pr; + throw Error(precisionLimitExceeded); + } + return finalise(new Ctor(LN10), sd, 1, true); +} +function getPi(Ctor, sd, rm) { + if (sd > PI_PRECISION) + throw Error(precisionLimitExceeded); + return finalise(new Ctor(PI), sd, rm, true); +} +function getPrecision(digits) { + var w = digits.length - 1, len = w * LOG_BASE + 1; + w = digits[w]; + if (w) { + for (; w % 10 == 0; w /= 10) + len--; + for (w = digits[0]; w >= 10; w /= 10) + len++; + } + return len; +} +function getZeroString(k) { + var zs = ""; + for (; k--; ) + zs += "0"; + return zs; +} +function intPow(Ctor, x, n, pr) { + var isTruncated, r = new Ctor(1), k = Math.ceil(pr / LOG_BASE + 4); + external = false; + for (; ; ) { + if (n % 2) { + r = r.times(x); + if (truncate(r.d, k)) + isTruncated = true; + } + n = mathfloor(n / 2); + if (n === 0) { + n = r.d.length - 1; + if (isTruncated && r.d[n] === 0) + ++r.d[n]; + break; + } + x = x.times(x); + truncate(x.d, k); + } + external = true; + return r; +} +function isOdd(n) { + return n.d[n.d.length - 1] & 1; +} +function maxOrMin(Ctor, args, ltgt) { + var y, x = new Ctor(args[0]), i = 0; + for (; ++i < args.length; ) { + y = new Ctor(args[i]); + if (!y.s) { + x = y; + break; + } else if (x[ltgt](y)) { + x = y; + } + } + return x; +} +function naturalExponential(x, sd) { + var denominator, guard, j, pow2, sum2, t, wpr, rep = 0, i = 0, k = 0, Ctor = x.constructor, rm = Ctor.rounding, pr = Ctor.precision; + if (!x.d || !x.d[0] || x.e > 17) { + return new Ctor(x.d ? !x.d[0] ? 1 : x.s < 0 ? 0 : 1 / 0 : x.s ? x.s < 0 ? 0 : x : 0 / 0); + } + if (sd == null) { + external = false; + wpr = pr; + } else { + wpr = sd; + } + t = new Ctor(0.03125); + while (x.e > -2) { + x = x.times(t); + k += 5; + } + guard = Math.log(mathpow(2, k)) / Math.LN10 * 2 + 5 | 0; + wpr += guard; + denominator = pow2 = sum2 = new Ctor(1); + Ctor.precision = wpr; + for (; ; ) { + pow2 = finalise(pow2.times(x), wpr, 1); + denominator = denominator.times(++i); + t = sum2.plus(divide(pow2, denominator, wpr, 1)); + if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum2.d).slice(0, wpr)) { + j = k; + while (j--) + sum2 = finalise(sum2.times(sum2), wpr, 1); + if (sd == null) { + if (rep < 3 && checkRoundingDigits(sum2.d, wpr - guard, rm, rep)) { + Ctor.precision = wpr += 10; + denominator = pow2 = t = new Ctor(1); + i = 0; + rep++; + } else { + return finalise(sum2, Ctor.precision = pr, rm, external = true); + } + } else { + Ctor.precision = pr; + return sum2; + } + } + sum2 = t; + } +} +function naturalLogarithm(y, sd) { + var c, c0, denominator, e, numerator, rep, sum2, t, wpr, x1, x2, n = 1, guard = 10, x = y, xd = x.d, Ctor = x.constructor, rm = Ctor.rounding, pr = Ctor.precision; + if (x.s < 0 || !xd || !xd[0] || !x.e && xd[0] == 1 && xd.length == 1) { + return new Ctor(xd && !xd[0] ? -1 / 0 : x.s != 1 ? NaN : xd ? 0 : x); + } + if (sd == null) { + external = false; + wpr = pr; + } else { + wpr = sd; + } + Ctor.precision = wpr += guard; + c = digitsToString(xd); + c0 = c.charAt(0); + if (Math.abs(e = x.e) < 15e14) { + while (c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3) { + x = x.times(y); + c = digitsToString(x.d); + c0 = c.charAt(0); + n++; + } + e = x.e; + if (c0 > 1) { + x = new Ctor("0." + c); + e++; + } else { + x = new Ctor(c0 + "." + c.slice(1)); + } + } else { + t = getLn10(Ctor, wpr + 2, pr).times(e + ""); + x = naturalLogarithm(new Ctor(c0 + "." + c.slice(1)), wpr - guard).plus(t); + Ctor.precision = pr; + return sd == null ? finalise(x, pr, rm, external = true) : x; + } + x1 = x; + sum2 = numerator = x = divide(x.minus(1), x.plus(1), wpr, 1); + x2 = finalise(x.times(x), wpr, 1); + denominator = 3; + for (; ; ) { + numerator = finalise(numerator.times(x2), wpr, 1); + t = sum2.plus(divide(numerator, new Ctor(denominator), wpr, 1)); + if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum2.d).slice(0, wpr)) { + sum2 = sum2.times(2); + if (e !== 0) + sum2 = sum2.plus(getLn10(Ctor, wpr + 2, pr).times(e + "")); + sum2 = divide(sum2, new Ctor(n), wpr, 1); + if (sd == null) { + if (checkRoundingDigits(sum2.d, wpr - guard, rm, rep)) { + Ctor.precision = wpr += guard; + t = numerator = x = divide(x1.minus(1), x1.plus(1), wpr, 1); + x2 = finalise(x.times(x), wpr, 1); + denominator = rep = 1; + } else { + return finalise(sum2, Ctor.precision = pr, rm, external = true); + } + } else { + Ctor.precision = pr; + return sum2; + } + } + sum2 = t; + denominator += 2; + } +} +function nonFiniteToString(x) { + return String(x.s * x.s / 0); +} +function parseDecimal(x, str) { + var e, i, len; + if ((e = str.indexOf(".")) > -1) + str = str.replace(".", ""); + if ((i = str.search(/e/i)) > 0) { + if (e < 0) + e = i; + e += +str.slice(i + 1); + str = str.substring(0, i); + } else if (e < 0) { + e = str.length; + } + for (i = 0; str.charCodeAt(i) === 48; i++) + ; + for (len = str.length; str.charCodeAt(len - 1) === 48; --len) + ; + str = str.slice(i, len); + if (str) { + len -= i; + x.e = e = e - i - 1; + x.d = []; + i = (e + 1) % LOG_BASE; + if (e < 0) + i += LOG_BASE; + if (i < len) { + if (i) + x.d.push(+str.slice(0, i)); + for (len -= LOG_BASE; i < len; ) + x.d.push(+str.slice(i, i += LOG_BASE)); + str = str.slice(i); + i = LOG_BASE - str.length; + } else { + i -= len; + } + for (; i--; ) + str += "0"; + x.d.push(+str); + if (external) { + if (x.e > x.constructor.maxE) { + x.d = null; + x.e = NaN; + } else if (x.e < x.constructor.minE) { + x.e = 0; + x.d = [0]; + } + } + } else { + x.e = 0; + x.d = [0]; + } + return x; +} +function parseOther(x, str) { + var base, Ctor, divisor, i, isFloat, len, p, xd, xe; + if (str.indexOf("_") > -1) { + str = str.replace(/(\d)_(?=\d)/g, "$1"); + if (isDecimal.test(str)) + return parseDecimal(x, str); + } else if (str === "Infinity" || str === "NaN") { + if (!+str) + x.s = NaN; + x.e = NaN; + x.d = null; + return x; + } + if (isHex.test(str)) { + base = 16; + str = str.toLowerCase(); + } else if (isBinary.test(str)) { + base = 2; + } else if (isOctal.test(str)) { + base = 8; + } else { + throw Error(invalidArgument + str); + } + i = str.search(/p/i); + if (i > 0) { + p = +str.slice(i + 1); + str = str.substring(2, i); + } else { + str = str.slice(2); + } + i = str.indexOf("."); + isFloat = i >= 0; + Ctor = x.constructor; + if (isFloat) { + str = str.replace(".", ""); + len = str.length; + i = len - i; + divisor = intPow(Ctor, new Ctor(base), i, i * 2); + } + xd = convertBase(str, base, BASE); + xe = xd.length - 1; + for (i = xe; xd[i] === 0; --i) + xd.pop(); + if (i < 0) + return new Ctor(x.s * 0); + x.e = getBase10Exponent(xd, xe); + x.d = xd; + external = false; + if (isFloat) + x = divide(x, divisor, len * 4); + if (p) + x = x.times(Math.abs(p) < 54 ? mathpow(2, p) : Decimal.pow(2, p)); + external = true; + return x; +} +function sine(Ctor, x) { + var k, len = x.d.length; + if (len < 3) { + return x.isZero() ? x : taylorSeries(Ctor, 2, x, x); + } + k = 1.4 * Math.sqrt(len); + k = k > 16 ? 16 : k | 0; + x = x.times(1 / tinyPow(5, k)); + x = taylorSeries(Ctor, 2, x, x); + var sin2_x, d5 = new Ctor(5), d16 = new Ctor(16), d20 = new Ctor(20); + for (; k--; ) { + sin2_x = x.times(x); + x = x.times(d5.plus(sin2_x.times(d16.times(sin2_x).minus(d20)))); + } + return x; +} +function taylorSeries(Ctor, n, x, y, isHyperbolic) { + var j, t, u, x2, i = 1, pr = Ctor.precision, k = Math.ceil(pr / LOG_BASE); + external = false; + x2 = x.times(x); + u = new Ctor(y); + for (; ; ) { + t = divide(u.times(x2), new Ctor(n++ * n++), pr, 1); + u = isHyperbolic ? y.plus(t) : y.minus(t); + y = divide(t.times(x2), new Ctor(n++ * n++), pr, 1); + t = u.plus(y); + if (t.d[k] !== void 0) { + for (j = k; t.d[j] === u.d[j] && j--; ) + ; + if (j == -1) + break; + } + j = u; + u = y; + y = t; + t = j; + i++; + } + external = true; + t.d.length = k + 1; + return t; +} +function tinyPow(b, e) { + var n = b; + while (--e) + n *= b; + return n; +} +function toLessThanHalfPi(Ctor, x) { + var t, isNeg = x.s < 0, pi = getPi(Ctor, Ctor.precision, 1), halfPi = pi.times(0.5); + x = x.abs(); + if (x.lte(halfPi)) { + quadrant = isNeg ? 4 : 1; + return x; + } + t = x.divToInt(pi); + if (t.isZero()) { + quadrant = isNeg ? 3 : 2; + } else { + x = x.minus(t.times(pi)); + if (x.lte(halfPi)) { + quadrant = isOdd(t) ? isNeg ? 2 : 3 : isNeg ? 4 : 1; + return x; + } + quadrant = isOdd(t) ? isNeg ? 1 : 4 : isNeg ? 3 : 2; + } + return x.minus(pi).abs(); +} +function toStringBinary(x, baseOut, sd, rm) { + var base, e, i, k, len, roundUp, str, xd, y, Ctor = x.constructor, isExp = sd !== void 0; + if (isExp) { + checkInt32(sd, 1, MAX_DIGITS); + if (rm === void 0) + rm = Ctor.rounding; + else + checkInt32(rm, 0, 8); + } else { + sd = Ctor.precision; + rm = Ctor.rounding; + } + if (!x.isFinite()) { + str = nonFiniteToString(x); + } else { + str = finiteToString(x); + i = str.indexOf("."); + if (isExp) { + base = 2; + if (baseOut == 16) { + sd = sd * 4 - 3; + } else if (baseOut == 8) { + sd = sd * 3 - 2; + } + } else { + base = baseOut; + } + if (i >= 0) { + str = str.replace(".", ""); + y = new Ctor(1); + y.e = str.length - i; + y.d = convertBase(finiteToString(y), 10, base); + y.e = y.d.length; + } + xd = convertBase(str, 10, base); + e = len = xd.length; + for (; xd[--len] == 0; ) + xd.pop(); + if (!xd[0]) { + str = isExp ? "0p+0" : "0"; + } else { + if (i < 0) { + e--; + } else { + x = new Ctor(x); + x.d = xd; + x.e = e; + x = divide(x, y, sd, rm, 0, base); + xd = x.d; + e = x.e; + roundUp = inexact; + } + i = xd[sd]; + k = base / 2; + roundUp = roundUp || xd[sd + 1] !== void 0; + roundUp = rm < 4 ? (i !== void 0 || roundUp) && (rm === 0 || rm === (x.s < 0 ? 3 : 2)) : i > k || i === k && (rm === 4 || roundUp || rm === 6 && xd[sd - 1] & 1 || rm === (x.s < 0 ? 8 : 7)); + xd.length = sd; + if (roundUp) { + for (; ++xd[--sd] > base - 1; ) { + xd[sd] = 0; + if (!sd) { + ++e; + xd.unshift(1); + } + } + } + for (len = xd.length; !xd[len - 1]; --len) + ; + for (i = 0, str = ""; i < len; i++) + str += NUMERALS.charAt(xd[i]); + if (isExp) { + if (len > 1) { + if (baseOut == 16 || baseOut == 8) { + i = baseOut == 16 ? 4 : 3; + for (--len; len % i; len++) + str += "0"; + xd = convertBase(str, base, baseOut); + for (len = xd.length; !xd[len - 1]; --len) + ; + for (i = 1, str = "1."; i < len; i++) + str += NUMERALS.charAt(xd[i]); + } else { + str = str.charAt(0) + "." + str.slice(1); + } + } + str = str + (e < 0 ? "p" : "p+") + e; + } else if (e < 0) { + for (; ++e; ) + str = "0" + str; + str = "0." + str; + } else { + if (++e > len) + for (e -= len; e--; ) + str += "0"; + else if (e < len) + str = str.slice(0, e) + "." + str.slice(e); + } + } + str = (baseOut == 16 ? "0x" : baseOut == 2 ? "0b" : baseOut == 8 ? "0o" : "") + str; + } + return x.s < 0 ? "-" + str : str; +} +function truncate(arr, len) { + if (arr.length > len) { + arr.length = len; + return true; + } +} +function abs(x) { + return new this(x).abs(); +} +function acos(x) { + return new this(x).acos(); +} +function acosh(x) { + return new this(x).acosh(); +} +function add(x, y) { + return new this(x).plus(y); +} +function asin(x) { + return new this(x).asin(); +} +function asinh(x) { + return new this(x).asinh(); +} +function atan(x) { + return new this(x).atan(); +} +function atanh(x) { + return new this(x).atanh(); +} +function atan2(y, x) { + y = new this(y); + x = new this(x); + var r, pr = this.precision, rm = this.rounding, wpr = pr + 4; + if (!y.s || !x.s) { + r = new this(NaN); + } else if (!y.d && !x.d) { + r = getPi(this, wpr, 1).times(x.s > 0 ? 0.25 : 0.75); + r.s = y.s; + } else if (!x.d || y.isZero()) { + r = x.s < 0 ? getPi(this, pr, rm) : new this(0); + r.s = y.s; + } else if (!y.d || x.isZero()) { + r = getPi(this, wpr, 1).times(0.5); + r.s = y.s; + } else if (x.s < 0) { + this.precision = wpr; + this.rounding = 1; + r = this.atan(divide(y, x, wpr, 1)); + x = getPi(this, wpr, 1); + this.precision = pr; + this.rounding = rm; + r = y.s < 0 ? r.minus(x) : r.plus(x); + } else { + r = this.atan(divide(y, x, wpr, 1)); + } + return r; +} +function cbrt(x) { + return new this(x).cbrt(); +} +function ceil(x) { + return finalise(x = new this(x), x.e + 1, 2); +} +function clamp(x, min2, max2) { + return new this(x).clamp(min2, max2); +} +function config(obj) { + if (!obj || typeof obj !== "object") + throw Error(decimalError + "Object expected"); + var i, p, v, useDefaults = obj.defaults === true, ps = [ + "precision", + 1, + MAX_DIGITS, + "rounding", + 0, + 8, + "toExpNeg", + -EXP_LIMIT, + 0, + "toExpPos", + 0, + EXP_LIMIT, + "maxE", + 0, + EXP_LIMIT, + "minE", + -EXP_LIMIT, + 0, + "modulo", + 0, + 9 + ]; + for (i = 0; i < ps.length; i += 3) { + if (p = ps[i], useDefaults) + this[p] = DEFAULTS[p]; + if ((v = obj[p]) !== void 0) { + if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) + this[p] = v; + else + throw Error(invalidArgument + p + ": " + v); + } + } + if (p = "crypto", useDefaults) + this[p] = DEFAULTS[p]; + if ((v = obj[p]) !== void 0) { + if (v === true || v === false || v === 0 || v === 1) { + if (v) { + if (typeof crypto != "undefined" && crypto && (crypto.getRandomValues || crypto.randomBytes)) { + this[p] = true; + } else { + throw Error(cryptoUnavailable); + } + } else { + this[p] = false; + } + } else { + throw Error(invalidArgument + p + ": " + v); + } + } + return this; +} +function cos(x) { + return new this(x).cos(); +} +function cosh(x) { + return new this(x).cosh(); +} +function clone(obj) { + var i, p, ps; + function Decimal2(v) { + var e, i2, t, x = this; + if (!(x instanceof Decimal2)) + return new Decimal2(v); + x.constructor = Decimal2; + if (isDecimalInstance(v)) { + x.s = v.s; + if (external) { + if (!v.d || v.e > Decimal2.maxE) { + x.e = NaN; + x.d = null; + } else if (v.e < Decimal2.minE) { + x.e = 0; + x.d = [0]; + } else { + x.e = v.e; + x.d = v.d.slice(); + } + } else { + x.e = v.e; + x.d = v.d ? v.d.slice() : v.d; + } + return; + } + t = typeof v; + if (t === "number") { + if (v === 0) { + x.s = 1 / v < 0 ? -1 : 1; + x.e = 0; + x.d = [0]; + return; + } + if (v < 0) { + v = -v; + x.s = -1; + } else { + x.s = 1; + } + if (v === ~~v && v < 1e7) { + for (e = 0, i2 = v; i2 >= 10; i2 /= 10) + e++; + if (external) { + if (e > Decimal2.maxE) { + x.e = NaN; + x.d = null; + } else if (e < Decimal2.minE) { + x.e = 0; + x.d = [0]; + } else { + x.e = e; + x.d = [v]; + } + } else { + x.e = e; + x.d = [v]; + } + return; + } else if (v * 0 !== 0) { + if (!v) + x.s = NaN; + x.e = NaN; + x.d = null; + return; + } + return parseDecimal(x, v.toString()); + } else if (t !== "string") { + throw Error(invalidArgument + v); + } + if ((i2 = v.charCodeAt(0)) === 45) { + v = v.slice(1); + x.s = -1; + } else { + if (i2 === 43) + v = v.slice(1); + x.s = 1; + } + return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v); + } + Decimal2.prototype = P; + Decimal2.ROUND_UP = 0; + Decimal2.ROUND_DOWN = 1; + Decimal2.ROUND_CEIL = 2; + Decimal2.ROUND_FLOOR = 3; + Decimal2.ROUND_HALF_UP = 4; + Decimal2.ROUND_HALF_DOWN = 5; + Decimal2.ROUND_HALF_EVEN = 6; + Decimal2.ROUND_HALF_CEIL = 7; + Decimal2.ROUND_HALF_FLOOR = 8; + Decimal2.EUCLID = 9; + Decimal2.config = Decimal2.set = config; + Decimal2.clone = clone; + Decimal2.isDecimal = isDecimalInstance; + Decimal2.abs = abs; + Decimal2.acos = acos; + Decimal2.acosh = acosh; + Decimal2.add = add; + Decimal2.asin = asin; + Decimal2.asinh = asinh; + Decimal2.atan = atan; + Decimal2.atanh = atanh; + Decimal2.atan2 = atan2; + Decimal2.cbrt = cbrt; + Decimal2.ceil = ceil; + Decimal2.clamp = clamp; + Decimal2.cos = cos; + Decimal2.cosh = cosh; + Decimal2.div = div; + Decimal2.exp = exp; + Decimal2.floor = floor; + Decimal2.hypot = hypot; + Decimal2.ln = ln; + Decimal2.log = log; + Decimal2.log10 = log10; + Decimal2.log2 = log2; + Decimal2.max = max; + Decimal2.min = min; + Decimal2.mod = mod; + Decimal2.mul = mul; + Decimal2.pow = pow; + Decimal2.random = random; + Decimal2.round = round; + Decimal2.sign = sign; + Decimal2.sin = sin; + Decimal2.sinh = sinh; + Decimal2.sqrt = sqrt; + Decimal2.sub = sub; + Decimal2.sum = sum; + Decimal2.tan = tan; + Decimal2.tanh = tanh; + Decimal2.trunc = trunc; + if (obj === void 0) + obj = {}; + if (obj) { + if (obj.defaults !== true) { + ps = ["precision", "rounding", "toExpNeg", "toExpPos", "maxE", "minE", "modulo", "crypto"]; + for (i = 0; i < ps.length; ) + if (!obj.hasOwnProperty(p = ps[i++])) + obj[p] = this[p]; + } + } + Decimal2.config(obj); + return Decimal2; +} +function div(x, y) { + return new this(x).div(y); +} +function exp(x) { + return new this(x).exp(); +} +function floor(x) { + return finalise(x = new this(x), x.e + 1, 3); +} +function hypot() { + var i, n, t = new this(0); + external = false; + for (i = 0; i < arguments.length; ) { + n = new this(arguments[i++]); + if (!n.d) { + if (n.s) { + external = true; + return new this(1 / 0); + } + t = n; + } else if (t.d) { + t = t.plus(n.times(n)); + } + } + external = true; + return t.sqrt(); +} +function isDecimalInstance(obj) { + return obj instanceof Decimal || obj && obj.toStringTag === tag || false; +} +function ln(x) { + return new this(x).ln(); +} +function log(x, y) { + return new this(x).log(y); +} +function log2(x) { + return new this(x).log(2); +} +function log10(x) { + return new this(x).log(10); +} +function max() { + return maxOrMin(this, arguments, "lt"); +} +function min() { + return maxOrMin(this, arguments, "gt"); +} +function mod(x, y) { + return new this(x).mod(y); +} +function mul(x, y) { + return new this(x).mul(y); +} +function pow(x, y) { + return new this(x).pow(y); +} +function random(sd) { + var d, e, k, n, i = 0, r = new this(1), rd = []; + if (sd === void 0) + sd = this.precision; + else + checkInt32(sd, 1, MAX_DIGITS); + k = Math.ceil(sd / LOG_BASE); + if (!this.crypto) { + for (; i < k; ) + rd[i++] = Math.random() * 1e7 | 0; + } else if (crypto.getRandomValues) { + d = crypto.getRandomValues(new Uint32Array(k)); + for (; i < k; ) { + n = d[i]; + if (n >= 429e7) { + d[i] = crypto.getRandomValues(new Uint32Array(1))[0]; + } else { + rd[i++] = n % 1e7; + } + } + } else if (crypto.randomBytes) { + d = crypto.randomBytes(k *= 4); + for (; i < k; ) { + n = d[i] + (d[i + 1] << 8) + (d[i + 2] << 16) + ((d[i + 3] & 127) << 24); + if (n >= 214e7) { + crypto.randomBytes(4).copy(d, i); + } else { + rd.push(n % 1e7); + i += 4; + } + } + i = k / 4; + } else { + throw Error(cryptoUnavailable); + } + k = rd[--i]; + sd %= LOG_BASE; + if (k && sd) { + n = mathpow(10, LOG_BASE - sd); + rd[i] = (k / n | 0) * n; + } + for (; rd[i] === 0; i--) + rd.pop(); + if (i < 0) { + e = 0; + rd = [0]; + } else { + e = -1; + for (; rd[0] === 0; e -= LOG_BASE) + rd.shift(); + for (k = 1, n = rd[0]; n >= 10; n /= 10) + k++; + if (k < LOG_BASE) + e -= LOG_BASE - k; + } + r.e = e; + r.d = rd; + return r; +} +function round(x) { + return finalise(x = new this(x), x.e + 1, this.rounding); +} +function sign(x) { + x = new this(x); + return x.d ? x.d[0] ? x.s : 0 * x.s : x.s || NaN; +} +function sin(x) { + return new this(x).sin(); +} +function sinh(x) { + return new this(x).sinh(); +} +function sqrt(x) { + return new this(x).sqrt(); +} +function sub(x, y) { + return new this(x).sub(y); +} +function sum() { + var i = 0, args = arguments, x = new this(args[i]); + external = false; + for (; x.s && ++i < args.length; ) + x = x.plus(args[i]); + external = true; + return finalise(x, this.precision, this.rounding); +} +function tan(x) { + return new this(x).tan(); +} +function tanh(x) { + return new this(x).tanh(); +} +function trunc(x) { + return finalise(x = new this(x), x.e + 1, 1); +} +P[Symbol.for("nodejs.util.inspect.custom")] = P.toString; +P[Symbol.toStringTag] = "Decimal"; +var Decimal = P.constructor = clone(DEFAULTS); +LN10 = new Decimal(LN10); +PI = new Decimal(PI); +var decimal_default = Decimal; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Decimal, + Public, + makeStrictEnum, + objectEnumValues +}); +/*! + * decimal.js v10.4.3 + * An arbitrary-precision Decimal type for JavaScript. + * https://github.com/MikeMcl/decimal.js + * Copyright (c) 2022 Michael Mclaughlin + * MIT Licence + */ diff --git a/uc-controller-user/controller-user/prisma/prismaAuthUserClient/runtime/index.d.ts b/uc-controller-user/controller-user/prisma/prismaAuthUserClient/runtime/index.d.ts new file mode 100644 index 0000000..f708258 --- /dev/null +++ b/uc-controller-user/controller-user/prisma/prismaAuthUserClient/runtime/index.d.ts @@ -0,0 +1,3057 @@ +/** + * TODO + * @param this + */ +declare function $extends(this: Client, extension: Args_2 | ((client: Client) => Client)): Client; + +declare type Action = keyof typeof DMMF.ModelAction | 'executeRaw' | 'queryRaw' | 'runCommandRaw'; + +declare type Aggregate = '_count' | '_max' | '_min' | '_avg' | '_sum'; + +declare type AllModelsToStringIndex, K extends PropertyKey> = Args extends { + [P in K]: { + $allModels: infer AllModels; + }; +} ? { + [P in K]: Record; +} : {}; + +declare class AnyNull extends NullTypesEnumValue { +} + +declare type ApplyExtensionsParams = { + result: object; + modelName: string; + args: JsArgs; + extensions: MergedExtensionsList; +}; + +declare class Arg { + key: string; + value: ArgValue; + error?: InvalidArgError; + hasError: boolean; + isEnum: boolean; + schemaArg?: DMMF.SchemaArg; + isNullable: boolean; + inputType?: DMMF.SchemaArgInputType; + constructor({ key, value, isEnum, error, schemaArg, inputType }: ArgOptions); + get [Symbol.toStringTag](): string; + _toString(value: ArgValue, key: string): string | undefined; + stringifyValue(value: ArgValue): any; + toString(): string | undefined; + collectErrors(): ArgError[]; +} + +declare interface ArgError { + path: string[]; + id?: string; + error: InvalidArgError; +} + +declare interface ArgOptions { + key: string; + value: ArgValue; + isEnum?: boolean; + error?: InvalidArgError; + schemaArg?: DMMF.SchemaArg; + inputType?: DMMF.SchemaArgInputType; +} + +export declare type Args = InternalArgs; + +declare type Args_2 = Optional; + +declare class Args_3 { + args: Arg[]; + readonly hasInvalidArg: boolean; + constructor(args?: Arg[]); + get [Symbol.toStringTag](): string; + toString(): string; + collectErrors(): ArgError[]; +} + +declare type Args_4 = T extends { + [K: symbol]: { + types: { + operations: { + [K in F]: { + args: any; + }; + }; + }; + }; +} ? T[symbol]['types']['operations'][F]['args'] : never; + +declare type ArgValue = string | boolean | number | undefined | Args_3 | string[] | boolean[] | number[] | Args_3[] | Date | null; + +declare interface AtLeastOneError { + type: 'atLeastOne'; + key: string; + inputType: DMMF.InputType; + atLeastFields?: string[]; +} + +declare interface AtMostOneError { + type: 'atMostOne'; + key: string; + inputType: DMMF.InputType; + providedKeys: string[]; +} + +/** + * Attributes is a map from string to attribute values. + * + * Note: only the own enumerable keys are counted as valid attribute keys. + */ +declare interface Attributes { + [attributeKey: string]: AttributeValue | undefined; +} + +/** + * Attribute values may be any non-nullish primitive value except an object. + * + * null or undefined attribute values are invalid and will result in undefined behavior. + */ +declare type AttributeValue = string | number | boolean | Array | Array | Array; + +export declare type BaseDMMF = Pick; + +declare type BatchArgs = { + queries: BatchQuery[]; + transaction?: { + isolationLevel?: IsolationLevel; + }; +}; + +declare type BatchInternalParams = { + requests: RequestParams[]; + customDataProxyFetch?: CustomDataProxyFetch; +}; + +declare type BatchQuery = { + model: string | undefined; + operation: string; + args: JsArgs | RawQueryArgs; +}; + +declare type BatchQueryEngineResult = QueryEngineResult | Error; + +declare type BatchQueryOptionsCb = (args: BatchQueryOptionsCbArgs) => Promise; + +declare type BatchQueryOptionsCbArgs = { + args: BatchArgs; + query: (args: BatchArgs, __internalParams?: BatchInternalParams) => Promise; + __internalParams: BatchInternalParams; +}; + +declare type BatchTransactionOptions = { + isolationLevel?: Transaction.IsolationLevel; +}; + +declare interface BinaryTargetsEnvValue { + fromEnvVar: string | null; + value: string; + native?: boolean; +} + +declare type Call = (F & { + params: P; +})['returns']; + +declare interface CallSite { + getLocation(): LocationInFile | null; +} + +declare type Cast = A extends W ? A : W; + +declare type Client = ReturnType extends new () => infer T ? T : never; + +declare type ClientArg = { + [MethodName in string]: unknown; +}; + +declare type ClientArgs = { + client: ClientArg; +}; + +declare type ClientBuiltInProp = keyof DynamicClientExtensionThisBuiltin; + +declare enum ClientEngineType { + Library = "library", + Binary = "binary" +} + +declare type Compute = T extends Function ? T : { + [K in keyof T]: T[K]; +} & unknown; + +declare type ComputeDeep = T extends Function ? T : { + [K in keyof T]: ComputeDeep; +} & unknown; + +declare type ComputedField = { + name: string; + needs: string[]; + compute: ResultArgsFieldCompute; +}; + +declare type ComputedFieldsMap = { + [fieldName: string]: ComputedField; +}; + +declare type ConnectorType = 'mysql' | 'mongodb' | 'sqlite' | 'postgresql' | 'sqlserver' | 'jdbc:sqlserver' | 'cockroachdb'; + +declare interface Context { + /** + * Get a value from the context. + * + * @param key key which identifies a context value + */ + getValue(key: symbol): unknown; + /** + * Create a new context which inherits from this context and has + * the given key set to the given value. + * + * @param key context key for which to set the value + * @param value value to set for the given key + */ + setValue(key: symbol, value: unknown): Context; + /** + * Return a new context which inherits from this context but does + * not contain a value for the given key. + * + * @param key context key for which to clear a value + */ + deleteValue(key: symbol): Context; +} + +declare type Context_2 = T extends { + [K: symbol]: { + ctx: infer C; + }; +} ? C & T & { + name?: string; +} : T & { + name?: string; +}; + +declare type Count = { + [K in keyof O]: Count; +} & {}; + +declare type CreateMessageOptions = { + action: Action; + modelName?: string; + args?: JsArgs; + extensions: MergedExtensionsList; + clientMethod: string; + callsite?: CallSite; +}; + +declare type CustomDataProxyFetch = (fetch: Fetch) => Fetch; + +declare class DataLoader { + private options; + batches: { + [key: string]: Job[]; + }; + private tickActive; + constructor(options: DataLoaderOptions); + request(request: T): Promise; + private dispatchBatches; + get [Symbol.toStringTag](): string; +} + +declare type DataLoaderOptions = { + singleLoader: (request: T) => Promise; + batchLoader: (request: T[]) => Promise; + batchBy: (request: T) => string | undefined; + batchOrder: (requestA: T, requestB: T) => number; +}; + +declare type Datasource = { + url?: string; +}; + +declare interface DatasourceOverwrite { + name: string; + url?: string; + env?: string; +} + +declare type Datasources = { + [name in string]: Datasource; +}; + +declare class DbNull extends NullTypesEnumValue { +} + +export declare interface Debug { + (namespace: string): Debugger; + disable: () => string; + enable: (namespace: string) => void; + enabled: (namespace: string) => boolean; + log: (...args: any[]) => any; + formatters: Record string) | undefined>; +} + +declare interface Debugger { + (format: any, ...args: any[]): void; + log: (...args: any[]) => any; + extend: (namespace: string, delimiter?: string) => Debugger; + color: string | number; + enabled: boolean; + namespace: string; +} + +export declare namespace Decimal { + export type Constructor = typeof Decimal; + export type Instance = Decimal; + export type Rounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; + export type Modulo = Rounding | 9; + export type Value = string | number | Decimal; + + // http://mikemcl.github.io/decimal.js/#constructor-properties + export interface Config { + precision?: number; + rounding?: Rounding; + toExpNeg?: number; + toExpPos?: number; + minE?: number; + maxE?: number; + crypto?: boolean; + modulo?: Modulo; + defaults?: boolean; + } +} + +export declare class Decimal { + readonly d: number[]; + readonly e: number; + readonly s: number; + + constructor(n: Decimal.Value); + + absoluteValue(): Decimal; + abs(): Decimal; + + ceil(): Decimal; + + clampedTo(min: Decimal.Value, max: Decimal.Value): Decimal; + clamp(min: Decimal.Value, max: Decimal.Value): Decimal; + + comparedTo(n: Decimal.Value): number; + cmp(n: Decimal.Value): number; + + cosine(): Decimal; + cos(): Decimal; + + cubeRoot(): Decimal; + cbrt(): Decimal; + + decimalPlaces(): number; + dp(): number; + + dividedBy(n: Decimal.Value): Decimal; + div(n: Decimal.Value): Decimal; + + dividedToIntegerBy(n: Decimal.Value): Decimal; + divToInt(n: Decimal.Value): Decimal; + + equals(n: Decimal.Value): boolean; + eq(n: Decimal.Value): boolean; + + floor(): Decimal; + + greaterThan(n: Decimal.Value): boolean; + gt(n: Decimal.Value): boolean; + + greaterThanOrEqualTo(n: Decimal.Value): boolean; + gte(n: Decimal.Value): boolean; + + hyperbolicCosine(): Decimal; + cosh(): Decimal; + + hyperbolicSine(): Decimal; + sinh(): Decimal; + + hyperbolicTangent(): Decimal; + tanh(): Decimal; + + inverseCosine(): Decimal; + acos(): Decimal; + + inverseHyperbolicCosine(): Decimal; + acosh(): Decimal; + + inverseHyperbolicSine(): Decimal; + asinh(): Decimal; + + inverseHyperbolicTangent(): Decimal; + atanh(): Decimal; + + inverseSine(): Decimal; + asin(): Decimal; + + inverseTangent(): Decimal; + atan(): Decimal; + + isFinite(): boolean; + + isInteger(): boolean; + isInt(): boolean; + + isNaN(): boolean; + + isNegative(): boolean; + isNeg(): boolean; + + isPositive(): boolean; + isPos(): boolean; + + isZero(): boolean; + + lessThan(n: Decimal.Value): boolean; + lt(n: Decimal.Value): boolean; + + lessThanOrEqualTo(n: Decimal.Value): boolean; + lte(n: Decimal.Value): boolean; + + logarithm(n?: Decimal.Value): Decimal; + log(n?: Decimal.Value): Decimal; + + minus(n: Decimal.Value): Decimal; + sub(n: Decimal.Value): Decimal; + + modulo(n: Decimal.Value): Decimal; + mod(n: Decimal.Value): Decimal; + + naturalExponential(): Decimal; + exp(): Decimal; + + naturalLogarithm(): Decimal; + ln(): Decimal; + + negated(): Decimal; + neg(): Decimal; + + plus(n: Decimal.Value): Decimal; + add(n: Decimal.Value): Decimal; + + precision(includeZeros?: boolean): number; + sd(includeZeros?: boolean): number; + + round(): Decimal; + + sine() : Decimal; + sin() : Decimal; + + squareRoot(): Decimal; + sqrt(): Decimal; + + tangent() : Decimal; + tan() : Decimal; + + times(n: Decimal.Value): Decimal; + mul(n: Decimal.Value) : Decimal; + + toBinary(significantDigits?: number): string; + toBinary(significantDigits: number, rounding: Decimal.Rounding): string; + + toDecimalPlaces(decimalPlaces?: number): Decimal; + toDecimalPlaces(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; + toDP(decimalPlaces?: number): Decimal; + toDP(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; + + toExponential(decimalPlaces?: number): string; + toExponential(decimalPlaces: number, rounding: Decimal.Rounding): string; + + toFixed(decimalPlaces?: number): string; + toFixed(decimalPlaces: number, rounding: Decimal.Rounding): string; + + toFraction(max_denominator?: Decimal.Value): Decimal[]; + + toHexadecimal(significantDigits?: number): string; + toHexadecimal(significantDigits: number, rounding: Decimal.Rounding): string; + toHex(significantDigits?: number): string; + toHex(significantDigits: number, rounding?: Decimal.Rounding): string; + + toJSON(): string; + + toNearest(n: Decimal.Value, rounding?: Decimal.Rounding): Decimal; + + toNumber(): number; + + toOctal(significantDigits?: number): string; + toOctal(significantDigits: number, rounding: Decimal.Rounding): string; + + toPower(n: Decimal.Value): Decimal; + pow(n: Decimal.Value): Decimal; + + toPrecision(significantDigits?: number): string; + toPrecision(significantDigits: number, rounding: Decimal.Rounding): string; + + toSignificantDigits(significantDigits?: number): Decimal; + toSignificantDigits(significantDigits: number, rounding: Decimal.Rounding): Decimal; + toSD(significantDigits?: number): Decimal; + toSD(significantDigits: number, rounding: Decimal.Rounding): Decimal; + + toString(): string; + + truncated(): Decimal; + trunc(): Decimal; + + valueOf(): string; + + static abs(n: Decimal.Value): Decimal; + static acos(n: Decimal.Value): Decimal; + static acosh(n: Decimal.Value): Decimal; + static add(x: Decimal.Value, y: Decimal.Value): Decimal; + static asin(n: Decimal.Value): Decimal; + static asinh(n: Decimal.Value): Decimal; + static atan(n: Decimal.Value): Decimal; + static atanh(n: Decimal.Value): Decimal; + static atan2(y: Decimal.Value, x: Decimal.Value): Decimal; + static cbrt(n: Decimal.Value): Decimal; + static ceil(n: Decimal.Value): Decimal; + static clamp(n: Decimal.Value, min: Decimal.Value, max: Decimal.Value): Decimal; + static clone(object?: Decimal.Config): Decimal.Constructor; + static config(object: Decimal.Config): Decimal.Constructor; + static cos(n: Decimal.Value): Decimal; + static cosh(n: Decimal.Value): Decimal; + static div(x: Decimal.Value, y: Decimal.Value): Decimal; + static exp(n: Decimal.Value): Decimal; + static floor(n: Decimal.Value): Decimal; + static hypot(...n: Decimal.Value[]): Decimal; + static isDecimal(object: any): object is Decimal; + static ln(n: Decimal.Value): Decimal; + static log(n: Decimal.Value, base?: Decimal.Value): Decimal; + static log2(n: Decimal.Value): Decimal; + static log10(n: Decimal.Value): Decimal; + static max(...n: Decimal.Value[]): Decimal; + static min(...n: Decimal.Value[]): Decimal; + static mod(x: Decimal.Value, y: Decimal.Value): Decimal; + static mul(x: Decimal.Value, y: Decimal.Value): Decimal; + static noConflict(): Decimal.Constructor; // Browser only + static pow(base: Decimal.Value, exponent: Decimal.Value): Decimal; + static random(significantDigits?: number): Decimal; + static round(n: Decimal.Value): Decimal; + static set(object: Decimal.Config): Decimal.Constructor; + static sign(n: Decimal.Value): number; + static sin(n: Decimal.Value): Decimal; + static sinh(n: Decimal.Value): Decimal; + static sqrt(n: Decimal.Value): Decimal; + static sub(x: Decimal.Value, y: Decimal.Value): Decimal; + static sum(...n: Decimal.Value[]): Decimal; + static tan(n: Decimal.Value): Decimal; + static tanh(n: Decimal.Value): Decimal; + static trunc(n: Decimal.Value): Decimal; + + static readonly default?: Decimal.Constructor; + static readonly Decimal?: Decimal.Constructor; + + static readonly precision: number; + static readonly rounding: Decimal.Rounding; + static readonly toExpNeg: number; + static readonly toExpPos: number; + static readonly minE: number; + static readonly maxE: number; + static readonly crypto: boolean; + static readonly modulo: Decimal.Modulo; + + static readonly ROUND_UP: 0; + static readonly ROUND_DOWN: 1; + static readonly ROUND_CEIL: 2; + static readonly ROUND_FLOOR: 3; + static readonly ROUND_HALF_UP: 4; + static readonly ROUND_HALF_DOWN: 5; + static readonly ROUND_HALF_EVEN: 6; + static readonly ROUND_HALF_CEIL: 7; + static readonly ROUND_HALF_FLOOR: 8; + static readonly EUCLID: 9; +} + +/** + * Interface for any Decimal.js-like library + * Allows us to accept Decimal.js from different + * versions and some compatible alternatives + */ +export declare interface DecimalJsLike { + d: number[]; + e: number; + s: number; + toFixed(): string; +} + +export declare const decompressFromBase64: (str: string) => string; + +export declare type DefaultArgs = InternalArgs<{}, {}, {}, {}>; + +declare type DefaultSelection

= P extends Payload ? P['scalars'] & UnwrapPayload : P; + +export declare function defineDmmfProperty(target: object, runtimeDataModel: RuntimeDataModel): void; + +declare function defineExtension(ext: Args_2 | ((client: Client) => Client)): (client: Client) => Client; + +declare const denylist: readonly ["$connect", "$disconnect", "$on", "$transaction", "$use", "$extends"]; + +declare interface Dictionary { + [key: string]: T; +} + +declare type Dictionary_2 = { + [key: string]: T; +}; + +export declare namespace DMMF { + export interface Document { + datamodel: Datamodel; + schema: Schema; + mappings: Mappings; + } + export interface Mappings { + modelOperations: ModelMapping[]; + otherOperations: { + read: string[]; + write: string[]; + }; + } + export interface OtherOperationMappings { + read: string[]; + write: string[]; + } + export interface DatamodelEnum { + name: string; + values: EnumValue[]; + dbName?: string | null; + documentation?: string; + } + export interface SchemaEnum { + name: string; + values: string[]; + } + export interface EnumValue { + name: string; + dbName: string | null; + } + export interface Datamodel { + models: Model[]; + enums: DatamodelEnum[]; + types: Model[]; + } + export interface uniqueIndex { + name: string; + fields: string[]; + } + export interface PrimaryKey { + name: string | null; + fields: string[]; + } + export interface Model { + name: string; + dbName: string | null; + fields: Field[]; + uniqueFields: string[][]; + uniqueIndexes: uniqueIndex[]; + documentation?: string; + primaryKey: PrimaryKey | null; + isGenerated?: boolean; + } + export type FieldKind = 'scalar' | 'object' | 'enum' | 'unsupported'; + export type FieldNamespace = 'model' | 'prisma'; + export type FieldLocation = 'scalar' | 'inputObjectTypes' | 'outputObjectTypes' | 'enumTypes' | 'fieldRefTypes'; + export interface Field { + kind: FieldKind; + name: string; + isRequired: boolean; + isList: boolean; + isUnique: boolean; + isId: boolean; + isReadOnly: boolean; + isGenerated?: boolean; + isUpdatedAt?: boolean; + /** + * Describes the data type in the same the way is is defined in the Prisma schema: + * BigInt, Boolean, Bytes, DateTime, Decimal, Float, Int, JSON, String, $ModelName + */ + type: string; + dbName?: string | null; + hasDefaultValue: boolean; + default?: FieldDefault | FieldDefaultScalar | FieldDefaultScalar[]; + relationFromFields?: string[]; + relationToFields?: any[]; + relationOnDelete?: string; + relationName?: string; + documentation?: string; + [key: string]: any; + } + export interface FieldDefault { + name: string; + args: any[]; + } + export type FieldDefaultScalar = string | boolean | number; + export interface Schema { + rootQueryType?: string; + rootMutationType?: string; + inputObjectTypes: { + model?: InputType[]; + prisma: InputType[]; + }; + outputObjectTypes: { + model: OutputType[]; + prisma: OutputType[]; + }; + enumTypes: { + model?: SchemaEnum[]; + prisma: SchemaEnum[]; + }; + fieldRefTypes: { + prisma?: FieldRefType[]; + }; + } + export interface Query { + name: string; + args: SchemaArg[]; + output: QueryOutput; + } + export interface QueryOutput { + name: string; + isRequired: boolean; + isList: boolean; + } + export type ArgType = string | InputType | SchemaEnum; + export interface SchemaArgInputType { + isList: boolean; + type: ArgType; + location: FieldLocation; + namespace?: FieldNamespace; + } + export interface SchemaArg { + name: string; + comment?: string; + isNullable: boolean; + isRequired: boolean; + inputTypes: SchemaArgInputType[]; + deprecation?: Deprecation; + } + export interface OutputType { + name: string; + fields: SchemaField[]; + fieldMap?: Record; + } + export interface SchemaField { + name: string; + isNullable?: boolean; + outputType: OutputTypeRef; + args: SchemaArg[]; + deprecation?: Deprecation; + documentation?: string; + } + export type TypeRefCommon = { + isList: boolean; + namespace?: FieldNamespace; + }; + export type TypeRefScalar = TypeRefCommon & { + location: 'scalar'; + type: string; + }; + export type TypeRefOutputObject = TypeRefCommon & { + location: 'outputObjectTypes'; + type: OutputType | string; + }; + export type TypeRefEnum = TypeRefCommon & { + location: 'enumTypes'; + type: SchemaEnum | string; + }; + export type OutputTypeRef = TypeRefScalar | TypeRefOutputObject | TypeRefEnum; + export interface Deprecation { + sinceVersion: string; + reason: string; + plannedRemovalVersion?: string; + } + export interface InputType { + name: string; + constraints: { + maxNumFields: number | null; + minNumFields: number | null; + fields?: string[]; + }; + meta?: { + source?: string; + }; + fields: SchemaArg[]; + fieldMap?: Record; + } + export interface FieldRefType { + name: string; + allowTypes: FieldRefAllowType[]; + fields: SchemaArg[]; + } + export type FieldRefAllowType = TypeRefScalar | TypeRefEnum; + export interface ModelMapping { + model: string; + plural: string; + findUnique?: string | null; + findUniqueOrThrow?: string | null; + findFirst?: string | null; + findFirstOrThrow?: string | null; + findMany?: string | null; + create?: string | null; + createMany?: string | null; + update?: string | null; + updateMany?: string | null; + upsert?: string | null; + delete?: string | null; + deleteMany?: string | null; + aggregate?: string | null; + groupBy?: string | null; + count?: string | null; + findRaw?: string | null; + aggregateRaw?: string | null; + } + export enum ModelAction { + findUnique = "findUnique", + findUniqueOrThrow = "findUniqueOrThrow", + findFirst = "findFirst", + findFirstOrThrow = "findFirstOrThrow", + findMany = "findMany", + create = "create", + createMany = "createMany", + update = "update", + updateMany = "updateMany", + upsert = "upsert", + delete = "delete", + deleteMany = "deleteMany", + groupBy = "groupBy", + count = "count", + aggregate = "aggregate", + findRaw = "findRaw", + aggregateRaw = "aggregateRaw" + } +} + +export declare interface DMMFClass extends DMMFDatamodelHelper, DMMFMappingsHelper, DMMFSchemaHelper { +} + +export declare class DMMFClass { + constructor(dmmf: DMMF.Document); +} + +declare class DMMFDatamodelHelper implements Pick { + datamodel: DMMF.Datamodel; + datamodelEnumMap: Dictionary; + modelMap: Dictionary; + typeMap: Dictionary; + typeAndModelMap: Dictionary; + constructor({ datamodel }: Pick); + getDatamodelEnumMap(): Dictionary; + getModelMap(): Dictionary; + getTypeMap(): Dictionary; + getTypeModelMap(): Dictionary; +} + +declare class DMMFMappingsHelper implements Pick { + mappings: DMMF.Mappings; + mappingsMap: Dictionary; + constructor({ mappings }: Pick); + getMappingsMap(): Dictionary; + getOtherOperationNames(): string[]; +} + +declare class DMMFSchemaHelper implements Pick { + schema: DMMF.Schema; + queryType: DMMF.OutputType; + mutationType: DMMF.OutputType; + outputTypes: { + model: DMMF.OutputType[]; + prisma: DMMF.OutputType[]; + }; + outputTypeMap: Dictionary; + inputObjectTypes: { + model?: DMMF.InputType[]; + prisma: DMMF.InputType[]; + }; + inputTypeMap: Dictionary; + enumMap: Dictionary; + rootFieldMap: Dictionary; + constructor({ schema }: Pick); + get [Symbol.toStringTag](): string; + outputTypeToMergedOutputType: (outputType: DMMF.OutputType) => DMMF.OutputType; + resolveOutputTypes(): void; + resolveInputTypes(): void; + resolveFieldArgumentTypes(): void; + getQueryType(): DMMF.OutputType; + getMutationType(): DMMF.OutputType; + getOutputTypes(): { + model: DMMF.OutputType[]; + prisma: DMMF.OutputType[]; + }; + getEnumMap(): Dictionary; + hasEnumInNamespace(enumName: string, namespace: 'prisma' | 'model'): boolean; + getMergedOutputTypeMap(): Dictionary; + getInputTypeMap(): Dictionary; + getRootFieldMap(): Dictionary; +} + +declare class Document_2 { + readonly type: 'query' | 'mutation'; + readonly children: Field[]; + constructor(type: 'query' | 'mutation', children: Field[]); + get [Symbol.toStringTag](): string; + toString(): string; + validate(select?: any, isTopLevelQuery?: boolean, originalMethod?: string, errorFormat?: 'pretty' | 'minimal' | 'colorless', validationCallsite?: any): void; + protected printFieldError: ({ error }: FieldError, missingItems: MissingItem[], minimal: boolean) => string | undefined; + protected printArgError: ({ error, path }: ArgError, hasMissingItems: boolean, minimal: boolean) => string | undefined; + /** + * As we're allowing both single objects and array of objects for list inputs, we need to remove incorrect + * zero indexes from the path + * @param inputPath e.g. ['where', 'AND', 0, 'id'] + * @param select select object + */ + private normalizePath; +} + +declare interface DocumentInput { + dmmf: DMMFClass; + rootTypeName: 'query' | 'mutation'; + rootField: string; + select?: any; + modelName?: string; + extensions: MergedExtensionsList; +} + +/** Client */ +export declare type DynamicClientExtensionArgs> = { + [P in keyof C_]: unknown; +} & { + [K: symbol]: { + ctx: Optional, ITXClientDenyList>; + }; +}; + +export declare type DynamicClientExtensionThis> = { + [P in keyof ExtArgs['client']]: Return; +} & { + [P in Exclude]: DynamicModelExtensionThis, ExtArgs>; +} & { + [P in Exclude]: >(...args: ToTuple) => PrismaPromise; +} & { + [P in Exclude]: DynamicClientExtensionThisBuiltin[P]; +}; + +declare type DynamicClientExtensionThisBuiltin> = { + $extends: ExtendsHook<'extends', TypeMapCb, ExtArgs>; + $transaction

[]>(arg: [...P], options?: { + isolationLevel?: TypeMap['meta']['txIsolationLevel']; + }): Promise>; + $transaction(fn: (client: Omit, ITXClientDenyList>) => Promise, options?: { + maxWait?: number; + timeout?: number; + isolationLevel?: TypeMap['meta']['txIsolationLevel']; + }): Promise; + $disconnect(): Promise; + $connect(): Promise; +}; + +/** Model */ +export declare type DynamicModelExtensionArgs> = { + [K in keyof M_]: K extends '$allModels' ? { + [P in keyof M_[K]]?: unknown; + } & { + [K: symbol]: {}; + } : K extends TypeMap['meta']['modelProps'] ? { + [P in keyof M_[K]]?: unknown; + } & { + [K: symbol]: { + ctx: DynamicModelExtensionThis, ExtArgs> & { + name: ModelKey; + }; + }; + } : never; +}; + +declare type DynamicModelExtensionFluentApi = { + [K in keyof TypeMap['model'][M]['payload']['objects']]: (args?: Exact>) => PrismaPromise, [K]> | Null> & DynamicModelExtensionFluentApi; +}; + +declare type DynamicModelExtensionFnResult> = P extends FluentOperation ? DynamicModelExtensionFluentApi & PrismaPromise | Null> : PrismaPromise>; + +declare type DynamicModelExtensionFnResultBase = GetResult_2; + +declare type DynamicModelExtensionFnResultNull

= P extends 'findUnique' | 'findFirst' ? null : never; + +declare type DynamicModelExtensionOperationFn = {} extends TypeMap['model'][M]['operations'][P]['args'] ? (args?: Exact) => DynamicModelExtensionFnResult : (args: Exact) => DynamicModelExtensionFnResult; + +export declare type DynamicModelExtensionThis> = { + [P in keyof ExtArgs['model'][Uncapitalize]]: Return][P]>; +} & { + [P in Exclude]>]: DynamicModelExtensionOperationFn; +} & { + [P in Exclude<'fields' & keyof TypeMap['model'][M], keyof ExtArgs['model'][Uncapitalize]>]: TypeMap['model'][M]['fields']; +} & { + [K: symbol]: { + types: TypeMap['model'][M]; + }; +}; + +/** Query */ +export declare type DynamicQueryExtensionArgs = { + [K in keyof Q_]: K extends '$allOperations' ? (args: { + model?: string; + operation: string; + args: any; + query: (args: any) => PrismaPromise; + }) => Promise : K extends '$allModels' ? { + [P in keyof Q_[K] | keyof TypeMap['model'][keyof TypeMap['model']]['operations'] | '$allOperations']?: P extends '$allOperations' ? DynamicQueryExtensionCb : P extends keyof TypeMap['model'][keyof TypeMap['model']]['operations'] ? DynamicQueryExtensionCb : never; + } : K extends TypeMap['meta']['modelProps'] ? { + [P in keyof Q_[K] | keyof TypeMap['model'][ModelKey]['operations'] | '$allOperations']?: P extends '$allOperations' ? DynamicQueryExtensionCb, keyof TypeMap['model'][ModelKey]['operations']> : P extends keyof TypeMap['model'][ModelKey]['operations'] ? DynamicQueryExtensionCb, P> : never; + } : K extends keyof TypeMap['other']['operations'] ? DynamicQueryExtensionCb<[TypeMap], 0, 'other', K> : never; +}; + +declare type DynamicQueryExtensionCb = >(args: A) => Promise; + +declare type DynamicQueryExtensionCbArgs = (_1 extends unknown ? _2 extends unknown ? { + args: DynamicQueryExtensionCbArgsArgs; + model: _0 extends 0 ? undefined : _1; + operation: _2; + query: (args: DynamicQueryExtensionCbArgsArgs) => PrismaPromise; +} : never : never) & { + query: (args: DynamicQueryExtensionCbArgsArgs) => PrismaPromise; +}; + +declare type DynamicQueryExtensionCbArgsArgs = _2 extends '$queryRaw' | '$executeRaw' ? Sql : TypeMap[_0][_1]['operations'][_2]['args']; + +/** Result */ +export declare type DynamicResultExtensionArgs = { + [K in keyof R_]: { + [P in keyof R_[K]]?: { + needs?: DynamicResultExtensionNeeds, R_[K][P]>; + compute(data: DynamicResultExtensionData, R_[K][P]>): any; + }; + }; +}; + +declare type DynamicResultExtensionData = GetFindResult; + +declare type DynamicResultExtensionNeeds = { + [K in keyof S]: K extends keyof TypeMap['model'][M]['payload']['scalars'] ? S[K] : never; +} & { + [N in keyof TypeMap['model'][M]['payload']['scalars']]?: boolean; +}; + +/** + * Placeholder value for "no text". + */ +export declare const empty: Sql; + +declare interface EmptyIncludeError { + type: 'emptyInclude'; + field: DMMF.SchemaField; +} + +declare interface EmptySelectError { + type: 'emptySelect'; + field: DMMF.SchemaField; +} + +declare type EmptyToUnknown = T; + +declare abstract class Engine { + abstract on(event: EngineEventType, listener: (args?: any) => any): void; + abstract start(): Promise; + abstract stop(): Promise; + abstract getDmmf(): Promise; + abstract version(forceRun?: boolean): Promise | string; + abstract request(query: EngineQuery, options: RequestOptions): Promise>; + abstract requestBatch(queries: EngineBatchQueries, options: RequestBatchOptions): Promise[]>; + abstract transaction(action: 'start', headers: Transaction.TransactionHeaders, options?: Transaction.Options): Promise>; + abstract transaction(action: 'commit', headers: Transaction.TransactionHeaders, info: Transaction.InteractiveTransactionInfo): Promise; + abstract transaction(action: 'rollback', headers: Transaction.TransactionHeaders, info: Transaction.InteractiveTransactionInfo): Promise; + abstract metrics(options: MetricsOptionsJson): Promise; + abstract metrics(options: MetricsOptionsPrometheus): Promise; +} + +declare type EngineBatchQueries = GraphQLQuery[] | JsonQuery[]; + +declare interface EngineConfig { + cwd: string; + dirname: string; + datamodelPath: string; + enableDebugLogs?: boolean; + allowTriggerPanic?: boolean; + prismaPath?: string; + generator?: GeneratorConfig; + datasources?: DatasourceOverwrite[]; + showColors?: boolean; + logQueries?: boolean; + logLevel?: 'info' | 'warn'; + env: Record; + flags?: string[]; + clientVersion?: string; + previewFeatures?: string[]; + engineEndpoint?: string; + activeProvider?: string; + logEmitter: EventEmitter; + engineProtocol: EngineProtocol; + /** + * The contents of the schema encoded into a string + * @remarks only used for the purpose of data proxy + */ + inlineSchema?: string; + /** + * The contents of the datasource url saved in a string + * @remarks only used for the purpose of data proxy + */ + inlineDatasources?: Record; + /** + * The string hash that was produced for a given schema + * @remarks only used for the purpose of data proxy + */ + inlineSchemaHash?: string; + /** + * The helper for interaction with OTEL tracing + * @remarks enabling is determined by the client and @prisma/instrumentation package + */ + tracingHelper: TracingHelper; + /** + * Information about whether we have not found a schema.prisma file in the + * default location, and that we fell back to finding the schema.prisma file + * in the current working directory. This usually means it has been bundled. + */ + isBundled?: boolean; +} + +declare type EngineEventType = 'query' | 'info' | 'warn' | 'error' | 'beforeExit'; + +declare type EngineProtocol = 'graphql' | 'json'; + +declare type EngineQuery = GraphQLQuery | JsonQuery; + +declare type EngineSpan = { + span: boolean; + name: string; + trace_id: string; + span_id: string; + parent_span_id: string; + start_time: [number, number]; + end_time: [number, number]; + attributes?: Record; + links?: { + trace_id: string; + span_id: string; + }[]; +}; + +declare type EngineSpanEvent = { + span: boolean; + spans: EngineSpan[]; +}; + +declare interface EnvValue { + fromEnvVar: null | string; + value: null | string; +} + +declare interface EnvValue_2 { + fromEnvVar: string | null; + value: string | null; +} + +declare type ErrorFormat = 'pretty' | 'colorless' | 'minimal'; + +declare interface ErrorWithBatchIndex { + batchRequestIdx?: number; +} + +declare interface EventEmitter { + on(event: string, listener: (...args: any[]) => void): unknown; + emit(event: string, args?: any): boolean; +} + +declare type Exact = (W extends A ? { + [K in keyof W]: K extends keyof A ? Exact : never; +} : W) | (A extends Narrowable ? A : never); + +/** + * Defines Exception. + * + * string or an object with one of (message or name or code) and optional stack + */ +declare type Exception = ExceptionWithCode | ExceptionWithMessage | ExceptionWithName | string; + +declare interface ExceptionWithCode { + code: string | number; + name?: string; + message?: string; + stack?: string; +} + +declare interface ExceptionWithMessage { + code?: string | number; + message: string; + name?: string; + stack?: string; +} + +declare interface ExceptionWithName { + code?: string | number; + message?: string; + name: string; + stack?: string; +} + +declare type ExtendedSpanOptions = SpanOptions & { + /** The name of the span */ + name: string; + internal?: boolean; + middleware?: boolean; + /** Whether it propagates context (?=true) */ + active?: boolean; + /** The context to append the span to */ + context?: Context; +}; + +/** $extends, defineExtension */ +export declare interface ExtendsHook, TypeMap extends TypeMapDef = Call> { + extArgs: ExtArgs; + , MergedArgs extends InternalArgs = MergeExtArgs>(extension: ((client: DynamicClientExtensionThis) => { + $extends: { + extArgs: Args; + }; + }) | { + name?: string; + query?: DynamicQueryExtensionArgs; + result?: DynamicResultExtensionArgs & R; + model?: DynamicModelExtensionArgs & M; + client?: DynamicClientExtensionArgs & C; + }): { + 'extends': DynamicClientExtensionThis, TypeMapCb, MergedArgs>; + 'define': (client: any) => { + $extends: { + extArgs: Args; + }; + }; + }[Variant]; +} + +declare namespace Extensions { + export { + defineExtension, + getExtensionContext + } +} +export { Extensions } + +declare namespace Extensions_2 { + export { + InternalArgs, + Args, + DefaultArgs, + GetResult, + GetSelect, + DynamicQueryExtensionArgs, + DynamicResultExtensionArgs, + DynamicModelExtensionArgs, + DynamicModelExtensionThis, + DynamicClientExtensionArgs, + DynamicClientExtensionThis, + ExtendsHook, + UserArgs + } +} + +declare type Fetch = typeof nodeFetch; + +declare class Field { + readonly name: string; + readonly args?: Args_3; + readonly children?: Field[]; + readonly error?: InvalidFieldError; + readonly hasInvalidChild: boolean; + readonly hasInvalidArg: boolean; + readonly schemaField?: DMMF.SchemaField; + constructor({ name, args, children, error, schemaField }: FieldArgs); + get [Symbol.toStringTag](): string; + toString(): string; + collectErrors(prefix?: string): { + fieldErrors: FieldError[]; + argErrors: ArgError[]; + }; +} + +declare interface FieldArgs { + name: string; + schemaField?: DMMF.SchemaField; + args?: Args_3; + children?: Field[]; + error?: InvalidFieldError; +} + +declare interface FieldError { + path: string[]; + error: InvalidFieldError; +} + +/** + * A reference to a specific field of a specific model + */ +export declare interface FieldRef { + readonly modelName: Model; + readonly name: string; + readonly typeName: FieldType; + readonly isList: boolean; +} + +declare type FluentOperation = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'create' | 'update' | 'upsert' | 'delete'; + +declare interface Fn { + params: Params; + returns: Returns; +} + +declare interface GeneratorConfig { + name: string; + output: EnvValue | null; + isCustomOutput?: boolean; + provider: EnvValue; + config: Dictionary_2; + binaryTargets: BinaryTargetsEnvValue[]; + previewFeatures: string[]; +} + +declare type GetAggregateResult

= { + [K in keyof A as K extends Aggregate ? K : never]: K extends '_count' ? A[K] extends true ? number : Count : { + [J in keyof A[K] & string]: P['scalars'][J] | null; + }; +}; + +declare type GetBatchResult = { + count: number; +}; + +declare type GetCountResult = A extends { + select: infer S; +} ? (S extends true ? number : Count) : number; + +declare function getExtensionContext(that: T): Context_2; + +declare type GetFindResult

= {} extends A ? DefaultSelection

: A extends { + select: infer S; +} & Record | { + include: infer S; +} & Record ? S extends undefined ? DefaultSelection

: { + [K in keyof S as S[K] extends false | undefined | null ? never : K]: S[K] extends object ? P extends SelectablePayloadFields ? O extends Payload ? GetFindResult[] : never : P extends SelectablePayloadFields ? O extends Payload ? GetFindResult | SelectField & null : never : K extends '_count' ? Count> : never : P extends SelectablePayloadFields ? O extends Payload ? DefaultSelection[] : never : P extends SelectablePayloadFields ? O extends Payload ? DefaultSelection | SelectField & null : never : P extends { + scalars: { + [k in K]: infer O; + }; + } ? O : K extends '_count' ? Count : never; +} & (A extends { + include: any; +} & Record ? DefaultSelection

: unknown) : DefaultSelection

; + +declare type GetGroupByResult

= A extends { + by: string[]; +} ? Array & { + [K in A['by'][number]]: P['scalars'][K]; +}> : never; + +export declare function getPrismaClient(config: GetPrismaClientConfig): { + new (optionsArg?: PrismaClientOptions): { + _runtimeDataModel: RuntimeDataModel; + _dmmf?: DMMFClass | undefined; + _engine: Engine; + _fetcher: RequestHandler; + _connectionPromise?: Promise | undefined; + _disconnectionPromise?: Promise | undefined; + _engineConfig: EngineConfig; + _clientVersion: string; + _errorFormat: ErrorFormat; + _clientEngineType: ClientEngineType; + _tracingHelper: TracingHelper; + _metrics: MetricsClient; + _middlewares: MiddlewareHandler; + _previewFeatures: string[]; + _activeProvider: string; + _rejectOnNotFound?: InstanceRejectOnNotFound; + _dataProxy: boolean; + _extensions: MergedExtensionsList; + _createPrismaPromise: PrismaPromiseFactory; + getEngine(): Engine; + /** + * Hook a middleware into the client + * @param middleware to hook + */ + $use(middleware: QueryMiddleware): void; + $on(eventType: EngineEventType, callback: (event: any) => void): void; + $connect(): Promise; + /** + * @private + */ + _runDisconnect(): Promise; + /** + * Disconnect from the database + */ + $disconnect(): Promise; + /** + * Executes a raw query and always returns a number + */ + $executeRawInternal(transaction: PrismaPromiseTransaction | undefined, clientMethod: string, args: RawQueryArgs, middlewareArgsMapper?: MiddlewareArgsMapper): Promise; + /** + * Executes a raw query provided through a safe tag function + * @see https://github.com/prisma/prisma/issues/7142 + * + * @param query + * @param values + * @returns + */ + $executeRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2; + /** + * Unsafe counterpart of `$executeRaw` that is susceptible to SQL injections + * @see https://github.com/prisma/prisma/issues/7142 + * + * @param query + * @param values + * @returns + */ + $executeRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2; + /** + * Executes a raw command only for MongoDB + * + * @param command + * @returns + */ + $runCommandRaw(command: Record): PrismaPromise_2; + /** + * Executes a raw query and returns selected data + */ + $queryRawInternal(transaction: PrismaPromiseTransaction | undefined, clientMethod: string, args: RawQueryArgs, middlewareArgsMapper?: MiddlewareArgsMapper): Promise; + /** + * Executes a raw query provided through a safe tag function + * @see https://github.com/prisma/prisma/issues/7142 + * + * @param query + * @param values + * @returns + */ + $queryRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2; + /** + * Unsafe counterpart of `$queryRaw` that is susceptible to SQL injections + * @see https://github.com/prisma/prisma/issues/7142 + * + * @param query + * @param values + * @returns + */ + $queryRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2; + /** + * Execute a batch of requests in a transaction + * @param requests + * @param options + */ + _transactionWithArray({ promises, options, }: { + promises: Array>; + options?: BatchTransactionOptions | undefined; + }): Promise; + /** + * Perform a long-running transaction + * @param callback + * @param options + * @returns + */ + _transactionWithCallback({ callback, options, }: { + callback: (client: Client) => Promise; + options?: Options | undefined; + }): Promise; + _createItxClient(transaction: PrismaPromiseInteractiveTransaction): any; + /** + * Execute queries within a transaction + * @param input a callback or a query list + * @param options to set timeouts (callback) + * @returns + */ + $transaction(input: any, options?: any): Promise; + /** + * Runs the middlewares over params before executing a request + * @param internalParams + * @returns + */ + _request(internalParams: InternalRequestParams): Promise; + _executeRequest({ args, clientMethod, dataPath, callsite, action, model, argsMapper, transaction, unpacker, otelParentCtx, customDataProxyFetch, }: InternalRequestParams): Promise; + _getDmmf: (params: Pick) => Promise; + _getProtocolEncoder: (params: Pick) => Promise>; + readonly $metrics: MetricsClient; + /** + * Shortcut for checking a preview flag + * @param feature preview flag + * @returns + */ + _hasPreviewFlag(feature: string): boolean; + $extends: typeof $extends; + readonly [Symbol.toStringTag]: string; + }; +}; + +/** + * Config that is stored into the generated client. When the generated client is + * loaded, this same config is passed to {@link getPrismaClient} which creates a + * closure with that config around a non-instantiated [[PrismaClient]]. + */ +declare type GetPrismaClientConfig = ({ + runtimeDataModel: RuntimeDataModel; + document?: undefined; +} | { + runtimeDataModel?: undefined; + document: DMMF.Document; +}) & { + generator?: GeneratorConfig; + sqliteDatasourceOverrides?: DatasourceOverwrite[]; + relativeEnvPaths: { + rootEnvPath?: string | null; + schemaEnvPath?: string | null; + }; + relativePath: string; + dirname: string; + filename?: string; + clientVersion: string; + engineVersion?: string; + datasourceNames: string[]; + activeProvider: string; + /** + * True when `--data-proxy` is passed to `prisma generate` + * If enabled, we disregard the generator config engineType. + * It means that `--data-proxy` binds you to the Data Proxy. + */ + dataProxy: boolean; + /** + * The contents of the schema encoded into a string + * @remarks only used for the purpose of data proxy + */ + inlineSchema?: string; + /** + * A special env object just for the data proxy edge runtime. + * Allows bundlers to inject their own env variables (Vercel). + * Allows platforms to declare global variables as env (Workers). + * @remarks only used for the purpose of data proxy + */ + injectableEdgeEnv?: LoadedEnv; + /** + * Engine protocol to use within edge runtime. Passed + * through config because edge client can not read env variables + * @remarks only used for the purpose of data proxy + */ + edgeClientProtocol?: QueryEngineProtocol; + /** + * The contents of the datasource url saved in a string. + * This can either be an env var name or connection string. + * It is needed by the client to connect to the Data Proxy. + * @remarks only used for the purpose of data proxy + */ + inlineDatasources?: InlineDatasources; + /** + * The string hash that was produced for a given schema + * @remarks only used for the purpose of data proxy + */ + inlineSchemaHash?: string; + /** + * A marker to indicate that the client was not generated via `prisma + * generate` but was generated via `generate --postinstall` script instead. + * @remarks used to error for Vercel/Netlify for schema caching issues + */ + postinstall?: boolean; + /** + * Information about the CI where the Prisma Client has been generated. The + * name of the CI environment is stored at generation time because CI + * information is not always available at runtime. Moreover, the edge client + * has no notion of environment variables, so this works around that. + * @remarks used to error for Vercel/Netlify for schema caching issues + */ + ciName?: string; + /** + * Information about whether we have not found a schema.prisma file in the + * default location, and that we fell back to finding the schema.prisma file + * in the current working directory. This usually means it has been bundled. + */ + isBundled?: boolean; +}; + +export declare type GetResult, R extends Args['result'][string], KR extends keyof R = string extends keyof R ? never : keyof R> = { + [K in KR | keyof Base]: K extends KR ? R[K] extends (() => { + compute: (...args: any) => infer C; + }) ? C : never : Base[K]; +}; + +declare type GetResult_2

= { + findUnique: GetFindResult | Null; + findUniqueOrThrow: GetFindResult; + findFirst: GetFindResult | Null; + findFirstOrThrow: GetFindResult; + findMany: GetFindResult[]; + create: GetFindResult; + createMany: GetBatchResult; + update: GetFindResult; + updateMany: GetBatchResult; + upsert: GetFindResult; + delete: GetFindResult; + deleteMany: GetBatchResult; + aggregate: GetAggregateResult; + count: GetCountResult; + groupBy: GetGroupByResult; + $queryRaw: unknown; + $executeRaw: number; + $queryRawUnsafe: unknown; + $executeRawUnsafe: number; + $runCommandRaw: JsonObject; + findRaw: JsonObject; + aggregateRaw: JsonObject; +}[O]; + +export declare type GetSelect, R extends Args['result'][string], KR extends keyof R = string extends keyof R ? never : keyof R> = { + [K in KR | keyof Base]?: K extends KR ? boolean : Base[K]; +}; + +declare type GraphQLQuery = { + query: string; + variables: object; +}; + +declare type HandleErrorParams = { + args: JsArgs; + error: any; + clientMethod: string; + callsite?: CallSite; + transaction?: PrismaPromiseTransaction; +}; + +declare type Headers_2 = Record; + +/** + * Defines High-Resolution Time. + * + * The first number, HrTime[0], is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970. + * The second number, HrTime[1], represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds. + * For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150. + * The first number is calculated by converting and truncating the Epoch time in milliseconds to seconds: + * HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210. + * The second number is calculated by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds: + * HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000. + * This is represented in HrTime format as [1609504210, 150000000]. + */ +declare type HrTime = [number, number]; + +declare interface IncludeAndSelectError { + type: 'includeAndSelect'; + field: DMMF.SchemaField; +} + +declare type InlineDatasource = { + url: NullableEnvValue; +}; + +declare type InlineDatasources = { + [name in InternalDatasource['name']]: { + url: InternalDatasource['url']; + }; +}; + +declare type InstanceRejectOnNotFound = RejectOnNotFound | Record | Record>; + +declare type InteractiveTransactionInfo = { + /** + * Transaction ID returned by the query engine. + */ + id: string; + /** + * Arbitrary payload the meaning of which depends on the `Engine` implementation. + * For example, `DataProxyEngine` needs to associate different API endpoints with transactions. + * In `LibraryEngine` and `BinaryEngine` it is currently not used. + */ + payload: Payload; +}; + +declare type InteractiveTransactionOptions = Transaction.InteractiveTransactionInfo; + +export declare type InternalArgs = { + result: { + [K in keyof R]: { + [P in keyof R[K]]: () => R[K][P]; + }; + }; + model: { + [K in keyof M]: { + [P in keyof M[K]]: () => M[K][P]; + }; + }; + query: { + [K in keyof Q]: { + [P in keyof Q[K]]: () => Q[K][P]; + }; + }; + client: { + [K in keyof C]: () => C[K]; + }; +}; + +declare interface InternalDatasource { + name: string; + activeProvider: ConnectorType; + provider: ConnectorType; + url: EnvValue_2; + config: any; +} + +declare type InternalRequestParams = { + /** + * The original client method being called. + * Even though the rootField / operation can be changed, + * this method stays as it is, as it's what the user's + * code looks like + */ + clientMethod: string; + /** + * Name of js model that triggered the request. Might be used + * for warnings or error messages + */ + jsModelName?: string; + callsite?: CallSite; + transaction?: PrismaPromiseTransaction; + unpacker?: Unpacker; + otelParentCtx?: Context; + /** Used to "desugar" a user input into an "expanded" one */ + argsMapper?: (args?: UserArgs_2) => UserArgs_2; + /** Used to convert args for middleware and back */ + middlewareArgsMapper?: MiddlewareArgsMapper; + /** Used for Accelerate client extension via Data Proxy */ + customDataProxyFetch?: (fetch: Fetch) => Fetch; +} & Omit; + +declare type InvalidArgError = InvalidArgNameError | MissingArgError | InvalidArgTypeError | AtLeastOneError | AtMostOneError | InvalidNullArgError | InvalidDateArgError; + +/** + * This error occurs if the user provides an arg name that doesn't exist + */ +declare interface InvalidArgNameError { + type: 'invalidName'; + providedName: string; + providedValue: any; + didYouMeanArg?: string; + didYouMeanField?: string; + originalType: DMMF.ArgType; + possibilities?: DMMF.SchemaArgInputType[]; + outputType?: DMMF.OutputType; +} + +/** + * If the scalar type of an arg is not matching what is required + */ +declare interface InvalidArgTypeError { + type: 'invalidType'; + argName: string; + requiredType: { + bestFittingType: DMMF.SchemaArgInputType; + inputType: DMMF.SchemaArgInputType[]; + }; + providedValue: any; +} + +/** + * User provided invalid date value + */ +declare interface InvalidDateArgError { + type: 'invalidDateArg'; + argName: string; +} + +declare type InvalidFieldError = InvalidFieldNameError | InvalidFieldTypeError | EmptySelectError | NoTrueSelectError | IncludeAndSelectError | EmptyIncludeError; + +declare interface InvalidFieldNameError { + type: 'invalidFieldName'; + modelName: string; + didYouMean?: string | null; + providedName: string; + isInclude?: boolean; + isIncludeScalar?: boolean; + outputType: DMMF.OutputType; +} + +declare interface InvalidFieldTypeError { + type: 'invalidFieldType'; + modelName: string; + fieldName: string; + providedValue: any; +} + +/** + * If a user incorrectly provided null where she shouldn't have + */ +declare interface InvalidNullArgError { + type: 'invalidNullArg'; + name: string; + invalidType: DMMF.SchemaArgInputType[]; + atLeastOne: boolean; + atMostOne: boolean; +} + +declare enum IsolationLevel { + ReadUncommitted = "ReadUncommitted", + ReadCommitted = "ReadCommitted", + RepeatableRead = "RepeatableRead", + Snapshot = "Snapshot", + Serializable = "Serializable" +} + +export declare type ITXClientDenyList = (typeof denylist)[number]; + +declare interface Job { + resolve: (data: any) => void; + reject: (data: any) => void; + request: any; +} + +/** + * Create a SQL query for a list of values. + */ +export declare function join(values: RawValue[], separator?: string, prefix?: string, suffix?: string): Sql; + +declare type JsArgs = { + select?: Selection_2; + include?: Selection_2; + [argName: string]: JsInputValue; +}; + +declare type JsInputValue = null | undefined | string | number | boolean | bigint | Uint8Array | Date | DecimalJsLike | ObjectEnumValue | RawParameters | FieldRef | JsInputValue[] | { + [key: string]: JsInputValue; +}; + +declare type JsonArgumentValue = number | string | boolean | null | JsonTaggedValue | JsonArgumentValue[] | { + [key: string]: JsonArgumentValue; +}; + +declare interface JsonArray extends Array { +} + +declare type JsonFieldSelection = { + arguments?: Record; + selection: JsonSelectionSet; +}; + +declare class JsonNull extends NullTypesEnumValue { +} + +declare type JsonObject = { + [Key in string]?: JsonValue; +}; + +declare type JsonQuery = { + modelName?: string; + action: JsonQueryAction; + query: JsonFieldSelection; +}; + +declare type JsonQueryAction = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'findMany' | 'createOne' | 'createMany' | 'updateOne' | 'updateMany' | 'deleteOne' | 'deleteMany' | 'upsertOne' | 'aggregate' | 'groupBy' | 'executeRaw' | 'queryRaw' | 'runCommandRaw' | 'findRaw' | 'aggregateRaw'; + +declare type JsonSelectionSet = { + $scalars?: boolean; + $composites?: boolean; +} & { + [fieldName: string]: boolean | JsonFieldSelection; +}; + +declare type JsonTaggedValue = { + $type: 'Json'; + value: string; +}; + +declare type JsonValue = string | number | boolean | JsonObject | JsonArray | null; + +declare type KnownErrorParams = { + code: string; + clientVersion: string; + meta?: Record; + batchRequestIdx?: number; +}; + +declare type LegacyExact = W extends unknown ? A extends LegacyNarrowable ? Cast : Cast<{ + [K in keyof A]: K extends keyof W ? LegacyExact : never; +}, { + [K in keyof W]: K extends keyof A ? LegacyExact : W[K]; +}> : never; + +declare type LegacyNarrowable = string | number | boolean | bigint; + +/** + * A pointer from the current {@link Span} to another span in the same trace or + * in a different trace. + * Few examples of Link usage. + * 1. Batch Processing: A batch of elements may contain elements associated + * with one or more traces/spans. Since there can only be one parent + * SpanContext, Link is used to keep reference to SpanContext of all + * elements in the batch. + * 2. Public Endpoint: A SpanContext in incoming client request on a public + * endpoint is untrusted from service provider perspective. In such case it + * is advisable to start a new trace with appropriate sampling decision. + * However, it is desirable to associate incoming SpanContext to new trace + * initiated on service provider side so two traces (from Client and from + * Service Provider) can be correlated. + */ +declare interface Link { + /** The {@link SpanContext} of a linked span. */ + context: SpanContext; + /** A set of {@link SpanAttributes} on the link. */ + attributes?: SpanAttributes; + /** Count of attributes of the link that were dropped due to collection limits */ + droppedAttributesCount?: number; +} + +declare type LoadedEnv = { + message?: string; + parsed: { + [x: string]: string; + }; +} | undefined; + +declare type LocationInFile = { + fileName: string; + lineNumber: number | null; + columnNumber: number | null; +}; + +declare type LogDefinition = { + level: LogLevel; + emit: 'stdout' | 'event'; +}; + +declare type LogLevel = 'info' | 'query' | 'warn' | 'error'; + +export declare function makeDocument({ dmmf, rootTypeName, rootField, select, modelName, extensions, }: DocumentInput): Document_2; + +/** + * Generates more strict variant of an enum which, unlike regular enum, + * throws on non-existing property access. This can be useful in following situations: + * - we have an API, that accepts both `undefined` and `SomeEnumType` as an input + * - enum values are generated dynamically from DMMF. + * + * In that case, if using normal enums and no compile-time typechecking, using non-existing property + * will result in `undefined` value being used, which will be accepted. Using strict enum + * in this case will help to have a runtime exception, telling you that you are probably doing something wrong. + * + * Note: if you need to check for existence of a value in the enum you can still use either + * `in` operator or `hasOwnProperty` function. + * + * @param definition + * @returns + */ +export declare function makeStrictEnum>(definition: T): T; + +/** + * Class that holds the list of all extensions, applied to particular instance, + * as well as resolved versions of the components that need to apply on + * different levels. Main idea of this class: avoid re-resolving as much of the + * stuff as possible when new extensions are added while also delaying the + * resolve until the point it is actually needed. For example, computed fields + * of the model won't be resolved unless the model is actually queried. Neither + * adding extensions with `client` component only cause other components to + * recompute. + */ +declare class MergedExtensionsList { + private head?; + private constructor(); + static empty(): MergedExtensionsList; + static single(extension: Args_2): MergedExtensionsList; + isEmpty(): boolean; + append(extension: Args_2): MergedExtensionsList; + getAllComputedFields(dmmfModelName: string): ComputedFieldsMap | undefined; + getAllClientExtensions(): ClientArg | undefined; + getAllModelExtensions(dmmfModelName: string): ModelArg | undefined; + getAllQueryCallbacks(jsModelName: string, operation: string): any; + getAllBatchQueryCallbacks(): BatchQueryOptionsCb[]; +} + +declare type MergeExtArgs, Args extends Record> = ComputeDeep & AllModelsToStringIndex>; + +export declare type Metric = { + key: string; + value: T; + labels: Record; + description: string; +}; + +export declare type MetricHistogram = { + buckets: MetricHistogramBucket[]; + sum: number; + count: number; +}; + +export declare type MetricHistogramBucket = [maxValue: number, count: number]; + +export declare type Metrics = { + counters: Metric[]; + gauges: Metric[]; + histograms: Metric[]; +}; + +export declare class MetricsClient { + private _engine; + constructor(engine: Engine); + /** + * Returns all metrics gathered up to this point in prometheus format. + * Result of this call can be exposed directly to prometheus scraping endpoint + * + * @param options + * @returns + */ + prometheus(options?: MetricsOptions): Promise; + /** + * Returns all metrics gathered up to this point in prometheus format. + * + * @param options + * @returns + */ + json(options?: MetricsOptions): Promise; +} + +declare type MetricsOptions = { + /** + * Labels to add to every metrics in key-value format + */ + globalLabels?: Record; +}; + +declare type MetricsOptionsCommon = { + globalLabels?: Record; +}; + +declare type MetricsOptionsJson = { + format: 'json'; +} & MetricsOptionsCommon; + +declare type MetricsOptionsPrometheus = { + format: 'prometheus'; +} & MetricsOptionsCommon; + +declare type MiddlewareArgsMapper = { + requestArgsToMiddlewareArgs(requestArgs: RequestArgs): MiddlewareArgs; + middlewareArgsToRequestArgs(middlewareArgs: MiddlewareArgs): RequestArgs; +}; + +declare class MiddlewareHandler { + private _middlewares; + use(middleware: M): void; + get(id: number): M | undefined; + has(id: number): boolean; + length(): number; +} + +/** + * Opposite of InvalidArgNameError - if the user *doesn't* provide an arg that should be provided + * This error both happens with an implicit and explicit `undefined` + */ +declare interface MissingArgError { + type: 'missingArg'; + missingName: string; + missingArg: DMMF.SchemaArg; + atLeastOne: boolean; + atMostOne: boolean; +} + +declare interface MissingItem { + path: string; + isRequired: boolean; + type: string | object; +} + +declare type ModelArg = { + [MethodName in string]: unknown; +}; + +declare type ModelArgs = { + model: { + [ModelName in string]: ModelArg; + }; +}; + +declare type ModelKey = M extends keyof TypeMap['model'] ? M : Capitalize; + +declare type ModelQueryOptionsCb = (args: ModelQueryOptionsCbArgs) => Promise; + +declare type ModelQueryOptionsCbArgs = { + model: string; + operation: string; + args: JsArgs; + query: (args: JsArgs) => Promise; +}; + +declare type NameArgs = { + name?: string; +}; + +declare type Narrow = { + [K in keyof A]: A[K] extends Function ? A[K] : Narrow; +} | (A extends Narrowable ? A : never); + +declare type Narrowable = string | number | bigint | boolean | []; + +declare type NeverToUnknown = [T] extends [never] ? unknown : T; + +/** + * Imitates `fetch` via `https` to only suit our needs, it does nothing more. + * This is because we cannot bundle `node-fetch` as it uses many other Node.js + * utilities, while also bloating our bundles. This approach is much leaner. + * @param url + * @param options + * @returns + */ +declare function nodeFetch(url: string, options?: RequestOptions_2): Promise; + +/** + * @deprecated please don´t rely on type checks to this error anymore. + * This will become a PrismaClientKnownRequestError with code P2025 + * in the future major version of the client + */ +export declare class NotFoundError extends PrismaClientKnownRequestError { + constructor(message: string); +} + +declare interface NoTrueSelectError { + type: 'noTrueSelect'; + field: DMMF.SchemaField; +} + +declare type NullableEnvValue = { + fromEnvVar: string | null; + value?: string | null; +}; + +declare class NullTypesEnumValue extends ObjectEnumValue { + _getNamespace(): string; +} + +/** + * Base class for unique values of object-valued enums. + */ +declare abstract class ObjectEnumValue { + constructor(arg?: symbol); + abstract _getNamespace(): string; + _getName(): string; + toString(): string; +} + +export declare const objectEnumValues: { + classes: { + DbNull: typeof DbNull; + JsonNull: typeof JsonNull; + AnyNull: typeof AnyNull; + }; + instances: { + DbNull: DbNull; + JsonNull: JsonNull; + AnyNull: AnyNull; + }; +}; + +declare type Omit_2 = { + [P in keyof T as P extends K ? never : P]: T[P]; +}; + +declare type Operation = 'findFirst' | 'findFirstOrThrow' | 'findUnique' | 'findUniqueOrThrow' | 'findMany' | 'create' | 'createMany' | 'update' | 'updateMany' | 'upsert' | 'delete' | 'deleteMany' | 'aggregate' | 'count' | 'groupBy' | '$queryRaw' | '$executeRaw' | '$queryRawUnsafe' | '$executeRawUnsafe' | 'findRaw' | 'aggregateRaw' | '$runCommandRaw'; + +declare type Optional = { + [P in K & keyof O]?: O[P]; +} & { + [P in Exclude]: O[P]; +}; + +declare type OptionalFlat = { + [K in keyof T]?: T[K]; +}; + +declare type OptionalKeys = { + [K in keyof O]-?: {} extends Pick_2 ? K : never; +}[keyof O]; + +/** + * maxWait ?= 2000 + * timeout ?= 5000 + */ +declare type Options = { + maxWait?: number; + timeout?: number; + isolationLevel?: IsolationLevel; +}; + +declare type PatchFlat = O1 & Omit_2; + +declare type Path = O extends unknown ? P extends [infer K, ...infer R] ? K extends keyof O ? Path : Default : O : never; + +export declare type Payload = { + scalars: { + [ScalarName in string]: unknown; + }; + objects: { + [ObjectName in string]: unknown; + }; + composites: { + [CompositeName in string]: unknown; + }; +}; + +declare type Payload_2 = T extends { + [K: symbol]: { + types: { + payload: any; + }; + }; +} ? T[symbol]['types']['payload'] : never; + +declare type PayloadToResult = RenameAndNestPayloadKeys

> = { + [K in keyof O]?: O[K][K] extends any[] ? PayloadToResult[] : O[K][K] extends object ? PayloadToResult : O[K][K]; +}; + +declare type Pick_2 = { + [P in keyof T as P extends K ? P : never]: T[P]; +}; + +export declare class PrismaClientInitializationError extends Error { + clientVersion: string; + errorCode?: string; + retryable?: boolean; + constructor(message: string, clientVersion: string, errorCode?: string); + get [Symbol.toStringTag](): string; +} + +export declare class PrismaClientKnownRequestError extends Error implements ErrorWithBatchIndex { + code: string; + meta?: Record; + clientVersion: string; + batchRequestIdx?: number; + constructor(message: string, { code, clientVersion, meta, batchRequestIdx }: KnownErrorParams); + get [Symbol.toStringTag](): string; +} + +export declare interface PrismaClientOptions { + /** + * Will throw an Error if findUnique returns null + */ + rejectOnNotFound?: InstanceRejectOnNotFound; + /** + * Overwrites the datasource url from your schema.prisma file + */ + datasources?: Datasources; + /** + * @default "colorless" + */ + errorFormat?: ErrorFormat; + /** + * @example + * \`\`\` + * // Defaults to stdout + * log: ['query', 'info', 'warn'] + * + * // Emit as events + * log: [ + * { emit: 'stdout', level: 'query' }, + * { emit: 'stdout', level: 'info' }, + * { emit: 'stdout', level: 'warn' } + * ] + * \`\`\` + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option). + */ + log?: Array; + /** + * @internal + * You probably don't want to use this. \`__internal\` is used by internal tooling. + */ + __internal?: { + debug?: boolean; + engine?: { + cwd?: string; + binaryPath?: string; + endpoint?: string; + allowTriggerPanic?: boolean; + }; + }; +} + +export declare class PrismaClientRustPanicError extends Error { + clientVersion: string; + constructor(message: string, clientVersion: string); + get [Symbol.toStringTag](): string; +} + +export declare class PrismaClientUnknownRequestError extends Error implements ErrorWithBatchIndex { + clientVersion: string; + batchRequestIdx?: number; + constructor(message: string, { clientVersion, batchRequestIdx }: UnknownErrorParams); + get [Symbol.toStringTag](): string; +} + +export declare class PrismaClientValidationError extends Error { + get [Symbol.toStringTag](): string; +} + +export declare interface PrismaPromise extends Promise { + [Symbol.toStringTag]: 'PrismaPromise'; +} + +/** + * Prisma's `Promise` that is backwards-compatible. All additions on top of the + * original `Promise` are optional so that it can be backwards-compatible. + * @see [[createPrismaPromise]] + */ +declare interface PrismaPromise_2 extends Promise { + /** + * Extension of the original `.then` function + * @param onfulfilled same as regular promises + * @param onrejected same as regular promises + * @param transaction transaction options + */ + then(onfulfilled?: (value: A) => R1 | PromiseLike, onrejected?: (error: unknown) => R2 | PromiseLike, transaction?: PrismaPromiseTransaction): Promise; + /** + * Extension of the original `.catch` function + * @param onrejected same as regular promises + * @param transaction transaction options + */ + catch(onrejected?: ((reason: any) => R | PromiseLike) | undefined | null, transaction?: PrismaPromiseTransaction): Promise; + /** + * Extension of the original `.finally` function + * @param onfinally same as regular promises + * @param transaction transaction options + */ + finally(onfinally?: (() => void) | undefined | null, transaction?: PrismaPromiseTransaction): Promise; + /** + * Called when executing a batch of regular tx + * @param transaction transaction options for batch tx + */ + requestTransaction?(transaction: PrismaPromiseBatchTransaction): PromiseLike; +} + +declare type PrismaPromiseBatchTransaction = { + kind: 'batch'; + id: number; + isolationLevel?: IsolationLevel; + index: number; + lock: PromiseLike; +}; + +declare type PrismaPromiseCallback = (transaction?: PrismaPromiseTransaction) => PrismaPromise_2; + +/** + * Creates a [[PrismaPromise]]. It is Prisma's implementation of `Promise` which + * is essentially a proxy for `Promise`. All the transaction-compatible client + * methods return one, this allows for pre-preparing queries without executing + * them until `.then` is called. It's the foundation of Prisma's query batching. + * @param callback that will be wrapped within our promise implementation + * @see [[PrismaPromise]] + * @returns + */ +declare type PrismaPromiseFactory = (callback: PrismaPromiseCallback) => PrismaPromise_2; + +declare type PrismaPromiseInteractiveTransaction = { + kind: 'itx'; + id: string; + payload: PayloadType; +}; + +declare type PrismaPromiseTransaction = PrismaPromiseBatchTransaction | PrismaPromiseInteractiveTransaction; + +declare interface ProtocolEncoder { + createMessage(options: CreateMessageOptions): ProtocolMessage; + createBatch(messages: ProtocolMessage[]): EngineBatchQueries; +} + +declare interface ProtocolMessage { + isWrite(): boolean; + getBatchId(): string | undefined; + toDebugString(): string; + toEngineQuery(): EngineQueryType; + deserializeResponse(data: unknown, dataPath: string[]): unknown; +} + +declare namespace Public { + export { + validator + } +} +export { Public } + +declare namespace Public_2 { + export { + Args_4 as Args, + Result, + Payload_2 as Payload, + PrismaPromise, + Operation, + Exact + } +} + +declare type QueryEngineProtocol = 'graphql' | 'json'; + +declare type QueryEngineResult = { + data: T; + elapsed: number; +}; + +declare type QueryMiddleware = (params: QueryMiddlewareParams, next: (params: QueryMiddlewareParams) => Promise) => Promise; + +declare type QueryMiddlewareParams = { + /** The model this is executed on */ + model?: string; + /** The action that is being handled */ + action: Action; + /** TODO what is this */ + dataPath: string[]; + /** TODO what is this */ + runInTransaction: boolean; + args?: UserArgs_2; +}; + +declare type QueryOptions = { + query: { + [ModelName in string]: { + [ModelAction in string]: ModelQueryOptionsCb; + } | QueryOptionsCb; + }; +}; + +declare type QueryOptionsCb = (args: QueryOptionsCbArgs) => Promise; + +declare type QueryOptionsCbArgs = { + model?: string; + operation: string; + args: JsArgs | RawQueryArgs; + query: (args: JsArgs | RawQueryArgs) => Promise; +}; + +/** + * Create raw SQL statement. + */ +export declare function raw(value: string): Sql; + +declare type RawParameters = { + __prismaRawParameters__: true; + values: string; +}; + +declare type RawQueryArgs = Sql | [query: string, ...values: RawValue[]]; + +/** + * Supported value or SQL instance. + */ +export declare type RawValue = Value | Sql; + +declare type ReadonlyDeep = { + readonly [K in keyof T]: ReadonlyDeep; +}; + +declare type Record_2 = { + [P in T]: U; +}; + +declare type RejectOnNotFound = boolean | ((error: Error) => Error) | undefined; + +declare type RenameAndNestPayloadKeys

= { + [K in keyof P as K extends 'scalars' | 'objects' | 'composites' ? keyof P[K] : never]: P[K]; +}; + +declare type RequestBatchOptions = { + transaction?: TransactionOptions; + traceparent?: string; + numTry?: number; + containsWrite: boolean; + customDataProxyFetch?: (fetch: Fetch) => Fetch; +}; + +declare class RequestHandler { + client: Client; + dataloader: DataLoader; + private logEmitter?; + constructor(client: Client, logEmitter?: EventEmitter); + request(params: RequestParams): Promise; + mapQueryEngineResult({ protocolMessage, dataPath, unpacker, modelName, args, extensions }: RequestParams, response: QueryEngineResult): any; + /** + * Handles the error and logs it, logging the error is done synchronously waiting for the event + * handlers to finish. + */ + handleAndLogRequestError(params: HandleErrorParams): never; + handleRequestError({ error, clientMethod, callsite, transaction, args }: HandleErrorParams): never; + sanitizeMessage(message: any): any; + unpack(message: ProtocolMessage, data: unknown, dataPath: string[], unpacker?: Unpacker): any; + applyResultExtensions({ result, modelName, args, extensions }: ApplyExtensionsParams): object; + get [Symbol.toStringTag](): string; +} + +declare type RequestOptions = { + traceparent?: string; + numTry?: number; + interactiveTransaction?: InteractiveTransactionOptions; + isWrite: boolean; + customDataProxyFetch?: (fetch: Fetch) => Fetch; +}; + +declare type RequestOptions_2 = { + method?: string; + headers?: Record; + body?: string; +}; + +declare type RequestParams = { + modelName?: string; + action: Action; + protocolMessage: ProtocolMessage; + protocolEncoder: ProtocolEncoder; + dataPath: string[]; + clientMethod: string; + callsite?: CallSite; + rejectOnNotFound?: RejectOnNotFound; + transaction?: PrismaPromiseTransaction; + extensions: MergedExtensionsList; + args?: any; + headers?: Record; + unpacker?: Unpacker; + otelParentCtx?: Context; + otelChildCtx?: Context; + customDataProxyFetch?: (fetch: Fetch) => Fetch; +}; + +declare type RequestResponse = { + ok: boolean; + url: string; + statusText?: string; + status: number; + headers: Headers_2; + text: () => Promise; + json: () => Promise; +}; + +declare type RequiredKeys = { + [K in keyof O]-?: {} extends Pick_2 ? never : K; +}[keyof O]; + +declare type Result = T extends { + [K: symbol]: { + types: { + payload: any; + }; + }; +} ? GetResult_2 : never; + +declare type ResultArg = { + [FieldName in string]: ResultFieldDefinition; +}; + +declare type ResultArgs = { + result: { + [ModelName in string]: ResultArg; + }; +}; + +declare type ResultArgsFieldCompute = (model: any) => unknown; + +declare type ResultFieldDefinition = { + needs?: { + [FieldName in string]: boolean; + }; + compute: ResultArgsFieldCompute; +}; + +declare type Return = T extends (...args: any[]) => infer R ? R : T; + +declare type RuntimeDataModel = { + readonly models: Record; + readonly enums: Record; + readonly types: Record; +}; + +declare type RuntimeEnum = Omit; + +declare type RuntimeModel = Omit; + +declare type Select = T extends U ? T : never; + +declare type SelectablePayloadFields = { + objects: { + [k in K]: O; + }; +} | { + composites: { + [k in K]: O; + }; +}; + +declare type SelectField

, K extends PropertyKey> = P extends { + objects: Record; +} ? P['objects'][K] : P extends { + composites: Record; +} ? P['composites'][K] : never; + +declare type Selection_2 = Record; + +/** + * An interface that represents a span. A span represents a single operation + * within a trace. Examples of span might include remote procedure calls or a + * in-process function calls to sub-components. A Trace has a single, top-level + * "root" Span that in turn may have zero or more child Spans, which in turn + * may have children. + * + * Spans are created by the {@link Tracer.startSpan} method. + */ +declare interface Span { + /** + * Returns the {@link SpanContext} object associated with this Span. + * + * Get an immutable, serializable identifier for this span that can be used + * to create new child spans. Returned SpanContext is usable even after the + * span ends. + * + * @returns the SpanContext object associated with this Span. + */ + spanContext(): SpanContext; + /** + * Sets an attribute to the span. + * + * Sets a single Attribute with the key and value passed as arguments. + * + * @param key the key for this attribute. + * @param value the value for this attribute. Setting a value null or + * undefined is invalid and will result in undefined behavior. + */ + setAttribute(key: string, value: SpanAttributeValue): this; + /** + * Sets attributes to the span. + * + * @param attributes the attributes that will be added. + * null or undefined attribute values + * are invalid and will result in undefined behavior. + */ + setAttributes(attributes: SpanAttributes): this; + /** + * Adds an event to the Span. + * + * @param name the name of the event. + * @param [attributesOrStartTime] the attributes that will be added; these are + * associated with this event. Can be also a start time + * if type is {@type TimeInput} and 3rd param is undefined + * @param [startTime] start time of the event. + */ + addEvent(name: string, attributesOrStartTime?: SpanAttributes | TimeInput, startTime?: TimeInput): this; + /** + * Sets a status to the span. If used, this will override the default Span + * status. Default is {@link SpanStatusCode.UNSET}. SetStatus overrides the value + * of previous calls to SetStatus on the Span. + * + * @param status the SpanStatus to set. + */ + setStatus(status: SpanStatus): this; + /** + * Updates the Span name. + * + * This will override the name provided via {@link Tracer.startSpan}. + * + * Upon this update, any sampling behavior based on Span name will depend on + * the implementation. + * + * @param name the Span name. + */ + updateName(name: string): this; + /** + * Marks the end of Span execution. + * + * Call to End of a Span MUST not have any effects on child spans. Those may + * still be running and can be ended later. + * + * Do not return `this`. The Span generally should not be used after it + * is ended so chaining is not desired in this context. + * + * @param [endTime] the time to set as Span's end time. If not provided, + * use the current time as the span's end time. + */ + end(endTime?: TimeInput): void; + /** + * Returns the flag whether this span will be recorded. + * + * @returns true if this Span is active and recording information like events + * with the `AddEvent` operation and attributes using `setAttributes`. + */ + isRecording(): boolean; + /** + * Sets exception as a span event + * @param exception the exception the only accepted values are string or Error + * @param [time] the time to set as Span's event time. If not provided, + * use the current time. + */ + recordException(exception: Exception, time?: TimeInput): void; +} + +/** + * @deprecated please use {@link Attributes} + */ +declare type SpanAttributes = Attributes; + +/** + * @deprecated please use {@link AttributeValue} + */ +declare type SpanAttributeValue = AttributeValue; + +declare type SpanCallback = (span?: Span, context?: Context) => R; + +/** + * A SpanContext represents the portion of a {@link Span} which must be + * serialized and propagated along side of a {@link Baggage}. + */ +declare interface SpanContext { + /** + * The ID of the trace that this span belongs to. It is worldwide unique + * with practically sufficient probability by being made as 16 randomly + * generated bytes, encoded as a 32 lowercase hex characters corresponding to + * 128 bits. + */ + traceId: string; + /** + * The ID of the Span. It is globally unique with practically sufficient + * probability by being made as 8 randomly generated bytes, encoded as a 16 + * lowercase hex characters corresponding to 64 bits. + */ + spanId: string; + /** + * Only true if the SpanContext was propagated from a remote parent. + */ + isRemote?: boolean; + /** + * Trace flags to propagate. + * + * It is represented as 1 byte (bitmap). Bit to represent whether trace is + * sampled or not. When set, the least significant bit documents that the + * caller may have recorded trace data. A caller who does not record trace + * data out-of-band leaves this flag unset. + * + * see {@link TraceFlags} for valid flag values. + */ + traceFlags: number; + /** + * Tracing-system-specific info to propagate. + * + * The tracestate field value is a `list` as defined below. The `list` is a + * series of `list-members` separated by commas `,`, and a list-member is a + * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs + * surrounding `list-members` are ignored. There can be a maximum of 32 + * `list-members` in a `list`. + * More Info: https://www.w3.org/TR/trace-context/#tracestate-field + * + * Examples: + * Single tracing system (generic format): + * tracestate: rojo=00f067aa0ba902b7 + * Multiple tracing systems (with different formatting): + * tracestate: rojo=00f067aa0ba902b7,congo=t61rcWkgMzE + */ + traceState?: TraceState; +} + +declare enum SpanKind { + /** Default value. Indicates that the span is used internally. */ + INTERNAL = 0, + /** + * Indicates that the span covers server-side handling of an RPC or other + * remote request. + */ + SERVER = 1, + /** + * Indicates that the span covers the client-side wrapper around an RPC or + * other remote request. + */ + CLIENT = 2, + /** + * Indicates that the span describes producer sending a message to a + * broker. Unlike client and server, there is no direct critical path latency + * relationship between producer and consumer spans. + */ + PRODUCER = 3, + /** + * Indicates that the span describes consumer receiving a message from a + * broker. Unlike client and server, there is no direct critical path latency + * relationship between producer and consumer spans. + */ + CONSUMER = 4 +} + +/** + * Options needed for span creation + */ +declare interface SpanOptions { + /** + * The SpanKind of a span + * @default {@link SpanKind.INTERNAL} + */ + kind?: SpanKind; + /** A span's attributes */ + attributes?: SpanAttributes; + /** {@link Link}s span to other spans */ + links?: Link[]; + /** A manually specified start time for the created `Span` object. */ + startTime?: TimeInput; + /** The new span should be a root span. (Ignore parent from context). */ + root?: boolean; +} + +declare interface SpanStatus { + /** The status code of this message. */ + code: SpanStatusCode; + /** A developer-facing error message. */ + message?: string; +} + +/** + * An enumeration of status codes. + */ +declare enum SpanStatusCode { + /** + * The default status. + */ + UNSET = 0, + /** + * The operation has been validated by an Application developer or + * Operator to have completed successfully. + */ + OK = 1, + /** + * The operation contains an error. + */ + ERROR = 2 +} + +/** + * A SQL instance can be nested within each other to build SQL strings. + */ +export declare class Sql { + values: Value[]; + strings: string[]; + constructor(rawStrings: ReadonlyArray, rawValues: ReadonlyArray); + get text(): string; + get sql(): string; + inspect(): { + text: string; + sql: string; + values: unknown[]; + }; +} + +/** + * Create a SQL object from a template string. + */ +export declare function sqltag(strings: ReadonlyArray, ...values: RawValue[]): Sql; + +/** + * Defines TimeInput. + * + * hrtime, epoch milliseconds, performance.now() or Date + */ +declare type TimeInput = HrTime | number | Date; + +declare type ToTuple = T extends any[] ? T : [T]; + +declare interface TraceState { + /** + * Create a new TraceState which inherits from this TraceState and has the + * given key set. + * The new entry will always be added in the front of the list of states. + * + * @param key key of the TraceState entry. + * @param value value of the TraceState entry. + */ + set(key: string, value: string): TraceState; + /** + * Return a new TraceState which inherits from this TraceState but does not + * contain the given key. + * + * @param key the key for the TraceState entry to be removed. + */ + unset(key: string): TraceState; + /** + * Returns the value to which the specified key is mapped, or `undefined` if + * this map contains no mapping for the key. + * + * @param key with which the specified value is to be associated. + * @returns the value to which the specified key is mapped, or `undefined` if + * this map contains no mapping for the key. + */ + get(key: string): string | undefined; + /** + * Serializes the TraceState to a `list` as defined below. The `list` is a + * series of `list-members` separated by commas `,`, and a list-member is a + * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs + * surrounding `list-members` are ignored. There can be a maximum of 32 + * `list-members` in a `list`. + * + * @returns the serialized string. + */ + serialize(): string; +} + +declare interface TracingHelper { + isEnabled(): boolean; + getTraceParent(context?: Context): string; + createEngineSpan(engineSpanEvent: EngineSpanEvent): void; + getActiveContext(): Context | undefined; + runInChildSpan(nameOrOptions: string | ExtendedSpanOptions, callback: SpanCallback): R; +} + +declare namespace Transaction { + export { + IsolationLevel, + Options, + InteractiveTransactionInfo, + TransactionHeaders + } +} + +declare type TransactionHeaders = { + traceparent?: string; +}; + +declare type TransactionOptions = { + kind: 'itx'; + options: InteractiveTransactionOptions; +} | { + kind: 'batch'; + options: BatchTransactionOptions; +}; + +export declare function transformDocument(document: Document_2): Document_2; + +declare type TypeMapCbDef = Fn<{ + extArgs: Args; +}, TypeMapDef>; + +/** Shared */ +declare type TypeMapDef = Record; + +declare namespace Types { + export { + Extensions_2 as Extensions, + Utils, + Public_2 as Public, + GetResult_2 as GetResult, + Payload, + DefaultSelection + } +} +export { Types } + +declare type UnknownErrorParams = { + clientVersion: string; + batchRequestIdx?: number; +}; + +/** + * Unpacks the result of a data object and maps DateTime fields to instances of `Date` in-place + * @param options: UnpackOptions + */ +export declare function unpack({ document, path, data }: UnpackOptions): any; + +declare type Unpacker = (data: any) => any; + +declare interface UnpackOptions { + document: Document_2; + path: string[]; + data: any; +} + +declare type UnwrapPayload

= { + [K in keyof P]: P[K] extends Payload[] ? UnwrapPayload : P[K] extends Payload ? P[K]['scalars'] & UnwrapPayload : P[K] extends (infer O extends Payload) | null ? (O['scalars'] & UnwrapPayload) | null : P[K]; +} & unknown; + +declare type UnwrapPromise

= P extends Promise ? R : P; + +declare type UnwrapTuple = { + [K in keyof Tuple]: K extends `${number}` ? Tuple[K] extends PrismaPromise_2 ? X : UnwrapPromise : UnwrapPromise; +}; + +export declare type UserArgs = NameArgs & ResultArgs & ModelArgs & ClientArgs & QueryOptions; + +/** + * Input that flows from the user into the Client. + */ +declare type UserArgs_2 = any; + +declare namespace Utils { + export { + EmptyToUnknown, + NeverToUnknown, + PatchFlat, + Omit_2 as Omit, + Pick_2 as Pick, + ComputeDeep, + Compute, + OptionalFlat, + ReadonlyDeep, + Narrow, + Exact, + Cast, + LegacyExact, + JsonObject, + JsonArray, + JsonValue, + Record_2 as Record, + UnwrapTuple, + Path, + Fn, + Call, + RequiredKeys, + OptionalKeys, + Optional, + Return, + ToTuple, + RenameAndNestPayloadKeys, + PayloadToResult, + Select + } +} + +declare function validator(): (select: Exact) => S; + +declare function validator, O extends keyof C[M] & Operation>(client: C, model: M, operation: O): (select: Exact>) => S; + +declare function validator, O extends keyof C[M] & Operation, P extends keyof Args_4>(client: C, model: M, operation: O, prop: P): (select: Exact[P]>) => S; + +/** + * Values supported by SQL engine. + */ +export declare type Value = unknown; + +export declare function warnEnvConflicts(envPaths: any): void; + +export declare const warnOnce: (key: string, message: string, ...args: unknown[]) => void; + +export { } diff --git a/uc-controller-user/controller-user/prisma/prismaAuthUserClient/runtime/library.d.ts b/uc-controller-user/controller-user/prisma/prismaAuthUserClient/runtime/library.d.ts new file mode 100644 index 0000000..4a56e5f --- /dev/null +++ b/uc-controller-user/controller-user/prisma/prismaAuthUserClient/runtime/library.d.ts @@ -0,0 +1 @@ +export * from "./index" diff --git a/uc-controller-user/controller-user/prisma/prismaAuthUserClient/runtime/library.js b/uc-controller-user/controller-user/prisma/prismaAuthUserClient/runtime/library.js new file mode 100644 index 0000000..1c1c95c --- /dev/null +++ b/uc-controller-user/controller-user/prisma/prismaAuthUserClient/runtime/library.js @@ -0,0 +1,212 @@ +"use strict";var lu=Object.create;var hr=Object.defineProperty;var uu=Object.getOwnPropertyDescriptor;var cu=Object.getOwnPropertyNames;var pu=Object.getPrototypeOf,du=Object.prototype.hasOwnProperty;var L=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Rt=(e,t)=>{for(var r in t)hr(e,r,{get:t[r],enumerable:!0})},so=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of cu(t))!du.call(e,i)&&i!==r&&hr(e,i,{get:()=>t[i],enumerable:!(n=uu(t,i))||n.enumerable});return e};var F=(e,t,r)=>(r=e!=null?lu(pu(e)):{},so(t||!e||!e.__esModule?hr(r,"default",{value:e,enumerable:!0}):r,e)),mu=e=>so(hr({},"__esModule",{value:!0}),e);var xo=L((wf,bo)=>{var at=1e3,lt=at*60,ut=lt*60,et=ut*24,gu=et*7,yu=et*365.25;bo.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return hu(e);if(r==="number"&&isFinite(e))return t.long?xu(e):bu(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function hu(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!!t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*yu;case"weeks":case"week":case"w":return r*gu;case"days":case"day":case"d":return r*et;case"hours":case"hour":case"hrs":case"hr":case"h":return r*ut;case"minutes":case"minute":case"mins":case"min":case"m":return r*lt;case"seconds":case"second":case"secs":case"sec":case"s":return r*at;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function bu(e){var t=Math.abs(e);return t>=et?Math.round(e/et)+"d":t>=ut?Math.round(e/ut)+"h":t>=lt?Math.round(e/lt)+"m":t>=at?Math.round(e/at)+"s":e+"ms"}function xu(e){var t=Math.abs(e);return t>=et?xr(e,t,et,"day"):t>=ut?xr(e,t,ut,"hour"):t>=lt?xr(e,t,lt,"minute"):t>=at?xr(e,t,at,"second"):e+" ms"}function xr(e,t,r,n){var i=t>=r*1.5;return Math.round(e/r)+" "+n+(i?"s":"")}});var _n=L((Ef,wo)=>{function wu(e){r.debug=r,r.default=r,r.coerce=l,r.disable=o,r.enable=i,r.enabled=s,r.humanize=xo(),r.destroy=u,Object.keys(e).forEach(c=>{r[c]=e[c]}),r.names=[],r.skips=[],r.formatters={};function t(c){let p=0;for(let d=0;d{if(O==="%%")return"%";E++;let k=r.formatters[B];if(typeof k=="function"){let U=b[E];O=k.call(y,U),b.splice(E,1),E--}return O}),r.formatArgs.call(y,b),(y.log||r.log).apply(y,b)}return g.namespace=c,g.useColors=r.useColors(),g.color=r.selectColor(c),g.extend=n,g.destroy=r.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(m!==r.namespaces&&(m=r.namespaces,f=r.enabled(c)),f),set:b=>{d=b}}),typeof r.init=="function"&&r.init(g),g}function n(c,p){let d=r(this.namespace+(typeof p>"u"?":":p)+c);return d.log=this.log,d}function i(c){r.save(c),r.namespaces=c,r.names=[],r.skips=[];let p,d=(typeof c=="string"?c:"").split(/[\s,]+/),m=d.length;for(p=0;p"-"+p)].join(",");return r.enable(""),c}function s(c){if(c[c.length-1]==="*")return!0;let p,d;for(p=0,d=r.skips.length;p{he.formatArgs=Tu;he.save=Pu;he.load=Mu;he.useColors=Eu;he.storage=vu();he.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();he.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Eu(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Tu(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+wr.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),e.splice(n,0,t)}he.log=console.debug||console.log||(()=>{});function Pu(e){try{e?he.storage.setItem("debug",e):he.storage.removeItem("debug")}catch{}}function Mu(){let e;try{e=he.storage.getItem("debug")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function vu(){try{return localStorage}catch{}}wr.exports=_n()(he);var{formatters:Au}=wr.exports;Au.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Ln=L((Tf,To)=>{"use strict";To.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),i=t.indexOf("--");return n!==-1&&(i===-1||n{"use strict";var Cu=require("os"),Po=require("tty"),xe=Ln(),{env:H}=process,Ke;xe("no-color")||xe("no-colors")||xe("color=false")||xe("color=never")?Ke=0:(xe("color")||xe("colors")||xe("color=true")||xe("color=always"))&&(Ke=1);"FORCE_COLOR"in H&&(H.FORCE_COLOR==="true"?Ke=1:H.FORCE_COLOR==="false"?Ke=0:Ke=H.FORCE_COLOR.length===0?1:Math.min(parseInt(H.FORCE_COLOR,10),3));function jn(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function qn(e,t){if(Ke===0)return 0;if(xe("color=16m")||xe("color=full")||xe("color=truecolor"))return 3;if(xe("color=256"))return 2;if(e&&!t&&Ke===void 0)return 0;let r=Ke||0;if(H.TERM==="dumb")return r;if(process.platform==="win32"){let n=Cu.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in H)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in H)||H.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in H)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(H.TEAMCITY_VERSION)?1:0;if(H.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in H){let n=parseInt((H.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(H.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(H.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(H.TERM)||"COLORTERM"in H?1:r}function Fu(e){let t=qn(e,e&&e.isTTY);return jn(t)}Mo.exports={supportsColor:Fu,stdout:jn(qn(!0,Po.isatty(1))),stderr:jn(qn(!0,Po.isatty(2)))}});var Ao=L((Z,Tr)=>{var Su=require("tty"),Er=require("util");Z.init=Nu;Z.log=$u;Z.formatArgs=Ru;Z.save=ku;Z.load=Iu;Z.useColors=Ou;Z.destroy=Er.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Z.colors=[6,2,3,4,5,1];try{let e=Bn();e&&(e.stderr||e).level>=2&&(Z.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}Z.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),n=process.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[r]=n,e},{});function Ou(){return"colors"in Z.inspectOpts?Boolean(Z.inspectOpts.colors):Su.isatty(process.stderr.fd)}function Ru(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${i};1m${t} \x1B[0m`;e[0]=o+e[0].split(` +`).join(` +`+o),e.push(i+"m+"+Tr.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=Du()+t+" "+e[0]}function Du(){return Z.inspectOpts.hideDate?"":new Date().toISOString()+" "}function $u(...e){return process.stderr.write(Er.format(...e)+` +`)}function ku(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function Iu(){return process.env.DEBUG}function Nu(e){e.inspectOpts={};let t=Object.keys(Z.inspectOpts);for(let r=0;rt.trim()).join(" ")};vo.O=function(e){return this.inspectOpts.colors=this.useColors,Er.inspect(e,this.inspectOpts)}});var Co=L((Mf,Vn)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Vn.exports=Eo():Vn.exports=Ao()});var Oo=L((Af,ju)=>{ju.exports={name:"dotenv",version:"16.0.3",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{require:"./lib/main.js",types:"./lib/main.d.ts",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^17.0.9",decache:"^4.6.1",dtslint:"^3.7.0",sinon:"^12.0.1",standard:"^16.0.4","standard-markdown":"^7.1.0","standard-version":"^9.3.2",tap:"^15.1.6",tar:"^6.1.11",typescript:"^4.5.4"},engines:{node:">=12"}}});var Do=L((Cf,vr)=>{var qu=require("fs"),Ro=require("path"),Bu=require("os"),Vu=Oo(),Ku=Vu.version,Qu=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Uu(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,` +`);let n;for(;(n=Qu.exec(r))!=null;){let i=n[1],o=n[2]||"";o=o.trim();let s=o[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),s==='"'&&(o=o.replace(/\\n/g,` +`),o=o.replace(/\\r/g,"\r")),t[i]=o}return t}function Qn(e){console.log(`[dotenv@${Ku}][DEBUG] ${e}`)}function Ju(e){return e[0]==="~"?Ro.join(Bu.homedir(),e.slice(1)):e}function Gu(e){let t=Ro.resolve(process.cwd(),".env"),r="utf8",n=Boolean(e&&e.debug),i=Boolean(e&&e.override);e&&(e.path!=null&&(t=Ju(e.path)),e.encoding!=null&&(r=e.encoding));try{let o=Mr.parse(qu.readFileSync(t,{encoding:r}));return Object.keys(o).forEach(function(s){Object.prototype.hasOwnProperty.call(process.env,s)?(i===!0&&(process.env[s]=o[s]),n&&Qn(i===!0?`"${s}" is already defined in \`process.env\` and WAS overwritten`:`"${s}" is already defined in \`process.env\` and was NOT overwritten`)):process.env[s]=o[s]}),{parsed:o}}catch(o){return n&&Qn(`Failed to load ${t} ${o.message}`),{error:o}}}var Mr={config:Gu,parse:Uu};vr.exports.config=Mr.config;vr.exports.parse=Mr.parse;vr.exports=Mr});var Lo=L((kf,_o)=>{"use strict";_o.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var Wn=L((If,jo)=>{"use strict";var Yu=Lo();jo.exports=e=>{let t=Yu(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}});var Qo=L((Wf,Xn)=>{"use strict";var D=Xn.exports;Xn.exports.default=D;var I="\x1B[",Nt="\x1B]",dt="\x07",Sr=";",Ko=process.env.TERM_PROGRAM==="Apple_Terminal";D.cursorTo=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof t!="number"?I+(e+1)+"G":I+(t+1)+";"+(e+1)+"H"};D.cursorMove=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let r="";return e<0?r+=I+-e+"D":e>0&&(r+=I+e+"C"),t<0?r+=I+-t+"A":t>0&&(r+=I+t+"B"),r};D.cursorUp=(e=1)=>I+e+"A";D.cursorDown=(e=1)=>I+e+"B";D.cursorForward=(e=1)=>I+e+"C";D.cursorBackward=(e=1)=>I+e+"D";D.cursorLeft=I+"G";D.cursorSavePosition=Ko?"\x1B7":I+"s";D.cursorRestorePosition=Ko?"\x1B8":I+"u";D.cursorGetPosition=I+"6n";D.cursorNextLine=I+"E";D.cursorPrevLine=I+"F";D.cursorHide=I+"?25l";D.cursorShow=I+"?25h";D.eraseLines=e=>{let t="";for(let r=0;r[Nt,"8",Sr,Sr,t,dt,e,Nt,"8",Sr,Sr,dt].join("");D.image=(e,t={})=>{let r=`${Nt}1337;File=inline=1`;return t.width&&(r+=`;width=${t.width}`),t.height&&(r+=`;height=${t.height}`),t.preserveAspectRatio===!1&&(r+=";preserveAspectRatio=0"),r+":"+e.toString("base64")+dt};D.iTerm={setCwd:(e=process.cwd())=>`${Nt}50;CurrentDir=${e}${dt}`,annotation:(e,t={})=>{let r=`${Nt}1337;`,n=typeof t.x<"u",i=typeof t.y<"u";if((n||i)&&!(n&&i&&typeof t.length<"u"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replace(/\|/g,""),r+=t.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",t.length>0?r+=(n?[e,t.length,t.x,t.y]:[t.length,e]).join("|"):r+=e,r+dt}}});var Go=L((Hf,Jo)=>{"use strict";var tc=Bn(),mt=Ln();function Uo(e){if(/^\d{3,4}$/.test(e)){let r=/(\d{1,2})(\d{2})/.exec(e);return{major:0,minor:parseInt(r[1],10),patch:parseInt(r[2],10)}}let t=(e||"").split(".").map(r=>parseInt(r,10));return{major:t[0],minor:t[1],patch:t[2]}}function ei(e){let{env:t}=process;if("FORCE_HYPERLINK"in t)return!(t.FORCE_HYPERLINK.length>0&&parseInt(t.FORCE_HYPERLINK,10)===0);if(mt("no-hyperlink")||mt("no-hyperlinks")||mt("hyperlink=false")||mt("hyperlink=never"))return!1;if(mt("hyperlink=true")||mt("hyperlink=always")||"NETLIFY"in t)return!0;if(!tc.supportsColor(e)||e&&!e.isTTY||process.platform==="win32"||"CI"in t||"TEAMCITY_VERSION"in t)return!1;if("TERM_PROGRAM"in t){let r=Uo(t.TERM_PROGRAM_VERSION);switch(t.TERM_PROGRAM){case"iTerm.app":return r.major===3?r.minor>=1:r.major>3;case"WezTerm":return r.major>=20200620;case"vscode":return r.major>1||r.major===1&&r.minor>=72}}if("VTE_VERSION"in t){if(t.VTE_VERSION==="0.50.0")return!1;let r=Uo(t.VTE_VERSION);return r.major>0||r.minor>=50}return!1}Jo.exports={supportsHyperlink:ei,stdout:ei(process.stdout),stderr:ei(process.stderr)}});var Ho=L((zf,_t)=>{"use strict";var rc=Qo(),ti=Go(),Wo=(e,t,{target:r="stdout",...n}={})=>ti[r]?rc.link(e,t):n.fallback===!1?e:typeof n.fallback=="function"?n.fallback(e,t):`${e} (\u200B${t}\u200B)`;_t.exports=(e,t,r={})=>Wo(e,t,r);_t.exports.stderr=(e,t,r={})=>Wo(e,t,{target:"stderr",...r});_t.exports.isSupported=ti.stdout;_t.exports.stderr.isSupported=ti.stderr});var os=L((fg,hc)=>{hc.exports={name:"@prisma/engines-version",version:"4.16.1-1.4bc8b6e1b66cb932731fb1bdbbc550d1e010de81",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"4bc8b6e1b66cb932731fb1bdbbc550d1e010de81"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.16.18",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var oi=L($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.enginesVersion=void 0;$r.enginesVersion=os().prisma.enginesVersion});var qt=L((Cg,ls)=>{"use strict";ls.exports=(e,t=1,r)=>{if(r={indent:" ",includeEmptyLines:!1,...r},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof r.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r.indent}\``);if(t===0)return e;let n=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,r.indent.repeat(t))}});var ds=L((Og,ps)=>{"use strict";ps.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var Kt=L((Rg,ms)=>{"use strict";var Cc=ds();ms.exports=e=>typeof e=="string"?e.replace(Cc(),""):e});var fs=L((Ig,Ir)=>{"use strict";Ir.exports=(e={})=>{let t;if(e.repoUrl)t=e.repoUrl;else if(e.user&&e.repo)t=`https://github.com/${e.user}/${e.repo}`;else throw new Error("You need to specify either the `repoUrl` option or both the `user` and `repo` options");let r=new URL(`${t}/issues/new`),n=["body","title","labels","template","milestone","assignee","projects"];for(let i of n){let o=e[i];if(o!==void 0){if(i==="labels"||i==="projects"){if(!Array.isArray(o))throw new TypeError(`The \`${i}\` option should be an array`);o=o.join(",")}r.searchParams.set(i,o)}}return r.toString()};Ir.exports.default=Ir.exports});var Kr=L((Fy,$s)=>{"use strict";$s.exports=function(){function e(t,r,n,i,o){return tn?n+1:t+1:i===o?r:r+1}return function(t,r){if(t===r)return 0;if(t.length>r.length){var n=t;t=r,r=n}for(var i=t.length,o=r.length;i>0&&t.charCodeAt(i-1)===r.charCodeAt(o-1);)i--,o--;for(var s=0;s{(function(e,t){typeof require=="function"&&typeof Oi=="object"&&typeof Ri=="object"?Ri.exports=t():e.pluralize=t()})(Oi,function(){var e=[],t=[],r={},n={},i={};function o(m){return typeof m=="string"?new RegExp("^"+m+"$","i"):m}function s(m,f){return m===f?f:m===m.toLowerCase()?f.toLowerCase():m===m.toUpperCase()?f.toUpperCase():m[0]===m[0].toUpperCase()?f.charAt(0).toUpperCase()+f.substr(1).toLowerCase():f.toLowerCase()}function a(m,f){return m.replace(/\$(\d{1,2})/g,function(g,b){return f[b]||""})}function l(m,f){return m.replace(f[0],function(g,b){var y=a(f[1],arguments);return s(g===""?m[b-1]:g,y)})}function u(m,f,g){if(!m.length||r.hasOwnProperty(m))return f;for(var b=g.length;b--;){var y=g[b];if(y[0].test(f))return l(f,y)}return f}function c(m,f,g){return function(b){var y=b.toLowerCase();return f.hasOwnProperty(y)?s(b,y):m.hasOwnProperty(y)?s(b,m[y]):u(y,b,g)}}function p(m,f,g,b){return function(y){var w=y.toLowerCase();return f.hasOwnProperty(w)?!0:m.hasOwnProperty(w)?!1:u(w,w,g)===w}}function d(m,f,g){var b=f===1?d.singular(m):d.plural(m);return(g?f+" ":"")+b}return d.plural=c(i,n,e),d.isPlural=p(i,n,e),d.singular=c(n,i,t),d.isSingular=p(n,i,t),d.addPluralRule=function(m,f){e.push([o(m),f])},d.addSingularRule=function(m,f){t.push([o(m),f])},d.addUncountableRule=function(m){if(typeof m=="string"){r[m.toLowerCase()]=!0;return}d.addPluralRule(m,"$0"),d.addSingularRule(m,"$0")},d.addIrregularRule=function(m,f){f=f.toLowerCase(),m=m.toLowerCase(),i[m]=f,n[f]=m},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(m){return d.addIrregularRule(m[0],m[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(m){return d.addPluralRule(m[0],m[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(m){return d.addSingularRule(m[0],m[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(d.addUncountableRule),d})});var Na=L((Mx,Ia)=>{"use strict";Ia.exports=e=>Object.prototype.toString.call(e)==="[object RegExp]"});var La=L((vx,_a)=>{"use strict";_a.exports=e=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")}});var ja=L(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.default=e=>Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))});var Ja=L((rw,Vd)=>{Vd.exports={name:"@prisma/client",version:"4.16.2",description:"Prisma Client is an auto-generated, type-safe and modern JavaScript/TypeScript ORM for Node.js that's tailored to your data. Supports MySQL, PostgreSQL, MariaDB, SQLite databases.",keywords:["orm","prisma2","prisma","client","query","database","sql","postgres","postgresql","mysql","sqlite","mariadb","mssql","typescript","query-builder"],main:"index.js",browser:"index-browser.js",types:"index.d.ts",license:"Apache-2.0",engines:{node:">=14.17"},homepage:"https://www.prisma.io",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/client"},author:"Tim Suchanek ",bugs:"https://github.com/prisma/prisma/issues",scripts:{dev:"DEV=true node -r esbuild-register helpers/build.ts",build:"node -r esbuild-register helpers/build.ts",test:"jest --silent","test:e2e":"node -r esbuild-register tests/e2e/_utils/run.ts","test:functional":"node -r esbuild-register helpers/functional-test/run-tests.ts","test:memory":"node -r esbuild-register helpers/memory-tests.ts","test:functional:code":"node -r esbuild-register helpers/functional-test/run-tests.ts --no-types","test:functional:types":"node -r esbuild-register helpers/functional-test/run-tests.ts --types-only","test-notypes":"jest --testPathIgnorePatterns src/__tests__/types/types.test.ts",generate:"node scripts/postinstall.js",postinstall:"node scripts/postinstall.js",prepublishOnly:"pnpm run build","new-test":"NODE_OPTIONS='-r ts-node/register' yo ./helpers/generator-test/index.ts"},files:["README.md","runtime","!runtime/*.map","scripts","generator-build","edge.js","edge.d.ts","index.js","index.d.ts","index-browser.js","extension.js","extension.d.ts"],devDependencies:{"@codspeed/benchmark.js-plugin":"1.1.0","@faker-js/faker":"8.0.2","@fast-check/jest":"1.6.2","@jest/create-cache-key-function":"29.5.0","@jest/globals":"29.5.0","@jest/test-sequencer":"29.5.0","@opentelemetry/api":"1.4.1","@opentelemetry/context-async-hooks":"1.13.0","@opentelemetry/instrumentation":"0.39.1","@opentelemetry/resources":"1.13.0","@opentelemetry/sdk-trace-base":"1.13.0","@opentelemetry/semantic-conventions":"1.13.0","@prisma/debug":"workspace:*","@prisma/engines":"workspace:*","@prisma/fetch-engine":"workspace:*","@prisma/generator-helper":"workspace:*","@prisma/get-platform":"workspace:*","@prisma/instrumentation":"workspace:*","@prisma/internals":"workspace:*","@prisma/migrate":"workspace:*","@prisma/mini-proxy":"0.7.0","@swc-node/register":"1.6.5","@swc/core":"1.3.64","@swc/jest":"0.2.26","@timsuchanek/copy":"1.4.5","@types/debug":"4.1.8","@types/fs-extra":"9.0.13","@types/jest":"29.5.2","@types/js-levenshtein":"1.1.1","@types/mssql":"8.1.2","@types/node":"18.16.16","@types/pg":"8.10.2","@types/yeoman-generator":"5.2.11",arg:"5.0.2",benchmark:"2.1.4","ci-info":"3.8.0","decimal.js":"10.4.3","env-paths":"2.2.1",esbuild:"0.15.13",execa:"5.1.1","expect-type":"0.16.0","flat-map-polyfill":"0.3.8","fs-extra":"11.1.1","get-own-enumerable-property-symbols":"3.0.2","get-stream":"6.0.1",globby:"11.1.0","indent-string":"4.0.0","is-obj":"2.0.0","is-regexp":"2.1.0",jest:"29.5.0","jest-junit":"16.0.0","jest-serializer-ansi-escapes":"2.0.1","jest-snapshot":"29.5.0","js-levenshtein":"1.1.6",kleur:"4.1.5",klona:"2.0.6","lz-string":"1.5.0",mariadb:"3.1.2",memfs:"3.5.3",mssql:"9.1.1","new-github-issue-url":"0.2.1","node-fetch":"2.6.11","p-retry":"4.6.2",pg:"8.9.0","pkg-up":"3.1.0",pluralize:"8.0.0",resolve:"1.22.2",rimraf:"3.0.2","simple-statistics":"7.8.3","sort-keys":"4.2.0","source-map-support":"0.5.21","sql-template-tag":"5.0.3","stacktrace-parser":"0.1.10","strip-ansi":"6.0.1","strip-indent":"3.0.0","ts-node":"10.9.1","ts-pattern":"4.3.0",tsd:"0.28.1",typescript:"4.9.5",undici:"5.22.1","yeoman-generator":"5.9.0",yo:"4.3.1",zx:"7.2.2"},peerDependencies:{prisma:"*"},peerDependenciesMeta:{prisma:{optional:!0}},dependencies:{"@prisma/engines-version":"4.16.1-1.4bc8b6e1b66cb932731fb1bdbbc550d1e010de81"},sideEffects:!1}});var Wm={};Rt(Wm,{DMMF:()=>we,DMMFClass:()=>We,Debug:()=>Kn,Decimal:()=>pe,Extensions:()=>$n,MetricsClient:()=>yt,NotFoundError:()=>Pe,PrismaClientInitializationError:()=>Q,PrismaClientKnownRequestError:()=>ie,PrismaClientRustPanicError:()=>be,PrismaClientUnknownRequestError:()=>oe,PrismaClientValidationError:()=>Y,Public:()=>kn,Sql:()=>ee,Types:()=>In,decompressFromBase64:()=>su,defineDmmfProperty:()=>hs,empty:()=>js,getPrismaClient:()=>iu,join:()=>Ls,makeDocument:()=>cn,makeStrictEnum:()=>ou,objectEnumValues:()=>wt,raw:()=>Fi,sqltag:()=>Si,transformDocument:()=>Va,unpack:()=>pn,warnEnvConflicts:()=>au,warnOnce:()=>Ut});module.exports=mu(Wm);var $n={};Rt($n,{defineExtension:()=>ao,getExtensionContext:()=>lo});function ao(e){return typeof e=="function"?e:t=>t.$extends(e)}function lo(e){return e}var kn={};Rt(kn,{validator:()=>uo});function uo(...e){return t=>t}var In={};Rt(In,{Extensions:()=>co,Public:()=>po,Utils:()=>mo});var co={};var po={};var mo={};var Nn,fo,go,yo,ho=!0;typeof process<"u"&&({FORCE_COLOR:Nn,NODE_DISABLE_COLORS:fo,NO_COLOR:go,TERM:yo}=process.env||{},ho=process.stdout&&process.stdout.isTTY);var fu={enabled:!fo&&go==null&&yo!=="dumb"&&(Nn!=null&&Nn!=="0"||ho)};function j(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!fu.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var rf=j(0,0),v=j(1,22),$=j(2,22),nf=j(3,23),ce=j(4,24),of=j(7,27),sf=j(8,28),af=j(9,29),lf=j(30,39),R=j(31,39),S=j(32,39),Re=j(33,39),st=j(34,39),uf=j(35,39),Ve=j(36,39),Dt=j(37,39),br=j(90,39),cf=j(90,39),pf=j(40,49),df=j(41,49),mf=j(42,49),ff=j(43,49),gf=j(44,49),yf=j(45,49),hf=j(46,49),bf=j(47,49);var Pr=F(Co()),_u=100,$t=[];typeof process<"u"&&typeof process.stderr?.write!="function"&&(Pr.default.log=console.debug??console.log);function Lu(e){let t=(0,Pr.default)(e),r=Object.assign((...n)=>(t.log=r.log,n.length!==0&&$t.push([e,...n]),$t.length>_u&&$t.shift(),t("",...n)),t);return r}var Kn=Object.assign(Lu,Pr.default);function Fo(e=7500){let t=$t.map(r=>r.map(n=>typeof n=="string"?n:JSON.stringify(n)).join(" ")).join(` +`);return t.lengthn.match(/(.?\${(?:[a-zA-Z0-9_]+)?})/g)?.reduce(function(o,s){let a=/(.?)\${([a-zA-Z0-9_]+)?}/g.exec(s);if(!a)return o;let l=a[1],u,c;if(l==="\\")c=a[0],u=c.replace("\\$","$");else{let p=a[2];c=a[0].substring(l.length),u=Object.hasOwnProperty.call(t,p)?t[p]:e.parsed[p]||"",u=r(u)}return o.replace(c,u)},n)??n;for(let n in e.parsed){let i=Object.hasOwnProperty.call(t,n)?t[n]:e.parsed[n];e.parsed[n]=r(i)}for(let n in e.parsed)t[n]=e.parsed[n];return e}var Un=V("prisma:tryLoadEnv");function kt({rootEnvPath:e,schemaEnvPath:t},r={conflictCheck:"none"}){let n=ko(e);r.conflictCheck!=="none"&&Wu(n,t,r.conflictCheck);let i=null;return Io(n?.path,t)||(i=ko(t)),!n&&!i&&Un("No Environment variables loaded"),i?.dotenvResult.error?console.error(R(v("Schema Env Error: "))+i.dotenvResult.error):{message:[n?.message,i?.message].filter(Boolean).join(` +`),parsed:{...n?.dotenvResult?.parsed,...i?.dotenvResult?.parsed}}}function Wu(e,t,r){let n=e?.dotenvResult.parsed,i=!Io(e?.path,t);if(n&&t&&i&&Ar.default.existsSync(t)){let o=Jn.default.parse(Ar.default.readFileSync(t)),s=[];for(let a in o)n[a]===o[a]&&s.push(a);if(s.length>0){let a=ct.default.relative(process.cwd(),e.path),l=ct.default.relative(process.cwd(),t);if(r==="error"){let u=`There is a conflict between env var${s.length>1?"s":""} in ${ce(a)} and ${ce(l)} +Conflicting env vars: +${s.map(c=>` ${v(c)}`).join(` +`)} + +We suggest to move the contents of ${ce(l)} to ${ce(a)} to consolidate your env vars. +`;throw new Error(u)}else if(r==="warn"){let u=`Conflict for env var${s.length>1?"s":""} ${s.map(c=>v(c)).join(", ")} in ${ce(a)} and ${ce(l)} +Env vars from ${ce(l)} overwrite the ones from ${ce(a)} + `;console.warn(`${Re("warn(prisma)")} ${u}`)}}}}function ko(e){return Hu(e)?(Un(`Environment variables loaded from ${e}`),{dotenvResult:$o(Jn.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0})),message:$(`Environment variables loaded from ${ct.default.relative(process.cwd(),e)}`),path:e}):(Un(`Environment variables not found at ${e}`),null)}function Io(e,t){return e&&t&&ct.default.resolve(e)===ct.default.resolve(t)}function Hu(e){return Boolean(e&&Ar.default.existsSync(e))}var No="library";function Gn(e){let t=zu();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":No)}function zu(){let e=process.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}var Zu=F(Wn());function It(e){return e instanceof Error}function Hn(e){let t=process.env.PRISMA_ENGINE_PROTOCOL;if(t==="json"||t=="graphql")return t;if(t!==void 0)throw new Error(`Invalid PRISMA_ENGINE_PROTOCOL env variable value. Expected 'graphql' or 'json', got '${t}'`);return e?.previewFeatures?.includes("jsonProtocol")?"json":"graphql"}var Cr=Symbol("@ts-pattern/matcher"),qo="@ts-pattern/anonymous-select-key",Bo=function(e){return Boolean(e&&typeof e=="object")},zn=function(e){return e&&!!e[Cr]},Xu=function e(t,r,n){if(Bo(t)){if(zn(t)){var i=t[Cr]().match(r),o=i.matched,s=i.selections;return o&&s&&Object.keys(s).forEach(function(l){return n(l,s[l])}),o}if(!Bo(r))return!1;if(Array.isArray(t))return!!Array.isArray(r)&&t.length===r.length&&t.every(function(l,u){return e(l,r[u],n)});if(t instanceof Map)return r instanceof Map&&Array.from(t.keys()).every(function(l){return e(t.get(l),r.get(l),n)});if(t instanceof Set){if(!(r instanceof Set))return!1;if(t.size===0)return r.size===0;if(t.size===1){var a=Array.from(t.values())[0];return zn(a)?Array.from(r.values()).every(function(l){return e(a,l,n)}):r.has(a)}return Array.from(t.values()).every(function(l){return r.has(l)})}return Object.keys(t).every(function(l){var u,c=t[l];return(l in r||zn(u=c)&&u[Cr]().matcherType==="optional")&&e(c,r[l],n)})}return Object.is(r,t)};function tt(e){var t;return(t={})[Cr]=function(){return{match:function(r){return{matched:Boolean(e(r))}}}},t}var Lf=tt(function(e){return!0});var jf=tt(function(e){return typeof e=="string"}),qf=tt(function(e){return typeof e=="number"}),Bf=tt(function(e){return typeof e=="boolean"}),Vf=tt(function(e){return typeof e=="bigint"}),Kf=tt(function(e){return typeof e=="symbol"}),Qf=tt(function(e){return e==null});function pt(e){return new ec(e,[])}var ec=function(){function e(r,n){this.value=void 0,this.cases=void 0,this.value=r,this.cases=n}var t=e.prototype;return t.with=function(){var r=[].slice.call(arguments),n=r[r.length-1],i=[r[0]],o=[];return r.length===3&&typeof r[1]=="function"?(i.push(r[0]),o.push(r[1])):r.length>2&&i.push.apply(i,r.slice(1,r.length-1)),new e(this.value,this.cases.concat([{match:function(s){var a={},l=Boolean(i.some(function(u){return Xu(u,s,function(c,p){a[c]=p})})&&o.every(function(u){return u(s)}));return{matched:l,value:l&&Object.keys(a).length?qo in a?a[qo]:a:s}},handler:n}]))},t.when=function(r,n){return new e(this.value,this.cases.concat([{match:function(i){return{matched:Boolean(r(i)),value:i}},handler:n}]))},t.otherwise=function(r){return new e(this.value,this.cases.concat([{match:function(n){return{matched:!0,value:n}},handler:r}])).run()},t.exhaustive=function(){return this.run()},t.run=function(){for(var r=this.value,n=void 0,i=0;i!process.env.PRISMA_DISABLE_WARNINGS};function jt(e,...t){ic.warn()&&console.warn(`${nc.warn} ${e}`,...t)}var oc=(0,es.promisify)(Xo.default.exec),fe=V("prisma:get-platform"),sc=["1.0.x","1.1.x","3.0.x"];async function ts(){let e=Rr.default.platform(),t=process.arch;if(e==="freebsd"){let s=await Dr("freebsd-version");if(s&&s.trim().length>0){let l=/^(\d+)\.?/.exec(s);if(l)return{platform:"freebsd",targetDistro:`freebsd${l[1]}`,arch:t}}}if(e!=="linux")return{platform:e,arch:t};let r=await lc(),n=await yc(),i=cc({arch:t,archFromUname:n,familyDistro:r.familyDistro}),{libssl:o}=await pc(i);return{platform:"linux",libssl:o,arch:t,archFromUname:n,...r}}function ac(e){let t=/^ID="?([^"\n]*)"?$/im,r=/^ID_LIKE="?([^"\n]*)"?$/im,n=t.exec(e),i=n&&n[1]&&n[1].toLowerCase()||"",o=r.exec(e),s=o&&o[1]&&o[1].toLowerCase()||"",a=pt({id:i,idLike:s}).with({id:"alpine"},({id:l})=>({targetDistro:"musl",familyDistro:l,originalDistro:l})).with({id:"raspbian"},({id:l})=>({targetDistro:"arm",familyDistro:"debian",originalDistro:l})).with({id:"nixos"},({id:l})=>({targetDistro:"nixos",originalDistro:l,familyDistro:"nixos"})).with({id:"debian"},{id:"ubuntu"},({id:l})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:l})).with({id:"rhel"},{id:"centos"},{id:"fedora"},({id:l})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:l})).when(({idLike:l})=>l.includes("debian")||l.includes("ubuntu"),({id:l})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:l})).when(({idLike:l})=>i==="arch"||l.includes("arch"),({id:l})=>({targetDistro:"debian",familyDistro:"arch",originalDistro:l})).when(({idLike:l})=>l.includes("centos")||l.includes("fedora")||l.includes("rhel")||l.includes("suse"),({id:l})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:l})).otherwise(({id:l})=>({targetDistro:void 0,familyDistro:void 0,originalDistro:l}));return fe(`Found distro info: +${JSON.stringify(a,null,2)}`),a}async function lc(){let e="/etc/os-release";try{let t=await ri.default.readFile(e,{encoding:"utf-8"});return ac(t)}catch{return{targetDistro:void 0,familyDistro:void 0,originalDistro:void 0}}}function uc(e){let t=/^OpenSSL\s(\d+\.\d+)\.\d+/.exec(e);if(t){let r=`${t[1]}.x`;return rs(r)}}function Yo(e){let t=/libssl\.so\.(\d)(\.\d)?/.exec(e);if(t){let r=`${t[1]}${t[2]??".0"}.x`;return rs(r)}}function rs(e){let t=(()=>{if(is(e))return e;let r=e.split(".");return r[1]="0",r.join(".")})();if(sc.includes(t))return t}function cc(e){return pt(e).with({familyDistro:"musl"},()=>(fe('Trying platform-specific paths for "alpine"'),["/lib"])).with({familyDistro:"debian"},({archFromUname:t})=>(fe('Trying platform-specific paths for "debian" (and "ubuntu")'),[`/usr/lib/${t}-linux-gnu`,`/lib/${t}-linux-gnu`])).with({familyDistro:"rhel"},()=>(fe('Trying platform-specific paths for "rhel"'),["/lib64","/usr/lib64"])).otherwise(({familyDistro:t,arch:r,archFromUname:n})=>(fe(`Don't know any platform-specific paths for "${t}" on ${r} (${n})`),[]))}async function pc(e){let t='grep -v "libssl.so.0"',r=await Zo(e);if(r){fe(`Found libssl.so file using platform-specific paths: ${r}`);let o=Yo(r);if(fe(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"libssl-specific-path"}}fe('Falling back to "ldconfig" and other generic paths');let n=await Dr(`ldconfig -p | sed "s/.*=>s*//" | sed "s|.*/||" | grep libssl | sort | ${t}`);if(n||(n=await Zo(["/lib64","/usr/lib64","/lib"])),n){fe(`Found libssl.so file using "ldconfig" or other generic paths: ${n}`);let o=Yo(n);if(fe(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"ldconfig"}}let i=await Dr("openssl version -v");if(i){fe(`Found openssl binary with version: ${i}`);let o=uc(i);if(fe(`The parsed openssl version is: ${o}`),o)return{libssl:o,strategy:"openssl-binary"}}return fe("Couldn't find any version of libssl or OpenSSL in the system"),{}}async function Zo(e){for(let t of e){let r=await dc(t);if(r)return r}}async function dc(e){try{return(await ri.default.readdir(e)).find(r=>r.startsWith("libssl.so")&&!r.startsWith("libssl.so.0"))}catch(t){if(t.code==="ENOENT")return;throw t}}async function ft(){let{binaryTarget:e}=await ns();return e}function mc(e){return e.binaryTarget!==void 0}async function ni(){let{memoized:e,...t}=await ns();return t}var Or={};async function ns(){if(mc(Or))return Promise.resolve({...Or,memoized:!0});let e=await ts(),t=fc(e);return Or={...e,binaryTarget:t},{...Or,memoized:!1}}function fc(e){let{platform:t,arch:r,archFromUname:n,libssl:i,targetDistro:o,familyDistro:s,originalDistro:a}=e;t==="linux"&&!["x64","arm64"].includes(r)&&jt(`Prisma only officially supports Linux on amd64 (x86_64) and arm64 (aarch64) system architectures. If you are using your own custom Prisma engines, you can ignore this warning, as long as you've compiled the engines for your system architecture "${n}".`);let l="1.1.x";if(t==="linux"&&i===void 0){let c=pt({familyDistro:s}).with({familyDistro:"debian"},()=>"Please manually install OpenSSL via `apt-get update -y && apt-get install -y openssl` and try installing Prisma again. If you're running Prisma on Docker, add this command to your Dockerfile, or switch to an image that already has OpenSSL installed.").otherwise(()=>"Please manually install OpenSSL and try installing Prisma again.");jt(`Prisma failed to detect the libssl/openssl version to use, and may not work as expected. Defaulting to "openssl-${l}". +${c}`)}let u="debian";if(t==="linux"&&o===void 0&&jt(`Prisma doesn't know which engines to download for the Linux distro "${a}". Falling back to Prisma engines built "${u}". +Please report your experience by creating an issue at ${Lt("https://github.com/prisma/prisma/issues")} so we can add your distro to the list of known supported distros.`),t==="darwin"&&r==="arm64")return"darwin-arm64";if(t==="darwin")return"darwin";if(t==="win32")return"windows";if(t==="freebsd")return o;if(t==="openbsd")return"openbsd";if(t==="netbsd")return"netbsd";if(t==="linux"&&o==="nixos")return"linux-nixos";if(t==="linux"&&r==="arm64")return`${o==="musl"?"linux-musl-arm64":"linux-arm64"}-openssl-${i||l}`;if(t==="linux"&&r==="arm")return`linux-arm-openssl-${i||l}`;if(t==="linux"&&o==="musl"){let c="linux-musl";return!i||is(i)?c:`${c}-openssl-${i}`}return t==="linux"&&o&&i?`${o}-openssl-${i}`:(t!=="linux"&&jt(`Prisma detected unknown OS "${t}" and may not work as expected. Defaulting to "linux".`),i?`${u}-openssl-${i}`:o?`${o}-openssl-${l}`:`${u}-openssl-${l}`)}async function gc(e){try{return await e()}catch{return}}function Dr(e){return gc(async()=>{let t=await oc(e);return fe(`Command "${e}" successfully returned "${t.stdout}"`),t.stdout})}async function yc(){return typeof Rr.default.machine=="function"?Rr.default.machine():(await Dr("uname -m"))?.trim()}function is(e){return e.startsWith("1.")}var ii=["darwin","darwin-arm64","debian-openssl-1.0.x","debian-openssl-1.1.x","debian-openssl-3.0.x","rhel-openssl-1.0.x","rhel-openssl-1.1.x","rhel-openssl-3.0.x","linux-arm64-openssl-1.1.x","linux-arm64-openssl-1.0.x","linux-arm64-openssl-3.0.x","linux-arm-openssl-1.1.x","linux-arm-openssl-1.0.x","linux-arm-openssl-3.0.x","linux-musl","linux-musl-openssl-3.0.x","linux-musl-arm64-openssl-1.1.x","linux-musl-arm64-openssl-3.0.x","linux-nixos","linux-static-x64","linux-static-arm64","windows","freebsd11","freebsd12","freebsd13","openbsd","netbsd","arm"];var bc=F(oi());var q=F(require("path")),xc=F(oi()),hg=V("prisma:engines");function ss(){return q.default.join(__dirname,"../")}var bg="libquery-engine";q.default.join(__dirname,"../query-engine-darwin");q.default.join(__dirname,"../query-engine-darwin-arm64");q.default.join(__dirname,"../query-engine-debian-openssl-1.0.x");q.default.join(__dirname,"../query-engine-debian-openssl-1.1.x");q.default.join(__dirname,"../query-engine-debian-openssl-3.0.x");q.default.join(__dirname,"../query-engine-linux-static-x64");q.default.join(__dirname,"../query-engine-linux-static-arm64");q.default.join(__dirname,"../query-engine-rhel-openssl-1.0.x");q.default.join(__dirname,"../query-engine-rhel-openssl-1.1.x");q.default.join(__dirname,"../query-engine-rhel-openssl-3.0.x");q.default.join(__dirname,"../libquery_engine-darwin.dylib.node");q.default.join(__dirname,"../libquery_engine-darwin-arm64.dylib.node");q.default.join(__dirname,"../libquery_engine-debian-openssl-1.0.x.so.node");q.default.join(__dirname,"../libquery_engine-debian-openssl-1.1.x.so.node");q.default.join(__dirname,"../libquery_engine-debian-openssl-3.0.x.so.node");q.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.0.x.so.node");q.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.1.x.so.node");q.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-3.0.x.so.node");q.default.join(__dirname,"../libquery_engine-linux-musl.so.node");q.default.join(__dirname,"../libquery_engine-linux-musl-openssl-3.0.x.so.node");q.default.join(__dirname,"../libquery_engine-rhel-openssl-1.0.x.so.node");q.default.join(__dirname,"../libquery_engine-rhel-openssl-1.1.x.so.node");q.default.join(__dirname,"../libquery_engine-rhel-openssl-3.0.x.so.node");q.default.join(__dirname,"../query_engine-windows.dll.node");var si=F(require("fs")),as=V("plusX");function ai(e){let t=si.default.statSync(e),r=t.mode|64|8|1;if(t.mode===r){as(`Execution permissions of ${e} are fine`);return}let n=r.toString(8).slice(-3);as(`Have to call plusX on ${e}`),si.default.chmodSync(e,n)}function li(e){let t=e.e,r=a=>`Prisma cannot find the required \`${a}\` system library in your system`,n=t.message.includes("cannot open shared object file"),i=`Please refer to the documentation about Prisma's system requirements: ${Lt("https://pris.ly/d/system-requirements")}`,o=`Unable to require(\`${$(e.id)}\`).`,s=pt({message:t.message,code:t.code}).with({code:"ENOENT"},()=>"File does not exist.").when(({message:a})=>n&&a.includes("libz"),()=>`${r("libz")}. Please install it and try again.`).when(({message:a})=>n&&a.includes("libgcc_s"),()=>`${r("libgcc_s")}. Please install it and try again.`).when(({message:a})=>n&&a.includes("libssl"),()=>{let a=e.platformInfo.libssl?`openssl-${e.platformInfo.libssl}`:"openssl";return`${r("libssl")}. Please install ${a} and try again.`}).when(({message:a})=>a.includes("GLIBC"),()=>`Prisma has detected an incompatible version of the \`glibc\` C standard library installed in your system. This probably means your system may be too old to run Prisma. ${i}`).when(({message:a})=>e.platformInfo.platform==="linux"&&a.includes("symbol not found"),()=>`The Prisma engines are not compatible with your system ${e.platformInfo.originalDistro} on (${e.platformInfo.archFromUname}) which uses the \`${e.platformInfo.binaryTarget}\` binaryTarget by default. ${i}`).otherwise(()=>`The Prisma engines do not seem to be compatible with your system. ${i}`);return`${o} +${s} + +Details: ${t.message}`}var we;(t=>{let e;(x=>(x.findUnique="findUnique",x.findUniqueOrThrow="findUniqueOrThrow",x.findFirst="findFirst",x.findFirstOrThrow="findFirstOrThrow",x.findMany="findMany",x.create="create",x.createMany="createMany",x.update="update",x.updateMany="updateMany",x.upsert="upsert",x.delete="delete",x.deleteMany="deleteMany",x.groupBy="groupBy",x.count="count",x.aggregate="aggregate",x.findRaw="findRaw",x.aggregateRaw="aggregateRaw"))(e=t.ModelAction||(t.ModelAction={}))})(we||(we={}));var us=F(qt());function ci(e){return String(new ui(e))}var ui=class{constructor(t){this.config=t}toString(){let{config:t}=this,r=t.provider.fromEnvVar?`env("${t.provider.fromEnvVar}")`:t.provider.value,n=JSON.parse(JSON.stringify({provider:r,binaryTargets:wc(t.binaryTargets)}));return`generator ${t.name} { +${(0,us.default)(Ec(n),2)} +}`}};function wc(e){let t;if(e.length>0){let r=e.find(n=>n.fromEnvVar!==null);r?t=`env("${r.fromEnvVar}")`:t=e.map(n=>n.native?"native":n.value)}else t=void 0;return t}function Ec(e){let t=Object.keys(e).reduce((r,n)=>Math.max(r,n.length),0);return Object.entries(e).map(([r,n])=>`${r.padEnd(t)} = ${Tc(n)}`).join(` +`)}function Tc(e){return JSON.parse(JSON.stringify(e,(t,r)=>Array.isArray(r)?`[${r.map(n=>JSON.stringify(n)).join(", ")}]`:JSON.stringify(r)))}var Vt={};Rt(Vt,{error:()=>vc,info:()=>Mc,log:()=>Pc,query:()=>Ac,should:()=>cs,tags:()=>Bt,warn:()=>pi});var Bt={error:R("prisma:error"),warn:Re("prisma:warn"),info:Ve("prisma:info"),query:st("prisma:query")},cs={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function Pc(...e){console.log(...e)}function pi(e,...t){cs.warn()&&console.warn(`${Bt.warn} ${e}`,...t)}function Mc(e,...t){console.info(`${Bt.info} ${e}`,...t)}function vc(e,...t){console.error(`${Bt.error} ${e}`,...t)}function Ac(e,...t){console.log(`${Bt.query} ${e}`,...t)}function Me(e,t){throw new Error(t)}function kr(e){let t;return(...r)=>t||(t=e(...r).catch(n=>{throw t=void 0,n}),t)}var Qt=F(require("path"));function di(e){return Qt.default.sep===Qt.default.posix.sep?e:e.split(Qt.default.sep).join(Qt.default.posix.sep)}function mi(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var fi=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});function gt(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}function gi(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n{gs.has(e)||(gs.add(e),pi(t,...r))};var Q=class extends Error{constructor(r,n,i){super(r);this.name="PrismaClientInitializationError",this.clientVersion=n,this.errorCode=i,Error.captureStackTrace(Q)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};ge(Q,"PrismaClientInitializationError");var ie=class extends Error{constructor(r,{code:n,clientVersion:i,meta:o,batchRequestIdx:s}){super(r);this.name="PrismaClientKnownRequestError",this.code=n,this.clientVersion=i,this.meta=o,Object.defineProperty(this,"batchRequestIdx",{value:s,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};ge(ie,"PrismaClientKnownRequestError");var be=class extends Error{constructor(r,n){super(r);this.name="PrismaClientRustPanicError",this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};ge(be,"PrismaClientRustPanicError");var oe=class extends Error{constructor(r,{clientVersion:n,batchRequestIdx:i}){super(r);this.name="PrismaClientUnknownRequestError",this.clientVersion=n,Object.defineProperty(this,"batchRequestIdx",{value:i,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};ge(oe,"PrismaClientUnknownRequestError");var yt=class{constructor(t){this._engine=t}prometheus(t){return this._engine.metrics({format:"prometheus",...t})}json(t){return this._engine.metrics({format:"json",...t})}};function Jt(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function ys(e){return{models:yi(e.models),enums:yi(e.enums),types:yi(e.types)}}function yi(e){let t={};for(let{name:r,...n}of e)t[r]=n;return t}function hs(e,t){let r=Jt(()=>Sc(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function Sc(e){return{datamodel:{models:hi(e.models),enums:hi(e.enums),types:hi(e.types)}}}function hi(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}function bs(e,t){for(let r of t)for(let n of Object.getOwnPropertyNames(r.prototype))Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(r.prototype,n)??Object.create(null))}var ht=9e15,Ge=1e9,bi="0123456789abcdef",_r="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Lr="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",xi={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ht,maxE:ht,crypto:!1},Ts,je,M=!0,qr="[DecimalError] ",Je=qr+"Invalid argument: ",Ps=qr+"Precision limit exceeded",Ms=qr+"crypto unavailable",vs="[object Decimal]",se=Math.floor,G=Math.pow,Oc=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Rc=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Dc=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,As=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ae=1e7,P=7,$c=9007199254740991,kc=_r.length-1,wi=Lr.length-1,h={toStringTag:vs};h.absoluteValue=h.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),T(e)};h.ceil=function(){return T(new this.constructor(this),this.e+1,2)};h.clampedTo=h.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(Je+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};h.comparedTo=h.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,l=o.s,u=e.s;if(!s||!a)return!l||!u?NaN:l!==u?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-u:0;if(l!==u)return l;if(o.e!==e.e)return o.e>e.e^l<0?1:-1;for(n=s.length,i=a.length,t=0,r=na[t]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};h.cosine=h.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+P,n.rounding=1,r=Ic(n,Rs(n,r)),n.precision=e,n.rounding=t,T(je==2||je==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};h.cubeRoot=h.cbrt=function(){var e,t,r,n,i,o,s,a,l,u,c=this,p=c.constructor;if(!c.isFinite()||c.isZero())return new p(c);for(M=!1,o=c.s*G(c.s*c,1/3),!o||Math.abs(o)==1/0?(r=X(c.d),e=c.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=G(r,1/3),e=se((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new p(r),n.s=c.s):n=new p(o.toString()),s=(e=p.precision)+3;;)if(a=n,l=a.times(a).times(a),u=l.plus(c),n=_(u.plus(c).times(a),u.plus(l),s+2,1),X(a.d).slice(0,s)===(r=X(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(T(a,e+1,0),a.times(a).times(a).eq(c))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(T(n,e+1,1),t=!n.times(n).times(n).eq(c));break}return M=!0,T(n,e,p.rounding,t)};h.decimalPlaces=h.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-se(this.e/P))*P,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};h.dividedBy=h.div=function(e){return _(this,new this.constructor(e))};h.dividedToIntegerBy=h.divToInt=function(e){var t=this,r=t.constructor;return T(_(t,new r(e),0,1,1),r.precision,r.rounding)};h.equals=h.eq=function(e){return this.cmp(e)===0};h.floor=function(){return T(new this.constructor(this),this.e+1,3)};h.greaterThan=h.gt=function(e){return this.cmp(e)>0};h.greaterThanOrEqualTo=h.gte=function(e){var t=this.cmp(e);return t==1||t===0};h.hyperbolicCosine=h.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/Vr(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=bt(s,1,o.times(t),new s(1),!0);for(var l,u=e,c=new s(8);u--;)l=o.times(o),o=a.minus(l.times(c.minus(l.times(c))));return T(o,s.precision=r,s.rounding=n,!0)};h.hyperbolicSine=h.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=bt(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/Vr(5,e)),i=bt(o,2,i,i,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=t,o.rounding=r,T(i,t,r,!0)};h.hyperbolicTangent=h.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,_(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};h.inverseCosine=h.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return n!==-1?n===0?t.isNeg()?ve(r,i,o):new r(0):new r(NaN):t.isZero()?ve(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=ve(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))};h.inverseHyperbolicCosine=h.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,M=!1,r=r.times(r).minus(1).sqrt().plus(r),M=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};h.inverseHyperbolicSine=h.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,M=!1,r=r.times(r).plus(1).sqrt().plus(r),M=!0,n.precision=e,n.rounding=t,r.ln())};h.inverseHyperbolicTangent=h.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?T(new o(i),e,t,!0):(o.precision=r=n-i.e,i=_(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};h.inverseSine=h.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=ve(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};h.inverseTangent=h.atan=function(){var e,t,r,n,i,o,s,a,l,u=this,c=u.constructor,p=c.precision,d=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&p+4<=wi)return s=ve(c,p+4,d).times(.25),s.s=u.s,s}else{if(!u.s)return new c(NaN);if(p+4<=wi)return s=ve(c,p+4,d).times(.5),s.s=u.s,s}for(c.precision=a=p+10,c.rounding=1,r=Math.min(28,a/P+2|0),e=r;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(M=!1,t=Math.ceil(a/P),n=1,l=u.times(u),s=new c(u),i=u;e!==-1;)if(i=i.times(l),o=s.minus(i.div(n+=2)),i=i.times(l),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<this.d.length-2};h.isNaN=function(){return!this.s};h.isNegative=h.isNeg=function(){return this.s<0};h.isPositive=h.isPos=function(){return this.s>0};h.isZero=function(){return!!this.d&&this.d[0]===0};h.lessThan=h.lt=function(e){return this.cmp(e)<0};h.lessThanOrEqualTo=h.lte=function(e){return this.cmp(e)<1};h.logarithm=h.log=function(e){var t,r,n,i,o,s,a,l,u=this,c=u.constructor,p=c.precision,d=c.rounding,m=5;if(e==null)e=new c(10),t=!0;else{if(e=new c(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new c(NaN);t=e.eq(10)}if(r=u.d,u.s<0||!r||!r[0]||u.eq(1))return new c(r&&!r[0]?-1/0:u.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(M=!1,a=p+m,s=Ue(u,a),n=t?jr(c,a+10):Ue(e,a),l=_(s,n,a,1),Gt(l.d,i=p,d))do if(a+=10,s=Ue(u,a),n=t?jr(c,a+10):Ue(e,a),l=_(s,n,a,1),!o){+X(l.d).slice(i+1,i+15)+1==1e14&&(l=T(l,p+1,0));break}while(Gt(l.d,i+=10,d));return M=!0,T(l,p,d)};h.minus=h.sub=function(e){var t,r,n,i,o,s,a,l,u,c,p,d,m=this,f=m.constructor;if(e=new f(e),!m.d||!e.d)return!m.s||!e.s?e=new f(NaN):m.d?e.s=-e.s:e=new f(e.d||m.s!==e.s?m:NaN),e;if(m.s!=e.s)return e.s=-e.s,m.plus(e);if(u=m.d,d=e.d,a=f.precision,l=f.rounding,!u[0]||!d[0]){if(d[0])e.s=-e.s;else if(u[0])e=new f(m);else return new f(l===3?-0:0);return M?T(e,a,l):e}if(r=se(e.e/P),c=se(m.e/P),u=u.slice(),o=c-r,o){for(p=o<0,p?(t=u,o=-o,s=d.length):(t=d,r=c,s=u.length),n=Math.max(Math.ceil(a/P),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=u.length,s=d.length,p=n0;--n)u[s++]=0;for(n=d.length;n>o;){if(u[--n]s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=u.length,i=c.length,s-i<0&&(i=s,r=c,c=u,u=r),t=0;i;)t=(u[--i]=u[i]+c[i]+t)/Ae|0,u[i]%=Ae;for(t&&(u.unshift(t),++n),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=Br(u,n),M?T(e,a,l):e};h.precision=h.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Je+e);return r.d?(t=Cs(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};h.round=function(){var e=this,t=e.constructor;return T(new t(e),e.e+1,t.rounding)};h.sine=h.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+P,n.rounding=1,r=_c(n,Rs(n,r)),n.precision=e,n.rounding=t,T(je>2?r.neg():r,e,t,!0)):new n(NaN)};h.squareRoot=h.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,l=s.e,u=s.s,c=s.constructor;if(u!==1||!a||!a[0])return new c(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(M=!1,u=Math.sqrt(+s),u==0||u==1/0?(t=X(a),(t.length+l)%2==0&&(t+="0"),u=Math.sqrt(t),l=se((l+1)/2)-(l<0||l%2),u==1/0?t="5e"+l:(t=u.toExponential(),t=t.slice(0,t.indexOf("e")+1)+l),n=new c(t)):n=new c(u.toString()),r=(l=c.precision)+3;;)if(o=n,n=o.plus(_(s,o,r+2,1)).times(.5),X(o.d).slice(0,r)===(t=X(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(T(o,l+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(T(n,l+1,1),e=!n.times(n).eq(s));break}return M=!0,T(n,l,c.rounding,e)};h.tangent=h.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=_(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,T(je==2||je==4?r.neg():r,e,t,!0)):new n(NaN)};h.times=h.mul=function(e){var t,r,n,i,o,s,a,l,u,c=this,p=c.constructor,d=c.d,m=(e=new p(e)).d;if(e.s*=c.s,!d||!d[0]||!m||!m[0])return new p(!e.s||d&&!d[0]&&!m||m&&!m[0]&&!d?NaN:!d||!m?e.s/0:e.s*0);for(r=se(c.e/P)+se(e.e/P),l=d.length,u=m.length,l=0;){for(t=0,i=l+n;i>n;)a=o[i]+m[n]*d[i-n-1]+t,o[i--]=a%Ae|0,t=a/Ae|0;o[i]=(o[i]+t)%Ae|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=Br(o,r),M?T(e,p.precision,p.rounding):e};h.toBinary=function(e,t){return Pi(this,2,e,t)};h.toDecimalPlaces=h.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ye(e,0,Ge),t===void 0?t=n.rounding:ye(t,0,8),T(r,e+r.e+1,t))};h.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=De(n,!0):(ye(e,0,Ge),t===void 0?t=i.rounding:ye(t,0,8),n=T(new i(n),e+1,t),r=De(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};h.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=De(i):(ye(e,0,Ge),t===void 0?t=o.rounding:ye(t,0,8),n=T(new o(i),e+i.e+1,t),r=De(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};h.toFraction=function(e){var t,r,n,i,o,s,a,l,u,c,p,d,m=this,f=m.d,g=m.constructor;if(!f)return new g(m);if(u=r=new g(1),n=l=new g(0),t=new g(n),o=t.e=Cs(f)-m.e-1,s=o%P,t.d[0]=G(10,s<0?P+s:s),e==null)e=o>0?t:u;else{if(a=new g(e),!a.isInt()||a.lt(u))throw Error(Je+a);e=a.gt(t)?o>0?t:u:a}for(M=!1,a=new g(X(f)),c=g.precision,g.precision=o=f.length*P*2;p=_(a,t,0,1,1),i=r.plus(p.times(n)),i.cmp(e)!=1;)r=n,n=i,i=u,u=l.plus(p.times(i)),l=i,i=t,t=a.minus(p.times(i)),a=i;return i=_(e.minus(r),n,0,1,1),l=l.plus(i.times(u)),r=r.plus(i.times(n)),l.s=u.s=m.s,d=_(u,n,o,1).minus(m).abs().cmp(_(l,r,o,1).minus(m).abs())<1?[u,n]:[l,r],g.precision=c,M=!0,d};h.toHexadecimal=h.toHex=function(e,t){return Pi(this,16,e,t)};h.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:ye(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(M=!1,r=_(r,e,0,t,1).times(e),M=!0,T(r)):(e.s=r.s,r=e),r};h.toNumber=function(){return+this};h.toOctal=function(e,t){return Pi(this,8,e,t)};h.toPower=h.pow=function(e){var t,r,n,i,o,s,a=this,l=a.constructor,u=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(G(+a,u));if(a=new l(a),a.eq(1))return a;if(n=l.precision,o=l.rounding,e.eq(1))return T(a,n,o);if(t=se(e.e/P),t>=e.d.length-1&&(r=u<0?-u:u)<=$c)return i=Fs(l,a,r,n),e.s<0?new l(1).div(i):T(i,n,o);if(s=a.s,s<0){if(tl.maxE+1||t0?s/0:0):(M=!1,l.rounding=a.s=1,r=Math.min(12,(t+"").length),i=Ei(e.times(Ue(a,n+r)),n),i.d&&(i=T(i,n+5,1),Gt(i.d,n,o)&&(t=n+10,i=T(Ei(e.times(Ue(a,t+r)),t),t+5,1),+X(i.d).slice(n+1,n+15)+1==1e14&&(i=T(i,n+1,0)))),i.s=s,M=!0,l.rounding=o,T(i,n,o))};h.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=De(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(ye(e,1,Ge),t===void 0?t=i.rounding:ye(t,0,8),n=T(new i(n),e,t),r=De(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};h.toSignificantDigits=h.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ye(e,1,Ge),t===void 0?t=n.rounding:ye(t,0,8)),T(new n(r),e,t)};h.toString=function(){var e=this,t=e.constructor,r=De(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};h.truncated=h.trunc=function(){return T(new this.constructor(this),this.e+1,1)};h.valueOf=h.toJSON=function(){var e=this,t=e.constructor,r=De(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function X(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;tr)throw Error(Je+e)}function Gt(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=P,i=0):(i=Math.ceil((t+1)/P),t%=P),o=G(10,P-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==G(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==G(10,t-3)-1,s}function Nr(e,t,r){for(var n,i=[0],o,s=0,a=e.length;sr-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function Ic(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/Vr(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=bt(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var _=function(){function e(n,i,o){var s,a=0,l=n.length;for(n=n.slice();l--;)s=n[l]*i+a,n[l]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function t(n,i,o,s){var a,l;if(o!=s)l=o>s?1:-1;else for(a=l=0;ai[a]?1:-1;break}return l}function r(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]1;)n.shift()}return function(n,i,o,s,a,l){var u,c,p,d,m,f,g,b,y,w,x,E,C,O,B,k,U,J,re,ot,yr=n.constructor,Dn=n.s==i.s?1:-1,ne=n.d,N=i.d;if(!ne||!ne[0]||!N||!N[0])return new yr(!n.s||!i.s||(ne?N&&ne[0]==N[0]:!N)?NaN:ne&&ne[0]==0||!N?Dn*0:Dn/0);for(l?(m=1,c=n.e-i.e):(l=Ae,m=P,c=se(n.e/m)-se(i.e/m)),re=N.length,U=ne.length,y=new yr(Dn),w=y.d=[],p=0;N[p]==(ne[p]||0);p++);if(N[p]>(ne[p]||0)&&c--,o==null?(O=o=yr.precision,s=yr.rounding):a?O=o+(n.e-i.e)+1:O=o,O<0)w.push(1),f=!0;else{if(O=O/m+2|0,p=0,re==1){for(d=0,N=N[0],O++;(p1&&(N=e(N,d,l),ne=e(ne,d,l),re=N.length,U=ne.length),k=re,x=ne.slice(0,re),E=x.length;E=l/2&&++J;do d=0,u=t(N,x,re,E),u<0?(C=x[0],re!=E&&(C=C*l+(x[1]||0)),d=C/J|0,d>1?(d>=l&&(d=l-1),g=e(N,d,l),b=g.length,E=x.length,u=t(g,x,b,E),u==1&&(d--,r(g,re=10;d/=10)p++;y.e=p+c*m-1,T(y,a?o+y.e+1:o,s,f)}return y}}();function T(e,t,r,n){var i,o,s,a,l,u,c,p,d,m=e.constructor;e:if(t!=null){if(p=e.d,!p)return e;for(i=1,a=p[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=P,s=t,c=p[d=0],l=c/G(10,i-s-1)%10|0;else if(d=Math.ceil((o+1)/P),a=p.length,d>=a)if(n){for(;a++<=d;)p.push(0);c=l=0,i=1,o%=P,s=o-P+1}else break e;else{for(c=a=p[d],i=1;a>=10;a/=10)i++;o%=P,s=o-P+i,l=s<0?0:c/G(10,i-s-1)%10|0}if(n=n||t<0||p[d+1]!==void 0||(s<0?c:c%G(10,i-s-1)),u=r<4?(l||n)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||n||r==6&&(o>0?s>0?c/G(10,i-s):0:p[d-1])%10&1||r==(e.s<0?8:7)),t<1||!p[0])return p.length=0,u?(t-=e.e+1,p[0]=G(10,(P-t%P)%P),e.e=-t||0):p[0]=e.e=0,e;if(o==0?(p.length=d,a=1,d--):(p.length=d+1,a=G(10,P-o),p[d]=s>0?(c/G(10,i-s)%G(10,s)|0)*a:0),u)for(;;)if(d==0){for(o=1,s=p[0];s>=10;s/=10)o++;for(s=p[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,p[0]==Ae&&(p[0]=1));break}else{if(p[d]+=a,p[d]!=Ae)break;p[d--]=0,a=1}for(o=p.length;p[--o]===0;)p.pop()}return M&&(e.e>m.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+Qe(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Qe(-i-1)+o,r&&(n=r-s)>0&&(o+=Qe(n))):i>=s?(o+=Qe(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+Qe(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=Qe(n))),o}function Br(e,t){var r=e[0];for(t*=P;r>=10;r/=10)t++;return t}function jr(e,t,r){if(t>kc)throw M=!0,r&&(e.precision=r),Error(Ps);return T(new e(_r),t,1,!0)}function ve(e,t,r){if(t>wi)throw Error(Ps);return T(new e(Lr),t,r,!0)}function Cs(e){var t=e.length-1,r=t*P+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function Qe(e){for(var t="";e--;)t+="0";return t}function Fs(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/P+4);for(M=!1;;){if(r%2&&(o=o.times(t),ws(o.d,s)&&(i=!0)),r=se(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),ws(t.d,s)}return M=!0,o}function xs(e){return e.d[e.d.length-1]&1}function Ss(e,t,r){for(var n,i=new e(t[0]),o=0;++o17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(t==null?(M=!1,l=f):l=t,a=new d(.03125);e.e>-2;)e=e.times(a),p+=5;for(n=Math.log(G(2,p))/Math.LN10*2+5|0,l+=n,r=o=s=new d(1),d.precision=l;;){if(o=T(o.times(e),l,1),r=r.times(++c),a=s.plus(_(o,r,l,1)),X(a.d).slice(0,l)===X(s.d).slice(0,l)){for(i=p;i--;)s=T(s.times(s),l,1);if(t==null)if(u<3&&Gt(s.d,l-n,m,u))d.precision=l+=10,r=o=a=new d(1),c=0,u++;else return T(s,d.precision=f,m,M=!0);else return d.precision=f,s}s=a}}function Ue(e,t){var r,n,i,o,s,a,l,u,c,p,d,m=1,f=10,g=e,b=g.d,y=g.constructor,w=y.rounding,x=y.precision;if(g.s<0||!b||!b[0]||!g.e&&b[0]==1&&b.length==1)return new y(b&&!b[0]?-1/0:g.s!=1?NaN:b?0:g);if(t==null?(M=!1,c=x):c=t,y.precision=c+=f,r=X(b),n=r.charAt(0),Math.abs(o=g.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)g=g.times(e),r=X(g.d),n=r.charAt(0),m++;o=g.e,n>1?(g=new y("0."+r),o++):g=new y(n+"."+r.slice(1))}else return u=jr(y,c+2,x).times(o+""),g=Ue(new y(n+"."+r.slice(1)),c-f).plus(u),y.precision=x,t==null?T(g,x,w,M=!0):g;for(p=g,l=s=g=_(g.minus(1),g.plus(1),c,1),d=T(g.times(g),c,1),i=3;;){if(s=T(s.times(d),c,1),u=l.plus(_(s,new y(i),c,1)),X(u.d).slice(0,c)===X(l.d).slice(0,c))if(l=l.times(2),o!==0&&(l=l.plus(jr(y,c+2,x).times(o+""))),l=_(l,new y(m),c,1),t==null)if(Gt(l.d,c-f,w,a))y.precision=c+=f,u=s=g=_(p.minus(1),p.plus(1),c,1),d=T(g.times(g),c,1),i=a=1;else return T(l,y.precision=x,w,M=!0);else return y.precision=x,l;l=u,i+=2}}function Os(e){return String(e.s*e.s/0)}function Ti(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%P,r<0&&(n+=P),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),As.test(t))return Ti(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Rc.test(t))r=16,t=t.toLowerCase();else if(Oc.test(t))r=2;else if(Dc.test(t))r=8;else throw Error(Je+t);for(o=t.search(/p/i),o>0?(l=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=Fs(n,new n(r),o,o*2)),u=Nr(t,r,Ae),c=u.length-1,o=c;u[o]===0;--o)u.pop();return o<0?new n(e.s*0):(e.e=Br(u,c),e.d=u,M=!1,s&&(e=_(e,i,a*4)),l&&(e=e.times(Math.abs(l)<54?G(2,l):rt.pow(2,l))),M=!0,e)}function _c(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:bt(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/Vr(5,r)),t=bt(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function bt(e,t,r,n,i){var o,s,a,l,u=1,c=e.precision,p=Math.ceil(c/P);for(M=!1,l=r.times(r),a=new e(n);;){if(s=_(a.times(l),new e(t++*t++),c,1),a=i?n.plus(s):n.minus(s),n=_(s.times(l),new e(t++*t++),c,1),s=a.plus(n),s.d[p]!==void 0){for(o=p;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,u++}return M=!0,s.d.length=p+1,s}function Vr(e,t){for(var r=e;--t;)r*=e;return r}function Rs(e,t){var r,n=t.s<0,i=ve(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return je=n?4:1,t;if(r=t.divToInt(i),r.isZero())je=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return je=xs(r)?n?2:3:n?4:1,t;je=xs(r)?n?1:4:n?3:2}return t.minus(i).abs()}function Pi(e,t,r,n){var i,o,s,a,l,u,c,p,d,m=e.constructor,f=r!==void 0;if(f?(ye(r,1,Ge),n===void 0?n=m.rounding:ye(n,0,8)):(r=m.precision,n=m.rounding),!e.isFinite())c=Os(e);else{for(c=De(e),s=c.indexOf("."),f?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(c=c.replace(".",""),d=new m(1),d.e=c.length-s,d.d=Nr(De(d),10,i),d.e=d.d.length),p=Nr(c,10,i),o=l=p.length;p[--l]==0;)p.pop();if(!p[0])c=f?"0p+0":"0";else{if(s<0?o--:(e=new m(e),e.d=p,e.e=o,e=_(e,d,r,n,0,i),p=e.d,o=e.e,u=Ts),s=p[r],a=i/2,u=u||p[r+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||u||n===6&&p[r-1]&1||n===(e.s<0?8:7)),p.length=r,u)for(;++p[--r]>i-1;)p[r]=0,r||(++o,p.unshift(1));for(l=p.length;!p[l-1];--l);for(s=0,c="";s1)if(t==16||t==8){for(s=t==16?4:3,--l;l%s;l++)c+="0";for(p=Nr(c,i,t),l=p.length;!p[l-1];--l);for(s=1,c="1.";sl)for(o-=l;o--;)c+="0";else ot)return e.length=t,!0}function Lc(e){return new this(e).abs()}function jc(e){return new this(e).acos()}function qc(e){return new this(e).acosh()}function Bc(e,t){return new this(e).plus(t)}function Vc(e){return new this(e).asin()}function Kc(e){return new this(e).asinh()}function Qc(e){return new this(e).atan()}function Uc(e){return new this(e).atanh()}function Jc(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=ve(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?ve(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=ve(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(_(e,t,o,1)),t=ve(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(_(e,t,o,1)),r}function Gc(e){return new this(e).cbrt()}function Wc(e){return T(e=new this(e),e.e+1,2)}function Hc(e,t,r){return new this(e).clamp(t,r)}function zc(e){if(!e||typeof e!="object")throw Error(qr+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,Ge,"rounding",0,8,"toExpNeg",-ht,0,"toExpPos",0,ht,"maxE",0,ht,"minE",-ht,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(Je+r+": "+n);if(r="crypto",i&&(this[r]=xi[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(Ms);else this[r]=!1;else throw Error(Je+r+": "+n);return this}function Yc(e){return new this(e).cos()}function Zc(e){return new this(e).cosh()}function Ds(e){var t,r,n;function i(o){var s,a,l,u=this;if(!(u instanceof i))return new i(o);if(u.constructor=i,Es(o)){u.s=o.s,M?!o.d||o.e>i.maxE?(u.e=NaN,u.d=null):o.e=10;a/=10)s++;M?s>i.maxE?(u.e=NaN,u.d=null):s=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(Ms);else for(;o=10;i/=10)n++;n`}};function xt(e){return e instanceof Ee}var ks=["JsonNullValueInput","NullableJsonNullValueInput","JsonNullValueFilter"],Qr=Symbol(),Mi=new WeakMap,z=class{constructor(t){t===Qr?Mi.set(this,`Prisma.${this._getName()}`):Mi.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return Mi.get(this)}},Wt=class extends z{_getNamespace(){return"NullTypes"}},Ht=class extends Wt{};vi(Ht,"DbNull");var zt=class extends Wt{};vi(zt,"JsonNull");var Yt=class extends Wt{};vi(Yt,"AnyNull");var wt={classes:{DbNull:Ht,JsonNull:zt,AnyNull:Yt},instances:{DbNull:new Ht(Qr),JsonNull:new zt(Qr),AnyNull:new Yt(Qr)}};function vi(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}function de(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function $e(e){return e.toString()!=="Invalid Date"}function ke(e){return rt.isDecimal(e)?!0:e!==null&&typeof e=="object"&&typeof e.s=="number"&&typeof e.e=="number"&&typeof e.toFixed=="function"&&Array.isArray(e.d)}var ae=(e,t)=>{let r={};for(let n of e){let i=n[t];r[i]=n}return r},Et={String:!0,Int:!0,Float:!0,Boolean:!0,Long:!0,DateTime:!0,ID:!0,UUID:!0,Json:!0,Bytes:!0,Decimal:!0,BigInt:!0};var Pp={string:"String",boolean:"Boolean",object:"Json",symbol:"Symbol"};function Tt(e){return typeof e=="string"?e:e.name}function Xt(e,t){return t?`List<${e}>`:e}var Mp=/^(\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60))(\.\d{1,})?(([Z])|([+|-]([01][0-9]|2[0-3]):[0-5][0-9]))$/,vp=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function Pt(e,t){let r=t?.type;if(e===null)return"null";if(Object.prototype.toString.call(e)==="[object BigInt]")return"BigInt";if(pe.isDecimal(e)||r==="Decimal"&&ke(e))return"Decimal";if(Buffer.isBuffer(e))return"Bytes";if(Ap(e,t))return r.name;if(e instanceof z)return e._getName();if(e instanceof Ee)return e._toGraphQLInputType();if(Array.isArray(e)){let i=e.reduce((o,s)=>{let a=Pt(s,t);return o.includes(a)||o.push(a),o},[]);return i.includes("Float")&&i.includes("Int")&&(i=["Float"]),`List<${i.join(" | ")}>`}let n=typeof e;if(n==="number")return Math.trunc(e)===e?"Int":"Float";if(de(e))return"DateTime";if(n==="string"){if(vp.test(e))return"UUID";if(new Date(e).toString()==="Invalid Date")return"String";if(Mp.test(e))return"DateTime"}return Pp[n]}function Ap(e,t){let r=t?.type;if(!Fp(r))return!1;if(t?.namespace==="prisma"&&ks.includes(r.name)){let n=e?.constructor?.name;return typeof n=="string"&&wt.instances[n]===e&&r.values.includes(n)}return typeof e=="string"&&r.values.includes(e)}function Ur(e,t){return t.reduce((n,i)=>{let o=(0,Is.default)(e,i);return on.length*3)),str:null}).str}function Mt(e,t=!1){if(typeof e=="string")return e;if(e.values)return`enum ${e.name} { +${(0,Ai.default)(e.values.join(", "),2)} +}`;{let r=(0,Ai.default)(e.fields.map(n=>{let i=`${n.name}`,o=`${t?S(i):i}${n.isRequired?"":"?"}: ${Dt(n.inputTypes.map(s=>Xt(Cp(s.type)?s.type.name:Tt(s.type),s.isList)).join(" | "))}`;return n.isRequired?o:$(o)}).join(` +`),2);return`${$("type")} ${v($(e.name))} ${$("{")} +${r} +${$("}")}`}}function Cp(e){return typeof e!="string"}function Zt(e){return typeof e=="string"?e==="Null"?"null":e:e.name}function er(e){return typeof e=="string"?e:e.name}function Ci(e,t,r=!1){if(typeof e=="string")return e==="Null"?"null":e;if(e.values)return e.values.join(" | ");let n=e,i=t&&n.fields.every(o=>o.inputTypes[0].location==="inputObjectTypes"||o.inputTypes[1]?.location==="inputObjectTypes");return r?Zt(e):n.fields.reduce((o,s)=>{let a="";return!i&&!s.isRequired?a=s.inputTypes.map(l=>Zt(l.type)).join(" | "):a=s.inputTypes.map(l=>Ci(l.type,s.isRequired,!0)).join(" | "),o[s.name+(s.isRequired?"":"?")]=a,o},{})}function Ns(e,t,r){let n={};for(let i of e)n[r(i)]=i;for(let i of t){let o=r(i);n[o]||(n[o]=i)}return Object.values(n)}function vt(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function _s(e){return e.endsWith("GroupByOutputType")}function Fp(e){return typeof e=="object"&&e!==null&&typeof e.name=="string"&&Array.isArray(e.values)}var Jr=class{constructor({datamodel:t}){this.datamodel=t,this.datamodelEnumMap=this.getDatamodelEnumMap(),this.modelMap=this.getModelMap(),this.typeMap=this.getTypeMap(),this.typeAndModelMap=this.getTypeModelMap()}getDatamodelEnumMap(){return ae(this.datamodel.enums,"name")}getModelMap(){return{...ae(this.datamodel.models,"name")}}getTypeMap(){return{...ae(this.datamodel.types,"name")}}getTypeModelMap(){return{...this.getTypeMap(),...this.getModelMap()}}},Gr=class{constructor({mappings:t}){this.mappings=t,this.mappingsMap=this.getMappingsMap()}getMappingsMap(){return ae(this.mappings.modelOperations,"model")}getOtherOperationNames(){return[Object.values(this.mappings.otherOperations.write),Object.values(this.mappings.otherOperations.read)].flat()}},Wr=class{constructor({schema:t}){this.outputTypeToMergedOutputType=t=>({...t,fields:t.fields});this.schema=t,this.enumMap=this.getEnumMap(),this.queryType=this.getQueryType(),this.mutationType=this.getMutationType(),this.outputTypes=this.getOutputTypes(),this.outputTypeMap=this.getMergedOutputTypeMap(),this.resolveOutputTypes(),this.inputObjectTypes=this.schema.inputObjectTypes,this.inputTypeMap=this.getInputTypeMap(),this.resolveInputTypes(),this.resolveFieldArgumentTypes(),this.queryType=this.outputTypeMap.Query,this.mutationType=this.outputTypeMap.Mutation,this.rootFieldMap=this.getRootFieldMap()}get[Symbol.toStringTag](){return"DMMFClass"}resolveOutputTypes(){for(let t of this.outputTypes.model){for(let r of t.fields)typeof r.outputType.type=="string"&&!Et[r.outputType.type]&&(r.outputType.type=this.outputTypeMap[r.outputType.type]||this.outputTypeMap[r.outputType.type]||this.enumMap[r.outputType.type]||r.outputType.type);t.fieldMap=ae(t.fields,"name")}for(let t of this.outputTypes.prisma){for(let r of t.fields)typeof r.outputType.type=="string"&&!Et[r.outputType.type]&&(r.outputType.type=this.outputTypeMap[r.outputType.type]||this.outputTypeMap[r.outputType.type]||this.enumMap[r.outputType.type]||r.outputType.type);t.fieldMap=ae(t.fields,"name")}}resolveInputTypes(){let t=this.inputObjectTypes.prisma;this.inputObjectTypes.model&&t.push(...this.inputObjectTypes.model);for(let r of t){for(let n of r.fields)for(let i of n.inputTypes){let o=i.type;typeof o=="string"&&!Et[o]&&(this.inputTypeMap[o]||this.enumMap[o])&&(i.type=this.inputTypeMap[o]||this.enumMap[o]||o)}r.fieldMap=ae(r.fields,"name")}}resolveFieldArgumentTypes(){for(let t of this.outputTypes.prisma)for(let r of t.fields)for(let n of r.args)for(let i of n.inputTypes){let o=i.type;typeof o=="string"&&!Et[o]&&(i.type=this.inputTypeMap[o]||this.enumMap[o]||o)}for(let t of this.outputTypes.model)for(let r of t.fields)for(let n of r.args)for(let i of n.inputTypes){let o=i.type;typeof o=="string"&&!Et[o]&&(i.type=this.inputTypeMap[o]||this.enumMap[o]||i.type)}}getQueryType(){return this.schema.outputObjectTypes.prisma.find(t=>t.name==="Query")}getMutationType(){return this.schema.outputObjectTypes.prisma.find(t=>t.name==="Mutation")}getOutputTypes(){return{model:this.schema.outputObjectTypes.model.map(this.outputTypeToMergedOutputType),prisma:this.schema.outputObjectTypes.prisma.map(this.outputTypeToMergedOutputType)}}getEnumMap(){return{...ae(this.schema.enumTypes.prisma,"name"),...this.schema.enumTypes.model?ae(this.schema.enumTypes.model,"name"):void 0}}hasEnumInNamespace(t,r){return this.schema.enumTypes[r]?.find(n=>n.name===t)!==void 0}getMergedOutputTypeMap(){return{...ae(this.outputTypes.model,"name"),...ae(this.outputTypes.prisma,"name")}}getInputTypeMap(){return{...this.schema.inputObjectTypes.model?ae(this.schema.inputObjectTypes.model,"name"):void 0,...ae(this.schema.inputObjectTypes.prisma,"name")}}getRootFieldMap(){return{...ae(this.queryType.fields,"name"),...ae(this.mutationType.fields,"name")}}},We=class{constructor(t){return Object.assign(this,new Jr(t),new Gr(t),new Wr(t))}};bs(We,[Jr,Gr,Wr]);var tu=require("async_hooks"),ru=require("events"),nu=F(require("fs")),gr=F(require("path"));var ee=class{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof ee?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,o=0;for(;i{let i=t.models.find(o=>o.name===n.model);if(!i)throw new Error(`Mapping without model ${n.model}`);return i.fields.some(o=>o.kind!=="object")}).map(n=>({model:n.model,plural:(0,Bs.default)(vt(n.model)),findUnique:n.findUnique||n.findSingle,findUniqueOrThrow:n.findUniqueOrThrow,findFirst:n.findFirst,findFirstOrThrow:n.findFirstOrThrow,findMany:n.findMany,create:n.createOne||n.createSingle||n.create,createMany:n.createMany,delete:n.deleteOne||n.deleteSingle||n.delete,update:n.updateOne||n.updateSingle||n.update,deleteMany:n.deleteMany,updateMany:n.updateMany,upsert:n.upsertOne||n.upsertSingle||n.upsert,aggregate:n.aggregate,groupBy:n.groupBy,findRaw:n.findRaw,aggregateRaw:n.aggregateRaw})),otherOperations:e.otherOperations}}function Ks(e){return Vs(e)}function tr(e){return{getKeys(){return Object.keys(e)},getPropertyValue(t){return e[t]}}}function Ce(e,t){return{getKeys(){return[e]},getPropertyValue(){return t()}}}var Ie=class{constructor(){this._map=new Map}get(t){return this._map.get(t)?.value}set(t,r){this._map.set(t,{value:r})}getOrCreate(t,r){let n=this._map.get(t);if(n)return n.value;let i=r();return this.set(t,i),i}};function nt(e){let t=new Ie;return{getKeys(){return e.getKeys()},getPropertyValue(r){return t.getOrCreate(r,()=>e.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}var Js=require("util");var Hr={enumerable:!0,configurable:!0,writable:!0};function zr(e){let t=new Set(e);return{getOwnPropertyDescriptor:()=>Hr,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var Qs=Symbol.for("nodejs.util.inspect.custom");function Ne(e,t){let r=Op(t),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=r.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){if(n.has(s))return!0;let a=r.get(s);return a?a.has?.(s)??!0:Reflect.has(o,s)},ownKeys(o){let s=Us(Reflect.ownKeys(o),r),a=Us(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(o,s,a){return r.get(s)?.getPropertyDescriptor?.(s)?.writable===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let l=r.get(s);return l?l.getPropertyDescriptor?{...Hr,...l?.getPropertyDescriptor(s)}:Hr:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)}});return i[Qs]=function(o,s,a=Js.inspect){let l={...this};return delete l[Qs],a(l,s)},i}function Op(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let i of n)t.set(i,r)}return t}function Us(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}function rr(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}function Gs({error:e,user_facing_error:t},r){return t.error_code?new ie(t.message,{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new oe(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}var Yr=class{};var Zs=F(require("fs")),nr=F(require("path"));function Zr(e){let{runtimeBinaryTarget:t}=e;return`Add "${t}" to \`binaryTargets\` in the "schema.prisma" file and run \`prisma generate\` after saving it: + +${Rp(e)}`}function Rp(e){let{generator:t,generatorBinaryTargets:r,runtimeBinaryTarget:n}=e,i={fromEnvVar:null,value:n},o=[...r,i];return ci({...t,binaryTargets:o})}function He(e){let{runtimeBinaryTarget:t}=e;return`Prisma Client could not locate the Query Engine for runtime "${t}".`}function ze(e){let{searchedLocations:t}=e;return`The following locations have been searched: +${[...new Set(t)].map(i=>` ${i}`).join(` +`)}`}function Ws(e){let{runtimeBinaryTarget:t}=e;return`${He(e)} + +This happened because \`binaryTargets\` have been pinned, but the actual deployment also required "${t}". +${Zr(e)} + +${ze(e)}`}function Xr(e){return`We would appreciate if you could take the time to share some information with us. +Please help us by answering a few questions: https://pris.ly/${e}`}function Hs(e){let{queryEngineName:t}=e;return`${He(e)} + +This is likely caused by a bundler that has not copied "${t}" next to the resulting bundle. +Ensure that "${t}" has been copied next to the bundle or in "${e.expectedLocation}". + +${Xr("engine-not-found-bundler-investigation")} + +${ze(e)}`}function zs(e){let{runtimeBinaryTarget:t,generatorBinaryTargets:r}=e,n=r.find(i=>i.native);return`${He(e)} + +This happened because Prisma Client was generated for "${n?.value??"unknown"}", but the actual deployment required "${t}". +${Zr(e)} + +${ze(e)}`}function Ys(e){let{queryEngineName:t}=e;return`${He(e)} + +This is likely caused by tooling that has not copied "${t}" to the deployment folder. +Ensure that you ran \`prisma generate\` and that "${t}" has been copied to "${e.expectedLocation}". + +${Xr("engine-not-found-tooling-investigation")} + +${ze(e)}`}var Dp=V("prisma:client:engines:resolveEnginePath"),$p=()=>"library",kp=()=>new RegExp(`runtime[\\\\/]${$p()}\\.m?js$`);async function Xs(e,t){let r={binary:process.env.PRISMA_QUERY_ENGINE_BINARY,library:process.env.PRISMA_QUERY_ENGINE_LIBRARY}[e]??t.prismaPath;if(r!==void 0)return r;let{enginePath:n,searchedLocations:i}=await Ip(e,t);if(Dp("enginePath",n),n!==void 0&&e==="binary"&&ai(n),n!==void 0)return t.prismaPath=n;let o=await ft(),s=t.generator?.binaryTargets??[],a=s.some(d=>d.native),l=!s.some(d=>d.value===o),u=__filename.match(kp())===null,c={searchedLocations:i,generatorBinaryTargets:s,generator:t.generator,runtimeBinaryTarget:o,queryEngineName:ea(e,o),expectedLocation:nr.default.relative(process.cwd(),t.dirname)},p;throw a&&l?p=zs(c):l?p=Ws(c):u?p=Hs(c):p=Ys(c),new Q(p,t.clientVersion)}async function Ip(engineType,config){let binaryTarget=await ft(),searchedLocations=[],dirname=eval("__dirname"),searchLocations=[config.dirname,nr.default.resolve(dirname,".."),config.generator?.output?.value??dirname,nr.default.resolve(dirname,"../../../.prisma/client"),"/tmp/prisma-engines",config.cwd];__filename.includes("resolveEnginePath")&&searchLocations.push(ss());for(let e of searchLocations){let t=ea(engineType,binaryTarget),r=nr.default.join(e,t);if(searchedLocations.push(e),Zs.default.existsSync(r))return{enginePath:r,searchedLocations}}return{enginePath:void 0,searchedLocations}}function ea(e,t){return e==="library"?Zn(t,"fs"):`query-engine-${t}${t==="windows"?".exe":""}`}function ta(e,t){return Np(e)?!t||t.kind==="itx"?{batch:e,transaction:!1}:{batch:e,transaction:!0,isolationLevel:t.options.isolationLevel}:{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}function Np(e){return typeof e[0].query=="string"}var Di=F(Kt());function ra(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,t=>`${t[0]}5`):""}function na(e){return e.split(` +`).map(t=>t.replace(/^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)\s*/,"").replace(/\+\d+\s*ms$/,"")).join(` +`)}var ia=F(fs());function oa({title:e,user:t="prisma",repo:r="prisma",template:n="bug_report.md",body:i}){return(0,ia.default)({user:t,repo:r,template:n,title:e,body:i})}function sa({version:e,platform:t,title:r,description:n,engineVersion:i,database:o,query:s}){let a=Fo(6e3-(s?.length??0)),l=na((0,Di.default)(a)),u=n?`# Description +\`\`\` +${n} +\`\`\``:"",c=(0,Di.default)(`Hi Prisma Team! My Prisma Client just crashed. This is the report: +## Versions + +| Name | Version | +|-----------------|--------------------| +| Node | ${process.version?.padEnd(19)}| +| OS | ${t?.padEnd(19)}| +| Prisma Client | ${e?.padEnd(19)}| +| Query Engine | ${i?.padEnd(19)}| +| Database | ${o?.padEnd(19)}| + +${u} + +## Logs +\`\`\` +${l} +\`\`\` + +## Client Snippet +\`\`\`ts +// PLEASE FILL YOUR CODE SNIPPET HERE +\`\`\` + +## Schema +\`\`\`prisma +// PLEASE ADD YOUR SCHEMA HERE IF POSSIBLE +\`\`\` + +## Prisma Engine Query +\`\`\` +${s?ra(s):""} +\`\`\` +`),p=oa({title:r,body:c});return`${r} + +This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic. + +${ce(p)} + +If you want the Prisma team to look into it, please open the link above \u{1F64F} +To increase the chance of success, please post your schema and a snippet of +how you used Prisma Client in the issue. +`}var pa=F(require("fs"));function aa(e){if(e?.kind==="itx")return e.options.id}var ki=F(require("os")),la=F(require("path"));var $i=Symbol("PrismaLibraryEngineCache");function _p(){let e=globalThis;return e[$i]===void 0&&(e[$i]={}),e[$i]}function Lp(e){let t=_p();if(t[e]!==void 0)return t[e];let r=la.default.toNamespacedPath(e),n={exports:{}},i=0;return process.platform!=="win32"&&(i=ki.default.constants.dlopen.RTLD_LAZY|ki.default.constants.dlopen.RTLD_DEEPBIND),process.dlopen(n,r,i),t[e]=n.exports,n.exports}var en=class{constructor(t){this.config=t}async loadLibrary(){let t=await ni(),r=await Xs("library",this.config);try{return this.config.tracingHelper.runInChildSpan({name:"loadLibrary",internal:!0},()=>Lp(r))}catch(n){let i=li({e:n,platformInfo:t,id:r});throw new Q(i,this.config.clientVersion)}}};var jp=V("prisma:client:libraryEngine:exitHooks"),qp={SIGINT:2,SIGUSR2:31,SIGTERM:15},tn=class{constructor(){this.nextOwnerId=1;this.ownerToIdMap=new WeakMap;this.idToListenerMap=new Map;this.areHooksInstalled=!1;this.exitLikeHook=async t=>{jp(`exit event received: ${t}`);for(let r of this.idToListenerMap.values())await r();this.idToListenerMap.clear()}}install(){this.areHooksInstalled||(this.installExitEventHook("beforeExit"),this.installExitEventHook("exit"),this.installExitSignalHook("SIGINT"),this.installExitSignalHook("SIGUSR2"),this.installExitSignalHook("SIGTERM"),this.areHooksInstalled=!0)}setListener(t,r){if(r){let n=this.ownerToIdMap.get(t);n||(n=this.nextOwnerId++,this.ownerToIdMap.set(t,n)),this.idToListenerMap.set(n,r)}else{let n=this.ownerToIdMap.get(t);n!==void 0&&(this.ownerToIdMap.delete(t),this.idToListenerMap.delete(n))}}getListener(t){let r=this.ownerToIdMap.get(t);if(r!==void 0)return this.idToListenerMap.get(r)}installExitEventHook(t){process.once(t,this.exitLikeHook)}installExitSignalHook(t){process.once(t,async r=>{if(await this.exitLikeHook(r),process.listenerCount(r)>0)return;let i=qp[r]+128;process.exit(i)})}};var qe=V("prisma:client:libraryEngine");function Bp(e){return e.item_type==="query"&&"query"in e}function Vp(e){return"level"in e?e.level==="error"&&e.message==="PANIC":!1}var ua=[...ii,"native"],ca=0,Ii=new tn,ir=class extends Yr{constructor(r,n=new en(r)){super();try{this.datamodel=pa.default.readFileSync(r.datamodelPath,"utf-8")}catch(i){throw i.stack.match(/\/\.next|\/next@|\/next\//)?new Q(`Your schema.prisma could not be found, and we detected that you are using Next.js. +Find out why and learn how to fix this: https://pris.ly/d/schema-not-found-nextjs`,r.clientVersion):r.isBundled===!0?new Q("Prisma Client could not find its `schema.prisma`. This is likely caused by a bundling step, which leads to `schema.prisma` not being copied near the resulting bundle. We would appreciate if you could take the time to share some information with us.\nPlease help us by answering a few questions: https://pris.ly/bundler-investigation-error",r.clientVersion):i}this.config=r,this.libraryStarted=!1,this.logQueries=r.logQueries??!1,this.logLevel=r.logLevel??"error",this.libraryLoader=n,this.logEmitter=r.logEmitter,this.engineProtocol=r.engineProtocol,this.datasourceOverrides=r.datasources?this.convertDatasources(r.datasources):{},r.enableDebugLogs&&(this.logLevel="debug"),this.libraryInstantiationPromise=this.instantiateLibrary(),Ii.install(),this.checkForTooManyEngines()}get beforeExitListener(){return Ii.getListener(this)}set beforeExitListener(r){Ii.setListener(this,r)}checkForTooManyEngines(){ca===10&&console.warn(`${Re("warn(prisma-client)")} This is the 10th instance of Prisma Client being started. Make sure this is intentional.`)}async transaction(r,n,i){await this.start();let o=JSON.stringify(n),s;if(r==="start"){let l=JSON.stringify({max_wait:i?.maxWait??2e3,timeout:i?.timeout??5e3,isolation_level:i?.isolationLevel});s=await this.engine?.startTransaction(l,o)}else r==="commit"?s=await this.engine?.commitTransaction(i.id,o):r==="rollback"&&(s=await this.engine?.rollbackTransaction(i.id,o));let a=this.parseEngineResponse(s);if(a.error_code)throw new ie(a.message,{code:a.error_code,clientVersion:this.config.clientVersion,meta:a.meta});return a}async instantiateLibrary(){if(qe("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;Yn(),this.platform=await this.getPlatform(),await this.loadEngine(),this.version()}async getPlatform(){if(this.platform)return this.platform;let r=await ft();if(!ua.includes(r))throw new Q(`Unknown ${R("PRISMA_QUERY_ENGINE_LIBRARY")} ${R(v(r))}. Possible binaryTargets: ${S(ua.join(", "))} or a path to the query engine library. +You may have to run ${S("prisma generate")} for your changes to take effect.`,this.config.clientVersion);return r}parseEngineResponse(r){if(!r)throw new oe("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(r)}catch{throw new oe("Unable to JSON.parse response from engine",{clientVersion:this.config.clientVersion})}}convertDatasources(r){let n=Object.create(null);for(let{name:i,url:o}of r)n[i]=o;return n}async loadEngine(){if(!this.engine){this.QueryEngineConstructor||(this.library=await this.libraryLoader.loadLibrary(),this.QueryEngineConstructor=this.library.QueryEngine);try{let r=new WeakRef(this);this.engine=new this.QueryEngineConstructor({datamodel:this.datamodel,env:process.env,logQueries:this.config.logQueries??!1,ignoreEnvVarErrors:!0,datasourceOverrides:this.datasourceOverrides,logLevel:this.logLevel,configDir:this.config.cwd,engineProtocol:this.engineProtocol},n=>{r.deref()?.logger(n)}),ca++}catch(r){let n=r,i=this.parseInitError(n.message);throw typeof i=="string"?n:new Q(i.message,this.config.clientVersion,i.error_code)}}}logger(r){let n=this.parseEngineResponse(r);if(!!n){if("span"in n){this.config.tracingHelper.createEngineSpan(n);return}n.level=n?.level.toLowerCase()??"unknown",Bp(n)?this.logEmitter.emit("query",{timestamp:new Date,query:n.query,params:n.params,duration:Number(n.duration_ms),target:n.module_path}):Vp(n)?this.loggerRustPanic=new be(this.getErrorMessageWithLink(`${n.message}: ${n.reason} in ${n.file}:${n.line}:${n.column}`),this.config.clientVersion):this.logEmitter.emit(n.level,{timestamp:new Date,message:n.message,target:n.module_path})}}getErrorMessageWithLink(r){return sa({platform:this.platform,title:r,version:this.config.clientVersion,engineVersion:this.versionInfo?.commit,database:this.config.activeProvider,query:this.lastQuery})}parseInitError(r){try{return JSON.parse(r)}catch{}return r}parseRequestError(r){try{return JSON.parse(r)}catch{}return r}on(r,n){r==="beforeExit"?this.beforeExitListener=n:this.logEmitter.on(r,n)}async start(){if(await this.libraryInstantiationPromise,await this.libraryStoppingPromise,this.libraryStartingPromise)return qe(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let r=async()=>{qe("library starting");try{let n={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(n)),this.libraryStarted=!0,qe("library started")}catch(n){let i=this.parseInitError(n.message);throw typeof i=="string"?n:new Q(i.message,this.config.clientVersion,i.error_code)}finally{this.libraryStartingPromise=void 0}};return this.libraryStartingPromise=this.config.tracingHelper.runInChildSpan("connect",r),this.libraryStartingPromise}async stop(){if(await this.libraryStartingPromise,await this.executingQueryPromise,this.libraryStoppingPromise)return qe("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted)return;let r=async()=>{await new Promise(i=>setTimeout(i,5)),qe("library stopping");let n={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(n)),this.libraryStarted=!1,this.libraryStoppingPromise=void 0,qe("library stopped")};return this.libraryStoppingPromise=this.config.tracingHelper.runInChildSpan("disconnect",r),this.libraryStoppingPromise}async getDmmf(){await this.start();let r=this.config.tracingHelper.getTraceParent(),n=await this.engine.dmmf(JSON.stringify({traceparent:r}));return this.config.tracingHelper.runInChildSpan({name:"parseDmmf",internal:!0},()=>JSON.parse(n))}version(){return this.versionInfo=this.library?.version(),this.versionInfo?.version??"unknown"}debugPanic(r){return this.library?.debugPanic(r)}async request(r,{traceparent:n,interactiveTransaction:i}){qe(`sending request, this.libraryStarted: ${this.libraryStarted}`);let o=JSON.stringify({traceparent:n}),s=JSON.stringify(r);try{await this.start(),this.executingQueryPromise=this.engine?.query(s,o,i?.id),this.lastQuery=s;let a=this.parseEngineResponse(await this.executingQueryPromise);if(a.errors)throw a.errors.length===1?this.buildQueryError(a.errors[0]):new oe(JSON.stringify(a.errors),{clientVersion:this.config.clientVersion});if(this.loggerRustPanic)throw this.loggerRustPanic;return{data:a,elapsed:0}}catch(a){if(a instanceof Q)throw a;if(a.code==="GenericFailure"&&a.message?.startsWith("PANIC:"))throw new be(this.getErrorMessageWithLink(a.message),this.config.clientVersion);let l=this.parseRequestError(a.message);throw typeof l=="string"?a:new oe(`${l.message} +${l.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(r,{transaction:n,traceparent:i}){qe("requestBatch");let o=ta(r,n);await this.start(),this.lastQuery=JSON.stringify(o),this.executingQueryPromise=this.engine.query(this.lastQuery,JSON.stringify({traceparent:i}),aa(n));let s=await this.executingQueryPromise,a=this.parseEngineResponse(s);if(a.errors)throw a.errors.length===1?this.buildQueryError(a.errors[0]):new oe(JSON.stringify(a.errors),{clientVersion:this.config.clientVersion});let{batchResult:l,errors:u}=a;if(Array.isArray(l))return l.map(c=>c.errors&&c.errors.length>0?this.loggerRustPanic??this.buildQueryError(c.errors[0]):{data:c,elapsed:0});throw u&&u.length===1?new Error(u[0].error):new Error(JSON.stringify(a))}buildQueryError(r){return r.user_facing_error.is_panic?new be(this.getErrorMessageWithLink(r.user_facing_error.message),this.config.clientVersion):Gs(r,this.config.clientVersion)}async metrics(r){await this.start();let n=await this.engine.metrics(JSON.stringify(r));return r.format==="prometheus"?n:this.parseEngineResponse(n)}};var or="";function da(e){var t=e.split(` +`);return t.reduce(function(r,n){var i=Up(n)||Gp(n)||zp(n)||ed(n)||Zp(n);return i&&r.push(i),r},[])}var Kp=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack||\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Qp=/\((\S*)(?::(\d+))(?::(\d+))\)/;function Up(e){var t=Kp.exec(e);if(!t)return null;var r=t[2]&&t[2].indexOf("native")===0,n=t[2]&&t[2].indexOf("eval")===0,i=Qp.exec(t[2]);return n&&i!=null&&(t[2]=i[1],t[3]=i[2],t[4]=i[3]),{file:r?null:t[2],methodName:t[1]||or,arguments:r?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}var Jp=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Gp(e){var t=Jp.exec(e);return t?{file:t[2],methodName:t[1]||or,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var Wp=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Hp=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function zp(e){var t=Wp.exec(e);if(!t)return null;var r=t[3]&&t[3].indexOf(" > eval")>-1,n=Hp.exec(t[3]);return r&&n!=null&&(t[3]=n[1],t[4]=n[2],t[5]=null),{file:t[3],methodName:t[1]||or,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}var Yp=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function Zp(e){var t=Yp.exec(e);return t?{file:t[3],methodName:t[1]||or,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}var Xp=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function ed(e){var t=Xp.exec(e);return t?{file:t[2],methodName:t[1]||or,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var Ni=class{getLocation(){return null}},_i=class{constructor(){this._error=new Error}getLocation(){let t=this._error.stack;if(!t)return null;let n=da(t).find(i=>{if(!i.file)return!1;let o=di(i.file);return o!==""&&!o.includes("@prisma")&&!o.includes("/packages/client/src/runtime/")&&!o.endsWith("/runtime/binary.js")&&!o.endsWith("/runtime/library.js")&&!o.endsWith("/runtime/data-proxy.js")&&!o.endsWith("/runtime/edge.js")&&!o.endsWith("/runtime/edge-esm.js")&&!o.startsWith("internal/")&&!i.methodName.includes("new ")&&!i.methodName.includes("getCallSite")&&!i.methodName.includes("Proxy.")&&i.methodName.split(".").length<4});return!n||!n.file?null:{fileName:n.file,lineNumber:n.lineNumber,columnNumber:n.column}}};function Ye(e){return e==="minimal"?new Ni:new _i}var ma={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function At(e={}){let t=rd(e);return Object.entries(t).reduce((n,[i,o])=>(ma[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function rd(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function rn(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function fa(e,t){let r=rn(e);return t({action:"aggregate",unpacker:r,argsMapper:At})(e)}function nd(e={}){let{select:t,...r}=e;return typeof t=="object"?At({...r,_count:t}):At({...r,_count:{_all:!0}})}function id(e={}){return typeof e.select=="object"?t=>rn(e)(t)._count:t=>rn(e)(t)._count._all}function ga(e,t){return t({action:"count",unpacker:id(e),argsMapper:nd})(e)}function od(e={}){let t=At(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);return t}function sd(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function ya(e,t){return t({action:"groupBy",unpacker:sd(e),argsMapper:od})(e)}function ha(e,t,r){if(t==="aggregate")return n=>fa(n,r);if(t==="count")return n=>ga(n,r);if(t==="groupBy")return n=>ya(n,r)}function ba(e,t){let r=t.fields.filter(i=>!i.relationName),n=fi(r,i=>i.name);return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new Ee(e,o,s.type,s.isList,s.kind==="enum")},...zr(Object.keys(n))})}var xa=e=>Array.isArray(e)?e:e.split("."),sr=(e,t)=>xa(t).reduce((r,n)=>r&&r[n],e),nn=(e,t,r)=>xa(t).reduceRight((n,i,o,s)=>Object.assign({},sr(e,s.slice(0,o)),{[i]:n}),r);function ad(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function ld(e,t,r){return t===void 0?e??{}:nn(t,r,e||!0)}function Li(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((l,u)=>({...l,[u.name]:u}),{});return l=>{let u=Ye(e._errorFormat),c=ad(n,i),p=ld(l,o,c),d=r({dataPath:c,callsite:u})(p),m=ud(e,t);return new Proxy(d,{get(f,g){if(!m.includes(g))return f[g];let y=[a[g].type,r,g],w=[c,p];return Li(e,...y,...w)},...zr([...m,...Object.getOwnPropertyNames(d)])})}}function ud(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}var it=F(qt());var Qi=F(Kt());function Te(e){return e.replace(/^./,t=>t.toLowerCase())}function Ea(e,t,r){let n=Te(r);return!t.result||!(t.result.$allModels||t.result[n])?e:cd({...e,...wa(t.name,e,t.result.$allModels),...wa(t.name,e,t.result[n])})}function cd(e){let t=new Ie,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>r(o,i)):[n]));return gt(e,n=>({...n,needs:r(n.name,new Set)}))}function wa(e,t,r){return r?gt(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:pd(t,o,i)})):{}}function pd(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function on(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(!!e[n.name])for(let i of n.needs)r[i]=!0;return r}var Ca=F(qt());var Aa=F(require("fs"));var Ta={keyword:Ve,entity:Ve,value:e=>v(st(e)),punctuation:st,directive:Ve,function:Ve,variable:e=>v(st(e)),string:e=>v(S(e)),boolean:Re,number:Ve,comment:br};var dd=e=>e,sn={},md=0,A={manual:sn.Prism&&sn.Prism.manual,disableWorkerMessageHandler:sn.Prism&&sn.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof Fe){let t=e;return new Fe(t.type,A.util.encode(t.content),t.alias)}else return Array.isArray(e)?e.map(A.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(J instanceof Fe)continue;if(C&&k!=t.length-1){w.lastIndex=U;var p=w.exec(e);if(!p)break;var c=p.index+(E?p[1].length:0),d=p.index+p[0].length,a=k,l=U;for(let N=t.length;a=l&&(++k,U=l);if(t[k]instanceof Fe)continue;u=a-k,J=e.slice(U,l),p.index-=U}else{w.lastIndex=0;var p=w.exec(J),u=1}if(!p){if(o)break;continue}E&&(O=p[1]?p[1].length:0);var c=p.index+O,p=p[0].slice(O),d=c+p.length,m=J.slice(0,c),f=J.slice(d);let re=[k,u];m&&(++k,U+=m.length,re.push(m));let ot=new Fe(g,x?A.tokenize(p,x):p,B,p,C);if(re.push(ot),f&&re.push(f),Array.prototype.splice.apply(t,re),u!=1&&A.matchGrammar(e,t,r,k,U,!0,g),o)break}}}},tokenize:function(e,t){let r=[e],n=t.rest;if(n){for(let i in n)t[i]=n[i];delete t.rest}return A.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){let r=A.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){let r=A.hooks.all[e];if(!(!r||!r.length))for(var n=0,i;i=r[n++];)i(t)}},Token:Fe};A.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};A.languages.javascript=A.languages.extend("clike",{"class-name":[A.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/});A.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;A.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:A.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:A.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:A.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:A.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});A.languages.markup&&A.languages.markup.tag.addInlined("script","javascript");A.languages.js=A.languages.javascript;A.languages.typescript=A.languages.extend("javascript",{keyword:/\b(?:abstract|as|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|var|void|while|with|yield)\b/,builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/});A.languages.ts=A.languages.typescript;function Fe(e,t,r,n,i){this.type=e,this.content=t,this.alias=r,this.length=(n||"").length|0,this.greedy=!!i}Fe.stringify=function(e,t){return typeof e=="string"?e:Array.isArray(e)?e.map(function(r){return Fe.stringify(r,t)}).join(""):fd(e.type)(e.content)};function fd(e){return Ta[e]||dd}function Pa(e){return gd(e,A.languages.javascript)}function gd(e,t){return A.tokenize(e,t).map(n=>Fe.stringify(n)).join("")}var Ma=F(Wn());function va(e){return(0,Ma.default)(e)}var Se=class{static read(t){let r;try{r=Aa.default.readFileSync(t,"utf-8")}catch{return null}return Se.fromContent(r)}static fromContent(t){let r=t.split(/\r?\n/);return new Se(1,r)}constructor(t,r){this.firstLineNumber=t,this.lines=r}get lastLineNumber(){return this.firstLineNumber+this.lines.length-1}mapLineAt(t,r){if(tthis.lines.length+this.firstLineNumber)return this;let n=t-this.firstLineNumber,i=[...this.lines];return i[n]=r(i[n]),new Se(this.firstLineNumber,i)}mapLines(t){return new Se(this.firstLineNumber,this.lines.map((r,n)=>t(r,this.firstLineNumber+n)))}lineAt(t){return this.lines[t-this.firstLineNumber]}prependSymbolAt(t,r){return this.mapLines((n,i)=>i===t?`${r} ${n}`:` ${n}`)}slice(t,r){let n=this.lines.slice(t-1,r).join(` +`);return new Se(t,va(n).split(` +`))}highlight(){let t=Pa(this.toString());return new Se(this.firstLineNumber,t.split(` +`))}toString(){return this.lines.join(` +`)}};var yd={red:R,gray:br,dim:$,bold:v,underline:ce,highlightSource:e=>e.highlight()},hd={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function bd({callsite:e,message:t,originalMethod:r,isPanic:n,callArguments:i},o){let s={functionName:`prisma.${r}()`,message:t,isPanic:n??!1,callArguments:i};if(!e||typeof window<"u"||process.env.NODE_ENV==="production")return s;let a=e.getLocation();if(!a||!a.lineNumber||!a.columnNumber)return s;let l=Math.max(1,a.lineNumber-3),u=Se.read(a.fileName)?.slice(l,a.lineNumber),c=u?.lineAt(a.lineNumber);if(u&&c){let p=wd(c),d=xd(c);if(!d)return s;s.functionName=`${d.code})`,s.location=a,n||(u=u.mapLineAt(a.lineNumber,f=>f.slice(0,d.openingBraceIndex))),u=o.highlightSource(u);let m=String(u.lastLineNumber).length;if(s.contextLines=u.mapLines((f,g)=>o.gray(String(g).padStart(m))+" "+f).mapLines(f=>o.dim(f)).prependSymbolAt(a.lineNumber,o.bold(o.red("\u2192"))),i){let f=p+m+1;f+=2,s.callArguments=(0,Ca.default)(i,f).slice(f)}}return s}function xd(e){let t=Object.keys(we.ModelAction).join("|"),n=new RegExp(String.raw`\.(${t})\(`).exec(e);if(n){let i=n.index+n[0].length,o=e.lastIndexOf(" ",n.index)+1;return{code:e.slice(o,i),openingBraceIndex:i}}return null}function wd(e){let t=0;for(let r=0;r{let n=[];return function i(o,s={},a="",l=[]){s.indent=s.indent||" ";let u;s.inlineCharacterLimit===void 0?u={newLine:` +`,newLineOrSpace:` +`,pad:a,indent:a+s.indent}:u={newLine:"@@__STRINGIFY_OBJECT_NEW_LINE__@@",newLineOrSpace:"@@__STRINGIFY_OBJECT_NEW_LINE_OR_SPACE__@@",pad:"@@__STRINGIFY_OBJECT_PAD__@@",indent:"@@__STRINGIFY_OBJECT_INDENT__@@"};let c=p=>{if(s.inlineCharacterLimit===void 0)return p;let d=p.replace(new RegExp(u.newLine,"g"),"").replace(new RegExp(u.newLineOrSpace,"g")," ").replace(new RegExp(u.pad+"|"+u.indent,"g"),"");return d.length<=s.inlineCharacterLimit?d:p.replace(new RegExp(u.newLine+"|"+u.newLineOrSpace,"g"),` +`).replace(new RegExp(u.pad,"g"),a).replace(new RegExp(u.indent,"g"),a+s.indent)};if(n.indexOf(o)!==-1)return'"[Circular]"';if(Buffer.isBuffer(o))return`Buffer(${Buffer.length})`;if(o==null||typeof o=="number"||typeof o=="boolean"||typeof o=="function"||typeof o=="symbol"||o instanceof z||Md(o))return String(o);if(de(o))return`new Date('${$e(o)?o.toISOString():"Invalid Date"}')`;if(o instanceof Ee)return`prisma.${vt(o.modelName)}.fields.${o.name}`;if(Array.isArray(o)){if(o.length===0)return"[]";n.push(o);let p="["+u.newLine+o.map((d,m)=>{let f=o.length-1===m?u.newLine:","+u.newLineOrSpace,g=i(d,s,a+s.indent,[...l,m]);s.transformValue&&(g=s.transformValue(o,m,g));let b=u.indent+g+f;return s.transformLine&&(b=s.transformLine({obj:o,indent:u.indent,key:m,stringifiedValue:g,value:o[m],eol:f,originalLine:b,path:l.concat(m)})),b}).join("")+u.pad+"]";return n.pop(),c(p)}if(vd(o)){let p=Object.keys(o).concat(Ad(o));if(s.filter&&(p=p.filter(m=>s.filter(o,m))),p.length===0)return"{}";n.push(o);let d="{"+u.newLine+p.map((m,f)=>{let g=p.length-1===f?u.newLine:","+u.newLineOrSpace,b=typeof m=="symbol",y=!b&&/^[a-z$_][a-z$_0-9]*$/i.test(m),w=b||y?m:i(m,s,void 0,[...l,m]),x=i(o[m],s,a+s.indent,[...l,m]);s.transformValue&&(x=s.transformValue(o,m,x));let E=u.indent+String(w)+": "+x+g;return s.transformLine&&(E=s.transformLine({obj:o,indent:u.indent,key:w,stringifiedValue:x,value:o[m],eol:g,originalLine:E,path:l.concat(w)})),E}).join("")+u.pad+"}";return n.pop(),c(d)}return o=String(o).replace(/[\r\n]/g,p=>p===` +`?"\\n":"\\r"),s.singleQuotes===!1?(o=o.replace(/"/g,'\\"'),`"${o}"`):(o=o.replace(/\\?'/g,"\\'"),`'${o}'`)}(e,t,r)},lr=Cd;var qi="@@__DIM_POINTER__@@";function an({ast:e,keyPaths:t,valuePaths:r,missingItems:n}){let i=e;for(let{path:o,type:s}of n)i=nn(i,o,s);return lr(i,{indent:" ",transformLine:({indent:o,key:s,value:a,stringifiedValue:l,eol:u,path:c})=>{let p=c.join("."),d=t.includes(p),m=r.includes(p),f=n.find(b=>b.path===p),g=l;if(f){typeof a=="string"&&(g=g.slice(1,g.length-1));let b=f.isRequired?"":"?",y=f.isRequired?"+":"?",x=(f.isRequired?E=>v(S(E)):S)(Od(s+b+": "+g+u,o,y));return f.isRequired||(x=$(x)),x}else{let b=n.some(E=>p.startsWith(E.path)),y=s[s.length-2]==="?";y&&(s=s.slice(1,s.length-1)),y&&typeof a=="object"&&a!==null&&(g=g.split(` +`).map((E,C,O)=>C===O.length-1?E+qi:E).join(` +`)),b&&typeof a=="string"&&(g=g.slice(1,g.length-1),y||(g=v(g))),(typeof a!="object"||a===null)&&!m&&!b&&(g=$(g));let w="";typeof s=="string"&&(w=(d?R(s):s)+": "),g=m?R(g):g;let x=o+w+g+(b?u:$(u));if(d||m){let E=x.split(` +`),C=String(s).length,O=d?R("~".repeat(C)):" ".repeat(C),B=m?Fd(o,s,a,l):0,k=m&&qa(a),U=m?" "+R("~".repeat(B)):"";O&&O.length>0&&!k&&E.splice(1,0,o+O+U),O&&O.length>0&&k&&E.splice(E.length-1,0,o.slice(0,o.length-2)+U),x=E.join(` +`)}return x}}})}function Fd(e,t,r,n){return r===null?4:typeof r=="string"?r.length+2:Array.isArray(r)&&r.length==0?2:qa(r)?Math.abs(Sd(`${t}: ${(0,Bi.default)(n)}`)-e.length):de(r)?$e(r)?`new Date('${r.toISOString()}')`.length:24:String(r).length}function qa(e){return typeof e=="object"&&e!==null&&!(e instanceof z)&&!de(e)}function Sd(e){return e.split(` +`).reduce((t,r)=>r.length>t?r.length:t,0)}function Od(e,t,r){return e.split(` +`).map((n,i,o)=>i===0?r+t.slice(1)+n:i(0,Bi.default)(n).includes(qi)?$(n.replace(qi,"")):n.includes("?")?$(n):n).join(` +`)}var ur=2,Ui=class{constructor(t,r){this.type=t;this.children=r;this.printFieldError=({error:t},r,n)=>{if(t.type==="emptySelect"){let i=n?"":` Available options are listed in ${$(S("green"))}.`;return`The ${R("`select`")} statement for type ${v(er(t.field.outputType.type))} must not be empty.${i}`}if(t.type==="emptyInclude"){if(r.length===0)return`${v(er(t.field.outputType.type))} does not have any relation and therefore can't have an ${R("`include`")} statement.`;let i=n?"":` Available options are listed in ${$(S("green"))}.`;return`The ${R("`include`")} statement for type ${R(er(t.field.outputType.type))} must not be empty.${i}`}if(t.type==="noTrueSelect")return`The ${R("`select`")} statement for type ${R(er(t.field.outputType.type))} needs ${R("at least one truthy value")}.`;if(t.type==="includeAndSelect")return`Please ${v("either")} use ${S("`include`")} or ${S("`select`")}, but ${R("not both")} at the same time.`;if(t.type==="invalidFieldName"){let i=t.isInclude?"include":"select",o=t.isIncludeScalar?"Invalid scalar":"Unknown",s=n?"":t.isInclude&&r.length===0?` +This model has no relations, so you can't use ${R("include")} with it.`:` Available options are listed in ${$(S("green"))}.`,a=`${o} field ${R(`\`${t.providedName}\``)} for ${R(i)} statement on model ${v(Dt(t.modelName))}.${s}`;return t.didYouMean&&(a+=` Did you mean ${S(`\`${t.didYouMean}\``)}?`),t.isIncludeScalar&&(a+=` +Note, that ${v("include")} statements only accept relation fields.`),a}if(t.type==="invalidFieldType")return`Invalid value ${R(`${lr(t.providedValue)}`)} of type ${R(Pt(t.providedValue,void 0))} for field ${v(`${t.fieldName}`)} on model ${v(Dt(t.modelName))}. Expected either ${S("true")} or ${S("false")}.`};this.printArgError=({error:t,path:r},n,i)=>{if(t.type==="invalidName"){let o=`Unknown arg ${R(`\`${t.providedName}\``)} in ${v(r.join("."))} for type ${v(t.outputType?t.outputType.name:Zt(t.originalType))}.`;return t.didYouMeanField?o+=` +\u2192 Did you forget to wrap it with \`${S("select")}\`? ${$("e.g. "+S(`{ select: { ${t.providedName}: ${t.providedValue} } }`))}`:t.didYouMeanArg?(o+=` Did you mean \`${S(t.didYouMeanArg)}\`?`,!n&&!i&&(o+=` ${$("Available args:")} +`+Mt(t.originalType,!0))):t.originalType.fields.length===0?o+=` The field ${v(t.originalType.name)} has no arguments.`:!n&&!i&&(o+=` Available args: + +`+Mt(t.originalType,!0)),o}if(t.type==="invalidType"){let o=lr(t.providedValue,{indent:" "}),s=o.split(` +`).length>1;if(s&&(o=` +${o} +`),t.requiredType.bestFittingType.location==="enumTypes")return`Argument ${v(t.argName)}: Provided value ${R(o)}${s?"":" "}of type ${R(Pt(t.providedValue))} on ${v(`prisma.${this.children[0].name}`)} is not a ${S(Xt(Tt(t.requiredType.bestFittingType.type),t.requiredType.bestFittingType.isList))}. +\u2192 Possible values: ${t.requiredType.bestFittingType.type.values.map(c=>S(`${Tt(t.requiredType.bestFittingType.type)}.${c}`)).join(", ")}`;let a=".";Ct(t.requiredType.bestFittingType.type)&&(a=`: +`+Mt(t.requiredType.bestFittingType.type));let l=`${t.requiredType.inputType.map(c=>S(Xt(Tt(c.type),t.requiredType.bestFittingType.isList))).join(" or ")}${a}`,u=t.requiredType.inputType.length===2&&t.requiredType.inputType.find(c=>Ct(c.type))||null;return u&&(l+=` +`+Mt(u.type,!0)),`Argument ${v(t.argName)}: Got invalid value ${R(o)}${s?"":" "}on ${v(`prisma.${this.children[0].name}`)}. Provided ${R(Pt(t.providedValue))}, expected ${l}`}if(t.type==="invalidNullArg"){let o=r.length===1&&r[0]===t.name?"":` for ${v(`${r.join(".")}`)}`,s=` Please use ${v(S("undefined"))} instead.`;return`Argument ${S(t.name)}${o} must not be ${v("null")}.${s}`}if(t.type==="invalidDateArg"){let o=r.length===1&&r[0]===t.argName?"":` for ${v(`${r.join(".")}`)}`;return`Argument ${S(t.argName)}${o} is not a valid Date object.`}if(t.type==="missingArg"){let o=r.length===1&&r[0]===t.missingName?"":` for ${v(`${r.join(".")}`)}`;return`Argument ${S(t.missingName)}${o} is missing.`}if(t.type==="atLeastOne"){let o=i?"":` Available args are listed in ${$(S("green"))}.`,s=t.atLeastFields?` and at least one argument for ${t.atLeastFields.map(a=>v(a)).join(", or ")}`:"";return`Argument ${v(r.join("."))} of type ${v(t.inputType.name)} needs ${S("at least one")} argument${v(s)}.${o}`}if(t.type==="atMostOne"){let o=i?"":` Please choose one. ${$("Available args:")} +${Mt(t.inputType,!0)}`;return`Argument ${v(r.join("."))} of type ${v(t.inputType.name)} needs ${S("exactly one")} argument, but you provided ${t.providedKeys.map(s=>R(s)).join(" and ")}.${o}`}};this.type=t,this.children=r}get[Symbol.toStringTag](){return"Document"}toString(){return`${this.type} { +${(0,it.default)(this.children.map(String).join(` +`),ur)} +}`}validate(t,r=!1,n,i,o){t||(t={});let s=this.children.filter(y=>y.hasInvalidChild||y.hasInvalidArg);if(s.length===0)return;let a=[],l=[],u=t&&t.select?"select":t.include?"include":void 0;for(let y of s){let w=y.collectErrors(u);a.push(...w.fieldErrors.map(x=>({...x,path:r?x.path:x.path.slice(1)}))),l.push(...w.argErrors.map(x=>({...x,path:r?x.path:x.path.slice(1)})))}let c=this.children[0].name,p=r?this.type:c,d=[],m=[],f=[];for(let y of a){let w=this.normalizePath(y.path,t).join(".");if(y.error.type==="invalidFieldName"){d.push(w);let x=y.error.outputType,{isInclude:E}=y.error;x.fields.filter(C=>E?C.outputType.location==="outputObjectTypes":!0).forEach(C=>{let O=w.split(".");f.push({path:`${O.slice(0,O.length-1).join(".")}.${C.name}`,type:"true",isRequired:!1})})}else y.error.type==="includeAndSelect"?(d.push("select"),d.push("include")):m.push(w);if(y.error.type==="emptySelect"||y.error.type==="noTrueSelect"||y.error.type==="emptyInclude"){let x=this.normalizePath(y.path,t),E=x.slice(0,x.length-1).join(".");y.error.field.outputType.type.fields?.filter(O=>y.error.type==="emptyInclude"?O.outputType.location==="outputObjectTypes":!0).forEach(O=>{f.push({path:`${E}.${O.name}`,type:"true",isRequired:!1})})}}for(let y of l){let w=this.normalizePath(y.path,t).join(".");if(y.error.type==="invalidName")d.push(w);else if(y.error.type!=="missingArg"&&y.error.type!=="atLeastOne")m.push(w);else if(y.error.type==="missingArg"){let x=y.error.missingArg.inputTypes.length===1?y.error.missingArg.inputTypes[0].type:y.error.missingArg.inputTypes.map(E=>{let C=Zt(E.type);return C==="Null"?"null":E.isList?C+"[]":C}).join(" | ");f.push({path:w,type:Ci(x,!0,w.split("where.").length===2),isRequired:y.error.missingArg.isRequired})}}let g=y=>{let w=l.some(J=>J.error.type==="missingArg"&&J.error.missingArg.isRequired),x=Boolean(l.find(J=>J.error.type==="missingArg"&&!J.error.missingArg.isRequired)),E=x||w,C="";w&&(C+=` +${$("Note: Lines with ")}${S("+")} ${$("are required")}`),x&&(C.length===0&&(C=` +`),w?C+=$(`, lines with ${S("?")} are optional`):C+=$(`Note: Lines with ${S("?")} are optional`),C+=$("."));let B=l.filter(J=>J.error.type!=="missingArg"||J.error.missingArg.isRequired).map(J=>this.printArgError(J,E,i==="minimal")).join(` +`);if(B+=` +${a.map(J=>this.printFieldError(J,f,i==="minimal")).join(` +`)}`,i==="minimal")return(0,Qi.default)(B);let k={ast:r?{[c]:t}:t,keyPaths:d,valuePaths:m,missingItems:f};n?.endsWith("aggregate")&&(k=Bd(k));let U=_e({callsite:y,originalMethod:n||p,showColors:i&&i==="pretty",callArguments:an(k),message:`${B}${C} +`});return process.env.NO_COLOR||i==="colorless"?(0,Qi.default)(U):U},b=new Y(g(o));throw process.env.NODE_ENV!=="production"&&Object.defineProperty(b,"render",{get:()=>g,enumerable:!1}),b}normalizePath(t,r){let n=t.slice(),i=[],o,s=r;for(;(o=n.shift())!==void 0;)!Array.isArray(s)&&o===0||(o==="select"?s[o]?s=s[o]:s=s.include:s&&s[o]&&(s=s[o]),i.push(o));return i}},Y=class extends Error{get[Symbol.toStringTag](){return"PrismaClientValidationError"}};ge(Y,"PrismaClientValidationError");var W=class extends Error{constructor(t){super(t+` +Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};ge(W,"PrismaClientConstructorValidationError");var me=class{constructor({name:t,args:r,children:n,error:i,schemaField:o}){this.name=t,this.args=r,this.children=n,this.error=i,this.schemaField=o,this.hasInvalidChild=n?n.some(s=>Boolean(s.error||s.hasInvalidArg||s.hasInvalidChild)):!1,this.hasInvalidArg=r?r.hasInvalidArg:!1}get[Symbol.toStringTag](){return"Field"}toString(){let t=this.name;return this.error?t+" # INVALID_FIELD":(this.args&&this.args.args&&this.args.args.length>0&&(this.args.args.length===1?t+=`(${this.args.toString()})`:t+=`( +${(0,it.default)(this.args.toString(),ur)} +)`),this.children&&(t+=` { +${(0,it.default)(this.children.map(String).join(` +`),ur)} +}`),t)}collectErrors(t="select"){let r=[],n=[];if(this.error&&r.push({path:[this.name],error:this.error}),this.children)for(let i of this.children){let o=i.collectErrors(t);r.push(...o.fieldErrors.map(s=>({...s,path:[this.name,t,...s.path]}))),n.push(...o.argErrors.map(s=>({...s,path:[this.name,t,...s.path]})))}return this.args&&n.push(...this.args.collectErrors().map(i=>({...i,path:[this.name,...i.path]}))),{fieldErrors:r,argErrors:n}}},le=class{constructor(t=[]){this.args=t,this.hasInvalidArg=t?t.some(r=>Boolean(r.hasError)):!1}get[Symbol.toStringTag](){return"Args"}toString(){return this.args.length===0?"":`${this.args.map(t=>t.toString()).filter(t=>t).join(` +`)}`}collectErrors(){return this.hasInvalidArg?this.args.flatMap(t=>t.collectErrors()):[]}};function Vi(e,t){return Buffer.isBuffer(e)?JSON.stringify(e.toString("base64")):e instanceof Ee?`{ _ref: ${JSON.stringify(e.name)}, _container: ${JSON.stringify(e.modelName)}}`:Object.prototype.toString.call(e)==="[object BigInt]"?e.toString():typeof t?.type=="string"&&t.type==="Json"?e===null?"null":e&&e.values&&e.__prismaRawParameters__?JSON.stringify(e.values):t?.isList&&Array.isArray(e)?JSON.stringify(e.map(r=>JSON.stringify(r))):JSON.stringify(JSON.stringify(e)):e===void 0?null:e===null?"null":pe.isDecimal(e)||t?.type==="Decimal"&&ke(e)?JSON.stringify(e.toFixed()):t?.location==="enumTypes"&&typeof e=="string"?Array.isArray(e)?`[${e.join(", ")}]`:e:typeof e=="number"&&t?.type==="Float"?e.toExponential():JSON.stringify(e,null,2)}var ue=class{constructor({key:t,value:r,isEnum:n=!1,error:i,schemaArg:o,inputType:s}){this.inputType=s,this.key=t,this.value=r instanceof z?r._getName():r,this.isEnum=n,this.error=i,this.schemaArg=o,this.isNullable=o?.inputTypes.reduce(a=>a&&o.isNullable,!0)||!1,this.hasError=Boolean(i)||(r instanceof le?r.hasInvalidArg:!1)||Array.isArray(r)&&r.some(a=>a instanceof le?a.hasInvalidArg:a instanceof ue?a.hasError:!1)}get[Symbol.toStringTag](){return"Arg"}_toString(t,r){let n=this.stringifyValue(t);if(!(typeof n>"u"))return`${r}: ${n}`}stringifyValue(t){if(!(typeof t>"u")){if(t instanceof le)return`{ +${(0,it.default)(t.toString(),2)} +}`;if(Array.isArray(t)){if(this.inputType?.type==="Json")return Vi(t,this.inputType);let r=!t.some(n=>typeof n=="object");return`[${r?"":` +`}${(0,it.default)(t.map(n=>n instanceof le?`{ +${(0,it.default)(n.toString(),ur)} +}`:n instanceof ue?n.stringifyValue(n.value):Vi(n,this.inputType)).join(`,${r?" ":` +`}`),r?0:ur)}${r?"":` +`}]`}return Vi(t,this.inputType)}}toString(){return this._toString(this.value,this.key)}collectErrors(){if(!this.hasError)return[];let t=[];if(this.error){let r=typeof this.inputType?.type=="object"?`${this.inputType.type.name}${this.inputType.isList?"[]":""}`:void 0;t.push({error:this.error,path:[this.key],id:r})}return Array.isArray(this.value)?t.concat(this.value.flatMap((r,n)=>r instanceof le?r.collectErrors().map(i=>({...i,path:[this.key,String(n),...i.path]})):r instanceof ue?r.collectErrors().map(i=>({...i,path:[this.key,...i.path]})):[])):this.value instanceof le?t.concat(this.value.collectErrors().map(r=>({...r,path:[this.key,...r.path]}))):t}};function cn({dmmf:e,rootTypeName:t,rootField:r,select:n,modelName:i,extensions:o}){n||(n={});let s=t==="query"?e.queryType:e.mutationType,a={args:[],outputType:{isList:!1,type:s,location:"outputObjectTypes"},name:t},l={modelName:i},u=Ka({dmmf:e,selection:{[r]:n},schemaField:a,path:[t],context:l,extensions:o});return new Ui(t,u)}function Va(e){return e}function Ka({dmmf:e,selection:t,schemaField:r,path:n,context:i,extensions:o}){let s=r.outputType.type,a=i.modelName?o.getAllComputedFields(i.modelName):{};return t=on(t,a),Object.entries(t).reduce((l,[u,c])=>{let p=s.fieldMap?s.fieldMap[u]:s.fields.find(x=>x.name===u);if(!p)return a?.[u]||l.push(new me({name:u,children:[],error:{type:"invalidFieldName",modelName:s.name,providedName:u,didYouMean:Ur(u,s.fields.map(x=>x.name).concat(Object.keys(a??{}))),outputType:s}})),l;if(p.outputType.location==="scalar"&&p.args.length===0&&typeof c!="boolean")return l.push(new me({name:u,children:[],error:{type:"invalidFieldType",modelName:s.name,fieldName:u,providedValue:c}})),l;if(c===!1)return l;let d={name:p.name,fields:p.args,constraints:{minNumFields:null,maxNumFields:null}},m=typeof c=="object"?ka(c,["include","select"]):void 0,f=m?un(m,d,i,[],typeof p=="string"?void 0:p.outputType.type):void 0,g=p.outputType.location==="outputObjectTypes";if(c){if(c.select&&c.include)l.push(new me({name:u,children:[new me({name:"include",args:new le,error:{type:"includeAndSelect",field:p}})]}));else if(c.include){let x=Object.keys(c.include);if(x.length===0)return l.push(new me({name:u,children:[new me({name:"include",args:new le,error:{type:"emptyInclude",field:p}})]})),l;if(p.outputType.location==="outputObjectTypes"){let E=p.outputType.type,C=E.fields.filter(B=>B.outputType.location==="outputObjectTypes").map(B=>B.name),O=x.filter(B=>!C.includes(B));if(O.length>0)return l.push(...O.map(B=>new me({name:B,children:[new me({name:B,args:new le,error:{type:"invalidFieldName",modelName:E.name,outputType:E,providedName:B,didYouMean:Ur(B,C)||void 0,isInclude:!0,isIncludeScalar:E.fields.some(k=>k.name===B)}})]}))),l}}else if(c.select){let x=Object.values(c.select);if(x.length===0)return l.push(new me({name:u,children:[new me({name:"select",args:new le,error:{type:"emptySelect",field:p}})]})),l;if(x.filter(C=>C).length===0)return l.push(new me({name:u,children:[new me({name:"select",args:new le,error:{type:"noTrueSelect",field:p}})]})),l}}let b=g?Dd(e,p.outputType.type):null,y=b;c&&(c.select?y=c.select:c.include?y=ar(b,c.include):c.by&&Array.isArray(c.by)&&p.outputType.namespace==="prisma"&&p.outputType.location==="outputObjectTypes"&&_s(p.outputType.type.name)&&(y=Rd(c.by)));let w;if(y!==!1&&g){let x=i.modelName;typeof p.outputType.type=="object"&&p.outputType.namespace==="model"&&p.outputType.location==="outputObjectTypes"&&(x=p.outputType.type.name),w=Ka({dmmf:e,selection:y,schemaField:p,path:[...n,u],context:{modelName:x},extensions:o})}return l.push(new me({name:u,args:f,children:w,schemaField:p})),l},[])}function Rd(e){let t=Object.create(null);for(let r of e)t[r]=!0;return t}function Dd(e,t){let r=Object.create(null);for(let n of t.fields)e.typeMap[n.outputType.type.name]!==void 0&&(r[n.name]=!0),(n.outputType.location==="scalar"||n.outputType.location==="enumTypes")&&(r[n.name]=!0);return r}function Ji(e,t,r,n){return new ue({key:e,value:t,isEnum:n.location==="enumTypes",inputType:n,error:{type:"invalidType",providedValue:t,argName:e,requiredType:{inputType:r.inputTypes,bestFittingType:n}}})}function Qa(e,t,r){let{isList:n}=t,i=$d(t,r),o=Pt(e,t);return o===i||n&&o==="List<>"||i==="Json"&&o!=="Symbol"&&!(e instanceof z)&&!(e instanceof Ee)||o==="Int"&&i==="BigInt"||(o==="Int"||o==="Float")&&i==="Decimal"||o==="DateTime"&&i==="String"||o==="UUID"&&i==="String"||o==="String"&&i==="ID"||o==="Int"&&i==="Float"||o==="Int"&&i==="Long"||o==="String"&&i==="Decimal"&&kd(e)||e===null?!0:t.isList&&Array.isArray(e)?e.every(s=>Qa(s,{...t,isList:!1},r)):!1}function $d(e,t,r=e.isList){let n=Tt(e.type);return e.location==="fieldRefTypes"&&t.modelName&&(n+=`<${t.modelName}>`),Xt(n,r)}var ln=e=>Da(e,(t,r)=>r!==void 0);function kd(e){return/^\-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i.test(e)}function Id(e,t,r,n){let i=null,o=[];for(let s of r.inputTypes){if(i=_d(e,t,r,s,n),i?.collectErrors().length===0)return i;if(i&&i?.collectErrors()){let a=i?.collectErrors();a&&a.length>0&&o.push({arg:i,errors:a})}}if(i?.hasError&&o.length>0){let s=o.map(({arg:a,errors:l})=>{let u=l.map(c=>{let p=1;return c.error.type==="invalidType"&&(p=2*Math.exp(Ua(c.error.providedValue))+1),p+=Math.log(c.path.length),c.error.type==="missingArg"&&a.inputType&&Ct(a.inputType.type)&&a.inputType.type.name.includes("Unchecked")&&(p*=2),c.error.type==="invalidName"&&Ct(c.error.originalType)&&c.error.originalType.name.includes("Unchecked")&&(p*=2),p});return{score:l.length+Nd(u),arg:a,errors:l}});return s.sort((a,l)=>a.scoret+r,0)}function _d(e,t,r,n,i){if(typeof t>"u")return r.isRequired?new ue({key:e,value:t,isEnum:n.location==="enumTypes",inputType:n,error:{type:"missingArg",missingName:e,missingArg:r,atLeastOne:!1,atMostOne:!1}}):null;let{isNullable:o,isRequired:s}=r;if(t===null&&!o&&!s&&!(Ct(n.type)?n.type.constraints.minNumFields!==null&&n.type.constraints.minNumFields>0:!1))return new ue({key:e,value:t,isEnum:n.location==="enumTypes",inputType:n,error:{type:"invalidNullArg",name:e,invalidType:r.inputTypes,atLeastOne:!1,atMostOne:!1}});if(!n.isList)if(Ct(n.type)){if(typeof t!="object"||Array.isArray(t)||n.location==="inputObjectTypes"&&!$a(t))return Ji(e,t,r,n);{let c=ln(t),p,d=Object.keys(c||{}),m=d.length;return m===0&&typeof n.type.constraints.minNumFields=="number"&&n.type.constraints.minNumFields>0||n.type.constraints.fields?.some(f=>d.includes(f))===!1?p={type:"atLeastOne",key:e,inputType:n.type,atLeastFields:n.type.constraints.fields}:m>1&&typeof n.type.constraints.maxNumFields=="number"&&n.type.constraints.maxNumFields<2&&(p={type:"atMostOne",key:e,inputType:n.type,providedKeys:d}),new ue({key:e,value:c===null?null:un(c,n.type,i,r.inputTypes),isEnum:n.location==="enumTypes",error:p,inputType:n,schemaArg:r})}}else return Ba(e,t,r,n,i);if(!Array.isArray(t)&&n.isList&&e!=="updateMany"&&(t=[t]),n.location==="enumTypes"||n.location==="scalar")return Ba(e,t,r,n,i);let a=n.type,u=(typeof a.constraints?.minNumFields=="number"&&a.constraints?.minNumFields>0?Array.isArray(t)&&t.some(c=>!c||Object.keys(ln(c)).length===0):!1)?{inputType:a,key:e,type:"atLeastOne"}:void 0;if(!u){let c=typeof a.constraints?.maxNumFields=="number"&&a.constraints?.maxNumFields<2?Array.isArray(t)&&t.find(p=>!p||Object.keys(ln(p)).length!==1):!1;c&&(u={inputType:a,key:e,type:"atMostOne",providedKeys:Object.keys(c)})}if(!Array.isArray(t))for(let c of r.inputTypes){let p=un(t,c.type,i);if(p.collectErrors().length===0)return new ue({key:e,value:p,isEnum:!1,schemaArg:r,inputType:c})}return new ue({key:e,value:t.map((c,p)=>n.isList&&typeof c!="object"?c:typeof c!="object"||!t||Array.isArray(c)?Ji(String(p),c,jd(r),Ld(n)):un(c,a,i)),isEnum:!1,inputType:n,schemaArg:r,error:u})}function Ld(e){return{...e,isList:!1}}function jd(e){return{...e,inputTypes:e.inputTypes.filter(t=>!t.isList)}}function Ct(e){return!(typeof e=="string"||Object.hasOwnProperty.call(e,"values"))}function Ba(e,t,r,n,i){return de(t)&&!$e(t)?new ue({key:e,value:t,schemaArg:r,inputType:n,error:{type:"invalidDateArg",argName:e}}):Qa(t,n,i)?new ue({key:e,value:t,isEnum:n.location==="enumTypes",schemaArg:r,inputType:n}):Ji(e,t,r,n)}function un(e,t,r,n,i){t.meta?.source&&(r={modelName:t.meta.source});let o=ln(e),{fields:s,fieldMap:a}=t,l=s.map(d=>[d.name,void 0]),u=Object.entries(o||{}),p=Ns(u,l,d=>d[0]).reduce((d,[m,f])=>{let g=a?a[m]:s.find(y=>y.name===m);if(!g){let y=typeof f=="boolean"&&i&&i.fields.some(w=>w.name===m)?m:null;return d.push(new ue({key:m,value:f,error:{type:"invalidName",providedName:m,providedValue:f,didYouMeanField:y,didYouMeanArg:!y&&Ur(m,[...s.map(w=>w.name),"select"])||void 0,originalType:t,possibilities:n,outputType:i}})),d}let b=Id(m,f,g,r);return b&&d.push(b),d},[]);if(typeof t.constraints.minNumFields=="number"&&u.lengthd.error?.type==="missingArg"||d.error?.type==="atLeastOne")){let d=t.fields.filter(m=>!m.isRequired&&o&&(typeof o[m.name]>"u"||o[m.name]===null));p.push(...d.map(m=>{let f=m.inputTypes[0];return new ue({key:m.name,value:void 0,isEnum:f.location==="enumTypes",error:{type:"missingArg",missingName:m.name,missingArg:m,atLeastOne:Boolean(t.constraints.minNumFields)||!1,atMostOne:t.constraints.maxNumFields===1||!1},inputType:f})}))}return new le(p)}function pn({document:e,path:t,data:r}){let n=sr(r,t);if(n==="undefined")return null;if(typeof n!="object")return n;let i=qd(e,t);return Gi({field:i,data:n})}function Gi({field:e,data:t}){if(!t||typeof t!="object"||!e.children||!e.schemaField)return t;let r={DateTime:n=>new Date(n),Json:n=>JSON.parse(n),Bytes:n=>Buffer.from(n,"base64"),Decimal:n=>new pe(n),BigInt:n=>BigInt(n)};for(let n of e.children){let i=n.schemaField?.outputType.type;if(i&&typeof i=="string"){let o=r[i];if(o)if(Array.isArray(t))for(let s of t)typeof s[n.name]<"u"&&s[n.name]!==null&&(Array.isArray(s[n.name])?s[n.name]=s[n.name].map(o):s[n.name]=o(s[n.name]));else typeof t[n.name]<"u"&&t[n.name]!==null&&(Array.isArray(t[n.name])?t[n.name]=t[n.name].map(o):t[n.name]=o(t[n.name]))}if(n.schemaField&&n.schemaField.outputType.location==="outputObjectTypes")if(Array.isArray(t))for(let o of t)Gi({field:n,data:o[n.name]});else Gi({field:n,data:t[n.name]})}return t}function qd(e,t){let r=t.slice(),n=r.shift(),i=e.children.find(o=>o.name===n);if(!i)throw new Error(`Could not find field ${n} in document ${e}`);for(;r.length>0;){let o=r.shift();if(!i.children)throw new Error(`Can't get children for field ${i} with child ${o}`);let s=i.children.find(a=>a.name===o);if(!s)throw new Error(`Can't find child ${o} of field ${i}`);i=s}return i}function Ki(e){return e.split(".").filter(t=>t!=="select").join(".")}function Wi(e){if(Object.prototype.toString.call(e)==="[object Object]"){let r={};for(let n in e)if(n==="select")for(let i in e.select)r[i]=Wi(e.select[i]);else r[n]=Wi(e[n]);return r}return e}function Bd({ast:e,keyPaths:t,missingItems:r,valuePaths:n}){let i=t.map(Ki),o=n.map(Ki),s=r.map(l=>({path:Ki(l.path),isRequired:l.isRequired,type:l.type}));return{ast:Wi(e),keyPaths:i,missingItems:s,valuePaths:o}}var dn=Ja().version;var Pe=class extends ie{constructor(t){super(t,{code:"P2025",clientVersion:dn}),this.name="NotFoundError"}};ge(Pe,"NotFoundError");function Hi(e,t,r,n){let i;if(r&&typeof r=="object"&&"rejectOnNotFound"in r&&r.rejectOnNotFound!==void 0)i=r.rejectOnNotFound,delete r.rejectOnNotFound;else if(typeof n=="boolean")i=n;else if(n&&typeof n=="object"&&e in n){let o=n[e];if(o&&typeof o=="object")return t in o?o[t]:void 0;i=Hi(e,t,r,o)}else typeof n=="function"?i=n:i=!1;return i}var Kd=/(findUnique|findFirst)/;function Ga(e,t,r,n){if(r??(r="record"),n&&!e&&Kd.exec(t))throw typeof n=="boolean"&&n?new Pe(`No ${r} found`):typeof n=="function"?n(new Pe(`No ${r} found`)):It(n)?n:new Pe(`No ${r} found`)}function Wa(e,t,r){return e===we.ModelAction.findFirstOrThrow||e===we.ModelAction.findUniqueOrThrow?Qd(t,r):r}function Qd(e,t){return async r=>{if("rejectOnNotFound"in r.args){let i=_e({originalMethod:r.clientMethod,callsite:r.callsite,message:"'rejectOnNotFound' option is not supported"});throw new Y(i)}return await t(r).catch(i=>{throw i instanceof ie&&i.code==="P2025"?new Pe(`No ${e} found`):i})}}var Ud=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Jd=["aggregate","count","groupBy"];function zi(e,t){let r=[Wd(e,t),Gd(t)];e._engineConfig.previewFeatures?.includes("fieldReference")&&r.push(zd(e,t));let n=e._extensions.getAllModelExtensions(t);return n&&r.push(tr(n)),Ne({},r)}function Gd(e){return Ce("name",()=>e)}function Wd(e,t){let r=Te(t),n=Object.keys(we.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=l=>e._request(l);s=Wa(o,t,s);let a=l=>u=>{let c=Ye(e._errorFormat);return e._createPrismaPromise(p=>{let d={args:u,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:p,callsite:c};return s({...d,...l})})};return Ud.includes(o)?Li(e,t,a):Hd(i)?ha(e,i,a):a({})}}}function Hd(e){return Jd.includes(e)}function zd(e,t){return nt(Ce("fields",()=>{let r=e._runtimeDataModel.models[t];return ba(t,r)}))}function Ha(e){return e.replace(/^./,t=>t.toUpperCase())}var Yi=Symbol();function cr(e){let t=[Yd(e),Ce(Yi,()=>e)],r=e._extensions.getAllClientExtensions();return r&&t.push(tr(r)),Ne(e,t)}function Yd(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(Te),n=[...new Set(t.concat(r))];return nt({getKeys(){return n},getPropertyValue(i){let o=Ha(i);if(e._runtimeDataModel.models[o]!==void 0)return zi(e,o);if(e._runtimeDataModel.models[i]!==void 0)return zi(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function mn(e){return e[Yi]?e[Yi]:e}function za(e){if(typeof e=="function")return e(this);let t=mn(this),r=Object.create(t,{_extensions:{value:this._extensions.append(e)},$use:{value:void 0},$on:{value:void 0}});return cr(r)}function Ya(e){if(e instanceof ee)return Zd(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n{let o=t.customDataProxyFetch;return"transaction"in t&&i!==void 0&&(t.transaction?.kind==="batch"&&t.transaction.lock.then(),t.transaction=i),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:Ya(t.args??{}),__internalParams:t,query:(s,a=t)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=nl(o,l),a.args=s,Xa(e,a,r,n+1)}})})}function el(e,t){let{jsModelName:r,action:n,clientMethod:i}=t,o=r?n:i;if(e._extensions.isEmpty())return e._executeRequest(t);let s=e._extensions.getAllQueryCallbacks(r??"$none",o);return Xa(e,t,s)}function tl(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?rl(r,n,0,e):e(r)}}function rl(e,t,r,n){if(r===t.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let l=a.customDataProxyFetch;return a.customDataProxyFetch=nl(i,l),rl(a,t,r+1,n)}})}var Za=e=>e;function nl(e=Za,t=Za){return r=>e(t(r))}var fn=class{constructor(t,r){this.extension=t;this.previous=r;this.computedFieldsCache=new Ie;this.modelExtensionsCache=new Ie;this.queryCallbacksCache=new Ie;this.clientExtensions=Jt(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());this.batchCallbacks=Jt(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t})}getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>Ea(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=Te(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(t):{...this.previous?.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{let n=this.previous?.getAllQueryCallbacks(t,r)??[],i=[],o=this.extension.query;return!o||!(o[t]||o.$allModels||o[r]||o.$allOperations)?n:(o[t]!==void 0&&(o[t][r]!==void 0&&i.push(o[t][r]),o[t].$allOperations!==void 0&&i.push(o[t].$allOperations)),t!=="$none"&&o.$allModels!==void 0&&(o.$allModels[r]!==void 0&&i.push(o.$allModels[r]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[r]!==void 0&&i.push(o[r]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},Ze=class{constructor(t){this.head=t}static empty(){return new Ze}static single(t){return new Ze(new fn(t))}isEmpty(){return this.head===void 0}append(t){return new Ze(new fn(t,this.head))}getAllComputedFields(t){return this.head?.getAllComputedFields(t)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(t){return this.head?.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){return this.head?.getAllQueryCallbacks(t,r)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};var il=V("prisma:client"),ol={Vercel:"vercel","Netlify CI":"netlify"};function sl({postinstall:e,ciName:t,clientVersion:r}){if(il("checkPlatformCaching:postinstall",e),il("checkPlatformCaching:ciName",t),e===!0&&t&&t in ol){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process. + +Learn how: https://pris.ly/d/${ol[t]}-build`;throw console.error(n),new Q(n,r)}}var Xd={findUnique:"query",findUniqueOrThrow:"query",findFirst:"query",findFirstOrThrow:"query",findMany:"query",count:"query",create:"mutation",createMany:"mutation",update:"mutation",updateMany:"mutation",upsert:"mutation",delete:"mutation",deleteMany:"mutation",executeRaw:"mutation",queryRaw:"mutation",aggregate:"query",groupBy:"query",runCommandRaw:"mutation",findRaw:"query",aggregateRaw:"query"},gn=class{constructor(t,r){this.dmmf=t;this.errorFormat=r}createMessage({action:t,modelName:r,args:n,extensions:i,clientMethod:o,callsite:s}){let a,l=Xd[t];(t==="executeRaw"||t==="queryRaw"||t==="runCommandRaw")&&(a=t);let u;if(r!==void 0){if(u=this.dmmf?.mappingsMap[r],u===void 0)throw new Error(`Could not find mapping for model ${r}`);if(a=u[t==="count"?"aggregate":t],!a){let d=_e({message:`Model \`${r}\` does not support \`${t}\` action.`,originalMethod:o,callsite:s});throw new Y(d)}}if(l!=="query"&&l!=="mutation")throw new Error(`Invalid operation ${l} for action ${t}`);if(this.dmmf?.rootFieldMap[a]===void 0)throw new Error(`Could not find rootField ${a} for action ${t} for model ${r} on rootType ${l}`);let p=cn({dmmf:this.dmmf,rootField:a,rootTypeName:l,select:n,modelName:r,extensions:i});return p.validate(n,!1,o,this.errorFormat,s),new Zi(p)}createBatch(t){return t.map(r=>r.toEngineQuery())}},Zi=class{constructor(t){this.document=t}isWrite(){return this.document.type==="mutation"}getBatchId(){if(!this.getRootField().startsWith("findUnique"))return;let t=this.document.children[0].args?.args.map(n=>n.value instanceof le?`${n.key}-${n.value.args.map(i=>i.key).join(",")}`:n.key).join(","),r=this.document.children[0].children.join(",");return`${this.document.children[0].name}|${t}|${r}`}toDebugString(){return String(this.document)}toEngineQuery(){return{query:String(this.document),variables:{}}}deserializeResponse(t,r){let n=this.getRootField(),i=[];return n&&i.push(n),i.push(...r.filter(o=>o!=="select"&&o!=="include")),pn({document:this.document,path:i,data:t})}getRootField(){return this.document.children[0].name}};function yn(e){return e===null?e:Array.isArray(e)?e.map(yn):typeof e=="object"?em(e)?tm(e):gt(e,yn):e}function em(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function tm({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":return Buffer.from(t,"base64");case"DateTime":return new Date(t);case"Decimal":return new pe(t);case"Json":return JSON.parse(t);default:Me(t,"Unknown tagged value")}}var hn=class{constructor(t=0,r){this.context=r;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=t}write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r){let n=r.length-1;for(let i=0;i0&&this.currentIndent--,this}addMarginSymbol(t){return this.marginSymbol=t,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` +`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};var ml=F(Kr());function ul(e,t){let r=cl(e),n=rm(r),i=nm(n);i?bn(i,t):t.addErrorMessage(()=>"Unknown error")}function cl(e){return e.errors.flatMap(t=>t.kind==="Union"?cl(t):[t])}function rm(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=t.get(i);o?t.set(i,{...n,argument:{...n.argument,typeNames:o.argument.typeNames.concat(n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function nm(e){return gi(e,(t,r)=>{let n=al(t),i=al(r);return n!==i?n-i:ll(t)-ll(r)})}function al(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function ll(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;default:return 0}}var Be=class{constructor(t,r){this.name=t;this.value=r;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(t){let{colors:{green:r}}=t.context;t.addMarginSymbol(r(this.isRequired?"+":"?")),t.write(r(this.name)),this.isRequired||t.write(r("?")),t.write(r(": ")),typeof this.value=="string"?t.write(r(this.value)):t.write(this.value)}};var xn=e=>e,pl={bold:xn,red:xn,green:xn,dim:xn},dl={bold:v,red:R,green:S,dim:$},Ft={write(e){e.writeLine(",")}};var Le=class{constructor(t){this.contents=t;this.isUnderlined=!1;this.color=t=>t}underline(){return this.isUnderlined=!0,this}setColor(t){return this.color=t,this}write(t){let r=t.getCurrentLineLength();t.write(this.color(this.contents)),this.isUnderlined&&t.afterNextNewline(()=>{t.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length)))})}};var Xe=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var K=class extends Xe{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(r){this.fields[r.name]=r}addSuggestion(r){this.suggestions.push(r)}getField(r){return this.fields[r]}getDeepField(r){let[n,...i]=r,o=this.getField(n);if(!o)return;let s=o;for(let a of i){if(!(s.value instanceof K))return;let l=s.value.getField(a);if(!l)return;s=l}return s}getDeepFieldValue(r){return r.length===0?this:this.getDeepField(r)?.value}hasField(r){return Boolean(this.getField(r))}removeAllFields(){this.fields={}}removeField(r){delete this.fields[r]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(r){return this.getField(r)?.value}getDeepSubSelectionValue(r){let n=this;for(let i of r){if(!(n instanceof K))return;let o=n.getSubSelectionValue(i);if(!o)return;n=o}return n}getDeepSelectionParent(r){let n=this.getSelectionParent();if(!n)return;let i=n;for(let o of r){let s=i.value.getFieldValue(o);if(!s||!(s instanceof K))return;let a=s.getSelectionParent();if(!a)return;i=a}return i}getSelectionParent(){let r=this.getField("select");if(r?.value instanceof K)return{kind:"select",value:r.value};let n=this.getField("include");if(n?.value instanceof K)return{kind:"include",value:n.value}}getSubSelectionValue(r){return this.getSelectionParent()?.value.fields[r].value}getPrintWidth(){let r=Object.values(this.fields);return r.length==0?2:Math.max(...r.map(i=>i.getPrintWidth()))+2}write(r){let n=Object.values(this.fields);if(n.length===0&&this.suggestions.length===0){this.writeEmpty(r);return}this.writeWithContents(r,n)}writeEmpty(r){let n=new Le("{}");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithContents(r,n){r.writeLine("{").withIndent(()=>{r.writeJoined(Ft,[...n,...this.suggestions]).newLine()}),r.write("}"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(r.context.colors.red("~".repeat(this.getPrintWidth())))})}};var te=class extends Xe{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new Le(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}};var wn=class{constructor(){this.fields=[]}addField(t,r){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${t}: ${r}`))).addMarginSymbol(i(o("+")))}}),this}write(t){let{colors:{green:r}}=t.context;t.writeLine(r("{")).withIndent(()=>{t.writeJoined(Ft,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function bn(e,t){switch(e.kind){case"IncludeAndSelect":om(e,t);break;case"IncludeOnScalar":sm(e,t);break;case"EmptySelection":am(e,t);break;case"UnknownSelectionField":lm(e,t);break;case"UnknownArgument":um(e,t);break;case"UnknownInputField":cm(e,t);break;case"RequiredArgumentMissing":pm(e,t);break;case"InvalidArgumentType":dm(e,t);break;case"InvalidArgumentValue":mm(e,t);break;case"ValueTooLarge":fm(e,t);break;case"SomeFieldsMissing":gm(e,t);break;case"TooManyFieldsGiven":ym(e,t);break;case"Union":ul(e,t);break;default:throw new Error("not implemented: "+e.kind)}}function om(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath);r&&r instanceof K&&(r.getField("include")?.markAsError(),r.getField("select")?.markAsError()),t.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green("`include`")} or ${n.green("`select`")}, but ${n.red("not both")} at the same time.`)}function sm(e,t){let[r,n]=En(e.selectionPath),i=e.outputType,o=t.arguments.getDeepSelectionParent(r)?.value;if(o&&(o.getField(n)?.markAsError(),i))for(let s of i.fields)s.isRelation&&o.addSuggestion(new Be(s.name,"true"));t.addErrorMessage(s=>{let a=`Invalid scalar field ${s.red(`\`${n}\``)} for ${s.bold("include")} statement`;return i?a+=` on model ${s.bold(i.name)}. ${dr(s)}`:a+=".",a+=` +Note that ${s.bold("include")} statements only accept relation fields.`,a})}function am(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),yl(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${dr(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function lm(e,t){let[r,n]=En(e.selectionPath),i=t.arguments.getDeepSelectionParent(r);i&&(i.value.getField(n)?.markAsError(),yl(i.value,e.outputType)),t.addErrorMessage(o=>{let s=[`Unknown field ${o.red(`\`${n}\``)}`];return i&&s.push(`for ${o.bold(i.kind)} statement`),s.push(`on model ${o.bold(`\`${e.outputType.name}\``)}.`),s.push(dr(o)),s.join(" ")})}function um(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath);n instanceof K&&(n.getField(r)?.markAsError(),hm(n,e.arguments)),t.addErrorMessage(i=>fl(i,r,e.arguments.map(o=>o.name)))}function cm(e,t){let[r,n]=En(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath);if(i instanceof K){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r);o instanceof K&&hl(o,e.inputType)}t.addErrorMessage(o=>fl(o,n,e.inputType.fields.map(s=>s.name)))}function fl(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=xm(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(dr(e)),n.join(" ")}function pm(e,t){let r;t.addErrorMessage(l=>r?.value instanceof te&&r.value.text==="null"?`Argument \`${l.green(o)}\` must not be ${l.red("null")}.`:`Argument \`${l.green(o)}\` is missing.`);let n=t.arguments.getDeepSubSelectionValue(e.selectionPath);if(!(n instanceof K))return;let[i,o]=En(e.argumentPath),s=new wn,a=n.getDeepFieldValue(i);if(a instanceof K)if(r=a.getField(o),r&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let l of e.inputTypes[0].fields)s.addField(l.name,l.typeNames.join(" | "));a.addSuggestion(new Be(o,s).makeRequired())}else{let l=e.inputTypes.map(gl).join(" | ");a.addSuggestion(new Be(o,l).makeRequired())}}function gl(e){return e.kind==="list"?`${gl(e.elementType)}[]`:e.name}function dm(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath);n instanceof K&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=Tn("or",e.argument.typeNames.map(s=>i.green(s)));return`Argument \`${i.bold(r)}\`: Invalid value provided. Expected ${o}, provided ${i.red(e.inferredType)}.`})}function mm(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath);n instanceof K&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=Tn("or",e.argument.typeNames.map(a=>i.green(a))),s=[`Invalid value for argument \`${i.bold(r)}\``];return e.underlyingError&&s.push(`: ${e.underlyingError}`),s.push(`. Expected ${o}.`),s.join("")})}function fm(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath),i;if(n instanceof K){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof te&&(i=s.text)}t.addErrorMessage(o=>{let s=["Unable to fit value"];return i&&s.push(o.red(i)),s.push(`into a 64-bit signed integer for field \`${o.bold(r)}\``),s.join(" ")})}function gm(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath);if(n instanceof K){let i=n.getDeepFieldValue(e.argumentPath);i instanceof K&&hl(i,e.inputType)}t.addErrorMessage(i=>{let o=[`Argument \`${i.bold(r)}\` of type ${i.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?o.push(`${i.green("at least one of")} ${Tn("or",e.constraints.requiredFields.map(s=>`\`${i.bold(s)}\``))} arguments.`):o.push(`${i.green("at least one")} argument.`):o.push(`${i.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),o.push(dr(i)),o.join(" ")})}function ym(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath),i=[];if(n instanceof K){let o=n.getDeepFieldValue(e.argumentPath);o instanceof K&&(o.markAsError(),i=Object.keys(o.getFields()))}t.addErrorMessage(o=>{let s=[`Argument \`${o.bold(r)}\` of type ${o.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?s.push(`${o.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?s.push(`${o.green("at most one")} argument,`):s.push(`${o.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),s.push(`but you provided ${Tn("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function yl(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new Be(r.name,"true"))}function hm(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new Be(r.name,r.typeNames.join(" | ")))}function hl(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new Be(r.name,r.typeNames.join(" | ")))}function En(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function dr({green:e}){return`Available options are listed in ${e("green")}.`}function Tn(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var bm=3;function xm(e,t){let r=1/0,n;for(let i of t){let o=(0,ml.default)(e,i);o>bm||on.getPrintWidth()))+2}write(r){if(this.items.length===0){this.writeEmpty(r);return}this.writeWithItems(r)}writeEmpty(r){let n=new Le("[]");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithItems(r){let{colors:n}=r.context;r.writeLine("[").withIndent(()=>r.writeJoined(Ft,this.items).newLine()).write("]"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(n.red("~".repeat(this.getPrintWidth())))})}};var bl=": ",Mn=class{constructor(t,r){this.name=t;this.value=r;this.hasError=!1}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+bl.length}write(t){let r=new Le(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(bl).write(this.value)}};var Xi=class{constructor(t){this.errorMessages=[];this.arguments=t}write(t){t.write(this.arguments)}addErrorMessage(t){this.errorMessages.push(t)}renderAllMessages(t){return this.errorMessages.map(r=>r(t)).join(` +`)}};function xl(e){return new Xi(wl(e))}function wl(e){let t=new K;for(let[r,n]of Object.entries(e)){let i=new Mn(r,El(n));t.addField(i)}return t}function El(e){if(typeof e=="string")return new te(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new te(String(e));if(typeof e=="bigint")return new te(`${e}n`);if(e===null)return new te("null");if(e===void 0)return new te("undefined");if(ke(e))return new te(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return Buffer.isBuffer(e)?new te(`Buffer.alloc(${e.byteLength})`):new te(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=$e(e)?e.toISOString():"Invalid Date";return new te(`new Date("${t}")`)}if(e instanceof z)return new te(`Prisma.${e._getName()}`);if(xt(e))return new te(`prisma.${vt(e.modelName)}.$fields.${e.name}`);if(Array.isArray(e))return wm(e);if(typeof e=="object")return wl(e);Me(e,"Unknown value type")}function wm(e){let t=new Pn;for(let r of e)t.addItem(El(r));return t}function vn({args:e,errors:t,errorFormat:r,callsite:n,originalMethod:i}){let o=xl(e);for(let c of t)bn(c,o);let s=r==="pretty"?dl:pl,a=o.renderAllMessages(s),l=new hn(0,{colors:s}).write(o).toString(),u=_e({message:a,callsite:n,originalMethod:i,showColors:r==="pretty",callArguments:l});throw new Y(u)}var Em={findUnique:"findUnique",findUniqueOrThrow:"findUniqueOrThrow",findFirst:"findFirst",findFirstOrThrow:"findFirstOrThrow",findMany:"findMany",count:"aggregate",create:"createOne",createMany:"createMany",update:"updateOne",updateMany:"updateMany",upsert:"upsertOne",delete:"deleteOne",deleteMany:"deleteMany",executeRaw:"executeRaw",queryRaw:"queryRaw",aggregate:"aggregate",groupBy:"groupBy",runCommandRaw:"runCommandRaw",findRaw:"findRaw",aggregateRaw:"aggregateRaw"};function Tl({modelName:e,action:t,args:r,runtimeDataModel:n,extensions:i,callsite:o,clientMethod:s,errorFormat:a}){let l=new St({runtimeDataModel:n,modelName:e,action:t,rootArgs:r,callsite:o,extensions:i,selectionPath:[],argumentPath:[],originalMethod:s,errorFormat:a});return{modelName:e,action:Em[t],query:eo(r,l)}}function eo({select:e,include:t,...r}={},n){return{arguments:Ml(r,n),selection:Tm(e,t,n)}}function Tm(e,t,r){return e&&t&&r.throwValidationError({kind:"IncludeAndSelect",selectionPath:r.getSelectionPath()}),e?vm(e,r):Pm(r,t)}function Pm(e,t){let r={};return e.model&&!e.isRawAction()&&(r.$composites=!0,r.$scalars=!0),t&&Mm(r,t,e),r}function Mm(e,t,r){for(let[n,i]of Object.entries(t)){let o=r.findField(n);o&&o?.kind!=="object"&&r.throwValidationError({kind:"IncludeOnScalar",selectionPath:r.getSelectionPath().concat(n),outputType:r.getOutputTypeDescription()}),i===!0?e[n]=!0:typeof i=="object"&&(e[n]=eo(i,r.nestSelection(n)))}}function vm(e,t){let r={},n=t.getComputedFields(),i=on(e,n);for(let[o,s]of Object.entries(i)){let a=t.findField(o);n?.[o]&&!a||(s===!0?r[o]=!0:typeof s=="object"&&(r[o]=eo(s,t.nestSelection(o))))}return r}function Pl(e,t){if(e===null)return null;if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="bigint")return{$type:"BigInt",value:String(e)};if(de(e)){if($e(e))return{$type:"DateTime",value:e.toISOString()};t.throwValidationError({kind:"InvalidArgumentValue",selectionPath:t.getSelectionPath(),argumentPath:t.getArgumentPath(),argument:{name:t.getArgumentName(),typeNames:["Date"]},underlyingError:"Provided Date object is invalid"})}if(xt(e))return{$type:"FieldRef",value:{_ref:e.name,_container:e.modelName}};if(Array.isArray(e))return Am(e,t);if(ArrayBuffer.isView(e))return{$type:"Bytes",value:Buffer.from(e).toString("base64")};if(Cm(e))return e.values;if(ke(e))return{$type:"Decimal",value:e.toFixed()};if(e instanceof z){if(e!==wt.instances[e._getName()])throw new Error("Invalid ObjectEnumValue");return{$type:"Enum",value:e._getName()}}if(typeof e=="object")return Ml(e,t);Me(e,"Unknown value type")}function Ml(e,t){if(e.$type)return{$type:"Json",value:JSON.stringify(e)};let r={};for(let n in e){let i=e[n];i!==void 0&&(r[n]=Pl(i,t.nestArgument(n)))}return r}function Am(e,t){let r=[];for(let n=0;n({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}getComputedFields(){if(!!this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){return this.model?.fields.find(r=>r.name===t)}nestSelection(t){let r=this.findField(t),n=r?.kind==="object"?r.type:void 0;return new St({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}nestArgument(t){return new St({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};var mr=class{constructor(t,r){this.runtimeDataModel=t;this.errorFormat=r}createMessage(t){let r=Tl({...t,runtimeDataModel:this.runtimeDataModel,errorFormat:this.errorFormat});return new An(r)}createBatch(t){return t.map(r=>r.toEngineQuery())}},Fm={aggregate:!1,aggregateRaw:!1,createMany:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0},An=class{constructor(t){this.query=t}isWrite(){return Fm[this.query.action]}getBatchId(){if(this.query.action!=="findUnique"&&this.query.action!=="findUniqueOrThrow")return;let t=[];return this.query.modelName&&t.push(this.query.modelName),this.query.query.arguments&&t.push(to(this.query.query.arguments)),t.push(to(this.query.query.selection)),t.join("")}toDebugString(){return JSON.stringify(this.query,null,2)}toEngineQuery(){return this.query}deserializeResponse(t,r){if(!t)return t;let n=Object.values(t)[0],i=r.filter(o=>o!=="select"&&o!=="include");return yn(sr(n,i))}};function to(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${to(n)})`:r}).join(" ")})`}var vl=e=>({command:e});var Al=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);function fr(e){try{return Cl(e,"fast")}catch{return Cl(e,"slow")}}function Cl(e,t){return JSON.stringify(e.map(r=>Sm(r,t)))}function Sm(e,t){return typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:de(e)?{prisma__type:"date",prisma__value:e.toJSON()}:pe.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:Buffer.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:Om(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:Buffer.from(e).toString("base64")}:typeof e=="object"&&t==="slow"?Sl(e):e}function Om(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Sl(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Fl);let t={};for(let r of Object.keys(e))t[r]=Fl(e[r]);return t}function Fl(e){return typeof e=="bigint"?e.toString():Sl(e)}var Rm=/^(\s*alter\s)/i,Ol=V("prisma:client");function ro(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&Rm.exec(t))throw new Error(`Running ALTER using ${n} is not supported +Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization. + +Example: + await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`) + +More Information: https://pris.ly/d/execute-raw +`)}var no=(e,t)=>r=>{let n="",i;if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:fr(s||[]),__prismaRawParameters__:!0}}else switch(e){case"sqlite":case"mysql":{n=r.sql,i={values:fr(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":{n=r.text,i={values:fr(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=Al(r),i={values:fr(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${e} provider does not support ${t}`)}return i?.values?Ol(`prisma.${t}(${n}, ${i.values})`):Ol(`prisma.${t}(${n})`),{query:n,parameters:i}},Rl={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new ee(t,r)}},Dl={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};function io(e){return function(r){let n,i=(o=e)=>{try{return o===void 0||o?.kind==="itx"?n??(n=$l(r(o))):$l(r(o))}catch(s){return Promise.reject(s)}};return{then(o,s){return i().then(o,s)},catch(o){return i().catch(o)},finally(o){return i().finally(o)},requestTransaction(o){let s=i(o);return s.requestTransaction?s.requestTransaction(o):s},[Symbol.toStringTag]:"PrismaPromise"}}}function $l(e){return typeof e.then=="function"?e:Promise.resolve(e)}var kl={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,t){return t()}},oo=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}createEngineSpan(t){return this.getGlobalTracingHelper().createEngineSpan(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){return globalThis.PRISMA_INSTRUMENTATION?.helper??kl}};function Il(e){return e.includes("tracing")?new oo:kl}function Nl(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}function _l(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}var Dm=["$connect","$disconnect","$on","$transaction","$use","$extends"],Ll=Dm;function ql(e,t,r){let n=jl(e,r),i=jl(t,r),o=Object.values(i).map(a=>a[a.length-1]),s=Object.keys(i);return Object.entries(n).forEach(([a,l])=>{s.includes(a)||o.push(l[l.length-1])}),o}var jl=(e,t)=>e.reduce((r,n)=>{let i=t(n);return r[i]||(r[i]=[]),r[i].push(n),r},{});var Cn=class{constructor(){this._middlewares=[]}use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};var Kl=F(Kt());function Fn(e){return typeof e.batchRequestIdx=="number"}function Bl({result:e,modelName:t,select:r,extensions:n}){let i=n.getAllComputedFields(t);if(!i)return e;let o=[],s=[];for(let a of Object.values(i)){if(r){if(!r[a.name])continue;let l=a.needs.filter(u=>!r[u]);l.length>0&&s.push(rr(l))}$m(e,a.needs)&&o.push(km(a,Ne(e,o)))}return o.length>0||s.length>0?Ne(e,[...o,...s]):e}function $m(e,t){return t.every(r=>mi(e,r))}function km(e,t){return nt(Ce(e.name,()=>e.compute(t)))}function Sn({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;sc.name===o);if(!l||l.kind!=="object"||!l.relationName)continue;let u=typeof s=="object"?s:{};t[o]=Sn({visitor:i,result:t[o],args:u,modelName:l.type,runtimeDataModel:n})}}var On=class{constructor(t){this.options=t;this.tickActive=!1;this.batches={}}request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,process.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i{for(let i=0;i{let{transaction:o,protocolEncoder:s,otelParentCtx:a}=n[0],l=s.createBatch(n.map(d=>d.protocolMessage)),u=this.client._tracingHelper.getTraceParent(a),c=n.some(d=>d.protocolMessage.isWrite());return(await this.client._engine.requestBatch(l,{traceparent:u,transaction:Nm(o),containsWrite:c,customDataProxyFetch:i})).map((d,m)=>{if(d instanceof Error)return d;try{return this.mapQueryEngineResult(n[m],d)}catch(f){return f}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?Ql(n.transaction):void 0,o=await this.client._engine.request(n.protocolMessage.toEngineQuery(),{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:n.protocolMessage.isWrite(),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:n.protocolMessage.getBatchId(),batchOrder(n,i){return n.transaction?.kind==="batch"&&i.transaction?.kind==="batch"?n.transaction.index-i.transaction.index:0}})}async request(t){try{let r=await this.dataloader.request(t);return Ga(r,t.clientMethod,t.modelName,t.rejectOnNotFound),r}catch(r){let{clientMethod:n,callsite:i,transaction:o,args:s}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s})}}mapQueryEngineResult({protocolMessage:t,dataPath:r,unpacker:n,modelName:i,args:o,extensions:s},a){let l=a?.data,u=a?.elapsed,c=this.unpack(t,l,r,n);return i&&(c=this.applyResultExtensions({result:c,modelName:i,args:o,extensions:s})),process.env.PRISMA_CLIENT_GET_TIME?{data:c,elapsed:u}:c}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:o}){if(Im(t),_m(t,i)||t instanceof Pe)throw t;if(t instanceof ie&&Lm(t)){let a=Ul(t.meta);vn({args:o,errors:[a],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r})}let s=t.message;throw n&&(s=_e({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:s})),s=this.sanitizeMessage(s),t.code?new ie(s,{code:t.code,clientVersion:this.client._clientVersion,meta:t.meta,batchRequestIdx:t.batchRequestIdx}):t.isPanic?new be(s,this.client._clientVersion):t instanceof oe?new oe(s,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx}):t instanceof Q?new Q(s,this.client._clientVersion):t instanceof be?new be(s,this.client._clientVersion):(t.clientVersion=this.client._clientVersion,t)}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,Kl.default)(t):t}unpack(t,r,n,i){if(!r)return r;r.data&&(r=r.data);let o=t.deserializeResponse(r,n);return i?i(o):o}applyResultExtensions({result:t,modelName:r,args:n,extensions:i}){return i.isEmpty()||t==null||!this.client._runtimeDataModel.models[r]?t:Sn({result:t,args:n??{},modelName:r,runtimeDataModel:this.client._runtimeDataModel,visitor(s,a,l){let u=Te(a);return Bl({result:s,modelName:u,select:l.select,extensions:i})}})}get[Symbol.toStringTag](){return"RequestHandler"}};function Nm(e){if(!!e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Ql(e)};Me(e,"Unknown transaction kind")}}function Ql(e){return{id:e.id,payload:e.payload}}function _m(e,t){return Fn(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function Lm(e){return e.code==="P2009"||e.code==="P2012"}function Ul(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(Ul)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}function Jl(e){return e.map(t=>{let r={};for(let n of Object.keys(t))r[n]=Gl(t[n]);return r})}function Gl({prisma__type:e,prisma__value:t}){switch(e){case"bigint":return BigInt(t);case"bytes":return Buffer.from(t,"base64");case"decimal":return new pe(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"array":return t.map(Gl);default:return t}}var Yl=F(Kr());var Wl=["datasources","errorFormat","log","__internal","rejectOnNotFound"],Hl=["pretty","colorless","minimal"],zl=["info","query","warn","error"],jm={datasources:(e,t)=>{if(!!e){if(typeof e!="object"||Array.isArray(e))throw new W(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=Ot(r,t)||`Available datasources: ${t.join(", ")}`;throw new W(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new W(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. +It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new W(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. +It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new W(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor. +It should have this form: { url: "CONNECTION_STRING" }`)}}}},errorFormat:e=>{if(!!e){if(typeof e!="string")throw new W(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Hl.includes(e)){let t=Ot(e,Hl);throw new W(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new W(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!zl.includes(r)){let n=Ot(r,zl);throw new W(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=Ot(i,o);throw new W(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[i,o]of Object.entries(r))if(n[i])n[i](o);else throw new W(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},__internal:e=>{if(!e)return;let t=["debug","hooks","engine","measurePerformance"];if(typeof e!="object")throw new W(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=Ot(r,t);throw new W(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}},rejectOnNotFound:e=>{if(!!e){if(It(e)||typeof e=="boolean"||typeof e=="object"||typeof e=="function")return e;throw new W(`Invalid rejectOnNotFound expected a boolean/Error/{[modelName: Error | boolean]} but received ${JSON.stringify(e)}`)}}};function Zl(e,t){for(let[r,n]of Object.entries(e)){if(!Wl.includes(r)){let i=Ot(r,Wl);throw new W(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}jm[r](n,t)}}function Ot(e,t){if(t.length===0||typeof e!="string")return"";let r=qm(e,t);return r?` Did you mean "${r}"?`:""}function qm(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,Yl.default)(e,i)}));r.sort((i,o)=>i.distance{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?r(i):t(n)))},l=u=>{o||(o=!0,r(u))};for(let u=0;u{n[u]=c,a()},c=>{if(!Fn(c)){l(c);return}c.batchRequestIdx===u?l(c):(i||(i=c),a())})})}var Oe=V("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Bm={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},Vm=Symbol.for("prisma.client.transaction.id"),Km={id:0,nextId(){return++this.id}};function iu(e){class t{constructor(n){this._middlewares=new Cn;this._createPrismaPromise=io();this._getDmmf=kr(async n=>{try{let i=await this._tracingHelper.runInChildSpan({name:"getDmmf",internal:!0},()=>this._engine.getDmmf());return this._tracingHelper.runInChildSpan({name:"processDmmf",internal:!0},()=>new We(Ks(i)))}catch(i){this._fetcher.handleAndLogRequestError({...n,args:{},error:i})}});this._getProtocolEncoder=kr(async n=>this._engineConfig.engineProtocol==="json"?new mr(this._runtimeDataModel,this._errorFormat):(this._dmmf===void 0&&(this._dmmf=await this._getDmmf(n)),new gn(this._dmmf,this._errorFormat)));this.$extends=za;sl(e),n&&Zl(n,e.datasourceNames);let i=new ru.EventEmitter().on("error",()=>{});this._extensions=Ze.empty(),this._previewFeatures=e.generator?.previewFeatures??[],this._rejectOnNotFound=n?.rejectOnNotFound,this._clientVersion=e.clientVersion??dn,this._activeProvider=e.activeProvider,this._dataProxy=e.dataProxy,this._tracingHelper=Il(this._previewFeatures),this._clientEngineType=Gn(e.generator);let o={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&gr.default.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&gr.default.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s=kt(o,{conflictCheck:"none"});try{let a=n??{},l=a.__internal??{},u=l.debug===!0;u&&V.enable("prisma:client");let c=gr.default.resolve(e.dirname,e.relativePath);nu.default.existsSync(c)||(c=e.dirname),Oe("dirname",e.dirname),Oe("relativePath",e.relativePath),Oe("cwd",c);let p=a.datasources||{},d=Object.entries(p).filter(([b,y])=>y&&y.url).map(([b,{url:y}])=>({name:b,url:y})),m=ql([],d,b=>b.name),f=l.engine||{};a.errorFormat?this._errorFormat=a.errorFormat:process.env.NODE_ENV==="production"?this._errorFormat="minimal":process.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",e.runtimeDataModel?this._runtimeDataModel=e.runtimeDataModel:this._runtimeDataModel=ys(e.document.datamodel);let g=Hn(e.generator);if(Oe("protocol",g),e.document&&(this._dmmf=new We(e.document)),this._engineConfig={cwd:c,dirname:e.dirname,enableDebugLogs:u,allowTriggerPanic:f.allowTriggerPanic,datamodelPath:gr.default.join(e.dirname,e.filename??"schema.prisma"),prismaPath:f.binaryPath??void 0,engineEndpoint:f.endpoint,datasources:m,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:a.log&&_l(a.log),logQueries:a.log&&Boolean(typeof a.log=="string"?a.log==="query":a.log.find(b=>typeof b=="string"?b==="query":b.level==="query")),env:s?.parsed??e.injectableEdgeEnv?.parsed??{},flags:[],clientVersion:e.clientVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,logEmitter:i,engineProtocol:g,isBundled:e.isBundled},Oe("clientVersion",e.clientVersion),Oe("clientEngineType",this._dataProxy?"dataproxy":this._clientEngineType),this._dataProxy&&Oe("using Data Proxy with Node.js runtime"),this._engine=this.getEngine(),this._fetcher=new Rn(this,i),a.log)for(let b of a.log){let y=typeof b=="string"?b:b.emit==="stdout"?b.level:null;y&&this.$on(y,w=>{Vt.log(`${Vt.tags[y]??""}`,w.message||w.query)})}this._metrics=new yt(this._engine)}catch(a){throw a.clientVersion=this._clientVersion,a}return cr(this)}get[Symbol.toStringTag](){return"PrismaClient"}getEngine(){if(this._dataProxy,this._clientEngineType==="library")return new ir(this._engineConfig);throw this._clientEngineType,"binary",new Y("Invalid client engine type, please use `library` or `binary`")}$use(n){this._middlewares.use(n)}$on(n,i){n==="beforeExit"?this._engine.on("beforeExit",i):this._engine.on(n,o=>{let s=o.fields;return i(n==="query"?{timestamp:o.timestamp,query:s?.query??o.query,params:s?.params??o.params,duration:s?.duration_ms??o.duration,target:o.target}:{timestamp:o.timestamp,message:s?.message??o.message,target:o.target})})}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async _runDisconnect(){await this._engine.stop(),delete this._connectionPromise,this._engine=this.getEngine(),delete this._disconnectionPromise}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{So(),this._dataProxy||(this._dmmf=void 0)}}$executeRawInternal(n,i,o,s){return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:no(this._activeProvider,i),callsite:Ye(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=eu(n,i);return ro(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new Y("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n")})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>(ro(this._activeProvider,n,i,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new Y(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`);return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:vl,callsite:Ye(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:no(this._activeProvider,i),callsite:Ye(this._errorFormat),dataPath:[],middlewareArgsMapper:s}).then(Jl)}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...eu(n,i));throw new Y("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n")})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=Km.nextId(),s=Nl(n.length),a=n.map((l,u)=>{if(l?.[Symbol.toStringTag]!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let c=i?.isolationLevel,p={kind:"batch",id:o,index:u,isolationLevel:c,lock:s};return l.requestTransaction?.(p)??l});return Xl(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s=await this._engine.transaction("start",o,i),a;try{let l={kind:"itx",...s};a=await n(this._createItxClient(l)),await this._engine.transaction("commit",o,s)}catch(l){throw await this._engine.transaction("rollback",o,s).catch(()=>{}),l}return a}_createItxClient(n){let i=mn(this);return cr(Ne(i,[Ce("_createPrismaPromise",()=>io(n)),Ce(Vm,()=>n.id),rr(Ll)]))}$transaction(n,i){let o;typeof n=="function"?o=()=>this._transactionWithCallback({callback:n,options:i}):o=()=>this._transactionWithArray({promises:n,options:i});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,o)}_request(n){n.otelParentCtx=this._tracingHelper.getActiveContext();let i=n.middlewareArgsMapper??Bm,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:Boolean(n.transaction),action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:`${o.model}.${o.action}`}}},a=-1,l=u=>{let c=this._middlewares.get(++a);if(c)return this._tracingHelper.runInChildSpan(s.middleware,g=>c(u,b=>(g?.end(),l(b))));let{runInTransaction:p,args:d,...m}=u,f={...n,...m};return d&&(f.args=i.middlewareArgsToRequestArgs(d)),n.transaction!==void 0&&p===!1&&delete f.transaction,el(this,f)};return this._tracingHelper.runInChildSpan(s.operation,()=>new tu.AsyncResource("prisma-client-request").runInAsyncScope(()=>l(o)))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:l,argsMapper:u,transaction:c,unpacker:p,otelParentCtx:d,customDataProxyFetch:m}){try{let f=await this._getProtocolEncoder({clientMethod:i,callsite:s});n=u?u(n):n;let g={name:"serialize"},b;l&&(b=Hi(a,l,n,this._rejectOnNotFound),Um(b,l,a));let y=this._tracingHelper.runInChildSpan(g,()=>f.createMessage({modelName:l,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions}));return V.enabled("prisma:client")&&(Oe("Prisma Client call:"),Oe(`prisma.${i}(${an({ast:n,keyPaths:[],valuePaths:[],missingItems:[]})})`),Oe("Generated request:"),Oe(y.toDebugString()+` +`)),c?.kind==="batch"&&await c.lock,this._fetcher.request({protocolMessage:y,protocolEncoder:f,modelName:l,action:a,clientMethod:i,dataPath:o,rejectOnNotFound:b,callsite:s,args:n,extensions:this._extensions,transaction:c,unpacker:p,otelParentCtx:d,otelChildCtx:this._tracingHelper.getActiveContext(),customDataProxyFetch:m})}catch(f){throw f.clientVersion=this._clientVersion,f}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new Y("`metrics` preview feature must be enabled in order to access metrics API");return this._metrics}_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}}return t}var Qm={findUnique:"findUniqueOrThrow",findFirst:"findFirstOrThrow"};function Um(e,t,r){if(e){let n=Qm[r],i=t?`prisma.${Te(t)}.${n}`:`prisma.${n}`,o=`rejectOnNotFound.${t??""}.${r}`;Ut(o,`\`rejectOnNotFound\` option is deprecated and will be removed in Prisma 5. Please use \`${i}\` method instead`)}}function eu(e,t){return Jm(e)?[new ee(e,t),Rl]:[e,Dl]}function Jm(e){return Array.isArray(e)&&Array.isArray(e.raw)}var Gm=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function ou(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!Gm.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}var su=e=>e;function au(e){kt(e,{conflictCheck:"warn"})}0&&(module.exports={DMMF,DMMFClass,Debug,Decimal,Extensions,MetricsClient,NotFoundError,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,Types,decompressFromBase64,defineDmmfProperty,empty,getPrismaClient,join,makeDocument,makeStrictEnum,objectEnumValues,raw,sqltag,transformDocument,unpack,warnEnvConflicts,warnOnce}); +/*! + * decimal.js v10.4.3 + * An arbitrary-precision Decimal type for JavaScript. + * https://github.com/MikeMcl/decimal.js + * Copyright (c) 2022 Michael Mclaughlin + * MIT Licence + */ +/*! + * @description Recursive object extending + * @author Viacheslav Lotsmanov + * @license MIT + * + * The MIT License (MIT) + * + * Copyright (c) 2013-2018 Viacheslav Lotsmanov + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +//# sourceMappingURL=library.js.map diff --git a/uc-controller-user/controller-user/prisma/prismaAuthUserClient/schema.prisma b/uc-controller-user/controller-user/prisma/prismaAuthUserClient/schema.prisma new file mode 100644 index 0000000..8da6ca6 --- /dev/null +++ b/uc-controller-user/controller-user/prisma/prismaAuthUserClient/schema.prisma @@ -0,0 +1,44 @@ +// This is your Prisma schema file, +// learn more about it in the docs: https://pris.ly/d/prisma-schema + +generator client { + provider = "prisma-client-js" + output = "./prismaAuthUserClient/" +} + +datasource db { + provider = "postgresql" + url = "postgres://unicourt_user:admin@30.7.1.201:5432/uc_master" +} + +model User { + id Int @id @default(autoincrement()) + firstName String @map("first_name") + emailId String @map("email_id") @unique + lastName String @map("last_name") + password String + createdAt DateTime @default(now()) + contacts Contact[] + @@map("user") +} + +model Contact { + id Int @id @default(autoincrement()) + name String + emailId String @map("email_id") + street String + city String + zipcode Int + companyName String @map("company_name") + phoneNumber String @map("phone_number") + user User @relation(fields: [userId], references: [id]) + userId Int + + @@map("contact") +} + +enum Role { + CLIENT + ADMIN + ROOT +} diff --git a/uc-controller-user/controller-user/src/auth/auth.controller.ts b/uc-controller-user/controller-user/src/auth/auth.controller.ts index 71655d3..14a7c43 100644 --- a/uc-controller-user/controller-user/src/auth/auth.controller.ts +++ b/uc-controller-user/controller-user/src/auth/auth.controller.ts @@ -8,11 +8,19 @@ export class AuthController { @Post('register') public async register(@Body() createUserDto: CreateUserDto ): Promise { - return; + const result: RegistrationStatus = await this.authService.register( + createUserDto, + ); + if (!result.success) { + throw new HttpException(result.message, HttpStatus.BAD_REQUEST); + } + return result; } @Post('login') public async login(@Body() loginUserDto: LoginUserDto): Promise { - return; - } + console.log("loginUserDto: "+JSON.stringify(loginUserDto)); + return await this.authService.login(loginUserDto); +} + } diff --git a/uc-controller-user/controller-user/src/auth/auth.module.ts b/uc-controller-user/controller-user/src/auth/auth.module.ts index 1e48f23..71f01dd 100644 --- a/uc-controller-user/controller-user/src/auth/auth.module.ts +++ b/uc-controller-user/controller-user/src/auth/auth.module.ts @@ -7,9 +7,21 @@ import { AuthController } from './auth.controller'; import { UsersService } from '../service/users.service'; import { PrismaService } from '../service/prisma.service'; @Module({ - imports: [], + imports: [ + PassportModule.register({ + defaultStrategy: 'jwt', + property: 'user', + session: false, + }), + JwtModule.register({ + secret: process.env.SECRETKEY, + signOptions: { + expiresIn: process.env.EXPIRESIN, + }, + }), + ], + providers: [AuthService, UsersService, JwtStrategy, PrismaService], + exports: [PassportModule, JwtModule], controllers: [AuthController], - providers: [AuthService, UsersService, PrismaService], - exports: [], }) export class AuthModule {} diff --git a/uc-controller-user/controller-user/src/auth/auth.service.ts b/uc-controller-user/controller-user/src/auth/auth.service.ts index f39328e..50d5da2 100644 --- a/uc-controller-user/controller-user/src/auth/auth.service.ts +++ b/uc-controller-user/controller-user/src/auth/auth.service.ts @@ -10,24 +10,67 @@ import { User } from 'prisma/prismaAuthUserClient'; export class AuthService { constructor( private readonly prisma: PrismaService, + private readonly jwtService: JwtService, private readonly usersService: UsersService, - ) {} + ) {} - async register(userDto: CreateUserDto): Promise { - return; - } + async register(userDto: CreateUserDto): Promise { + let status: RegistrationStatus = { + success: true, + message: 'ACCOUNT_CREATE_SUCCESS', + }; + + try { + status.data = await this.usersService.create(userDto); + } catch (err) { + console.log(err); + status = { + success: false, + message: err, + }; + } + return status; + } - async login(loginUserDto: LoginUserDto): Promise { - return; - } + async login(loginUserDto: LoginUserDto): Promise { + // find user in db + const user = await this.usersService.findByLogin(loginUserDto); + console.log(user) + if(!user){ + return false; + } + // generate and sign token + const token = await this._createToken(user); + + return { + ...token, + data: user, + }; + } + // generate and sign token + private async _createToken(userData): Promise { + + const user: JwtPayload = { userId: userData.id, userEmailId:userData.emailId }; + console.log(user); + + const Authorization = await this.jwtService.sign(user); + console.log(Authorization); + + return { + expiresIn: process.env.EXPIRESIN, + Authorization, + }; + } - private async _createToken(userData): Promise { - return; - } async validateUser(payload: JwtPayload): Promise { - return; + const user = await this.usersService.findByPayload(payload); + if (!user) { + throw new HttpException('INVALID_TOKEN', HttpStatus.UNAUTHORIZED); + } + return user; } + } export interface RegistrationStatus { diff --git a/uc-controller-user/controller-user/src/auth/jwt.strategy.ts b/uc-controller-user/controller-user/src/auth/jwt.strategy.ts index 2722323..a97e454 100644 --- a/uc-controller-user/controller-user/src/auth/jwt.strategy.ts +++ b/uc-controller-user/controller-user/src/auth/jwt.strategy.ts @@ -6,11 +6,19 @@ import { HttpException, HttpStatus, Injectable } from '@nestjs/common'; @Injectable() export class JwtStrategy extends PassportStrategy(Strategy) { constructor(private readonly authService: AuthService) { - super({}); + super({ + jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(), + ignoreExpiration: false, + secretOrKey: process.env.SECRETKEY, + }); } - async validate() { - + async validate(payload: JwtPayload): Promise { + const user = await this.authService.validateUser(payload); + if (!user) { + throw new HttpException('Invalid token', HttpStatus.UNAUTHORIZED); + } + return user; } } diff --git a/uc-controller-user/controller-user/src/dto/user.dto.ts b/uc-controller-user/controller-user/src/dto/user.dto.ts index 5ac4692..1b1a70e 100644 --- a/uc-controller-user/controller-user/src/dto/user.dto.ts +++ b/uc-controller-user/controller-user/src/dto/user.dto.ts @@ -2,6 +2,18 @@ import { IsNotEmpty } from 'class-validator'; export class LoginUserDto {} -export class CreateUserDto {} +export class CreateUserDto { + @IsNotEmpty() + firstName: string; + + @IsNotEmpty() + lastName: string; + + @IsNotEmpty() + emailId: string; + + @IsNotEmpty() + password: string; + } export class UpdatePasswordDto {} diff --git a/uc-controller-user/controller-user/src/service/users.service.ts b/uc-controller-user/controller-user/src/service/users.service.ts index 3799fea..79f0133 100644 --- a/uc-controller-user/controller-user/src/service/users.service.ts +++ b/uc-controller-user/controller-user/src/service/users.service.ts @@ -2,20 +2,49 @@ import { HttpException, Injectable } from '@nestjs/common'; import { CreateUserDto, UpdatePasswordDto } from '../dto/user.dto'; import { PrismaService } from './prisma.service'; import { User } from 'prisma/prismaAuthUserClient'; +import * as bcrypt from 'bcrypt'; +import { IsNotEmpty, IsEmail } from 'class-validator'; @Injectable() export class UsersService { constructor(private prisma: PrismaService) {} - - //use by auth module to register user in database + async findByPayload(userData: any): Promise {} async create(userDto: CreateUserDto): Promise { - return; - } + const hashedPassword = await bcrypt.hash(userDto.password, 10); + console.log("hashed password",hashedPassword) + const data = await this.prisma.user + .create({ + data: { + firstName: userDto.firstName, + lastName: userDto.lastName, + emailId: userDto.emailId, + password: hashedPassword, // Save the hashed password + }, + }) + .catch((err) => { + console.log(err); + throw new HttpException('Failed to create user', 400); + }); - //use by auth module to login user + return data; + } async findByLogin(userData: any): Promise { - return; + console.log(userData); + + const data = await this.prisma.user + .findFirst({ + where: { + emailId: userData.username + }, + }) + .catch((err) => { + console.log(err); + throw new HttpException('User Doesnt Exist', 400); + }); + console.log("password---------->",data.password); + console.log(data); + return data; } - async findByPayload(userData: any): Promise {} } + diff --git a/uc-controller-user/docker/Dockerfile b/uc-controller-user/docker/Dockerfile old mode 100644 new mode 100755