From b145fcc74a6279b9e2c2219b33cd8166eec71db3 Mon Sep 17 00:00:00 2001 From: deyvisonwanderley Date: Wed, 3 Dec 2025 16:19:39 -0300 Subject: [PATCH] refactor: standardize import statements and improve formatting in backend Convex files; update package.json script for consistency --- packages/backend/convex/_generated/api.d.ts | 4464 +++++++++-------- packages/backend/convex/_generated/api.js | 2 +- .../backend/convex/_generated/dataModel.d.ts | 22 +- .../backend/convex/_generated/server.d.ts | 34 +- packages/backend/convex/_generated/server.js | 16 +- packages/backend/package.json | 2 +- 6 files changed, 2444 insertions(+), 2096 deletions(-) diff --git a/packages/backend/convex/_generated/api.d.ts b/packages/backend/convex/_generated/api.d.ts index 8431778..beb3c67 100644 --- a/packages/backend/convex/_generated/api.d.ts +++ b/packages/backend/convex/_generated/api.d.ts @@ -8,168 +8,172 @@ * @module */ -import type * as acoes from '../acoes.js'; -import type * as actions_email from '../actions/email.js'; -import type * as actions_linkPreview from '../actions/linkPreview.js'; -import type * as actions_pushNotifications from '../actions/pushNotifications.js'; -import type * as actions_smtp from '../actions/smtp.js'; -import type * as actions_utils_nodeCrypto from '../actions/utils/nodeCrypto.js'; -import type * as atestadosLicencas from '../atestadosLicencas.js'; -import type * as ausencias from '../ausencias.js'; -import type * as autenticacao from '../autenticacao.js'; -import type * as auth from '../auth.js'; -import type * as auth_utils from '../auth/utils.js'; -import type * as chamadas from '../chamadas.js'; -import type * as chamados from '../chamados.js'; -import type * as chat from '../chat.js'; -import type * as config from '../config.js'; -import type * as configuracaoEmail from '../configuracaoEmail.js'; -import type * as configuracaoJitsi from '../configuracaoJitsi.js'; -import type * as configuracaoPonto from '../configuracaoPonto.js'; -import type * as configuracaoRelogio from '../configuracaoRelogio.js'; -import type * as contratos from '../contratos.js'; -import type * as crons from '../crons.js'; -import type * as cursos from '../cursos.js'; -import type * as dashboard from '../dashboard.js'; -import type * as documentos from '../documentos.js'; -import type * as email from '../email.js'; -import type * as empresas from '../empresas.js'; -import type * as enderecosMarcacao from '../enderecosMarcacao.js'; -import type * as ferias from '../ferias.js'; -import type * as flows from '../flows.js'; -import type * as funcionarioEnderecos from '../funcionarioEnderecos.js'; -import type * as funcionarios from '../funcionarios.js'; -import type * as healthCheck from '../healthCheck.js'; -import type * as http from '../http.js'; -import type * as lgpd from '../lgpd.js'; -import type * as logsAcesso from '../logsAcesso.js'; -import type * as logsAtividades from '../logsAtividades.js'; -import type * as logsLogin from '../logsLogin.js'; -import type * as monitoramento from '../monitoramento.js'; -import type * as pedidos from '../pedidos.js'; -import type * as permissoesAcoes from '../permissoesAcoes.js'; -import type * as pontos from '../pontos.js'; -import type * as preferenciasNotificacao from '../preferenciasNotificacao.js'; -import type * as produtos from '../produtos.js'; -import type * as pushNotifications from '../pushNotifications.js'; -import type * as roles from '../roles.js'; -import type * as saldoFerias from '../saldoFerias.js'; -import type * as security from '../security.js'; -import type * as seed from '../seed.js'; -import type * as setores from '../setores.js'; -import type * as simbolos from '../simbolos.js'; -import type * as tables_atestados from '../tables/atestados.js'; -import type * as tables_ausencias from '../tables/ausencias.js'; -import type * as tables_auth from '../tables/auth.js'; -import type * as tables_chat from '../tables/chat.js'; -import type * as tables_contratos from '../tables/contratos.js'; -import type * as tables_cursos from '../tables/cursos.js'; -import type * as tables_empresas from '../tables/empresas.js'; -import type * as tables_enderecos from '../tables/enderecos.js'; -import type * as tables_ferias from '../tables/ferias.js'; -import type * as tables_flows from '../tables/flows.js'; -import type * as tables_funcionarios from '../tables/funcionarios.js'; -import type * as tables_lgpdTables from '../tables/lgpdTables.js'; -import type * as tables_licencas from '../tables/licencas.js'; -import type * as tables_pedidos from '../tables/pedidos.js'; -import type * as tables_ponto from '../tables/ponto.js'; -import type * as tables_produtos from '../tables/produtos.js'; -import type * as tables_security from '../tables/security.js'; -import type * as tables_setores from '../tables/setores.js'; -import type * as tables_system from '../tables/system.js'; -import type * as tables_tickets from '../tables/tickets.js'; -import type * as tables_times from '../tables/times.js'; -import type * as templatesMensagens from '../templatesMensagens.js'; -import type * as times from '../times.js'; -import type * as usuarios from '../usuarios.js'; -import type * as utils_chatTemplateWrapper from '../utils/chatTemplateWrapper.js'; -import type * as utils_emailTemplateWrapper from '../utils/emailTemplateWrapper.js'; -import type * as utils_getClientIP from '../utils/getClientIP.js'; -import type * as utils_scanEmailSenders from '../utils/scanEmailSenders.js'; -import type * as verificarMatriculas from '../verificarMatriculas.js'; +import type * as acoes from "../acoes.js"; +import type * as actions_email from "../actions/email.js"; +import type * as actions_linkPreview from "../actions/linkPreview.js"; +import type * as actions_pushNotifications from "../actions/pushNotifications.js"; +import type * as actions_smtp from "../actions/smtp.js"; +import type * as actions_utils_nodeCrypto from "../actions/utils/nodeCrypto.js"; +import type * as atestadosLicencas from "../atestadosLicencas.js"; +import type * as ausencias from "../ausencias.js"; +import type * as autenticacao from "../autenticacao.js"; +import type * as auth from "../auth.js"; +import type * as auth_utils from "../auth/utils.js"; +import type * as chamadas from "../chamadas.js"; +import type * as chamados from "../chamados.js"; +import type * as chat from "../chat.js"; +import type * as config from "../config.js"; +import type * as configuracaoEmail from "../configuracaoEmail.js"; +import type * as configuracaoJitsi from "../configuracaoJitsi.js"; +import type * as configuracaoPonto from "../configuracaoPonto.js"; +import type * as configuracaoRelogio from "../configuracaoRelogio.js"; +import type * as contratos from "../contratos.js"; +import type * as crons from "../crons.js"; +import type * as cursos from "../cursos.js"; +import type * as dashboard from "../dashboard.js"; +import type * as documentos from "../documentos.js"; +import type * as email from "../email.js"; +import type * as empresas from "../empresas.js"; +import type * as enderecosMarcacao from "../enderecosMarcacao.js"; +import type * as ferias from "../ferias.js"; +import type * as flows from "../flows.js"; +import type * as funcionarioEnderecos from "../funcionarioEnderecos.js"; +import type * as funcionarios from "../funcionarios.js"; +import type * as healthCheck from "../healthCheck.js"; +import type * as http from "../http.js"; +import type * as lgpd from "../lgpd.js"; +import type * as logsAcesso from "../logsAcesso.js"; +import type * as logsAtividades from "../logsAtividades.js"; +import type * as logsLogin from "../logsLogin.js"; +import type * as monitoramento from "../monitoramento.js"; +import type * as pedidos from "../pedidos.js"; +import type * as permissoesAcoes from "../permissoesAcoes.js"; +import type * as pontos from "../pontos.js"; +import type * as preferenciasNotificacao from "../preferenciasNotificacao.js"; +import type * as produtos from "../produtos.js"; +import type * as pushNotifications from "../pushNotifications.js"; +import type * as roles from "../roles.js"; +import type * as saldoFerias from "../saldoFerias.js"; +import type * as security from "../security.js"; +import type * as seed from "../seed.js"; +import type * as setores from "../setores.js"; +import type * as simbolos from "../simbolos.js"; +import type * as tables_atestados from "../tables/atestados.js"; +import type * as tables_ausencias from "../tables/ausencias.js"; +import type * as tables_auth from "../tables/auth.js"; +import type * as tables_chat from "../tables/chat.js"; +import type * as tables_contratos from "../tables/contratos.js"; +import type * as tables_cursos from "../tables/cursos.js"; +import type * as tables_empresas from "../tables/empresas.js"; +import type * as tables_enderecos from "../tables/enderecos.js"; +import type * as tables_ferias from "../tables/ferias.js"; +import type * as tables_flows from "../tables/flows.js"; +import type * as tables_funcionarios from "../tables/funcionarios.js"; +import type * as tables_lgpdTables from "../tables/lgpdTables.js"; +import type * as tables_licencas from "../tables/licencas.js"; +import type * as tables_pedidos from "../tables/pedidos.js"; +import type * as tables_ponto from "../tables/ponto.js"; +import type * as tables_produtos from "../tables/produtos.js"; +import type * as tables_security from "../tables/security.js"; +import type * as tables_setores from "../tables/setores.js"; +import type * as tables_system from "../tables/system.js"; +import type * as tables_tickets from "../tables/tickets.js"; +import type * as tables_times from "../tables/times.js"; +import type * as templatesMensagens from "../templatesMensagens.js"; +import type * as times from "../times.js"; +import type * as usuarios from "../usuarios.js"; +import type * as utils_chatTemplateWrapper from "../utils/chatTemplateWrapper.js"; +import type * as utils_emailTemplateWrapper from "../utils/emailTemplateWrapper.js"; +import type * as utils_getClientIP from "../utils/getClientIP.js"; +import type * as utils_scanEmailSenders from "../utils/scanEmailSenders.js"; +import type * as verificarMatriculas from "../verificarMatriculas.js"; -import type { ApiFromModules, FilterApi, FunctionReference } from 'convex/server'; +import type { + ApiFromModules, + FilterApi, + FunctionReference, +} from "convex/server"; declare const fullApi: ApiFromModules<{ - acoes: typeof acoes; - 'actions/email': typeof actions_email; - 'actions/linkPreview': typeof actions_linkPreview; - 'actions/pushNotifications': typeof actions_pushNotifications; - 'actions/smtp': typeof actions_smtp; - 'actions/utils/nodeCrypto': typeof actions_utils_nodeCrypto; - atestadosLicencas: typeof atestadosLicencas; - ausencias: typeof ausencias; - autenticacao: typeof autenticacao; - auth: typeof auth; - 'auth/utils': typeof auth_utils; - chamadas: typeof chamadas; - chamados: typeof chamados; - chat: typeof chat; - config: typeof config; - configuracaoEmail: typeof configuracaoEmail; - configuracaoJitsi: typeof configuracaoJitsi; - configuracaoPonto: typeof configuracaoPonto; - configuracaoRelogio: typeof configuracaoRelogio; - contratos: typeof contratos; - crons: typeof crons; - cursos: typeof cursos; - dashboard: typeof dashboard; - documentos: typeof documentos; - email: typeof email; - empresas: typeof empresas; - enderecosMarcacao: typeof enderecosMarcacao; - ferias: typeof ferias; - flows: typeof flows; - funcionarioEnderecos: typeof funcionarioEnderecos; - funcionarios: typeof funcionarios; - healthCheck: typeof healthCheck; - http: typeof http; - lgpd: typeof lgpd; - logsAcesso: typeof logsAcesso; - logsAtividades: typeof logsAtividades; - logsLogin: typeof logsLogin; - monitoramento: typeof monitoramento; - pedidos: typeof pedidos; - permissoesAcoes: typeof permissoesAcoes; - pontos: typeof pontos; - preferenciasNotificacao: typeof preferenciasNotificacao; - produtos: typeof produtos; - pushNotifications: typeof pushNotifications; - roles: typeof roles; - saldoFerias: typeof saldoFerias; - security: typeof security; - seed: typeof seed; - setores: typeof setores; - simbolos: typeof simbolos; - 'tables/atestados': typeof tables_atestados; - 'tables/ausencias': typeof tables_ausencias; - 'tables/auth': typeof tables_auth; - 'tables/chat': typeof tables_chat; - 'tables/contratos': typeof tables_contratos; - 'tables/cursos': typeof tables_cursos; - 'tables/empresas': typeof tables_empresas; - 'tables/enderecos': typeof tables_enderecos; - 'tables/ferias': typeof tables_ferias; - 'tables/flows': typeof tables_flows; - 'tables/funcionarios': typeof tables_funcionarios; - 'tables/lgpdTables': typeof tables_lgpdTables; - 'tables/licencas': typeof tables_licencas; - 'tables/pedidos': typeof tables_pedidos; - 'tables/ponto': typeof tables_ponto; - 'tables/produtos': typeof tables_produtos; - 'tables/security': typeof tables_security; - 'tables/setores': typeof tables_setores; - 'tables/system': typeof tables_system; - 'tables/tickets': typeof tables_tickets; - 'tables/times': typeof tables_times; - templatesMensagens: typeof templatesMensagens; - times: typeof times; - usuarios: typeof usuarios; - 'utils/chatTemplateWrapper': typeof utils_chatTemplateWrapper; - 'utils/emailTemplateWrapper': typeof utils_emailTemplateWrapper; - 'utils/getClientIP': typeof utils_getClientIP; - 'utils/scanEmailSenders': typeof utils_scanEmailSenders; - verificarMatriculas: typeof verificarMatriculas; + acoes: typeof acoes; + "actions/email": typeof actions_email; + "actions/linkPreview": typeof actions_linkPreview; + "actions/pushNotifications": typeof actions_pushNotifications; + "actions/smtp": typeof actions_smtp; + "actions/utils/nodeCrypto": typeof actions_utils_nodeCrypto; + atestadosLicencas: typeof atestadosLicencas; + ausencias: typeof ausencias; + autenticacao: typeof autenticacao; + auth: typeof auth; + "auth/utils": typeof auth_utils; + chamadas: typeof chamadas; + chamados: typeof chamados; + chat: typeof chat; + config: typeof config; + configuracaoEmail: typeof configuracaoEmail; + configuracaoJitsi: typeof configuracaoJitsi; + configuracaoPonto: typeof configuracaoPonto; + configuracaoRelogio: typeof configuracaoRelogio; + contratos: typeof contratos; + crons: typeof crons; + cursos: typeof cursos; + dashboard: typeof dashboard; + documentos: typeof documentos; + email: typeof email; + empresas: typeof empresas; + enderecosMarcacao: typeof enderecosMarcacao; + ferias: typeof ferias; + flows: typeof flows; + funcionarioEnderecos: typeof funcionarioEnderecos; + funcionarios: typeof funcionarios; + healthCheck: typeof healthCheck; + http: typeof http; + lgpd: typeof lgpd; + logsAcesso: typeof logsAcesso; + logsAtividades: typeof logsAtividades; + logsLogin: typeof logsLogin; + monitoramento: typeof monitoramento; + pedidos: typeof pedidos; + permissoesAcoes: typeof permissoesAcoes; + pontos: typeof pontos; + preferenciasNotificacao: typeof preferenciasNotificacao; + produtos: typeof produtos; + pushNotifications: typeof pushNotifications; + roles: typeof roles; + saldoFerias: typeof saldoFerias; + security: typeof security; + seed: typeof seed; + setores: typeof setores; + simbolos: typeof simbolos; + "tables/atestados": typeof tables_atestados; + "tables/ausencias": typeof tables_ausencias; + "tables/auth": typeof tables_auth; + "tables/chat": typeof tables_chat; + "tables/contratos": typeof tables_contratos; + "tables/cursos": typeof tables_cursos; + "tables/empresas": typeof tables_empresas; + "tables/enderecos": typeof tables_enderecos; + "tables/ferias": typeof tables_ferias; + "tables/flows": typeof tables_flows; + "tables/funcionarios": typeof tables_funcionarios; + "tables/lgpdTables": typeof tables_lgpdTables; + "tables/licencas": typeof tables_licencas; + "tables/pedidos": typeof tables_pedidos; + "tables/ponto": typeof tables_ponto; + "tables/produtos": typeof tables_produtos; + "tables/security": typeof tables_security; + "tables/setores": typeof tables_setores; + "tables/system": typeof tables_system; + "tables/tickets": typeof tables_tickets; + "tables/times": typeof tables_times; + templatesMensagens: typeof templatesMensagens; + times: typeof times; + usuarios: typeof usuarios; + "utils/chatTemplateWrapper": typeof utils_chatTemplateWrapper; + "utils/emailTemplateWrapper": typeof utils_emailTemplateWrapper; + "utils/getClientIP": typeof utils_getClientIP; + "utils/scanEmailSenders": typeof utils_scanEmailSenders; + verificarMatriculas: typeof verificarMatriculas; }>; /** @@ -180,7 +184,10 @@ declare const fullApi: ApiFromModules<{ * const myFunctionReference = api.myModule.myFunction; * ``` */ -export declare const api: FilterApi>; +export declare const api: FilterApi< + typeof fullApi, + FunctionReference +>; /** * A utility for referencing Convex functions in your app's internal API. @@ -190,1906 +197,2243 @@ export declare const api: FilterApi>; +export declare const internal: FilterApi< + typeof fullApi, + FunctionReference +>; export declare const components: { - betterAuth: { - adapter: { - create: FunctionReference< - 'mutation', - 'internal', - { - input: - | { - data: { - createdAt: number; - displayUsername?: null | string; - email: string; - emailVerified: boolean; - image?: null | string; - isAnonymous?: null | boolean; - name: string; - phoneNumber?: null | string; - phoneNumberVerified?: null | boolean; - twoFactorEnabled?: null | boolean; - updatedAt: number; - userId?: null | string; - username?: null | string; - }; - model: 'user'; - } - | { - data: { - createdAt: number; - expiresAt: number; - ipAddress?: null | string; - token: string; - updatedAt: number; - userAgent?: null | string; - userId: string; - }; - model: 'session'; - } - | { - data: { - accessToken?: null | string; - accessTokenExpiresAt?: null | number; - accountId: string; - createdAt: number; - idToken?: null | string; - password?: null | string; - providerId: string; - refreshToken?: null | string; - refreshTokenExpiresAt?: null | number; - scope?: null | string; - updatedAt: number; - userId: string; - }; - model: 'account'; - } - | { - data: { - createdAt: number; - expiresAt: number; - identifier: string; - updatedAt: number; - value: string; - }; - model: 'verification'; - } - | { - data: { backupCodes: string; secret: string; userId: string }; - model: 'twoFactor'; - } - | { - data: { - aaguid?: null | string; - backedUp: boolean; - counter: number; - createdAt?: null | number; - credentialID: string; - deviceType: string; - name?: null | string; - publicKey: string; - transports?: null | string; - userId: string; - }; - model: 'passkey'; - } - | { - data: { - clientId?: null | string; - clientSecret?: null | string; - createdAt?: null | number; - disabled?: null | boolean; - icon?: null | string; - metadata?: null | string; - name?: null | string; - redirectURLs?: null | string; - type?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - model: 'oauthApplication'; - } - | { - data: { - accessToken?: null | string; - accessTokenExpiresAt?: null | number; - clientId?: null | string; - createdAt?: null | number; - refreshToken?: null | string; - refreshTokenExpiresAt?: null | number; - scopes?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - model: 'oauthAccessToken'; - } - | { - data: { - clientId?: null | string; - consentGiven?: null | boolean; - createdAt?: null | number; - scopes?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - model: 'oauthConsent'; - } - | { - data: { - createdAt: number; - privateKey: string; - publicKey: string; - }; - model: 'jwks'; - } - | { - data: { - count?: null | number; - key?: null | string; - lastRequest?: null | number; - }; - model: 'rateLimit'; - } - | { - data: { count: number; key: string; lastRequest: number }; - model: 'ratelimit'; - }; - onCreateHandle?: string; - select?: Array; - }, - any - >; - deleteMany: FunctionReference< - 'mutation', - 'internal', - { - input: - | { - model: 'user'; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'name' - | 'email' - | 'emailVerified' - | 'image' - | 'createdAt' - | 'updatedAt' - | 'twoFactorEnabled' - | 'isAnonymous' - | 'username' - | 'displayUsername' - | 'phoneNumber' - | 'phoneNumberVerified' - | 'userId' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'session'; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'expiresAt' - | 'token' - | 'createdAt' - | 'updatedAt' - | 'ipAddress' - | 'userAgent' - | 'userId' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'account'; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'accountId' - | 'providerId' - | 'userId' - | 'accessToken' - | 'refreshToken' - | 'idToken' - | 'accessTokenExpiresAt' - | 'refreshTokenExpiresAt' - | 'scope' - | 'password' - | 'createdAt' - | 'updatedAt' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'verification'; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: 'identifier' | 'value' | 'expiresAt' | 'createdAt' | 'updatedAt' | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'twoFactor'; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: 'secret' | 'backupCodes' | 'userId' | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'passkey'; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'name' - | 'publicKey' - | 'userId' - | 'credentialID' - | 'counter' - | 'deviceType' - | 'backedUp' - | 'transports' - | 'createdAt' - | 'aaguid' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'oauthApplication'; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'name' - | 'icon' - | 'metadata' - | 'clientId' - | 'clientSecret' - | 'redirectURLs' - | 'type' - | 'disabled' - | 'userId' - | 'createdAt' - | 'updatedAt' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'oauthAccessToken'; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'accessToken' - | 'refreshToken' - | 'accessTokenExpiresAt' - | 'refreshTokenExpiresAt' - | 'clientId' - | 'userId' - | 'scopes' - | 'createdAt' - | 'updatedAt' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'oauthConsent'; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'clientId' - | 'userId' - | 'scopes' - | 'createdAt' - | 'updatedAt' - | 'consentGiven' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'jwks'; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: 'publicKey' | 'privateKey' | 'createdAt' | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'rateLimit'; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: 'key' | 'count' | 'lastRequest' | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'ratelimit'; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: 'key' | 'count' | 'lastRequest' | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - }; - onDeleteHandle?: string; - paginationOpts: { - cursor: string | null; - endCursor?: string | null; - id?: number; - maximumBytesRead?: number; - maximumRowsRead?: number; - numItems: number; - }; - }, - any - >; - deleteOne: FunctionReference< - 'mutation', - 'internal', - { - input: - | { - model: 'user'; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'name' - | 'email' - | 'emailVerified' - | 'image' - | 'createdAt' - | 'updatedAt' - | 'twoFactorEnabled' - | 'isAnonymous' - | 'username' - | 'displayUsername' - | 'phoneNumber' - | 'phoneNumberVerified' - | 'userId' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'session'; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'expiresAt' - | 'token' - | 'createdAt' - | 'updatedAt' - | 'ipAddress' - | 'userAgent' - | 'userId' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'account'; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'accountId' - | 'providerId' - | 'userId' - | 'accessToken' - | 'refreshToken' - | 'idToken' - | 'accessTokenExpiresAt' - | 'refreshTokenExpiresAt' - | 'scope' - | 'password' - | 'createdAt' - | 'updatedAt' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'verification'; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: 'identifier' | 'value' | 'expiresAt' | 'createdAt' | 'updatedAt' | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'twoFactor'; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: 'secret' | 'backupCodes' | 'userId' | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'passkey'; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'name' - | 'publicKey' - | 'userId' - | 'credentialID' - | 'counter' - | 'deviceType' - | 'backedUp' - | 'transports' - | 'createdAt' - | 'aaguid' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'oauthApplication'; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'name' - | 'icon' - | 'metadata' - | 'clientId' - | 'clientSecret' - | 'redirectURLs' - | 'type' - | 'disabled' - | 'userId' - | 'createdAt' - | 'updatedAt' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'oauthAccessToken'; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'accessToken' - | 'refreshToken' - | 'accessTokenExpiresAt' - | 'refreshTokenExpiresAt' - | 'clientId' - | 'userId' - | 'scopes' - | 'createdAt' - | 'updatedAt' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'oauthConsent'; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'clientId' - | 'userId' - | 'scopes' - | 'createdAt' - | 'updatedAt' - | 'consentGiven' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'jwks'; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: 'publicKey' | 'privateKey' | 'createdAt' | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'rateLimit'; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: 'key' | 'count' | 'lastRequest' | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'ratelimit'; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: 'key' | 'count' | 'lastRequest' | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - }; - onDeleteHandle?: string; - }, - any - >; - findMany: FunctionReference< - 'query', - 'internal', - { - limit?: number; - model: - | 'user' - | 'session' - | 'account' - | 'verification' - | 'twoFactor' - | 'passkey' - | 'oauthApplication' - | 'oauthAccessToken' - | 'oauthConsent' - | 'jwks' - | 'rateLimit' - | 'ratelimit'; - offset?: number; - paginationOpts: { - cursor: string | null; - endCursor?: string | null; - id?: number; - maximumBytesRead?: number; - maximumRowsRead?: number; - numItems: number; - }; - sortBy?: { direction: 'asc' | 'desc'; field: string }; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: string; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - }, - any - >; - findOne: FunctionReference< - 'query', - 'internal', - { - model: - | 'user' - | 'session' - | 'account' - | 'verification' - | 'twoFactor' - | 'passkey' - | 'oauthApplication' - | 'oauthAccessToken' - | 'oauthConsent' - | 'jwks' - | 'rateLimit' - | 'ratelimit'; - select?: Array; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: string; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - }, - any - >; - migrationRemoveUserId: FunctionReference<'mutation', 'internal', { userId: string }, any>; - updateMany: FunctionReference< - 'mutation', - 'internal', - { - input: - | { - model: 'user'; - update: { - createdAt?: number; - displayUsername?: null | string; - email?: string; - emailVerified?: boolean; - image?: null | string; - isAnonymous?: null | boolean; - name?: string; - phoneNumber?: null | string; - phoneNumberVerified?: null | boolean; - twoFactorEnabled?: null | boolean; - updatedAt?: number; - userId?: null | string; - username?: null | string; - }; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'name' - | 'email' - | 'emailVerified' - | 'image' - | 'createdAt' - | 'updatedAt' - | 'twoFactorEnabled' - | 'isAnonymous' - | 'username' - | 'displayUsername' - | 'phoneNumber' - | 'phoneNumberVerified' - | 'userId' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'session'; - update: { - createdAt?: number; - expiresAt?: number; - ipAddress?: null | string; - token?: string; - updatedAt?: number; - userAgent?: null | string; - userId?: string; - }; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'expiresAt' - | 'token' - | 'createdAt' - | 'updatedAt' - | 'ipAddress' - | 'userAgent' - | 'userId' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'account'; - update: { - accessToken?: null | string; - accessTokenExpiresAt?: null | number; - accountId?: string; - createdAt?: number; - idToken?: null | string; - password?: null | string; - providerId?: string; - refreshToken?: null | string; - refreshTokenExpiresAt?: null | number; - scope?: null | string; - updatedAt?: number; - userId?: string; - }; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'accountId' - | 'providerId' - | 'userId' - | 'accessToken' - | 'refreshToken' - | 'idToken' - | 'accessTokenExpiresAt' - | 'refreshTokenExpiresAt' - | 'scope' - | 'password' - | 'createdAt' - | 'updatedAt' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'verification'; - update: { - createdAt?: number; - expiresAt?: number; - identifier?: string; - updatedAt?: number; - value?: string; - }; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: 'identifier' | 'value' | 'expiresAt' | 'createdAt' | 'updatedAt' | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'twoFactor'; - update: { - backupCodes?: string; - secret?: string; - userId?: string; - }; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: 'secret' | 'backupCodes' | 'userId' | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'passkey'; - update: { - aaguid?: null | string; - backedUp?: boolean; - counter?: number; - createdAt?: null | number; - credentialID?: string; - deviceType?: string; - name?: null | string; - publicKey?: string; - transports?: null | string; - userId?: string; - }; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'name' - | 'publicKey' - | 'userId' - | 'credentialID' - | 'counter' - | 'deviceType' - | 'backedUp' - | 'transports' - | 'createdAt' - | 'aaguid' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'oauthApplication'; - update: { - clientId?: null | string; - clientSecret?: null | string; - createdAt?: null | number; - disabled?: null | boolean; - icon?: null | string; - metadata?: null | string; - name?: null | string; - redirectURLs?: null | string; - type?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'name' - | 'icon' - | 'metadata' - | 'clientId' - | 'clientSecret' - | 'redirectURLs' - | 'type' - | 'disabled' - | 'userId' - | 'createdAt' - | 'updatedAt' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'oauthAccessToken'; - update: { - accessToken?: null | string; - accessTokenExpiresAt?: null | number; - clientId?: null | string; - createdAt?: null | number; - refreshToken?: null | string; - refreshTokenExpiresAt?: null | number; - scopes?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'accessToken' - | 'refreshToken' - | 'accessTokenExpiresAt' - | 'refreshTokenExpiresAt' - | 'clientId' - | 'userId' - | 'scopes' - | 'createdAt' - | 'updatedAt' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'oauthConsent'; - update: { - clientId?: null | string; - consentGiven?: null | boolean; - createdAt?: null | number; - scopes?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'clientId' - | 'userId' - | 'scopes' - | 'createdAt' - | 'updatedAt' - | 'consentGiven' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'jwks'; - update: { - createdAt?: number; - privateKey?: string; - publicKey?: string; - }; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: 'publicKey' | 'privateKey' | 'createdAt' | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'rateLimit'; - update: { - count?: null | number; - key?: null | string; - lastRequest?: null | number; - }; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: 'key' | 'count' | 'lastRequest' | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'ratelimit'; - update: { count?: number; key?: string; lastRequest?: number }; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: 'key' | 'count' | 'lastRequest' | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - }; - onUpdateHandle?: string; - paginationOpts: { - cursor: string | null; - endCursor?: string | null; - id?: number; - maximumBytesRead?: number; - maximumRowsRead?: number; - numItems: number; - }; - }, - any - >; - updateOne: FunctionReference< - 'mutation', - 'internal', - { - input: - | { - model: 'user'; - update: { - createdAt?: number; - displayUsername?: null | string; - email?: string; - emailVerified?: boolean; - image?: null | string; - isAnonymous?: null | boolean; - name?: string; - phoneNumber?: null | string; - phoneNumberVerified?: null | boolean; - twoFactorEnabled?: null | boolean; - updatedAt?: number; - userId?: null | string; - username?: null | string; - }; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'name' - | 'email' - | 'emailVerified' - | 'image' - | 'createdAt' - | 'updatedAt' - | 'twoFactorEnabled' - | 'isAnonymous' - | 'username' - | 'displayUsername' - | 'phoneNumber' - | 'phoneNumberVerified' - | 'userId' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'session'; - update: { - createdAt?: number; - expiresAt?: number; - ipAddress?: null | string; - token?: string; - updatedAt?: number; - userAgent?: null | string; - userId?: string; - }; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'expiresAt' - | 'token' - | 'createdAt' - | 'updatedAt' - | 'ipAddress' - | 'userAgent' - | 'userId' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'account'; - update: { - accessToken?: null | string; - accessTokenExpiresAt?: null | number; - accountId?: string; - createdAt?: number; - idToken?: null | string; - password?: null | string; - providerId?: string; - refreshToken?: null | string; - refreshTokenExpiresAt?: null | number; - scope?: null | string; - updatedAt?: number; - userId?: string; - }; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'accountId' - | 'providerId' - | 'userId' - | 'accessToken' - | 'refreshToken' - | 'idToken' - | 'accessTokenExpiresAt' - | 'refreshTokenExpiresAt' - | 'scope' - | 'password' - | 'createdAt' - | 'updatedAt' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'verification'; - update: { - createdAt?: number; - expiresAt?: number; - identifier?: string; - updatedAt?: number; - value?: string; - }; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: 'identifier' | 'value' | 'expiresAt' | 'createdAt' | 'updatedAt' | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'twoFactor'; - update: { - backupCodes?: string; - secret?: string; - userId?: string; - }; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: 'secret' | 'backupCodes' | 'userId' | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'passkey'; - update: { - aaguid?: null | string; - backedUp?: boolean; - counter?: number; - createdAt?: null | number; - credentialID?: string; - deviceType?: string; - name?: null | string; - publicKey?: string; - transports?: null | string; - userId?: string; - }; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'name' - | 'publicKey' - | 'userId' - | 'credentialID' - | 'counter' - | 'deviceType' - | 'backedUp' - | 'transports' - | 'createdAt' - | 'aaguid' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'oauthApplication'; - update: { - clientId?: null | string; - clientSecret?: null | string; - createdAt?: null | number; - disabled?: null | boolean; - icon?: null | string; - metadata?: null | string; - name?: null | string; - redirectURLs?: null | string; - type?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'name' - | 'icon' - | 'metadata' - | 'clientId' - | 'clientSecret' - | 'redirectURLs' - | 'type' - | 'disabled' - | 'userId' - | 'createdAt' - | 'updatedAt' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'oauthAccessToken'; - update: { - accessToken?: null | string; - accessTokenExpiresAt?: null | number; - clientId?: null | string; - createdAt?: null | number; - refreshToken?: null | string; - refreshTokenExpiresAt?: null | number; - scopes?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'accessToken' - | 'refreshToken' - | 'accessTokenExpiresAt' - | 'refreshTokenExpiresAt' - | 'clientId' - | 'userId' - | 'scopes' - | 'createdAt' - | 'updatedAt' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'oauthConsent'; - update: { - clientId?: null | string; - consentGiven?: null | boolean; - createdAt?: null | number; - scopes?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: - | 'clientId' - | 'userId' - | 'scopes' - | 'createdAt' - | 'updatedAt' - | 'consentGiven' - | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'jwks'; - update: { - createdAt?: number; - privateKey?: string; - publicKey?: string; - }; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: 'publicKey' | 'privateKey' | 'createdAt' | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'rateLimit'; - update: { - count?: null | number; - key?: null | string; - lastRequest?: null | number; - }; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: 'key' | 'count' | 'lastRequest' | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - } - | { - model: 'ratelimit'; - update: { count?: number; key?: string; lastRequest?: number }; - where?: Array<{ - connector?: 'AND' | 'OR'; - field: 'key' | 'count' | 'lastRequest' | '_id'; - operator?: - | 'lt' - | 'lte' - | 'gt' - | 'gte' - | 'eq' - | 'in' - | 'not_in' - | 'ne' - | 'contains' - | 'starts_with' - | 'ends_with'; - value: string | number | boolean | Array | Array | null; - }>; - }; - onUpdateHandle?: string; - }, - any - >; - }; - adapterTest: { - count: FunctionReference<'query', 'internal', any, any>; - create: FunctionReference<'mutation', 'internal', any, any>; - delete: FunctionReference<'mutation', 'internal', any, any>; - deleteMany: FunctionReference<'mutation', 'internal', any, any>; - findMany: FunctionReference<'query', 'internal', any, any>; - findOne: FunctionReference<'query', 'internal', any, any>; - update: FunctionReference<'mutation', 'internal', any, any>; - updateMany: FunctionReference<'mutation', 'internal', any, any>; - }; - }; - rateLimiter: { - lib: { - checkRateLimit: FunctionReference< - 'query', - 'internal', - { - config: - | { - capacity?: number; - kind: 'token bucket'; - maxReserved?: number; - period: number; - rate: number; - shards?: number; - start?: null; - } - | { - capacity?: number; - kind: 'fixed window'; - maxReserved?: number; - period: number; - rate: number; - shards?: number; - start?: number; - }; - count?: number; - key?: string; - name: string; - reserve?: boolean; - throws?: boolean; - }, - { ok: true; retryAfter?: number } | { ok: false; retryAfter: number } - >; - clearAll: FunctionReference<'mutation', 'internal', { before?: number }, null>; - getServerTime: FunctionReference<'mutation', 'internal', {}, number>; - getValue: FunctionReference< - 'query', - 'internal', - { - config: - | { - capacity?: number; - kind: 'token bucket'; - maxReserved?: number; - period: number; - rate: number; - shards?: number; - start?: null; - } - | { - capacity?: number; - kind: 'fixed window'; - maxReserved?: number; - period: number; - rate: number; - shards?: number; - start?: number; - }; - key?: string; - name: string; - sampleShards?: number; - }, - { - config: - | { - capacity?: number; - kind: 'token bucket'; - maxReserved?: number; - period: number; - rate: number; - shards?: number; - start?: null; - } - | { - capacity?: number; - kind: 'fixed window'; - maxReserved?: number; - period: number; - rate: number; - shards?: number; - start?: number; - }; - shard: number; - ts: number; - value: number; - } - >; - rateLimit: FunctionReference< - 'mutation', - 'internal', - { - config: - | { - capacity?: number; - kind: 'token bucket'; - maxReserved?: number; - period: number; - rate: number; - shards?: number; - start?: null; - } - | { - capacity?: number; - kind: 'fixed window'; - maxReserved?: number; - period: number; - rate: number; - shards?: number; - start?: number; - }; - count?: number; - key?: string; - name: string; - reserve?: boolean; - throws?: boolean; - }, - { ok: true; retryAfter?: number } | { ok: false; retryAfter: number } - >; - resetRateLimit: FunctionReference< - 'mutation', - 'internal', - { key?: string; name: string }, - null - >; - }; - time: { - getServerTime: FunctionReference<'mutation', 'internal', {}, number>; - }; - }; + betterAuth: { + adapter: { + create: FunctionReference< + "mutation", + "internal", + { + input: + | { + data: { + createdAt: number; + displayUsername?: null | string; + email: string; + emailVerified: boolean; + image?: null | string; + isAnonymous?: null | boolean; + name: string; + phoneNumber?: null | string; + phoneNumberVerified?: null | boolean; + twoFactorEnabled?: null | boolean; + updatedAt: number; + userId?: null | string; + username?: null | string; + }; + model: "user"; + } + | { + data: { + createdAt: number; + expiresAt: number; + ipAddress?: null | string; + token: string; + updatedAt: number; + userAgent?: null | string; + userId: string; + }; + model: "session"; + } + | { + data: { + accessToken?: null | string; + accessTokenExpiresAt?: null | number; + accountId: string; + createdAt: number; + idToken?: null | string; + password?: null | string; + providerId: string; + refreshToken?: null | string; + refreshTokenExpiresAt?: null | number; + scope?: null | string; + updatedAt: number; + userId: string; + }; + model: "account"; + } + | { + data: { + createdAt: number; + expiresAt: number; + identifier: string; + updatedAt: number; + value: string; + }; + model: "verification"; + } + | { + data: { backupCodes: string; secret: string; userId: string }; + model: "twoFactor"; + } + | { + data: { + aaguid?: null | string; + backedUp: boolean; + counter: number; + createdAt?: null | number; + credentialID: string; + deviceType: string; + name?: null | string; + publicKey: string; + transports?: null | string; + userId: string; + }; + model: "passkey"; + } + | { + data: { + clientId?: null | string; + clientSecret?: null | string; + createdAt?: null | number; + disabled?: null | boolean; + icon?: null | string; + metadata?: null | string; + name?: null | string; + redirectURLs?: null | string; + type?: null | string; + updatedAt?: null | number; + userId?: null | string; + }; + model: "oauthApplication"; + } + | { + data: { + accessToken?: null | string; + accessTokenExpiresAt?: null | number; + clientId?: null | string; + createdAt?: null | number; + refreshToken?: null | string; + refreshTokenExpiresAt?: null | number; + scopes?: null | string; + updatedAt?: null | number; + userId?: null | string; + }; + model: "oauthAccessToken"; + } + | { + data: { + clientId?: null | string; + consentGiven?: null | boolean; + createdAt?: null | number; + scopes?: null | string; + updatedAt?: null | number; + userId?: null | string; + }; + model: "oauthConsent"; + } + | { + data: { + createdAt: number; + privateKey: string; + publicKey: string; + }; + model: "jwks"; + } + | { + data: { + count?: null | number; + key?: null | string; + lastRequest?: null | number; + }; + model: "rateLimit"; + } + | { + data: { count: number; key: string; lastRequest: number }; + model: "ratelimit"; + }; + onCreateHandle?: string; + select?: Array; + }, + any + >; + deleteMany: FunctionReference< + "mutation", + "internal", + { + input: + | { + model: "user"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "name" + | "email" + | "emailVerified" + | "image" + | "createdAt" + | "updatedAt" + | "twoFactorEnabled" + | "isAnonymous" + | "username" + | "displayUsername" + | "phoneNumber" + | "phoneNumberVerified" + | "userId" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "session"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "expiresAt" + | "token" + | "createdAt" + | "updatedAt" + | "ipAddress" + | "userAgent" + | "userId" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "account"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "accountId" + | "providerId" + | "userId" + | "accessToken" + | "refreshToken" + | "idToken" + | "accessTokenExpiresAt" + | "refreshTokenExpiresAt" + | "scope" + | "password" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "verification"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "identifier" + | "value" + | "expiresAt" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "twoFactor"; + where?: Array<{ + connector?: "AND" | "OR"; + field: "secret" | "backupCodes" | "userId" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "passkey"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "name" + | "publicKey" + | "userId" + | "credentialID" + | "counter" + | "deviceType" + | "backedUp" + | "transports" + | "createdAt" + | "aaguid" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "oauthApplication"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "name" + | "icon" + | "metadata" + | "clientId" + | "clientSecret" + | "redirectURLs" + | "type" + | "disabled" + | "userId" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "oauthAccessToken"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "accessToken" + | "refreshToken" + | "accessTokenExpiresAt" + | "refreshTokenExpiresAt" + | "clientId" + | "userId" + | "scopes" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "oauthConsent"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "clientId" + | "userId" + | "scopes" + | "createdAt" + | "updatedAt" + | "consentGiven" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "jwks"; + where?: Array<{ + connector?: "AND" | "OR"; + field: "publicKey" | "privateKey" | "createdAt" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "rateLimit"; + where?: Array<{ + connector?: "AND" | "OR"; + field: "key" | "count" | "lastRequest" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "ratelimit"; + where?: Array<{ + connector?: "AND" | "OR"; + field: "key" | "count" | "lastRequest" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + }; + onDeleteHandle?: string; + paginationOpts: { + cursor: string | null; + endCursor?: string | null; + id?: number; + maximumBytesRead?: number; + maximumRowsRead?: number; + numItems: number; + }; + }, + any + >; + deleteOne: FunctionReference< + "mutation", + "internal", + { + input: + | { + model: "user"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "name" + | "email" + | "emailVerified" + | "image" + | "createdAt" + | "updatedAt" + | "twoFactorEnabled" + | "isAnonymous" + | "username" + | "displayUsername" + | "phoneNumber" + | "phoneNumberVerified" + | "userId" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "session"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "expiresAt" + | "token" + | "createdAt" + | "updatedAt" + | "ipAddress" + | "userAgent" + | "userId" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "account"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "accountId" + | "providerId" + | "userId" + | "accessToken" + | "refreshToken" + | "idToken" + | "accessTokenExpiresAt" + | "refreshTokenExpiresAt" + | "scope" + | "password" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "verification"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "identifier" + | "value" + | "expiresAt" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "twoFactor"; + where?: Array<{ + connector?: "AND" | "OR"; + field: "secret" | "backupCodes" | "userId" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "passkey"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "name" + | "publicKey" + | "userId" + | "credentialID" + | "counter" + | "deviceType" + | "backedUp" + | "transports" + | "createdAt" + | "aaguid" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "oauthApplication"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "name" + | "icon" + | "metadata" + | "clientId" + | "clientSecret" + | "redirectURLs" + | "type" + | "disabled" + | "userId" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "oauthAccessToken"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "accessToken" + | "refreshToken" + | "accessTokenExpiresAt" + | "refreshTokenExpiresAt" + | "clientId" + | "userId" + | "scopes" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "oauthConsent"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "clientId" + | "userId" + | "scopes" + | "createdAt" + | "updatedAt" + | "consentGiven" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "jwks"; + where?: Array<{ + connector?: "AND" | "OR"; + field: "publicKey" | "privateKey" | "createdAt" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "rateLimit"; + where?: Array<{ + connector?: "AND" | "OR"; + field: "key" | "count" | "lastRequest" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "ratelimit"; + where?: Array<{ + connector?: "AND" | "OR"; + field: "key" | "count" | "lastRequest" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + }; + onDeleteHandle?: string; + }, + any + >; + findMany: FunctionReference< + "query", + "internal", + { + limit?: number; + model: + | "user" + | "session" + | "account" + | "verification" + | "twoFactor" + | "passkey" + | "oauthApplication" + | "oauthAccessToken" + | "oauthConsent" + | "jwks" + | "rateLimit" + | "ratelimit"; + offset?: number; + paginationOpts: { + cursor: string | null; + endCursor?: string | null; + id?: number; + maximumBytesRead?: number; + maximumRowsRead?: number; + numItems: number; + }; + sortBy?: { direction: "asc" | "desc"; field: string }; + where?: Array<{ + connector?: "AND" | "OR"; + field: string; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + }, + any + >; + findOne: FunctionReference< + "query", + "internal", + { + model: + | "user" + | "session" + | "account" + | "verification" + | "twoFactor" + | "passkey" + | "oauthApplication" + | "oauthAccessToken" + | "oauthConsent" + | "jwks" + | "rateLimit" + | "ratelimit"; + select?: Array; + where?: Array<{ + connector?: "AND" | "OR"; + field: string; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + }, + any + >; + migrationRemoveUserId: FunctionReference< + "mutation", + "internal", + { userId: string }, + any + >; + updateMany: FunctionReference< + "mutation", + "internal", + { + input: + | { + model: "user"; + update: { + createdAt?: number; + displayUsername?: null | string; + email?: string; + emailVerified?: boolean; + image?: null | string; + isAnonymous?: null | boolean; + name?: string; + phoneNumber?: null | string; + phoneNumberVerified?: null | boolean; + twoFactorEnabled?: null | boolean; + updatedAt?: number; + userId?: null | string; + username?: null | string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "name" + | "email" + | "emailVerified" + | "image" + | "createdAt" + | "updatedAt" + | "twoFactorEnabled" + | "isAnonymous" + | "username" + | "displayUsername" + | "phoneNumber" + | "phoneNumberVerified" + | "userId" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "session"; + update: { + createdAt?: number; + expiresAt?: number; + ipAddress?: null | string; + token?: string; + updatedAt?: number; + userAgent?: null | string; + userId?: string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "expiresAt" + | "token" + | "createdAt" + | "updatedAt" + | "ipAddress" + | "userAgent" + | "userId" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "account"; + update: { + accessToken?: null | string; + accessTokenExpiresAt?: null | number; + accountId?: string; + createdAt?: number; + idToken?: null | string; + password?: null | string; + providerId?: string; + refreshToken?: null | string; + refreshTokenExpiresAt?: null | number; + scope?: null | string; + updatedAt?: number; + userId?: string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "accountId" + | "providerId" + | "userId" + | "accessToken" + | "refreshToken" + | "idToken" + | "accessTokenExpiresAt" + | "refreshTokenExpiresAt" + | "scope" + | "password" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "verification"; + update: { + createdAt?: number; + expiresAt?: number; + identifier?: string; + updatedAt?: number; + value?: string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "identifier" + | "value" + | "expiresAt" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "twoFactor"; + update: { + backupCodes?: string; + secret?: string; + userId?: string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: "secret" | "backupCodes" | "userId" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "passkey"; + update: { + aaguid?: null | string; + backedUp?: boolean; + counter?: number; + createdAt?: null | number; + credentialID?: string; + deviceType?: string; + name?: null | string; + publicKey?: string; + transports?: null | string; + userId?: string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "name" + | "publicKey" + | "userId" + | "credentialID" + | "counter" + | "deviceType" + | "backedUp" + | "transports" + | "createdAt" + | "aaguid" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "oauthApplication"; + update: { + clientId?: null | string; + clientSecret?: null | string; + createdAt?: null | number; + disabled?: null | boolean; + icon?: null | string; + metadata?: null | string; + name?: null | string; + redirectURLs?: null | string; + type?: null | string; + updatedAt?: null | number; + userId?: null | string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "name" + | "icon" + | "metadata" + | "clientId" + | "clientSecret" + | "redirectURLs" + | "type" + | "disabled" + | "userId" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "oauthAccessToken"; + update: { + accessToken?: null | string; + accessTokenExpiresAt?: null | number; + clientId?: null | string; + createdAt?: null | number; + refreshToken?: null | string; + refreshTokenExpiresAt?: null | number; + scopes?: null | string; + updatedAt?: null | number; + userId?: null | string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "accessToken" + | "refreshToken" + | "accessTokenExpiresAt" + | "refreshTokenExpiresAt" + | "clientId" + | "userId" + | "scopes" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "oauthConsent"; + update: { + clientId?: null | string; + consentGiven?: null | boolean; + createdAt?: null | number; + scopes?: null | string; + updatedAt?: null | number; + userId?: null | string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "clientId" + | "userId" + | "scopes" + | "createdAt" + | "updatedAt" + | "consentGiven" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "jwks"; + update: { + createdAt?: number; + privateKey?: string; + publicKey?: string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: "publicKey" | "privateKey" | "createdAt" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "rateLimit"; + update: { + count?: null | number; + key?: null | string; + lastRequest?: null | number; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: "key" | "count" | "lastRequest" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "ratelimit"; + update: { count?: number; key?: string; lastRequest?: number }; + where?: Array<{ + connector?: "AND" | "OR"; + field: "key" | "count" | "lastRequest" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + }; + onUpdateHandle?: string; + paginationOpts: { + cursor: string | null; + endCursor?: string | null; + id?: number; + maximumBytesRead?: number; + maximumRowsRead?: number; + numItems: number; + }; + }, + any + >; + updateOne: FunctionReference< + "mutation", + "internal", + { + input: + | { + model: "user"; + update: { + createdAt?: number; + displayUsername?: null | string; + email?: string; + emailVerified?: boolean; + image?: null | string; + isAnonymous?: null | boolean; + name?: string; + phoneNumber?: null | string; + phoneNumberVerified?: null | boolean; + twoFactorEnabled?: null | boolean; + updatedAt?: number; + userId?: null | string; + username?: null | string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "name" + | "email" + | "emailVerified" + | "image" + | "createdAt" + | "updatedAt" + | "twoFactorEnabled" + | "isAnonymous" + | "username" + | "displayUsername" + | "phoneNumber" + | "phoneNumberVerified" + | "userId" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "session"; + update: { + createdAt?: number; + expiresAt?: number; + ipAddress?: null | string; + token?: string; + updatedAt?: number; + userAgent?: null | string; + userId?: string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "expiresAt" + | "token" + | "createdAt" + | "updatedAt" + | "ipAddress" + | "userAgent" + | "userId" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "account"; + update: { + accessToken?: null | string; + accessTokenExpiresAt?: null | number; + accountId?: string; + createdAt?: number; + idToken?: null | string; + password?: null | string; + providerId?: string; + refreshToken?: null | string; + refreshTokenExpiresAt?: null | number; + scope?: null | string; + updatedAt?: number; + userId?: string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "accountId" + | "providerId" + | "userId" + | "accessToken" + | "refreshToken" + | "idToken" + | "accessTokenExpiresAt" + | "refreshTokenExpiresAt" + | "scope" + | "password" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "verification"; + update: { + createdAt?: number; + expiresAt?: number; + identifier?: string; + updatedAt?: number; + value?: string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "identifier" + | "value" + | "expiresAt" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "twoFactor"; + update: { + backupCodes?: string; + secret?: string; + userId?: string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: "secret" | "backupCodes" | "userId" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "passkey"; + update: { + aaguid?: null | string; + backedUp?: boolean; + counter?: number; + createdAt?: null | number; + credentialID?: string; + deviceType?: string; + name?: null | string; + publicKey?: string; + transports?: null | string; + userId?: string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "name" + | "publicKey" + | "userId" + | "credentialID" + | "counter" + | "deviceType" + | "backedUp" + | "transports" + | "createdAt" + | "aaguid" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "oauthApplication"; + update: { + clientId?: null | string; + clientSecret?: null | string; + createdAt?: null | number; + disabled?: null | boolean; + icon?: null | string; + metadata?: null | string; + name?: null | string; + redirectURLs?: null | string; + type?: null | string; + updatedAt?: null | number; + userId?: null | string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "name" + | "icon" + | "metadata" + | "clientId" + | "clientSecret" + | "redirectURLs" + | "type" + | "disabled" + | "userId" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "oauthAccessToken"; + update: { + accessToken?: null | string; + accessTokenExpiresAt?: null | number; + clientId?: null | string; + createdAt?: null | number; + refreshToken?: null | string; + refreshTokenExpiresAt?: null | number; + scopes?: null | string; + updatedAt?: null | number; + userId?: null | string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "accessToken" + | "refreshToken" + | "accessTokenExpiresAt" + | "refreshTokenExpiresAt" + | "clientId" + | "userId" + | "scopes" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "oauthConsent"; + update: { + clientId?: null | string; + consentGiven?: null | boolean; + createdAt?: null | number; + scopes?: null | string; + updatedAt?: null | number; + userId?: null | string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "clientId" + | "userId" + | "scopes" + | "createdAt" + | "updatedAt" + | "consentGiven" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "jwks"; + update: { + createdAt?: number; + privateKey?: string; + publicKey?: string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: "publicKey" | "privateKey" | "createdAt" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "rateLimit"; + update: { + count?: null | number; + key?: null | string; + lastRequest?: null | number; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: "key" | "count" | "lastRequest" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "ratelimit"; + update: { count?: number; key?: string; lastRequest?: number }; + where?: Array<{ + connector?: "AND" | "OR"; + field: "key" | "count" | "lastRequest" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + }; + onUpdateHandle?: string; + }, + any + >; + }; + adapterTest: { + count: FunctionReference<"query", "internal", any, any>; + create: FunctionReference<"mutation", "internal", any, any>; + delete: FunctionReference<"mutation", "internal", any, any>; + deleteMany: FunctionReference<"mutation", "internal", any, any>; + findMany: FunctionReference<"query", "internal", any, any>; + findOne: FunctionReference<"query", "internal", any, any>; + update: FunctionReference<"mutation", "internal", any, any>; + updateMany: FunctionReference<"mutation", "internal", any, any>; + }; + }; + rateLimiter: { + lib: { + checkRateLimit: FunctionReference< + "query", + "internal", + { + config: + | { + capacity?: number; + kind: "token bucket"; + maxReserved?: number; + period: number; + rate: number; + shards?: number; + start?: null; + } + | { + capacity?: number; + kind: "fixed window"; + maxReserved?: number; + period: number; + rate: number; + shards?: number; + start?: number; + }; + count?: number; + key?: string; + name: string; + reserve?: boolean; + throws?: boolean; + }, + { ok: true; retryAfter?: number } | { ok: false; retryAfter: number } + >; + clearAll: FunctionReference< + "mutation", + "internal", + { before?: number }, + null + >; + getServerTime: FunctionReference<"mutation", "internal", {}, number>; + getValue: FunctionReference< + "query", + "internal", + { + config: + | { + capacity?: number; + kind: "token bucket"; + maxReserved?: number; + period: number; + rate: number; + shards?: number; + start?: null; + } + | { + capacity?: number; + kind: "fixed window"; + maxReserved?: number; + period: number; + rate: number; + shards?: number; + start?: number; + }; + key?: string; + name: string; + sampleShards?: number; + }, + { + config: + | { + capacity?: number; + kind: "token bucket"; + maxReserved?: number; + period: number; + rate: number; + shards?: number; + start?: null; + } + | { + capacity?: number; + kind: "fixed window"; + maxReserved?: number; + period: number; + rate: number; + shards?: number; + start?: number; + }; + shard: number; + ts: number; + value: number; + } + >; + rateLimit: FunctionReference< + "mutation", + "internal", + { + config: + | { + capacity?: number; + kind: "token bucket"; + maxReserved?: number; + period: number; + rate: number; + shards?: number; + start?: null; + } + | { + capacity?: number; + kind: "fixed window"; + maxReserved?: number; + period: number; + rate: number; + shards?: number; + start?: number; + }; + count?: number; + key?: string; + name: string; + reserve?: boolean; + throws?: boolean; + }, + { ok: true; retryAfter?: number } | { ok: false; retryAfter: number } + >; + resetRateLimit: FunctionReference< + "mutation", + "internal", + { key?: string; name: string }, + null + >; + }; + time: { + getServerTime: FunctionReference<"mutation", "internal", {}, number>; + }; + }; }; diff --git a/packages/backend/convex/_generated/api.js b/packages/backend/convex/_generated/api.js index 24593c7..44bf985 100644 --- a/packages/backend/convex/_generated/api.js +++ b/packages/backend/convex/_generated/api.js @@ -8,7 +8,7 @@ * @module */ -import { anyApi, componentsGeneric } from 'convex/server'; +import { anyApi, componentsGeneric } from "convex/server"; /** * A utility for referencing Convex functions in your app's API. diff --git a/packages/backend/convex/_generated/dataModel.d.ts b/packages/backend/convex/_generated/dataModel.d.ts index 1a3ea26..8541f31 100644 --- a/packages/backend/convex/_generated/dataModel.d.ts +++ b/packages/backend/convex/_generated/dataModel.d.ts @@ -9,13 +9,13 @@ */ import type { - DataModelFromSchemaDefinition, - DocumentByName, - TableNamesInDataModel, - SystemTableNames -} from 'convex/server'; -import type { GenericId } from 'convex/values'; -import schema from '../schema.js'; + DataModelFromSchemaDefinition, + DocumentByName, + TableNamesInDataModel, + SystemTableNames, +} from "convex/server"; +import type { GenericId } from "convex/values"; +import schema from "../schema.js"; /** * The names of all of your Convex tables. @@ -27,7 +27,10 @@ export type TableNames = TableNamesInDataModel; * * @typeParam TableName - A string literal type of the table name (like "users"). */ -export type Doc = DocumentByName; +export type Doc = DocumentByName< + DataModel, + TableName +>; /** * An identifier for a document in Convex. @@ -42,7 +45,8 @@ export type Doc = DocumentByName = GenericId; +export type Id = + GenericId; /** * A type describing your Convex data model. diff --git a/packages/backend/convex/_generated/server.d.ts b/packages/backend/convex/_generated/server.d.ts index 1cc047e..bec05e6 100644 --- a/packages/backend/convex/_generated/server.d.ts +++ b/packages/backend/convex/_generated/server.d.ts @@ -9,17 +9,17 @@ */ import { - ActionBuilder, - HttpActionBuilder, - MutationBuilder, - QueryBuilder, - GenericActionCtx, - GenericMutationCtx, - GenericQueryCtx, - GenericDatabaseReader, - GenericDatabaseWriter -} from 'convex/server'; -import type { DataModel } from './dataModel.js'; + ActionBuilder, + HttpActionBuilder, + MutationBuilder, + QueryBuilder, + GenericActionCtx, + GenericMutationCtx, + GenericQueryCtx, + GenericDatabaseReader, + GenericDatabaseWriter, +} from "convex/server"; +import type { DataModel } from "./dataModel.js"; /** * Define a query in this Convex app's public API. @@ -29,7 +29,7 @@ import type { DataModel } from './dataModel.js'; * @param func - The query function. It receives a {@link QueryCtx} as its first argument. * @returns The wrapped query. Include this as an `export` to name it and make it accessible. */ -export declare const query: QueryBuilder; +export declare const query: QueryBuilder; /** * Define a query that is only accessible from other Convex functions (but not from the client). @@ -39,7 +39,7 @@ export declare const query: QueryBuilder; * @param func - The query function. It receives a {@link QueryCtx} as its first argument. * @returns The wrapped query. Include this as an `export` to name it and make it accessible. */ -export declare const internalQuery: QueryBuilder; +export declare const internalQuery: QueryBuilder; /** * Define a mutation in this Convex app's public API. @@ -49,7 +49,7 @@ export declare const internalQuery: QueryBuilder; * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument. * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible. */ -export declare const mutation: MutationBuilder; +export declare const mutation: MutationBuilder; /** * Define a mutation that is only accessible from other Convex functions (but not from the client). @@ -59,7 +59,7 @@ export declare const mutation: MutationBuilder; * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument. * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible. */ -export declare const internalMutation: MutationBuilder; +export declare const internalMutation: MutationBuilder; /** * Define an action in this Convex app's public API. @@ -72,7 +72,7 @@ export declare const internalMutation: MutationBuilder; * @param func - The action. It receives an {@link ActionCtx} as its first argument. * @returns The wrapped action. Include this as an `export` to name it and make it accessible. */ -export declare const action: ActionBuilder; +export declare const action: ActionBuilder; /** * Define an action that is only accessible from other Convex functions (but not from the client). @@ -80,7 +80,7 @@ export declare const action: ActionBuilder; * @param func - The function. It receives an {@link ActionCtx} as its first argument. * @returns The wrapped function. Include this as an `export` to name it and make it accessible. */ -export declare const internalAction: ActionBuilder; +export declare const internalAction: ActionBuilder; /** * Define an HTTP action. diff --git a/packages/backend/convex/_generated/server.js b/packages/backend/convex/_generated/server.js index a18aa28..bf3d25a 100644 --- a/packages/backend/convex/_generated/server.js +++ b/packages/backend/convex/_generated/server.js @@ -9,14 +9,14 @@ */ import { - actionGeneric, - httpActionGeneric, - queryGeneric, - mutationGeneric, - internalActionGeneric, - internalMutationGeneric, - internalQueryGeneric -} from 'convex/server'; + actionGeneric, + httpActionGeneric, + queryGeneric, + mutationGeneric, + internalActionGeneric, + internalMutationGeneric, + internalQueryGeneric, +} from "convex/server"; /** * Define a query in this Convex app's public API. diff --git a/packages/backend/package.json b/packages/backend/package.json index 301292e..abb03b2 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -2,7 +2,7 @@ "name": "@sgse-app/backend", "version": "1.0.0", "scripts": { - "dev": "convex dev", + "dev": "convex dev", "dev:setup": "convex dev --configure --until-success", "lint": "eslint .", "format": "prettier --write ."