diff --git a/.vscode/settings.json b/.vscode/settings.json index 4f9b40e..324766b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,8 +12,12 @@ // }, "eslint.useFlatConfig": true, "eslint.workingDirectories": [ - { "pattern": "apps/*" }, - { "pattern": "packages/*" } + { + "pattern": "apps/*" + }, + { + "pattern": "packages/*" + } ], "eslint.validate": [ "javascript", @@ -25,5 +29,18 @@ "eslint.options": { "cache": true, "cacheLocation": ".eslintcache" - } -} + }, + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit", + "source.addMissingImports": "always", + "source.removeUnusedImports": "always", + }, + "[typescript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[jsonc]": { + "editor.defaultFormatter": "vscode.json-language-features" + }, + "editor.tabSize": 2 +} \ No newline at end of file diff --git a/apps/web/src/lib/components/chat/PresenceManager.svelte b/apps/web/src/lib/components/chat/PresenceManager.svelte index 9dbc147..b513151 100644 --- a/apps/web/src/lib/components/chat/PresenceManager.svelte +++ b/apps/web/src/lib/components/chat/PresenceManager.svelte @@ -7,9 +7,7 @@ // Verificar se o usuário está autenticado antes de gerenciar presença const currentUser = useQuery(api.auth.getCurrentUser, {}); - let usuarioAutenticado = $derived( - currentUser?.data !== null && currentUser?.data !== undefined - ); + let usuarioAutenticado = $derived(currentUser?.data !== null && currentUser?.data !== undefined); // Token é passado automaticamente via interceptadores em +layout.svelte diff --git a/apps/web/src/lib/components/ferias/DashboardFerias.svelte b/apps/web/src/lib/components/ferias/DashboardFerias.svelte index a87d45e..9fbd989 100644 --- a/apps/web/src/lib/components/ferias/DashboardFerias.svelte +++ b/apps/web/src/lib/components/ferias/DashboardFerias.svelte @@ -25,9 +25,7 @@ solicitacoes.filter((s) => s.status === 'aprovado' || s.status === 'data_ajustada_aprovada') .length ); - let pendentes = $derived( - solicitacoes.filter((s) => s.status === 'aguardando_aprovacao').length - ); + let pendentes = $derived(solicitacoes.filter((s) => s.status === 'aguardando_aprovacao').length); let reprovadas = $derived(solicitacoes.filter((s) => s.status === 'reprovado').length); // Canvas para gráfico de pizza diff --git a/apps/web/src/routes/(dashboard)/pedidos/[id]/+page.svelte b/apps/web/src/routes/(dashboard)/pedidos/[id]/+page.svelte index 0b7dc25..d6f02f8 100644 --- a/apps/web/src/routes/(dashboard)/pedidos/[id]/+page.svelte +++ b/apps/web/src/routes/(dashboard)/pedidos/[id]/+page.svelte @@ -311,9 +311,7 @@ const message = (e as Error).message || String(e); if ( - message.includes( - 'Todos os itens do pedido devem usar a mesma modalidade e a mesma ata' - ) + message.includes('Todos os itens do pedido devem usar a mesma modalidade e a mesma ata') ) { toast.error( 'Não é possível adicionar este item, pois o pedido já possui uma combinação diferente de modalidade e ata. Ajuste os itens existentes ou crie um novo pedido para a nova combinação.' diff --git a/apps/web/src/routes/(dashboard)/pedidos/novo/+page.svelte b/apps/web/src/routes/(dashboard)/pedidos/novo/+page.svelte index 032810c..eb4c9bb 100644 --- a/apps/web/src/routes/(dashboard)/pedidos/novo/+page.svelte +++ b/apps/web/src/routes/(dashboard)/pedidos/novo/+page.svelte @@ -37,9 +37,7 @@ let selectedItems = $state([]); let selectedObjetoIds = $derived(selectedItems.map((i) => i.objeto._id)); - let hasMixedModalidades = $derived( - new Set(selectedItems.map((i) => i.modalidade)).size > 1 - ); + let hasMixedModalidades = $derived(new Set(selectedItems.map((i) => i.modalidade)).size > 1); // Item configuration modal let showItemModal = $state(false); @@ -267,7 +265,7 @@ ? selectedItems.map((item) => ({ objetoId: item.objeto._id, modalidade: item.modalidade - })) + })) : undefined; const result = await client.query(api.pedidos.checkExisting, { @@ -440,7 +438,9 @@
- Qtd: {item.quantidade} {item.objeto.unidade} + Qtd: + {item.quantidade} + {item.objeto.unidade}
@@ -478,9 +478,7 @@ {#if hasMixedModalidades} -
+

Modalidades diferentes detectadas

Não é possível criar o pedido com itens de modalidades diferentes. Ajuste os itens para diff --git a/apps/web/src/routes/(dashboard)/perfil/+page.svelte b/apps/web/src/routes/(dashboard)/perfil/+page.svelte index cc6820a..408a55a 100644 --- a/apps/web/src/routes/(dashboard)/perfil/+page.svelte +++ b/apps/web/src/routes/(dashboard)/perfil/+page.svelte @@ -125,9 +125,7 @@ let gestorIdDisponivel = $derived(currentUser?.data?._id ?? null); // Verificar autenticação antes de executar queries - let usuarioAutenticado = $derived( - currentUser?.data !== null && currentUser?.data !== undefined - ); + let usuarioAutenticado = $derived(currentUser?.data !== null && currentUser?.data !== undefined); // ✅ CORRIGIDO: Queries condicionais - só executar se usuário estiver autenticado // Queries que não requerem argumentos são criadas uma vez diff --git a/apps/web/src/routes/(dashboard)/perfil/chamados/+page.svelte b/apps/web/src/routes/(dashboard)/perfil/chamados/+page.svelte index 05b64dd..fc8e97e 100644 --- a/apps/web/src/routes/(dashboard)/perfil/chamados/+page.svelte +++ b/apps/web/src/routes/(dashboard)/perfil/chamados/+page.svelte @@ -32,9 +32,7 @@ let sucessoMensagem = $state(null); let listaChamados = $derived($ticketsStore); - let detalheAtual = $derived( - selectedTicketId ? ($detalhesStore[selectedTicketId] ?? null) : null - ); + let detalheAtual = $derived(selectedTicketId ? ($detalhesStore[selectedTicketId] ?? null) : null); let ticketsFiltrados = $derived( listaChamados.filter((ticket) => { if (filtroStatus !== 'todos' && ticket.status !== filtroStatus) return false; diff --git a/apps/web/src/routes/(dashboard)/recursos-humanos/funcionarios/cadastro/+page.svelte b/apps/web/src/routes/(dashboard)/recursos-humanos/funcionarios/cadastro/+page.svelte index bd4151c..0fbddf9 100644 --- a/apps/web/src/routes/(dashboard)/recursos-humanos/funcionarios/cadastro/+page.svelte +++ b/apps/web/src/routes/(dashboard)/recursos-humanos/funcionarios/cadastro/+page.svelte @@ -68,9 +68,9 @@ let naturalidade = $state(''); let naturalidadeUF = $state(''); let sexo = $state<'masculino' | 'feminino' | 'outro' | null>(null); - let estadoCivil = $state< - 'solteiro' | 'casado' | 'divorciado' | 'viuvo' | 'uniao_estavel' | null - >(null); + let estadoCivil = $state<'solteiro' | 'casado' | 'divorciado' | 'viuvo' | 'uniao_estavel' | null>( + null + ); let nacionalidade = $state('Brasileira'); // Documentos Pessoais diff --git a/packages/backend/convex/_generated/api.d.ts b/packages/backend/convex/_generated/api.d.ts index 584f0e6..49dcbf5 100644 --- a/packages/backend/convex/_generated/api.d.ts +++ b/packages/backend/convex/_generated/api.d.ts @@ -8,174 +8,170 @@ * @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 atas from "../atas.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 logsAcesso from "../logsAcesso.js"; -import type * as logsAtividades from "../logsAtividades.js"; -import type * as logsLogin from "../logsLogin.js"; -import type * as menu from "../menu.js"; -import type * as monitoramento from "../monitoramento.js"; -import type * as objetos from "../objetos.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 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_atas from "../tables/atas.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_licencas from "../tables/licencas.js"; -import type * as tables_objetos from "../tables/objetos.js"; -import type * as tables_pedidos from "../tables/pedidos.js"; -import type * as tables_ponto from "../tables/ponto.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 atas from '../atas.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 logsAcesso from '../logsAcesso.js'; +import type * as logsAtividades from '../logsAtividades.js'; +import type * as logsLogin from '../logsLogin.js'; +import type * as menu from '../menu.js'; +import type * as monitoramento from '../monitoramento.js'; +import type * as objetos from '../objetos.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 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_atas from '../tables/atas.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_licencas from '../tables/licencas.js'; +import type * as tables_objetos from '../tables/objetos.js'; +import type * as tables_pedidos from '../tables/pedidos.js'; +import type * as tables_ponto from '../tables/ponto.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; - atas: typeof atas; - 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; - logsAcesso: typeof logsAcesso; - logsAtividades: typeof logsAtividades; - logsLogin: typeof logsLogin; - menu: typeof menu; - monitoramento: typeof monitoramento; - objetos: typeof objetos; - pedidos: typeof pedidos; - permissoesAcoes: typeof permissoesAcoes; - pontos: typeof pontos; - preferenciasNotificacao: typeof preferenciasNotificacao; - pushNotifications: typeof pushNotifications; - roles: typeof roles; - saldoFerias: typeof saldoFerias; - security: typeof security; - seed: typeof seed; - setores: typeof setores; - simbolos: typeof simbolos; - "tables/atas": typeof tables_atas; - "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/licencas": typeof tables_licencas; - "tables/objetos": typeof tables_objetos; - "tables/pedidos": typeof tables_pedidos; - "tables/ponto": typeof tables_ponto; - "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; + atas: typeof atas; + 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; + logsAcesso: typeof logsAcesso; + logsAtividades: typeof logsAtividades; + logsLogin: typeof logsLogin; + menu: typeof menu; + monitoramento: typeof monitoramento; + objetos: typeof objetos; + pedidos: typeof pedidos; + permissoesAcoes: typeof permissoesAcoes; + pontos: typeof pontos; + preferenciasNotificacao: typeof preferenciasNotificacao; + pushNotifications: typeof pushNotifications; + roles: typeof roles; + saldoFerias: typeof saldoFerias; + security: typeof security; + seed: typeof seed; + setores: typeof setores; + simbolos: typeof simbolos; + 'tables/atas': typeof tables_atas; + '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/licencas': typeof tables_licencas; + 'tables/objetos': typeof tables_objetos; + 'tables/pedidos': typeof tables_pedidos; + 'tables/ponto': typeof tables_ponto; + '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; }>; /** @@ -186,10 +182,7 @@ declare const fullApi: ApiFromModules<{ * const myFunctionReference = api.myModule.myFunction; * ``` */ -export declare const api: FilterApi< - typeof fullApi, - FunctionReference ->; +export declare const api: FilterApi>; /** * A utility for referencing Convex functions in your app's internal API. @@ -199,2243 +192,1906 @@ export declare const api: FilterApi< * const myFunctionReference = internal.myModule.myFunction; * ``` */ -export declare const internal: FilterApi< - typeof fullApi, - FunctionReference ->; +export declare const internal: FilterApi>; 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 44bf985..24593c7 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 8541f31..1a3ea26 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,10 +27,7 @@ export type TableNames = TableNamesInDataModel; * * @typeParam TableName - A string literal type of the table name (like "users"). */ -export type Doc = DocumentByName< - DataModel, - TableName ->; +export type Doc = DocumentByName; /** * An identifier for a document in Convex. @@ -45,8 +42,7 @@ export type Doc = DocumentByName< * * @typeParam TableName - A string literal type of the table name (like "users"). */ -export type Id = - 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 bec05e6..1cc047e 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 bf3d25a..a18aa28 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/convex/pedidos.ts b/packages/backend/convex/pedidos.ts index 46a3b92..9adcde4 100644 --- a/packages/backend/convex/pedidos.ts +++ b/packages/backend/convex/pedidos.ts @@ -36,9 +36,8 @@ async function ensurePedidoModalidadeAtaConsistency( for (const item of items) { if (ignoreItemId && item._id === ignoreItemId) continue; - const normalizedItemAtaId = (('ataId' in item ? item.ataId : undefined) ?? null) as - | Id<'atas'> - | null; + const normalizedItemAtaId = (('ataId' in item ? item.ataId : undefined) ?? + null) as Id<'atas'> | null; if (item.modalidade !== modalidade || normalizedItemAtaId !== normalizedNewAtaId) { throw new Error( @@ -656,12 +655,7 @@ export const addItem = mutation({ // Regra global: todos os itens do pedido devem ter a mesma // modalidade e a mesma ata (quando houver). - await ensurePedidoModalidadeAtaConsistency( - ctx, - args.pedidoId, - args.modalidade, - args.ataId - ); + await ensurePedidoModalidadeAtaConsistency(ctx, args.pedidoId, args.modalidade, args.ataId); // --- CHECK ANALYSIS / ACCEPTANCE MODE --- if (pedido.status === 'em_analise' || pedido.status === 'aguardando_aceite') {