Fix: Resolver todos los errores de TypeScript

ERRORES RESUELTOS:

1. Colores de botones inválidos → colores válidos:
   - 'orange' → 'warning' (BackendVerificationButton)
   - 'purple' → 'primary' (FrontendVerificationButton)
   - 'red' → 'error' (CheckAuthentikAdminsButton)
   - 'blue' → 'info' (CheckGrupoPruebaButton)
   - 'green' → 'success' (CheckLvl0Button)
   - 'gray' → 'neutral' (CheckPublicAccessButton, UserMetadata)

2. Tipos no exportados en Nuxt UI v4:
   - Removidos imports: ButtonColor, ButtonVariant, ButtonSize
   - Reemplazados con tipos literales inline
   - Removido 'none' de variant (no válido en v4)

3. Subcategoria puede ser null:
   - FormularioMuestra: tipo cambiado a Exclude<Subcategoria, null>
   - sesion.vue: agregado ?? 'null' para key y guards para null

4. process.client no definido:
   - useCatacion.ts: process.client → import.meta.client (2 lugares)
   - Nuxt 4 usa import.meta.client en lugar de process.client

5. process.env en nuxt.config.ts:
   - Removido process.env.NUXT_PUBLIC_AUTHENTIK_URL
   - Nuxt runtimeConfig lee automáticamente de .env
   - Solo valor por defecto necesario

6. Propiedades no válidas en PWA manifest:
   - Removido: capture_links (no existe en ManifestOptions)
   - Removido: url_handlers (no existe en ManifestOptions)
   - Removido: handle_links (no existe en ManifestOptions)

7. Toast props no válidas:
   - Removido: timeout (no existe en Toast type)
   - BackendVerificationButton y FrontendVerificationButton

RESULTADO:
 npx nuxi typecheck pasa sin errores
 Solo warnings de @nuxt/content (no críticos)
This commit is contained in:
2025-10-19 03:14:14 -06:00
parent 6994114d91
commit 599cb24f8d
13 changed files with 23 additions and 34 deletions

View File

@@ -1,6 +1,6 @@
<template>
<UButton
color="orange"
color="warning"
size="lg"
variant="outline"
:loading="loading"
@@ -39,9 +39,8 @@ const handleClick = async () => {
title: 'Verificación Backend',
description: `Usuario: ${response.user.username}
Grupos (${groupCount}): ${groupList}`,
color: 'orange',
icon: 'i-heroicons-server-stack',
timeout: 5000
color: 'warning',
icon: 'i-heroicons-server-stack'
})
} else {
toast.add({

View File

@@ -3,7 +3,7 @@
group-name="authentik Admins"
label="Authentik Admins"
icon="i-heroicons-shield-check"
color="red"
color="error"
variant="soft"
:verify-backend="verifyBackend"
/>

View File

@@ -3,7 +3,7 @@
group-name="grupo-prueba"
label="Grupo Prueba"
icon="i-heroicons-beaker"
color="blue"
color="info"
variant="soft"
:verify-backend="verifyBackend"
/>

View File

@@ -3,7 +3,7 @@
group-name="lvl0"
label="Level 0"
icon="i-heroicons-key"
color="green"
color="success"
variant="soft"
:verify-backend="verifyBackend"
/>

View File

@@ -3,7 +3,7 @@
group-name="public-access"
label="Acceso Público"
icon="i-heroicons-globe-alt"
color="gray"
color="neutral"
variant="soft"
:verify-backend="verifyBackend"
/>

View File

@@ -1,6 +1,6 @@
<template>
<UButton
color="purple"
color="primary"
size="lg"
variant="outline"
@click="handleClick"
@@ -35,9 +35,8 @@ const handleClick = () => {
title: 'Verificación Frontend',
description: `Usuario: ${user.value.username}
Grupos (${groupCount}): ${groupList}`,
color: 'purple',
icon: 'i-heroicons-check-badge',
timeout: 5000
color: 'primary',
icon: 'i-heroicons-check-badge'
})
}
</script>

View File

@@ -15,15 +15,13 @@
</template>
<script setup lang="ts">
import type { ButtonColor, ButtonVariant, ButtonSize } from '#ui/types'
interface Props {
groupName: string
label?: string
icon?: string
color?: ButtonColor
variant?: ButtonVariant
size?: ButtonSize
color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral'
variant?: 'solid' | 'outline' | 'soft' | 'ghost' | 'link' | 'subtle'
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
verifyBackend?: boolean
}

View File

@@ -58,7 +58,7 @@
>
{{ group }}
</UBadge>
<UBadge v-if="user.groups.length === 0" color="gray" variant="soft">
<UBadge v-if="user.groups.length === 0" color="neutral" variant="soft">
Sin grupos asignados
</UBadge>
</div>