mirror of
https://github.com/ZeroCatDev/ClassworksKV.git
synced 2026-02-03 23:23:10 +00:00
233 lines
15 KiB
TypeScript
233 lines
15 KiB
TypeScript
|
|
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
|
|
/* eslint-disable */
|
|
// biome-ignore-all lint: generated file
|
|
// @ts-nocheck
|
|
/*
|
|
* WARNING: This is an internal file that is subject to change!
|
|
*
|
|
* 🛑 Under no circumstances should you import this file directly! 🛑
|
|
*
|
|
* Please import the `PrismaClient` class from the `client.ts` file instead.
|
|
*/
|
|
|
|
import * as runtime from "@prisma/client/runtime/client"
|
|
import type * as Prisma from "./prismaNamespace.ts"
|
|
|
|
|
|
const config: runtime.GetPrismaClientConfig = {
|
|
"previewFeatures": [],
|
|
"clientVersion": "7.3.0",
|
|
"engineVersion": "9d6ad21cbbceab97458517b147a6a09ff43aa735",
|
|
"activeProvider": "postgresql",
|
|
"inlineSchema": "generator client {\n provider = \"prisma-client\"\n output = \"../generated/prisma\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n}\n\nmodel Account {\n id String @id(map: \"idx_18303_PRIMARY\") @db.VarChar(191)\n provider String @db.VarChar(191)\n providerId String @db.VarChar(191)\n email String? @db.VarChar(191)\n name String? @db.VarChar(191)\n avatarUrl String? @db.VarChar(191)\n providerData Json? @db.Json\n accessToken String?\n createdAt DateTime @default(now()) @db.Timestamptz(6)\n updatedAt DateTime @default(now()) @updatedAt @db.Timestamptz(6)\n refreshToken String?\n refreshTokenExpiry DateTime? @db.Timestamptz(6)\n tokenVersion Int @default(1)\n\n devices Device[]\n\n @@unique([provider, providerId], map: \"idx_18303_Account_provider_providerId_key\")\n}\n\nmodel AppInstall {\n id String @id(map: \"idx_18310_PRIMARY\") @db.VarChar(191)\n deviceId Int\n appId String @db.VarChar(191)\n token String @unique(map: \"idx_18310_AppInstall_token_key\") @db.VarChar(191)\n note String? @db.VarChar(191)\n installedAt DateTime @default(now()) @db.Timestamptz(6)\n updatedAt DateTime @default(now()) @updatedAt @db.Timestamptz(6)\n deviceType String? @db.VarChar(191)\n isReadOnly Boolean @default(false)\n\n device Device @relation(fields: [deviceId], references: [id], onDelete: Cascade)\n\n @@index([deviceId], map: \"idx_18310_AppInstall_deviceId_fkey\")\n}\n\nmodel AutoAuth {\n id String @id(map: \"idx_18317_PRIMARY\") @db.VarChar(191)\n deviceId Int\n password String? @db.VarChar(191)\n deviceType String? @db.VarChar(191)\n isReadOnly Boolean @default(false)\n createdAt DateTime @default(now()) @db.Timestamptz(6)\n updatedAt DateTime @default(now()) @updatedAt @db.Timestamptz(6)\n\n device Device @relation(fields: [deviceId], references: [id], onDelete: Cascade)\n\n @@unique([deviceId, password], map: \"idx_18317_AutoAuth_deviceId_password_key\")\n}\n\nmodel Device {\n id Int @id(map: \"idx_18324_PRIMARY\")\n uuid String @unique(map: \"idx_18324_Device_uuid_key\") @db.VarChar(191)\n name String? @db.VarChar(191)\n accountId String? @db.VarChar(191)\n createdAt DateTime @default(now()) @db.Timestamptz(6)\n updatedAt DateTime @default(now()) @updatedAt @db.Timestamptz(6)\n password String? @db.VarChar(191)\n passwordHint String? @db.VarChar(191)\n namespace String? @unique(map: \"idx_18324_Device_namespace_key\") @db.VarChar(191)\n\n // 关联关系\n account Account? @relation(fields: [accountId], references: [id], onDelete: SetNull)\n appInstalls AppInstall[]\n kvStore KVStore[] // 设备相关的KV存储\n autoAuths AutoAuth[] // 自动授权配置\n\n @@index([accountId], map: \"idx_18324_Device_accountId_fkey\")\n}\n\nmodel KVStore {\n deviceId Int\n key String @db.VarChar(191)\n value Json @db.Json\n creatorIp String? @default(\"\") @db.VarChar(191)\n createdAt DateTime @default(now()) @db.Timestamptz(6)\n updatedAt DateTime @default(now()) @updatedAt @db.Timestamptz(6)\n\n device Device @relation(fields: [deviceId], references: [id], onDelete: Cascade)\n\n @@id([deviceId, key], map: \"idx_18330_PRIMARY\")\n}\n",
|
|
"runtimeDataModel": {
|
|
"models": {},
|
|
"enums": {},
|
|
"types": {}
|
|
}
|
|
}
|
|
|
|
config.runtimeDataModel = JSON.parse("{\"models\":{\"Account\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"provider\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"providerId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"avatarUrl\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"providerData\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"accessToken\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"refreshToken\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"refreshTokenExpiry\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"tokenVersion\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"devices\",\"kind\":\"object\",\"type\":\"Device\",\"relationName\":\"AccountToDevice\"}],\"dbName\":null},\"AppInstall\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"deviceId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"appId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"token\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"note\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"installedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deviceType\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"isReadOnly\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"device\",\"kind\":\"object\",\"type\":\"Device\",\"relationName\":\"AppInstallToDevice\"}],\"dbName\":null},\"AutoAuth\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"deviceId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"password\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"deviceType\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"isReadOnly\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"device\",\"kind\":\"object\",\"type\":\"Device\",\"relationName\":\"AutoAuthToDevice\"}],\"dbName\":null},\"Device\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"uuid\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"accountId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"password\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"passwordHint\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"namespace\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account\",\"kind\":\"object\",\"type\":\"Account\",\"relationName\":\"AccountToDevice\"},{\"name\":\"appInstalls\",\"kind\":\"object\",\"type\":\"AppInstall\",\"relationName\":\"AppInstallToDevice\"},{\"name\":\"kvStore\",\"kind\":\"object\",\"type\":\"KVStore\",\"relationName\":\"DeviceToKVStore\"},{\"name\":\"autoAuths\",\"kind\":\"object\",\"type\":\"AutoAuth\",\"relationName\":\"AutoAuthToDevice\"}],\"dbName\":null},\"KVStore\":{\"fields\":[{\"name\":\"deviceId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"key\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"value\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"creatorIp\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"device\",\"kind\":\"object\",\"type\":\"Device\",\"relationName\":\"DeviceToKVStore\"}],\"dbName\":null}},\"enums\":{},\"types\":{}}")
|
|
|
|
async function decodeBase64AsWasm(wasmBase64: string): Promise<WebAssembly.Module> {
|
|
const { Buffer } = await import('node:buffer')
|
|
const wasmArray = Buffer.from(wasmBase64, 'base64')
|
|
return new WebAssembly.Module(wasmArray)
|
|
}
|
|
|
|
config.compilerWasm = {
|
|
getRuntime: async () => await import("@prisma/client/runtime/query_compiler_fast_bg.postgresql.mjs"),
|
|
|
|
getQueryCompilerWasmModule: async () => {
|
|
const { wasm } = await import("@prisma/client/runtime/query_compiler_fast_bg.postgresql.wasm-base64.mjs")
|
|
return await decodeBase64AsWasm(wasm)
|
|
},
|
|
|
|
importName: "./query_compiler_fast_bg.js"
|
|
}
|
|
|
|
|
|
|
|
export type LogOptions<ClientOptions extends Prisma.PrismaClientOptions> =
|
|
'log' extends keyof ClientOptions ? ClientOptions['log'] extends Array<Prisma.LogLevel | Prisma.LogDefinition> ? Prisma.GetEvents<ClientOptions['log']> : never : never
|
|
|
|
export interface PrismaClientConstructor {
|
|
/**
|
|
* ## Prisma Client
|
|
*
|
|
* Type-safe database client for TypeScript
|
|
* @example
|
|
* ```
|
|
* const prisma = new PrismaClient()
|
|
* // Fetch zero or more Accounts
|
|
* const accounts = await prisma.account.findMany()
|
|
* ```
|
|
*
|
|
* Read more in our [docs](https://pris.ly/d/client).
|
|
*/
|
|
|
|
new <
|
|
Options extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions,
|
|
LogOpts extends LogOptions<Options> = LogOptions<Options>,
|
|
OmitOpts extends Prisma.PrismaClientOptions['omit'] = Options extends { omit: infer U } ? U : Prisma.PrismaClientOptions['omit'],
|
|
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
|
|
>(options: Prisma.Subset<Options, Prisma.PrismaClientOptions> ): PrismaClient<LogOpts, OmitOpts, ExtArgs>
|
|
}
|
|
|
|
/**
|
|
* ## Prisma Client
|
|
*
|
|
* Type-safe database client for TypeScript
|
|
* @example
|
|
* ```
|
|
* const prisma = new PrismaClient()
|
|
* // Fetch zero or more Accounts
|
|
* const accounts = await prisma.account.findMany()
|
|
* ```
|
|
*
|
|
* Read more in our [docs](https://pris.ly/d/client).
|
|
*/
|
|
|
|
export interface PrismaClient<
|
|
in LogOpts extends Prisma.LogLevel = never,
|
|
in out OmitOpts extends Prisma.PrismaClientOptions['omit'] = undefined,
|
|
in out ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
|
|
> {
|
|
[K: symbol]: { types: Prisma.TypeMap<ExtArgs>['other'] }
|
|
|
|
$on<V extends LogOpts>(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : Prisma.LogEvent) => void): PrismaClient;
|
|
|
|
/**
|
|
* Connect with the database
|
|
*/
|
|
$connect(): runtime.Types.Utils.JsPromise<void>;
|
|
|
|
/**
|
|
* Disconnect from the database
|
|
*/
|
|
$disconnect(): runtime.Types.Utils.JsPromise<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://pris.ly/d/raw-queries).
|
|
*/
|
|
$executeRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<number>;
|
|
|
|
/**
|
|
* 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://pris.ly/d/raw-queries).
|
|
*/
|
|
$executeRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<number>;
|
|
|
|
/**
|
|
* 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://pris.ly/d/raw-queries).
|
|
*/
|
|
$queryRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<T>;
|
|
|
|
/**
|
|
* 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://pris.ly/d/raw-queries).
|
|
*/
|
|
$queryRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<T>;
|
|
|
|
|
|
/**
|
|
* 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<P extends Prisma.PrismaPromise<any>[]>(arg: [...P], options?: { isolationLevel?: Prisma.TransactionIsolationLevel }): runtime.Types.Utils.JsPromise<runtime.Types.Utils.UnwrapTuple<P>>
|
|
|
|
$transaction<R>(fn: (prisma: Omit<PrismaClient, runtime.ITXClientDenyList>) => runtime.Types.Utils.JsPromise<R>, options?: { maxWait?: number, timeout?: number, isolationLevel?: Prisma.TransactionIsolationLevel }): runtime.Types.Utils.JsPromise<R>
|
|
|
|
$extends: runtime.Types.Extensions.ExtendsHook<"extends", Prisma.TypeMapCb<OmitOpts>, ExtArgs, runtime.Types.Utils.Call<Prisma.TypeMapCb<OmitOpts>, {
|
|
extArgs: ExtArgs
|
|
}>>
|
|
|
|
/**
|
|
* `prisma.account`: Exposes CRUD operations for the **Account** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more Accounts
|
|
* const accounts = await prisma.account.findMany()
|
|
* ```
|
|
*/
|
|
get account(): Prisma.AccountDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.appInstall`: Exposes CRUD operations for the **AppInstall** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more AppInstalls
|
|
* const appInstalls = await prisma.appInstall.findMany()
|
|
* ```
|
|
*/
|
|
get appInstall(): Prisma.AppInstallDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.autoAuth`: Exposes CRUD operations for the **AutoAuth** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more AutoAuths
|
|
* const autoAuths = await prisma.autoAuth.findMany()
|
|
* ```
|
|
*/
|
|
get autoAuth(): Prisma.AutoAuthDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.device`: Exposes CRUD operations for the **Device** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more Devices
|
|
* const devices = await prisma.device.findMany()
|
|
* ```
|
|
*/
|
|
get device(): Prisma.DeviceDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.kVStore`: Exposes CRUD operations for the **KVStore** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more KVStores
|
|
* const kVStores = await prisma.kVStore.findMany()
|
|
* ```
|
|
*/
|
|
get kVStore(): Prisma.KVStoreDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
}
|
|
|
|
export function getPrismaClientClass(): PrismaClientConstructor {
|
|
return runtime.getPrismaClient(config) as unknown as PrismaClientConstructor
|
|
}
|