From 144ee6cde09622e86d2ffe3073a159cef95ec29c Mon Sep 17 00:00:00 2001 From: Kevin De Porre Date: Tue, 14 Nov 2023 16:51:02 +0100 Subject: [PATCH 1/2] Client-side support for BigInt --- .../src/client/conversions/input.ts | 3 +- .../src/client/conversions/sqlite.ts | 5 + .../typescript/src/client/model/builder.ts | 43 +- clients/typescript/src/client/model/table.ts | 9 +- clients/typescript/src/migrators/triggers.ts | 13 +- clients/typescript/src/satellite/client.ts | 2 +- clients/typescript/src/satellite/oplog.ts | 6 + clients/typescript/src/satellite/process.ts | 8 +- clients/typescript/src/util/types.ts | 8 +- .../test/client/conversions/input.test.ts | 3 +- .../test/client/conversions/sqlite.test.ts | 23 +- .../client/generated/client/index-browser.js | 173 - .../test/client/generated/client/index.d.ts | 99 + .../test/client/generated/client/index.js | 219 - .../test/client/generated/client/package.json | 7 - .../client/runtime/index-browser.d.ts | 322 - .../generated/client/runtime/index-browser.js | 2411 ----- .../generated/client/runtime/index.d.ts | 2726 ----- .../generated/client/runtime/library.d.ts | 1 - .../generated/client/runtime/library.js | 212 - .../client/generated/client/schema.prisma | 66 - .../typescript/test/client/generated/index.ts | 93 +- .../test/client/model/builder.test.ts | 5 +- .../test/client/model/datatype.test.ts | 106 +- .../test/client/prisma/schema.prisma | 1 + clients/typescript/test/satellite/common.ts | 8 +- .../test/satellite/process.migration.test.ts | 62 +- e2e/satellite_client/src/client.ts | 2 +- .../src/generated/client/index.ts | 101 +- .../src/generated/client/prismaClient.d.ts | 9630 +++++++++++++++++ e2e/satellite_client/src/prisma/schema.prisma | 13 +- .../03.17_node_satellite_can_sync_ints.lux | 36 +- e2e/tests/_satellite_macros.luxinc | 2 +- .../cases/testValidators/number.prisma | 1 + .../cases/testValidators/number.test.ts | 7 + .../extendedDMMFFieldValidatorMap.ts | 2 +- .../functions/fieldWriters/writeScalarType.ts | 49 + 37 files changed, 10270 insertions(+), 6207 deletions(-) delete mode 100644 clients/typescript/test/client/generated/client/index-browser.js delete mode 100644 clients/typescript/test/client/generated/client/index.js delete mode 100644 clients/typescript/test/client/generated/client/package.json delete mode 100644 clients/typescript/test/client/generated/client/runtime/index-browser.d.ts delete mode 100644 clients/typescript/test/client/generated/client/runtime/index-browser.js delete mode 100644 clients/typescript/test/client/generated/client/runtime/index.d.ts delete mode 100644 clients/typescript/test/client/generated/client/runtime/library.d.ts delete mode 100644 clients/typescript/test/client/generated/client/runtime/library.js delete mode 100644 clients/typescript/test/client/generated/client/schema.prisma create mode 100644 e2e/satellite_client/src/generated/client/prismaClient.d.ts diff --git a/clients/typescript/src/client/conversions/input.ts b/clients/typescript/src/client/conversions/input.ts index bdc363fca4..8fb6d94002 100644 --- a/clients/typescript/src/client/conversions/input.ts +++ b/clients/typescript/src/client/conversions/input.ts @@ -331,8 +331,7 @@ function isObject(v: any): boolean { } function isFilterObject(value: any): boolean { - // if it is an object it can only be a timestamp or a filter object - // because those are the only objects we support in where clauses + // if it is an object it can only be a data object or a filter object return isObject(value) && !isDataObject(value) } diff --git a/clients/typescript/src/client/conversions/sqlite.ts b/clients/typescript/src/client/conversions/sqlite.ts index 5591585198..5a985863a4 100644 --- a/clients/typescript/src/client/conversions/sqlite.ts +++ b/clients/typescript/src/client/conversions/sqlite.ts @@ -50,6 +50,11 @@ export function fromSqlite(v: any, pgType: PgType): any { ) { // it's a serialised NaN return NaN + } else if (pgType === PgBasicType.PG_INT8) { + // always return BigInts for PG_INT8 values + // because some drivers (e.g. wa-sqlite) return a regular JS number if the value fits into a JS number + // but we know that it should be a BigInt based on the column type + return BigInt(v) } else { return v } diff --git a/clients/typescript/src/client/model/builder.ts b/clients/typescript/src/client/model/builder.ts index 9e1d5a7f57..acdd247727 100644 --- a/clients/typescript/src/client/model/builder.ts +++ b/clients/typescript/src/client/model/builder.ts @@ -13,8 +13,14 @@ import { InvalidArgumentError } from '../validation/errors/invalidArgumentError' import * as z from 'zod' import { IShapeManager } from './shapes' import Log from 'loglevel' +import { ExtendedTableSchema } from './schema' +import { PgBasicType } from '../conversions/types' +import { HKT } from '../util/hkt' const squelPostgres = squel.useFlavour('postgres') +squelPostgres.registerValueHandler('bigint', function (bigint) { + return bigint.toString() +}) type AnyFindInput = FindInput @@ -22,7 +28,19 @@ export class Builder { constructor( private _tableName: string, private _fields: string[], - private shapeManager: IShapeManager + private shapeManager: IShapeManager, + private _tableDescription: ExtendedTableSchema< + any, + any, + any, + any, + any, + any, + any, + any, + any, + HKT + > ) {} create(i: CreateInput): QueryBuilder { @@ -196,10 +214,26 @@ export class Builder { const fields = identificationFields .filter((f) => this._fields.includes(f)) .concat(selectedFields) + .map((f) => this.castBigIntToText(f)) return q.fields(fields) } + /** + * Casts a field to TEXT if it is of type BigInt + * because not all adapters deal well with BigInts + * (e.g. better-sqlite3 requires BigInt support to be enabled + * but then all integers are returned as BigInt...) + * The DAL will convert the string into a BigInt in the `fromSqlite` function from `../conversions/sqlite.ts`. + */ + private castBigIntToText(field: string) { + const pgType = this._tableDescription.fields.get(field) + if (pgType === PgBasicType.PG_INT8) { + return `cast(${field} as TEXT) AS ${field}` + } + return field + } + private addOrderBy(i: AnyFindInput, q: PostgresSelect): PostgresSelect { if (typeof i.orderBy === 'undefined') return q const orderByArray = Array.isArray(i.orderBy) ? i.orderBy : [i.orderBy] @@ -243,6 +277,13 @@ export class Builder { query: T ): T { return this._fields.reduce((query, field) => { + // if field is of type BigInt cast the result to TEXT + // because not all adapters deal well with BigInts + // the DAL will convert the string into a BigInt in the `fromSqlite` function from `../conversions/sqlite.ts`. + const pgType = this._tableDescription.fields.get(field) + if (pgType === PgBasicType.PG_INT8) { + return query.returning(`cast(${field} as TEXT) AS ${field}`) + } return query.returning(field) }, query) } diff --git a/clients/typescript/src/client/model/table.ts b/clients/typescript/src/client/model/table.ts index bd5a9e7b45..1008b0076a 100644 --- a/clients/typescript/src/client/model/table.ts +++ b/clients/typescript/src/client/model/table.ts @@ -107,12 +107,17 @@ export class Table< ) { this._fields = this._dbDescription.getFields(tableName) const fieldNames = this._dbDescription.getFieldNames(tableName) - this._builder = new Builder(tableName, fieldNames, shapeManager) + const tableDescription = this._dbDescription.getTableDescription(tableName) + this._builder = new Builder( + tableName, + fieldNames, + shapeManager, + tableDescription + ) this._executor = new Executor(adapter, notifier, this._fields) this._shapeManager = shapeManager this._qualifiedTableName = new QualifiedTablename('main', tableName) this._tables = new Map() - const tableDescription = this._dbDescription.getTableDescription(tableName) this._schema = tableDescription.modelSchema this.createSchema = //transformCreateSchema( omitCountFromSelectAndIncludeSchema(tableDescription.createSchema) //, fields) diff --git a/clients/typescript/src/migrators/triggers.ts b/clients/typescript/src/migrators/triggers.ts index b58b9fffda..1e4b53e8ca 100644 --- a/clients/typescript/src/migrators/triggers.ts +++ b/clients/typescript/src/migrators/triggers.ts @@ -9,7 +9,12 @@ type ForeignKey = { type ColumnName = string type SQLiteType = string -type ColumnTypes = Record +type PgType = string +type ColumnType = { + sqliteType: SQLiteType + pgType: PgType +} +type ColumnTypes = Record export type Table = { tableName: string @@ -220,6 +225,7 @@ export function generateTriggers(tables: Tables): Statement[] { * Joins the column names and values into a string of pairs of the form `'col1', val1, 'col2', val2, ...` * that can be used to build a JSON object in a SQLite `json_object` function call. * Values of type REAL are cast to text to avoid a bug in SQLite's `json_object` function (see below). + * Similarly, values of type INT8 (i.e. BigInts) are cast to text because JSON does not support BigInts. * * NOTE: There is a bug with SQLite's `json_object` function up to version 3.41.2 * that causes it to return an invalid JSON object if some value is +Infinity or -Infinity. @@ -268,7 +274,10 @@ function joinColsForJSON( // casts the value to TEXT if it is of type REAL // to work around the bug in SQLite's `json_object` function const castIfNeeded = (col: string, targettedCol: string) => { - if (colTypes[col] === 'REAL') { + const tpes = colTypes[col] + const sqliteType = tpes.sqliteType + const pgType = tpes.pgType + if (sqliteType === 'REAL' || pgType === 'INT8' || pgType === 'BIGINT') { return `cast(${targettedCol} as TEXT)` } else { return targettedCol diff --git a/clients/typescript/src/satellite/client.ts b/clients/typescript/src/satellite/client.ts index f9c43ba6ad..b99ee462cc 100644 --- a/clients/typescript/src/satellite/client.ts +++ b/clients/typescript/src/satellite/client.ts @@ -1130,6 +1130,7 @@ function deserializeColumnData( switch (columnType) { case PgBasicType.PG_CHAR: case PgDateType.PG_DATE: + case PgBasicType.PG_INT8: case PgBasicType.PG_TEXT: case PgDateType.PG_TIME: case PgDateType.PG_TIMESTAMP: @@ -1142,7 +1143,6 @@ function deserializeColumnData( case PgBasicType.PG_INT: case PgBasicType.PG_INT2: case PgBasicType.PG_INT4: - case PgBasicType.PG_INT8: case PgBasicType.PG_INTEGER: return Number(typeDecoder.text(column)) case PgBasicType.PG_FLOAT4: diff --git a/clients/typescript/src/satellite/oplog.ts b/clients/typescript/src/satellite/oplog.ts index dde3ed2e3a..8a66e15e58 100644 --- a/clients/typescript/src/satellite/oplog.ts +++ b/clients/typescript/src/satellite/oplog.ts @@ -306,6 +306,9 @@ function serialiseRow(row?: Rec): string { return '-Inf' } } + if (typeof value === 'bigint') { + return value.toString() + } return value }) } @@ -338,6 +341,9 @@ function deserialiseRow(str: string, rel: Pick): Rec { return Number(value) } } + if (columnType === 'INT8' || columnType === 'BIGINT') { + return BigInt(value) + } return value }) } diff --git a/clients/typescript/src/satellite/process.ts b/clients/typescript/src/satellite/process.ts index 3ae891bd10..13115f4168 100644 --- a/clients/typescript/src/satellite/process.ts +++ b/clients/typescript/src/satellite/process.ts @@ -1471,7 +1471,13 @@ export function generateTriggersForTable(tbl: MigrationTable): Statement[] { } }), columnTypes: Object.fromEntries( - tbl.columns.map((col) => [col.name, col.sqliteType.toUpperCase()]) + tbl.columns.map((col) => [ + col.name, + { + sqliteType: col.sqliteType.toUpperCase(), + pgType: col.pgType!.name.toUpperCase(), + }, + ]) ), } const fullTableName = table.namespace + '.' + table.tableName diff --git a/clients/typescript/src/util/types.ts b/clients/typescript/src/util/types.ts index a8871e0656..bf08c89833 100644 --- a/clients/typescript/src/util/types.ts +++ b/clients/typescript/src/util/types.ts @@ -1,6 +1,7 @@ import type Long from 'long' import { SatOpMigrate_Column, + SatOpMigrate_PgColumnType, SatOpMigrate_Table, SatOpMigrate_Type, SatRelation_RelationType, @@ -130,9 +131,12 @@ export type DataChange = { tags: Tag[] } -// The properties are omitted from columns because they are not currently used. +export type SatOpMigrate_Col = Omit & { + pgType: Omit | undefined +} + export type MigrationTable = Omit & { - columns: Omit[] + columns: SatOpMigrate_Col[] } export type SchemaChange = { diff --git a/clients/typescript/test/client/conversions/input.test.ts b/clients/typescript/test/client/conversions/input.test.ts index 37fea48b72..504533c275 100644 --- a/clients/typescript/test/client/conversions/input.test.ts +++ b/clients/typescript/test/client/conversions/input.test.ts @@ -31,7 +31,7 @@ await tbl.sync() function setupDB() { db.exec('DROP TABLE IF EXISTS DataTypes') db.exec( - "CREATE TABLE DataTypes('id' int PRIMARY KEY, 'date' varchar, 'time' varchar, 'timetz' varchar, 'timestamp' varchar, 'timestamptz' varchar, 'bool' int, 'uuid' varchar, 'int2' int2, 'int4' int4, 'float8' real, 'relatedId' int);" + "CREATE TABLE DataTypes('id' int PRIMARY KEY, 'date' varchar, 'time' varchar, 'timetz' varchar, 'timestamp' varchar, 'timestamptz' varchar, 'bool' int, 'uuid' varchar, 'int2' int2, 'int4' int4, 'int8' int8, 'float8' real, 'relatedId' int);" ) db.exec('DROP TABLE IF EXISTS Dummy') @@ -232,6 +232,7 @@ const dateNulls = { bool: null, int2: null, int4: null, + int8: null, float8: null, uuid: null, } diff --git a/clients/typescript/test/client/conversions/sqlite.test.ts b/clients/typescript/test/client/conversions/sqlite.test.ts index 148fc9f538..e949766c0c 100644 --- a/clients/typescript/test/client/conversions/sqlite.test.ts +++ b/clients/typescript/test/client/conversions/sqlite.test.ts @@ -30,7 +30,7 @@ await tbl.sync() function setupDB() { db.exec('DROP TABLE IF EXISTS DataTypes') db.exec( - "CREATE TABLE DataTypes('id' int PRIMARY KEY, 'date' varchar, 'time' varchar, 'timetz' varchar, 'timestamp' varchar, 'timestamptz' varchar, 'bool' int, 'uuid' varchar, 'int2' int2, 'int4' int4, 'float8' real, 'relatedId' int);" + "CREATE TABLE DataTypes('id' int PRIMARY KEY, 'date' varchar, 'time' varchar, 'timetz' varchar, 'timestamp' varchar, 'timestamptz' varchar, 'bool' int, 'uuid' varchar, 'int2' int2, 'int4' int4, 'int8' int8, 'float8' real, 'relatedId' int);" ) } @@ -211,3 +211,24 @@ test.serial('floats are converted correctly to SQLite', async (t) => { { id: 4, float8: -Infinity }, ]) }) + +test.serial('BigInts are converted correctly to SQLite', async (t) => { + //db.defaultSafeIntegers(true) // enables BigInt support + const bigInt = 9_223_372_036_854_775_807n + await tbl.create({ + data: { + id: 1, + int8: bigInt, + }, + }) + + const rawRes = await electric.db.raw({ + sql: 'SELECT id, cast(int8 as TEXT) AS int8 FROM DataTypes WHERE id = ?', + args: [1], + }) + // because we are executing a raw query, + // the returned BigInt for the `id` + // is not converted into a regular number + t.deepEqual(rawRes, [{ id: 1, int8: bigInt.toString() }]) + //db.defaultSafeIntegers(false) // disables BigInt support +}) diff --git a/clients/typescript/test/client/generated/client/index-browser.js b/clients/typescript/test/client/generated/client/index-browser.js deleted file mode 100644 index 37ad89e8bf..0000000000 --- a/clients/typescript/test/client/generated/client/index-browser.js +++ /dev/null @@ -1,173 +0,0 @@ - -Object.defineProperty(exports, "__esModule", { value: true }); - -const { - Decimal, - objectEnumValues, - makeStrictEnum -} = require('./runtime/index-browser') - - -const Prisma = {} - -exports.Prisma = Prisma - -/** - * Prisma Client JS version: 4.15.0 - * Query Engine version: 8fbc245156db7124f997f4cecdd8d1219e360944 - */ -Prisma.prismaVersion = { - client: "4.15.0", - engine: "8fbc245156db7124f997f4cecdd8d1219e360944" -} - -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 = () => (val) => val - - -/** - * Shorthand utilities for JSON filtering - */ -Prisma.DbNull = objectEnumValues.instances.DbNull -Prisma.JsonNull = objectEnumValues.instances.JsonNull -Prisma.AnyNull = objectEnumValues.instances.AnyNull - -Prisma.NullTypes = { - DbNull: objectEnumValues.classes.DbNull, - JsonNull: objectEnumValues.classes.JsonNull, - AnyNull: objectEnumValues.classes.AnyNull -} - -/** - * Enums - */ - -exports.Prisma.DataTypesScalarFieldEnum = { - id: 'id', - date: 'date', - time: 'time', - timetz: 'timetz', - timestamp: 'timestamp', - timestamptz: 'timestamptz', - bool: 'bool', - uuid: 'uuid', - int2: 'int2', - int4: 'int4', - float8: 'float8', - relatedId: 'relatedId' -}; - -exports.Prisma.DummyScalarFieldEnum = { - id: 'id', - timestamp: 'timestamp' -}; - -exports.Prisma.ItemsScalarFieldEnum = { - value: 'value', - nbr: 'nbr' -}; - -exports.Prisma.PostScalarFieldEnum = { - id: 'id', - title: 'title', - contents: 'contents', - nbr: 'nbr', - authorId: 'authorId' -}; - -exports.Prisma.ProfileScalarFieldEnum = { - id: 'id', - bio: 'bio', - userId: 'userId' -}; - -exports.Prisma.QueryMode = { - default: 'default', - insensitive: 'insensitive' -}; - -exports.Prisma.SortOrder = { - asc: 'asc', - desc: 'desc' -}; - -exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ - ReadUncommitted: 'ReadUncommitted', - ReadCommitted: 'ReadCommitted', - RepeatableRead: 'RepeatableRead', - Serializable: 'Serializable' -}); - -exports.Prisma.UserScalarFieldEnum = { - id: 'id', - name: 'name' -}; - - -exports.Prisma.ModelName = { - Items: 'Items', - User: 'User', - Post: 'Post', - Profile: 'Profile', - DataTypes: 'DataTypes', - Dummy: 'Dummy' -}; - -/** - * 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/clients/typescript/test/client/generated/client/index.d.ts b/clients/typescript/test/client/generated/client/index.d.ts index 1adde93497..79a7b6ade5 100644 --- a/clients/typescript/test/client/generated/client/index.d.ts +++ b/clients/typescript/test/client/generated/client/index.d.ts @@ -76,6 +76,7 @@ export type DataTypes = { * @zod.number.int().gte(-2147483648).lte(2147483647) */ int4: number | null + int8: bigint | null /** * @zod.custom.use(z.number().or(z.nan())) */ @@ -4801,6 +4802,7 @@ export namespace Prisma { id: number | null int2: number | null int4: number | null + int8: number | null float8: number | null relatedId: number | null } @@ -4809,6 +4811,7 @@ export namespace Prisma { id: number | null int2: number | null int4: number | null + int8: bigint | null float8: number | null relatedId: number | null } @@ -4824,6 +4827,7 @@ export namespace Prisma { uuid: string | null int2: number | null int4: number | null + int8: bigint | null float8: number | null relatedId: number | null } @@ -4839,6 +4843,7 @@ export namespace Prisma { uuid: string | null int2: number | null int4: number | null + int8: bigint | null float8: number | null relatedId: number | null } @@ -4854,6 +4859,7 @@ export namespace Prisma { uuid: number int2: number int4: number + int8: number float8: number relatedId: number _all: number @@ -4864,6 +4870,7 @@ export namespace Prisma { id?: true int2?: true int4?: true + int8?: true float8?: true relatedId?: true } @@ -4872,6 +4879,7 @@ export namespace Prisma { id?: true int2?: true int4?: true + int8?: true float8?: true relatedId?: true } @@ -4887,6 +4895,7 @@ export namespace Prisma { uuid?: true int2?: true int4?: true + int8?: true float8?: true relatedId?: true } @@ -4902,6 +4911,7 @@ export namespace Prisma { uuid?: true int2?: true int4?: true + int8?: true float8?: true relatedId?: true } @@ -4917,6 +4927,7 @@ export namespace Prisma { uuid?: true int2?: true int4?: true + int8?: true float8?: true relatedId?: true _all?: true @@ -5020,6 +5031,7 @@ export namespace Prisma { uuid: string | null int2: number | null int4: number | null + int8: bigint | null float8: number | null relatedId: number | null _count: DataTypesCountAggregateOutputType | null @@ -5054,6 +5066,7 @@ export namespace Prisma { uuid?: boolean int2?: boolean int4?: boolean + int8?: boolean float8?: boolean relatedId?: boolean related?: boolean | DummyArgs @@ -6802,6 +6815,7 @@ export namespace Prisma { uuid: 'uuid', int2: 'int2', int4: 'int4', + int8: 'int8', float8: 'float8', relatedId: 'relatedId' }; @@ -7064,6 +7078,7 @@ export namespace Prisma { uuid?: UuidNullableFilter | string | null int2?: IntNullableFilter | number | null int4?: IntNullableFilter | number | null + int8?: BigIntNullableFilter | bigint | number | null float8?: FloatNullableFilter | number | null relatedId?: IntNullableFilter | number | null related?: XOR | null @@ -7080,6 +7095,7 @@ export namespace Prisma { uuid?: SortOrder int2?: SortOrder int4?: SortOrder + int8?: SortOrder float8?: SortOrder relatedId?: SortOrder related?: DummyOrderByWithRelationInput @@ -7101,6 +7117,7 @@ export namespace Prisma { uuid?: SortOrder int2?: SortOrder int4?: SortOrder + int8?: SortOrder float8?: SortOrder relatedId?: SortOrder _count?: DataTypesCountOrderByAggregateInput @@ -7124,6 +7141,7 @@ export namespace Prisma { uuid?: UuidNullableWithAggregatesFilter | string | null int2?: IntNullableWithAggregatesFilter | number | null int4?: IntNullableWithAggregatesFilter | number | null + int8?: BigIntNullableWithAggregatesFilter | bigint | number | null float8?: FloatNullableWithAggregatesFilter | number | null relatedId?: IntNullableWithAggregatesFilter | number | null } @@ -7350,6 +7368,7 @@ export namespace Prisma { uuid?: string | null int2?: number | null int4?: number | null + int8?: bigint | number | null float8?: number | null related?: DummyCreateNestedOneWithoutDatatypeInput } @@ -7365,6 +7384,7 @@ export namespace Prisma { uuid?: string | null int2?: number | null int4?: number | null + int8?: bigint | number | null float8?: number | null relatedId?: number | null } @@ -7380,6 +7400,7 @@ export namespace Prisma { uuid?: NullableStringFieldUpdateOperationsInput | string | null int2?: NullableIntFieldUpdateOperationsInput | number | null int4?: NullableIntFieldUpdateOperationsInput | number | null + int8?: NullableBigIntFieldUpdateOperationsInput | bigint | number | null float8?: NullableFloatFieldUpdateOperationsInput | number | null related?: DummyUpdateOneWithoutDatatypeNestedInput } @@ -7395,6 +7416,7 @@ export namespace Prisma { uuid?: NullableStringFieldUpdateOperationsInput | string | null int2?: NullableIntFieldUpdateOperationsInput | number | null int4?: NullableIntFieldUpdateOperationsInput | number | null + int8?: NullableBigIntFieldUpdateOperationsInput | bigint | number | null float8?: NullableFloatFieldUpdateOperationsInput | number | null relatedId?: NullableIntFieldUpdateOperationsInput | number | null } @@ -7410,6 +7432,7 @@ export namespace Prisma { uuid?: string | null int2?: number | null int4?: number | null + int8?: bigint | number | null float8?: number | null relatedId?: number | null } @@ -7425,6 +7448,7 @@ export namespace Prisma { uuid?: NullableStringFieldUpdateOperationsInput | string | null int2?: NullableIntFieldUpdateOperationsInput | number | null int4?: NullableIntFieldUpdateOperationsInput | number | null + int8?: NullableBigIntFieldUpdateOperationsInput | bigint | number | null float8?: NullableFloatFieldUpdateOperationsInput | number | null } @@ -7439,6 +7463,7 @@ export namespace Prisma { uuid?: NullableStringFieldUpdateOperationsInput | string | null int2?: NullableIntFieldUpdateOperationsInput | number | null int4?: NullableIntFieldUpdateOperationsInput | number | null + int8?: NullableBigIntFieldUpdateOperationsInput | bigint | number | null float8?: NullableFloatFieldUpdateOperationsInput | number | null relatedId?: NullableIntFieldUpdateOperationsInput | number | null } @@ -7760,6 +7785,17 @@ export namespace Prisma { not?: NestedUuidNullableFilter | string | null } + export type BigIntNullableFilter = { + equals?: bigint | number | null + in?: Enumerable | Enumerable | bigint | number | null + notIn?: Enumerable | Enumerable | bigint | number | null + lt?: bigint | number + lte?: bigint | number + gt?: bigint | number + gte?: bigint | number + not?: NestedBigIntNullableFilter | bigint | number | null + } + export type FloatNullableFilter = { equals?: number | null in?: Enumerable | number | null @@ -7787,6 +7823,7 @@ export namespace Prisma { uuid?: SortOrder int2?: SortOrder int4?: SortOrder + int8?: SortOrder float8?: SortOrder relatedId?: SortOrder } @@ -7795,6 +7832,7 @@ export namespace Prisma { id?: SortOrder int2?: SortOrder int4?: SortOrder + int8?: SortOrder float8?: SortOrder relatedId?: SortOrder } @@ -7810,6 +7848,7 @@ export namespace Prisma { uuid?: SortOrder int2?: SortOrder int4?: SortOrder + int8?: SortOrder float8?: SortOrder relatedId?: SortOrder } @@ -7825,6 +7864,7 @@ export namespace Prisma { uuid?: SortOrder int2?: SortOrder int4?: SortOrder + int8?: SortOrder float8?: SortOrder relatedId?: SortOrder } @@ -7833,6 +7873,7 @@ export namespace Prisma { id?: SortOrder int2?: SortOrder int4?: SortOrder + int8?: SortOrder float8?: SortOrder relatedId?: SortOrder } @@ -7874,6 +7915,22 @@ export namespace Prisma { _max?: NestedStringNullableFilter } + export type BigIntNullableWithAggregatesFilter = { + equals?: bigint | number | null + in?: Enumerable | Enumerable | bigint | number | null + notIn?: Enumerable | Enumerable | bigint | number | null + lt?: bigint | number + lte?: bigint | number + gt?: bigint | number + gte?: bigint | number + not?: NestedBigIntNullableWithAggregatesFilter | bigint | number | null + _count?: NestedIntNullableFilter + _avg?: NestedFloatNullableFilter + _sum?: NestedBigIntNullableFilter + _min?: NestedBigIntNullableFilter + _max?: NestedBigIntNullableFilter + } + export type FloatNullableWithAggregatesFilter = { equals?: number | null in?: Enumerable | number | null @@ -8067,6 +8124,14 @@ export namespace Prisma { set?: boolean | null } + export type NullableBigIntFieldUpdateOperationsInput = { + set?: bigint | number | null + increment?: bigint | number + decrement?: bigint | number + multiply?: bigint | number + divide?: bigint | number + } + export type NullableFloatFieldUpdateOperationsInput = { set?: number | null increment?: number @@ -8292,6 +8357,17 @@ export namespace Prisma { not?: NestedUuidNullableFilter | string | null } + export type NestedBigIntNullableFilter = { + equals?: bigint | number | null + in?: Enumerable | Enumerable | bigint | number | null + notIn?: Enumerable | Enumerable | bigint | number | null + lt?: bigint | number + lte?: bigint | number + gt?: bigint | number + gte?: bigint | number + not?: NestedBigIntNullableFilter | bigint | number | null + } + export type NestedDateTimeNullableWithAggregatesFilter = { equals?: Date | string | null in?: Enumerable | Enumerable | Date | string | null @@ -8328,6 +8404,22 @@ export namespace Prisma { _max?: NestedStringNullableFilter } + export type NestedBigIntNullableWithAggregatesFilter = { + equals?: bigint | number | null + in?: Enumerable | Enumerable | bigint | number | null + notIn?: Enumerable | Enumerable | bigint | number | null + lt?: bigint | number + lte?: bigint | number + gt?: bigint | number + gte?: bigint | number + not?: NestedBigIntNullableWithAggregatesFilter | bigint | number | null + _count?: NestedIntNullableFilter + _avg?: NestedFloatNullableFilter + _sum?: NestedBigIntNullableFilter + _min?: NestedBigIntNullableFilter + _max?: NestedBigIntNullableFilter + } + export type NestedFloatNullableWithAggregatesFilter = { equals?: number | null in?: Enumerable | number | null @@ -8534,6 +8626,7 @@ export namespace Prisma { uuid?: string | null int2?: number | null int4?: number | null + int8?: bigint | number | null float8?: number | null } @@ -8548,6 +8641,7 @@ export namespace Prisma { uuid?: string | null int2?: number | null int4?: number | null + int8?: bigint | number | null float8?: number | null } @@ -8591,6 +8685,7 @@ export namespace Prisma { uuid?: UuidNullableFilter | string | null int2?: IntNullableFilter | number | null int4?: IntNullableFilter | number | null + int8?: BigIntNullableFilter | bigint | number | null float8?: FloatNullableFilter | number | null relatedId?: IntNullableFilter | number | null } @@ -8634,6 +8729,7 @@ export namespace Prisma { uuid?: string | null int2?: number | null int4?: number | null + int8?: bigint | number | null float8?: number | null } @@ -8648,6 +8744,7 @@ export namespace Prisma { uuid?: NullableStringFieldUpdateOperationsInput | string | null int2?: NullableIntFieldUpdateOperationsInput | number | null int4?: NullableIntFieldUpdateOperationsInput | number | null + int8?: NullableBigIntFieldUpdateOperationsInput | bigint | number | null float8?: NullableFloatFieldUpdateOperationsInput | number | null } @@ -8662,6 +8759,7 @@ export namespace Prisma { uuid?: NullableStringFieldUpdateOperationsInput | string | null int2?: NullableIntFieldUpdateOperationsInput | number | null int4?: NullableIntFieldUpdateOperationsInput | number | null + int8?: NullableBigIntFieldUpdateOperationsInput | bigint | number | null float8?: NullableFloatFieldUpdateOperationsInput | number | null } @@ -8676,6 +8774,7 @@ export namespace Prisma { uuid?: NullableStringFieldUpdateOperationsInput | string | null int2?: NullableIntFieldUpdateOperationsInput | number | null int4?: NullableIntFieldUpdateOperationsInput | number | null + int8?: NullableBigIntFieldUpdateOperationsInput | bigint | number | null float8?: NullableFloatFieldUpdateOperationsInput | number | null } diff --git a/clients/typescript/test/client/generated/client/index.js b/clients/typescript/test/client/generated/client/index.js deleted file mode 100644 index 5cc7d184e0..0000000000 --- a/clients/typescript/test/client/generated/client/index.js +++ /dev/null @@ -1,219 +0,0 @@ - -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, -} = require('./runtime/library') - - -const Prisma = {} - -exports.Prisma = Prisma - -/** - * Prisma Client JS version: 4.15.0 - * Query Engine version: 8fbc245156db7124f997f4cecdd8d1219e360944 - */ -Prisma.prismaVersion = { - client: "4.15.0", - engine: "8fbc245156db7124f997f4cecdd8d1219e360944" -} - -Prisma.PrismaClientKnownRequestError = PrismaClientKnownRequestError; -Prisma.PrismaClientUnknownRequestError = PrismaClientUnknownRequestError -Prisma.PrismaClientRustPanicError = PrismaClientRustPanicError -Prisma.PrismaClientInitializationError = PrismaClientInitializationError -Prisma.PrismaClientValidationError = PrismaClientValidationError -Prisma.NotFoundError = NotFoundError -Prisma.Decimal = Decimal - -/** - * Re-export of sql-template-tag - */ -Prisma.sql = sqltag -Prisma.empty = empty -Prisma.join = join -Prisma.raw = raw -Prisma.validator = () => (val) => val - - -/** - * Shorthand utilities for JSON filtering - */ -Prisma.DbNull = objectEnumValues.instances.DbNull -Prisma.JsonNull = objectEnumValues.instances.JsonNull -Prisma.AnyNull = objectEnumValues.instances.AnyNull - -Prisma.NullTypes = { - DbNull: objectEnumValues.classes.DbNull, - JsonNull: objectEnumValues.classes.JsonNull, - AnyNull: objectEnumValues.classes.AnyNull -} - - - const path = require('path') - -/** - * Enums - */ - -exports.Prisma.DataTypesScalarFieldEnum = { - id: 'id', - date: 'date', - time: 'time', - timetz: 'timetz', - timestamp: 'timestamp', - timestamptz: 'timestamptz', - bool: 'bool', - uuid: 'uuid', - int2: 'int2', - int4: 'int4', - float8: 'float8', - relatedId: 'relatedId' -}; - -exports.Prisma.DummyScalarFieldEnum = { - id: 'id', - timestamp: 'timestamp' -}; - -exports.Prisma.ItemsScalarFieldEnum = { - value: 'value', - nbr: 'nbr' -}; - -exports.Prisma.PostScalarFieldEnum = { - id: 'id', - title: 'title', - contents: 'contents', - nbr: 'nbr', - authorId: 'authorId' -}; - -exports.Prisma.ProfileScalarFieldEnum = { - id: 'id', - bio: 'bio', - userId: 'userId' -}; - -exports.Prisma.QueryMode = { - default: 'default', - insensitive: 'insensitive' -}; - -exports.Prisma.SortOrder = { - asc: 'asc', - desc: 'desc' -}; - -exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ - ReadUncommitted: 'ReadUncommitted', - ReadCommitted: 'ReadCommitted', - RepeatableRead: 'RepeatableRead', - Serializable: 'Serializable' -}); - -exports.Prisma.UserScalarFieldEnum = { - id: 'id', - name: 'name' -}; - - -exports.Prisma.ModelName = { - Items: 'Items', - User: 'User', - Post: 'Post', - Profile: 'Profile', - DataTypes: 'DataTypes', - Dummy: 'Dummy' -}; -/** - * Create the Client - */ -const config = { - "generator": { - "name": "client", - "provider": { - "fromEnvVar": null, - "value": "prisma-client-js" - }, - "output": { - "value": "/Users/kevin/Documents/Electric/development/electric/clients/typescript/test/client/generated/client", - "fromEnvVar": null - }, - "config": { - "engineType": "library" - }, - "binaryTargets": [ - { - "fromEnvVar": null, - "value": "darwin-arm64", - "native": true - } - ], - "previewFeatures": [], - "isCustomOutput": true - }, - "relativeEnvPaths": { - "rootEnvPath": null - }, - "relativePath": "../../prisma", - "clientVersion": "4.15.0", - "engineVersion": "8fbc245156db7124f997f4cecdd8d1219e360944", - "datasourceNames": [ - "db" - ], - "activeProvider": "postgresql", - "dataProxy": false, - "postinstall": false -} - -const fs = require('fs') - -config.dirname = __dirname -if (!fs.existsSync(path.join(__dirname, 'schema.prisma'))) { - config.dirname = path.join(process.cwd(), "generated/client") - config.isBundled = true -} - -config.runtimeDataModel = JSON.parse("{\"models\":{\"Items\":{\"dbName\":null,\"fields\":[{\"name\":\"value\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nbr\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"User\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"posts\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Post\",\"relationName\":\"PostToUser\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"profile\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Profile\",\"relationName\":\"ProfileToUser\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Post\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"contents\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nbr\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"authorId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"author\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"relationName\":\"PostToUser\",\"relationFromFields\":[\"authorId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Profile\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"bio\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"user\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"relationName\":\"ProfileToUser\",\"relationFromFields\":[\"userId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"DataTypes\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"date\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"time\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"timetz\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"timestamp\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"timestamptz\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"bool\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Boolean\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"uuid\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"@zod.string.uuid()\"},{\"name\":\"int2\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"@zod.number.int().gte(-32768).lte(32767)\"},{\"name\":\"int4\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"@zod.number.int().gte(-2147483648).lte(2147483647)\"},{\"name\":\"float8\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Float\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"@zod.custom.use(z.number().or(z.nan()))\"},{\"name\":\"relatedId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"related\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Dummy\",\"relationName\":\"DataTypesToDummy\",\"relationFromFields\":[\"relatedId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Dummy\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"timestamp\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"datatype\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DataTypes\",\"relationName\":\"DataTypesToDummy\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false}},\"enums\":{},\"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-darwin-arm64.dylib.node"); -path.join(process.cwd(), "generated/client/libquery_engine-darwin-arm64.dylib.node") -path.join(__dirname, "schema.prisma"); -path.join(process.cwd(), "generated/client/schema.prisma") diff --git a/clients/typescript/test/client/generated/client/package.json b/clients/typescript/test/client/generated/client/package.json deleted file mode 100644 index da6bb21c01..0000000000 --- a/clients/typescript/test/client/generated/client/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "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/clients/typescript/test/client/generated/client/runtime/index-browser.d.ts b/clients/typescript/test/client/generated/client/runtime/index-browser.d.ts deleted file mode 100644 index 428d217e7e..0000000000 --- a/clients/typescript/test/client/generated/client/runtime/index-browser.d.ts +++ /dev/null @@ -1,322 +0,0 @@ -declare class AnyNull extends NullTypesEnumValue { -} - -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 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 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; - }; -}; - -export { } diff --git a/clients/typescript/test/client/generated/client/runtime/index-browser.js b/clients/typescript/test/client/generated/client/runtime/index-browser.js deleted file mode 100644 index b6ce780ee4..0000000000 --- a/clients/typescript/test/client/generated/client/runtime/index-browser.js +++ /dev/null @@ -1,2411 +0,0 @@ -"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, - makeStrictEnum: () => makeStrictEnum, - objectEnumValues: () => objectEnumValues -}); -module.exports = __toCommonJS(index_browser_exports); - -// 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, - 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/clients/typescript/test/client/generated/client/runtime/index.d.ts b/clients/typescript/test/client/generated/client/runtime/index.d.ts deleted file mode 100644 index 96c2c1a1ef..0000000000 --- a/clients/typescript/test/client/generated/client/runtime/index.d.ts +++ /dev/null @@ -1,2726 +0,0 @@ -/** - * TODO - * @param this - */ -declare function $extends(this: Client, extension: Args | ((client: Client) => Client)): Client; - -declare type Action = keyof typeof DMMF.ModelAction | 'executeRaw' | 'queryRaw' | 'runCommandRaw'; - -declare type Aggregate = '_count' | '_max' | '_min' | '_avg' | '_sum'; - -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; -} - -declare type Args = OptionalFlat; - -declare class Args_2 { - args: Arg[]; - readonly hasInvalidArg: boolean; - constructor(args?: Arg[]); - get [Symbol.toStringTag](): string; - toString(): string; - collectErrors(): ArgError[]; -} - -declare type Args_3 = InternalArgs; - -declare type Args_4 = T extends { - [K: symbol]: { - types: { - [K in F]: { - args: any; - }; - }; - }; -} ? T[symbol]['types'][F]['args'] : never; - -declare type ArgValue = string | boolean | number | undefined | Args_2 | string[] | boolean[] | number[] | Args_2[] | 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 BatchQueryEngineResult = QueryEngineResult | Error; - -declare type BatchTransactionOptions = { - isolationLevel?: Transaction.IsolationLevel; -}; - -declare interface BinaryTargetsEnvValue { - fromEnvVar: string | null; - value: string; - native?: boolean; -} - -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]: Function; -}; - -declare type ClientArgs = { - client: ClientArg; -}; - -declare enum ClientEngineType { - Library = "library", - Binary = "binary" -} - -declare type Compute = T extends Function ? T : { - [K in keyof T]: T[K]; -} & 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 & { - [K in Exclude & string]: T[K]; -} & ContextMeta : T & ContextMeta; - -declare type ContextMeta = { - 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 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; -}; - -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; - -declare type DefaultArgs = InternalArgs<{}, {}, {}, {}>; - -export declare function defineDmmfProperty(target: object, runtimeDataModel: RuntimeDataModel): void; - -declare function defineExtension(ext: Args | ((client: Client) => Client)): (client: Client) => Client; - -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; -} - -/** - * 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; -}; - -declare namespace Extensions { - export { - defineExtension, - getExtensionContext - } -} -export { Extensions } - -declare namespace Extensions_2 { - export { - InternalArgs, - Args_3 as Args, - DefaultArgs, - GetResult, - GetSelect, - GetModel, - GetClient, - ReadonlySelector, - RequiredArgs as UserArgs - } -} - -declare type Fetch = typeof nodeFetch; - -declare class Field { - readonly name: string; - readonly args?: Args_2; - 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_2; - 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 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 : Count; -}; - -declare type GetBatchResult = { - count: number; -}; - -declare type GetClient, C extends Args_3['client']> = Omit & { - [K in keyof C]: ReturnType; -}; - -declare type GetCountResult = A extends { - select: infer S; -} ? S extends true ? number : Count : number; - -declare function getExtensionContext(that: T): Context_2; - -declare type GetFindResult

= A extends { - select: infer S; -} & Record | { - include: infer S; -} & Record ? { - [K in keyof S as S[K] extends false | undefined | null ? never : K]: S[K] extends true ? P extends { - objects: { - [k in K]: (infer O)[]; - }; - } ? O extends Payload ? O['scalars'][] : never : P extends { - objects: { - [k in K]: (infer O) | null; - }; - } ? O extends Payload ? O['scalars'] | P['objects'][K] & null : never : P extends { - scalars: { - [k in K]: infer O; - }; - } ? O : K extends '_count' ? Count : never : P extends { - objects: { - [k in K]: (infer O)[]; - }; - } ? O extends Payload ? GetFindResult[] : never : P extends { - objects: { - [k in K]: (infer O) | null; - }; - } ? O extends Payload ? GetFindResult | P['objects'][K] & null : never : K extends '_count' ? Count> : never; -} & (A extends { - include: any; -} & Record ? P['scalars'] : unknown) : P['scalars']; - -declare type GetGroupByResult = P extends Payload ? A extends { - by: string[]; -} ? Array & { - [K in A['by'][number]]: P['scalars'][K]; -}> : never : never; - -declare type GetModel, M extends Args_3['model'][string]> = { - [K in keyof M | keyof Base]: K extends keyof M ? ReturnType : Base[K]; -}; - -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; - 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): 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; - /** - * 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; - /** - * Executes a raw command only for MongoDB - * - * @param command - * @returns - */ - $runCommandRaw(command: object): PrismaPromise; - /** - * Executes a raw query and returns selected data - */ - $queryRawInternal(transaction: PrismaPromiseTransaction | undefined, clientMethod: string, args: RawQueryArgs): 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; - /** - * 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; - /** - * 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; - /** - * 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; -}; - -declare type GetResult, R extends Args_3['result'][string]> = { - [K in keyof R | keyof Base]: K extends keyof R ? ReturnType['compute']> : Base[K]; -} & unknown; - -declare type GetResult_2

= { - findUnique: GetFindResult; - findUniqueOrThrow: GetFindResult; - findFirst: GetFindResult; - 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: any; - $executeRaw: any; - $queryRawUnsafe: any; - $executeRawUnsafe: any; - $runCommandRaw: object; -}[O]; - -declare type GetSelect, R extends Args_3['result'][string]> = { - [K in keyof R | keyof Base]?: K extends keyof R ? 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; - -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) => UserArgs; - /** 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" -} - -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 type JsonFieldSelection = { - arguments?: Record; - selection: JsonSelectionSet; -}; - -declare class JsonNull extends NullTypesEnumValue { -} - -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 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): MergedExtensionsList; - isEmpty(): boolean; - append(extension: Args): MergedExtensionsList; - getAllComputedFields(dmmfModelName: string): ComputedFieldsMap | undefined; - getAllClientExtensions(): ClientArg | undefined; - getAllModelExtensions(dmmfModelName: string): ModelArg | undefined; - getAllQueryCallbacks(jsModelName: string, operation: string): any; -} - -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 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]: Function; -}; - -declare type ModelArgs = { - model: { - [ModelName in string]: ModelArg; - }; -}; - -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' | '$runCommandRaw'; - -declare type OptionalFlat = { - [K in keyof T]?: T[K]; -}; - -/** - * maxWait ?= 2000 - * timeout ?= 5000 - */ -declare type Options = { - maxWait?: number; - timeout?: number; - isolationLevel?: IsolationLevel; -}; - -declare type PatchDeep = { - [K in keyof O]: K extends keyof O1 ? K extends keyof O2 ? O1[K] extends object ? O2[K] extends object ? O1[K] extends Function ? O1[K] : O2[K] extends Function ? O1[K] : PatchDeep : O1[K] : O1[K] : O1[K] : O2[K & keyof O2]; -}; - -declare type PatchFlat = O1 & Omit_2; - -/** - * Patches 3 objects on top of each other with minimal looping. - * This is a more efficient way of doing `PatchFlat>` - */ -declare type PatchFlat3 = A & { - [K in Exclude]: K extends keyof B ? B[K] : C[K & keyof C]; -}; - -export declare type Payload = { - scalars: { - [ScalarName in string]: unknown; - }; - objects: { - [ObjectName in string]: unknown; - }; -}; - -declare type Payload_2 = T extends { - [K: symbol]: { - types: { - [K in F]: { - payload: any; - }; - }; - }; -} ? T[symbol]['types'][F]['payload'] : never; - -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; -} - -/** - * 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 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 interface PrismaPromise_2 extends Promise { - [Symbol.toStringTag]: 'PrismaPromise'; -} - -declare type PrismaPromiseBatchTransaction = { - kind: 'batch'; - id: number; - isolationLevel?: IsolationLevel; - index: number; - lock: PromiseLike; -}; - -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 { - Args_4 as Args, - Result, - Payload_2 as Payload, - PrismaPromise_2 as 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; -}; - -declare type QueryOptions = { - query: { - [ModelName in string]: { - [ModelAction in string]: QueryOptionsCb; - } | QueryOptionsCb; - }; -}; - -declare type QueryOptionsCb = (args: QueryOptionsCbArgs) => Promise; - -declare type QueryOptionsCbArgs = { - model?: string; - operation: string; - args: object; - query: (args: object) => Promise; -}; - -/** - * Create raw SQL statement. - */ -export declare function raw(value: string): Sql; - -declare type RawParameters = { - __prismaRawParameters__: true; - values: string; -}; - -declare type RawQueryArgs = [query: string | TemplateStringsArray | Sql, ...values: RawValue[]]; - -/** - * Supported value or SQL instance. - */ -export declare type RawValue = Value | Sql; - -declare type ReadonlyDeep = { - readonly [K in keyof T]: ReadonlyDeep; -}; - -declare type ReadonlySelector = T extends unknown ? { - readonly [K in keyof T as K extends 'include' | 'select' ? K : never]: ReadonlyDeep; -} & { - [K in keyof T as K extends 'include' | 'select' ? never : K]: T[K]; -} : never; - -declare type RejectOnNotFound = boolean | ((error: Error) => Error) | undefined; - -declare type Request_2 = { - protocolMessage: ProtocolMessage; - protocolEncoder: ProtocolEncoder; - transaction?: PrismaPromiseTransaction; - otelParentCtx?: Context; - otelChildCtx?: Context; - customDataProxyFetch?: (fetch: Fetch) => Fetch; -}; - -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({ protocolMessage, protocolEncoder, dataPath, callsite, modelName, rejectOnNotFound, clientMethod, args, transaction, unpacker, extensions, otelParentCtx, otelChildCtx, customDataProxyFetch, }: RequestParams): Promise; - /** - * 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; - 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 RequiredArgs = NameArgs & ResultArgs & ModelArgs & ClientArgs & QueryOptions; - -declare type Result = T extends { - [K: symbol]: { - types: { - [K in F]: { - 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 RuntimeDataModel = { - readonly models: Record; - readonly enums: Record; - readonly types: Record; -}; - -declare type RuntimeEnum = Omit; - -declare type RuntimeModel = Omit; - -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 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 namespace Types { - export { - Extensions_2 as Extensions, - Utils, - Public, - GetResult_2 as GetResult, - GetFindResult, - Payload - } -} -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; -} - -/** - * Input that flows from the user into the Client. - */ -declare type UserArgs = any; - -declare namespace Utils { - export { - EmptyToUnknown, - NeverToUnknown, - PatchFlat, - PatchDeep, - Omit_2 as Omit, - Pick_2 as Pick, - PatchFlat3, - Compute, - OptionalFlat, - ReadonlyDeep, - Narrow, - Exact, - Cast, - LegacyExact, - WrapPropsInFnDeep - } -} - -/** - * 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; - -declare type WrapPropsInFnDeep = { - [K in keyof T]: T[K] extends Function ? T[K] : T[K] extends object ? WrapPropsInFnDeep : () => T[K]; -} & {}; - -export { } diff --git a/clients/typescript/test/client/generated/client/runtime/library.d.ts b/clients/typescript/test/client/generated/client/runtime/library.d.ts deleted file mode 100644 index 4a56e5f1c0..0000000000 --- a/clients/typescript/test/client/generated/client/runtime/library.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./index" diff --git a/clients/typescript/test/client/generated/client/runtime/library.js b/clients/typescript/test/client/generated/client/runtime/library.js deleted file mode 100644 index 50ed3cc21e..0000000000 --- a/clients/typescript/test/client/generated/client/runtime/library.js +++ /dev/null @@ -1,212 +0,0 @@ -"use strict";var zu=Object.create;var mr=Object.defineProperty;var Yu=Object.getOwnPropertyDescriptor;var Zu=Object.getOwnPropertyNames;var Xu=Object.getPrototypeOf,el=Object.prototype.hasOwnProperty;var _=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),dr=(e,t)=>{for(var r in t)mr(e,r,{get:t[r],enumerable:!0})},so=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Zu(t))!el.call(e,i)&&i!==r&&mr(e,i,{get:()=>t[i],enumerable:!(n=Yu(t,i))||n.enumerable});return e};var S=(e,t,r)=>(r=e!=null?zu(Xu(e)):{},so(t||!e||!e.__esModule?mr(r,"default",{value:e,enumerable:!0}):r,e)),tl=e=>so(mr({},"__esModule",{value:!0}),e);var bo=_((id,yo)=>{var lt=1e3,ct=lt*60,pt=ct*60,rt=pt*24,nl=rt*7,il=rt*365.25;yo.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return ol(e);if(r==="number"&&isFinite(e))return t.long?al(e):sl(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function ol(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*il;case"weeks":case"week":case"w":return r*nl;case"days":case"day":case"d":return r*rt;case"hours":case"hour":case"hrs":case"hr":case"h":return r*pt;case"minutes":case"minute":case"mins":case"min":case"m":return r*ct;case"seconds":case"second":case"secs":case"sec":case"s":return r*lt;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function sl(e){var t=Math.abs(e);return t>=rt?Math.round(e/rt)+"d":t>=pt?Math.round(e/pt)+"h":t>=ct?Math.round(e/ct)+"m":t>=lt?Math.round(e/lt)+"s":e+"ms"}function al(e){var t=Math.abs(e);return t>=rt?hr(e,t,rt,"day"):t>=pt?hr(e,t,pt,"hour"):t>=ct?hr(e,t,ct,"minute"):t>=lt?hr(e,t,lt,"second"):e+" ms"}function hr(e,t,r,n){var i=t>=r*1.5;return Math.round(e/r)+" "+n+(i?"s":"")}});var In=_((od,wo)=>{function ul(e){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=s,r.humanize=bo(),r.destroy=l,Object.keys(e).forEach(c=>{r[c]=e[c]}),r.names=[],r.skips=[],r.formatters={};function t(c){let p=0;for(let f=0;f{if(O==="%%")return"%";E++;let I=r.formatters[q];if(typeof I=="function"){let G=b[E];O=I.call(h,G),b.splice(E,1),E--}return O}),r.formatArgs.call(h,b),(h.log||r.log).apply(h,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:()=>f!==null?f:(m!==r.namespaces&&(m=r.namespaces,d=r.enabled(c)),d),set:b=>{f=b}}),typeof r.init=="function"&&r.init(g),g}function n(c,p){let f=r(this.namespace+(typeof p>"u"?":":p)+c);return f.log=this.log,f}function i(c){r.save(c),r.namespaces=c,r.names=[],r.skips=[];let p,f=(typeof c=="string"?c:"").split(/[\s,]+/),m=f.length;for(p=0;p"-"+p)].join(",");return r.enable(""),c}function s(c){if(c[c.length-1]==="*")return!0;let p,f;for(p=0,f=r.skips.length;p{de.formatArgs=cl;de.save=pl;de.load=fl;de.useColors=ll;de.storage=ml();de.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`."))}})();de.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 ll(){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 cl(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+yr.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)}de.log=console.debug||console.log||(()=>{});function pl(e){try{e?de.storage.setItem("debug",e):de.storage.removeItem("debug")}catch{}}function fl(){let e;try{e=de.storage.getItem("debug")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function ml(){try{return localStorage}catch{}}yr.exports=In()(de);var{formatters:dl}=yr.exports;dl.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Nn=_((sd,Eo)=>{"use strict";Eo.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 gl=require("os"),To=require("tty"),we=Nn(),{env:z}=process,Ve;we("no-color")||we("no-colors")||we("color=false")||we("color=never")?Ve=0:(we("color")||we("colors")||we("color=true")||we("color=always"))&&(Ve=1);"FORCE_COLOR"in z&&(z.FORCE_COLOR==="true"?Ve=1:z.FORCE_COLOR==="false"?Ve=0:Ve=z.FORCE_COLOR.length===0?1:Math.min(parseInt(z.FORCE_COLOR,10),3));function kn(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Ln(e,t){if(Ve===0)return 0;if(we("color=16m")||we("color=full")||we("color=truecolor"))return 3;if(we("color=256"))return 2;if(e&&!t&&Ve===void 0)return 0;let r=Ve||0;if(z.TERM==="dumb")return r;if(process.platform==="win32"){let n=gl.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in z)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in z)||z.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in z)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(z.TEAMCITY_VERSION)?1:0;if(z.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in z){let n=parseInt((z.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(z.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(z.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(z.TERM)||"COLORTERM"in z?1:r}function hl(e){let t=Ln(e,e&&e.isTTY);return kn(t)}vo.exports={supportsColor:hl,stdout:kn(Ln(!0,To.isatty(1))),stderr:kn(Ln(!0,To.isatty(2)))}});var Mo=_((Y,wr)=>{var yl=require("tty"),br=require("util");Y.init=Pl;Y.log=El;Y.formatArgs=wl;Y.save=Tl;Y.load=vl;Y.useColors=bl;Y.destroy=br.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Y.colors=[6,2,3,4,5,1];try{let e=_n();e&&(e.stderr||e).level>=2&&(Y.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{}Y.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 bl(){return"colors"in Y.inspectOpts?Boolean(Y.inspectOpts.colors):yl.isatty(process.stderr.fd)}function wl(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+"+wr.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=xl()+t+" "+e[0]}function xl(){return Y.inspectOpts.hideDate?"":new Date().toISOString()+" "}function El(...e){return process.stderr.write(br.format(...e)+` -`)}function Tl(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function vl(){return process.env.DEBUG}function Pl(e){e.inspectOpts={};let t=Object.keys(Y.inspectOpts);for(let r=0;rt.trim()).join(" ")};Po.O=function(e){return this.inspectOpts.colors=this.useColors,br.inspect(e,this.inspectOpts)}});var Fo=_((ud,jn)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?jn.exports=xo():jn.exports=Mo()});var Ao=_((cd,Cl)=>{Cl.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 Ro=_((pd,Tr)=>{var Sl=require("fs"),Oo=require("path"),Al=require("os"),Ol=Ao(),Rl=Ol.version,$l=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Dl(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,` -`);let n;for(;(n=$l.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 Bn(e){console.log(`[dotenv@${Rl}][DEBUG] ${e}`)}function Il(e){return e[0]==="~"?Oo.join(Al.homedir(),e.slice(1)):e}function Nl(e){let t=Oo.resolve(process.cwd(),".env"),r="utf8",n=Boolean(e&&e.debug),i=Boolean(e&&e.override);e&&(e.path!=null&&(t=Il(e.path)),e.encoding!=null&&(r=e.encoding));try{let o=Er.parse(Sl.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&&Bn(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&&Bn(`Failed to load ${t} ${o.message}`),{error:o}}}var Er={config:Nl,parse:Dl};Tr.exports.config=Er.config;Tr.exports.parse=Er.parse;Tr.exports=Er});var Lo=_((bd,ko)=>{"use strict";ko.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var Gn=_((wd,_o)=>{"use strict";var jl=Lo();_o.exports=e=>{let t=jl(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}});var Uo=_(($d,zn)=>{"use strict";var $=zn.exports;zn.exports.default=$;var N="\x1B[",Lt="\x1B]",dt="\x07",Fr=";",Vo=process.env.TERM_PROGRAM==="Apple_Terminal";$.cursorTo=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof t!="number"?N+(e+1)+"G":N+(t+1)+";"+(e+1)+"H"};$.cursorMove=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let r="";return e<0?r+=N+-e+"D":e>0&&(r+=N+e+"C"),t<0?r+=N+-t+"A":t>0&&(r+=N+t+"B"),r};$.cursorUp=(e=1)=>N+e+"A";$.cursorDown=(e=1)=>N+e+"B";$.cursorForward=(e=1)=>N+e+"C";$.cursorBackward=(e=1)=>N+e+"D";$.cursorLeft=N+"G";$.cursorSavePosition=Vo?"\x1B7":N+"s";$.cursorRestorePosition=Vo?"\x1B8":N+"u";$.cursorGetPosition=N+"6n";$.cursorNextLine=N+"E";$.cursorPrevLine=N+"F";$.cursorHide=N+"?25l";$.cursorShow=N+"?25h";$.eraseLines=e=>{let t="";for(let r=0;r[Lt,"8",Fr,Fr,t,dt,e,Lt,"8",Fr,Fr,dt].join("");$.image=(e,t={})=>{let r=`${Lt}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};$.iTerm={setCwd:(e=process.cwd())=>`${Lt}50;CurrentDir=${e}${dt}`,annotation:(e,t={})=>{let r=`${Lt}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 Jo=_((Dd,Go)=>{"use strict";var Ul=_n(),gt=Nn();function Qo(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 Yn(e){let{env:t}=process;if("FORCE_HYPERLINK"in t)return!(t.FORCE_HYPERLINK.length>0&&parseInt(t.FORCE_HYPERLINK,10)===0);if(gt("no-hyperlink")||gt("no-hyperlinks")||gt("hyperlink=false")||gt("hyperlink=never"))return!1;if(gt("hyperlink=true")||gt("hyperlink=always")||"NETLIFY"in t)return!0;if(!Ul.supportsColor(e)||e&&!e.isTTY||process.platform==="win32"||"CI"in t||"TEAMCITY_VERSION"in t)return!1;if("TERM_PROGRAM"in t){let r=Qo(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=Qo(t.VTE_VERSION);return r.major>0||r.minor>=50}return!1}Go.exports={supportsHyperlink:Yn,stdout:Yn(process.stdout),stderr:Yn(process.stderr)}});var Wo=_((Id,_t)=>{"use strict";var Ql=Uo(),Zn=Jo(),Ko=(e,t,{target:r="stdout",...n}={})=>Zn[r]?Ql.link(e,t):n.fallback===!1?e:typeof n.fallback=="function"?n.fallback(e,t):`${e} (\u200B${t}\u200B)`;_t.exports=(e,t,r={})=>Ko(e,t,r);_t.exports.stderr=(e,t,r={})=>Ko(e,t,{target:"stderr",...r});_t.exports.isSupported=Zn.stdout;_t.exports.stderr.isSupported=Zn.stderr});var is=_((Zd,oc)=>{oc.exports={name:"@prisma/engines-version",version:"4.15.0-28.8fbc245156db7124f997f4cecdd8d1219e360944",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"8fbc245156db7124f997f4cecdd8d1219e360944"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.16.14",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var ri=_(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.enginesVersion=void 0;Or.enginesVersion=is().prisma.enginesVersion});var Bt=_((pg,as)=>{"use strict";as.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 ps=_((dg,cs)=>{"use strict";cs.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 Qt=_((gg,fs)=>{"use strict";var gc=ps();fs.exports=e=>typeof e=="string"?e.replace(gc(),""):e});var ms=_((wg,$r)=>{"use strict";$r.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()};$r.exports.default=$r.exports});var Br=_((ph,$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 Mi=="object"&&typeof Fi=="object"?Fi.exports=t():e.pluralize=t()})(Mi,function(){var e=[],t=[],r={},n={},i={};function o(m){return typeof m=="string"?new RegExp("^"+m+"$","i"):m}function s(m,d){return m===d?d:m===m.toLowerCase()?d.toLowerCase():m===m.toUpperCase()?d.toUpperCase():m[0]===m[0].toUpperCase()?d.charAt(0).toUpperCase()+d.substr(1).toLowerCase():d.toLowerCase()}function a(m,d){return m.replace(/\$(\d{1,2})/g,function(g,b){return d[b]||""})}function u(m,d){return m.replace(d[0],function(g,b){var h=a(d[1],arguments);return s(g===""?m[b-1]:g,h)})}function l(m,d,g){if(!m.length||r.hasOwnProperty(m))return d;for(var b=g.length;b--;){var h=g[b];if(h[0].test(d))return u(d,h)}return d}function c(m,d,g){return function(b){var h=b.toLowerCase();return d.hasOwnProperty(h)?s(b,h):m.hasOwnProperty(h)?s(b,m[h]):l(h,b,g)}}function p(m,d,g,b){return function(h){var x=h.toLowerCase();return d.hasOwnProperty(x)?!0:m.hasOwnProperty(x)?!1:l(x,x,g)===x}}function f(m,d,g){var b=d===1?f.singular(m):f.plural(m);return(g?d+" ":"")+b}return f.plural=c(i,n,e),f.isPlural=p(i,n,e),f.singular=c(n,i,t),f.isSingular=p(n,i,t),f.addPluralRule=function(m,d){e.push([o(m),d])},f.addSingularRule=function(m,d){t.push([o(m),d])},f.addUncountableRule=function(m){if(typeof m=="string"){r[m.toLowerCase()]=!0;return}f.addPluralRule(m,"$0"),f.addSingularRule(m,"$0")},f.addIrregularRule=function(m,d){d=d.toLowerCase(),m=m.toLowerCase(),i[m]=d,n[d]=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 f.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 f.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 f.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(f.addUncountableRule),f})});var va=_((Mb,Ta)=>{"use strict";Ta.exports=e=>Object.prototype.toString.call(e)==="[object RegExp]"});var Ma=_((Fb,Pa)=>{"use strict";Pa.exports=e=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")}});var Fa=_(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.default=e=>Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))});var Qa=_((jw,Rf)=>{Rf.exports={name:"@prisma/client",version:"4.15.0",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 --silent --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"],devDependencies:{"@codspeed/benchmark.js-plugin":"1.1.0","@faker-js/faker":"8.0.1","@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.32","@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.1","@types/js-levenshtein":"1.1.1","@types/mssql":"8.1.2","@types/node":"18.16.14","@types/pg":"8.10.1","@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.15.0","flat-map-polyfill":"0.3.8","fs-extra":"11.1.0","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.0.2",memfs:"3.5.1",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.1",rimraf:"3.0.2","simple-statistics":"7.8.2","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.0","yeoman-generator":"5.9.0",yo:"4.3.1",zx:"7.2.2"},peerDependencies:{prisma:"*"},peerDependenciesMeta:{prisma:{optional:!0}},dependencies:{"@prisma/engines-version":"4.15.0-28.8fbc245156db7124f997f4cecdd8d1219e360944"},sideEffects:!1}});var Nm={};dr(Nm,{DMMF:()=>xe,DMMFClass:()=>We,Debug:()=>qn,Decimal:()=>he,Extensions:()=>Rn,MetricsClient:()=>bt,NotFoundError:()=>ve,PrismaClientInitializationError:()=>Q,PrismaClientKnownRequestError:()=>re,PrismaClientRustPanicError:()=>ge,PrismaClientUnknownRequestError:()=>ne,PrismaClientValidationError:()=>K,Sql:()=>be,Types:()=>$n,decompressFromBase64:()=>Wu,defineDmmfProperty:()=>hs,empty:()=>bu,getPrismaClient:()=>Ju,join:()=>yu,makeDocument:()=>sn,makeStrictEnum:()=>Ku,objectEnumValues:()=>Et,raw:()=>Xi,sqltag:()=>eo,transformDocument:()=>Aa,unpack:()=>an,warnEnvConflicts:()=>Hu,warnOnce:()=>Jt});module.exports=tl(Nm);var Rn={};dr(Rn,{defineExtension:()=>ao,getExtensionContext:()=>uo});function ao(e){return typeof e=="function"?e:t=>t.$extends(e)}function uo(e){return e}var $n={};dr($n,{Extensions:()=>lo,Public:()=>co,Utils:()=>po});var lo={};var co={};var po={};var Dn,fo,mo,go,ho=!0;typeof process<"u"&&({FORCE_COLOR:Dn,NODE_DISABLE_COLORS:fo,NO_COLOR:mo,TERM:go}=process.env||{},ho=process.stdout&&process.stdout.isTTY);var rl={enabled:!fo&&mo==null&&go!=="dumb"&&(Dn!=null&&Dn!=="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!rl.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var Bm=j(0,0),M=j(1,22),D=j(2,22),Vm=j(3,23),le=j(4,24),Um=j(7,27),Qm=j(8,28),Gm=j(9,29),Jm=j(30,39),R=j(31,39),A=j(32,39),Ae=j(33,39),ut=j(34,39),Km=j(35,39),Be=j(36,39),Dt=j(37,39),gr=j(90,39),Wm=j(90,39),Hm=j(40,49),zm=j(41,49),Ym=j(42,49),Zm=j(43,49),Xm=j(44,49),ed=j(45,49),td=j(46,49),rd=j(47,49);var xr=S(Fo()),Ml=100,It=[];typeof process<"u"&&typeof process.stderr?.write!="function"&&(xr.default.log=console.debug??console.log);function Fl(e){let t=(0,xr.default)(e),r=Object.assign((...n)=>(t.log=r.log,n.length!==0&&It.push([e,...n]),It.length>Ml&&It.shift(),t("",...n)),t);return r}var qn=Object.assign(Fl,xr.default);function Co(e=7500){let t=It.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 u=a[1],l,c;if(u==="\\")c=a[0],l=c.replace("\\$","$");else{let p=a[2];c=a[0].substring(u.length),l=Object.hasOwnProperty.call(t,p)?t[p]:e.parsed[p]||"",l=r(l)}return o.replace(c,l)},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 Vn=B("prisma:tryLoadEnv");function Nt({rootEnvPath:e,schemaEnvPath:t},r={conflictCheck:"none"}){let n=Do(e);r.conflictCheck!=="none"&&kl(n,t,r.conflictCheck);let i=null;return Io(n?.path,t)||(i=Do(t)),!n&&!i&&Vn("No Environment variables loaded"),i?.dotenvResult.error?console.error(R(M("Schema Env Error: "))+i.dotenvResult.error):{message:[n?.message,i?.message].filter(Boolean).join(` -`),parsed:{...n?.dotenvResult?.parsed,...i?.dotenvResult?.parsed}}}function kl(e,t,r){let n=e?.dotenvResult.parsed,i=!Io(e?.path,t);if(n&&t&&i&&vr.default.existsSync(t)){let o=Un.default.parse(vr.default.readFileSync(t)),s=[];for(let a in o)n[a]===o[a]&&s.push(a);if(s.length>0){let a=ft.default.relative(process.cwd(),e.path),u=ft.default.relative(process.cwd(),t);if(r==="error"){let l=`There is a conflict between env var${s.length>1?"s":""} in ${le(a)} and ${le(u)} -Conflicting env vars: -${s.map(c=>` ${M(c)}`).join(` -`)} - -We suggest to move the contents of ${le(u)} to ${le(a)} to consolidate your env vars. -`;throw new Error(l)}else if(r==="warn"){let l=`Conflict for env var${s.length>1?"s":""} ${s.map(c=>M(c)).join(", ")} in ${le(a)} and ${le(u)} -Env vars from ${le(u)} overwrite the ones from ${le(a)} - `;console.warn(`${Ae("warn(prisma)")} ${l}`)}}}}function Do(e){return Ll(e)?(Vn(`Environment variables loaded from ${e}`),{dotenvResult:$o(Un.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0})),message:D(`Environment variables loaded from ${ft.default.relative(process.cwd(),e)}`),path:e}):(Vn(`Environment variables not found at ${e}`),null)}function Io(e,t){return e&&t&&ft.default.resolve(e)===ft.default.resolve(t)}function Ll(e){return Boolean(e&&vr.default.existsSync(e))}var No="library";function Qn(e){let t=_l();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":No)}function _l(){let e=process.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}var ql=S(Gn());function kt(e){return e instanceof Error}function Jn(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 Pr=Symbol("@ts-pattern/matcher"),jo="@ts-pattern/anonymous-select-key",qo=function(e){return Boolean(e&&typeof e=="object")},Kn=function(e){return e&&!!e[Pr]},Bl=function e(t,r,n){if(qo(t)){if(Kn(t)){var i=t[Pr]().match(r),o=i.matched,s=i.selections;return o&&s&&Object.keys(s).forEach(function(u){return n(u,s[u])}),o}if(!qo(r))return!1;if(Array.isArray(t))return!!Array.isArray(r)&&t.length===r.length&&t.every(function(u,l){return e(u,r[l],n)});if(t instanceof Map)return r instanceof Map&&Array.from(t.keys()).every(function(u){return e(t.get(u),r.get(u),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 Kn(a)?Array.from(r.values()).every(function(u){return e(a,u,n)}):r.has(a)}return Array.from(t.values()).every(function(u){return r.has(u)})}return Object.keys(t).every(function(u){var l,c=t[u];return(u in r||Kn(l=c)&&l[Pr]().matcherType==="optional")&&e(c,r[u],n)})}return Object.is(r,t)};function nt(e){var t;return(t={})[Pr]=function(){return{match:function(r){return{matched:Boolean(e(r))}}}},t}var Td=nt(function(e){return!0});var vd=nt(function(e){return typeof e=="string"}),Pd=nt(function(e){return typeof e=="number"}),Md=nt(function(e){return typeof e=="boolean"}),Fd=nt(function(e){return typeof e=="bigint"}),Cd=nt(function(e){return typeof e=="symbol"}),Sd=nt(function(e){return e==null});function mt(e){return new Vl(e,[])}var Vl=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={},u=Boolean(i.some(function(l){return Bl(l,s,function(c,p){a[c]=p})})&&o.every(function(l){return l(s)}));return{matched:u,value:u&&Object.keys(a).length?jo in a?a[jo]: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 qt(e,...t){Jl.warn()&&console.warn(`${Gl.warn} ${e}`,...t)}var Kl=(0,Xo.promisify)(Zo.default.exec),pe=B("prisma:get-platform"),Wl=["1.0.x","1.1.x","3.0.x"];async function es(){let e=Sr.default.platform(),t=process.arch;if(e==="freebsd"){let s=await Ar("freebsd-version");if(s&&s.trim().length>0){let u=/^(\d+)\.?/.exec(s);if(u)return{platform:"freebsd",targetDistro:`freebsd${u[1]}`,arch:t}}}if(e!=="linux")return{platform:e,arch:t};let r=await zl(),n=await ic(),i=Zl({arch:t,archFromUname:n,familyDistro:r.familyDistro}),{libssl:o}=await Xl(i);return{platform:"linux",libssl:o,arch:t,archFromUname:n,...r}}function Hl(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=mt({id:i,idLike:s}).with({id:"alpine"},({id:u})=>({targetDistro:"musl",familyDistro:u,originalDistro:u})).with({id:"raspbian"},({id:u})=>({targetDistro:"arm",familyDistro:"debian",originalDistro:u})).with({id:"nixos"},({id:u})=>({targetDistro:"nixos",originalDistro:u,familyDistro:"nixos"})).with({id:"debian"},{id:"ubuntu"},({id:u})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:u})).with({id:"rhel"},{id:"centos"},{id:"fedora"},({id:u})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:u})).when(({idLike:u})=>u.includes("debian")||u.includes("ubuntu"),({id:u})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:u})).when(({idLike:u})=>i==="arch"||u.includes("arch"),({id:u})=>({targetDistro:"debian",familyDistro:"arch",originalDistro:u})).when(({idLike:u})=>u.includes("centos")||u.includes("fedora")||u.includes("rhel")||u.includes("suse"),({id:u})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:u})).otherwise(({id:u})=>({targetDistro:void 0,familyDistro:void 0,originalDistro:u}));return pe(`Found distro info: -${JSON.stringify(a,null,2)}`),a}async function zl(){let e="/etc/os-release";try{let t=await Xn.default.readFile(e,{encoding:"utf-8"});return Hl(t)}catch{return{targetDistro:void 0,familyDistro:void 0,originalDistro:void 0}}}function Yl(e){let t=/^OpenSSL\s(\d+\.\d+)\.\d+/.exec(e);if(t){let r=`${t[1]}.x`;return ts(r)}}function zo(e){let t=/libssl\.so\.(\d)(\.\d)?/.exec(e);if(t){let r=`${t[1]}${t[2]??".0"}.x`;return ts(r)}}function ts(e){let t=(()=>{if(ns(e))return e;let r=e.split(".");return r[1]="0",r.join(".")})();if(Wl.includes(t))return t}function Zl(e){return mt(e).with({familyDistro:"musl"},()=>(pe('Trying platform-specific paths for "alpine"'),["/lib"])).with({familyDistro:"debian"},({archFromUname:t})=>(pe('Trying platform-specific paths for "debian" (and "ubuntu")'),[`/usr/lib/${t}-linux-gnu`,`/lib/${t}-linux-gnu`])).with({familyDistro:"rhel"},()=>(pe('Trying platform-specific paths for "rhel"'),["/lib64","/usr/lib64"])).otherwise(({familyDistro:t,arch:r,archFromUname:n})=>(pe(`Don't know any platform-specific paths for "${t}" on ${r} (${n})`),[]))}async function Xl(e){let t='grep -v "libssl.so.0"',r=await Yo(e);if(r){pe(`Found libssl.so file using platform-specific paths: ${r}`);let o=zo(r);if(pe(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"libssl-specific-path"}}pe('Falling back to "ldconfig" and other generic paths');let n=await Ar(`ldconfig -p | sed "s/.*=>s*//" | sed "s|.*/||" | grep libssl | sort | ${t}`);if(n||(n=await Yo(["/lib64","/usr/lib64","/lib"])),n){pe(`Found libssl.so file using "ldconfig" or other generic paths: ${n}`);let o=zo(n);if(pe(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"ldconfig"}}let i=await Ar("openssl version -v");if(i){pe(`Found openssl binary with version: ${i}`);let o=Yl(i);if(pe(`The parsed openssl version is: ${o}`),o)return{libssl:o,strategy:"openssl-binary"}}return pe("Couldn't find any version of libssl or OpenSSL in the system"),{}}async function Yo(e){for(let t of e){let r=await ec(t);if(r)return r}}async function ec(e){try{return(await Xn.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 ht(){let{binaryTarget:e}=await rs();return e}function tc(e){return e.binaryTarget!==void 0}async function ei(){let{memoized:e,...t}=await rs();return t}var Cr={};async function rs(){if(tc(Cr))return Promise.resolve({...Cr,memoized:!0});let e=await es(),t=rc(e);return Cr={...e,binaryTarget:t},{...Cr,memoized:!1}}function rc(e){let{platform:t,arch:r,archFromUname:n,libssl:i,targetDistro:o,familyDistro:s,originalDistro:a}=e;t==="linux"&&!["x64","arm64"].includes(r)&&qt(`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 u="1.1.x";if(t==="linux"&&i===void 0){let c=mt({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, you may also try to replace your base image with `node:lts-slim`, which already ships with OpenSSL installed.").otherwise(()=>"Please manually install OpenSSL and try installing Prisma again.");qt(`Prisma failed to detect the libssl/openssl version to use, and may not work as expected. Defaulting to "openssl-${u}". -${c}`)}let l="debian";if(t==="linux"&&o===void 0&&qt(`Prisma doesn't know which engines to download for the Linux distro "${a}". Falling back to Prisma engines built "${l}". -Please report your experience by creating an issue at ${jt("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||u}`;if(t==="linux"&&r==="arm")return`linux-arm-openssl-${i||u}`;if(t==="linux"&&o==="musl"){let c="linux-musl";return!i||ns(i)?c:`${c}-openssl-${i}`}return t==="linux"&&o&&i?`${o}-openssl-${i}`:(t!=="linux"&&qt(`Prisma detected unknown OS "${t}" and may not work as expected. Defaulting to "linux".`),i?`${l}-openssl-${i}`:o?`${o}-openssl-${u}`:`${l}-openssl-${u}`)}async function nc(e){try{return await e()}catch{return}}function Ar(e){return nc(async()=>{let t=await Kl(e);return pe(`Command "${e}" successfully returned "${t.stdout}"`),t.stdout})}async function ic(){return typeof Sr.default.machine=="function"?Sr.default.machine():(await Ar("uname -m"))?.trim()}function ns(e){return e.startsWith("1.")}var ti=["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","windows","freebsd11","freebsd12","freebsd13","openbsd","netbsd","arm"];var sc=S(ri());var V=S(require("path")),ac=S(ri()),tg=B("prisma:engines");function os(){return V.default.join(__dirname,"../")}var rg="libquery-engine";V.default.join(__dirname,"../query-engine-darwin");V.default.join(__dirname,"../query-engine-darwin-arm64");V.default.join(__dirname,"../query-engine-debian-openssl-1.0.x");V.default.join(__dirname,"../query-engine-debian-openssl-1.1.x");V.default.join(__dirname,"../query-engine-debian-openssl-3.0.x");V.default.join(__dirname,"../query-engine-rhel-openssl-1.0.x");V.default.join(__dirname,"../query-engine-rhel-openssl-1.1.x");V.default.join(__dirname,"../query-engine-rhel-openssl-3.0.x");V.default.join(__dirname,"../libquery_engine-darwin.dylib.node");V.default.join(__dirname,"../libquery_engine-darwin-arm64.dylib.node");V.default.join(__dirname,"../libquery_engine-debian-openssl-1.0.x.so.node");V.default.join(__dirname,"../libquery_engine-debian-openssl-1.1.x.so.node");V.default.join(__dirname,"../libquery_engine-debian-openssl-3.0.x.so.node");V.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.0.x.so.node");V.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.1.x.so.node");V.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-3.0.x.so.node");V.default.join(__dirname,"../libquery_engine-linux-musl.so.node");V.default.join(__dirname,"../libquery_engine-linux-musl-openssl-3.0.x.so.node");V.default.join(__dirname,"../libquery_engine-rhel-openssl-1.0.x.so.node");V.default.join(__dirname,"../libquery_engine-rhel-openssl-1.1.x.so.node");V.default.join(__dirname,"../libquery_engine-rhel-openssl-3.0.x.so.node");V.default.join(__dirname,"../query_engine-windows.dll.node");var ni=S(require("fs")),ss=B("plusX");function ii(e){let t=ni.default.statSync(e),r=t.mode|64|8|1;if(t.mode===r){ss(`Execution permissions of ${e} are fine`);return}let n=r.toString(8).slice(-3);ss(`Have to call plusX on ${e}`),ni.default.chmodSync(e,n)}function oi(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: ${jt("https://pris.ly/d/system-requirements")}`,o=`Unable to require(\`${D(e.id)}\`).`,s=mt({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 xe;(t=>{let e;(w=>(w.findUnique="findUnique",w.findUniqueOrThrow="findUniqueOrThrow",w.findFirst="findFirst",w.findFirstOrThrow="findFirstOrThrow",w.findMany="findMany",w.create="create",w.createMany="createMany",w.update="update",w.updateMany="updateMany",w.upsert="upsert",w.delete="delete",w.deleteMany="deleteMany",w.groupBy="groupBy",w.count="count",w.aggregate="aggregate",w.findRaw="findRaw",w.aggregateRaw="aggregateRaw"))(e=t.ModelAction||(t.ModelAction={}))})(xe||(xe={}));var us=S(Bt());function ai(e){return String(new si(e))}var si=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:uc(t.binaryTargets)}));return`generator ${t.name} { -${(0,us.default)(lc(n),2)} -}`}};function uc(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 lc(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)} = ${cc(n)}`).join(` -`)}function cc(e){return JSON.parse(JSON.stringify(e,(t,r)=>Array.isArray(r)?`[${r.map(n=>JSON.stringify(n)).join(", ")}]`:JSON.stringify(r)))}var Ut={};dr(Ut,{error:()=>mc,info:()=>fc,log:()=>pc,query:()=>dc,should:()=>ls,tags:()=>Vt,warn:()=>ui});var Vt={error:R("prisma:error"),warn:Ae("prisma:warn"),info:Be("prisma:info"),query:ut("prisma:query")},ls={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function pc(...e){console.log(...e)}function ui(e,...t){ls.warn()&&console.warn(`${Vt.warn} ${e}`,...t)}function fc(e,...t){console.info(`${Vt.info} ${e}`,...t)}function mc(e,...t){console.error(`${Vt.error} ${e}`,...t)}function dc(e,...t){console.log(`${Vt.query} ${e}`,...t)}function Le(e,t){throw new Error(t)}function Rr(e){let t;return(...r)=>t||(t=e(...r).catch(n=>{throw t=void 0,n}),t)}var Gt=S(require("path"));function li(e){return Gt.default.sep===Gt.default.posix.sep?e:e.split(Gt.default.sep).join(Gt.default.posix.sep)}function ci(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var pi=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});function yt(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}function fi(e,t){if(e.length===0)return;let r=e[0],n=t(e[0]);for(let i=1;in&&(n=o,r=e[i])}return r}function fe(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}var ds=new Set,Jt=(e,t,...r)=>{ds.has(e)||(ds.add(e),ui(t,...r))};var Q=class extends Error{constructor(r,n,i){super(r);this.clientVersion=n,this.errorCode=i,Error.captureStackTrace(Q)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};fe(Q,"PrismaClientInitializationError");var re=class extends Error{constructor(r,{code:n,clientVersion:i,meta:o,batchRequestIdx:s}){super(r);this.code=n,this.clientVersion=i,this.meta=o,Object.defineProperty(this,"batchRequestIdx",{value:s,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};fe(re,"PrismaClientKnownRequestError");var ge=class extends Error{constructor(r,n){super(r);this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};fe(ge,"PrismaClientRustPanicError");var ne=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"}};fe(ne,"PrismaClientUnknownRequestError");var bt=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 Dr(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function gs(e){return{models:mi(e.models),enums:mi(e.enums),types:mi(e.types)}}function mi(e){let t={};for(let{name:r,...n}of e)t[r]=n;return t}function hs(e,t){let r=Dr(()=>yc(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function yc(e){return{datamodel:{models:di(e.models),enums:di(e.enums),types:di(e.types)}}}function di(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}function ys(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 wt=9e15,Je=1e9,gi="0123456789abcdef",Nr="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",kr="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",hi={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-wt,maxE:wt,crypto:!1},Es,_e,P=!0,_r="[DecimalError] ",Ge=_r+"Invalid argument: ",Ts=_r+"Precision limit exceeded",vs=_r+"crypto unavailable",Ps="[object Decimal]",ie=Math.floor,W=Math.pow,bc=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,wc=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,xc=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Ms=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Me=1e7,v=7,Ec=9007199254740991,Tc=Nr.length-1,yi=kr.length-1,y={toStringTag:Ps};y.absoluteValue=y.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),T(e)};y.ceil=function(){return T(new this.constructor(this),this.e+1,2)};y.clampedTo=y.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(Ge+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};y.comparedTo=y.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,u=o.s,l=e.s;if(!s||!a)return!u||!l?NaN:u!==l?u:s===a?0:!s^u<0?1:-1;if(!s[0]||!a[0])return s[0]?u:a[0]?-l:0;if(u!==l)return u;if(o.e!==e.e)return o.e>e.e^u<0?1:-1;for(n=s.length,i=a.length,t=0,r=na[t]^u<0?1:-1;return n===i?0:n>i^u<0?1:-1};y.cosine=y.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())+v,n.rounding=1,r=vc(n,Os(n,r)),n.precision=e,n.rounding=t,T(_e==2||_e==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};y.cubeRoot=y.cbrt=function(){var e,t,r,n,i,o,s,a,u,l,c=this,p=c.constructor;if(!c.isFinite()||c.isZero())return new p(c);for(P=!1,o=c.s*W(c.s*c,1/3),!o||Math.abs(o)==1/0?(r=Z(c.d),e=c.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=W(r,1/3),e=ie((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,u=a.times(a).times(a),l=u.plus(c),n=L(l.plus(c).times(a),l.plus(u),s+2,1),Z(a.d).slice(0,s)===(r=Z(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 P=!0,T(n,e,p.rounding,t)};y.decimalPlaces=y.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-ie(this.e/v))*v,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};y.dividedBy=y.div=function(e){return L(this,new this.constructor(e))};y.dividedToIntegerBy=y.divToInt=function(e){var t=this,r=t.constructor;return T(L(t,new r(e),0,1,1),r.precision,r.rounding)};y.equals=y.eq=function(e){return this.cmp(e)===0};y.floor=function(){return T(new this.constructor(this),this.e+1,3)};y.greaterThan=y.gt=function(e){return this.cmp(e)>0};y.greaterThanOrEqualTo=y.gte=function(e){var t=this.cmp(e);return t==1||t===0};y.hyperbolicCosine=y.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/qr(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=xt(s,1,o.times(t),new s(1),!0);for(var u,l=e,c=new s(8);l--;)u=o.times(o),o=a.minus(u.times(c.minus(u.times(c))));return T(o,s.precision=r,s.rounding=n,!0)};y.hyperbolicSine=y.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=xt(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/qr(5,e)),i=xt(o,2,i,i,!0);for(var s,a=new o(5),u=new o(16),l=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(u.times(s).plus(l))))}return o.precision=t,o.rounding=r,T(i,t,r,!0)};y.hyperbolicTangent=y.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,L(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};y.inverseCosine=y.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()?Pe(r,i,o):new r(0):new r(NaN):t.isZero()?Pe(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=Pe(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))};y.inverseHyperbolicCosine=y.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,P=!1,r=r.times(r).minus(1).sqrt().plus(r),P=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};y.inverseHyperbolicSine=y.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,P=!1,r=r.times(r).plus(1).sqrt().plus(r),P=!0,n.precision=e,n.rounding=t,r.ln())};y.inverseHyperbolicTangent=y.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=L(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)};y.inverseSine=y.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=Pe(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)))};y.inverseTangent=y.atan=function(){var e,t,r,n,i,o,s,a,u,l=this,c=l.constructor,p=c.precision,f=c.rounding;if(l.isFinite()){if(l.isZero())return new c(l);if(l.abs().eq(1)&&p+4<=yi)return s=Pe(c,p+4,f).times(.25),s.s=l.s,s}else{if(!l.s)return new c(NaN);if(p+4<=yi)return s=Pe(c,p+4,f).times(.5),s.s=l.s,s}for(c.precision=a=p+10,c.rounding=1,r=Math.min(28,a/v+2|0),e=r;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(P=!1,t=Math.ceil(a/v),n=1,u=l.times(l),s=new c(l),i=l;e!==-1;)if(i=i.times(u),o=s.minus(i.div(n+=2)),i=i.times(u),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};y.isNaN=function(){return!this.s};y.isNegative=y.isNeg=function(){return this.s<0};y.isPositive=y.isPos=function(){return this.s>0};y.isZero=function(){return!!this.d&&this.d[0]===0};y.lessThan=y.lt=function(e){return this.cmp(e)<0};y.lessThanOrEqualTo=y.lte=function(e){return this.cmp(e)<1};y.logarithm=y.log=function(e){var t,r,n,i,o,s,a,u,l=this,c=l.constructor,p=c.precision,f=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=l.d,l.s<0||!r||!r[0]||l.eq(1))return new c(r&&!r[0]?-1/0:l.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(P=!1,a=p+m,s=Qe(l,a),n=t?Lr(c,a+10):Qe(e,a),u=L(s,n,a,1),Kt(u.d,i=p,f))do if(a+=10,s=Qe(l,a),n=t?Lr(c,a+10):Qe(e,a),u=L(s,n,a,1),!o){+Z(u.d).slice(i+1,i+15)+1==1e14&&(u=T(u,p+1,0));break}while(Kt(u.d,i+=10,f));return P=!0,T(u,p,f)};y.minus=y.sub=function(e){var t,r,n,i,o,s,a,u,l,c,p,f,m=this,d=m.constructor;if(e=new d(e),!m.d||!e.d)return!m.s||!e.s?e=new d(NaN):m.d?e.s=-e.s:e=new d(e.d||m.s!==e.s?m:NaN),e;if(m.s!=e.s)return e.s=-e.s,m.plus(e);if(l=m.d,f=e.d,a=d.precision,u=d.rounding,!l[0]||!f[0]){if(f[0])e.s=-e.s;else if(l[0])e=new d(m);else return new d(u===3?-0:0);return P?T(e,a,u):e}if(r=ie(e.e/v),c=ie(m.e/v),l=l.slice(),o=c-r,o){for(p=o<0,p?(t=l,o=-o,s=f.length):(t=f,r=c,s=l.length),n=Math.max(Math.ceil(a/v),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=l.length,s=f.length,p=n0;--n)l[s++]=0;for(n=f.length;n>o;){if(l[--n]s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=l.length,i=c.length,s-i<0&&(i=s,r=c,c=l,l=r),t=0;i;)t=(l[--i]=l[i]+c[i]+t)/Me|0,l[i]%=Me;for(t&&(l.unshift(t),++n),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=jr(l,n),P?T(e,a,u):e};y.precision=y.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ge+e);return r.d?(t=Fs(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};y.round=function(){var e=this,t=e.constructor;return T(new t(e),e.e+1,t.rounding)};y.sine=y.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())+v,n.rounding=1,r=Mc(n,Os(n,r)),n.precision=e,n.rounding=t,T(_e>2?r.neg():r,e,t,!0)):new n(NaN)};y.squareRoot=y.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,u=s.e,l=s.s,c=s.constructor;if(l!==1||!a||!a[0])return new c(!l||l<0&&(!a||a[0])?NaN:a?s:1/0);for(P=!1,l=Math.sqrt(+s),l==0||l==1/0?(t=Z(a),(t.length+u)%2==0&&(t+="0"),l=Math.sqrt(t),u=ie((u+1)/2)-(u<0||u%2),l==1/0?t="5e"+u:(t=l.toExponential(),t=t.slice(0,t.indexOf("e")+1)+u),n=new c(t)):n=new c(l.toString()),r=(u=c.precision)+3;;)if(o=n,n=o.plus(L(s,o,r+2,1)).times(.5),Z(o.d).slice(0,r)===(t=Z(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(T(o,u+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,u+1,1),e=!n.times(n).eq(s));break}return P=!0,T(n,u,c.rounding,e)};y.tangent=y.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=L(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,T(_e==2||_e==4?r.neg():r,e,t,!0)):new n(NaN)};y.times=y.mul=function(e){var t,r,n,i,o,s,a,u,l,c=this,p=c.constructor,f=c.d,m=(e=new p(e)).d;if(e.s*=c.s,!f||!f[0]||!m||!m[0])return new p(!e.s||f&&!f[0]&&!m||m&&!m[0]&&!f?NaN:!f||!m?e.s/0:e.s*0);for(r=ie(c.e/v)+ie(e.e/v),u=f.length,l=m.length,u=0;){for(t=0,i=u+n;i>n;)a=o[i]+m[n]*f[i-n-1]+t,o[i--]=a%Me|0,t=a/Me|0;o[i]=(o[i]+t)%Me|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=jr(o,r),P?T(e,p.precision,p.rounding):e};y.toBinary=function(e,t){return xi(this,2,e,t)};y.toDecimalPlaces=y.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(me(e,0,Je),t===void 0?t=n.rounding:me(t,0,8),T(r,e+r.e+1,t))};y.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Oe(n,!0):(me(e,0,Je),t===void 0?t=i.rounding:me(t,0,8),n=T(new i(n),e+1,t),r=Oe(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};y.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=Oe(i):(me(e,0,Je),t===void 0?t=o.rounding:me(t,0,8),n=T(new o(i),e+i.e+1,t),r=Oe(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};y.toFraction=function(e){var t,r,n,i,o,s,a,u,l,c,p,f,m=this,d=m.d,g=m.constructor;if(!d)return new g(m);if(l=r=new g(1),n=u=new g(0),t=new g(n),o=t.e=Fs(d)-m.e-1,s=o%v,t.d[0]=W(10,s<0?v+s:s),e==null)e=o>0?t:l;else{if(a=new g(e),!a.isInt()||a.lt(l))throw Error(Ge+a);e=a.gt(t)?o>0?t:l:a}for(P=!1,a=new g(Z(d)),c=g.precision,g.precision=o=d.length*v*2;p=L(a,t,0,1,1),i=r.plus(p.times(n)),i.cmp(e)!=1;)r=n,n=i,i=l,l=u.plus(p.times(i)),u=i,i=t,t=a.minus(p.times(i)),a=i;return i=L(e.minus(r),n,0,1,1),u=u.plus(i.times(l)),r=r.plus(i.times(n)),u.s=l.s=m.s,f=L(l,n,o,1).minus(m).abs().cmp(L(u,r,o,1).minus(m).abs())<1?[l,n]:[u,r],g.precision=c,P=!0,f};y.toHexadecimal=y.toHex=function(e,t){return xi(this,16,e,t)};y.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:me(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]?(P=!1,r=L(r,e,0,t,1).times(e),P=!0,T(r)):(e.s=r.s,r=e),r};y.toNumber=function(){return+this};y.toOctal=function(e,t){return xi(this,8,e,t)};y.toPower=y.pow=function(e){var t,r,n,i,o,s,a=this,u=a.constructor,l=+(e=new u(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new u(W(+a,l));if(a=new u(a),a.eq(1))return a;if(n=u.precision,o=u.rounding,e.eq(1))return T(a,n,o);if(t=ie(e.e/v),t>=e.d.length-1&&(r=l<0?-l:l)<=Ec)return i=Cs(u,a,r,n),e.s<0?new u(1).div(i):T(i,n,o);if(s=a.s,s<0){if(tu.maxE+1||t0?s/0:0):(P=!1,u.rounding=a.s=1,r=Math.min(12,(t+"").length),i=bi(e.times(Qe(a,n+r)),n),i.d&&(i=T(i,n+5,1),Kt(i.d,n,o)&&(t=n+10,i=T(bi(e.times(Qe(a,t+r)),t),t+5,1),+Z(i.d).slice(n+1,n+15)+1==1e14&&(i=T(i,n+1,0)))),i.s=s,P=!0,u.rounding=o,T(i,n,o))};y.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Oe(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(me(e,1,Je),t===void 0?t=i.rounding:me(t,0,8),n=T(new i(n),e,t),r=Oe(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};y.toSignificantDigits=y.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(me(e,1,Je),t===void 0?t=n.rounding:me(t,0,8)),T(new n(r),e,t)};y.toString=function(){var e=this,t=e.constructor,r=Oe(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};y.truncated=y.trunc=function(){return T(new this.constructor(this),this.e+1,1)};y.valueOf=y.toJSON=function(){var e=this,t=e.constructor,r=Oe(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Z(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;tr)throw Error(Ge+e)}function Kt(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=v,i=0):(i=Math.ceil((t+1)/v),t%=v),o=W(10,v-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)==W(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)==W(10,t-3)-1,s}function Ir(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 vc(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/qr(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=xt(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 L=function(){function e(n,i,o){var s,a=0,u=n.length;for(n=n.slice();u--;)s=n[u]*i+a,n[u]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function t(n,i,o,s){var a,u;if(o!=s)u=o>s?1:-1;else for(a=u=0;ai[a]?1:-1;break}return u}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,u){var l,c,p,f,m,d,g,b,h,x,w,E,C,O,q,I,G,J,ee,at,fr=n.constructor,On=n.s==i.s?1:-1,te=n.d,k=i.d;if(!te||!te[0]||!k||!k[0])return new fr(!n.s||!i.s||(te?k&&te[0]==k[0]:!k)?NaN:te&&te[0]==0||!k?On*0:On/0);for(u?(m=1,c=n.e-i.e):(u=Me,m=v,c=ie(n.e/m)-ie(i.e/m)),ee=k.length,G=te.length,h=new fr(On),x=h.d=[],p=0;k[p]==(te[p]||0);p++);if(k[p]>(te[p]||0)&&c--,o==null?(O=o=fr.precision,s=fr.rounding):a?O=o+(n.e-i.e)+1:O=o,O<0)x.push(1),d=!0;else{if(O=O/m+2|0,p=0,ee==1){for(f=0,k=k[0],O++;(p1&&(k=e(k,f,u),te=e(te,f,u),ee=k.length,G=te.length),I=ee,w=te.slice(0,ee),E=w.length;E=u/2&&++J;do f=0,l=t(k,w,ee,E),l<0?(C=w[0],ee!=E&&(C=C*u+(w[1]||0)),f=C/J|0,f>1?(f>=u&&(f=u-1),g=e(k,f,u),b=g.length,E=w.length,l=t(g,w,b,E),l==1&&(f--,r(g,ee=10;f/=10)p++;h.e=p+c*m-1,T(h,a?o+h.e+1:o,s,d)}return h}}();function T(e,t,r,n){var i,o,s,a,u,l,c,p,f,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+=v,s=t,c=p[f=0],u=c/W(10,i-s-1)%10|0;else if(f=Math.ceil((o+1)/v),a=p.length,f>=a)if(n){for(;a++<=f;)p.push(0);c=u=0,i=1,o%=v,s=o-v+1}else break e;else{for(c=a=p[f],i=1;a>=10;a/=10)i++;o%=v,s=o-v+i,u=s<0?0:c/W(10,i-s-1)%10|0}if(n=n||t<0||p[f+1]!==void 0||(s<0?c:c%W(10,i-s-1)),l=r<4?(u||n)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||n||r==6&&(o>0?s>0?c/W(10,i-s):0:p[f-1])%10&1||r==(e.s<0?8:7)),t<1||!p[0])return p.length=0,l?(t-=e.e+1,p[0]=W(10,(v-t%v)%v),e.e=-t||0):p[0]=e.e=0,e;if(o==0?(p.length=f,a=1,f--):(p.length=f+1,a=W(10,v-o),p[f]=s>0?(c/W(10,i-s)%W(10,s)|0)*a:0),l)for(;;)if(f==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]==Me&&(p[0]=1));break}else{if(p[f]+=a,p[f]!=Me)break;p[f--]=0,a=1}for(o=p.length;p[--o]===0;)p.pop()}return P&&(e.e>m.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+Ue(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Ue(-i-1)+o,r&&(n=r-s)>0&&(o+=Ue(n))):i>=s?(o+=Ue(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+Ue(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=Ue(n))),o}function jr(e,t){var r=e[0];for(t*=v;r>=10;r/=10)t++;return t}function Lr(e,t,r){if(t>Tc)throw P=!0,r&&(e.precision=r),Error(Ts);return T(new e(Nr),t,1,!0)}function Pe(e,t,r){if(t>yi)throw Error(Ts);return T(new e(kr),t,r,!0)}function Fs(e){var t=e.length-1,r=t*v+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 Ue(e){for(var t="";e--;)t+="0";return t}function Cs(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/v+4);for(P=!1;;){if(r%2&&(o=o.times(t),ws(o.d,s)&&(i=!0)),r=ie(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 P=!0,o}function bs(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 f(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(t==null?(P=!1,u=d):u=t,a=new f(.03125);e.e>-2;)e=e.times(a),p+=5;for(n=Math.log(W(2,p))/Math.LN10*2+5|0,u+=n,r=o=s=new f(1),f.precision=u;;){if(o=T(o.times(e),u,1),r=r.times(++c),a=s.plus(L(o,r,u,1)),Z(a.d).slice(0,u)===Z(s.d).slice(0,u)){for(i=p;i--;)s=T(s.times(s),u,1);if(t==null)if(l<3&&Kt(s.d,u-n,m,l))f.precision=u+=10,r=o=a=new f(1),c=0,l++;else return T(s,f.precision=d,m,P=!0);else return f.precision=d,s}s=a}}function Qe(e,t){var r,n,i,o,s,a,u,l,c,p,f,m=1,d=10,g=e,b=g.d,h=g.constructor,x=h.rounding,w=h.precision;if(g.s<0||!b||!b[0]||!g.e&&b[0]==1&&b.length==1)return new h(b&&!b[0]?-1/0:g.s!=1?NaN:b?0:g);if(t==null?(P=!1,c=w):c=t,h.precision=c+=d,r=Z(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=Z(g.d),n=r.charAt(0),m++;o=g.e,n>1?(g=new h("0."+r),o++):g=new h(n+"."+r.slice(1))}else return l=Lr(h,c+2,w).times(o+""),g=Qe(new h(n+"."+r.slice(1)),c-d).plus(l),h.precision=w,t==null?T(g,w,x,P=!0):g;for(p=g,u=s=g=L(g.minus(1),g.plus(1),c,1),f=T(g.times(g),c,1),i=3;;){if(s=T(s.times(f),c,1),l=u.plus(L(s,new h(i),c,1)),Z(l.d).slice(0,c)===Z(u.d).slice(0,c))if(u=u.times(2),o!==0&&(u=u.plus(Lr(h,c+2,w).times(o+""))),u=L(u,new h(m),c,1),t==null)if(Kt(u.d,c-d,x,a))h.precision=c+=d,l=s=g=L(p.minus(1),p.plus(1),c,1),f=T(g.times(g),c,1),i=a=1;else return T(u,h.precision=w,x,P=!0);else return h.precision=w,u;u=l,i+=2}}function As(e){return String(e.s*e.s/0)}function wi(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)%v,r<0&&(n+=v),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Ms.test(t))return wi(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(wc.test(t))r=16,t=t.toLowerCase();else if(bc.test(t))r=2;else if(xc.test(t))r=8;else throw Error(Ge+t);for(o=t.search(/p/i),o>0?(u=+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=Cs(n,new n(r),o,o*2)),l=Ir(t,r,Me),c=l.length-1,o=c;l[o]===0;--o)l.pop();return o<0?new n(e.s*0):(e.e=jr(l,c),e.d=l,P=!1,s&&(e=L(e,i,a*4)),u&&(e=e.times(Math.abs(u)<54?W(2,u):it.pow(2,u))),P=!0,e)}function Mc(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:xt(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/qr(5,r)),t=xt(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 xt(e,t,r,n,i){var o,s,a,u,l=1,c=e.precision,p=Math.ceil(c/v);for(P=!1,u=r.times(r),a=new e(n);;){if(s=L(a.times(u),new e(t++*t++),c,1),a=i?n.plus(s):n.minus(s),n=L(s.times(u),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,l++}return P=!0,s.d.length=p+1,s}function qr(e,t){for(var r=e;--t;)r*=e;return r}function Os(e,t){var r,n=t.s<0,i=Pe(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return _e=n?4:1,t;if(r=t.divToInt(i),r.isZero())_e=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return _e=bs(r)?n?2:3:n?4:1,t;_e=bs(r)?n?1:4:n?3:2}return t.minus(i).abs()}function xi(e,t,r,n){var i,o,s,a,u,l,c,p,f,m=e.constructor,d=r!==void 0;if(d?(me(r,1,Je),n===void 0?n=m.rounding:me(n,0,8)):(r=m.precision,n=m.rounding),!e.isFinite())c=As(e);else{for(c=Oe(e),s=c.indexOf("."),d?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(c=c.replace(".",""),f=new m(1),f.e=c.length-s,f.d=Ir(Oe(f),10,i),f.e=f.d.length),p=Ir(c,10,i),o=u=p.length;p[--u]==0;)p.pop();if(!p[0])c=d?"0p+0":"0";else{if(s<0?o--:(e=new m(e),e.d=p,e.e=o,e=L(e,f,r,n,0,i),p=e.d,o=e.e,l=Es),s=p[r],a=i/2,l=l||p[r+1]!==void 0,l=n<4?(s!==void 0||l)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||l||n===6&&p[r-1]&1||n===(e.s<0?8:7)),p.length=r,l)for(;++p[--r]>i-1;)p[r]=0,r||(++o,p.unshift(1));for(u=p.length;!p[u-1];--u);for(s=0,c="";s1)if(t==16||t==8){for(s=t==16?4:3,--u;u%s;u++)c+="0";for(p=Ir(c,i,t),u=p.length;!p[u-1];--u);for(s=1,c="1.";su)for(o-=u;o--;)c+="0";else ot)return e.length=t,!0}function Fc(e){return new this(e).abs()}function Cc(e){return new this(e).acos()}function Sc(e){return new this(e).acosh()}function Ac(e,t){return new this(e).plus(t)}function Oc(e){return new this(e).asin()}function Rc(e){return new this(e).asinh()}function $c(e){return new this(e).atan()}function Dc(e){return new this(e).atanh()}function Ic(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=Pe(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?Pe(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=Pe(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(L(e,t,o,1)),t=Pe(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(L(e,t,o,1)),r}function Nc(e){return new this(e).cbrt()}function kc(e){return T(e=new this(e),e.e+1,2)}function Lc(e,t,r){return new this(e).clamp(t,r)}function _c(e){if(!e||typeof e!="object")throw Error(_r+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,Je,"rounding",0,8,"toExpNeg",-wt,0,"toExpPos",0,wt,"maxE",0,wt,"minE",-wt,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(Ge+r+": "+n);if(r="crypto",i&&(this[r]=hi[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(vs);else this[r]=!1;else throw Error(Ge+r+": "+n);return this}function jc(e){return new this(e).cos()}function qc(e){return new this(e).cosh()}function Rs(e){var t,r,n;function i(o){var s,a,u,l=this;if(!(l instanceof i))return new i(o);if(l.constructor=i,xs(o)){l.s=o.s,P?!o.d||o.e>i.maxE?(l.e=NaN,l.d=null):o.e=10;a/=10)s++;P?s>i.maxE?(l.e=NaN,l.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(vs);else for(;o=10;i/=10)n++;n`}};function Vr(e){return e instanceof Ee}var Ds=["JsonNullValueInput","NullableJsonNullValueInput","JsonNullValueFilter"],Ur=Symbol(),Ei=new WeakMap,oe=class{constructor(t){t===Ur?Ei.set(this,`Prisma.${this._getName()}`):Ei.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return Ei.get(this)}},Wt=class extends oe{_getNamespace(){return"NullTypes"}},Ht=class extends Wt{};Ti(Ht,"DbNull");var zt=class extends Wt{};Ti(zt,"JsonNull");var Yt=class extends Wt{};Ti(Yt,"AnyNull");var Et={classes:{DbNull:Ht,JsonNull:zt,AnyNull:Yt},instances:{DbNull:new Ht(Ur),JsonNull:new zt(Ur),AnyNull:new Yt(Ur)}};function Ti(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}function ye(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Re(e){return e.toString()!=="Invalid Date"}function Ke(e){return it.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 se=(e,t)=>{let r={};for(let n of e){let i=n[t];r[i]=n}return r},Tt={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 vt(e){return typeof e=="string"?e:e.name}function Xt(e,t){return t?`List<${e}>`:e}var fp=/^(\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]))$/,mp=/^[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(he.isDecimal(e)||r==="Decimal"&&Ke(e))return"Decimal";if(Buffer.isBuffer(e))return"Bytes";if(dp(e,t))return r.name;if(e instanceof oe)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(ye(e))return"DateTime";if(n==="string"){if(mp.test(e))return"UUID";if(new Date(e).toString()==="Invalid Date")return"String";if(fp.test(e))return"DateTime"}return pp[n]}function dp(e,t){let r=t?.type;if(!hp(r))return!1;if(t?.namespace==="prisma"&&Ds.includes(r.name)){let n=e?.constructor?.name;return typeof n=="string"&&Et.instances[n]===e&&r.values.includes(n)}return typeof e=="string"&&r.values.includes(e)}function Qr(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,vi.default)(e.values.join(", "),2)} -}`;{let r=(0,vi.default)(e.fields.map(n=>{let i=`${n.name}`,o=`${t?A(i):i}${n.isRequired?"":"?"}: ${Dt(n.inputTypes.map(s=>Xt(gp(s.type)?s.type.name:vt(s.type),s.isList)).join(" | "))}`;return n.isRequired?o:D(o)}).join(` -`),2);return`${D("type")} ${M(D(e.name))} ${D("{")} -${r} -${D("}")}`}}function gp(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 Pi(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(u=>Zt(u.type)).join(" | "):a=s.inputTypes.map(u=>Pi(u.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 Ft(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function ks(e){return e.endsWith("GroupByOutputType")}function hp(e){return typeof e=="object"&&e!==null&&typeof e.name=="string"&&Array.isArray(e.values)}var Gr=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 se(this.datamodel.enums,"name")}getModelMap(){return{...se(this.datamodel.models,"name")}}getTypeMap(){return{...se(this.datamodel.types,"name")}}getTypeModelMap(){return{...this.getTypeMap(),...this.getModelMap()}}},Jr=class{constructor({mappings:t}){this.mappings=t,this.mappingsMap=this.getMappingsMap()}getMappingsMap(){return se(this.mappings.modelOperations,"model")}getOtherOperationNames(){return[Object.values(this.mappings.otherOperations.write),Object.values(this.mappings.otherOperations.read)].flat()}},Kr=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"&&!Tt[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=se(t.fields,"name")}for(let t of this.outputTypes.prisma){for(let r of t.fields)typeof r.outputType.type=="string"&&!Tt[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=se(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"&&!Tt[o]&&(this.inputTypeMap[o]||this.enumMap[o])&&(i.type=this.inputTypeMap[o]||this.enumMap[o]||o)}r.fieldMap=se(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"&&!Tt[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"&&!Tt[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{...se(this.schema.enumTypes.prisma,"name"),...this.schema.enumTypes.model?se(this.schema.enumTypes.model,"name"):void 0}}hasEnumInNamespace(t,r){return this.schema.enumTypes[r]?.find(n=>n.name===t)!==void 0}getMergedOutputTypeMap(){return{...se(this.outputTypes.model,"name"),...se(this.outputTypes.prisma,"name")}}getInputTypeMap(){return{...this.schema.inputObjectTypes.model?se(this.schema.inputObjectTypes.model,"name"):void 0,...se(this.schema.inputObjectTypes.prisma,"name")}}getRootFieldMap(){return{...se(this.queryType.fields,"name"),...se(this.mutationType.fields,"name")}}},We=class{constructor(t){return Object.assign(this,new Gr(t),new Jr(t),new Kr(t))}};ys(We,[Gr,Jr,Kr]);var Uu=require("async_hooks"),Qu=require("events"),Gu=S(require("fs")),pr=S(require("path"));var _s=S(Ls());function js(e){return{...e,mappings:yp(e.mappings,e.datamodel)}}function yp(e,t){return{modelOperations:e.modelOperations.filter(n=>{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,_s.default)(Ft(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 qs(e){return js(e)}function Bs({error:e,user_facing_error:t},r){return t.error_code?new re(t.message,{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new ne(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}var Wr=class{};var Js=S(require("fs")),tr=S(require("path"));function Hr(e){let{runtimeBinaryTarget:t}=e;return`Add "${t}" to \`binaryTargets\` in the "schema.prisma" file and run \`prisma generate\` after saving it: - -${bp(e)}`}function bp(e){let{generator:t,generatorBinaryTargets:r,runtimeBinaryTarget:n}=e,i={fromEnvVar:null,value:n},o=[...r,i];return ai({...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 Vs(e){let{runtimeBinaryTarget:t}=e;return`${He(e)} - -This happened because \`binaryTargets\` have been pinned, but the actual deployment also required "${t}". -${Hr(e)} - -${ze(e)}`}function zr(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 Us(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}". - -${zr("engine-not-found-bundler-investigation")} - -${ze(e)}`}function Qs(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}". -${Hr(e)} - -${ze(e)}`}function Gs(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}". - -${zr("engine-not-found-tooling-investigation")} - -${ze(e)}`}var wp=B("prisma:client:engines:resolveEnginePath"),xp=()=>"library",Ep=()=>new RegExp(`runtime[\\\\/]${xp()}\\.m?js$`);async function Ks(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 Tp(e,t);if(wp("enginePath",n),n!==void 0&&e==="binary"&&ii(n),n!==void 0)return t.prismaPath=n;let o=await ht(),s=t.generator?.binaryTargets??[],a=s.some(f=>f.native),u=!s.some(f=>f.value===o),l=__filename.match(Ep())===null,c={searchedLocations:i,generatorBinaryTargets:s,generator:t.generator,runtimeBinaryTarget:o,queryEngineName:Ws(e,o),expectedLocation:tr.default.relative(process.cwd(),t.dirname)},p;throw a&&u?p=Qs(c):u?p=Vs(c):l?p=Us(c):p=Gs(c),new Q(p,t.clientVersion)}async function Tp(engineType,config){let binaryTarget=await ht(),searchedLocations=[],dirname=eval("__dirname"),searchLocations=[config.dirname,tr.default.resolve(dirname,".."),config.generator?.output?.value??dirname,tr.default.resolve(dirname,"../../../.prisma/client"),"/tmp/prisma-engines",config.cwd];__filename.includes("resolveEnginePath")&&searchLocations.push(os());for(let e of searchLocations){let t=Ws(engineType,binaryTarget),r=tr.default.join(e,t);if(searchedLocations.push(e),Js.default.existsSync(r))return{enginePath:r,searchedLocations}}return{enginePath:void 0,searchedLocations}}function Ws(e,t){return e==="library"?Hn(t,"fs"):`query-engine-${t}${t==="windows"?".exe":""}`}function Hs(e,t){return vp(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 vp(e){return typeof e[0].query=="string"}var Ci=S(Qt());function zs(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,t=>`${t[0]}5`):""}function Ys(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 Zs=S(ms());function Xs({title:e,user:t="prisma",repo:r="prisma",template:n="bug_report.md",body:i}){return(0,Zs.default)({user:t,repo:r,template:n,title:e,body:i})}function ea({version:e,platform:t,title:r,description:n,engineVersion:i,database:o,query:s}){let a=Co(6e3-(s?.length??0)),u=Ys((0,Ci.default)(a)),l=n?`# Description -\`\`\` -${n} -\`\`\``:"",c=(0,Ci.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)}| - -${l} - -## Logs -\`\`\` -${u} -\`\`\` - -## Client Snippet -\`\`\`ts -// PLEASE FILL YOUR CODE SNIPPET HERE -\`\`\` - -## Schema -\`\`\`prisma -// PLEASE ADD YOUR SCHEMA HERE IF POSSIBLE -\`\`\` - -## Prisma Engine Query -\`\`\` -${s?zs(s):""} -\`\`\` -`),p=Xs({title:r,body:c});return`${r} - -This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic. - -${le(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 oa=S(require("fs"));function ta(e){if(e?.kind==="itx")return e.options.id}var Ai=S(require("os")),ra=S(require("path"));var Si=Symbol("PrismaLibraryEngineCache");function Pp(){let e=globalThis;return e[Si]===void 0&&(e[Si]={}),e[Si]}function Mp(e){let t=Pp();if(t[e]!==void 0)return t[e];let r=ra.default.toNamespacedPath(e),n={exports:{}},i=0;return process.platform!=="win32"&&(i=Ai.default.constants.dlopen.RTLD_LAZY|Ai.default.constants.dlopen.RTLD_DEEPBIND),process.dlopen(n,r,i),t[e]=n.exports,n.exports}var Yr=class{constructor(t){this.config=t}async loadLibrary(){let t=await ei(),r=await Ks("library",this.config);try{return this.config.tracingHelper.runInChildSpan({name:"loadLibrary",internal:!0},()=>Mp(r))}catch(n){let i=oi({e:n,platformInfo:t,id:r});throw new Q(i,this.config.clientVersion)}}};var Fp=B("prisma:client:libraryEngine:exitHooks"),Cp={SIGINT:2,SIGUSR2:31,SIGTERM:15},Zr=class{constructor(){this.nextOwnerId=1;this.ownerToIdMap=new WeakMap;this.idToListenerMap=new Map;this.areHooksInstalled=!1;this.exitLikeHook=async t=>{Fp(`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=Cp[r]+128;process.exit(i)})}};var je=B("prisma:client:libraryEngine");function Sp(e){return e.item_type==="query"&&"query"in e}function Ap(e){return"level"in e?e.level==="error"&&e.message==="PANIC":!1}var na=[...ti,"native"],ia=0,Oi=new Zr,rr=class extends Wr{constructor(r,n=new Yr(r)){super();try{this.datamodel=oa.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(),Oi.install(),this.checkForTooManyEngines()}get beforeExitListener(){return Oi.getListener(this)}set beforeExitListener(r){Oi.setListener(this,r)}checkForTooManyEngines(){ia===10&&console.warn(`${Ae("warn(prisma-client)")} There are already 10 instances of Prisma Client actively running.`)}async transaction(r,n,i){await this.start();let o=JSON.stringify(n),s;if(r==="start"){let u=JSON.stringify({max_wait:i?.maxWait??2e3,timeout:i?.timeout??5e3,isolation_level:i?.isolationLevel});s=await this.engine?.startTransaction(u,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 re(a.message,{code:a.error_code,clientVersion:this.config.clientVersion,meta:a.meta});return a}async instantiateLibrary(){if(je("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;Wn(),this.platform=await this.getPlatform(),await this.loadEngine(),this.version()}async getPlatform(){if(this.platform)return this.platform;let r=await ht();if(!na.includes(r))throw new Q(`Unknown ${R("PRISMA_QUERY_ENGINE_LIBRARY")} ${R(M(r))}. Possible binaryTargets: ${A(na.join(", "))} or a path to the query engine library. -You may have to run ${A("prisma generate")} for your changes to take effect.`,this.config.clientVersion);return r}parseEngineResponse(r){if(!r)throw new ne("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(r)}catch{throw new ne("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)}),ia++}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",Sp(n)?this.logEmitter.emit("query",{timestamp:new Date,query:n.query,params:n.params,duration:Number(n.duration_ms),target:n.module_path}):Ap(n)?this.loggerRustPanic=new ge(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 ea({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 je(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let r=async()=>{je("library starting");try{let n={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(n)),this.libraryStarted=!0,je("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 je("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted)return;let r=async()=>{await new Promise(i=>setTimeout(i,5)),je("library stopping");let n={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(n)),this.libraryStarted=!1,this.libraryStoppingPromise=void 0,je("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}){je(`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 ne(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 ge(this.getErrorMessageWithLink(a.message),this.config.clientVersion);let u=this.parseRequestError(a.message);throw typeof u=="string"?a:new ne(`${u.message} -${u.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(r,{transaction:n,traceparent:i}){je("requestBatch");let o=Hs(r,n);await this.start(),this.lastQuery=JSON.stringify(o),this.executingQueryPromise=this.engine.query(this.lastQuery,JSON.stringify({traceparent:i}),ta(n));let s=await this.executingQueryPromise,a=this.parseEngineResponse(s);if(a.errors)throw a.errors.length===1?this.buildQueryError(a.errors[0]):new ne(JSON.stringify(a.errors),{clientVersion:this.config.clientVersion});let{batchResult:u,errors:l}=a;if(Array.isArray(u))return u.map(c=>c.errors&&c.errors.length>0?this.loggerRustPanic??this.buildQueryError(c.errors[0]):{data:c,elapsed:0});throw l&&l.length===1?new Error(l[0].error):new Error(JSON.stringify(a))}buildQueryError(r){return r.user_facing_error.is_panic?new ge(this.getErrorMessageWithLink(r.user_facing_error.message),this.config.clientVersion):Bs(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 ot=S(Bt());var ki=S(Qt());var $e=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 Te(e){return e.replace(/^./,t=>t.toLowerCase())}function aa(e,t,r){let n=Te(r);return!t.result||!(t.result.$allModels||t.result[n])?e:Op({...e,...sa(t.name,e,t.result.$allModels),...sa(t.name,e,t.result[n])})}function Op(e){let t=new $e,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 yt(e,n=>({...n,needs:r(n.name,new Set)}))}function sa(e,t,r){return r?yt(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:Rp(t,o,i)})):{}}function Rp(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function Xr(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 ma=S(Bt());var fa=S(require("fs"));var ua={keyword:Be,entity:Be,value:e=>M(ut(e)),punctuation:ut,directive:Be,function:Be,variable:e=>M(ut(e)),string:e=>M(A(e)),boolean:Ae,number:Be,comment:gr};var $p=e=>e,en={},Dp=0,F={manual:en.Prism&&en.Prism.manual,disableWorkerMessageHandler:en.Prism&&en.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof Fe){let t=e;return new Fe(t.type,F.util.encode(t.content),t.alias)}else return Array.isArray(e)?e.map(F.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(J instanceof Fe)continue;if(C&&I!=t.length-1){x.lastIndex=G;var p=x.exec(e);if(!p)break;var c=p.index+(E?p[1].length:0),f=p.index+p[0].length,a=I,u=G;for(let k=t.length;a=u&&(++I,G=u);if(t[I]instanceof Fe)continue;l=a-I,J=e.slice(G,u),p.index-=G}else{x.lastIndex=0;var p=x.exec(J),l=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),f=c+p.length,m=J.slice(0,c),d=J.slice(f);let ee=[I,l];m&&(++I,G+=m.length,ee.push(m));let at=new Fe(g,w?F.tokenize(p,w):p,q,p,C);if(ee.push(at),d&&ee.push(d),Array.prototype.splice.apply(t,ee),l!=1&&F.matchGrammar(e,t,r,I,G,!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 F.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){let r=F.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){let r=F.hooks.all[e];if(!(!r||!r.length))for(var n=0,i;i=r[n++];)i(t)}},Token:Fe};F.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:/[{}[\];(),.:]/};F.languages.javascript=F.languages.extend("clike",{"class-name":[F.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}/});F.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;F.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:F.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:F.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:F.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:F.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});F.languages.markup&&F.languages.markup.tag.addInlined("script","javascript");F.languages.js=F.languages.javascript;F.languages.typescript=F.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/});F.languages.ts=F.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(""):Ip(e.type)(e.content)};function Ip(e){return ua[e]||$p}function la(e){return Np(e,F.languages.javascript)}function Np(e,t){return F.tokenize(e,t).map(n=>Fe.stringify(n)).join("")}var ca=S(Gn());function pa(e){return(0,ca.default)(e)}var Ce=class{static read(t){let r;try{r=fa.default.readFileSync(t,"utf-8")}catch{return null}return Ce.fromContent(r)}static fromContent(t){let r=t.split(/\r?\n/);return new Ce(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 Ce(this.firstLineNumber,i)}mapLines(t){return new Ce(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 Ce(t,pa(n).split(` -`))}highlight(){let t=la(this.toString());return new Ce(this.firstLineNumber,t.split(` -`))}toString(){return this.lines.join(` -`)}};var kp={red:R,gray:gr,dim:D,bold:M,underline:le,highlightSource:e=>e.highlight()},Lp={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function _p({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 u=Math.max(1,a.lineNumber-3),l=Ce.read(a.fileName)?.slice(u,a.lineNumber),c=l?.lineAt(a.lineNumber);if(l&&c){let p=qp(c),f=jp(c);if(!f)return s;s.functionName=`${f.code})`,s.location=a,n||(l=l.mapLineAt(a.lineNumber,d=>d.slice(0,f.openingBraceIndex))),l=o.highlightSource(l);let m=String(l.lastLineNumber).length;if(s.contextLines=l.mapLines((d,g)=>o.gray(String(g).padStart(m))+" "+d).mapLines(d=>o.dim(d)).prependSymbolAt(a.lineNumber,o.bold(o.red("\u2192"))),i){let d=p+m+1;d+=2,s.callArguments=(0,ma.default)(i,d).slice(d)}}return s}function jp(e){let t=Object.keys(xe.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 qp(e){let t=0;for(let r=0;rArray.isArray(e)?e:e.split("."),ir=(e,t)=>ba(t).reduce((r,n)=>r&&r[n],e),tn=(e,t,r)=>ba(t).reduceRight((n,i,o,s)=>Object.assign({},ir(e,s.slice(0,o)),{[i]:n}),r);function wa(e,t){if(!e||typeof e!="object"||typeof e.hasOwnProperty!="function")return e;let r={};for(let n in e){let i=e[n];Object.hasOwnProperty.call(e,n)&&t(n,i)&&(r[n]=i)}return r}var Up={"[object Date]":!0,"[object Uint8Array]":!0,"[object Decimal]":!0};function xa(e){return e?typeof e=="object"&&!Up[Object.prototype.toString.call(e)]:!1}function Ea(e,t){let r={},n=Array.isArray(t)?t:[t];for(let i in e)Object.hasOwnProperty.call(e,i)&&!n.includes(i)&&(r[i]=e[i]);return r}var Di=S(Qt());var Qp=va(),Gp=Ma(),Jp=Fa().default,Kp=(e,t,r)=>{let n=[];return function i(o,s={},a="",u=[]){s.indent=s.indent||" ";let l;s.inlineCharacterLimit===void 0?l={newLine:` -`,newLineOrSpace:` -`,pad:a,indent:a+s.indent}:l={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 f=p.replace(new RegExp(l.newLine,"g"),"").replace(new RegExp(l.newLineOrSpace,"g")," ").replace(new RegExp(l.pad+"|"+l.indent,"g"),"");return f.length<=s.inlineCharacterLimit?f:p.replace(new RegExp(l.newLine+"|"+l.newLineOrSpace,"g"),` -`).replace(new RegExp(l.pad,"g"),a).replace(new RegExp(l.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 oe||Qp(o))return String(o);if(ye(o))return`new Date('${Re(o)?o.toISOString():"Invalid Date"}')`;if(o instanceof Ee)return`prisma.${Ft(o.modelName)}.fields.${o.name}`;if(Array.isArray(o)){if(o.length===0)return"[]";n.push(o);let p="["+l.newLine+o.map((f,m)=>{let d=o.length-1===m?l.newLine:","+l.newLineOrSpace,g=i(f,s,a+s.indent,[...u,m]);s.transformValue&&(g=s.transformValue(o,m,g));let b=l.indent+g+d;return s.transformLine&&(b=s.transformLine({obj:o,indent:l.indent,key:m,stringifiedValue:g,value:o[m],eol:d,originalLine:b,path:u.concat(m)})),b}).join("")+l.pad+"]";return n.pop(),c(p)}if(Gp(o)){let p=Object.keys(o).concat(Jp(o));if(s.filter&&(p=p.filter(m=>s.filter(o,m))),p.length===0)return"{}";n.push(o);let f="{"+l.newLine+p.map((m,d)=>{let g=p.length-1===d?l.newLine:","+l.newLineOrSpace,b=typeof m=="symbol",h=!b&&/^[a-z$_][a-z$_0-9]*$/i.test(m),x=b||h?m:i(m,s,void 0,[...u,m]),w=i(o[m],s,a+s.indent,[...u,m]);s.transformValue&&(w=s.transformValue(o,m,w));let E=l.indent+String(x)+": "+w+g;return s.transformLine&&(E=s.transformLine({obj:o,indent:l.indent,key:x,stringifiedValue:w,value:o[m],eol:g,originalLine:E,path:u.concat(x)})),E}).join("")+l.pad+"}";return n.pop(),c(f)}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)},or=Kp;var $i="@@__DIM_POINTER__@@";function rn({ast:e,keyPaths:t,valuePaths:r,missingItems:n}){let i=e;for(let{path:o,type:s}of n)i=tn(i,o,s);return or(i,{indent:" ",transformLine:({indent:o,key:s,value:a,stringifiedValue:u,eol:l,path:c})=>{let p=c.join("."),f=t.includes(p),m=r.includes(p),d=n.find(b=>b.path===p),g=u;if(d){typeof a=="string"&&(g=g.slice(1,g.length-1));let b=d.isRequired?"":"?",h=d.isRequired?"+":"?",w=(d.isRequired?E=>M(A(E)):A)(zp(s+b+": "+g+l,o,h));return d.isRequired||(w=D(w)),w}else{let b=n.some(E=>p.startsWith(E.path)),h=s[s.length-2]==="?";h&&(s=s.slice(1,s.length-1)),h&&typeof a=="object"&&a!==null&&(g=g.split(` -`).map((E,C,O)=>C===O.length-1?E+$i:E).join(` -`)),b&&typeof a=="string"&&(g=g.slice(1,g.length-1),h||(g=M(g))),(typeof a!="object"||a===null)&&!m&&!b&&(g=D(g));let x="";typeof s=="string"&&(x=(f?R(s):s)+": "),g=m?R(g):g;let w=o+x+g+(b?l:D(l));if(f||m){let E=w.split(` -`),C=String(s).length,O=f?R("~".repeat(C)):" ".repeat(C),q=m?Wp(o,s,a,u):0,I=m&&Ca(a),G=m?" "+R("~".repeat(q)):"";O&&O.length>0&&!I&&E.splice(1,0,o+O+G),O&&O.length>0&&I&&E.splice(E.length-1,0,o.slice(0,o.length-2)+G),w=E.join(` -`)}return w}}})}function Wp(e,t,r,n){return r===null?4:typeof r=="string"?r.length+2:Array.isArray(r)&&r.length==0?2:Ca(r)?Math.abs(Hp(`${t}: ${(0,Di.default)(n)}`)-e.length):ye(r)?Re(r)?`new Date('${r.toISOString()}')`.length:24:String(r).length}function Ca(e){return typeof e=="object"&&e!==null&&!(e instanceof oe)&&!ye(e)}function Hp(e){return e.split(` -`).reduce((t,r)=>r.length>t?r.length:t,0)}function zp(e,t,r){return e.split(` -`).map((n,i,o)=>i===0?r+t.slice(1)+n:i(0,Di.default)(n).includes($i)?D(n.replace($i,"")):n.includes("?")?D(n):n).join(` -`)}var sr=2,Li=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 ${D(A("green"))}.`;return`The ${R("`select`")} statement for type ${M(er(t.field.outputType.type))} must not be empty.${i}`}if(t.type==="emptyInclude"){if(r.length===0)return`${M(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 ${D(A("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 ${M("either")} use ${A("`include`")} or ${A("`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 ${D(A("green"))}.`,a=`${o} field ${R(`\`${t.providedName}\``)} for ${R(i)} statement on model ${M(Dt(t.modelName))}.${s}`;return t.didYouMean&&(a+=` Did you mean ${A(`\`${t.didYouMean}\``)}?`),t.isIncludeScalar&&(a+=` -Note, that ${M("include")} statements only accept relation fields.`),a}if(t.type==="invalidFieldType")return`Invalid value ${R(`${or(t.providedValue)}`)} of type ${R(Pt(t.providedValue,void 0))} for field ${M(`${t.fieldName}`)} on model ${M(Dt(t.modelName))}. Expected either ${A("true")} or ${A("false")}.`};this.printArgError=({error:t,path:r},n,i)=>{if(t.type==="invalidName"){let o=`Unknown arg ${R(`\`${t.providedName}\``)} in ${M(r.join("."))} for type ${M(t.outputType?t.outputType.name:Zt(t.originalType))}.`;return t.didYouMeanField?o+=` -\u2192 Did you forget to wrap it with \`${A("select")}\`? ${D("e.g. "+A(`{ select: { ${t.providedName}: ${t.providedValue} } }`))}`:t.didYouMeanArg?(o+=` Did you mean \`${A(t.didYouMeanArg)}\`?`,!n&&!i&&(o+=` ${D("Available args:")} -`+Mt(t.originalType,!0))):t.originalType.fields.length===0?o+=` The field ${M(t.originalType.name)} has no arguments.`:!n&&!i&&(o+=` Available args: - -`+Mt(t.originalType,!0)),o}if(t.type==="invalidType"){let o=or(t.providedValue,{indent:" "}),s=o.split(` -`).length>1;if(s&&(o=` -${o} -`),t.requiredType.bestFittingType.location==="enumTypes")return`Argument ${M(t.argName)}: Provided value ${R(o)}${s?"":" "}of type ${R(Pt(t.providedValue))} on ${M(`prisma.${this.children[0].name}`)} is not a ${A(Xt(vt(t.requiredType.bestFittingType.type),t.requiredType.bestFittingType.isList))}. -\u2192 Possible values: ${t.requiredType.bestFittingType.type.values.map(c=>A(`${vt(t.requiredType.bestFittingType.type)}.${c}`)).join(", ")}`;let a=".";Ct(t.requiredType.bestFittingType.type)&&(a=`: -`+Mt(t.requiredType.bestFittingType.type));let u=`${t.requiredType.inputType.map(c=>A(Xt(vt(c.type),t.requiredType.bestFittingType.isList))).join(" or ")}${a}`,l=t.requiredType.inputType.length===2&&t.requiredType.inputType.find(c=>Ct(c.type))||null;return l&&(u+=` -`+Mt(l.type,!0)),`Argument ${M(t.argName)}: Got invalid value ${R(o)}${s?"":" "}on ${M(`prisma.${this.children[0].name}`)}. Provided ${R(Pt(t.providedValue))}, expected ${u}`}if(t.type==="invalidNullArg"){let o=r.length===1&&r[0]===t.name?"":` for ${M(`${r.join(".")}`)}`,s=` Please use ${M(A("undefined"))} instead.`;return`Argument ${A(t.name)}${o} must not be ${M("null")}.${s}`}if(t.type==="invalidDateArg"){let o=r.length===1&&r[0]===t.argName?"":` for ${M(`${r.join(".")}`)}`;return`Argument ${A(t.argName)}${o} is not a valid Date object.`}if(t.type==="missingArg"){let o=r.length===1&&r[0]===t.missingName?"":` for ${M(`${r.join(".")}`)}`;return`Argument ${A(t.missingName)}${o} is missing.`}if(t.type==="atLeastOne"){let o=i?"":` Available args are listed in ${D(A("green"))}.`,s=t.atLeastFields?` and at least one argument for ${t.atLeastFields.map(a=>M(a)).join(", or ")}`:"";return`Argument ${M(r.join("."))} of type ${M(t.inputType.name)} needs ${A("at least one")} argument${M(s)}.${o}`}if(t.type==="atMostOne"){let o=i?"":` Please choose one. ${D("Available args:")} -${Mt(t.inputType,!0)}`;return`Argument ${M(r.join("."))} of type ${M(t.inputType.name)} needs ${A("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,ot.default)(this.children.map(String).join(` -`),sr)} -}`}validate(t,r=!1,n,i,o){t||(t={});let s=this.children.filter(h=>h.hasInvalidChild||h.hasInvalidArg);if(s.length===0)return;let a=[],u=[],l=t&&t.select?"select":t.include?"include":void 0;for(let h of s){let x=h.collectErrors(l);a.push(...x.fieldErrors.map(w=>({...w,path:r?w.path:w.path.slice(1)}))),u.push(...x.argErrors.map(w=>({...w,path:r?w.path:w.path.slice(1)})))}let c=this.children[0].name,p=r?this.type:c,f=[],m=[],d=[];for(let h of a){let x=this.normalizePath(h.path,t).join(".");if(h.error.type==="invalidFieldName"){f.push(x);let w=h.error.outputType,{isInclude:E}=h.error;w.fields.filter(C=>E?C.outputType.location==="outputObjectTypes":!0).forEach(C=>{let O=x.split(".");d.push({path:`${O.slice(0,O.length-1).join(".")}.${C.name}`,type:"true",isRequired:!1})})}else h.error.type==="includeAndSelect"?(f.push("select"),f.push("include")):m.push(x);if(h.error.type==="emptySelect"||h.error.type==="noTrueSelect"||h.error.type==="emptyInclude"){let w=this.normalizePath(h.path,t),E=w.slice(0,w.length-1).join(".");h.error.field.outputType.type.fields?.filter(O=>h.error.type==="emptyInclude"?O.outputType.location==="outputObjectTypes":!0).forEach(O=>{d.push({path:`${E}.${O.name}`,type:"true",isRequired:!1})})}}for(let h of u){let x=this.normalizePath(h.path,t).join(".");if(h.error.type==="invalidName")f.push(x);else if(h.error.type!=="missingArg"&&h.error.type!=="atLeastOne")m.push(x);else if(h.error.type==="missingArg"){let w=h.error.missingArg.inputTypes.length===1?h.error.missingArg.inputTypes[0].type:h.error.missingArg.inputTypes.map(E=>{let C=Zt(E.type);return C==="Null"?"null":E.isList?C+"[]":C}).join(" | ");d.push({path:x,type:Pi(w,!0,x.split("where.").length===2),isRequired:h.error.missingArg.isRequired})}}let g=h=>{let x=u.some(J=>J.error.type==="missingArg"&&J.error.missingArg.isRequired),w=Boolean(u.find(J=>J.error.type==="missingArg"&&!J.error.missingArg.isRequired)),E=w||x,C="";x&&(C+=` -${D("Note: Lines with ")}${A("+")} ${D("are required")}`),w&&(C.length===0&&(C=` -`),x?C+=D(`, lines with ${A("?")} are optional`):C+=D(`Note: Lines with ${A("?")} are optional`),C+=D("."));let q=u.filter(J=>J.error.type!=="missingArg"||J.error.missingArg.isRequired).map(J=>this.printArgError(J,E,i==="minimal")).join(` -`);if(q+=` -${a.map(J=>this.printFieldError(J,d,i==="minimal")).join(` -`)}`,i==="minimal")return(0,ki.default)(q);let I={ast:r?{[c]:t}:t,keyPaths:f,valuePaths:m,missingItems:d};n?.endsWith("aggregate")&&(I=uf(I));let G=De({callsite:h,originalMethod:n||p,showColors:i&&i==="pretty",callArguments:rn(I),message:`${q}${C} -`});return process.env.NO_COLOR||i==="colorless"?(0,ki.default)(G):G},b=new K(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}},K=class extends Error{get[Symbol.toStringTag](){return"PrismaClientValidationError"}};fe(K,"PrismaClientValidationError");var H=class extends Error{constructor(t){super(t+` -Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};fe(H,"PrismaClientConstructorValidationError");var ce=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,ot.default)(this.args.toString(),sr)} -)`),this.children&&(t+=` { -${(0,ot.default)(this.children.map(String).join(` -`),sr)} -}`),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}}},ae=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 Ii(e,t){return Buffer.isBuffer(e)?JSON.stringify(e.toString("base64")):e instanceof Ee?`{ _ref: ${JSON.stringify(e.name)}}`: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":he.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 oe?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 ae?r.hasInvalidArg:!1)||Array.isArray(r)&&r.some(a=>a instanceof ae?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 ae)return`{ -${(0,ot.default)(t.toString(),2)} -}`;if(Array.isArray(t)){if(this.inputType?.type==="Json")return Ii(t,this.inputType);let r=!t.some(n=>typeof n=="object");return`[${r?"":` -`}${(0,ot.default)(t.map(n=>n instanceof ae?`{ -${(0,ot.default)(n.toString(),sr)} -}`:n instanceof ue?n.stringifyValue(n.value):Ii(n,this.inputType)).join(`,${r?" ":` -`}`),r?0:sr)}${r?"":` -`}]`}return Ii(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 ae?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 ae?t.concat(this.value.collectErrors().map(r=>({...r,path:[this.key,...r.path]}))):t}};function sn({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},u={modelName:i},l=Oa({dmmf:e,selection:{[r]:n},schemaField:a,path:[t],context:u,extensions:o});return new Li(t,l)}function Aa(e){return e}function Oa({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=Xr(t,a),Object.entries(t).reduce((u,[l,c])=>{let p=s.fieldMap?s.fieldMap[l]:s.fields.find(w=>w.name===l);if(!p)return a?.[l]||u.push(new ce({name:l,children:[],error:{type:"invalidFieldName",modelName:s.name,providedName:l,didYouMean:Qr(l,s.fields.map(w=>w.name).concat(Object.keys(a??{}))),outputType:s}})),u;if(p.outputType.location==="scalar"&&p.args.length===0&&typeof c!="boolean")return u.push(new ce({name:l,children:[],error:{type:"invalidFieldType",modelName:s.name,fieldName:l,providedValue:c}})),u;if(c===!1)return u;let f={name:p.name,fields:p.args,constraints:{minNumFields:null,maxNumFields:null}},m=typeof c=="object"?Ea(c,["include","select"]):void 0,d=m?on(m,f,i,[],typeof p=="string"?void 0:p.outputType.type):void 0,g=p.outputType.location==="outputObjectTypes";if(c){if(c.select&&c.include)u.push(new ce({name:l,children:[new ce({name:"include",args:new ae,error:{type:"includeAndSelect",field:p}})]}));else if(c.include){let w=Object.keys(c.include);if(w.length===0)return u.push(new ce({name:l,children:[new ce({name:"include",args:new ae,error:{type:"emptyInclude",field:p}})]})),u;if(p.outputType.location==="outputObjectTypes"){let E=p.outputType.type,C=E.fields.filter(q=>q.outputType.location==="outputObjectTypes").map(q=>q.name),O=w.filter(q=>!C.includes(q));if(O.length>0)return u.push(...O.map(q=>new ce({name:q,children:[new ce({name:q,args:new ae,error:{type:"invalidFieldName",modelName:E.name,outputType:E,providedName:q,didYouMean:Qr(q,C)||void 0,isInclude:!0,isIncludeScalar:E.fields.some(I=>I.name===q)}})]}))),u}}else if(c.select){let w=Object.values(c.select);if(w.length===0)return u.push(new ce({name:l,children:[new ce({name:"select",args:new ae,error:{type:"emptySelect",field:p}})]})),u;if(w.filter(C=>C).length===0)return u.push(new ce({name:l,children:[new ce({name:"select",args:new ae,error:{type:"noTrueSelect",field:p}})]})),u}}let b=g?Zp(e,p.outputType.type):null,h=b;c&&(c.select?h=c.select:c.include?h=nr(b,c.include):c.by&&Array.isArray(c.by)&&p.outputType.namespace==="prisma"&&p.outputType.location==="outputObjectTypes"&&ks(p.outputType.type.name)&&(h=Yp(c.by)));let x;if(h!==!1&&g){let w=i.modelName;typeof p.outputType.type=="object"&&p.outputType.namespace==="model"&&p.outputType.location==="outputObjectTypes"&&(w=p.outputType.type.name),x=Oa({dmmf:e,selection:h,schemaField:p,path:[...n,l],context:{modelName:w},extensions:o})}return u.push(new ce({name:l,args:d,children:x,schemaField:p})),u},[])}function Yp(e){let t=Object.create(null);for(let r of e)t[r]=!0;return t}function Zp(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 _i(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 Ra(e,t,r){let{isList:n}=t,i=Xp(t,r),o=Pt(e,t);return o===i||n&&o==="List<>"||i==="Json"&&o!=="Symbol"&&!(e instanceof oe)&&!(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"&&ef(e)||e===null?!0:t.isList&&Array.isArray(e)?e.every(s=>Ra(s,{...t,isList:!1},r)):!1}function Xp(e,t,r=e.isList){let n=vt(e.type);return e.location==="fieldRefTypes"&&t.modelName&&(n+=`<${t.modelName}>`),Xt(n,r)}var nn=e=>wa(e,(t,r)=>r!==void 0);function ef(e){return/^\-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i.test(e)}function tf(e,t,r,n){let i=null,o=[];for(let s of r.inputTypes){if(i=nf(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:u})=>{let l=u.map(c=>{let p=1;return c.error.type==="invalidType"&&(p=2*Math.exp($a(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:u.length+rf(l),arg:a,errors:u}});return s.sort((a,u)=>a.scoret+r,0)}function nf(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"&&!xa(t))return _i(e,t,r,n);{let c=nn(t),p,f=Object.keys(c||{}),m=f.length;return m===0&&typeof n.type.constraints.minNumFields=="number"&&n.type.constraints.minNumFields>0||n.type.constraints.fields?.some(d=>f.includes(d))===!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:f}),new ue({key:e,value:c===null?null:on(c,n.type,i,r.inputTypes),isEnum:n.location==="enumTypes",error:p,inputType:n,schemaArg:r})}}else return Sa(e,t,r,n,i);if(!Array.isArray(t)&&n.isList&&e!=="updateMany"&&(t=[t]),n.location==="enumTypes"||n.location==="scalar")return Sa(e,t,r,n,i);let a=n.type,l=(typeof a.constraints?.minNumFields=="number"&&a.constraints?.minNumFields>0?Array.isArray(t)&&t.some(c=>!c||Object.keys(nn(c)).length===0):!1)?{inputType:a,key:e,type:"atLeastOne"}:void 0;if(!l){let c=typeof a.constraints?.maxNumFields=="number"&&a.constraints?.maxNumFields<2?Array.isArray(t)&&t.find(p=>!p||Object.keys(nn(p)).length!==1):!1;c&&(l={inputType:a,key:e,type:"atMostOne",providedKeys:Object.keys(c)})}if(!Array.isArray(t))for(let c of r.inputTypes){let p=on(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)?_i(String(p),c,sf(r),of(n)):on(c,a,i)),isEnum:!1,inputType:n,schemaArg:r,error:l})}function of(e){return{...e,isList:!1}}function sf(e){return{...e,inputTypes:e.inputTypes.filter(t=>!t.isList)}}function Ct(e){return!(typeof e=="string"||Object.hasOwnProperty.call(e,"values"))}function Sa(e,t,r,n,i){return ye(t)&&!Re(t)?new ue({key:e,value:t,schemaArg:r,inputType:n,error:{type:"invalidDateArg",argName:e}}):Ra(t,n,i)?new ue({key:e,value:t,isEnum:n.location==="enumTypes",schemaArg:r,inputType:n}):_i(e,t,r,n)}function on(e,t,r,n,i){t.meta?.source&&(r={modelName:t.meta.source});let o=nn(e),{fields:s,fieldMap:a}=t,u=s.map(f=>[f.name,void 0]),l=Object.entries(o||{}),p=Ns(l,u,f=>f[0]).reduce((f,[m,d])=>{let g=a?a[m]:s.find(h=>h.name===m);if(!g){let h=typeof d=="boolean"&&i&&i.fields.some(x=>x.name===m)?m:null;return f.push(new ue({key:m,value:d,error:{type:"invalidName",providedName:m,providedValue:d,didYouMeanField:h,didYouMeanArg:!h&&Qr(m,[...s.map(x=>x.name),"select"])||void 0,originalType:t,possibilities:n,outputType:i}})),f}let b=tf(m,d,g,r);return b&&f.push(b),f},[]);if(typeof t.constraints.minNumFields=="number"&&l.lengthf.error?.type==="missingArg"||f.error?.type==="atLeastOne")){let f=t.fields.filter(m=>!m.isRequired&&o&&(typeof o[m.name]>"u"||o[m.name]===null));p.push(...f.map(m=>{let d=m.inputTypes[0];return new ue({key:m.name,value:void 0,isEnum:d.location==="enumTypes",error:{type:"missingArg",missingName:m.name,missingArg:m,atLeastOne:Boolean(t.constraints.minNumFields)||!1,atMostOne:t.constraints.maxNumFields===1||!1},inputType:d})}))}return new ae(p)}function an({document:e,path:t,data:r}){let n=ir(r,t);if(n==="undefined")return null;if(typeof n!="object")return n;let i=af(e,t);return ji({field:i,data:n})}function ji({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 he(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)ji({field:n,data:o[n.name]});else ji({field:n,data:t[n.name]})}return t}function af(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 Ni(e){return e.split(".").filter(t=>t!=="select").join(".")}function qi(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]=qi(e.select[i]);else r[n]=qi(e[n]);return r}return e}function uf({ast:e,keyPaths:t,missingItems:r,valuePaths:n}){let i=t.map(Ni),o=n.map(Ni),s=r.map(u=>({path:Ni(u.path),isRequired:u.isRequired,type:u.type}));return{ast:qi(e),keyPaths:i,missingItems:s,valuePaths:o}}function ar(e){return{getKeys(){return Object.keys(e)},getPropertyValue(t){return e[t]}}}function Ye(e,t){return{getKeys(){return[e]},getPropertyValue(){return t()}}}function st(e){let t=new $e;return{getKeys(){return e.getKeys()},getPropertyValue(r){return t.getOrCreate(r,()=>e.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}var Na=require("util");var un={enumerable:!0,configurable:!0,writable:!0};function ln(e){let t=new Set(e);return{getOwnPropertyDescriptor:()=>un,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var Da=Symbol.for("nodejs.util.inspect.custom");function Ze(e,t){let r=lf(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=Ia(Reflect.ownKeys(o),r),a=Ia(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=r.get(s);return a?a.getPropertyDescriptor?{...un,...a?.getPropertyDescriptor(s)}:un:Reflect.getOwnPropertyDescriptor(o,s)},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)}});return i[Da]=function(o,s,a=Na.inspect){let u={...this};return delete u[Da],a(u,s)},i}function lf(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 Ia(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}function Bi(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}var ur="";function ka(e){var t=e.split(` -`);return t.reduce(function(r,n){var i=ff(n)||df(n)||yf(n)||Ef(n)||wf(n);return i&&r.push(i),r},[])}var cf=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack||\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,pf=/\((\S*)(?::(\d+))(?::(\d+))\)/;function ff(e){var t=cf.exec(e);if(!t)return null;var r=t[2]&&t[2].indexOf("native")===0,n=t[2]&&t[2].indexOf("eval")===0,i=pf.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]||ur,arguments:r?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}var mf=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function df(e){var t=mf.exec(e);return t?{file:t[2],methodName:t[1]||ur,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var gf=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,hf=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function yf(e){var t=gf.exec(e);if(!t)return null;var r=t[3]&&t[3].indexOf(" > eval")>-1,n=hf.exec(t[3]);return r&&n!=null&&(t[3]=n[1],t[4]=n[2],t[5]=null),{file:t[3],methodName:t[1]||ur,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}var bf=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function wf(e){var t=bf.exec(e);return t?{file:t[3],methodName:t[1]||ur,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}var xf=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Ef(e){var t=xf.exec(e);return t?{file:t[2],methodName:t[1]||ur,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var Vi=class{getLocation(){return null}},Ui=class{constructor(){this._error=new Error}getLocation(){let t=this._error.stack;if(!t)return null;let n=ka(t).find(i=>{if(!i.file)return!1;let o=li(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 Xe(e){return e==="minimal"?new Vi:new Ui}function Ie(e){let t,r=n=>{try{return n===void 0||n?.kind==="itx"?t??(t=La(e(n))):La(e(n))}catch(i){return Promise.reject(i)}};return{then(n,i,o){return r(o).then(n,i,o)},catch(n,i){return r(i).catch(n,i)},finally(n,i){return r(i).finally(n,i)},requestTransaction(n){let i=r(n);return i.requestTransaction?i.requestTransaction(n):i},[Symbol.toStringTag]:"PrismaPromise"}}function La(e){return typeof e.then=="function"?e:Promise.resolve(e)}var _a={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function St(e={}){let t=vf(e);return Object.entries(t).reduce((n,[i,o])=>(_a[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function vf(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function cn(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function ja(e,t){let r=cn(e);return t({action:"aggregate",unpacker:r,argsMapper:St})(e)}function Pf(e={}){let{select:t,...r}=e;return typeof t=="object"?St({...r,_count:t}):St({...r,_count:{_all:!0}})}function Mf(e={}){return typeof e.select=="object"?t=>cn(e)(t)._count:t=>cn(e)(t)._count._all}function qa(e,t){return t({action:"count",unpacker:Mf(e),argsMapper:Pf})(e)}function Ff(e={}){let t=St(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);return t}function Cf(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function Ba(e,t){return t({action:"groupBy",unpacker:Cf(e),argsMapper:Ff})(e)}function Va(e,t,r){if(t==="aggregate")return n=>ja(n,r);if(t==="count")return n=>qa(n,r);if(t==="groupBy")return n=>Ba(n,r)}function Ua(e,t){let r=t.fields.filter(i=>!i.relationName),n=pi(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")},...ln(Object.keys(n))})}function Sf(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function Af(e,t,r){return t===void 0?e??{}:tn(t,r,e||!0)}function Qi(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((u,l)=>({...u,[l.name]:l}),{});return u=>{let l=Xe(e._errorFormat),c=Sf(n,i),p=Af(u,o,c),f=r({dataPath:c,callsite:l})(p),m=Of(e,t);return new Proxy(f,{get(d,g){if(!m.includes(g))return d[g];let h=[a[g].type,r,g],x=[c,p];return Qi(e,...h,...x)},...ln([...m,...Object.getOwnPropertyNames(f)])})}}function Of(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}var pn=Qa().version;var ve=class extends re{constructor(t){super(t,{code:"P2025",clientVersion:pn}),this.name="NotFoundError"}};fe(ve,"NotFoundError");function Gi(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=Gi(e,t,r,o)}else typeof n=="function"?i=n:i=!1;return i}var $f=/(findUnique|findFirst)/;function Ga(e,t,r,n){if(r??(r="record"),n&&!e&&$f.exec(t))throw typeof n=="boolean"&&n?new ve(`No ${r} found`):typeof n=="function"?n(new ve(`No ${r} found`)):kt(n)?n:new ve(`No ${r} found`)}function Ja(e,t,r){return e===xe.ModelAction.findFirstOrThrow||e===xe.ModelAction.findUniqueOrThrow?Df(t,r):r}function Df(e,t){return async r=>{if("rejectOnNotFound"in r.args){let i=De({originalMethod:r.clientMethod,callsite:r.callsite,message:"'rejectOnNotFound' option is not supported"});throw new K(i)}return await t(r).catch(i=>{throw i instanceof re&&i.code==="P2025"?new ve(`No ${e} found`):i})}}var If=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Nf=["aggregate","count","groupBy"];function Ji(e,t){let r=[Lf(e,t),kf(t)];e._engineConfig.previewFeatures?.includes("fieldReference")&&r.push(jf(e,t));let n=e._extensions.getAllModelExtensions(t);return n&&r.push(ar(n)),Ze({},r)}function kf(e){return Ye("name",()=>e)}function Lf(e,t){let r=Te(t),n=Object.keys(xe.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=u=>e._request(u);s=Ja(o,t,s);let a=u=>l=>{let c=Xe(e._errorFormat);return Ie(p=>{let f={args:l,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:p,callsite:c};return s({...f,...u})})};return If.includes(o)?Qi(e,t,a):_f(i)?Va(e,i,a):a({})}}}function _f(e){return Nf.includes(e)}function jf(e,t){return st(Ye("fields",()=>{let r=e._runtimeDataModel.models[t];return Ua(t,r)}))}function Ka(e){return e.replace(/^./,t=>t.toUpperCase())}var Ki=Symbol();function fn(e){let t=[qf(e),Ye(Ki,()=>e)],r=e._extensions.getAllClientExtensions();return r&&t.push(ar(r)),Ze(e,t)}function qf(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(Te),n=[...new Set(t.concat(r))];return st({getKeys(){return n},getPropertyValue(i){let o=Ka(i);if(e._runtimeDataModel.models[o]!==void 0)return Ji(e,o);if(e._runtimeDataModel.models[i]!==void 0)return Ji(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function Wa(e){return e[Ki]?e[Ki]:e}function Ha(e){if(!this._hasPreviewFlag("clientExtensions"))throw new K("Extensions are not yet generally available, please add `clientExtensions` to the `previewFeatures` field in the `generator` block in the `schema.prisma` file.");if(typeof e=="function")return e(this);let t=Wa(this),r=Object.create(t,{_extensions:{value:this._extensions.append(e)}});return fn(r)}function Ne(e){if(typeof e!="object")return e;var t,r,n=Object.prototype.toString.call(e);if(n==="[object Object]"){if(e.constructor!==Object&&typeof e.constructor=="function"){r=new e.constructor;for(t in e)e.hasOwnProperty(t)&&r[t]!==e[t]&&(r[t]=Ne(e[t]))}else{r={};for(t in e)t==="__proto__"?Object.defineProperty(r,t,{value:Ne(e[t]),configurable:!0,enumerable:!0,writable:!0}):r[t]=Ne(e[t])}return r}if(n==="[object Array]"){for(t=e.length,r=Array(t);t--;)r[t]=Ne(e[t]);return r}return n==="[object Set]"?(r=new Set,e.forEach(function(i){r.add(Ne(i))}),r):n==="[object Map]"?(r=new Map,e.forEach(function(i,o){r.set(Ne(o),Ne(i))}),r):n==="[object Date]"?new Date(+e):n==="[object RegExp]"?(r=new RegExp(e.source,e.flags),r.lastIndex=e.lastIndex,r):n==="[object DataView]"?new e.constructor(Ne(e.buffer)):n==="[object ArrayBuffer]"?e.slice(0):n.slice(-6)==="Array]"?new e.constructor(e):e}function za(e,t,r,n=0){return Ie(i=>{let o=t.customDataProxyFetch??(s=>s);return 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:Ne(t.args??{}),__internalParams:t,query:(s,a=t)=>{let u=a.customDataProxyFetch??(l=>l);return a.customDataProxyFetch=l=>o(u(l)),a.args=s,za(e,a,r,n+1)}})})}function Ya(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??"*",o);return za(e,t,s)}var mn=class{constructor(t,r){this.extension=t;this.previous=r;this.computedFieldsCache=new $e;this.modelExtensionsCache=new $e;this.queryCallbacksCache=new $e;this.clientExtensions=Dr(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions())}getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>aa(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])?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)),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]),n.concat(i))})}},et=class{constructor(t){this.head=t}static empty(){return new et}static single(t){return new et(new mn(t))}isEmpty(){return this.head===void 0}append(t){return new et(new mn(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)??[]}};var Za=B("prisma:client"),Xa={Vercel:"vercel","Netlify CI":"netlify"};function eu({postinstall:e,ciName:t,clientVersion:r}){if(Za("checkPlatformCaching:postinstall",e),Za("checkPlatformCaching:ciName",t),e===!0&&t&&t in Xa){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/${Xa[t]}-build`;throw console.error(n),new Q(n,r)}}var Bf={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"},dn=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,u=Bf[t];(t==="executeRaw"||t==="queryRaw"||t==="runCommandRaw")&&(a=t);let l;if(r!==void 0){if(l=this.dmmf?.mappingsMap[r],l===void 0)throw new Error(`Could not find mapping for model ${r}`);if(a=l[t==="count"?"aggregate":t],!a){let f=De({message:`Model \`${r}\` does not support \`${t}\` action.`,originalMethod:o,callsite:s});throw new K(f)}}if(u!=="query"&&u!=="mutation")throw new Error(`Invalid operation ${u} 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 ${u}`);let p=sn({dmmf:this.dmmf,rootField:a,rootTypeName:u,select:n,modelName:r,extensions:i});return p.validate(n,!1,o,this.errorFormat,s),new Wi(p)}createBatch(t){return t.map(r=>r.toEngineQuery())}},Wi=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 ae?`${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")),an({document:this.document,path:i,data:t})}getRootField(){return this.document.children[0].name}};function gn(e){return e===null?e:Array.isArray(e)?e.map(gn):typeof e=="object"?Vf(e)?Uf(e):yt(e,gn):e}function Vf(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function Uf({$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 he(t);case"Json":return JSON.parse(t);default:Le(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 iu=S(Br());var qe=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 yn=e=>e,tu={bold:yn,red:yn,green:yn,dim:yn},ru={bold:M,red:R,green:A,dim:D},At={write(e){e.writeLine(",")}};var ke=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 tt=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var U=class extends tt{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 U))return;let u=s.value.getField(a);if(!u)return;s=u}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 U))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 U))return;let a=s.getSelectionParent();if(!a)return;i=a}return i}getSelectionParent(){let r=this.getField("select");if(r?.value instanceof U)return{kind:"select",value:r.value};let n=this.getField("include");if(n?.value instanceof U)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 ke("{}");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithContents(r,n){r.writeLine("{").withIndent(()=>{r.writeJoined(At,[...n,...this.suggestions]).newLine()}),r.write("}"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(r.context.colors.red("~".repeat(this.getPrintWidth())))})}};var X=class extends tt{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new ke(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}};var bn=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(At,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function Hi(e,t){switch(e.kind){case"IncludeAndSelect":Gf(e,t);break;case"IncludeOnScalar":Jf(e,t);break;case"EmptySelection":Kf(e,t);break;case"UnknownSelectionField":Wf(e,t);break;case"UnknownArgument":Hf(e,t);break;case"UnknownInputField":zf(e,t);break;case"RequiredArgumentMissing":Yf(e,t);break;case"InvalidArgumentType":Zf(e,t);break;case"InvalidArgumentValue":Xf(e,t);break;case"ValueTooLarge":em(e,t);break;case"SomeFieldsMissing":tm(e,t);break;case"TooManyFieldsGiven":rm(e,t);break;case"Union":nm(e,t);break;default:throw new Error("not implemented: "+e.kind)}}function Gf(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath);r&&r instanceof U&&(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 Jf(e,t){let[r,n]=wn(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 qe(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)}. ${lr(s)}`:a+=".",a+=` -Note that ${s.bold("include")} statements only accept relation fields.`,a})}function Kf(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),uu(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${lr(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function Wf(e,t){let[r,n]=wn(e.selectionPath),i=t.arguments.getDeepSelectionParent(r);i&&(i.value.getField(n)?.markAsError(),uu(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(lr(o)),s.join(" ")})}function Hf(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath);n instanceof U&&(n.getField(r)?.markAsError(),sm(n,e.arguments)),t.addErrorMessage(i=>ou(i,r,e.arguments.map(o=>o.name)))}function zf(e,t){let[r,n]=wn(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath);if(i instanceof U){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r);o instanceof U&&lu(o,e.inputType)}t.addErrorMessage(o=>ou(o,n,e.inputType.fields.map(s=>s.name)))}function ou(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=um(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(lr(e)),n.join(" ")}function Yf(e,t){let r;t.addErrorMessage(u=>r?.value instanceof X&&r.value.text==="null"?`Argument \`${u.green(o)}\` must not be ${u.red("null")}.`:`Argument \`${u.green(o)}\` is missing.`);let n=t.arguments.getDeepSubSelectionValue(e.selectionPath);if(!(n instanceof U))return;let[i,o]=wn(e.argumentPath),s=new bn,a=n.getDeepFieldValue(i);if(a instanceof U)if(r=a.getField(o),r&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let u of e.inputTypes[0].fields)s.addField(u.name,u.typeNames.join(" | "));a.addSuggestion(new qe(o,s).makeRequired())}else{let u=e.inputTypes.map(su).join(" | ");a.addSuggestion(new qe(o,u).makeRequired())}}function su(e){return e.kind==="list"?`${su(e.elementType)}[]`:e.name}function Zf(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath);n instanceof U&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=xn("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 Xf(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath);n instanceof U&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=xn("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 em(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath),i;if(n instanceof U){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof X&&(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 tm(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath);if(n instanceof U){let i=n.getDeepFieldValue(e.argumentPath);i instanceof U&&lu(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")} ${xn("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(lr(i)),o.join(" ")})}function rm(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath),i=[];if(n instanceof U){let o=n.getDeepFieldValue(e.argumentPath);o instanceof U&&(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 ${xn("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function nm(e,t){let r=au(e);r?Hi(r,t):t.addErrorMessage(()=>"Unknown error")}function au(e){return im(e)??om(e)}function im({errors:e}){if(e.length===0||e[0].kind!=="InvalidArgumentType")return;let t={...e[0],argument:{...e[0].argument}};for(let r=1;r{t.kind==="Union"&&(t=au(t)??t);let r=0;return Array.isArray(t.selectionPath)&&(r+=t.selectionPath.length),Array.isArray(t.argumentPath)&&(r+=t.argumentPath.length),r})}function uu(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new qe(r.name,"true"))}function sm(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new qe(r.name,r.typeNames.join(" | ")))}function lu(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new qe(r.name,r.typeNames.join(" | ")))}function wn(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function lr({green:e}){return`Available options are listed in ${e("green")}.`}function xn(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var am=3;function um(e,t){let r=1/0,n;for(let i of t){let o=(0,iu.default)(e,i);o>am||on.getPrintWidth()))+2}write(r){if(this.items.length===0){this.writeEmpty(r);return}this.writeWithItems(r)}writeEmpty(r){let n=new ke("[]");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithItems(r){let{colors:n}=r.context;r.writeLine("[").withIndent(()=>r.writeJoined(At,this.items).newLine()).write("]"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(n.red("~".repeat(this.getPrintWidth())))})}};var cu=": ",Tn=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()+cu.length}write(t){let r=new ke(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(cu).write(this.value)}};var zi=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 pu(e){return new zi(fu(e))}function fu(e){let t=new U;for(let[r,n]of Object.entries(e)){let i=new Tn(r,mu(n));t.addField(i)}return t}function mu(e){if(typeof e=="string")return new X(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new X(String(e));if(typeof e=="bigint")return new X(`${e}n`);if(e===null)return new X("null");if(e===void 0)return new X("undefined");if(Ke(e))return new X(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return Buffer.isBuffer(e)?new X(`Buffer.alloc(${e.byteLength})`):new X(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=Re(e)?e.toISOString():"Invalid Date";return new X(`new Date("${t}")`)}if(e instanceof oe)return new X(`Prisma.${e._getName()}`);if(Vr(e))return new X(`prisma.${Ft(e.modelName)}.$fields.${e.name}`);if(Array.isArray(e))return lm(e);if(typeof e=="object")return fu(e);Le(e,"Unknown value type")}function lm(e){let t=new En;for(let r of e)t.addItem(mu(r));return t}function vn({args:e,errors:t,errorFormat:r,callsite:n,originalMethod:i}){let o=pu(e);for(let c of t)Hi(c,o);let s=r==="pretty"?ru:tu,a=o.renderAllMessages(s),u=new hn(0,{colors:s}).write(o).toString(),l=De({message:a,callsite:n,originalMethod:i,showColors:r==="pretty",callArguments:u});throw new K(l)}var cm={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 du({modelName:e,action:t,args:r,runtimeDataModel:n,extensions:i,callsite:o,clientMethod:s,errorFormat:a}){let u=new Ot({runtimeDataModel:n,modelName:e,action:t,rootArgs:r,callsite:o,extensions:i,selectionPath:[],argumentPath:[],originalMethod:s,errorFormat:a});return{modelName:e,action:cm[t],query:Yi(r,u)}}function Yi({select:e,include:t,...r}={},n){return{arguments:hu(r,n),selection:pm(e,t,n)}}function pm(e,t,r){return e&&t&&r.throwValidationError({kind:"IncludeAndSelect",selectionPath:r.getSelectionPath()}),e?dm(e,r):fm(r,t)}function fm(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]=Yi(i,r.nestSelection(n)))}}function dm(e,t){let r={},n=t.getComputedFields(),i=Xr(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]=Yi(s,t.nestSelection(o))))}return r}function gu(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(ye(e)){if(Re(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(Vr(e))return{$type:"FieldRef",value:{_ref:e.name}};if(Array.isArray(e))return gm(e,t);if(ArrayBuffer.isView(e))return{$type:"Bytes",value:Buffer.from(e).toString("base64")};if(hm(e))return e.values;if(Ke(e))return{$type:"Decimal",value:e.toFixed()};if(e instanceof oe){if(e!==Et.instances[e._getName()])throw new Error("Invalid ObjectEnumValue");return{$type:"Enum",value:e._getName()}}if(typeof e=="object")return hu(e,t);Le(e,"Unknown value type")}function hu(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]=gu(i,t.nestArgument(n)))}return r}function gm(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 Ot({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}nestArgument(t){return new Ot({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};var cr=class{constructor(t,r){this.runtimeDataModel=t;this.errorFormat=r}createMessage(t){let r=du({...t,runtimeDataModel:this.runtimeDataModel,errorFormat:this.errorFormat});return new Pn(r)}createBatch(t){return t.map(r=>r.toEngineQuery())}},ym={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},Pn=class{constructor(t){this.query=t}isWrite(){return ym[this.query.action]}getBatchId(){if(this.query.action!=="findUnique")return;let t=[];return this.query.modelName&&t.push(this.query.modelName),this.query.query.arguments&&t.push(Zi(this.query.query.arguments)),t.push(Zi(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 gn(ir(n,i))}};function Zi(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${Zi(n)})`:r}).join(" ")})`}var be=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 be?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(;ie.reduce((t,r,n)=>`${t}@P${n}${r}`);function Rt(e){try{return wu(e,"fast")}catch{return wu(e,"slow")}}function wu(e,t){return JSON.stringify(e.map(r=>bm(r,t)))}function bm(e,t){return typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:ye(e)?{prisma__type:"date",prisma__value:e.toJSON()}:he.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:Buffer.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:wm(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:Buffer.from(e).toString("base64")}:typeof e=="object"&&t==="slow"?Eu(e):e}function wm(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Eu(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(xu);let t={};for(let r of Object.keys(e))t[r]=xu(e[r]);return t}function xu(e){return typeof e=="bigint"?e.toString():Eu(e)}var xm=/^(\s*alter\s)/i,Tu=B("prisma:client");function ro(e,t,r){if(t.length>0&&xm.exec(e))throw new Error(`Running ALTER using ${r} 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 -`)}function Em(e){return Array.isArray(e)}var no=(e,t)=>([r,...n])=>{let i="",o;if(typeof r=="string")i=r,o={values:Rt(n||[]),__prismaRawParameters__:!0},t.includes("executeRaw")&&ro(i,n,"prisma.$executeRawUnsafe(, [...values])");else if(Em(r))switch(e._activeProvider){case"sqlite":case"mysql":{let s=new be(r,n);i=s.sql,o={values:Rt(s.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":{let s=new be(r,n);i=s.text,t.includes("executeRaw")&&ro(i,s.values,"prisma.$executeRaw``"),o={values:Rt(s.values),__prismaRawParameters__:!0};break}case"sqlserver":{i=to(r),o={values:Rt(n),__prismaRawParameters__:!0};break}default:throw new Error(`The ${e._activeProvider} provider does not support ${t}`)}else{switch(e._activeProvider){case"sqlite":case"mysql":i=r.sql;break;case"cockroachdb":case"postgresql":i=r.text,t.includes("executeRaw")&&ro(i,r.values,"prisma.$executeRaw(sql``)");break;case"sqlserver":i=to(r.strings);break;default:throw new Error(`The ${e._activeProvider} provider does not support ${t}`)}o={values:Rt(r.values),__prismaRawParameters__:!0}}return o?.values?Tu(`prisma.${t}(${i}, ${o.values})`):Tu(`prisma.${t}(${i})`),{query:i,parameters:o}};var vu={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,t){return t()}},io=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??vu}};function Pu(e){return e.includes("tracing")?new io:vu}function Mu(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}function Fu(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)}function Su(e,t,r){let n=Cu(e,r),i=Cu(t,r),o=Object.values(i).map(a=>a[a.length-1]),s=Object.keys(i);return Object.entries(n).forEach(([a,u])=>{s.includes(a)||o.push(u[u.length-1])}),o}var Cu=(e,t)=>e.reduce((r,n)=>{let i=t(n);return r[i]||(r[i]=[]),r[i].push(n),r},{});var Mn=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 Ru=S(Qt());function Fn(e){return typeof e.batchRequestIdx=="number"}function Au({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 u=a.needs.filter(l=>!r[l]);u.length>0&&s.push(Bi(u))}Tm(e,a.needs)&&o.push(vm(a,Ze(e,o)))}return o.length>0||s.length>0?Ze(e,[...o,...s]):e}function Tm(e,t){return t.every(r=>ci(e,r))}function vm(e,t){return st(Ye(e.name,()=>e.compute(t)))}function Cn({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;sc.name===o);if(!u||u.kind!=="object"||!u.relationName)continue;let l=typeof s=="object"?s:{};t[o]=Cn({visitor:i,result:t[o],args:l,modelName:u.type,runtimeDataModel:n})}}var Sn=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)}):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:i,protocolEncoder:o,otelParentCtx:s}=n[0],a=o.createBatch(n.map(c=>c.protocolMessage)),u=this.client._tracingHelper.getTraceParent(s),l=n.some(c=>c.protocolMessage.isWrite());return this.client._engine.requestBatch(a,{traceparent:u,transaction:Mm(i),containsWrite:l,customDataProxyFetch:n[0].customDataProxyFetch})},singleLoader:n=>{let i=n.transaction?.kind==="itx"?$u(n.transaction):void 0;return this.client._engine.request(n.protocolMessage.toEngineQuery(),{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:n.protocolMessage.isWrite(),customDataProxyFetch:n.customDataProxyFetch})},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:n.protocolMessage.getBatchId()})}async request({protocolMessage:t,protocolEncoder:r,dataPath:n=[],callsite:i,modelName:o,rejectOnNotFound:s,clientMethod:a,args:u,transaction:l,unpacker:c,extensions:p,otelParentCtx:f,otelChildCtx:m,customDataProxyFetch:d}){try{let g=await this.dataloader.request({protocolMessage:t,protocolEncoder:r,transaction:l,otelParentCtx:f,otelChildCtx:m,customDataProxyFetch:d}),b=g?.data,h=g?.elapsed,x=this.unpack(t,b,n,c);return Ga(x,a,o,s),o&&(x=this.applyResultExtensions({result:x,modelName:o,args:u,extensions:p})),process.env.PRISMA_CLIENT_GET_TIME?{data:x,elapsed:h}:x}catch(g){this.handleAndLogRequestError({error:g,clientMethod:a,callsite:i,transaction:l,args:u})}}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(Pm(t),Fm(t,i)||t instanceof ve)throw t;if(t instanceof re&&Cm(t)){let a=Du(t.meta);vn({args:o,errors:[a],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r})}let s=t.message;throw n&&(s=De({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:s})),s=this.sanitizeMessage(s),t.code?new re(s,{code:t.code,clientVersion:this.client._clientVersion,meta:t.meta,batchRequestIdx:t.batchRequestIdx}):t.isPanic?new ge(s,this.client._clientVersion):t instanceof ne?new ne(s,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx}):t instanceof Q?new Q(s,this.client._clientVersion):t instanceof ge?new ge(s,this.client._clientVersion):(t.clientVersion=this.client._clientVersion,t)}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,Ru.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:Cn({result:t,args:n??{},modelName:r,runtimeDataModel:this.client._runtimeDataModel,visitor(s,a,u){let l=Te(a);return Au({result:s,modelName:l,select:u.select,extensions:i})}})}get[Symbol.toStringTag](){return"RequestHandler"}};function Mm(e){if(!!e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:$u(e)};Le(e,"Unknown transaction kind")}}function $u(e){return{id:e.id,payload:e.payload}}function Fm(e,t){return Fn(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function Cm(e){return e.code==="P2009"||e.code==="P2012"}function Du(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(Du)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}function Iu(e){return e.map(t=>{let r={};for(let n of Object.keys(t))r[n]=Nu(t[n]);return r})}function Nu({prisma__type:e,prisma__value:t}){switch(e){case"bigint":return BigInt(t);case"bytes":return Buffer.from(t,"base64");case"decimal":return new he(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"array":return t.map(Nu);default:return t}}var ju=S(Br());var ku=["datasources","errorFormat","log","__internal","rejectOnNotFound"],Lu=["pretty","colorless","minimal"],_u=["info","query","warn","error"],Sm={datasources:(e,t)=>{if(!!e){if(typeof e!="object"||Array.isArray(e))throw new H(`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=$t(r,t)||`Available datasources: ${t.join(", ")}`;throw new H(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new H(`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 H(`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 H(`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 H(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Lu.includes(e)){let t=$t(e,Lu);throw new H(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new H(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!_u.includes(r)){let n=$t(r,_u);throw new H(`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=$t(i,o);throw new H(`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 H(`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 H(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=$t(r,t);throw new H(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}},rejectOnNotFound:e=>{if(!!e){if(kt(e)||typeof e=="boolean"||typeof e=="object"||typeof e=="function")return e;throw new H(`Invalid rejectOnNotFound expected a boolean/Error/{[modelName: Error | boolean]} but received ${JSON.stringify(e)}`)}}};function qu(e,t){for(let[r,n]of Object.entries(e)){if(!ku.includes(r)){let i=$t(r,ku);throw new H(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}Sm[r](n,t)}}function $t(e,t){if(t.length===0||typeof e!="string")return"";let r=Am(e,t);return r?` Did you mean "${r}"?`:""}function Am(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,ju.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)))},u=l=>{o||(o=!0,r(l))};for(let l=0;l{n[l]=c,a()},c=>{if(!Fn(c)){u(c);return}c.batchRequestIdx===l?u(c):(i||(i=c),a())})})}var Se=B("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Om=Symbol.for("prisma.client.transaction.id"),Rm={id:0,nextId(){return++this.id}};function Ju(e){class t{constructor(n){this._middlewares=new Mn;this._getDmmf=Rr(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(qs(i)))}catch(i){this._fetcher.handleAndLogRequestError({...n,args:{},error:i})}});this._getProtocolEncoder=Rr(async n=>this._engineConfig.engineProtocol==="json"?new cr(this._runtimeDataModel,this._errorFormat):(this._dmmf===void 0&&(this._dmmf=await this._getDmmf(n)),new dn(this._dmmf,this._errorFormat)));this.$extends=Ha;eu(e),n&&qu(n,e.datasourceNames);let i=new Qu.EventEmitter().on("error",()=>{});this._extensions=et.empty(),this._previewFeatures=e.generator?.previewFeatures??[],this._rejectOnNotFound=n?.rejectOnNotFound,this._clientVersion=e.clientVersion??pn,this._activeProvider=e.activeProvider,this._dataProxy=e.dataProxy,this._tracingHelper=Pu(this._previewFeatures),this._clientEngineType=Qn(e.generator);let o={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&pr.default.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&pr.default.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s=Nt(o,{conflictCheck:"none"});try{let a=n??{},u=a.__internal??{},l=u.debug===!0;l&&B.enable("prisma:client");let c=pr.default.resolve(e.dirname,e.relativePath);Gu.default.existsSync(c)||(c=e.dirname),Se("dirname",e.dirname),Se("relativePath",e.relativePath),Se("cwd",c);let p=a.datasources||{},f=Object.entries(p).filter(([b,h])=>h&&h.url).map(([b,{url:h}])=>({name:b,url:h})),m=Su([],f,b=>b.name),d=u.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=gs(e.document.datamodel);let g=Jn(e.generator);if(Se("protocol",g),e.document&&(this._dmmf=new We(e.document)),this._engineConfig={cwd:c,dirname:e.dirname,enableDebugLogs:l,allowTriggerPanic:d.allowTriggerPanic,datamodelPath:pr.default.join(e.dirname,e.filename??"schema.prisma"),prismaPath:d.binaryPath??void 0,engineEndpoint:d.endpoint,datasources:m,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:a.log&&Fu(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},Se("clientVersion",e.clientVersion),Se("clientEngineType",this._dataProxy?"dataproxy":this._clientEngineType),this._dataProxy&&Se("using Data Proxy with Node.js runtime"),this._engine=this.getEngine(),this._fetcher=new An(this,i),a.log)for(let b of a.log){let h=typeof b=="string"?b:b.emit==="stdout"?b.level:null;h&&this.$on(h,x=>{Ut.log(`${Ut.tags[h]??""}`,x.message||x.query)})}this._metrics=new bt(this._engine)}catch(a){throw a.clientVersion=this._clientVersion,a}return fn(this)}get[Symbol.toStringTag](){return"PrismaClient"}getEngine(){if(this._dataProxy,this._clientEngineType==="library")return new rr(this._engineConfig);throw this._clientEngineType,"binary",new K("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){return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:no(this,i),callsite:Xe(this._errorFormat),dataPath:[]})}$executeRaw(n,...i){return Ie(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$executeRawInternal(o,"$executeRaw",[n,...i]);throw new K("`$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 Ie(o=>this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i]))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new K(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`);return Ie(i=>this._request({args:{command:n},clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",callsite:Xe(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o){return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:no(this,i),callsite:Xe(this._errorFormat),dataPath:[]}).then(Iu)}$queryRaw(n,...i){return Ie(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",[n,...i]);throw new K("`$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 Ie(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=Rm.nextId(),s=Mu(n.length),a=n.map((u,l)=>{if(u?.[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:l,isolationLevel:c,lock:s};return u.requestTransaction?.(p)??u});return Bu(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s=await this._engine.transaction("start",o,i),a;try{let u={kind:"itx",...s};a=await n(oo(this,u)),await this._engine.transaction("commit",o,s)}catch(u){throw await this._engine.transaction("rollback",o,s).catch(()=>{}),u}return a}$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={args:n.args,dataPath:n.dataPath,runInTransaction:Boolean(n.transaction),action:n.action,model:n.model},o={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:i.action,model:i.model,name:`${i.model}.${i.action}`}}},s=-1,a=u=>{let l=this._middlewares.get(++s);if(l)return this._tracingHelper.runInChildSpan(o.middleware,m=>l(u,d=>(m?.end(),a(d))));let{runInTransaction:c,...p}=u,f={...n,...p};return c||(f.transaction=void 0),Ya(this,f)};return this._tracingHelper.runInChildSpan(o.operation,()=>new Uu.AsyncResource("prisma-client-request").runInAsyncScope(()=>a(i)))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:u,argsMapper:l,transaction:c,unpacker:p,otelParentCtx:f,customDataProxyFetch:m}){try{let d=await this._getProtocolEncoder({clientMethod:i,callsite:s});n=l?l(n):n;let g={name:"serialize"},b;u&&(b=Gi(a,u,n,this._rejectOnNotFound),Dm(b,u,a));let h=this._tracingHelper.runInChildSpan(g,()=>d.createMessage({modelName:u,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions}));return B.enabled("prisma:client")&&(Se("Prisma Client call:"),Se(`prisma.${i}(${rn({ast:n,keyPaths:[],valuePaths:[],missingItems:[]})})`),Se("Generated request:"),Se(h.toDebugString()+` -`)),c?.kind==="batch"&&await c.lock,this._fetcher.request({protocolMessage:h,protocolEncoder:d,modelName:u,clientMethod:i,dataPath:o,rejectOnNotFound:b,callsite:s,args:n,extensions:this._extensions,transaction:c,unpacker:p,otelParentCtx:f,otelChildCtx:this._tracingHelper.getActiveContext(),customDataProxyFetch:m})}catch(d){throw d.clientVersion=this._clientVersion,d}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new K("`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 Vu=["$connect","$disconnect","$on","$transaction","$use","$extends"];function oo(e,t){return typeof e!="object"?e:new Proxy(e,{get:(r,n)=>{if(!Vu.includes(n))return n===Om?t?.id:typeof r[n]=="function"?(...i)=>n==="then"?r[n](i[0],i[1],t):n==="catch"||n==="finally"?r[n](i[0],t):oo(r[n](...i),t):oo(r[n],t)},has(r,n){return Vu.includes(n)?!1:Reflect.has(r,n)}})}var $m={findUnique:"findUniqueOrThrow",findFirst:"findFirstOrThrow"};function Dm(e,t,r){if(e){let n=$m[r],i=t?`prisma.${Te(t)}.${n}`:`prisma.${n}`,o=`rejectOnNotFound.${t??""}.${r}`;Jt(o,`\`rejectOnNotFound\` option is deprecated and will be removed in Prisma 5. Please use \`${i}\` method instead`)}}var Im=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Ku(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!Im.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}var Wu=e=>e;function Hu(e){Nt(e,{conflictCheck:"warn"})}0&&(module.exports={DMMF,DMMFClass,Debug,Decimal,Extensions,MetricsClient,NotFoundError,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,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/clients/typescript/test/client/generated/client/schema.prisma b/clients/typescript/test/client/generated/client/schema.prisma deleted file mode 100644 index 89de6330c0..0000000000 --- a/clients/typescript/test/client/generated/client/schema.prisma +++ /dev/null @@ -1,66 +0,0 @@ -datasource db { - provider = "postgresql" - url = env("PRISMA_DB_URL") -} - -generator electric { - provider = "../../node_modules/@electric-sql/prisma-generator/dist/bin.js" - output = "../generated" - relationModel = true - writeNullishInModelTypes = true -} - -generator client { - provider = "prisma-client-js" - output = "../generated/client" -} - -model Items { - value String @id - nbr Int? -} - -model User { - id Int @id - name String? - posts Post[] - profile Profile? -} - -model Post { - id Int @id - title String @unique - contents String - nbr Int? - authorId Int - author User? @relation(fields: [authorId], references: [id]) -} - -model Profile { - id Int @id - bio String - userId Int @unique - user User? @relation(fields: [userId], references: [id]) -} - -model DataTypes { - id Int @id - date DateTime? @db.Date - time DateTime? @db.Time(3) - timetz DateTime? @db.Timetz(3) - timestamp DateTime? @unique @db.Timestamp(3) - timestamptz DateTime? @db.Timestamptz(3) - bool Boolean? - uuid String? @db.Uuid /// @zod.string.uuid() - int2 Int? @db.SmallInt /// @zod.number.int().gte(-32768).lte(32767) - int4 Int? /// @zod.number.int().gte(-2147483648).lte(2147483647) - float8 Float? @db.DoublePrecision /// @zod.custom.use(z.number().or(z.nan())) - relatedId Int? - related Dummy? @relation(fields: [relatedId], references: [id]) -} - -model Dummy { - id Int @id - timestamp DateTime? @db.Timestamp(3) - datatype DataTypes[] -} diff --git a/clients/typescript/test/client/generated/index.ts b/clients/typescript/test/client/generated/index.ts index 71a8df2eb4..78763130bd 100644 --- a/clients/typescript/test/client/generated/index.ts +++ b/clients/typescript/test/client/generated/index.ts @@ -17,7 +17,7 @@ import { // ENUMS ///////////////////////////////////////// -export const DataTypesScalarFieldEnumSchema = z.enum(['id','date','time','timetz','timestamp','timestamptz','bool','uuid','int2','int4','float8','relatedId']); +export const DataTypesScalarFieldEnumSchema = z.enum(['id','date','time','timetz','timestamp','timestamptz','bool','uuid','int2','int4','int8','float8','relatedId']); export const DummyScalarFieldEnumSchema = z.enum(['id','timestamp']); @@ -101,6 +101,7 @@ export const DataTypesSchema = z.object({ uuid: z.string().uuid().nullish(), int2: z.number().int().gte(-32768).lte(32767).nullish(), int4: z.number().int().gte(-2147483648).lte(2147483647).nullish(), + int8: z.bigint().nullish(), float8: z.number().or(z.nan()).nullish(), relatedId: z.number().int().nullish(), }) @@ -223,6 +224,7 @@ export const DataTypesSelectSchema: z.ZodType = z.object uuid: z.boolean().optional(), int2: z.boolean().optional(), int4: z.boolean().optional(), + int8: z.boolean().optional(), float8: z.boolean().optional(), relatedId: z.boolean().optional(), related: z.union([z.boolean(),z.lazy(() => DummyArgsSchema)]).optional(), @@ -441,6 +443,7 @@ export const DataTypesWhereInputSchema: z.ZodType = uuid: z.union([ z.lazy(() => UuidNullableFilterSchema),z.string() ]).optional().nullable(), int2: z.union([ z.lazy(() => IntNullableFilterSchema),z.number() ]).optional().nullable(), int4: z.union([ z.lazy(() => IntNullableFilterSchema),z.number() ]).optional().nullable(), + int8: z.union([ z.lazy(() => BigIntNullableFilterSchema),z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]) ]).optional().nullable(), float8: z.union([ z.lazy(() => FloatNullableFilterSchema),z.number() ]).optional().nullable(), relatedId: z.union([ z.lazy(() => IntNullableFilterSchema),z.number() ]).optional().nullable(), related: z.union([ z.lazy(() => DummyRelationFilterSchema),z.lazy(() => DummyWhereInputSchema) ]).optional().nullable(), @@ -457,6 +460,7 @@ export const DataTypesOrderByWithRelationInputSchema: z.ZodType SortOrderSchema).optional(), int2: z.lazy(() => SortOrderSchema).optional(), int4: z.lazy(() => SortOrderSchema).optional(), + int8: z.lazy(() => SortOrderSchema).optional(), float8: z.lazy(() => SortOrderSchema).optional(), relatedId: z.lazy(() => SortOrderSchema).optional(), related: z.lazy(() => DummyOrderByWithRelationInputSchema).optional() @@ -478,6 +482,7 @@ export const DataTypesOrderByWithAggregationInputSchema: z.ZodType SortOrderSchema).optional(), int2: z.lazy(() => SortOrderSchema).optional(), int4: z.lazy(() => SortOrderSchema).optional(), + int8: z.lazy(() => SortOrderSchema).optional(), float8: z.lazy(() => SortOrderSchema).optional(), relatedId: z.lazy(() => SortOrderSchema).optional(), _count: z.lazy(() => DataTypesCountOrderByAggregateInputSchema).optional(), @@ -501,6 +506,7 @@ export const DataTypesScalarWhereWithAggregatesInputSchema: z.ZodType UuidNullableWithAggregatesFilterSchema),z.string() ]).optional().nullable(), int2: z.union([ z.lazy(() => IntNullableWithAggregatesFilterSchema),z.number() ]).optional().nullable(), int4: z.union([ z.lazy(() => IntNullableWithAggregatesFilterSchema),z.number() ]).optional().nullable(), + int8: z.union([ z.lazy(() => BigIntNullableWithAggregatesFilterSchema),z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]) ]).optional().nullable(), float8: z.union([ z.lazy(() => FloatNullableWithAggregatesFilterSchema),z.number() ]).optional().nullable(), relatedId: z.union([ z.lazy(() => IntNullableWithAggregatesFilterSchema),z.number() ]).optional().nullable(), }).strict(); @@ -727,6 +733,7 @@ export const DataTypesCreateInputSchema: z.ZodType uuid: z.string().uuid().optional().nullable(), int2: z.number().int().gte(-32768).lte(32767).optional().nullable(), int4: z.number().int().gte(-2147483648).lte(2147483647).optional().nullable(), + int8: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional().nullable(), float8: z.number().or(z.nan()).optional().nullable(), related: z.lazy(() => DummyCreateNestedOneWithoutDatatypeInputSchema).optional() }).strict(); @@ -742,6 +749,7 @@ export const DataTypesUncheckedCreateInputSchema: z.ZodType uuid: z.union([ z.string().uuid(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), int2: z.union([ z.number().int().gte(-32768).lte(32767),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), int4: z.union([ z.number().int().gte(-2147483648).lte(2147483647),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + int8: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]),z.lazy(() => NullableBigIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), float8: z.union([ z.number().or(z.nan()),z.lazy(() => NullableFloatFieldUpdateOperationsInputSchema) ]).optional().nullable(), related: z.lazy(() => DummyUpdateOneWithoutDatatypeNestedInputSchema).optional() }).strict(); @@ -772,6 +781,7 @@ export const DataTypesUncheckedUpdateInputSchema: z.ZodType NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), int2: z.union([ z.number().int().gte(-32768).lte(32767),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), int4: z.union([ z.number().int().gte(-2147483648).lte(2147483647),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + int8: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]),z.lazy(() => NullableBigIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), float8: z.union([ z.number().or(z.nan()),z.lazy(() => NullableFloatFieldUpdateOperationsInputSchema) ]).optional().nullable(), relatedId: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), }).strict(); @@ -787,6 +797,7 @@ export const DataTypesCreateManyInputSchema: z.ZodType NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), int2: z.union([ z.number().int().gte(-32768).lte(32767),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), int4: z.union([ z.number().int().gte(-2147483648).lte(2147483647),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + int8: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]),z.lazy(() => NullableBigIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), float8: z.union([ z.number().or(z.nan()),z.lazy(() => NullableFloatFieldUpdateOperationsInputSchema) ]).optional().nullable(), }).strict(); @@ -816,6 +828,7 @@ export const DataTypesUncheckedUpdateManyInputSchema: z.ZodType NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), int2: z.union([ z.number().int().gte(-32768).lte(32767),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), int4: z.union([ z.number().int().gte(-2147483648).lte(2147483647),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + int8: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]),z.lazy(() => NullableBigIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), float8: z.union([ z.number().or(z.nan()),z.lazy(() => NullableFloatFieldUpdateOperationsInputSchema) ]).optional().nullable(), relatedId: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), }).strict(); @@ -1137,6 +1150,17 @@ export const UuidNullableFilterSchema: z.ZodType = z. not: z.union([ z.string(),z.lazy(() => NestedUuidNullableFilterSchema) ]).optional().nullable(), }).strict(); +export const BigIntNullableFilterSchema: z.ZodType = z.object({ + equals: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional().nullable(), + in: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n).array(), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt).array() ]),z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]) ]).optional().nullable(), + notIn: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n).array(), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt).array() ]),z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]) ]).optional().nullable(), + lt: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + lte: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + gt: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + gte: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + not: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]),z.lazy(() => NestedBigIntNullableFilterSchema) ]).optional().nullable(), +}).strict(); + export const FloatNullableFilterSchema: z.ZodType = z.object({ equals: z.number().optional().nullable(), in: z.union([ z.number().array(),z.number() ]).optional().nullable(), @@ -1164,6 +1188,7 @@ export const DataTypesCountOrderByAggregateInputSchema: z.ZodType SortOrderSchema).optional(), int2: z.lazy(() => SortOrderSchema).optional(), int4: z.lazy(() => SortOrderSchema).optional(), + int8: z.lazy(() => SortOrderSchema).optional(), float8: z.lazy(() => SortOrderSchema).optional(), relatedId: z.lazy(() => SortOrderSchema).optional() }).strict(); @@ -1172,6 +1197,7 @@ export const DataTypesAvgOrderByAggregateInputSchema: z.ZodType SortOrderSchema).optional(), int2: z.lazy(() => SortOrderSchema).optional(), int4: z.lazy(() => SortOrderSchema).optional(), + int8: z.lazy(() => SortOrderSchema).optional(), float8: z.lazy(() => SortOrderSchema).optional(), relatedId: z.lazy(() => SortOrderSchema).optional() }).strict(); @@ -1187,6 +1213,7 @@ export const DataTypesMaxOrderByAggregateInputSchema: z.ZodType SortOrderSchema).optional(), int2: z.lazy(() => SortOrderSchema).optional(), int4: z.lazy(() => SortOrderSchema).optional(), + int8: z.lazy(() => SortOrderSchema).optional(), float8: z.lazy(() => SortOrderSchema).optional(), relatedId: z.lazy(() => SortOrderSchema).optional() }).strict(); @@ -1202,6 +1229,7 @@ export const DataTypesMinOrderByAggregateInputSchema: z.ZodType SortOrderSchema).optional(), int2: z.lazy(() => SortOrderSchema).optional(), int4: z.lazy(() => SortOrderSchema).optional(), + int8: z.lazy(() => SortOrderSchema).optional(), float8: z.lazy(() => SortOrderSchema).optional(), relatedId: z.lazy(() => SortOrderSchema).optional() }).strict(); @@ -1210,6 +1238,7 @@ export const DataTypesSumOrderByAggregateInputSchema: z.ZodType SortOrderSchema).optional(), int2: z.lazy(() => SortOrderSchema).optional(), int4: z.lazy(() => SortOrderSchema).optional(), + int8: z.lazy(() => SortOrderSchema).optional(), float8: z.lazy(() => SortOrderSchema).optional(), relatedId: z.lazy(() => SortOrderSchema).optional() }).strict(); @@ -1251,6 +1280,22 @@ export const UuidNullableWithAggregatesFilterSchema: z.ZodType NestedStringNullableFilterSchema).optional() }).strict(); +export const BigIntNullableWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional().nullable(), + in: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n).array(), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt).array() ]),z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]) ]).optional().nullable(), + notIn: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n).array(), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt).array() ]),z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]) ]).optional().nullable(), + lt: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + lte: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + gt: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + gte: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + not: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]),z.lazy(() => NestedBigIntNullableWithAggregatesFilterSchema) ]).optional().nullable(), + _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), + _avg: z.lazy(() => NestedFloatNullableFilterSchema).optional(), + _sum: z.lazy(() => NestedBigIntNullableFilterSchema).optional(), + _min: z.lazy(() => NestedBigIntNullableFilterSchema).optional(), + _max: z.lazy(() => NestedBigIntNullableFilterSchema).optional() +}).strict(); + export const FloatNullableWithAggregatesFilterSchema: z.ZodType = z.object({ equals: z.number().optional().nullable(), in: z.union([ z.number().array(),z.number() ]).optional().nullable(), @@ -1444,6 +1489,14 @@ export const NullableBoolFieldUpdateOperationsInputSchema: z.ZodType = z.object({ + set: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional().nullable(), + increment: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + decrement: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + multiply: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + divide: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional() +}).strict(); + export const NullableFloatFieldUpdateOperationsInputSchema: z.ZodType = z.object({ set: z.number().optional().nullable(), increment: z.number().optional(), @@ -1669,6 +1722,17 @@ export const NestedUuidNullableFilterSchema: z.ZodType NestedUuidNullableFilterSchema) ]).optional().nullable(), }).strict(); +export const NestedBigIntNullableFilterSchema: z.ZodType = z.object({ + equals: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional().nullable(), + in: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n).array(), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt).array() ]),z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]) ]).optional().nullable(), + notIn: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n).array(), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt).array() ]),z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]) ]).optional().nullable(), + lt: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + lte: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + gt: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + gte: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + not: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]),z.lazy(() => NestedBigIntNullableFilterSchema) ]).optional().nullable(), +}).strict(); + export const NestedDateTimeNullableWithAggregatesFilterSchema: z.ZodType = z.object({ equals: z.coerce.date().optional().nullable(), in: z.union([ z.coerce.date().array(),z.coerce.date() ]).optional().nullable(), @@ -1705,6 +1769,22 @@ export const NestedUuidNullableWithAggregatesFilterSchema: z.ZodType NestedStringNullableFilterSchema).optional() }).strict(); +export const NestedBigIntNullableWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional().nullable(), + in: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n).array(), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt).array() ]),z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]) ]).optional().nullable(), + notIn: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n).array(), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt).array() ]),z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]) ]).optional().nullable(), + lt: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + lte: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + gt: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + gte: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + not: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]),z.lazy(() => NestedBigIntNullableWithAggregatesFilterSchema) ]).optional().nullable(), + _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), + _avg: z.lazy(() => NestedFloatNullableFilterSchema).optional(), + _sum: z.lazy(() => NestedBigIntNullableFilterSchema).optional(), + _min: z.lazy(() => NestedBigIntNullableFilterSchema).optional(), + _max: z.lazy(() => NestedBigIntNullableFilterSchema).optional() +}).strict(); + export const NestedFloatNullableWithAggregatesFilterSchema: z.ZodType = z.object({ equals: z.number().optional().nullable(), in: z.union([ z.number().array(),z.number() ]).optional().nullable(), @@ -1911,6 +1991,7 @@ export const DataTypesCreateWithoutRelatedInputSchema: z.ZodType UuidNullableFilterSchema),z.string() ]).optional().nullable(), int2: z.union([ z.lazy(() => IntNullableFilterSchema),z.number() ]).optional().nullable(), int4: z.union([ z.lazy(() => IntNullableFilterSchema),z.number() ]).optional().nullable(), + int8: z.union([ z.lazy(() => BigIntNullableFilterSchema),z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]) ]).optional().nullable(), float8: z.union([ z.lazy(() => FloatNullableFilterSchema),z.number() ]).optional().nullable(), relatedId: z.union([ z.lazy(() => IntNullableFilterSchema),z.number() ]).optional().nullable(), }).strict(); @@ -2011,6 +2094,7 @@ export const DataTypesCreateManyRelatedInputSchema: z.ZodType NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), int2: z.union([ z.number(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), int4: z.union([ z.number(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + int8: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]),z.lazy(() => NullableBigIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), float8: z.union([ z.number(),z.lazy(() => NullableFloatFieldUpdateOperationsInputSchema) ]).optional().nullable(), }).strict(); @@ -2039,6 +2124,7 @@ export const DataTypesUncheckedUpdateWithoutRelatedInputSchema: z.ZodType NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), int2: z.union([ z.number(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), int4: z.union([ z.number(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + int8: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]),z.lazy(() => NullableBigIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), float8: z.union([ z.number(),z.lazy(() => NullableFloatFieldUpdateOperationsInputSchema) ]).optional().nullable(), }).strict(); @@ -2053,6 +2139,7 @@ export const DataTypesUncheckedUpdateManyWithoutDatatypeInputSchema: z.ZodType

NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), int2: z.union([ z.number().int().gte(-32768).lte(32767),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), int4: z.union([ z.number().int().gte(-2147483648).lte(2147483647),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + int8: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]),z.lazy(() => NullableBigIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), float8: z.union([ z.number().or(z.nan()),z.lazy(() => NullableFloatFieldUpdateOperationsInputSchema) ]).optional().nullable(), }).strict(); @@ -2928,6 +3015,10 @@ export const tableSchemas = { "int4", "INT4" ], + [ + "int8", + "INT8" + ], [ "float8", "FLOAT8" diff --git a/clients/typescript/test/client/model/builder.test.ts b/clients/typescript/test/client/model/builder.test.ts index c6e2a82f5f..f54353c354 100644 --- a/clients/typescript/test/client/model/builder.test.ts +++ b/clients/typescript/test/client/model/builder.test.ts @@ -2,13 +2,16 @@ import test from 'ava' import { Builder } from '../../../src/client/model/builder' import { ShapeManagerMock } from '../../../src/client/model/shapes' import { ZodError } from 'zod' +import { schema } from '../generated' const shapeManager = new ShapeManagerMock() +const postTableDescription = schema.getTableDescription('Post') const tbl = new Builder( 'Post', ['id', 'title', 'contents', 'nbr'], - shapeManager + shapeManager, + postTableDescription ) // Sync all shapes such that we don't get warnings on every query diff --git a/clients/typescript/test/client/model/datatype.test.ts b/clients/typescript/test/client/model/datatype.test.ts index 0148055318..a8154ba43d 100644 --- a/clients/typescript/test/client/model/datatype.test.ts +++ b/clients/typescript/test/client/model/datatype.test.ts @@ -31,7 +31,7 @@ await tbl.sync() function setupDB() { db.exec('DROP TABLE IF EXISTS DataTypes') db.exec( - "CREATE TABLE DataTypes('id' int PRIMARY KEY, 'date' varchar, 'time' varchar, 'timetz' varchar, 'timestamp' varchar, 'timestamptz' varchar, 'bool' int, 'uuid' varchar, 'int2' int2, 'int4' int4, 'float8' real, 'relatedId' int);" + "CREATE TABLE DataTypes('id' int PRIMARY KEY, 'date' varchar, 'time' varchar, 'timetz' varchar, 'timestamp' varchar, 'timestamptz' varchar, 'bool' int, 'uuid' varchar, 'int2' int2, 'int4' int4, 'int8' int8, 'float8' real, 'relatedId' int);" ) } @@ -644,3 +644,107 @@ test.serial('support null values for float8 type', async (t) => { t.deepEqual(fetchRes, expectedRes) }) + +test.serial('support BigInt type', async (t) => { + //db.defaultSafeIntegers(true) // enables BigInt support + const validBigInt1 = BigInt('9223372036854775807') + const validBigInt2 = BigInt('-9223372036854775808') + const bigInts = [ + { + id: 1, + int8: validBigInt1, + }, + { + id: 2, + int8: validBigInt2, + }, + ] + + const res = await tbl.createMany({ + data: bigInts, + }) + + t.deepEqual(res, { + count: 2, + }) + + // Check that we can read the big ints back + const fetchRes = await tbl.findMany({ + select: { + id: true, + int8: true, + }, + orderBy: { + id: 'asc', + }, + }) + + t.deepEqual(fetchRes, bigInts) + //db.defaultSafeIntegers(false) // disables BigInt support +}) + +test.serial('support null values for BigInt type', async (t) => { + const expectedRes = { + id: 1, + int8: null, + } + + const res = await tbl.create({ + data: { + id: 1, + int8: null, + }, + select: { + id: true, + int8: true, + }, + }) + + t.deepEqual(res, expectedRes) + + const fetchRes = await tbl.findUnique({ + where: { + id: 1, + }, + select: { + id: true, + int8: true, + }, + }) + + t.deepEqual(fetchRes, expectedRes) +}) + +test.serial( + 'throw error when value is out of range for BigInt type', + async (t) => { + const invalidBigInt1 = BigInt('9223372036854775808') + const invalidBigInt2 = BigInt('-9223372036854775809') + + await t.throwsAsync( + tbl.create({ + data: { + id: 1, + int8: invalidBigInt1, + }, + }), + { + instanceOf: ZodError, + message: /BigInt must be less than or equal to 9223372036854775807/, + } + ) + + await t.throwsAsync( + tbl.create({ + data: { + id: 2, + int8: invalidBigInt2, + }, + }), + { + instanceOf: ZodError, + message: /too_small/, + } + ) + } +) diff --git a/clients/typescript/test/client/prisma/schema.prisma b/clients/typescript/test/client/prisma/schema.prisma index 89de6330c0..4cd4f05e80 100644 --- a/clients/typescript/test/client/prisma/schema.prisma +++ b/clients/typescript/test/client/prisma/schema.prisma @@ -54,6 +54,7 @@ model DataTypes { uuid String? @db.Uuid /// @zod.string.uuid() int2 Int? @db.SmallInt /// @zod.number.int().gte(-32768).lte(32767) int4 Int? /// @zod.number.int().gte(-2147483648).lte(2147483647) + int8 BigInt? float8 Float? @db.DoublePrecision /// @zod.custom.use(z.number().or(z.nan())) relatedId Int? related Dummy? @relation(fields: [relatedId], references: [id]) diff --git a/clients/typescript/test/satellite/common.ts b/clients/typescript/test/satellite/common.ts index dfcacfa0be..49830574aa 100644 --- a/clients/typescript/test/satellite/common.ts +++ b/clients/typescript/test/satellite/common.ts @@ -274,9 +274,9 @@ export const personTable: Table = { primary: ['id'], foreignKeys: [], columnTypes: { - id: 'REAL', - name: 'TEXT', - age: 'INTEGER', - bmi: 'REAL', + id: { sqliteType: 'REAL', pgType: PgBasicType.PG_REAL }, + name: { sqliteType: 'TEXT', pgType: PgBasicType.PG_TEXT }, + age: { sqliteType: 'INTEGER', pgType: PgBasicType.PG_INTEGER }, + bmi: { sqliteType: 'REAL', pgType: PgBasicType.PG_REAL }, }, } diff --git a/clients/typescript/test/satellite/process.migration.test.ts b/clients/typescript/test/satellite/process.migration.test.ts index 4b6baedc6a..9322138b81 100644 --- a/clients/typescript/test/satellite/process.migration.test.ts +++ b/clients/typescript/test/satellite/process.migration.test.ts @@ -120,9 +120,21 @@ const createTable: SchemaChange = { table: { name: 'NewTable', columns: [ - { name: 'id', sqliteType: 'TEXT' }, - { name: 'foo', sqliteType: 'INTEGER' }, - { name: 'bar', sqliteType: 'TEXT' }, + { + name: 'id', + sqliteType: 'TEXT', + pgType: { name: 'TEXT', array: [], size: [] }, + }, + { + name: 'foo', + sqliteType: 'INTEGER', + pgType: { name: 'INTEGER', array: [], size: [] }, + }, + { + name: 'bar', + sqliteType: 'TEXT', + pgType: { name: 'TEXT', array: [], size: [] }, + }, ], fks: [], pks: ['id'], @@ -140,10 +152,26 @@ const addColumn: SchemaChange = { table: { name: 'parent', columns: [ - { name: 'id', sqliteType: 'INTEGER' }, - { name: 'value', sqliteType: 'TEXT' }, - { name: 'other', sqliteType: 'INTEGER' }, - { name: 'baz', sqliteType: 'TEXT' }, + { + name: 'id', + sqliteType: 'INTEGER', + pgType: { name: 'INTEGER', array: [], size: [] }, + }, + { + name: 'value', + sqliteType: 'TEXT', + pgType: { name: 'TEXT', array: [], size: [] }, + }, + { + name: 'other', + sqliteType: 'INTEGER', + pgType: { name: 'INTEGER', array: [], size: [] }, + }, + { + name: 'baz', + sqliteType: 'TEXT', + pgType: { name: 'TEXT', array: [], size: [] }, + }, ], fks: [], pks: ['id'], @@ -689,7 +717,13 @@ const migrationWithFKs: SchemaChange[] = [ `, table: { name: 'test_items', - columns: [{ name: 'id', sqliteType: 'TEXT' }], + columns: [ + { + name: 'id', + sqliteType: 'TEXT', + pgType: { name: 'TEXT', array: [], size: [] }, + }, + ], fks: [], pks: ['id'], }, @@ -707,8 +741,16 @@ const migrationWithFKs: SchemaChange[] = [ table: { name: 'test_other_items', columns: [ - { name: 'id', sqliteType: 'TEXT' }, - { name: 'item_id', sqliteType: 'TEXT' }, + { + name: 'id', + sqliteType: 'TEXT', + pgType: { name: 'TEXT', array: [], size: [] }, + }, + { + name: 'item_id', + sqliteType: 'TEXT', + pgType: { name: 'TEXT', array: [], size: [] }, + }, ], fks: [ { diff --git a/e2e/satellite_client/src/client.ts b/e2e/satellite_client/src/client.ts index 5240d4d053..4187e16d6b 100644 --- a/e2e/satellite_client/src/client.ts +++ b/e2e/satellite_client/src/client.ts @@ -198,7 +198,7 @@ export const get_int = (electric: Electric, id: string) => { }) } -export const write_int = (electric: Electric, id: string, i2: number, i4: number, i8: number) => { +export const write_int = (electric: Electric, id: string, i2: number, i4: number, i8: number | BigInt) => { return electric.db.ints.create({ data: { id, i2, i4, i8 } }) diff --git a/e2e/satellite_client/src/generated/client/index.ts b/e2e/satellite_client/src/generated/client/index.ts index e7278d04f8..a66b6e63c9 100644 --- a/e2e/satellite_client/src/generated/client/index.ts +++ b/e2e/satellite_client/src/generated/client/index.ts @@ -44,10 +44,10 @@ export const UuidsScalarFieldEnumSchema = z.enum(['id']); export const ItemsSchema = z.object({ id: z.string(), content: z.string(), - content_text_null: z.string().nullish(), - content_text_null_default: z.string().nullish(), - intvalue_null: z.number().int().nullish(), - intvalue_null_default: z.number().int().nullish(), + content_text_null: z.string().nullable(), + content_text_null_default: z.string().nullable(), + intvalue_null: z.number().int().nullable(), + intvalue_null_default: z.number().int().nullable(), }) export type Items = z.infer @@ -59,7 +59,7 @@ export type Items = z.infer export const OtherItemsSchema = z.object({ id: z.string(), content: z.string(), - item_id: z.string().nullish(), + item_id: z.string().nullable(), }) export type OtherItems = z.infer @@ -94,7 +94,7 @@ export type Datetimes = z.infer export const BoolsSchema = z.object({ id: z.string(), - b: z.boolean().nullish(), + b: z.boolean().nullable(), }) export type Bools = z.infer @@ -115,8 +115,9 @@ export type Uuids = z.infer export const IntsSchema = z.object({ id: z.string(), - i2: z.number().int().gte(-32768).lte(32767).nullish(), - i4: z.number().int().gte(-2147483648).lte(2147483647).nullish(), + i2: z.number().int().gte(-32768).lte(32767).nullable(), + i4: z.number().int().gte(-2147483648).lte(2147483647).nullable(), + i8: z.bigint().nullable(), }) export type Ints = z.infer @@ -127,7 +128,7 @@ export type Ints = z.infer export const FloatsSchema = z.object({ id: z.string(), - f8: z.number().or(z.nan()).nullish(), + f8: z.number().or(z.nan()).nullable(), }) export type Floats = z.infer @@ -469,7 +470,7 @@ export const IntsWhereInputSchema: z.ZodType = z.object({ id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), i2: z.union([ z.lazy(() => IntNullableFilterSchema),z.number() ]).optional().nullable(), i4: z.union([ z.lazy(() => IntNullableFilterSchema),z.number() ]).optional().nullable(), - i8: z.union([ z.lazy(() => IntNullableFilterSchema),z.number() ]).optional().nullable(), + i8: z.union([ z.lazy(() => BigIntNullableFilterSchema),z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]) ]).optional().nullable(), }).strict(); export const IntsOrderByWithRelationInputSchema: z.ZodType = z.object({ @@ -502,7 +503,7 @@ export const IntsScalarWhereWithAggregatesInputSchema: z.ZodType StringWithAggregatesFilterSchema),z.string() ]).optional(), i2: z.union([ z.lazy(() => IntNullableWithAggregatesFilterSchema),z.number() ]).optional().nullable(), i4: z.union([ z.lazy(() => IntNullableWithAggregatesFilterSchema),z.number() ]).optional().nullable(), - i8: z.union([ z.lazy(() => IntNullableWithAggregatesFilterSchema),z.number() ]).optional().nullable(), + i8: z.union([ z.lazy(() => BigIntNullableWithAggregatesFilterSchema),z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]) ]).optional().nullable(), }).strict(); export const FloatsWhereInputSchema: z.ZodType = z.object({ @@ -799,49 +800,49 @@ export const IntsCreateInputSchema: z.ZodType = z.object id: z.string(), i2: z.number().int().gte(-32768).lte(32767).optional().nullable(), i4: z.number().int().gte(-2147483648).lte(2147483647).optional().nullable(), - i8: z.number().int().gte(-9223372036854775808).lte(9223372036854775807).optional().nullable() + i8: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional().nullable() }).strict(); export const IntsUncheckedCreateInputSchema: z.ZodType = z.object({ id: z.string(), i2: z.number().int().gte(-32768).lte(32767).optional().nullable(), i4: z.number().int().gte(-2147483648).lte(2147483647).optional().nullable(), - i8: z.number().int().gte(-9223372036854775808).lte(9223372036854775807).optional().nullable() + i8: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional().nullable() }).strict(); export const IntsUpdateInputSchema: z.ZodType = z.object({ id: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), i2: z.union([ z.number().int().gte(-32768).lte(32767),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), i4: z.union([ z.number().int().gte(-2147483648).lte(2147483647),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), - i8: z.union([ z.number().int().gte(-9223372036854775808).lte(9223372036854775807),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + i8: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]),z.lazy(() => NullableBigIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), }).strict(); export const IntsUncheckedUpdateInputSchema: z.ZodType = z.object({ id: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), i2: z.union([ z.number().int().gte(-32768).lte(32767),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), i4: z.union([ z.number().int().gte(-2147483648).lte(2147483647),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), - i8: z.union([ z.number().int().gte(-9223372036854775808).lte(9223372036854775807),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + i8: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]),z.lazy(() => NullableBigIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), }).strict(); export const IntsCreateManyInputSchema: z.ZodType = z.object({ id: z.string(), i2: z.number().int().gte(-32768).lte(32767).optional().nullable(), i4: z.number().int().gte(-2147483648).lte(2147483647).optional().nullable(), - i8: z.number().int().gte(-9223372036854775808).lte(9223372036854775807).optional().nullable() + i8: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional().nullable() }).strict(); export const IntsUpdateManyMutationInputSchema: z.ZodType = z.object({ id: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), i2: z.union([ z.number().int().gte(-32768).lte(32767),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), i4: z.union([ z.number().int().gte(-2147483648).lte(2147483647),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), - i8: z.union([ z.number().int().gte(-9223372036854775808).lte(9223372036854775807),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + i8: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]),z.lazy(() => NullableBigIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), }).strict(); export const IntsUncheckedUpdateManyInputSchema: z.ZodType = z.object({ id: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), i2: z.union([ z.number().int().gte(-32768).lte(32767),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), i4: z.union([ z.number().int().gte(-2147483648).lte(2147483647),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), - i8: z.union([ z.number().int().gte(-9223372036854775808).lte(9223372036854775807),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + i8: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]),z.lazy(() => NullableBigIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), }).strict(); export const FloatsCreateInputSchema: z.ZodType = z.object({ @@ -1165,6 +1166,17 @@ export const UuidWithAggregatesFilterSchema: z.ZodType NestedStringFilterSchema).optional() }).strict(); +export const BigIntNullableFilterSchema: z.ZodType = z.object({ + equals: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional().nullable(), + in: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n).array(), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt).array() ]),z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]) ]).optional().nullable(), + notIn: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n).array(), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt).array() ]),z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]) ]).optional().nullable(), + lt: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + lte: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + gt: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + gte: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + not: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]),z.lazy(() => NestedBigIntNullableFilterSchema) ]).optional().nullable(), +}).strict(); + export const IntsCountOrderByAggregateInputSchema: z.ZodType = z.object({ id: z.lazy(() => SortOrderSchema).optional(), i2: z.lazy(() => SortOrderSchema).optional(), @@ -1198,6 +1210,22 @@ export const IntsSumOrderByAggregateInputSchema: z.ZodType SortOrderSchema).optional() }).strict(); +export const BigIntNullableWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional().nullable(), + in: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n).array(), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt).array() ]),z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]) ]).optional().nullable(), + notIn: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n).array(), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt).array() ]),z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]) ]).optional().nullable(), + lt: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + lte: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + gt: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + gte: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + not: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]),z.lazy(() => NestedBigIntNullableWithAggregatesFilterSchema) ]).optional().nullable(), + _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), + _avg: z.lazy(() => NestedFloatNullableFilterSchema).optional(), + _sum: z.lazy(() => NestedBigIntNullableFilterSchema).optional(), + _min: z.lazy(() => NestedBigIntNullableFilterSchema).optional(), + _max: z.lazy(() => NestedBigIntNullableFilterSchema).optional() +}).strict(); + export const FloatNullableFilterSchema: z.ZodType = z.object({ equals: z.number().optional().nullable(), in: z.union([ z.number().array(),z.number() ]).optional().nullable(), @@ -1320,6 +1348,14 @@ export const NullableBoolFieldUpdateOperationsInputSchema: z.ZodType = z.object({ + set: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional().nullable(), + increment: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + decrement: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + multiply: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + divide: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional() +}).strict(); + export const NullableFloatFieldUpdateOperationsInputSchema: z.ZodType = z.object({ set: z.number().optional().nullable(), increment: z.number().optional(), @@ -1502,6 +1538,33 @@ export const NestedUuidWithAggregatesFilterSchema: z.ZodType NestedStringFilterSchema).optional() }).strict(); +export const NestedBigIntNullableFilterSchema: z.ZodType = z.object({ + equals: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional().nullable(), + in: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n).array(), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt).array() ]),z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]) ]).optional().nullable(), + notIn: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n).array(), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt).array() ]),z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]) ]).optional().nullable(), + lt: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + lte: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + gt: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + gte: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + not: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]),z.lazy(() => NestedBigIntNullableFilterSchema) ]).optional().nullable(), +}).strict(); + +export const NestedBigIntNullableWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional().nullable(), + in: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n).array(), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt).array() ]),z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]) ]).optional().nullable(), + notIn: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n).array(), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt).array() ]),z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]) ]).optional().nullable(), + lt: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + lte: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + gt: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + gte: z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]).optional(), + not: z.union([ z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ]),z.lazy(() => NestedBigIntNullableWithAggregatesFilterSchema) ]).optional().nullable(), + _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), + _avg: z.lazy(() => NestedFloatNullableFilterSchema).optional(), + _sum: z.lazy(() => NestedBigIntNullableFilterSchema).optional(), + _min: z.lazy(() => NestedBigIntNullableFilterSchema).optional(), + _max: z.lazy(() => NestedBigIntNullableFilterSchema).optional() +}).strict(); + export const NestedFloatNullableWithAggregatesFilterSchema: z.ZodType = z.object({ equals: z.number().optional().nullable(), in: z.union([ z.number().array(),z.number() ]).optional().nullable(), @@ -2673,7 +2736,7 @@ export const tableSchemas = { ], [ "i8", - "INT4" + "INT8" ] ]), relations: [ diff --git a/e2e/satellite_client/src/generated/client/prismaClient.d.ts b/e2e/satellite_client/src/generated/client/prismaClient.d.ts new file mode 100644 index 0000000000..7a851f9335 --- /dev/null +++ b/e2e/satellite_client/src/generated/client/prismaClient.d.ts @@ -0,0 +1,9630 @@ + +/** + * Client +**/ + +import * as runtime from './runtime/library'; +type UnwrapPromise

= P extends Promise ? R : P +type UnwrapTuple = { + [K in keyof Tuple]: K extends `${number}` ? Tuple[K] extends Prisma.PrismaPromise ? X : UnwrapPromise : UnwrapPromise +}; + +export type PrismaPromise = runtime.Types.Public.PrismaPromise + + +/** + * Model Items + * + */ +export type Items = { + id: string + content: string + content_text_null: string | null + content_text_null_default: string | null + intvalue_null: number | null + intvalue_null_default: number | null +} + +/** + * Model OtherItems + * + */ +export type OtherItems = { + id: string + content: string + item_id: string | null +} + +/** + * Model Timestamps + * + */ +export type Timestamps = { + id: string + created_at: Date + updated_at: Date +} + +/** + * Model Datetimes + * + */ +export type Datetimes = { + id: string + d: Date + t: Date +} + +/** + * Model Bools + * + */ +export type Bools = { + id: string + b: boolean | null +} + +/** + * Model Uuids + * + */ +export type Uuids = { + /** + * @zod.string.uuid() + */ + id: string +} + +/** + * Model Ints + * + */ +export type Ints = { + id: string + /** + * @zod.number.int().gte(-32768).lte(32767) + */ + i2: number | null + /** + * @zod.number.int().gte(-2147483648).lte(2147483647) + */ + i4: number | null + i8: bigint | null +} + +/** + * Model Floats + * + */ +export type Floats = { + id: string + /** + * @zod.custom.use(z.number().or(z.nan())) + */ + f8: number | null +} + + +/** + * ## Prisma Client ʲˢ + * + * Type-safe database client for TypeScript & Node.js + * @example + * ``` + * const prisma = new PrismaClient() + * // Fetch zero or more Items + * const items = await prisma.items.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 + > { + /** + * ## Prisma Client ʲˢ + * + * Type-safe database client for TypeScript & Node.js + * @example + * ``` + * const prisma = new PrismaClient() + * // Fetch zero or more Items + * const items = await prisma.items.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 + */ + $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 + + /** + * `prisma.items`: Exposes CRUD operations for the **Items** model. + * Example usage: + * ```ts + * // Fetch zero or more Items + * const items = await prisma.items.findMany() + * ``` + */ + get items(): Prisma.ItemsDelegate; + + /** + * `prisma.otherItems`: Exposes CRUD operations for the **OtherItems** model. + * Example usage: + * ```ts + * // Fetch zero or more OtherItems + * const otherItems = await prisma.otherItems.findMany() + * ``` + */ + get otherItems(): Prisma.OtherItemsDelegate; + + /** + * `prisma.timestamps`: Exposes CRUD operations for the **Timestamps** model. + * Example usage: + * ```ts + * // Fetch zero or more Timestamps + * const timestamps = await prisma.timestamps.findMany() + * ``` + */ + get timestamps(): Prisma.TimestampsDelegate; + + /** + * `prisma.datetimes`: Exposes CRUD operations for the **Datetimes** model. + * Example usage: + * ```ts + * // Fetch zero or more Datetimes + * const datetimes = await prisma.datetimes.findMany() + * ``` + */ + get datetimes(): Prisma.DatetimesDelegate; + + /** + * `prisma.bools`: Exposes CRUD operations for the **Bools** model. + * Example usage: + * ```ts + * // Fetch zero or more Bools + * const bools = await prisma.bools.findMany() + * ``` + */ + get bools(): Prisma.BoolsDelegate; + + /** + * `prisma.uuids`: Exposes CRUD operations for the **Uuids** model. + * Example usage: + * ```ts + * // Fetch zero or more Uuids + * const uuids = await prisma.uuids.findMany() + * ``` + */ + get uuids(): Prisma.UuidsDelegate; + + /** + * `prisma.ints`: Exposes CRUD operations for the **Ints** model. + * Example usage: + * ```ts + * // Fetch zero or more Ints + * const ints = await prisma.ints.findMany() + * ``` + */ + get ints(): Prisma.IntsDelegate; + + /** + * `prisma.floats`: Exposes CRUD operations for the **Floats** model. + * Example usage: + * ```ts + * // Fetch zero or more Floats + * const floats = await prisma.floats.findMany() + * ``` + */ + get floats(): Prisma.FloatsDelegate; +} + +export namespace Prisma { + export import DMMF = runtime.DMMF + + export type PrismaPromise = runtime.Types.Public.PrismaPromise + + /** + * Prisma Errors + */ + export import PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError + export import PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError + export import PrismaClientRustPanicError = runtime.PrismaClientRustPanicError + export import PrismaClientInitializationError = runtime.PrismaClientInitializationError + export import PrismaClientValidationError = runtime.PrismaClientValidationError + export import NotFoundError = runtime.NotFoundError + + /** + * Re-export of sql-template-tag + */ + export import sql = runtime.sqltag + export import empty = runtime.empty + export import join = runtime.join + export import raw = runtime.raw + export import Sql = runtime.Sql + + /** + * Decimal.js + */ + export import Decimal = runtime.Decimal + + export type DecimalJsLike = runtime.DecimalJsLike + + /** + * Metrics + */ + export type Metrics = runtime.Metrics + export type Metric = runtime.Metric + export type MetricHistogram = runtime.MetricHistogram + export type MetricHistogramBucket = runtime.MetricHistogramBucket + + + /** + * Prisma Client JS version: 4.15.0 + * Query Engine version: 8fbc245156db7124f997f4cecdd8d1219e360944 + */ + 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 = null | 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; + + export function validator(): (select: runtime.Types.Utils.LegacyExact) => S; + + /** + * 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: { + Items: 'Items', + OtherItems: 'OtherItems', + Timestamps: 'Timestamps', + Datetimes: 'Datetimes', + Bools: 'Bools', + Uuids: 'Uuids', + Ints: 'Ints', + Floats: 'Floats' + }; + + export type ModelName = (typeof ModelName)[keyof typeof ModelName] + + + export type Datasources = { + db?: Datasource + } + + export type DefaultPrismaClient = PrismaClient + export type RejectOnNotFound = boolean | ((error: Error) => Error) + export type RejectPerModel = { [P in ModelName]?: RejectOnNotFound } + export type RejectPerOperation = { [P in "findUnique" | "findFirst"]?: RejectPerModel | RejectOnNotFound } + type IsReject = T extends true ? True : T extends (err: Error) => Error ? True : False + export type HasReject< + GlobalRejectSettings extends Prisma.PrismaClientOptions['rejectOnNotFound'], + LocalRejectSettings, + Action extends PrismaAction, + Model extends ModelName + > = LocalRejectSettings extends RejectOnNotFound + ? IsReject + : GlobalRejectSettings extends RejectPerOperation + ? Action extends keyof GlobalRejectSettings + ? GlobalRejectSettings[Action] extends RejectOnNotFound + ? IsReject + : GlobalRejectSettings[Action] 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 + */ + + + + /** + * Models + */ + + /** + * Model Items + */ + + + export type AggregateItems = { + _count: ItemsCountAggregateOutputType | null + _avg: ItemsAvgAggregateOutputType | null + _sum: ItemsSumAggregateOutputType | null + _min: ItemsMinAggregateOutputType | null + _max: ItemsMaxAggregateOutputType | null + } + + export type ItemsAvgAggregateOutputType = { + intvalue_null: number | null + intvalue_null_default: number | null + } + + export type ItemsSumAggregateOutputType = { + intvalue_null: number | null + intvalue_null_default: number | null + } + + export type ItemsMinAggregateOutputType = { + id: string | null + content: string | null + content_text_null: string | null + content_text_null_default: string | null + intvalue_null: number | null + intvalue_null_default: number | null + } + + export type ItemsMaxAggregateOutputType = { + id: string | null + content: string | null + content_text_null: string | null + content_text_null_default: string | null + intvalue_null: number | null + intvalue_null_default: number | null + } + + export type ItemsCountAggregateOutputType = { + id: number + content: number + content_text_null: number + content_text_null_default: number + intvalue_null: number + intvalue_null_default: number + _all: number + } + + + export type ItemsAvgAggregateInputType = { + intvalue_null?: true + intvalue_null_default?: true + } + + export type ItemsSumAggregateInputType = { + intvalue_null?: true + intvalue_null_default?: true + } + + export type ItemsMinAggregateInputType = { + id?: true + content?: true + content_text_null?: true + content_text_null_default?: true + intvalue_null?: true + intvalue_null_default?: true + } + + export type ItemsMaxAggregateInputType = { + id?: true + content?: true + content_text_null?: true + content_text_null_default?: true + intvalue_null?: true + intvalue_null_default?: true + } + + export type ItemsCountAggregateInputType = { + id?: true + content?: true + content_text_null?: true + content_text_null_default?: true + intvalue_null?: true + intvalue_null_default?: true + _all?: true + } + + export type ItemsAggregateArgs = { + /** + * Filter which Items to aggregate. + */ + where?: ItemsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Items 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?: ItemsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Items 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` Items. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Items + **/ + _count?: true | ItemsCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: ItemsAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: ItemsSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: ItemsMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: ItemsMaxAggregateInputType + } + + export type GetItemsAggregateType = { + [P in keyof T & keyof AggregateItems]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type ItemsGroupByArgs = { + where?: ItemsWhereInput + orderBy?: Enumerable + by: ItemsScalarFieldEnum[] + having?: ItemsScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: ItemsCountAggregateInputType | true + _avg?: ItemsAvgAggregateInputType + _sum?: ItemsSumAggregateInputType + _min?: ItemsMinAggregateInputType + _max?: ItemsMaxAggregateInputType + } + + + export type ItemsGroupByOutputType = { + id: string + content: string + content_text_null: string | null + content_text_null_default: string | null + intvalue_null: number | null + intvalue_null_default: number | null + _count: ItemsCountAggregateOutputType | null + _avg: ItemsAvgAggregateOutputType | null + _sum: ItemsSumAggregateOutputType | null + _min: ItemsMinAggregateOutputType | null + _max: ItemsMaxAggregateOutputType | null + } + + type GetItemsGroupByPayload = Prisma.PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof ItemsGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type ItemsSelect = { + id?: boolean + content?: boolean + content_text_null?: boolean + content_text_null_default?: boolean + intvalue_null?: boolean + intvalue_null_default?: boolean + other_items?: boolean | OtherItemsArgs + } + + + export type ItemsInclude = { + other_items?: boolean | OtherItemsArgs + } + + export type ItemsGetPayload = + S extends { select: any, include: any } ? 'Please either choose `select` or `include`' : + S extends true ? Items : + S extends undefined ? never : + S extends { include: any } & (ItemsArgs | ItemsFindManyArgs) + ? Items & { + [P in TruthyKeys]: + P extends 'other_items' ? OtherItemsGetPayload | null : never + } + : S extends { select: any } & (ItemsArgs | ItemsFindManyArgs) + ? { + [P in TruthyKeys]: + P extends 'other_items' ? OtherItemsGetPayload | null : P extends keyof Items ? Items[P] : never + } + : Items + + + type ItemsCountArgs = + Omit & { + select?: ItemsCountAggregateInputType | true + } + + export interface ItemsDelegate { + + /** + * Find zero or one Items that matches the filter. + * @param {ItemsFindUniqueArgs} args - Arguments to find a Items + * @example + * // Get one Items + * const items = await prisma.items.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUnique( + args: SelectSubset + ): HasReject extends True ? Prisma__ItemsClient> : Prisma__ItemsClient | null, null> + + /** + * Find one Items that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {ItemsFindUniqueOrThrowArgs} args - Arguments to find a Items + * @example + * // Get one Items + * const items = await prisma.items.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUniqueOrThrow( + args?: SelectSubset + ): Prisma__ItemsClient> + + /** + * Find the first Items 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 {ItemsFindFirstArgs} args - Arguments to find a Items + * @example + * // Get one Items + * const items = await prisma.items.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirst( + args?: SelectSubset + ): HasReject extends True ? Prisma__ItemsClient> : Prisma__ItemsClient | null, null> + + /** + * Find the first Items 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 {ItemsFindFirstOrThrowArgs} args - Arguments to find a Items + * @example + * // Get one Items + * const items = await prisma.items.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirstOrThrow( + args?: SelectSubset + ): Prisma__ItemsClient> + + /** + * Find zero or more Items 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 {ItemsFindManyArgs=} args - Arguments to filter and select certain fields only. + * @example + * // Get all Items + * const items = await prisma.items.findMany() + * + * // Get first 10 Items + * const items = await prisma.items.findMany({ take: 10 }) + * + * // Only select the `id` + * const itemsWithIdOnly = await prisma.items.findMany({ select: { id: true } }) + * + **/ + findMany( + args?: SelectSubset + ): Prisma.PrismaPromise>> + + /** + * Create a Items. + * @param {ItemsCreateArgs} args - Arguments to create a Items. + * @example + * // Create one Items + * const Items = await prisma.items.create({ + * data: { + * // ... data to create a Items + * } + * }) + * + **/ + create( + args: SelectSubset + ): Prisma__ItemsClient> + + /** + * Create many Items. + * @param {ItemsCreateManyArgs} args - Arguments to create many Items. + * @example + * // Create many Items + * const items = await prisma.items.createMany({ + * data: { + * // ... provide data here + * } + * }) + * + **/ + createMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Delete a Items. + * @param {ItemsDeleteArgs} args - Arguments to delete one Items. + * @example + * // Delete one Items + * const Items = await prisma.items.delete({ + * where: { + * // ... filter to delete one Items + * } + * }) + * + **/ + delete( + args: SelectSubset + ): Prisma__ItemsClient> + + /** + * Update one Items. + * @param {ItemsUpdateArgs} args - Arguments to update one Items. + * @example + * // Update one Items + * const items = await prisma.items.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + update( + args: SelectSubset + ): Prisma__ItemsClient> + + /** + * Delete zero or more Items. + * @param {ItemsDeleteManyArgs} args - Arguments to filter Items to delete. + * @example + * // Delete a few Items + * const { count } = await prisma.items.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + **/ + deleteMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Update zero or more Items. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ItemsUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Items + * const items = await prisma.items.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + updateMany( + args: SelectSubset + ): Prisma.PrismaPromise + + /** + * Create or update one Items. + * @param {ItemsUpsertArgs} args - Arguments to update or create a Items. + * @example + * // Update or create a Items + * const items = await prisma.items.upsert({ + * create: { + * // ... data to create a Items + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Items we want to update + * } + * }) + **/ + upsert( + args: SelectSubset + ): Prisma__ItemsClient> + + /** + * Count the number of Items. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ItemsCountArgs} args - Arguments to filter Items to count. + * @example + * // Count the number of Items + * const count = await prisma.items.count({ + * where: { + * // ... the filter for the Items we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends _Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Items. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ItemsAggregateArgs} 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 Items. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ItemsGroupByArgs} 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 ItemsGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: ItemsGroupByArgs['orderBy'] } + : { orderBy?: ItemsGroupByArgs['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 ? GetItemsGroupByPayload : Prisma.PrismaPromise + + } + + /** + * The delegate class that acts as a "Promise-like" for Items. + * 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__ItemsClient 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); + + other_items(args?: Subset): Prisma__OtherItemsClient | 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 + + /** + * Items base type for findUnique actions + */ + export type ItemsFindUniqueArgsBase = { + /** + * Select specific fields to fetch from the Items + */ + select?: ItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ItemsInclude | null + /** + * Filter, which Items to fetch. + */ + where: ItemsWhereUniqueInput + } + + /** + * Items findUnique + */ + export interface ItemsFindUniqueArgs extends ItemsFindUniqueArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findUniqueOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Items findUniqueOrThrow + */ + export type ItemsFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Items + */ + select?: ItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ItemsInclude | null + /** + * Filter, which Items to fetch. + */ + where: ItemsWhereUniqueInput + } + + + /** + * Items base type for findFirst actions + */ + export type ItemsFindFirstArgsBase = { + /** + * Select specific fields to fetch from the Items + */ + select?: ItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ItemsInclude | null + /** + * Filter, which Items to fetch. + */ + where?: ItemsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Items 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 Items. + */ + cursor?: ItemsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Items 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` Items. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Items. + */ + distinct?: Enumerable + } + + /** + * Items findFirst + */ + export interface ItemsFindFirstArgs extends ItemsFindFirstArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findFirstOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Items findFirstOrThrow + */ + export type ItemsFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Items + */ + select?: ItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ItemsInclude | null + /** + * Filter, which Items to fetch. + */ + where?: ItemsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Items 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 Items. + */ + cursor?: ItemsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Items 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` Items. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Items. + */ + distinct?: Enumerable + } + + + /** + * Items findMany + */ + export type ItemsFindManyArgs = { + /** + * Select specific fields to fetch from the Items + */ + select?: ItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ItemsInclude | null + /** + * Filter, which Items to fetch. + */ + where?: ItemsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Items 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 Items. + */ + cursor?: ItemsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Items 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` Items. + */ + skip?: number + distinct?: Enumerable + } + + + /** + * Items create + */ + export type ItemsCreateArgs = { + /** + * Select specific fields to fetch from the Items + */ + select?: ItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ItemsInclude | null + /** + * The data needed to create a Items. + */ + data: XOR + } + + + /** + * Items createMany + */ + export type ItemsCreateManyArgs = { + /** + * The data used to create many Items. + */ + data: Enumerable + skipDuplicates?: boolean + } + + + /** + * Items update + */ + export type ItemsUpdateArgs = { + /** + * Select specific fields to fetch from the Items + */ + select?: ItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ItemsInclude | null + /** + * The data needed to update a Items. + */ + data: XOR + /** + * Choose, which Items to update. + */ + where: ItemsWhereUniqueInput + } + + + /** + * Items updateMany + */ + export type ItemsUpdateManyArgs = { + /** + * The data used to update Items. + */ + data: XOR + /** + * Filter which Items to update + */ + where?: ItemsWhereInput + } + + + /** + * Items upsert + */ + export type ItemsUpsertArgs = { + /** + * Select specific fields to fetch from the Items + */ + select?: ItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ItemsInclude | null + /** + * The filter to search for the Items to update in case it exists. + */ + where: ItemsWhereUniqueInput + /** + * In case the Items found by the `where` argument doesn't exist, create a new Items with this data. + */ + create: XOR + /** + * In case the Items was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + + /** + * Items delete + */ + export type ItemsDeleteArgs = { + /** + * Select specific fields to fetch from the Items + */ + select?: ItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ItemsInclude | null + /** + * Filter which Items to delete. + */ + where: ItemsWhereUniqueInput + } + + + /** + * Items deleteMany + */ + export type ItemsDeleteManyArgs = { + /** + * Filter which Items to delete + */ + where?: ItemsWhereInput + } + + + /** + * Items without action + */ + export type ItemsArgs = { + /** + * Select specific fields to fetch from the Items + */ + select?: ItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ItemsInclude | null + } + + + + /** + * Model OtherItems + */ + + + export type AggregateOtherItems = { + _count: OtherItemsCountAggregateOutputType | null + _min: OtherItemsMinAggregateOutputType | null + _max: OtherItemsMaxAggregateOutputType | null + } + + export type OtherItemsMinAggregateOutputType = { + id: string | null + content: string | null + item_id: string | null + } + + export type OtherItemsMaxAggregateOutputType = { + id: string | null + content: string | null + item_id: string | null + } + + export type OtherItemsCountAggregateOutputType = { + id: number + content: number + item_id: number + _all: number + } + + + export type OtherItemsMinAggregateInputType = { + id?: true + content?: true + item_id?: true + } + + export type OtherItemsMaxAggregateInputType = { + id?: true + content?: true + item_id?: true + } + + export type OtherItemsCountAggregateInputType = { + id?: true + content?: true + item_id?: true + _all?: true + } + + export type OtherItemsAggregateArgs = { + /** + * Filter which OtherItems to aggregate. + */ + where?: OtherItemsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of OtherItems 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?: OtherItemsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` OtherItems 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` OtherItems. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned OtherItems + **/ + _count?: true | OtherItemsCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: OtherItemsMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: OtherItemsMaxAggregateInputType + } + + export type GetOtherItemsAggregateType = { + [P in keyof T & keyof AggregateOtherItems]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type OtherItemsGroupByArgs = { + where?: OtherItemsWhereInput + orderBy?: Enumerable + by: OtherItemsScalarFieldEnum[] + having?: OtherItemsScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: OtherItemsCountAggregateInputType | true + _min?: OtherItemsMinAggregateInputType + _max?: OtherItemsMaxAggregateInputType + } + + + export type OtherItemsGroupByOutputType = { + id: string + content: string + item_id: string | null + _count: OtherItemsCountAggregateOutputType | null + _min: OtherItemsMinAggregateOutputType | null + _max: OtherItemsMaxAggregateOutputType | null + } + + type GetOtherItemsGroupByPayload = Prisma.PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof OtherItemsGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type OtherItemsSelect = { + id?: boolean + content?: boolean + item_id?: boolean + items?: boolean | ItemsArgs + } + + + export type OtherItemsInclude = { + items?: boolean | ItemsArgs + } + + export type OtherItemsGetPayload = + S extends { select: any, include: any } ? 'Please either choose `select` or `include`' : + S extends true ? OtherItems : + S extends undefined ? never : + S extends { include: any } & (OtherItemsArgs | OtherItemsFindManyArgs) + ? OtherItems & { + [P in TruthyKeys]: + P extends 'items' ? ItemsGetPayload | null : never + } + : S extends { select: any } & (OtherItemsArgs | OtherItemsFindManyArgs) + ? { + [P in TruthyKeys]: + P extends 'items' ? ItemsGetPayload | null : P extends keyof OtherItems ? OtherItems[P] : never + } + : OtherItems + + + type OtherItemsCountArgs = + Omit & { + select?: OtherItemsCountAggregateInputType | true + } + + export interface OtherItemsDelegate { + + /** + * Find zero or one OtherItems that matches the filter. + * @param {OtherItemsFindUniqueArgs} args - Arguments to find a OtherItems + * @example + * // Get one OtherItems + * const otherItems = await prisma.otherItems.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUnique( + args: SelectSubset + ): HasReject extends True ? Prisma__OtherItemsClient> : Prisma__OtherItemsClient | null, null> + + /** + * Find one OtherItems that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {OtherItemsFindUniqueOrThrowArgs} args - Arguments to find a OtherItems + * @example + * // Get one OtherItems + * const otherItems = await prisma.otherItems.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUniqueOrThrow( + args?: SelectSubset + ): Prisma__OtherItemsClient> + + /** + * Find the first OtherItems 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 {OtherItemsFindFirstArgs} args - Arguments to find a OtherItems + * @example + * // Get one OtherItems + * const otherItems = await prisma.otherItems.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirst( + args?: SelectSubset + ): HasReject extends True ? Prisma__OtherItemsClient> : Prisma__OtherItemsClient | null, null> + + /** + * Find the first OtherItems 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 {OtherItemsFindFirstOrThrowArgs} args - Arguments to find a OtherItems + * @example + * // Get one OtherItems + * const otherItems = await prisma.otherItems.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirstOrThrow( + args?: SelectSubset + ): Prisma__OtherItemsClient> + + /** + * Find zero or more OtherItems 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 {OtherItemsFindManyArgs=} args - Arguments to filter and select certain fields only. + * @example + * // Get all OtherItems + * const otherItems = await prisma.otherItems.findMany() + * + * // Get first 10 OtherItems + * const otherItems = await prisma.otherItems.findMany({ take: 10 }) + * + * // Only select the `id` + * const otherItemsWithIdOnly = await prisma.otherItems.findMany({ select: { id: true } }) + * + **/ + findMany( + args?: SelectSubset + ): Prisma.PrismaPromise>> + + /** + * Create a OtherItems. + * @param {OtherItemsCreateArgs} args - Arguments to create a OtherItems. + * @example + * // Create one OtherItems + * const OtherItems = await prisma.otherItems.create({ + * data: { + * // ... data to create a OtherItems + * } + * }) + * + **/ + create( + args: SelectSubset + ): Prisma__OtherItemsClient> + + /** + * Create many OtherItems. + * @param {OtherItemsCreateManyArgs} args - Arguments to create many OtherItems. + * @example + * // Create many OtherItems + * const otherItems = await prisma.otherItems.createMany({ + * data: { + * // ... provide data here + * } + * }) + * + **/ + createMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Delete a OtherItems. + * @param {OtherItemsDeleteArgs} args - Arguments to delete one OtherItems. + * @example + * // Delete one OtherItems + * const OtherItems = await prisma.otherItems.delete({ + * where: { + * // ... filter to delete one OtherItems + * } + * }) + * + **/ + delete( + args: SelectSubset + ): Prisma__OtherItemsClient> + + /** + * Update one OtherItems. + * @param {OtherItemsUpdateArgs} args - Arguments to update one OtherItems. + * @example + * // Update one OtherItems + * const otherItems = await prisma.otherItems.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + update( + args: SelectSubset + ): Prisma__OtherItemsClient> + + /** + * Delete zero or more OtherItems. + * @param {OtherItemsDeleteManyArgs} args - Arguments to filter OtherItems to delete. + * @example + * // Delete a few OtherItems + * const { count } = await prisma.otherItems.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + **/ + deleteMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Update zero or more OtherItems. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OtherItemsUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many OtherItems + * const otherItems = await prisma.otherItems.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + updateMany( + args: SelectSubset + ): Prisma.PrismaPromise + + /** + * Create or update one OtherItems. + * @param {OtherItemsUpsertArgs} args - Arguments to update or create a OtherItems. + * @example + * // Update or create a OtherItems + * const otherItems = await prisma.otherItems.upsert({ + * create: { + * // ... data to create a OtherItems + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the OtherItems we want to update + * } + * }) + **/ + upsert( + args: SelectSubset + ): Prisma__OtherItemsClient> + + /** + * Count the number of OtherItems. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OtherItemsCountArgs} args - Arguments to filter OtherItems to count. + * @example + * // Count the number of OtherItems + * const count = await prisma.otherItems.count({ + * where: { + * // ... the filter for the OtherItems we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends _Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a OtherItems. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OtherItemsAggregateArgs} 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 OtherItems. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OtherItemsGroupByArgs} 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 OtherItemsGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: OtherItemsGroupByArgs['orderBy'] } + : { orderBy?: OtherItemsGroupByArgs['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 ? GetOtherItemsGroupByPayload : Prisma.PrismaPromise + + } + + /** + * The delegate class that acts as a "Promise-like" for OtherItems. + * 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__OtherItemsClient 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); + + items(args?: Subset): Prisma__ItemsClient | 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 + + /** + * OtherItems base type for findUnique actions + */ + export type OtherItemsFindUniqueArgsBase = { + /** + * Select specific fields to fetch from the OtherItems + */ + select?: OtherItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: OtherItemsInclude | null + /** + * Filter, which OtherItems to fetch. + */ + where: OtherItemsWhereUniqueInput + } + + /** + * OtherItems findUnique + */ + export interface OtherItemsFindUniqueArgs extends OtherItemsFindUniqueArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findUniqueOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * OtherItems findUniqueOrThrow + */ + export type OtherItemsFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the OtherItems + */ + select?: OtherItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: OtherItemsInclude | null + /** + * Filter, which OtherItems to fetch. + */ + where: OtherItemsWhereUniqueInput + } + + + /** + * OtherItems base type for findFirst actions + */ + export type OtherItemsFindFirstArgsBase = { + /** + * Select specific fields to fetch from the OtherItems + */ + select?: OtherItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: OtherItemsInclude | null + /** + * Filter, which OtherItems to fetch. + */ + where?: OtherItemsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of OtherItems 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 OtherItems. + */ + cursor?: OtherItemsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` OtherItems 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` OtherItems. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of OtherItems. + */ + distinct?: Enumerable + } + + /** + * OtherItems findFirst + */ + export interface OtherItemsFindFirstArgs extends OtherItemsFindFirstArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findFirstOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * OtherItems findFirstOrThrow + */ + export type OtherItemsFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the OtherItems + */ + select?: OtherItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: OtherItemsInclude | null + /** + * Filter, which OtherItems to fetch. + */ + where?: OtherItemsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of OtherItems 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 OtherItems. + */ + cursor?: OtherItemsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` OtherItems 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` OtherItems. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of OtherItems. + */ + distinct?: Enumerable + } + + + /** + * OtherItems findMany + */ + export type OtherItemsFindManyArgs = { + /** + * Select specific fields to fetch from the OtherItems + */ + select?: OtherItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: OtherItemsInclude | null + /** + * Filter, which OtherItems to fetch. + */ + where?: OtherItemsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of OtherItems 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 OtherItems. + */ + cursor?: OtherItemsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` OtherItems 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` OtherItems. + */ + skip?: number + distinct?: Enumerable + } + + + /** + * OtherItems create + */ + export type OtherItemsCreateArgs = { + /** + * Select specific fields to fetch from the OtherItems + */ + select?: OtherItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: OtherItemsInclude | null + /** + * The data needed to create a OtherItems. + */ + data: XOR + } + + + /** + * OtherItems createMany + */ + export type OtherItemsCreateManyArgs = { + /** + * The data used to create many OtherItems. + */ + data: Enumerable + skipDuplicates?: boolean + } + + + /** + * OtherItems update + */ + export type OtherItemsUpdateArgs = { + /** + * Select specific fields to fetch from the OtherItems + */ + select?: OtherItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: OtherItemsInclude | null + /** + * The data needed to update a OtherItems. + */ + data: XOR + /** + * Choose, which OtherItems to update. + */ + where: OtherItemsWhereUniqueInput + } + + + /** + * OtherItems updateMany + */ + export type OtherItemsUpdateManyArgs = { + /** + * The data used to update OtherItems. + */ + data: XOR + /** + * Filter which OtherItems to update + */ + where?: OtherItemsWhereInput + } + + + /** + * OtherItems upsert + */ + export type OtherItemsUpsertArgs = { + /** + * Select specific fields to fetch from the OtherItems + */ + select?: OtherItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: OtherItemsInclude | null + /** + * The filter to search for the OtherItems to update in case it exists. + */ + where: OtherItemsWhereUniqueInput + /** + * In case the OtherItems found by the `where` argument doesn't exist, create a new OtherItems with this data. + */ + create: XOR + /** + * In case the OtherItems was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + + /** + * OtherItems delete + */ + export type OtherItemsDeleteArgs = { + /** + * Select specific fields to fetch from the OtherItems + */ + select?: OtherItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: OtherItemsInclude | null + /** + * Filter which OtherItems to delete. + */ + where: OtherItemsWhereUniqueInput + } + + + /** + * OtherItems deleteMany + */ + export type OtherItemsDeleteManyArgs = { + /** + * Filter which OtherItems to delete + */ + where?: OtherItemsWhereInput + } + + + /** + * OtherItems without action + */ + export type OtherItemsArgs = { + /** + * Select specific fields to fetch from the OtherItems + */ + select?: OtherItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: OtherItemsInclude | null + } + + + + /** + * Model Timestamps + */ + + + export type AggregateTimestamps = { + _count: TimestampsCountAggregateOutputType | null + _min: TimestampsMinAggregateOutputType | null + _max: TimestampsMaxAggregateOutputType | null + } + + export type TimestampsMinAggregateOutputType = { + id: string | null + created_at: Date | null + updated_at: Date | null + } + + export type TimestampsMaxAggregateOutputType = { + id: string | null + created_at: Date | null + updated_at: Date | null + } + + export type TimestampsCountAggregateOutputType = { + id: number + created_at: number + updated_at: number + _all: number + } + + + export type TimestampsMinAggregateInputType = { + id?: true + created_at?: true + updated_at?: true + } + + export type TimestampsMaxAggregateInputType = { + id?: true + created_at?: true + updated_at?: true + } + + export type TimestampsCountAggregateInputType = { + id?: true + created_at?: true + updated_at?: true + _all?: true + } + + export type TimestampsAggregateArgs = { + /** + * Filter which Timestamps to aggregate. + */ + where?: TimestampsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Timestamps 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?: TimestampsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Timestamps 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` Timestamps. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Timestamps + **/ + _count?: true | TimestampsCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: TimestampsMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: TimestampsMaxAggregateInputType + } + + export type GetTimestampsAggregateType = { + [P in keyof T & keyof AggregateTimestamps]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type TimestampsGroupByArgs = { + where?: TimestampsWhereInput + orderBy?: Enumerable + by: TimestampsScalarFieldEnum[] + having?: TimestampsScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: TimestampsCountAggregateInputType | true + _min?: TimestampsMinAggregateInputType + _max?: TimestampsMaxAggregateInputType + } + + + export type TimestampsGroupByOutputType = { + id: string + created_at: Date + updated_at: Date + _count: TimestampsCountAggregateOutputType | null + _min: TimestampsMinAggregateOutputType | null + _max: TimestampsMaxAggregateOutputType | null + } + + type GetTimestampsGroupByPayload = Prisma.PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof TimestampsGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type TimestampsSelect = { + id?: boolean + created_at?: boolean + updated_at?: boolean + } + + + export type TimestampsGetPayload = + S extends { select: any, include: any } ? 'Please either choose `select` or `include`' : + S extends true ? Timestamps : + S extends undefined ? never : + S extends { include: any } & (TimestampsArgs | TimestampsFindManyArgs) + ? Timestamps + : S extends { select: any } & (TimestampsArgs | TimestampsFindManyArgs) + ? { + [P in TruthyKeys]: + P extends keyof Timestamps ? Timestamps[P] : never + } + : Timestamps + + + type TimestampsCountArgs = + Omit & { + select?: TimestampsCountAggregateInputType | true + } + + export interface TimestampsDelegate { + + /** + * Find zero or one Timestamps that matches the filter. + * @param {TimestampsFindUniqueArgs} args - Arguments to find a Timestamps + * @example + * // Get one Timestamps + * const timestamps = await prisma.timestamps.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUnique( + args: SelectSubset + ): HasReject extends True ? Prisma__TimestampsClient> : Prisma__TimestampsClient | null, null> + + /** + * Find one Timestamps that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {TimestampsFindUniqueOrThrowArgs} args - Arguments to find a Timestamps + * @example + * // Get one Timestamps + * const timestamps = await prisma.timestamps.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUniqueOrThrow( + args?: SelectSubset + ): Prisma__TimestampsClient> + + /** + * Find the first Timestamps 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 {TimestampsFindFirstArgs} args - Arguments to find a Timestamps + * @example + * // Get one Timestamps + * const timestamps = await prisma.timestamps.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirst( + args?: SelectSubset + ): HasReject extends True ? Prisma__TimestampsClient> : Prisma__TimestampsClient | null, null> + + /** + * Find the first Timestamps 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 {TimestampsFindFirstOrThrowArgs} args - Arguments to find a Timestamps + * @example + * // Get one Timestamps + * const timestamps = await prisma.timestamps.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirstOrThrow( + args?: SelectSubset + ): Prisma__TimestampsClient> + + /** + * Find zero or more Timestamps 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 {TimestampsFindManyArgs=} args - Arguments to filter and select certain fields only. + * @example + * // Get all Timestamps + * const timestamps = await prisma.timestamps.findMany() + * + * // Get first 10 Timestamps + * const timestamps = await prisma.timestamps.findMany({ take: 10 }) + * + * // Only select the `id` + * const timestampsWithIdOnly = await prisma.timestamps.findMany({ select: { id: true } }) + * + **/ + findMany( + args?: SelectSubset + ): Prisma.PrismaPromise>> + + /** + * Create a Timestamps. + * @param {TimestampsCreateArgs} args - Arguments to create a Timestamps. + * @example + * // Create one Timestamps + * const Timestamps = await prisma.timestamps.create({ + * data: { + * // ... data to create a Timestamps + * } + * }) + * + **/ + create( + args: SelectSubset + ): Prisma__TimestampsClient> + + /** + * Create many Timestamps. + * @param {TimestampsCreateManyArgs} args - Arguments to create many Timestamps. + * @example + * // Create many Timestamps + * const timestamps = await prisma.timestamps.createMany({ + * data: { + * // ... provide data here + * } + * }) + * + **/ + createMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Delete a Timestamps. + * @param {TimestampsDeleteArgs} args - Arguments to delete one Timestamps. + * @example + * // Delete one Timestamps + * const Timestamps = await prisma.timestamps.delete({ + * where: { + * // ... filter to delete one Timestamps + * } + * }) + * + **/ + delete( + args: SelectSubset + ): Prisma__TimestampsClient> + + /** + * Update one Timestamps. + * @param {TimestampsUpdateArgs} args - Arguments to update one Timestamps. + * @example + * // Update one Timestamps + * const timestamps = await prisma.timestamps.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + update( + args: SelectSubset + ): Prisma__TimestampsClient> + + /** + * Delete zero or more Timestamps. + * @param {TimestampsDeleteManyArgs} args - Arguments to filter Timestamps to delete. + * @example + * // Delete a few Timestamps + * const { count } = await prisma.timestamps.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + **/ + deleteMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Update zero or more Timestamps. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TimestampsUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Timestamps + * const timestamps = await prisma.timestamps.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + updateMany( + args: SelectSubset + ): Prisma.PrismaPromise + + /** + * Create or update one Timestamps. + * @param {TimestampsUpsertArgs} args - Arguments to update or create a Timestamps. + * @example + * // Update or create a Timestamps + * const timestamps = await prisma.timestamps.upsert({ + * create: { + * // ... data to create a Timestamps + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Timestamps we want to update + * } + * }) + **/ + upsert( + args: SelectSubset + ): Prisma__TimestampsClient> + + /** + * Count the number of Timestamps. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TimestampsCountArgs} args - Arguments to filter Timestamps to count. + * @example + * // Count the number of Timestamps + * const count = await prisma.timestamps.count({ + * where: { + * // ... the filter for the Timestamps we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends _Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Timestamps. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TimestampsAggregateArgs} 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 Timestamps. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TimestampsGroupByArgs} 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 TimestampsGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: TimestampsGroupByArgs['orderBy'] } + : { orderBy?: TimestampsGroupByArgs['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 ? GetTimestampsGroupByPayload : Prisma.PrismaPromise + + } + + /** + * The delegate class that acts as a "Promise-like" for Timestamps. + * 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__TimestampsClient implements Prisma.PrismaPromise { + private readonly _dmmf; + private readonly _queryType; + private readonly _rootField; + private readonly _clientMethod; + private readonly _args; + private readonly _dataPath; + private readonly _errorFormat; + private readonly _measurePerformance?; + private _isList; + private _callsite; + private _requestPromise?; + readonly [Symbol.toStringTag]: 'PrismaPromise'; + constructor(_dmmf: runtime.DMMFClass, _queryType: 'query' | 'mutation', _rootField: string, _clientMethod: string, _args: any, _dataPath: string[], _errorFormat: ErrorFormat, _measurePerformance?: boolean | undefined, _isList?: boolean); + + + private get _document(); + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(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 + + /** + * Timestamps base type for findUnique actions + */ + export type TimestampsFindUniqueArgsBase = { + /** + * Select specific fields to fetch from the Timestamps + */ + select?: TimestampsSelect | null + /** + * Filter, which Timestamps to fetch. + */ + where: TimestampsWhereUniqueInput + } + + /** + * Timestamps findUnique + */ + export interface TimestampsFindUniqueArgs extends TimestampsFindUniqueArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findUniqueOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Timestamps findUniqueOrThrow + */ + export type TimestampsFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Timestamps + */ + select?: TimestampsSelect | null + /** + * Filter, which Timestamps to fetch. + */ + where: TimestampsWhereUniqueInput + } + + + /** + * Timestamps base type for findFirst actions + */ + export type TimestampsFindFirstArgsBase = { + /** + * Select specific fields to fetch from the Timestamps + */ + select?: TimestampsSelect | null + /** + * Filter, which Timestamps to fetch. + */ + where?: TimestampsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Timestamps 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 Timestamps. + */ + cursor?: TimestampsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Timestamps 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` Timestamps. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Timestamps. + */ + distinct?: Enumerable + } + + /** + * Timestamps findFirst + */ + export interface TimestampsFindFirstArgs extends TimestampsFindFirstArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findFirstOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Timestamps findFirstOrThrow + */ + export type TimestampsFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Timestamps + */ + select?: TimestampsSelect | null + /** + * Filter, which Timestamps to fetch. + */ + where?: TimestampsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Timestamps 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 Timestamps. + */ + cursor?: TimestampsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Timestamps 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` Timestamps. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Timestamps. + */ + distinct?: Enumerable + } + + + /** + * Timestamps findMany + */ + export type TimestampsFindManyArgs = { + /** + * Select specific fields to fetch from the Timestamps + */ + select?: TimestampsSelect | null + /** + * Filter, which Timestamps to fetch. + */ + where?: TimestampsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Timestamps 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 Timestamps. + */ + cursor?: TimestampsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Timestamps 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` Timestamps. + */ + skip?: number + distinct?: Enumerable + } + + + /** + * Timestamps create + */ + export type TimestampsCreateArgs = { + /** + * Select specific fields to fetch from the Timestamps + */ + select?: TimestampsSelect | null + /** + * The data needed to create a Timestamps. + */ + data: XOR + } + + + /** + * Timestamps createMany + */ + export type TimestampsCreateManyArgs = { + /** + * The data used to create many Timestamps. + */ + data: Enumerable + skipDuplicates?: boolean + } + + + /** + * Timestamps update + */ + export type TimestampsUpdateArgs = { + /** + * Select specific fields to fetch from the Timestamps + */ + select?: TimestampsSelect | null + /** + * The data needed to update a Timestamps. + */ + data: XOR + /** + * Choose, which Timestamps to update. + */ + where: TimestampsWhereUniqueInput + } + + + /** + * Timestamps updateMany + */ + export type TimestampsUpdateManyArgs = { + /** + * The data used to update Timestamps. + */ + data: XOR + /** + * Filter which Timestamps to update + */ + where?: TimestampsWhereInput + } + + + /** + * Timestamps upsert + */ + export type TimestampsUpsertArgs = { + /** + * Select specific fields to fetch from the Timestamps + */ + select?: TimestampsSelect | null + /** + * The filter to search for the Timestamps to update in case it exists. + */ + where: TimestampsWhereUniqueInput + /** + * In case the Timestamps found by the `where` argument doesn't exist, create a new Timestamps with this data. + */ + create: XOR + /** + * In case the Timestamps was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + + /** + * Timestamps delete + */ + export type TimestampsDeleteArgs = { + /** + * Select specific fields to fetch from the Timestamps + */ + select?: TimestampsSelect | null + /** + * Filter which Timestamps to delete. + */ + where: TimestampsWhereUniqueInput + } + + + /** + * Timestamps deleteMany + */ + export type TimestampsDeleteManyArgs = { + /** + * Filter which Timestamps to delete + */ + where?: TimestampsWhereInput + } + + + /** + * Timestamps without action + */ + export type TimestampsArgs = { + /** + * Select specific fields to fetch from the Timestamps + */ + select?: TimestampsSelect | null + } + + + + /** + * Model Datetimes + */ + + + export type AggregateDatetimes = { + _count: DatetimesCountAggregateOutputType | null + _min: DatetimesMinAggregateOutputType | null + _max: DatetimesMaxAggregateOutputType | null + } + + export type DatetimesMinAggregateOutputType = { + id: string | null + d: Date | null + t: Date | null + } + + export type DatetimesMaxAggregateOutputType = { + id: string | null + d: Date | null + t: Date | null + } + + export type DatetimesCountAggregateOutputType = { + id: number + d: number + t: number + _all: number + } + + + export type DatetimesMinAggregateInputType = { + id?: true + d?: true + t?: true + } + + export type DatetimesMaxAggregateInputType = { + id?: true + d?: true + t?: true + } + + export type DatetimesCountAggregateInputType = { + id?: true + d?: true + t?: true + _all?: true + } + + export type DatetimesAggregateArgs = { + /** + * Filter which Datetimes to aggregate. + */ + where?: DatetimesWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Datetimes 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?: DatetimesWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Datetimes 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` Datetimes. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Datetimes + **/ + _count?: true | DatetimesCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: DatetimesMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: DatetimesMaxAggregateInputType + } + + export type GetDatetimesAggregateType = { + [P in keyof T & keyof AggregateDatetimes]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type DatetimesGroupByArgs = { + where?: DatetimesWhereInput + orderBy?: Enumerable + by: DatetimesScalarFieldEnum[] + having?: DatetimesScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: DatetimesCountAggregateInputType | true + _min?: DatetimesMinAggregateInputType + _max?: DatetimesMaxAggregateInputType + } + + + export type DatetimesGroupByOutputType = { + id: string + d: Date + t: Date + _count: DatetimesCountAggregateOutputType | null + _min: DatetimesMinAggregateOutputType | null + _max: DatetimesMaxAggregateOutputType | null + } + + type GetDatetimesGroupByPayload = Prisma.PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof DatetimesGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type DatetimesSelect = { + id?: boolean + d?: boolean + t?: boolean + } + + + export type DatetimesGetPayload = + S extends { select: any, include: any } ? 'Please either choose `select` or `include`' : + S extends true ? Datetimes : + S extends undefined ? never : + S extends { include: any } & (DatetimesArgs | DatetimesFindManyArgs) + ? Datetimes + : S extends { select: any } & (DatetimesArgs | DatetimesFindManyArgs) + ? { + [P in TruthyKeys]: + P extends keyof Datetimes ? Datetimes[P] : never + } + : Datetimes + + + type DatetimesCountArgs = + Omit & { + select?: DatetimesCountAggregateInputType | true + } + + export interface DatetimesDelegate { + + /** + * Find zero or one Datetimes that matches the filter. + * @param {DatetimesFindUniqueArgs} args - Arguments to find a Datetimes + * @example + * // Get one Datetimes + * const datetimes = await prisma.datetimes.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUnique( + args: SelectSubset + ): HasReject extends True ? Prisma__DatetimesClient> : Prisma__DatetimesClient | null, null> + + /** + * Find one Datetimes that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {DatetimesFindUniqueOrThrowArgs} args - Arguments to find a Datetimes + * @example + * // Get one Datetimes + * const datetimes = await prisma.datetimes.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUniqueOrThrow( + args?: SelectSubset + ): Prisma__DatetimesClient> + + /** + * Find the first Datetimes 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 {DatetimesFindFirstArgs} args - Arguments to find a Datetimes + * @example + * // Get one Datetimes + * const datetimes = await prisma.datetimes.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirst( + args?: SelectSubset + ): HasReject extends True ? Prisma__DatetimesClient> : Prisma__DatetimesClient | null, null> + + /** + * Find the first Datetimes 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 {DatetimesFindFirstOrThrowArgs} args - Arguments to find a Datetimes + * @example + * // Get one Datetimes + * const datetimes = await prisma.datetimes.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirstOrThrow( + args?: SelectSubset + ): Prisma__DatetimesClient> + + /** + * Find zero or more Datetimes 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 {DatetimesFindManyArgs=} args - Arguments to filter and select certain fields only. + * @example + * // Get all Datetimes + * const datetimes = await prisma.datetimes.findMany() + * + * // Get first 10 Datetimes + * const datetimes = await prisma.datetimes.findMany({ take: 10 }) + * + * // Only select the `id` + * const datetimesWithIdOnly = await prisma.datetimes.findMany({ select: { id: true } }) + * + **/ + findMany( + args?: SelectSubset + ): Prisma.PrismaPromise>> + + /** + * Create a Datetimes. + * @param {DatetimesCreateArgs} args - Arguments to create a Datetimes. + * @example + * // Create one Datetimes + * const Datetimes = await prisma.datetimes.create({ + * data: { + * // ... data to create a Datetimes + * } + * }) + * + **/ + create( + args: SelectSubset + ): Prisma__DatetimesClient> + + /** + * Create many Datetimes. + * @param {DatetimesCreateManyArgs} args - Arguments to create many Datetimes. + * @example + * // Create many Datetimes + * const datetimes = await prisma.datetimes.createMany({ + * data: { + * // ... provide data here + * } + * }) + * + **/ + createMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Delete a Datetimes. + * @param {DatetimesDeleteArgs} args - Arguments to delete one Datetimes. + * @example + * // Delete one Datetimes + * const Datetimes = await prisma.datetimes.delete({ + * where: { + * // ... filter to delete one Datetimes + * } + * }) + * + **/ + delete( + args: SelectSubset + ): Prisma__DatetimesClient> + + /** + * Update one Datetimes. + * @param {DatetimesUpdateArgs} args - Arguments to update one Datetimes. + * @example + * // Update one Datetimes + * const datetimes = await prisma.datetimes.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + update( + args: SelectSubset + ): Prisma__DatetimesClient> + + /** + * Delete zero or more Datetimes. + * @param {DatetimesDeleteManyArgs} args - Arguments to filter Datetimes to delete. + * @example + * // Delete a few Datetimes + * const { count } = await prisma.datetimes.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + **/ + deleteMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Update zero or more Datetimes. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DatetimesUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Datetimes + * const datetimes = await prisma.datetimes.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + updateMany( + args: SelectSubset + ): Prisma.PrismaPromise + + /** + * Create or update one Datetimes. + * @param {DatetimesUpsertArgs} args - Arguments to update or create a Datetimes. + * @example + * // Update or create a Datetimes + * const datetimes = await prisma.datetimes.upsert({ + * create: { + * // ... data to create a Datetimes + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Datetimes we want to update + * } + * }) + **/ + upsert( + args: SelectSubset + ): Prisma__DatetimesClient> + + /** + * Count the number of Datetimes. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DatetimesCountArgs} args - Arguments to filter Datetimes to count. + * @example + * // Count the number of Datetimes + * const count = await prisma.datetimes.count({ + * where: { + * // ... the filter for the Datetimes we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends _Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Datetimes. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DatetimesAggregateArgs} 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 Datetimes. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DatetimesGroupByArgs} 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 DatetimesGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: DatetimesGroupByArgs['orderBy'] } + : { orderBy?: DatetimesGroupByArgs['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 ? GetDatetimesGroupByPayload : Prisma.PrismaPromise + + } + + /** + * The delegate class that acts as a "Promise-like" for Datetimes. + * 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__DatetimesClient implements Prisma.PrismaPromise { + private readonly _dmmf; + private readonly _queryType; + private readonly _rootField; + private readonly _clientMethod; + private readonly _args; + private readonly _dataPath; + private readonly _errorFormat; + private readonly _measurePerformance?; + private _isList; + private _callsite; + private _requestPromise?; + readonly [Symbol.toStringTag]: 'PrismaPromise'; + constructor(_dmmf: runtime.DMMFClass, _queryType: 'query' | 'mutation', _rootField: string, _clientMethod: string, _args: any, _dataPath: string[], _errorFormat: ErrorFormat, _measurePerformance?: boolean | undefined, _isList?: boolean); + + + private get _document(); + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(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 + + /** + * Datetimes base type for findUnique actions + */ + export type DatetimesFindUniqueArgsBase = { + /** + * Select specific fields to fetch from the Datetimes + */ + select?: DatetimesSelect | null + /** + * Filter, which Datetimes to fetch. + */ + where: DatetimesWhereUniqueInput + } + + /** + * Datetimes findUnique + */ + export interface DatetimesFindUniqueArgs extends DatetimesFindUniqueArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findUniqueOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Datetimes findUniqueOrThrow + */ + export type DatetimesFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Datetimes + */ + select?: DatetimesSelect | null + /** + * Filter, which Datetimes to fetch. + */ + where: DatetimesWhereUniqueInput + } + + + /** + * Datetimes base type for findFirst actions + */ + export type DatetimesFindFirstArgsBase = { + /** + * Select specific fields to fetch from the Datetimes + */ + select?: DatetimesSelect | null + /** + * Filter, which Datetimes to fetch. + */ + where?: DatetimesWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Datetimes 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 Datetimes. + */ + cursor?: DatetimesWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Datetimes 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` Datetimes. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Datetimes. + */ + distinct?: Enumerable + } + + /** + * Datetimes findFirst + */ + export interface DatetimesFindFirstArgs extends DatetimesFindFirstArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findFirstOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Datetimes findFirstOrThrow + */ + export type DatetimesFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Datetimes + */ + select?: DatetimesSelect | null + /** + * Filter, which Datetimes to fetch. + */ + where?: DatetimesWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Datetimes 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 Datetimes. + */ + cursor?: DatetimesWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Datetimes 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` Datetimes. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Datetimes. + */ + distinct?: Enumerable + } + + + /** + * Datetimes findMany + */ + export type DatetimesFindManyArgs = { + /** + * Select specific fields to fetch from the Datetimes + */ + select?: DatetimesSelect | null + /** + * Filter, which Datetimes to fetch. + */ + where?: DatetimesWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Datetimes 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 Datetimes. + */ + cursor?: DatetimesWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Datetimes 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` Datetimes. + */ + skip?: number + distinct?: Enumerable + } + + + /** + * Datetimes create + */ + export type DatetimesCreateArgs = { + /** + * Select specific fields to fetch from the Datetimes + */ + select?: DatetimesSelect | null + /** + * The data needed to create a Datetimes. + */ + data: XOR + } + + + /** + * Datetimes createMany + */ + export type DatetimesCreateManyArgs = { + /** + * The data used to create many Datetimes. + */ + data: Enumerable + skipDuplicates?: boolean + } + + + /** + * Datetimes update + */ + export type DatetimesUpdateArgs = { + /** + * Select specific fields to fetch from the Datetimes + */ + select?: DatetimesSelect | null + /** + * The data needed to update a Datetimes. + */ + data: XOR + /** + * Choose, which Datetimes to update. + */ + where: DatetimesWhereUniqueInput + } + + + /** + * Datetimes updateMany + */ + export type DatetimesUpdateManyArgs = { + /** + * The data used to update Datetimes. + */ + data: XOR + /** + * Filter which Datetimes to update + */ + where?: DatetimesWhereInput + } + + + /** + * Datetimes upsert + */ + export type DatetimesUpsertArgs = { + /** + * Select specific fields to fetch from the Datetimes + */ + select?: DatetimesSelect | null + /** + * The filter to search for the Datetimes to update in case it exists. + */ + where: DatetimesWhereUniqueInput + /** + * In case the Datetimes found by the `where` argument doesn't exist, create a new Datetimes with this data. + */ + create: XOR + /** + * In case the Datetimes was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + + /** + * Datetimes delete + */ + export type DatetimesDeleteArgs = { + /** + * Select specific fields to fetch from the Datetimes + */ + select?: DatetimesSelect | null + /** + * Filter which Datetimes to delete. + */ + where: DatetimesWhereUniqueInput + } + + + /** + * Datetimes deleteMany + */ + export type DatetimesDeleteManyArgs = { + /** + * Filter which Datetimes to delete + */ + where?: DatetimesWhereInput + } + + + /** + * Datetimes without action + */ + export type DatetimesArgs = { + /** + * Select specific fields to fetch from the Datetimes + */ + select?: DatetimesSelect | null + } + + + + /** + * Model Bools + */ + + + export type AggregateBools = { + _count: BoolsCountAggregateOutputType | null + _min: BoolsMinAggregateOutputType | null + _max: BoolsMaxAggregateOutputType | null + } + + export type BoolsMinAggregateOutputType = { + id: string | null + b: boolean | null + } + + export type BoolsMaxAggregateOutputType = { + id: string | null + b: boolean | null + } + + export type BoolsCountAggregateOutputType = { + id: number + b: number + _all: number + } + + + export type BoolsMinAggregateInputType = { + id?: true + b?: true + } + + export type BoolsMaxAggregateInputType = { + id?: true + b?: true + } + + export type BoolsCountAggregateInputType = { + id?: true + b?: true + _all?: true + } + + export type BoolsAggregateArgs = { + /** + * Filter which Bools to aggregate. + */ + where?: BoolsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Bools 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?: BoolsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Bools 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` Bools. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Bools + **/ + _count?: true | BoolsCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: BoolsMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: BoolsMaxAggregateInputType + } + + export type GetBoolsAggregateType = { + [P in keyof T & keyof AggregateBools]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type BoolsGroupByArgs = { + where?: BoolsWhereInput + orderBy?: Enumerable + by: BoolsScalarFieldEnum[] + having?: BoolsScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: BoolsCountAggregateInputType | true + _min?: BoolsMinAggregateInputType + _max?: BoolsMaxAggregateInputType + } + + + export type BoolsGroupByOutputType = { + id: string + b: boolean | null + _count: BoolsCountAggregateOutputType | null + _min: BoolsMinAggregateOutputType | null + _max: BoolsMaxAggregateOutputType | null + } + + type GetBoolsGroupByPayload = Prisma.PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof BoolsGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type BoolsSelect = { + id?: boolean + b?: boolean + } + + + export type BoolsGetPayload = + S extends { select: any, include: any } ? 'Please either choose `select` or `include`' : + S extends true ? Bools : + S extends undefined ? never : + S extends { include: any } & (BoolsArgs | BoolsFindManyArgs) + ? Bools + : S extends { select: any } & (BoolsArgs | BoolsFindManyArgs) + ? { + [P in TruthyKeys]: + P extends keyof Bools ? Bools[P] : never + } + : Bools + + + type BoolsCountArgs = + Omit & { + select?: BoolsCountAggregateInputType | true + } + + export interface BoolsDelegate { + + /** + * Find zero or one Bools that matches the filter. + * @param {BoolsFindUniqueArgs} args - Arguments to find a Bools + * @example + * // Get one Bools + * const bools = await prisma.bools.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUnique( + args: SelectSubset + ): HasReject extends True ? Prisma__BoolsClient> : Prisma__BoolsClient | null, null> + + /** + * Find one Bools that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {BoolsFindUniqueOrThrowArgs} args - Arguments to find a Bools + * @example + * // Get one Bools + * const bools = await prisma.bools.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUniqueOrThrow( + args?: SelectSubset + ): Prisma__BoolsClient> + + /** + * Find the first Bools 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 {BoolsFindFirstArgs} args - Arguments to find a Bools + * @example + * // Get one Bools + * const bools = await prisma.bools.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirst( + args?: SelectSubset + ): HasReject extends True ? Prisma__BoolsClient> : Prisma__BoolsClient | null, null> + + /** + * Find the first Bools 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 {BoolsFindFirstOrThrowArgs} args - Arguments to find a Bools + * @example + * // Get one Bools + * const bools = await prisma.bools.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirstOrThrow( + args?: SelectSubset + ): Prisma__BoolsClient> + + /** + * Find zero or more Bools 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 {BoolsFindManyArgs=} args - Arguments to filter and select certain fields only. + * @example + * // Get all Bools + * const bools = await prisma.bools.findMany() + * + * // Get first 10 Bools + * const bools = await prisma.bools.findMany({ take: 10 }) + * + * // Only select the `id` + * const boolsWithIdOnly = await prisma.bools.findMany({ select: { id: true } }) + * + **/ + findMany( + args?: SelectSubset + ): Prisma.PrismaPromise>> + + /** + * Create a Bools. + * @param {BoolsCreateArgs} args - Arguments to create a Bools. + * @example + * // Create one Bools + * const Bools = await prisma.bools.create({ + * data: { + * // ... data to create a Bools + * } + * }) + * + **/ + create( + args: SelectSubset + ): Prisma__BoolsClient> + + /** + * Create many Bools. + * @param {BoolsCreateManyArgs} args - Arguments to create many Bools. + * @example + * // Create many Bools + * const bools = await prisma.bools.createMany({ + * data: { + * // ... provide data here + * } + * }) + * + **/ + createMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Delete a Bools. + * @param {BoolsDeleteArgs} args - Arguments to delete one Bools. + * @example + * // Delete one Bools + * const Bools = await prisma.bools.delete({ + * where: { + * // ... filter to delete one Bools + * } + * }) + * + **/ + delete( + args: SelectSubset + ): Prisma__BoolsClient> + + /** + * Update one Bools. + * @param {BoolsUpdateArgs} args - Arguments to update one Bools. + * @example + * // Update one Bools + * const bools = await prisma.bools.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + update( + args: SelectSubset + ): Prisma__BoolsClient> + + /** + * Delete zero or more Bools. + * @param {BoolsDeleteManyArgs} args - Arguments to filter Bools to delete. + * @example + * // Delete a few Bools + * const { count } = await prisma.bools.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + **/ + deleteMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Update zero or more Bools. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BoolsUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Bools + * const bools = await prisma.bools.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + updateMany( + args: SelectSubset + ): Prisma.PrismaPromise + + /** + * Create or update one Bools. + * @param {BoolsUpsertArgs} args - Arguments to update or create a Bools. + * @example + * // Update or create a Bools + * const bools = await prisma.bools.upsert({ + * create: { + * // ... data to create a Bools + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Bools we want to update + * } + * }) + **/ + upsert( + args: SelectSubset + ): Prisma__BoolsClient> + + /** + * Count the number of Bools. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BoolsCountArgs} args - Arguments to filter Bools to count. + * @example + * // Count the number of Bools + * const count = await prisma.bools.count({ + * where: { + * // ... the filter for the Bools we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends _Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Bools. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BoolsAggregateArgs} 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 Bools. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BoolsGroupByArgs} 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 BoolsGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: BoolsGroupByArgs['orderBy'] } + : { orderBy?: BoolsGroupByArgs['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 ? GetBoolsGroupByPayload : Prisma.PrismaPromise + + } + + /** + * The delegate class that acts as a "Promise-like" for Bools. + * 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__BoolsClient implements Prisma.PrismaPromise { + private readonly _dmmf; + private readonly _queryType; + private readonly _rootField; + private readonly _clientMethod; + private readonly _args; + private readonly _dataPath; + private readonly _errorFormat; + private readonly _measurePerformance?; + private _isList; + private _callsite; + private _requestPromise?; + readonly [Symbol.toStringTag]: 'PrismaPromise'; + constructor(_dmmf: runtime.DMMFClass, _queryType: 'query' | 'mutation', _rootField: string, _clientMethod: string, _args: any, _dataPath: string[], _errorFormat: ErrorFormat, _measurePerformance?: boolean | undefined, _isList?: boolean); + + + private get _document(); + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(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 + + /** + * Bools base type for findUnique actions + */ + export type BoolsFindUniqueArgsBase = { + /** + * Select specific fields to fetch from the Bools + */ + select?: BoolsSelect | null + /** + * Filter, which Bools to fetch. + */ + where: BoolsWhereUniqueInput + } + + /** + * Bools findUnique + */ + export interface BoolsFindUniqueArgs extends BoolsFindUniqueArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findUniqueOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Bools findUniqueOrThrow + */ + export type BoolsFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Bools + */ + select?: BoolsSelect | null + /** + * Filter, which Bools to fetch. + */ + where: BoolsWhereUniqueInput + } + + + /** + * Bools base type for findFirst actions + */ + export type BoolsFindFirstArgsBase = { + /** + * Select specific fields to fetch from the Bools + */ + select?: BoolsSelect | null + /** + * Filter, which Bools to fetch. + */ + where?: BoolsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Bools 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 Bools. + */ + cursor?: BoolsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Bools 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` Bools. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Bools. + */ + distinct?: Enumerable + } + + /** + * Bools findFirst + */ + export interface BoolsFindFirstArgs extends BoolsFindFirstArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findFirstOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Bools findFirstOrThrow + */ + export type BoolsFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Bools + */ + select?: BoolsSelect | null + /** + * Filter, which Bools to fetch. + */ + where?: BoolsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Bools 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 Bools. + */ + cursor?: BoolsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Bools 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` Bools. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Bools. + */ + distinct?: Enumerable + } + + + /** + * Bools findMany + */ + export type BoolsFindManyArgs = { + /** + * Select specific fields to fetch from the Bools + */ + select?: BoolsSelect | null + /** + * Filter, which Bools to fetch. + */ + where?: BoolsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Bools 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 Bools. + */ + cursor?: BoolsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Bools 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` Bools. + */ + skip?: number + distinct?: Enumerable + } + + + /** + * Bools create + */ + export type BoolsCreateArgs = { + /** + * Select specific fields to fetch from the Bools + */ + select?: BoolsSelect | null + /** + * The data needed to create a Bools. + */ + data: XOR + } + + + /** + * Bools createMany + */ + export type BoolsCreateManyArgs = { + /** + * The data used to create many Bools. + */ + data: Enumerable + skipDuplicates?: boolean + } + + + /** + * Bools update + */ + export type BoolsUpdateArgs = { + /** + * Select specific fields to fetch from the Bools + */ + select?: BoolsSelect | null + /** + * The data needed to update a Bools. + */ + data: XOR + /** + * Choose, which Bools to update. + */ + where: BoolsWhereUniqueInput + } + + + /** + * Bools updateMany + */ + export type BoolsUpdateManyArgs = { + /** + * The data used to update Bools. + */ + data: XOR + /** + * Filter which Bools to update + */ + where?: BoolsWhereInput + } + + + /** + * Bools upsert + */ + export type BoolsUpsertArgs = { + /** + * Select specific fields to fetch from the Bools + */ + select?: BoolsSelect | null + /** + * The filter to search for the Bools to update in case it exists. + */ + where: BoolsWhereUniqueInput + /** + * In case the Bools found by the `where` argument doesn't exist, create a new Bools with this data. + */ + create: XOR + /** + * In case the Bools was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + + /** + * Bools delete + */ + export type BoolsDeleteArgs = { + /** + * Select specific fields to fetch from the Bools + */ + select?: BoolsSelect | null + /** + * Filter which Bools to delete. + */ + where: BoolsWhereUniqueInput + } + + + /** + * Bools deleteMany + */ + export type BoolsDeleteManyArgs = { + /** + * Filter which Bools to delete + */ + where?: BoolsWhereInput + } + + + /** + * Bools without action + */ + export type BoolsArgs = { + /** + * Select specific fields to fetch from the Bools + */ + select?: BoolsSelect | null + } + + + + /** + * Model Uuids + */ + + + export type AggregateUuids = { + _count: UuidsCountAggregateOutputType | null + _min: UuidsMinAggregateOutputType | null + _max: UuidsMaxAggregateOutputType | null + } + + export type UuidsMinAggregateOutputType = { + id: string | null + } + + export type UuidsMaxAggregateOutputType = { + id: string | null + } + + export type UuidsCountAggregateOutputType = { + id: number + _all: number + } + + + export type UuidsMinAggregateInputType = { + id?: true + } + + export type UuidsMaxAggregateInputType = { + id?: true + } + + export type UuidsCountAggregateInputType = { + id?: true + _all?: true + } + + export type UuidsAggregateArgs = { + /** + * Filter which Uuids to aggregate. + */ + where?: UuidsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Uuids 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?: UuidsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Uuids 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` Uuids. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Uuids + **/ + _count?: true | UuidsCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: UuidsMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: UuidsMaxAggregateInputType + } + + export type GetUuidsAggregateType = { + [P in keyof T & keyof AggregateUuids]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type UuidsGroupByArgs = { + where?: UuidsWhereInput + orderBy?: Enumerable + by: UuidsScalarFieldEnum[] + having?: UuidsScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: UuidsCountAggregateInputType | true + _min?: UuidsMinAggregateInputType + _max?: UuidsMaxAggregateInputType + } + + + export type UuidsGroupByOutputType = { + id: string + _count: UuidsCountAggregateOutputType | null + _min: UuidsMinAggregateOutputType | null + _max: UuidsMaxAggregateOutputType | null + } + + type GetUuidsGroupByPayload = Prisma.PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof UuidsGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type UuidsSelect = { + id?: boolean + } + + + export type UuidsGetPayload = + S extends { select: any, include: any } ? 'Please either choose `select` or `include`' : + S extends true ? Uuids : + S extends undefined ? never : + S extends { include: any } & (UuidsArgs | UuidsFindManyArgs) + ? Uuids + : S extends { select: any } & (UuidsArgs | UuidsFindManyArgs) + ? { + [P in TruthyKeys]: + P extends keyof Uuids ? Uuids[P] : never + } + : Uuids + + + type UuidsCountArgs = + Omit & { + select?: UuidsCountAggregateInputType | true + } + + export interface UuidsDelegate { + + /** + * Find zero or one Uuids that matches the filter. + * @param {UuidsFindUniqueArgs} args - Arguments to find a Uuids + * @example + * // Get one Uuids + * const uuids = await prisma.uuids.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUnique( + args: SelectSubset + ): HasReject extends True ? Prisma__UuidsClient> : Prisma__UuidsClient | null, null> + + /** + * Find one Uuids that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {UuidsFindUniqueOrThrowArgs} args - Arguments to find a Uuids + * @example + * // Get one Uuids + * const uuids = await prisma.uuids.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUniqueOrThrow( + args?: SelectSubset + ): Prisma__UuidsClient> + + /** + * Find the first Uuids 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 {UuidsFindFirstArgs} args - Arguments to find a Uuids + * @example + * // Get one Uuids + * const uuids = await prisma.uuids.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirst( + args?: SelectSubset + ): HasReject extends True ? Prisma__UuidsClient> : Prisma__UuidsClient | null, null> + + /** + * Find the first Uuids 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 {UuidsFindFirstOrThrowArgs} args - Arguments to find a Uuids + * @example + * // Get one Uuids + * const uuids = await prisma.uuids.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirstOrThrow( + args?: SelectSubset + ): Prisma__UuidsClient> + + /** + * Find zero or more Uuids 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 {UuidsFindManyArgs=} args - Arguments to filter and select certain fields only. + * @example + * // Get all Uuids + * const uuids = await prisma.uuids.findMany() + * + * // Get first 10 Uuids + * const uuids = await prisma.uuids.findMany({ take: 10 }) + * + * // Only select the `id` + * const uuidsWithIdOnly = await prisma.uuids.findMany({ select: { id: true } }) + * + **/ + findMany( + args?: SelectSubset + ): Prisma.PrismaPromise>> + + /** + * Create a Uuids. + * @param {UuidsCreateArgs} args - Arguments to create a Uuids. + * @example + * // Create one Uuids + * const Uuids = await prisma.uuids.create({ + * data: { + * // ... data to create a Uuids + * } + * }) + * + **/ + create( + args: SelectSubset + ): Prisma__UuidsClient> + + /** + * Create many Uuids. + * @param {UuidsCreateManyArgs} args - Arguments to create many Uuids. + * @example + * // Create many Uuids + * const uuids = await prisma.uuids.createMany({ + * data: { + * // ... provide data here + * } + * }) + * + **/ + createMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Delete a Uuids. + * @param {UuidsDeleteArgs} args - Arguments to delete one Uuids. + * @example + * // Delete one Uuids + * const Uuids = await prisma.uuids.delete({ + * where: { + * // ... filter to delete one Uuids + * } + * }) + * + **/ + delete( + args: SelectSubset + ): Prisma__UuidsClient> + + /** + * Update one Uuids. + * @param {UuidsUpdateArgs} args - Arguments to update one Uuids. + * @example + * // Update one Uuids + * const uuids = await prisma.uuids.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + update( + args: SelectSubset + ): Prisma__UuidsClient> + + /** + * Delete zero or more Uuids. + * @param {UuidsDeleteManyArgs} args - Arguments to filter Uuids to delete. + * @example + * // Delete a few Uuids + * const { count } = await prisma.uuids.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + **/ + deleteMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Update zero or more Uuids. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UuidsUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Uuids + * const uuids = await prisma.uuids.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + updateMany( + args: SelectSubset + ): Prisma.PrismaPromise + + /** + * Create or update one Uuids. + * @param {UuidsUpsertArgs} args - Arguments to update or create a Uuids. + * @example + * // Update or create a Uuids + * const uuids = await prisma.uuids.upsert({ + * create: { + * // ... data to create a Uuids + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Uuids we want to update + * } + * }) + **/ + upsert( + args: SelectSubset + ): Prisma__UuidsClient> + + /** + * Count the number of Uuids. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UuidsCountArgs} args - Arguments to filter Uuids to count. + * @example + * // Count the number of Uuids + * const count = await prisma.uuids.count({ + * where: { + * // ... the filter for the Uuids we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends _Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Uuids. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UuidsAggregateArgs} 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 Uuids. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UuidsGroupByArgs} 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 UuidsGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: UuidsGroupByArgs['orderBy'] } + : { orderBy?: UuidsGroupByArgs['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 ? GetUuidsGroupByPayload : Prisma.PrismaPromise + + } + + /** + * The delegate class that acts as a "Promise-like" for Uuids. + * 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__UuidsClient implements Prisma.PrismaPromise { + private readonly _dmmf; + private readonly _queryType; + private readonly _rootField; + private readonly _clientMethod; + private readonly _args; + private readonly _dataPath; + private readonly _errorFormat; + private readonly _measurePerformance?; + private _isList; + private _callsite; + private _requestPromise?; + readonly [Symbol.toStringTag]: 'PrismaPromise'; + constructor(_dmmf: runtime.DMMFClass, _queryType: 'query' | 'mutation', _rootField: string, _clientMethod: string, _args: any, _dataPath: string[], _errorFormat: ErrorFormat, _measurePerformance?: boolean | undefined, _isList?: boolean); + + + private get _document(); + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(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 + + /** + * Uuids base type for findUnique actions + */ + export type UuidsFindUniqueArgsBase = { + /** + * Select specific fields to fetch from the Uuids + */ + select?: UuidsSelect | null + /** + * Filter, which Uuids to fetch. + */ + where: UuidsWhereUniqueInput + } + + /** + * Uuids findUnique + */ + export interface UuidsFindUniqueArgs extends UuidsFindUniqueArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findUniqueOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Uuids findUniqueOrThrow + */ + export type UuidsFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Uuids + */ + select?: UuidsSelect | null + /** + * Filter, which Uuids to fetch. + */ + where: UuidsWhereUniqueInput + } + + + /** + * Uuids base type for findFirst actions + */ + export type UuidsFindFirstArgsBase = { + /** + * Select specific fields to fetch from the Uuids + */ + select?: UuidsSelect | null + /** + * Filter, which Uuids to fetch. + */ + where?: UuidsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Uuids 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 Uuids. + */ + cursor?: UuidsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Uuids 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` Uuids. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Uuids. + */ + distinct?: Enumerable + } + + /** + * Uuids findFirst + */ + export interface UuidsFindFirstArgs extends UuidsFindFirstArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findFirstOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Uuids findFirstOrThrow + */ + export type UuidsFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Uuids + */ + select?: UuidsSelect | null + /** + * Filter, which Uuids to fetch. + */ + where?: UuidsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Uuids 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 Uuids. + */ + cursor?: UuidsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Uuids 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` Uuids. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Uuids. + */ + distinct?: Enumerable + } + + + /** + * Uuids findMany + */ + export type UuidsFindManyArgs = { + /** + * Select specific fields to fetch from the Uuids + */ + select?: UuidsSelect | null + /** + * Filter, which Uuids to fetch. + */ + where?: UuidsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Uuids 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 Uuids. + */ + cursor?: UuidsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Uuids 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` Uuids. + */ + skip?: number + distinct?: Enumerable + } + + + /** + * Uuids create + */ + export type UuidsCreateArgs = { + /** + * Select specific fields to fetch from the Uuids + */ + select?: UuidsSelect | null + /** + * The data needed to create a Uuids. + */ + data: XOR + } + + + /** + * Uuids createMany + */ + export type UuidsCreateManyArgs = { + /** + * The data used to create many Uuids. + */ + data: Enumerable + skipDuplicates?: boolean + } + + + /** + * Uuids update + */ + export type UuidsUpdateArgs = { + /** + * Select specific fields to fetch from the Uuids + */ + select?: UuidsSelect | null + /** + * The data needed to update a Uuids. + */ + data: XOR + /** + * Choose, which Uuids to update. + */ + where: UuidsWhereUniqueInput + } + + + /** + * Uuids updateMany + */ + export type UuidsUpdateManyArgs = { + /** + * The data used to update Uuids. + */ + data: XOR + /** + * Filter which Uuids to update + */ + where?: UuidsWhereInput + } + + + /** + * Uuids upsert + */ + export type UuidsUpsertArgs = { + /** + * Select specific fields to fetch from the Uuids + */ + select?: UuidsSelect | null + /** + * The filter to search for the Uuids to update in case it exists. + */ + where: UuidsWhereUniqueInput + /** + * In case the Uuids found by the `where` argument doesn't exist, create a new Uuids with this data. + */ + create: XOR + /** + * In case the Uuids was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + + /** + * Uuids delete + */ + export type UuidsDeleteArgs = { + /** + * Select specific fields to fetch from the Uuids + */ + select?: UuidsSelect | null + /** + * Filter which Uuids to delete. + */ + where: UuidsWhereUniqueInput + } + + + /** + * Uuids deleteMany + */ + export type UuidsDeleteManyArgs = { + /** + * Filter which Uuids to delete + */ + where?: UuidsWhereInput + } + + + /** + * Uuids without action + */ + export type UuidsArgs = { + /** + * Select specific fields to fetch from the Uuids + */ + select?: UuidsSelect | null + } + + + + /** + * Model Ints + */ + + + export type AggregateInts = { + _count: IntsCountAggregateOutputType | null + _avg: IntsAvgAggregateOutputType | null + _sum: IntsSumAggregateOutputType | null + _min: IntsMinAggregateOutputType | null + _max: IntsMaxAggregateOutputType | null + } + + export type IntsAvgAggregateOutputType = { + i2: number | null + i4: number | null + i8: number | null + } + + export type IntsSumAggregateOutputType = { + i2: number | null + i4: number | null + i8: bigint | null + } + + export type IntsMinAggregateOutputType = { + id: string | null + i2: number | null + i4: number | null + i8: bigint | null + } + + export type IntsMaxAggregateOutputType = { + id: string | null + i2: number | null + i4: number | null + i8: bigint | null + } + + export type IntsCountAggregateOutputType = { + id: number + i2: number + i4: number + i8: number + _all: number + } + + + export type IntsAvgAggregateInputType = { + i2?: true + i4?: true + i8?: true + } + + export type IntsSumAggregateInputType = { + i2?: true + i4?: true + i8?: true + } + + export type IntsMinAggregateInputType = { + id?: true + i2?: true + i4?: true + i8?: true + } + + export type IntsMaxAggregateInputType = { + id?: true + i2?: true + i4?: true + i8?: true + } + + export type IntsCountAggregateInputType = { + id?: true + i2?: true + i4?: true + i8?: true + _all?: true + } + + export type IntsAggregateArgs = { + /** + * Filter which Ints to aggregate. + */ + where?: IntsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Ints 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?: IntsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Ints 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` Ints. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Ints + **/ + _count?: true | IntsCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: IntsAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: IntsSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: IntsMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: IntsMaxAggregateInputType + } + + export type GetIntsAggregateType = { + [P in keyof T & keyof AggregateInts]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type IntsGroupByArgs = { + where?: IntsWhereInput + orderBy?: Enumerable + by: IntsScalarFieldEnum[] + having?: IntsScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: IntsCountAggregateInputType | true + _avg?: IntsAvgAggregateInputType + _sum?: IntsSumAggregateInputType + _min?: IntsMinAggregateInputType + _max?: IntsMaxAggregateInputType + } + + + export type IntsGroupByOutputType = { + id: string + i2: number | null + i4: number | null + i8: bigint | null + _count: IntsCountAggregateOutputType | null + _avg: IntsAvgAggregateOutputType | null + _sum: IntsSumAggregateOutputType | null + _min: IntsMinAggregateOutputType | null + _max: IntsMaxAggregateOutputType | null + } + + type GetIntsGroupByPayload = Prisma.PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof IntsGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type IntsSelect = { + id?: boolean + i2?: boolean + i4?: boolean + i8?: boolean + } + + + export type IntsGetPayload = + S extends { select: any, include: any } ? 'Please either choose `select` or `include`' : + S extends true ? Ints : + S extends undefined ? never : + S extends { include: any } & (IntsArgs | IntsFindManyArgs) + ? Ints + : S extends { select: any } & (IntsArgs | IntsFindManyArgs) + ? { + [P in TruthyKeys]: + P extends keyof Ints ? Ints[P] : never + } + : Ints + + + type IntsCountArgs = + Omit & { + select?: IntsCountAggregateInputType | true + } + + export interface IntsDelegate { + + /** + * Find zero or one Ints that matches the filter. + * @param {IntsFindUniqueArgs} args - Arguments to find a Ints + * @example + * // Get one Ints + * const ints = await prisma.ints.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUnique( + args: SelectSubset + ): HasReject extends True ? Prisma__IntsClient> : Prisma__IntsClient | null, null> + + /** + * Find one Ints that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {IntsFindUniqueOrThrowArgs} args - Arguments to find a Ints + * @example + * // Get one Ints + * const ints = await prisma.ints.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUniqueOrThrow( + args?: SelectSubset + ): Prisma__IntsClient> + + /** + * Find the first Ints 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 {IntsFindFirstArgs} args - Arguments to find a Ints + * @example + * // Get one Ints + * const ints = await prisma.ints.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirst( + args?: SelectSubset + ): HasReject extends True ? Prisma__IntsClient> : Prisma__IntsClient | null, null> + + /** + * Find the first Ints 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 {IntsFindFirstOrThrowArgs} args - Arguments to find a Ints + * @example + * // Get one Ints + * const ints = await prisma.ints.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirstOrThrow( + args?: SelectSubset + ): Prisma__IntsClient> + + /** + * Find zero or more Ints 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 {IntsFindManyArgs=} args - Arguments to filter and select certain fields only. + * @example + * // Get all Ints + * const ints = await prisma.ints.findMany() + * + * // Get first 10 Ints + * const ints = await prisma.ints.findMany({ take: 10 }) + * + * // Only select the `id` + * const intsWithIdOnly = await prisma.ints.findMany({ select: { id: true } }) + * + **/ + findMany( + args?: SelectSubset + ): Prisma.PrismaPromise>> + + /** + * Create a Ints. + * @param {IntsCreateArgs} args - Arguments to create a Ints. + * @example + * // Create one Ints + * const Ints = await prisma.ints.create({ + * data: { + * // ... data to create a Ints + * } + * }) + * + **/ + create( + args: SelectSubset + ): Prisma__IntsClient> + + /** + * Create many Ints. + * @param {IntsCreateManyArgs} args - Arguments to create many Ints. + * @example + * // Create many Ints + * const ints = await prisma.ints.createMany({ + * data: { + * // ... provide data here + * } + * }) + * + **/ + createMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Delete a Ints. + * @param {IntsDeleteArgs} args - Arguments to delete one Ints. + * @example + * // Delete one Ints + * const Ints = await prisma.ints.delete({ + * where: { + * // ... filter to delete one Ints + * } + * }) + * + **/ + delete( + args: SelectSubset + ): Prisma__IntsClient> + + /** + * Update one Ints. + * @param {IntsUpdateArgs} args - Arguments to update one Ints. + * @example + * // Update one Ints + * const ints = await prisma.ints.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + update( + args: SelectSubset + ): Prisma__IntsClient> + + /** + * Delete zero or more Ints. + * @param {IntsDeleteManyArgs} args - Arguments to filter Ints to delete. + * @example + * // Delete a few Ints + * const { count } = await prisma.ints.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + **/ + deleteMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Update zero or more Ints. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {IntsUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Ints + * const ints = await prisma.ints.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + updateMany( + args: SelectSubset + ): Prisma.PrismaPromise + + /** + * Create or update one Ints. + * @param {IntsUpsertArgs} args - Arguments to update or create a Ints. + * @example + * // Update or create a Ints + * const ints = await prisma.ints.upsert({ + * create: { + * // ... data to create a Ints + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Ints we want to update + * } + * }) + **/ + upsert( + args: SelectSubset + ): Prisma__IntsClient> + + /** + * Count the number of Ints. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {IntsCountArgs} args - Arguments to filter Ints to count. + * @example + * // Count the number of Ints + * const count = await prisma.ints.count({ + * where: { + * // ... the filter for the Ints we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends _Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Ints. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {IntsAggregateArgs} 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 Ints. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {IntsGroupByArgs} 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 IntsGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: IntsGroupByArgs['orderBy'] } + : { orderBy?: IntsGroupByArgs['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 ? GetIntsGroupByPayload : Prisma.PrismaPromise + + } + + /** + * The delegate class that acts as a "Promise-like" for Ints. + * 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__IntsClient implements Prisma.PrismaPromise { + private readonly _dmmf; + private readonly _queryType; + private readonly _rootField; + private readonly _clientMethod; + private readonly _args; + private readonly _dataPath; + private readonly _errorFormat; + private readonly _measurePerformance?; + private _isList; + private _callsite; + private _requestPromise?; + readonly [Symbol.toStringTag]: 'PrismaPromise'; + constructor(_dmmf: runtime.DMMFClass, _queryType: 'query' | 'mutation', _rootField: string, _clientMethod: string, _args: any, _dataPath: string[], _errorFormat: ErrorFormat, _measurePerformance?: boolean | undefined, _isList?: boolean); + + + private get _document(); + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(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 + + /** + * Ints base type for findUnique actions + */ + export type IntsFindUniqueArgsBase = { + /** + * Select specific fields to fetch from the Ints + */ + select?: IntsSelect | null + /** + * Filter, which Ints to fetch. + */ + where: IntsWhereUniqueInput + } + + /** + * Ints findUnique + */ + export interface IntsFindUniqueArgs extends IntsFindUniqueArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findUniqueOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Ints findUniqueOrThrow + */ + export type IntsFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Ints + */ + select?: IntsSelect | null + /** + * Filter, which Ints to fetch. + */ + where: IntsWhereUniqueInput + } + + + /** + * Ints base type for findFirst actions + */ + export type IntsFindFirstArgsBase = { + /** + * Select specific fields to fetch from the Ints + */ + select?: IntsSelect | null + /** + * Filter, which Ints to fetch. + */ + where?: IntsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Ints 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 Ints. + */ + cursor?: IntsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Ints 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` Ints. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Ints. + */ + distinct?: Enumerable + } + + /** + * Ints findFirst + */ + export interface IntsFindFirstArgs extends IntsFindFirstArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findFirstOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Ints findFirstOrThrow + */ + export type IntsFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Ints + */ + select?: IntsSelect | null + /** + * Filter, which Ints to fetch. + */ + where?: IntsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Ints 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 Ints. + */ + cursor?: IntsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Ints 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` Ints. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Ints. + */ + distinct?: Enumerable + } + + + /** + * Ints findMany + */ + export type IntsFindManyArgs = { + /** + * Select specific fields to fetch from the Ints + */ + select?: IntsSelect | null + /** + * Filter, which Ints to fetch. + */ + where?: IntsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Ints 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 Ints. + */ + cursor?: IntsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Ints 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` Ints. + */ + skip?: number + distinct?: Enumerable + } + + + /** + * Ints create + */ + export type IntsCreateArgs = { + /** + * Select specific fields to fetch from the Ints + */ + select?: IntsSelect | null + /** + * The data needed to create a Ints. + */ + data: XOR + } + + + /** + * Ints createMany + */ + export type IntsCreateManyArgs = { + /** + * The data used to create many Ints. + */ + data: Enumerable + skipDuplicates?: boolean + } + + + /** + * Ints update + */ + export type IntsUpdateArgs = { + /** + * Select specific fields to fetch from the Ints + */ + select?: IntsSelect | null + /** + * The data needed to update a Ints. + */ + data: XOR + /** + * Choose, which Ints to update. + */ + where: IntsWhereUniqueInput + } + + + /** + * Ints updateMany + */ + export type IntsUpdateManyArgs = { + /** + * The data used to update Ints. + */ + data: XOR + /** + * Filter which Ints to update + */ + where?: IntsWhereInput + } + + + /** + * Ints upsert + */ + export type IntsUpsertArgs = { + /** + * Select specific fields to fetch from the Ints + */ + select?: IntsSelect | null + /** + * The filter to search for the Ints to update in case it exists. + */ + where: IntsWhereUniqueInput + /** + * In case the Ints found by the `where` argument doesn't exist, create a new Ints with this data. + */ + create: XOR + /** + * In case the Ints was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + + /** + * Ints delete + */ + export type IntsDeleteArgs = { + /** + * Select specific fields to fetch from the Ints + */ + select?: IntsSelect | null + /** + * Filter which Ints to delete. + */ + where: IntsWhereUniqueInput + } + + + /** + * Ints deleteMany + */ + export type IntsDeleteManyArgs = { + /** + * Filter which Ints to delete + */ + where?: IntsWhereInput + } + + + /** + * Ints without action + */ + export type IntsArgs = { + /** + * Select specific fields to fetch from the Ints + */ + select?: IntsSelect | null + } + + + + /** + * Model Floats + */ + + + export type AggregateFloats = { + _count: FloatsCountAggregateOutputType | null + _avg: FloatsAvgAggregateOutputType | null + _sum: FloatsSumAggregateOutputType | null + _min: FloatsMinAggregateOutputType | null + _max: FloatsMaxAggregateOutputType | null + } + + export type FloatsAvgAggregateOutputType = { + f8: number | null + } + + export type FloatsSumAggregateOutputType = { + f8: number | null + } + + export type FloatsMinAggregateOutputType = { + id: string | null + f8: number | null + } + + export type FloatsMaxAggregateOutputType = { + id: string | null + f8: number | null + } + + export type FloatsCountAggregateOutputType = { + id: number + f8: number + _all: number + } + + + export type FloatsAvgAggregateInputType = { + f8?: true + } + + export type FloatsSumAggregateInputType = { + f8?: true + } + + export type FloatsMinAggregateInputType = { + id?: true + f8?: true + } + + export type FloatsMaxAggregateInputType = { + id?: true + f8?: true + } + + export type FloatsCountAggregateInputType = { + id?: true + f8?: true + _all?: true + } + + export type FloatsAggregateArgs = { + /** + * Filter which Floats to aggregate. + */ + where?: FloatsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Floats 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?: FloatsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Floats 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` Floats. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Floats + **/ + _count?: true | FloatsCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: FloatsAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: FloatsSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: FloatsMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: FloatsMaxAggregateInputType + } + + export type GetFloatsAggregateType = { + [P in keyof T & keyof AggregateFloats]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type FloatsGroupByArgs = { + where?: FloatsWhereInput + orderBy?: Enumerable + by: FloatsScalarFieldEnum[] + having?: FloatsScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: FloatsCountAggregateInputType | true + _avg?: FloatsAvgAggregateInputType + _sum?: FloatsSumAggregateInputType + _min?: FloatsMinAggregateInputType + _max?: FloatsMaxAggregateInputType + } + + + export type FloatsGroupByOutputType = { + id: string + f8: number | null + _count: FloatsCountAggregateOutputType | null + _avg: FloatsAvgAggregateOutputType | null + _sum: FloatsSumAggregateOutputType | null + _min: FloatsMinAggregateOutputType | null + _max: FloatsMaxAggregateOutputType | null + } + + type GetFloatsGroupByPayload = Prisma.PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof FloatsGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type FloatsSelect = { + id?: boolean + f8?: boolean + } + + + export type FloatsGetPayload = + S extends { select: any, include: any } ? 'Please either choose `select` or `include`' : + S extends true ? Floats : + S extends undefined ? never : + S extends { include: any } & (FloatsArgs | FloatsFindManyArgs) + ? Floats + : S extends { select: any } & (FloatsArgs | FloatsFindManyArgs) + ? { + [P in TruthyKeys]: + P extends keyof Floats ? Floats[P] : never + } + : Floats + + + type FloatsCountArgs = + Omit & { + select?: FloatsCountAggregateInputType | true + } + + export interface FloatsDelegate { + + /** + * Find zero or one Floats that matches the filter. + * @param {FloatsFindUniqueArgs} args - Arguments to find a Floats + * @example + * // Get one Floats + * const floats = await prisma.floats.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUnique( + args: SelectSubset + ): HasReject extends True ? Prisma__FloatsClient> : Prisma__FloatsClient | null, null> + + /** + * Find one Floats that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {FloatsFindUniqueOrThrowArgs} args - Arguments to find a Floats + * @example + * // Get one Floats + * const floats = await prisma.floats.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUniqueOrThrow( + args?: SelectSubset + ): Prisma__FloatsClient> + + /** + * Find the first Floats 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 {FloatsFindFirstArgs} args - Arguments to find a Floats + * @example + * // Get one Floats + * const floats = await prisma.floats.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirst( + args?: SelectSubset + ): HasReject extends True ? Prisma__FloatsClient> : Prisma__FloatsClient | null, null> + + /** + * Find the first Floats 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 {FloatsFindFirstOrThrowArgs} args - Arguments to find a Floats + * @example + * // Get one Floats + * const floats = await prisma.floats.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirstOrThrow( + args?: SelectSubset + ): Prisma__FloatsClient> + + /** + * Find zero or more Floats 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 {FloatsFindManyArgs=} args - Arguments to filter and select certain fields only. + * @example + * // Get all Floats + * const floats = await prisma.floats.findMany() + * + * // Get first 10 Floats + * const floats = await prisma.floats.findMany({ take: 10 }) + * + * // Only select the `id` + * const floatsWithIdOnly = await prisma.floats.findMany({ select: { id: true } }) + * + **/ + findMany( + args?: SelectSubset + ): Prisma.PrismaPromise>> + + /** + * Create a Floats. + * @param {FloatsCreateArgs} args - Arguments to create a Floats. + * @example + * // Create one Floats + * const Floats = await prisma.floats.create({ + * data: { + * // ... data to create a Floats + * } + * }) + * + **/ + create( + args: SelectSubset + ): Prisma__FloatsClient> + + /** + * Create many Floats. + * @param {FloatsCreateManyArgs} args - Arguments to create many Floats. + * @example + * // Create many Floats + * const floats = await prisma.floats.createMany({ + * data: { + * // ... provide data here + * } + * }) + * + **/ + createMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Delete a Floats. + * @param {FloatsDeleteArgs} args - Arguments to delete one Floats. + * @example + * // Delete one Floats + * const Floats = await prisma.floats.delete({ + * where: { + * // ... filter to delete one Floats + * } + * }) + * + **/ + delete( + args: SelectSubset + ): Prisma__FloatsClient> + + /** + * Update one Floats. + * @param {FloatsUpdateArgs} args - Arguments to update one Floats. + * @example + * // Update one Floats + * const floats = await prisma.floats.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + update( + args: SelectSubset + ): Prisma__FloatsClient> + + /** + * Delete zero or more Floats. + * @param {FloatsDeleteManyArgs} args - Arguments to filter Floats to delete. + * @example + * // Delete a few Floats + * const { count } = await prisma.floats.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + **/ + deleteMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Update zero or more Floats. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {FloatsUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Floats + * const floats = await prisma.floats.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + updateMany( + args: SelectSubset + ): Prisma.PrismaPromise + + /** + * Create or update one Floats. + * @param {FloatsUpsertArgs} args - Arguments to update or create a Floats. + * @example + * // Update or create a Floats + * const floats = await prisma.floats.upsert({ + * create: { + * // ... data to create a Floats + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Floats we want to update + * } + * }) + **/ + upsert( + args: SelectSubset + ): Prisma__FloatsClient> + + /** + * Count the number of Floats. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {FloatsCountArgs} args - Arguments to filter Floats to count. + * @example + * // Count the number of Floats + * const count = await prisma.floats.count({ + * where: { + * // ... the filter for the Floats we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends _Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Floats. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {FloatsAggregateArgs} 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 Floats. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {FloatsGroupByArgs} 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 FloatsGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: FloatsGroupByArgs['orderBy'] } + : { orderBy?: FloatsGroupByArgs['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 ? GetFloatsGroupByPayload : Prisma.PrismaPromise + + } + + /** + * The delegate class that acts as a "Promise-like" for Floats. + * 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__FloatsClient implements Prisma.PrismaPromise { + private readonly _dmmf; + private readonly _queryType; + private readonly _rootField; + private readonly _clientMethod; + private readonly _args; + private readonly _dataPath; + private readonly _errorFormat; + private readonly _measurePerformance?; + private _isList; + private _callsite; + private _requestPromise?; + readonly [Symbol.toStringTag]: 'PrismaPromise'; + constructor(_dmmf: runtime.DMMFClass, _queryType: 'query' | 'mutation', _rootField: string, _clientMethod: string, _args: any, _dataPath: string[], _errorFormat: ErrorFormat, _measurePerformance?: boolean | undefined, _isList?: boolean); + + + private get _document(); + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(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 + + /** + * Floats base type for findUnique actions + */ + export type FloatsFindUniqueArgsBase = { + /** + * Select specific fields to fetch from the Floats + */ + select?: FloatsSelect | null + /** + * Filter, which Floats to fetch. + */ + where: FloatsWhereUniqueInput + } + + /** + * Floats findUnique + */ + export interface FloatsFindUniqueArgs extends FloatsFindUniqueArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findUniqueOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Floats findUniqueOrThrow + */ + export type FloatsFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Floats + */ + select?: FloatsSelect | null + /** + * Filter, which Floats to fetch. + */ + where: FloatsWhereUniqueInput + } + + + /** + * Floats base type for findFirst actions + */ + export type FloatsFindFirstArgsBase = { + /** + * Select specific fields to fetch from the Floats + */ + select?: FloatsSelect | null + /** + * Filter, which Floats to fetch. + */ + where?: FloatsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Floats 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 Floats. + */ + cursor?: FloatsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Floats 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` Floats. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Floats. + */ + distinct?: Enumerable + } + + /** + * Floats findFirst + */ + export interface FloatsFindFirstArgs extends FloatsFindFirstArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findFirstOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Floats findFirstOrThrow + */ + export type FloatsFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Floats + */ + select?: FloatsSelect | null + /** + * Filter, which Floats to fetch. + */ + where?: FloatsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Floats 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 Floats. + */ + cursor?: FloatsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Floats 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` Floats. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Floats. + */ + distinct?: Enumerable + } + + + /** + * Floats findMany + */ + export type FloatsFindManyArgs = { + /** + * Select specific fields to fetch from the Floats + */ + select?: FloatsSelect | null + /** + * Filter, which Floats to fetch. + */ + where?: FloatsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Floats 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 Floats. + */ + cursor?: FloatsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Floats 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` Floats. + */ + skip?: number + distinct?: Enumerable + } + + + /** + * Floats create + */ + export type FloatsCreateArgs = { + /** + * Select specific fields to fetch from the Floats + */ + select?: FloatsSelect | null + /** + * The data needed to create a Floats. + */ + data: XOR + } + + + /** + * Floats createMany + */ + export type FloatsCreateManyArgs = { + /** + * The data used to create many Floats. + */ + data: Enumerable + skipDuplicates?: boolean + } + + + /** + * Floats update + */ + export type FloatsUpdateArgs = { + /** + * Select specific fields to fetch from the Floats + */ + select?: FloatsSelect | null + /** + * The data needed to update a Floats. + */ + data: XOR + /** + * Choose, which Floats to update. + */ + where: FloatsWhereUniqueInput + } + + + /** + * Floats updateMany + */ + export type FloatsUpdateManyArgs = { + /** + * The data used to update Floats. + */ + data: XOR + /** + * Filter which Floats to update + */ + where?: FloatsWhereInput + } + + + /** + * Floats upsert + */ + export type FloatsUpsertArgs = { + /** + * Select specific fields to fetch from the Floats + */ + select?: FloatsSelect | null + /** + * The filter to search for the Floats to update in case it exists. + */ + where: FloatsWhereUniqueInput + /** + * In case the Floats found by the `where` argument doesn't exist, create a new Floats with this data. + */ + create: XOR + /** + * In case the Floats was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + + /** + * Floats delete + */ + export type FloatsDeleteArgs = { + /** + * Select specific fields to fetch from the Floats + */ + select?: FloatsSelect | null + /** + * Filter which Floats to delete. + */ + where: FloatsWhereUniqueInput + } + + + /** + * Floats deleteMany + */ + export type FloatsDeleteManyArgs = { + /** + * Filter which Floats to delete + */ + where?: FloatsWhereInput + } + + + /** + * Floats without action + */ + export type FloatsArgs = { + /** + * Select specific fields to fetch from the Floats + */ + select?: FloatsSelect | null + } + + + + /** + * Enums + */ + + export const BoolsScalarFieldEnum: { + id: 'id', + b: 'b' + }; + + export type BoolsScalarFieldEnum = (typeof BoolsScalarFieldEnum)[keyof typeof BoolsScalarFieldEnum] + + + export const DatetimesScalarFieldEnum: { + id: 'id', + d: 'd', + t: 't' + }; + + export type DatetimesScalarFieldEnum = (typeof DatetimesScalarFieldEnum)[keyof typeof DatetimesScalarFieldEnum] + + + export const FloatsScalarFieldEnum: { + id: 'id', + f8: 'f8' + }; + + export type FloatsScalarFieldEnum = (typeof FloatsScalarFieldEnum)[keyof typeof FloatsScalarFieldEnum] + + + export const IntsScalarFieldEnum: { + id: 'id', + i2: 'i2', + i4: 'i4', + i8: 'i8' + }; + + export type IntsScalarFieldEnum = (typeof IntsScalarFieldEnum)[keyof typeof IntsScalarFieldEnum] + + + export const ItemsScalarFieldEnum: { + id: 'id', + content: 'content', + content_text_null: 'content_text_null', + content_text_null_default: 'content_text_null_default', + intvalue_null: 'intvalue_null', + intvalue_null_default: 'intvalue_null_default' + }; + + export type ItemsScalarFieldEnum = (typeof ItemsScalarFieldEnum)[keyof typeof ItemsScalarFieldEnum] + + + export const OtherItemsScalarFieldEnum: { + id: 'id', + content: 'content', + item_id: 'item_id' + }; + + export type OtherItemsScalarFieldEnum = (typeof OtherItemsScalarFieldEnum)[keyof typeof OtherItemsScalarFieldEnum] + + + export const QueryMode: { + default: 'default', + insensitive: 'insensitive' + }; + + export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode] + + + export const SortOrder: { + asc: 'asc', + desc: 'desc' + }; + + export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] + + + export const TimestampsScalarFieldEnum: { + id: 'id', + created_at: 'created_at', + updated_at: 'updated_at' + }; + + export type TimestampsScalarFieldEnum = (typeof TimestampsScalarFieldEnum)[keyof typeof TimestampsScalarFieldEnum] + + + export const TransactionIsolationLevel: { + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', + Serializable: 'Serializable' + }; + + export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] + + + export const UuidsScalarFieldEnum: { + id: 'id' + }; + + export type UuidsScalarFieldEnum = (typeof UuidsScalarFieldEnum)[keyof typeof UuidsScalarFieldEnum] + + + /** + * Deep Input Types + */ + + + export type ItemsWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + content?: StringFilter | string + content_text_null?: StringNullableFilter | string | null + content_text_null_default?: StringNullableFilter | string | null + intvalue_null?: IntNullableFilter | number | null + intvalue_null_default?: IntNullableFilter | number | null + other_items?: XOR | null + } + + export type ItemsOrderByWithRelationInput = { + id?: SortOrder + content?: SortOrder + content_text_null?: SortOrder + content_text_null_default?: SortOrder + intvalue_null?: SortOrder + intvalue_null_default?: SortOrder + other_items?: OtherItemsOrderByWithRelationInput + } + + export type ItemsWhereUniqueInput = { + id?: string + } + + export type ItemsOrderByWithAggregationInput = { + id?: SortOrder + content?: SortOrder + content_text_null?: SortOrder + content_text_null_default?: SortOrder + intvalue_null?: SortOrder + intvalue_null_default?: SortOrder + _count?: ItemsCountOrderByAggregateInput + _avg?: ItemsAvgOrderByAggregateInput + _max?: ItemsMaxOrderByAggregateInput + _min?: ItemsMinOrderByAggregateInput + _sum?: ItemsSumOrderByAggregateInput + } + + export type ItemsScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringWithAggregatesFilter | string + content?: StringWithAggregatesFilter | string + content_text_null?: StringNullableWithAggregatesFilter | string | null + content_text_null_default?: StringNullableWithAggregatesFilter | string | null + intvalue_null?: IntNullableWithAggregatesFilter | number | null + intvalue_null_default?: IntNullableWithAggregatesFilter | number | null + } + + export type OtherItemsWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + content?: StringFilter | string + item_id?: StringNullableFilter | string | null + items?: XOR | null + } + + export type OtherItemsOrderByWithRelationInput = { + id?: SortOrder + content?: SortOrder + item_id?: SortOrder + items?: ItemsOrderByWithRelationInput + } + + export type OtherItemsWhereUniqueInput = { + id?: string + item_id?: string + } + + export type OtherItemsOrderByWithAggregationInput = { + id?: SortOrder + content?: SortOrder + item_id?: SortOrder + _count?: OtherItemsCountOrderByAggregateInput + _max?: OtherItemsMaxOrderByAggregateInput + _min?: OtherItemsMinOrderByAggregateInput + } + + export type OtherItemsScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringWithAggregatesFilter | string + content?: StringWithAggregatesFilter | string + item_id?: StringNullableWithAggregatesFilter | string | null + } + + export type TimestampsWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + created_at?: DateTimeFilter | Date | string + updated_at?: DateTimeFilter | Date | string + } + + export type TimestampsOrderByWithRelationInput = { + id?: SortOrder + created_at?: SortOrder + updated_at?: SortOrder + } + + export type TimestampsWhereUniqueInput = { + id?: string + } + + export type TimestampsOrderByWithAggregationInput = { + id?: SortOrder + created_at?: SortOrder + updated_at?: SortOrder + _count?: TimestampsCountOrderByAggregateInput + _max?: TimestampsMaxOrderByAggregateInput + _min?: TimestampsMinOrderByAggregateInput + } + + export type TimestampsScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringWithAggregatesFilter | string + created_at?: DateTimeWithAggregatesFilter | Date | string + updated_at?: DateTimeWithAggregatesFilter | Date | string + } + + export type DatetimesWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + d?: DateTimeFilter | Date | string + t?: DateTimeFilter | Date | string + } + + export type DatetimesOrderByWithRelationInput = { + id?: SortOrder + d?: SortOrder + t?: SortOrder + } + + export type DatetimesWhereUniqueInput = { + id?: string + } + + export type DatetimesOrderByWithAggregationInput = { + id?: SortOrder + d?: SortOrder + t?: SortOrder + _count?: DatetimesCountOrderByAggregateInput + _max?: DatetimesMaxOrderByAggregateInput + _min?: DatetimesMinOrderByAggregateInput + } + + export type DatetimesScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringWithAggregatesFilter | string + d?: DateTimeWithAggregatesFilter | Date | string + t?: DateTimeWithAggregatesFilter | Date | string + } + + export type BoolsWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + b?: BoolNullableFilter | boolean | null + } + + export type BoolsOrderByWithRelationInput = { + id?: SortOrder + b?: SortOrder + } + + export type BoolsWhereUniqueInput = { + id?: string + } + + export type BoolsOrderByWithAggregationInput = { + id?: SortOrder + b?: SortOrder + _count?: BoolsCountOrderByAggregateInput + _max?: BoolsMaxOrderByAggregateInput + _min?: BoolsMinOrderByAggregateInput + } + + export type BoolsScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringWithAggregatesFilter | string + b?: BoolNullableWithAggregatesFilter | boolean | null + } + + export type UuidsWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: UuidFilter | string + } + + export type UuidsOrderByWithRelationInput = { + id?: SortOrder + } + + export type UuidsWhereUniqueInput = { + id?: string + } + + export type UuidsOrderByWithAggregationInput = { + id?: SortOrder + _count?: UuidsCountOrderByAggregateInput + _max?: UuidsMaxOrderByAggregateInput + _min?: UuidsMinOrderByAggregateInput + } + + export type UuidsScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: UuidWithAggregatesFilter | string + } + + export type IntsWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + i2?: IntNullableFilter | number | null + i4?: IntNullableFilter | number | null + i8?: BigIntNullableFilter | bigint | number | null + } + + export type IntsOrderByWithRelationInput = { + id?: SortOrder + i2?: SortOrder + i4?: SortOrder + i8?: SortOrder + } + + export type IntsWhereUniqueInput = { + id?: string + } + + export type IntsOrderByWithAggregationInput = { + id?: SortOrder + i2?: SortOrder + i4?: SortOrder + i8?: SortOrder + _count?: IntsCountOrderByAggregateInput + _avg?: IntsAvgOrderByAggregateInput + _max?: IntsMaxOrderByAggregateInput + _min?: IntsMinOrderByAggregateInput + _sum?: IntsSumOrderByAggregateInput + } + + export type IntsScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringWithAggregatesFilter | string + i2?: IntNullableWithAggregatesFilter | number | null + i4?: IntNullableWithAggregatesFilter | number | null + i8?: BigIntNullableWithAggregatesFilter | bigint | number | null + } + + export type FloatsWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + f8?: FloatNullableFilter | number | null + } + + export type FloatsOrderByWithRelationInput = { + id?: SortOrder + f8?: SortOrder + } + + export type FloatsWhereUniqueInput = { + id?: string + } + + export type FloatsOrderByWithAggregationInput = { + id?: SortOrder + f8?: SortOrder + _count?: FloatsCountOrderByAggregateInput + _avg?: FloatsAvgOrderByAggregateInput + _max?: FloatsMaxOrderByAggregateInput + _min?: FloatsMinOrderByAggregateInput + _sum?: FloatsSumOrderByAggregateInput + } + + export type FloatsScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringWithAggregatesFilter | string + f8?: FloatNullableWithAggregatesFilter | number | null + } + + export type ItemsCreateInput = { + id: string + content: string + content_text_null?: string | null + content_text_null_default?: string | null + intvalue_null?: number | null + intvalue_null_default?: number | null + other_items?: OtherItemsCreateNestedOneWithoutItemsInput + } + + export type ItemsUncheckedCreateInput = { + id: string + content: string + content_text_null?: string | null + content_text_null_default?: string | null + intvalue_null?: number | null + intvalue_null_default?: number | null + other_items?: OtherItemsUncheckedCreateNestedOneWithoutItemsInput + } + + export type ItemsUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + content?: StringFieldUpdateOperationsInput | string + content_text_null?: NullableStringFieldUpdateOperationsInput | string | null + content_text_null_default?: NullableStringFieldUpdateOperationsInput | string | null + intvalue_null?: NullableIntFieldUpdateOperationsInput | number | null + intvalue_null_default?: NullableIntFieldUpdateOperationsInput | number | null + other_items?: OtherItemsUpdateOneWithoutItemsNestedInput + } + + export type ItemsUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + content?: StringFieldUpdateOperationsInput | string + content_text_null?: NullableStringFieldUpdateOperationsInput | string | null + content_text_null_default?: NullableStringFieldUpdateOperationsInput | string | null + intvalue_null?: NullableIntFieldUpdateOperationsInput | number | null + intvalue_null_default?: NullableIntFieldUpdateOperationsInput | number | null + other_items?: OtherItemsUncheckedUpdateOneWithoutItemsNestedInput + } + + export type ItemsCreateManyInput = { + id: string + content: string + content_text_null?: string | null + content_text_null_default?: string | null + intvalue_null?: number | null + intvalue_null_default?: number | null + } + + export type ItemsUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + content?: StringFieldUpdateOperationsInput | string + content_text_null?: NullableStringFieldUpdateOperationsInput | string | null + content_text_null_default?: NullableStringFieldUpdateOperationsInput | string | null + intvalue_null?: NullableIntFieldUpdateOperationsInput | number | null + intvalue_null_default?: NullableIntFieldUpdateOperationsInput | number | null + } + + export type ItemsUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + content?: StringFieldUpdateOperationsInput | string + content_text_null?: NullableStringFieldUpdateOperationsInput | string | null + content_text_null_default?: NullableStringFieldUpdateOperationsInput | string | null + intvalue_null?: NullableIntFieldUpdateOperationsInput | number | null + intvalue_null_default?: NullableIntFieldUpdateOperationsInput | number | null + } + + export type OtherItemsCreateInput = { + id: string + content: string + items?: ItemsCreateNestedOneWithoutOther_itemsInput + } + + export type OtherItemsUncheckedCreateInput = { + id: string + content: string + item_id?: string | null + } + + export type OtherItemsUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + content?: StringFieldUpdateOperationsInput | string + items?: ItemsUpdateOneWithoutOther_itemsNestedInput + } + + export type OtherItemsUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + content?: StringFieldUpdateOperationsInput | string + item_id?: NullableStringFieldUpdateOperationsInput | string | null + } + + export type OtherItemsCreateManyInput = { + id: string + content: string + item_id?: string | null + } + + export type OtherItemsUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + content?: StringFieldUpdateOperationsInput | string + } + + export type OtherItemsUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + content?: StringFieldUpdateOperationsInput | string + item_id?: NullableStringFieldUpdateOperationsInput | string | null + } + + export type TimestampsCreateInput = { + id: string + created_at: Date | string + updated_at: Date | string + } + + export type TimestampsUncheckedCreateInput = { + id: string + created_at: Date | string + updated_at: Date | string + } + + export type TimestampsUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + created_at?: DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type TimestampsUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + created_at?: DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type TimestampsCreateManyInput = { + id: string + created_at: Date | string + updated_at: Date | string + } + + export type TimestampsUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + created_at?: DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type TimestampsUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + created_at?: DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type DatetimesCreateInput = { + id: string + d: Date | string + t: Date | string + } + + export type DatetimesUncheckedCreateInput = { + id: string + d: Date | string + t: Date | string + } + + export type DatetimesUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + d?: DateTimeFieldUpdateOperationsInput | Date | string + t?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type DatetimesUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + d?: DateTimeFieldUpdateOperationsInput | Date | string + t?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type DatetimesCreateManyInput = { + id: string + d: Date | string + t: Date | string + } + + export type DatetimesUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + d?: DateTimeFieldUpdateOperationsInput | Date | string + t?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type DatetimesUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + d?: DateTimeFieldUpdateOperationsInput | Date | string + t?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type BoolsCreateInput = { + id: string + b?: boolean | null + } + + export type BoolsUncheckedCreateInput = { + id: string + b?: boolean | null + } + + export type BoolsUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + b?: NullableBoolFieldUpdateOperationsInput | boolean | null + } + + export type BoolsUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + b?: NullableBoolFieldUpdateOperationsInput | boolean | null + } + + export type BoolsCreateManyInput = { + id: string + b?: boolean | null + } + + export type BoolsUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + b?: NullableBoolFieldUpdateOperationsInput | boolean | null + } + + export type BoolsUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + b?: NullableBoolFieldUpdateOperationsInput | boolean | null + } + + export type UuidsCreateInput = { + id: string + } + + export type UuidsUncheckedCreateInput = { + id: string + } + + export type UuidsUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + } + + export type UuidsUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + } + + export type UuidsCreateManyInput = { + id: string + } + + export type UuidsUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + } + + export type UuidsUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + } + + export type IntsCreateInput = { + id: string + i2?: number | null + i4?: number | null + i8?: bigint | number | null + } + + export type IntsUncheckedCreateInput = { + id: string + i2?: number | null + i4?: number | null + i8?: bigint | number | null + } + + export type IntsUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + i2?: NullableIntFieldUpdateOperationsInput | number | null + i4?: NullableIntFieldUpdateOperationsInput | number | null + i8?: NullableBigIntFieldUpdateOperationsInput | bigint | number | null + } + + export type IntsUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + i2?: NullableIntFieldUpdateOperationsInput | number | null + i4?: NullableIntFieldUpdateOperationsInput | number | null + i8?: NullableBigIntFieldUpdateOperationsInput | bigint | number | null + } + + export type IntsCreateManyInput = { + id: string + i2?: number | null + i4?: number | null + i8?: bigint | number | null + } + + export type IntsUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + i2?: NullableIntFieldUpdateOperationsInput | number | null + i4?: NullableIntFieldUpdateOperationsInput | number | null + i8?: NullableBigIntFieldUpdateOperationsInput | bigint | number | null + } + + export type IntsUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + i2?: NullableIntFieldUpdateOperationsInput | number | null + i4?: NullableIntFieldUpdateOperationsInput | number | null + i8?: NullableBigIntFieldUpdateOperationsInput | bigint | number | null + } + + export type FloatsCreateInput = { + id: string + f8?: number | null + } + + export type FloatsUncheckedCreateInput = { + id: string + f8?: number | null + } + + export type FloatsUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + f8?: NullableFloatFieldUpdateOperationsInput | number | null + } + + export type FloatsUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + f8?: NullableFloatFieldUpdateOperationsInput | number | null + } + + export type FloatsCreateManyInput = { + id: string + f8?: number | null + } + + export type FloatsUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + f8?: NullableFloatFieldUpdateOperationsInput | number | null + } + + export type FloatsUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + f8?: NullableFloatFieldUpdateOperationsInput | number | null + } + + 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 StringNullableFilter = { + equals?: string | null + in?: Enumerable | string | null + notIn?: Enumerable | string | null + lt?: string + lte?: string + gt?: string + gte?: string + contains?: string + startsWith?: string + endsWith?: string + mode?: QueryMode + not?: NestedStringNullableFilter | string | null + } + + export type IntNullableFilter = { + equals?: number | null + in?: Enumerable | number | null + notIn?: Enumerable | number | null + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedIntNullableFilter | number | null + } + + export type OtherItemsRelationFilter = { + is?: OtherItemsWhereInput | null + isNot?: OtherItemsWhereInput | null + } + + export type ItemsCountOrderByAggregateInput = { + id?: SortOrder + content?: SortOrder + content_text_null?: SortOrder + content_text_null_default?: SortOrder + intvalue_null?: SortOrder + intvalue_null_default?: SortOrder + } + + export type ItemsAvgOrderByAggregateInput = { + intvalue_null?: SortOrder + intvalue_null_default?: SortOrder + } + + export type ItemsMaxOrderByAggregateInput = { + id?: SortOrder + content?: SortOrder + content_text_null?: SortOrder + content_text_null_default?: SortOrder + intvalue_null?: SortOrder + intvalue_null_default?: SortOrder + } + + export type ItemsMinOrderByAggregateInput = { + id?: SortOrder + content?: SortOrder + content_text_null?: SortOrder + content_text_null_default?: SortOrder + intvalue_null?: SortOrder + intvalue_null_default?: SortOrder + } + + export type ItemsSumOrderByAggregateInput = { + intvalue_null?: SortOrder + intvalue_null_default?: SortOrder + } + + 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 StringNullableWithAggregatesFilter = { + equals?: string | null + in?: Enumerable | string | null + notIn?: Enumerable | string | null + lt?: string + lte?: string + gt?: string + gte?: string + contains?: string + startsWith?: string + endsWith?: string + mode?: QueryMode + not?: NestedStringNullableWithAggregatesFilter | string | null + _count?: NestedIntNullableFilter + _min?: NestedStringNullableFilter + _max?: NestedStringNullableFilter + } + + export type IntNullableWithAggregatesFilter = { + equals?: number | null + in?: Enumerable | number | null + notIn?: Enumerable | number | null + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedIntNullableWithAggregatesFilter | number | null + _count?: NestedIntNullableFilter + _avg?: NestedFloatNullableFilter + _sum?: NestedIntNullableFilter + _min?: NestedIntNullableFilter + _max?: NestedIntNullableFilter + } + + export type ItemsRelationFilter = { + is?: ItemsWhereInput | null + isNot?: ItemsWhereInput | null + } + + export type OtherItemsCountOrderByAggregateInput = { + id?: SortOrder + content?: SortOrder + item_id?: SortOrder + } + + export type OtherItemsMaxOrderByAggregateInput = { + id?: SortOrder + content?: SortOrder + item_id?: SortOrder + } + + export type OtherItemsMinOrderByAggregateInput = { + id?: SortOrder + content?: SortOrder + item_id?: SortOrder + } + + 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 TimestampsCountOrderByAggregateInput = { + id?: SortOrder + created_at?: SortOrder + updated_at?: SortOrder + } + + export type TimestampsMaxOrderByAggregateInput = { + id?: SortOrder + created_at?: SortOrder + updated_at?: SortOrder + } + + export type TimestampsMinOrderByAggregateInput = { + id?: SortOrder + created_at?: SortOrder + updated_at?: SortOrder + } + + 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 DatetimesCountOrderByAggregateInput = { + id?: SortOrder + d?: SortOrder + t?: SortOrder + } + + export type DatetimesMaxOrderByAggregateInput = { + id?: SortOrder + d?: SortOrder + t?: SortOrder + } + + export type DatetimesMinOrderByAggregateInput = { + id?: SortOrder + d?: SortOrder + t?: SortOrder + } + + export type BoolNullableFilter = { + equals?: boolean | null + not?: NestedBoolNullableFilter | boolean | null + } + + export type BoolsCountOrderByAggregateInput = { + id?: SortOrder + b?: SortOrder + } + + export type BoolsMaxOrderByAggregateInput = { + id?: SortOrder + b?: SortOrder + } + + export type BoolsMinOrderByAggregateInput = { + id?: SortOrder + b?: SortOrder + } + + export type BoolNullableWithAggregatesFilter = { + equals?: boolean | null + not?: NestedBoolNullableWithAggregatesFilter | boolean | null + _count?: NestedIntNullableFilter + _min?: NestedBoolNullableFilter + _max?: NestedBoolNullableFilter + } + + export type UuidFilter = { + equals?: string + in?: Enumerable | string + notIn?: Enumerable | string + lt?: string + lte?: string + gt?: string + gte?: string + mode?: QueryMode + not?: NestedUuidFilter | string + } + + export type UuidsCountOrderByAggregateInput = { + id?: SortOrder + } + + export type UuidsMaxOrderByAggregateInput = { + id?: SortOrder + } + + export type UuidsMinOrderByAggregateInput = { + id?: SortOrder + } + + export type UuidWithAggregatesFilter = { + equals?: string + in?: Enumerable | string + notIn?: Enumerable | string + lt?: string + lte?: string + gt?: string + gte?: string + mode?: QueryMode + not?: NestedUuidWithAggregatesFilter | string + _count?: NestedIntFilter + _min?: NestedStringFilter + _max?: NestedStringFilter + } + + export type BigIntNullableFilter = { + equals?: bigint | number | null + in?: Enumerable | Enumerable | bigint | number | null + notIn?: Enumerable | Enumerable | bigint | number | null + lt?: bigint | number + lte?: bigint | number + gt?: bigint | number + gte?: bigint | number + not?: NestedBigIntNullableFilter | bigint | number | null + } + + export type IntsCountOrderByAggregateInput = { + id?: SortOrder + i2?: SortOrder + i4?: SortOrder + i8?: SortOrder + } + + export type IntsAvgOrderByAggregateInput = { + i2?: SortOrder + i4?: SortOrder + i8?: SortOrder + } + + export type IntsMaxOrderByAggregateInput = { + id?: SortOrder + i2?: SortOrder + i4?: SortOrder + i8?: SortOrder + } + + export type IntsMinOrderByAggregateInput = { + id?: SortOrder + i2?: SortOrder + i4?: SortOrder + i8?: SortOrder + } + + export type IntsSumOrderByAggregateInput = { + i2?: SortOrder + i4?: SortOrder + i8?: SortOrder + } + + export type BigIntNullableWithAggregatesFilter = { + equals?: bigint | number | null + in?: Enumerable | Enumerable | bigint | number | null + notIn?: Enumerable | Enumerable | bigint | number | null + lt?: bigint | number + lte?: bigint | number + gt?: bigint | number + gte?: bigint | number + not?: NestedBigIntNullableWithAggregatesFilter | bigint | number | null + _count?: NestedIntNullableFilter + _avg?: NestedFloatNullableFilter + _sum?: NestedBigIntNullableFilter + _min?: NestedBigIntNullableFilter + _max?: NestedBigIntNullableFilter + } + + export type FloatNullableFilter = { + equals?: number | null + in?: Enumerable | number | null + notIn?: Enumerable | number | null + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedFloatNullableFilter | number | null + } + + export type FloatsCountOrderByAggregateInput = { + id?: SortOrder + f8?: SortOrder + } + + export type FloatsAvgOrderByAggregateInput = { + f8?: SortOrder + } + + export type FloatsMaxOrderByAggregateInput = { + id?: SortOrder + f8?: SortOrder + } + + export type FloatsMinOrderByAggregateInput = { + id?: SortOrder + f8?: SortOrder + } + + export type FloatsSumOrderByAggregateInput = { + f8?: SortOrder + } + + export type FloatNullableWithAggregatesFilter = { + equals?: number | null + in?: Enumerable | number | null + notIn?: Enumerable | number | null + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedFloatNullableWithAggregatesFilter | number | null + _count?: NestedIntNullableFilter + _avg?: NestedFloatNullableFilter + _sum?: NestedFloatNullableFilter + _min?: NestedFloatNullableFilter + _max?: NestedFloatNullableFilter + } + + export type OtherItemsCreateNestedOneWithoutItemsInput = { + create?: XOR + connectOrCreate?: OtherItemsCreateOrConnectWithoutItemsInput + connect?: OtherItemsWhereUniqueInput + } + + export type OtherItemsUncheckedCreateNestedOneWithoutItemsInput = { + create?: XOR + connectOrCreate?: OtherItemsCreateOrConnectWithoutItemsInput + connect?: OtherItemsWhereUniqueInput + } + + export type StringFieldUpdateOperationsInput = { + set?: string + } + + export type NullableStringFieldUpdateOperationsInput = { + set?: string | null + } + + export type NullableIntFieldUpdateOperationsInput = { + set?: number | null + increment?: number + decrement?: number + multiply?: number + divide?: number + } + + export type OtherItemsUpdateOneWithoutItemsNestedInput = { + create?: XOR + connectOrCreate?: OtherItemsCreateOrConnectWithoutItemsInput + upsert?: OtherItemsUpsertWithoutItemsInput + disconnect?: boolean + delete?: boolean + connect?: OtherItemsWhereUniqueInput + update?: XOR + } + + export type OtherItemsUncheckedUpdateOneWithoutItemsNestedInput = { + create?: XOR + connectOrCreate?: OtherItemsCreateOrConnectWithoutItemsInput + upsert?: OtherItemsUpsertWithoutItemsInput + disconnect?: boolean + delete?: boolean + connect?: OtherItemsWhereUniqueInput + update?: XOR + } + + export type ItemsCreateNestedOneWithoutOther_itemsInput = { + create?: XOR + connectOrCreate?: ItemsCreateOrConnectWithoutOther_itemsInput + connect?: ItemsWhereUniqueInput + } + + export type ItemsUpdateOneWithoutOther_itemsNestedInput = { + create?: XOR + connectOrCreate?: ItemsCreateOrConnectWithoutOther_itemsInput + upsert?: ItemsUpsertWithoutOther_itemsInput + disconnect?: boolean + delete?: boolean + connect?: ItemsWhereUniqueInput + update?: XOR + } + + export type DateTimeFieldUpdateOperationsInput = { + set?: Date | string + } + + export type NullableBoolFieldUpdateOperationsInput = { + set?: boolean | null + } + + export type NullableBigIntFieldUpdateOperationsInput = { + set?: bigint | number | null + increment?: bigint | number + decrement?: bigint | number + multiply?: bigint | number + divide?: bigint | number + } + + export type NullableFloatFieldUpdateOperationsInput = { + set?: number | null + increment?: number + decrement?: number + multiply?: number + divide?: 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 NestedStringNullableFilter = { + equals?: string | null + in?: Enumerable | string | null + notIn?: Enumerable | string | null + lt?: string + lte?: string + gt?: string + gte?: string + contains?: string + startsWith?: string + endsWith?: string + not?: NestedStringNullableFilter | string | null + } + + export type NestedIntNullableFilter = { + equals?: number | null + in?: Enumerable | number | null + notIn?: Enumerable | number | null + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedIntNullableFilter | number | null + } + + 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 NestedIntFilter = { + equals?: number + in?: Enumerable | number + notIn?: Enumerable | number + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedIntFilter | number + } + + export type NestedStringNullableWithAggregatesFilter = { + equals?: string | null + in?: Enumerable | string | null + notIn?: Enumerable | string | null + lt?: string + lte?: string + gt?: string + gte?: string + contains?: string + startsWith?: string + endsWith?: string + not?: NestedStringNullableWithAggregatesFilter | string | null + _count?: NestedIntNullableFilter + _min?: NestedStringNullableFilter + _max?: NestedStringNullableFilter + } + + export type NestedIntNullableWithAggregatesFilter = { + equals?: number | null + in?: Enumerable | number | null + notIn?: Enumerable | number | null + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedIntNullableWithAggregatesFilter | number | null + _count?: NestedIntNullableFilter + _avg?: NestedFloatNullableFilter + _sum?: NestedIntNullableFilter + _min?: NestedIntNullableFilter + _max?: NestedIntNullableFilter + } + + export type NestedFloatNullableFilter = { + equals?: number | null + in?: Enumerable | number | null + notIn?: Enumerable | number | null + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedFloatNullableFilter | number | null + } + + 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 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 NestedBoolNullableFilter = { + equals?: boolean | null + not?: NestedBoolNullableFilter | boolean | null + } + + export type NestedBoolNullableWithAggregatesFilter = { + equals?: boolean | null + not?: NestedBoolNullableWithAggregatesFilter | boolean | null + _count?: NestedIntNullableFilter + _min?: NestedBoolNullableFilter + _max?: NestedBoolNullableFilter + } + + export type NestedUuidFilter = { + equals?: string + in?: Enumerable | string + notIn?: Enumerable | string + lt?: string + lte?: string + gt?: string + gte?: string + not?: NestedUuidFilter | string + } + + export type NestedUuidWithAggregatesFilter = { + equals?: string + in?: Enumerable | string + notIn?: Enumerable | string + lt?: string + lte?: string + gt?: string + gte?: string + not?: NestedUuidWithAggregatesFilter | string + _count?: NestedIntFilter + _min?: NestedStringFilter + _max?: NestedStringFilter + } + + export type NestedBigIntNullableFilter = { + equals?: bigint | number | null + in?: Enumerable | Enumerable | bigint | number | null + notIn?: Enumerable | Enumerable | bigint | number | null + lt?: bigint | number + lte?: bigint | number + gt?: bigint | number + gte?: bigint | number + not?: NestedBigIntNullableFilter | bigint | number | null + } + + export type NestedBigIntNullableWithAggregatesFilter = { + equals?: bigint | number | null + in?: Enumerable | Enumerable | bigint | number | null + notIn?: Enumerable | Enumerable | bigint | number | null + lt?: bigint | number + lte?: bigint | number + gt?: bigint | number + gte?: bigint | number + not?: NestedBigIntNullableWithAggregatesFilter | bigint | number | null + _count?: NestedIntNullableFilter + _avg?: NestedFloatNullableFilter + _sum?: NestedBigIntNullableFilter + _min?: NestedBigIntNullableFilter + _max?: NestedBigIntNullableFilter + } + + export type NestedFloatNullableWithAggregatesFilter = { + equals?: number | null + in?: Enumerable | number | null + notIn?: Enumerable | number | null + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedFloatNullableWithAggregatesFilter | number | null + _count?: NestedIntNullableFilter + _avg?: NestedFloatNullableFilter + _sum?: NestedFloatNullableFilter + _min?: NestedFloatNullableFilter + _max?: NestedFloatNullableFilter + } + + export type OtherItemsCreateWithoutItemsInput = { + id: string + content: string + } + + export type OtherItemsUncheckedCreateWithoutItemsInput = { + id: string + content: string + } + + export type OtherItemsCreateOrConnectWithoutItemsInput = { + where: OtherItemsWhereUniqueInput + create: XOR + } + + export type OtherItemsUpsertWithoutItemsInput = { + update: XOR + create: XOR + } + + export type OtherItemsUpdateWithoutItemsInput = { + id?: StringFieldUpdateOperationsInput | string + content?: StringFieldUpdateOperationsInput | string + } + + export type OtherItemsUncheckedUpdateWithoutItemsInput = { + id?: StringFieldUpdateOperationsInput | string + content?: StringFieldUpdateOperationsInput | string + } + + export type ItemsCreateWithoutOther_itemsInput = { + id: string + content: string + content_text_null?: string | null + content_text_null_default?: string | null + intvalue_null?: number | null + intvalue_null_default?: number | null + } + + export type ItemsUncheckedCreateWithoutOther_itemsInput = { + id: string + content: string + content_text_null?: string | null + content_text_null_default?: string | null + intvalue_null?: number | null + intvalue_null_default?: number | null + } + + export type ItemsCreateOrConnectWithoutOther_itemsInput = { + where: ItemsWhereUniqueInput + create: XOR + } + + export type ItemsUpsertWithoutOther_itemsInput = { + update: XOR + create: XOR + } + + export type ItemsUpdateWithoutOther_itemsInput = { + id?: StringFieldUpdateOperationsInput | string + content?: StringFieldUpdateOperationsInput | string + content_text_null?: NullableStringFieldUpdateOperationsInput | string | null + content_text_null_default?: NullableStringFieldUpdateOperationsInput | string | null + intvalue_null?: NullableIntFieldUpdateOperationsInput | number | null + intvalue_null_default?: NullableIntFieldUpdateOperationsInput | number | null + } + + export type ItemsUncheckedUpdateWithoutOther_itemsInput = { + id?: StringFieldUpdateOperationsInput | string + content?: StringFieldUpdateOperationsInput | string + content_text_null?: NullableStringFieldUpdateOperationsInput | string | null + content_text_null_default?: NullableStringFieldUpdateOperationsInput | string | null + intvalue_null?: NullableIntFieldUpdateOperationsInput | number | null + intvalue_null_default?: NullableIntFieldUpdateOperationsInput | number | null + } + + + + /** + * 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/e2e/satellite_client/src/prisma/schema.prisma b/e2e/satellite_client/src/prisma/schema.prisma index e43c68b4b1..357564c25e 100644 --- a/e2e/satellite_client/src/prisma/schema.prisma +++ b/e2e/satellite_client/src/prisma/schema.prisma @@ -6,8 +6,7 @@ datasource db { generator electric { provider = "../node_modules/@electric-sql/prisma-generator/dist/bin.js" output = "../generated/client" - relationModel = true - writeNullishInModelTypes = true + relationModel = "false" } generator client { @@ -23,6 +22,7 @@ model Items { intvalue_null Int? intvalue_null_default Int? other_items OtherItems? + @@map("items") } model OtherItems { @@ -30,37 +30,44 @@ model OtherItems { content String item_id String? @unique items Items? @relation(fields: [item_id], references: [id]) + @@map("other_items") } model Timestamps { id String @id created_at DateTime @db.Timestamp(3) updated_at DateTime @db.Timestamptz(3) + @@map("timestamps") } model Datetimes { id String @id d DateTime @db.Date t DateTime @db.Time(3) + @@map("datetimes") } model Bools { id String @id b Boolean? + @@map("bools") } model Uuids { id String @id @db.Uuid /// @zod.string.uuid() + @@map("uuids") } model Ints { id String @id i2 Int? @db.SmallInt /// @zod.number.int().gte(-32768).lte(32767) i4 Int? /// @zod.number.int().gte(-2147483648).lte(2147483647) - i8 Int? /// @zod.number.int().gte(-9223372036854775808).lte(9223372036854775807) + i8 BigInt? + @@map("ints") } model Floats { id String @id f8 Float? @db.DoublePrecision /// @zod.custom.use(z.number().or(z.nan())) + @@map("floats") } diff --git a/e2e/tests/03.17_node_satellite_can_sync_ints.lux b/e2e/tests/03.17_node_satellite_can_sync_ints.lux index b58f2b5318..fd2d466cfa 100644 --- a/e2e/tests/03.17_node_satellite_can_sync_ints.lux +++ b/e2e/tests/03.17_node_satellite_can_sync_ints.lux @@ -26,8 +26,8 @@ [shell proxy_1] """! INSERT INTO public.ints (id, i2, i4, i8) VALUES - ('row1', -32768, -2147483648, -30000000000), - ('row2', 32767, 2147483647, 30000000000); + ('row1', -32768, -2147483648, -9223372036854775808), + ('row2', 32767, 2147483647, 9223372036854775807); """ ??INSERT 0 2 @@ -35,21 +35,26 @@ # Wait for the rows to arrive [invoke node_await_get_int "row2"] - [invoke node_get_int "row1" -32768 -2147483648 -30000000000] - [invoke node_get_int "row2" 32767 2147483647 30000000000] + [invoke node_get_int "row1" -32768 -2147483648 -9223372036854775808] + [invoke node_get_int "row2" 32767 2147483647 9223372036854775807] # Can write valid ints to the DB !await client.write_int(db, 'row3', 0, 0, 0) - ??{ id: 'row3', i2: 0, i4: 0, i8: 0 } + ??{ id: 'row3', i2: 0, i4: 0, i8: 0n } + ?$node + + !await client.write_int(db, 'row4', 0, 0, 9223372036854775806n) + ??{ id: 'row4', i2: 0, i4: 0, i8: 9223372036854775806n } ?$node [shell proxy_1] - [invoke wait-for "SELECT * FROM public.ints;" "row3" 10 $psql] + [invoke wait-for "SELECT * FROM public.ints;" "row4" 10 $psql] !SELECT * FROM public.ints; - ??row1 | -32768 | -2147483648 | -30000000000 - ??row2 | 32767 | 2147483647 | 30000000000 - ??row3 | 0 | 0 | 0 + ??row1 | -32768 | -2147483648 | -9223372036854775808 + ??row2 | 32767 | 2147483647 | 9223372036854775807 + ??row3 | 0 | 0 | 0 + ??row4 | 0 | 0 | 9223372036854775806 # Start a new Satellite client and verify that it receives all rows [invoke setup_client 2 electric_1 5133] @@ -61,21 +66,22 @@ # Wait for the rows to arrive [invoke node_await_get_int "row3"] - [invoke node_get_int "row1" -32768 -2147483648 -30000000000] - [invoke node_get_int "row2" 32767 2147483647 30000000000] + [invoke node_get_int "row1" -32768 -2147483648 -9223372036854775808] + [invoke node_get_int "row2" 32767 2147483647 9223372036854775807] [invoke node_get_int "row3" 0 0 0] + [invoke node_get_int "row4" 0 0 9223372036854775806] # Reset the failure pattern because we don't want it to match the errors below - # Can't write invalid ints to the DB - !await client.write_int(db, 'row4', 32768, 5, 0) + !await client.write_int(db, 'row5', 32768, 5, 0) ??Number must be less than or equal to 32767 - !await client.write_int(db, 'row4', 5, 2147483648, 0) + !await client.write_int(db, 'row5', 5, 2147483648, 0) ??Number must be less than or equal to 2147483647 - #!await client.write_int(db, 'row4', 5, 0, -9223372036854775809) - #??Number must be less than or equal to 9223372036854775808 + !await client.write_int(db, 'row5', 5, 0, 9223372036854775808n) + ??BigInt must be less than or equal to 9223372036854775807 [cleanup] [invoke teardown] diff --git a/e2e/tests/_satellite_macros.luxinc b/e2e/tests/_satellite_macros.luxinc index f5bdc9e9ec..b0166288a7 100644 --- a/e2e/tests/_satellite_macros.luxinc +++ b/e2e/tests/_satellite_macros.luxinc @@ -70,7 +70,7 @@ [macro node_get_int id expected_int2 expected_int4 expected_int8] !await client.get_int(db, '${id}') - ??{ id: '${id}', i2: ${expected_int2}, i4: ${expected_int4}, i8: ${expected_int8} } + ??{ id: '${id}', i2: ${expected_int2}, i4: ${expected_int4}, i8: ${expected_int8}n } ??$node [endmacro] diff --git a/generator/src/classes/__tests__/cases/testValidators/number.prisma b/generator/src/classes/__tests__/cases/testValidators/number.prisma index b67e7283ca..b330640fde 100644 --- a/generator/src/classes/__tests__/cases/testValidators/number.prisma +++ b/generator/src/classes/__tests__/cases/testValidators/number.prisma @@ -21,6 +21,7 @@ model NumberValidators { multipleOf Int? /// @zod.number.multipleOf(5) finite Int? /// @zod.number.finite() chained Int? /// @zod.number.gt(5).lt(10) + bigint BigInt? /// @zod.bigint.gte(-9223372036854775808n).lte(9223372036854775807n) } model NumberValidatorsWithMessage { diff --git a/generator/src/classes/__tests__/cases/testValidators/number.test.ts b/generator/src/classes/__tests__/cases/testValidators/number.test.ts index c294d21098..6c02184955 100644 --- a/generator/src/classes/__tests__/cases/testValidators/number.test.ts +++ b/generator/src/classes/__tests__/cases/testValidators/number.test.ts @@ -21,6 +21,7 @@ describe('test number validators', async () => { multipleOf: extendedDMMF.datamodel.models[0].fields[10], finite: extendedDMMF.datamodel.models[0].fields[11], chained: extendedDMMF.datamodel.models[0].fields[12], + bigint: extendedDMMF.datamodel.models[0].fields[13], } it(`should add gt validator for field "${fields.gt.name}"`, () => { @@ -70,6 +71,12 @@ describe('test number validators', async () => { it(`should add chained validators for field "${fields.chained.name}"`, () => { expect(fields.chained.zodValidatorString).toBe('.gt(5).lt(10)') }) + + it(`should add bigint validators for field "${fields.bigint.name}"`, () => { + expect(fields.bigint.zodValidatorString).toBe( + '.gte(-9223372036854775808n).lte(9223372036854775807n)' + ) + }) }) describe('test validators with message', () => { diff --git a/generator/src/classes/extendedDMMFField/extendedDMMFFieldValidatorMap.ts b/generator/src/classes/extendedDMMFField/extendedDMMFFieldValidatorMap.ts index 2b6ccb12a4..17d68078bc 100644 --- a/generator/src/classes/extendedDMMFField/extendedDMMFFieldValidatorMap.ts +++ b/generator/src/classes/extendedDMMFField/extendedDMMFFieldValidatorMap.ts @@ -111,7 +111,7 @@ export const DATE_VALIDATOR_NUMBER_AND_MESSAGE_REGEX = // ---------------------------------------- export const BIGINT_VALIDATOR_NUMBER_AND_MESSAGE_REGEX = - /.(?gt|gte|lt|lte|multipleOf)(?\([\w]+([,][ ]?)?(?[{][ ]?message:[ ]?['"][\w\W]+['"][ ]?[}])?\))/ + /.(?gt|gte|lt|lte|multipleOf)(?\(-?[\w]+([,][ ]?)?(?[{][ ]?message:[ ]?['"][\w\W]+['"][ ]?[}])?\))/ export const BIGINT_VALIDATOR_MESSAGE_REGEX = /(?positive|nonnegative|negative|nonpositive|array)(\((?[{][ ]?message:[ ]?['"][\w\W]+['"][ ]?[}])?\))/ diff --git a/generator/src/functions/fieldWriters/writeScalarType.ts b/generator/src/functions/fieldWriters/writeScalarType.ts index f428790c4e..456064074a 100644 --- a/generator/src/functions/fieldWriters/writeScalarType.ts +++ b/generator/src/functions/fieldWriters/writeScalarType.ts @@ -30,6 +30,18 @@ export const writeScalarType: WriteTypeFunction = ( const zodType = inputType.getZodScalarType() if (!zodType) return + // The schemas for bigint and bigint arrays + // accept both bigints and integers + // but transform integers to bigint + // We could also support arrays that mix both integers and bigints + // by always using `bigIntSchema` and moving the `array()` call + // to the end by using a conditional write as how it is done for the other types + // But the Prisma typings do not allow this so we would have to modify the Prisma typings + const bigIntSchema = + 'z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt) ])' + const bigIntArraySchema = + 'z.union([ z.bigint().gte(-9223372036854775808n).lte(9223372036854775807n).array(), z.number().int().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).transform(BigInt).array() ])' + if (zodCustomValidatorString) { if (zodType === 'date') { return writer @@ -53,6 +65,30 @@ export const writeScalarType: WriteTypeFunction = ( .conditionalWrite(writeComma, `,`) } + if (zodType === 'bigint') { + return writer + .conditionalWrite( + inputType.generatorConfig.addInputTypeValidation, + zodCustomValidatorString + ) + .conditionalWrite( + inputType.generatorConfig.addInputTypeValidation && inputType.isList, + `.array()` + ) + .conditionalWrite( + !inputType.generatorConfig.addInputTypeValidation && + !inputType.isList, + bigIntSchema + ) + .conditionalWrite( + !inputType.generatorConfig.addInputTypeValidation && inputType.isList, + bigIntArraySchema + ) + .conditionalWrite(isOptional, `.optional()`) + .conditionalWrite(isNullable, `.nullable()`) + .conditionalWrite(writeComma, `,`) + } + // only writes the validator string if the user has not disabled input type validation return writer .conditionalWrite( @@ -88,6 +124,19 @@ export const writeScalarType: WriteTypeFunction = ( .conditionalWrite(writeComma, `,`) } + if (zodType === 'bigint') { + return writer + .conditionalWrite(!inputType.isList, bigIntSchema) + .conditionalWrite(inputType.isList, bigIntArraySchema) + .conditionalWrite( + writeValidation && !!zodValidatorString, + zodValidatorString! + ) + .conditionalWrite(isOptional, `.optional()`) + .conditionalWrite(isNullable, `.nullable()`) + .conditionalWrite(writeComma, `,`) + } + return writer .write(`z.${zodType}(`) .conditionalWrite(writeValidation && !!zodCustomErrors, zodCustomErrors!) From 2001a244029f4b5898dfb5068e8a507cedbfe2bc Mon Sep 17 00:00:00 2001 From: David Martos Date: Mon, 27 Nov 2023 11:13:31 +0100 Subject: [PATCH 2/2] chore (client): include tests for bigint support in the oplog triggers and the merge logic (#699) In addition to the tests, the following logic is removed because at the oplog level, the Record values cannot be BigInt, as the oplog trigger serializes those values as string. Is the `deserialize` who checks the postgres type to turn it into the correct JS object. Leaving the type check there might cause confusion in the future. ```js if (typeof value === 'bigint') { return value.toString() } ``` --- clients/typescript/src/satellite/oplog.ts | 3 - .../test/migrators/triggers.test.ts | 12 +- clients/typescript/test/satellite/common.ts | 29 +++- .../typescript/test/satellite/merge.test.ts | 128 ++++++++++-------- 4 files changed, 106 insertions(+), 66 deletions(-) diff --git a/clients/typescript/src/satellite/oplog.ts b/clients/typescript/src/satellite/oplog.ts index 8a66e15e58..cf92951f55 100644 --- a/clients/typescript/src/satellite/oplog.ts +++ b/clients/typescript/src/satellite/oplog.ts @@ -306,9 +306,6 @@ function serialiseRow(row?: Rec): string { return '-Inf' } } - if (typeof value === 'bigint') { - return value.toString() - } return value }) } diff --git a/clients/typescript/test/migrators/triggers.test.ts b/clients/typescript/test/migrators/triggers.test.ts index 8a031ae7dc..f6822022fd 100644 --- a/clients/typescript/test/migrators/triggers.test.ts +++ b/clients/typescript/test/migrators/triggers.test.ts @@ -32,7 +32,7 @@ test('generateTableTriggers should create correct triggers for a table', (t) => WHEN 1 == (SELECT flag from _electric_trigger_settings WHERE tablename == 'personTable') BEGIN INSERT INTO _electric_oplog (namespace, tablename, optype, primaryKey, newRow, oldRow, timestamp) - VALUES ('main', 'personTable', 'INSERT', json_object('id', cast(new."id" as TEXT)), json_object('age', new."age", 'bmi', cast(new."bmi" as TEXT), 'id', cast(new."id" as TEXT), 'name', new."name"), NULL, NULL); + VALUES ('main', 'personTable', 'INSERT', json_object('id', cast(new."id" as TEXT)), json_object('age', new."age", 'bmi', cast(new."bmi" as TEXT), 'id', cast(new."id" as TEXT), 'int8', cast(new."int8" as TEXT), 'name', new."name"), NULL, NULL); END; ` ) @@ -46,7 +46,7 @@ test('generateTableTriggers should create correct triggers for a table', (t) => WHEN 1 == (SELECT flag from _electric_trigger_settings WHERE tablename == 'personTable') BEGIN INSERT INTO _electric_oplog (namespace, tablename, optype, primaryKey, newRow, oldRow, timestamp) - VALUES ('main', 'personTable', 'UPDATE', json_object('id', cast(new."id" as TEXT)), json_object('age', new."age", 'bmi', cast(new."bmi" as TEXT), 'id', cast(new."id" as TEXT), 'name', new."name"), json_object('age', old."age", 'bmi', cast(old."bmi" as TEXT), 'id', cast(old."id" as TEXT), 'name', old."name"), NULL); + VALUES ('main', 'personTable', 'UPDATE', json_object('id', cast(new."id" as TEXT)), json_object('age', new."age", 'bmi', cast(new."bmi" as TEXT), 'id', cast(new."id" as TEXT), 'int8', cast(new."int8" as TEXT), 'name', new."name"), json_object('age', old."age", 'bmi', cast(old."bmi" as TEXT), 'id', cast(old."id" as TEXT), 'int8', cast(old."int8" as TEXT), 'name', old."name"), NULL); END; ` ) @@ -60,7 +60,7 @@ test('generateTableTriggers should create correct triggers for a table', (t) => WHEN 1 == (SELECT flag from _electric_trigger_settings WHERE tablename == 'personTable') BEGIN INSERT INTO _electric_oplog (namespace, tablename, optype, primaryKey, newRow, oldRow, timestamp) - VALUES ('main', 'personTable', 'DELETE', json_object('id', cast(old."id" as TEXT)), NULL, json_object('age', old."age", 'bmi', cast(old."bmi" as TEXT), 'id', cast(old."id" as TEXT), 'name', old."name"), NULL); + VALUES ('main', 'personTable', 'DELETE', json_object('id', cast(old."id" as TEXT)), NULL, json_object('age', old."age", 'bmi', cast(old."bmi" as TEXT), 'id', cast(old."id" as TEXT), 'int8', cast(old."int8" as TEXT), 'name', old."name"), NULL); END; ` ) @@ -75,7 +75,7 @@ test('oplog insertion trigger should insert row into oplog table', (t) => { migrateDb() // Insert a row in the table - const insertRowSQL = `INSERT INTO ${tableName} (id, name, age, bmi) VALUES (1, 'John Doe', 30, 25.5)` + const insertRowSQL = `INSERT INTO ${tableName} (id, name, age, bmi, int8) VALUES (1, 'John Doe', 30, 25.5, 7)` db.exec(insertRowSQL) // Check that the oplog table contains an entry for the inserted row @@ -99,6 +99,7 @@ test('oplog insertion trigger should insert row into oplog table', (t) => { age: 30, bmi: '25.5', id: '1.0', + int8: '7', // BigInts are serialized as strings in the oplog name: 'John Doe', }), oldRow: null, @@ -116,7 +117,7 @@ test('oplog trigger should handle Infinity values correctly', (t) => { migrateDb() // Insert a row in the table - const insertRowSQL = `INSERT INTO ${tableName} (id, name, age, bmi) VALUES (-9e999, 'John Doe', 30, 9e999)` + const insertRowSQL = `INSERT INTO ${tableName} (id, name, age, bmi, int8) VALUES (-9e999, 'John Doe', 30, 9e999, 7)` db.exec(insertRowSQL) // Check that the oplog table contains an entry for the inserted row @@ -140,6 +141,7 @@ test('oplog trigger should handle Infinity values correctly', (t) => { age: 30, bmi: 'Inf', id: '-Inf', + int8: '7', // BigInts are serialized as strings in the oplog name: 'John Doe', }), oldRow: null, diff --git a/clients/typescript/test/satellite/common.ts b/clients/typescript/test/satellite/common.ts index 49830574aa..d8b04d6217 100644 --- a/clients/typescript/test/satellite/common.ts +++ b/clients/typescript/test/satellite/common.ts @@ -101,10 +101,10 @@ export const relations = { }, ], }, - floatTable: { + mergeTable: { id: 3, schema: 'public', - table: 'floatTable', + table: 'mergeTable', tableType: 0, columns: [ { @@ -114,11 +114,23 @@ export const relations = { primaryKey: true, }, { - name: 'value', + name: 'real', type: 'REAL', isNullable: true, primaryKey: false, }, + { + name: 'int8', + type: 'INT8', + isNullable: true, + primaryKey: false, + }, + { + name: 'bigint', + type: 'BIGINT', + isNullable: true, + primaryKey: false, + }, ], }, personTable: { @@ -151,6 +163,12 @@ export const relations = { isNullable: true, primaryKey: false, }, + { + name: 'int8', + type: 'INT8', + isNullable: true, + primaryKey: false, + }, ], }, } @@ -249,7 +267,7 @@ export const cleanAndStopSatellite = async ( export function migrateDb(db: SqliteDB, table: Table) { const tableName = table.tableName // Create the table in the database - const createTableSQL = `CREATE TABLE ${tableName} (id REAL PRIMARY KEY, name TEXT, age INTEGER, bmi REAL)` + const createTableSQL = `CREATE TABLE ${tableName} (id REAL PRIMARY KEY, name TEXT, age INTEGER, bmi REAL, int8 INTEGER)` db.exec(createTableSQL) // Apply the initial migration on the database @@ -270,7 +288,7 @@ export function migrateDb(db: SqliteDB, table: Table) { export const personTable: Table = { namespace: 'main', tableName: 'personTable', - columns: ['id', 'name', 'age', 'bmi'], + columns: ['id', 'name', 'age', 'bmi', 'int8'], primary: ['id'], foreignKeys: [], columnTypes: { @@ -278,5 +296,6 @@ export const personTable: Table = { name: { sqliteType: 'TEXT', pgType: PgBasicType.PG_TEXT }, age: { sqliteType: 'INTEGER', pgType: PgBasicType.PG_INTEGER }, bmi: { sqliteType: 'REAL', pgType: PgBasicType.PG_REAL }, + int8: { sqliteType: 'INTEGER', pgType: PgBasicType.PG_INT8 }, }, } diff --git a/clients/typescript/test/satellite/merge.test.ts b/clients/typescript/test/satellite/merge.test.ts index 7543f5e25d..63c05c3b89 100644 --- a/clients/typescript/test/satellite/merge.test.ts +++ b/clients/typescript/test/satellite/merge.test.ts @@ -1,4 +1,4 @@ -import test from 'ava' +import test, { ExecutionContext } from 'ava' import { mergeEntries } from '../../src/satellite/merge' import { OplogEntry, @@ -54,67 +54,77 @@ test('merging entries: local no-op updates should cancel incoming delete', (t) = }) test('merge can handle infinity values', (t) => { - const pk = primaryKeyToStr({ id: 1 }) - - const to_commit_timestamp = (timestamp: string): Long => - Long.UZERO.add(new Date(timestamp).getTime()) - - const tx1: DataTransaction = { - lsn: DEFAULT_LOG_POS, - commit_timestamp: to_commit_timestamp('1970-01-02T03:46:41.000Z'), - changes: [ - { - relation: relations.floatTable, - type: DataChangeType.INSERT, - record: { id: 1, value: +Infinity }, - tags: [], - }, - ], - } - - const tx2: DataTransaction = { - lsn: DEFAULT_LOG_POS, - commit_timestamp: to_commit_timestamp('1970-01-02T03:46:42.000Z'), - changes: [ - { - relation: relations.floatTable, - type: DataChangeType.INSERT, - record: { id: 1, value: -Infinity }, - tags: [], - }, - ], - } + _mergeTableTest(t, { + initial: { real: Infinity }, + incoming: { real: -Infinity }, + expected: { real: -Infinity }, + }) +}) - // we go through `fromTransaction` on purpose - // in order to also test serialisation/deserialisation of the rows - const entry1: OplogEntry[] = fromTransaction(tx1, relations) - const entry2: OplogEntry[] = fromTransaction(tx2, relations) +test('merge can handle NaN values', (t) => { + _mergeTableTest(t, { + initial: { real: 5.0 }, + incoming: { real: NaN }, + expected: { real: NaN }, + }) +}) - const merged = mergeEntries('local', entry1, 'remote', entry2, relations) +test('merge can handle BigInt (INT8 pgtype) values', (t) => { + // Big ints are serialized as strings in the oplog + _mergeTableTest(t, { + initial: { int8: '3' }, + incoming: { int8: '9223372036854775807' }, + expected: { int8: BigInt('9223372036854775807') }, + }) +}) - // tx2 should win because tx1 and tx2 happened concurrently - // but the timestamp of tx2 > tx1 - t.like(merged, { 'main.floatTable': { [pk]: { optype: 'UPSERT' } } }) - t.deepEqual(merged['main.floatTable'][pk].fullRow, { - id: 1, - value: -Infinity, +test('merge can handle BigInt (BIGINT pgtype) values', (t) => { + // Big ints are serialized as strings in the oplog + _mergeTableTest(t, { + initial: { bigint: '-5' }, + incoming: { bigint: '-9223372036854775808' }, + expected: { bigint: BigInt('-9223372036854775808') }, }) }) const to_commit_timestamp = (timestamp: string): Long => Long.UZERO.add(new Date(timestamp).getTime()) -test('merge can handle NaN values', (t) => { - const pk = primaryKeyToStr({ id: 1 }) +/** + * Merges two secuential transactions over the same row + * and checks that the value is merged correctly + * The operation is over the "mergeTable" table in the + * database schema + */ +function _mergeTableTest( + t: ExecutionContext, + opts: { + initial: Record + incoming: Record + expected: Record + } +) { + if (opts.initial.id !== undefined) { + throw new Error('id must not be provided in initial') + } + if (opts.incoming.id !== undefined) { + throw new Error('id must not be provided in incoming') + } + if (opts.expected.id !== undefined) { + throw new Error('id must not be provided in expected') + } + + const pkId = 1 + const pk = primaryKeyToStr({ id: pkId }) const tx1: DataTransaction = { lsn: DEFAULT_LOG_POS, commit_timestamp: to_commit_timestamp('1970-01-02T03:46:41.000Z'), changes: [ { - relation: relations.floatTable, + relation: relations.mergeTable, type: DataChangeType.INSERT, - record: { id: 1, value: 5.0 }, + record: { ...opts.initial, id: pkId }, tags: [], }, ], @@ -125,9 +135,9 @@ test('merge can handle NaN values', (t) => { commit_timestamp: to_commit_timestamp('1970-01-02T03:46:42.000Z'), changes: [ { - relation: relations.floatTable, + relation: relations.mergeTable, type: DataChangeType.INSERT, - record: { id: 1, value: NaN }, + record: { ...opts.incoming, id: pkId }, tags: [], }, ], @@ -142,9 +152,13 @@ test('merge can handle NaN values', (t) => { // tx2 should win because tx1 and tx2 happened concurrently // but the timestamp of tx2 > tx1 - t.like(merged, { 'main.floatTable': { [pk]: { optype: 'UPSERT' } } }) - t.deepEqual(merged['main.floatTable'][pk].fullRow, { id: 1, value: NaN }) -}) + t.like(merged, { 'main.mergeTable': { [pk]: { optype: 'UPSERT' } } }) + + t.deepEqual(merged['main.mergeTable'][pk].fullRow, { + ...opts.expected, + id: pkId, + }) +} test('merge works on oplog entries', (t) => { const db = new Database(':memory:') @@ -153,7 +167,7 @@ test('merge works on oplog entries', (t) => { migrateDb(db, personTable) // Insert a row in the table - const insertRowSQL = `INSERT INTO ${personTable.tableName} (id, name, age, bmi) VALUES (9e999, 'John Doe', 30, 25.5)` + const insertRowSQL = `INSERT INTO ${personTable.tableName} (id, name, age, bmi, int8) VALUES (9e999, 'John Doe', 30, 25.5, 7)` db.exec(insertRowSQL) // Fetch the oplog entry for the inserted row @@ -174,7 +188,14 @@ test('merge works on oplog entries', (t) => { { relation: relations[personTable.tableName as keyof typeof relations], type: DataChangeType.INSERT, - record: { age: 30, bmi: 8e888, id: 9e999, name: 'John Doe' }, // fields must be ordered alphabetically to match the behavior of the triggers + record: { + // fields must be ordered alphabetically to match the behavior of the triggers + age: 30, + bmi: 8e888, + id: 9e999, + int8: '224', // Big ints are serialized as strings in the oplog + name: 'John Doe', + }, tags: [], }, ], @@ -200,5 +221,6 @@ test('merge works on oplog entries', (t) => { name: 'John Doe', age: 30, bmi: Infinity, + int8: 224n, }) })