Commit Graph

53 Commits

Author SHA1 Message Date
alexrg c33089726c Establecer permisos de funciones y eliminar funciones no utilizadas en las migraciones 2026-02-12 09:37:03 -06:00
alexrg 7755246e8b Agregar supabase/snippets al archivo .gitignore 2026-02-12 09:36:59 -06:00
alexrg 12736b7f1d Actualizar README.md
Deploy Function / deploy (push) Successful in 24s
2026-02-06 15:58:51 +00:00
Guillermo.Arrieta 5c9fde1a9e Generación de datos básicos de asignaturas funcional
Deploy Function / deploy (push) Successful in 24s
close #6:
- Ya se pueden generar asignaturas con IA. Específicamente los datos generales.
- Se actualizaron los tipos de supabase
- Se arreglaron los imports
- TODO: generar contenido temático de la asignatura
2026-02-05 19:42:12 -06:00
Guillermo.Arrieta 7f9226ce38 hotfix de importacion
Deploy Function / deploy (push) Successful in 21s
2026-02-05 16:13:55 -06:00
Guillermo.Arrieta f1563b4cbe Merge pull request 'issue/6-generacin-de-materias' (#16) from issue/6-generacin-de-materias into main
Deploy Function / deploy (push) Failing after 46s
Reviewed-on: AlexRG/genesis-2#16
2026-02-05 22:07:23 +00:00
Guillermo.Arrieta 00f0bddf1c Arreglo de reverts 2026-02-05 16:00:07 -06:00
Guillermo.Arrieta 1ca861c51d Primera versión de la función de ai-generate-subject 2026-02-05 15:54:04 -06:00
Guillermo.Arrieta 42a437afa3 fix(functions): clasificar y estandarizar errores en ai-generate-plan
- Corregido el problema donde la función devolvía siempre 400; ahora se lanzan HttpError con status adecuados (405, 401, 415, 422, 404, 409, 502, 500) según el caso.
- Refactor: usar sendError/sendSuccess y HttpError desde _shared/utils.ts para respuestas consistentes y logging seguro.
- Validación: agrupar errores de parse/validación en un único mensaje numerado (cada error en nueva línea).
- OpenAI: manejo explícito de fallos (MissingEnv, JSON inválido, salida estructurada ausente) y mapeo a status apropiados.
- Supabase: distinguir errores 404/409/500 en consultas e inserts; incluir detalles en internalDetails para diagnóstico server-side.
- Eliminada dependencia de invocación HTTP a ai-structured; usar servicio compartido directo.
- Ajustes menores en mensajes y configuración (deno imports/deno.json) y tests marcados como ignorados donde corresponde.
2026-02-05 15:54:04 -06:00
Guillermo.Arrieta 7660d2c3a0 inicio de funcion de generación de asignatura 2026-02-05 15:53:23 -06:00
Guillermo.Arrieta e5657d6b0f chore(db): actualizar esquema/backups (auditoría de planes, hashes y conversation_id)
- Agrega fn_log_cambios_planes_estudio y trigger para registrar cambios en cambios_plan, usando response_id (reemplaza interaccion_ia_id).
- Extiende planes_estudio con conversation_id (unique) y plan_hash; agrega asignatura_hash en asignaturas; corrige unaccent_immutable y añade extensión http.
- Actualiza seeds/backups (data_backup.sql / scheme_backup.sql) y ajusta script de diff (sql_para_local_como_remoto.sql), elimina el diff viejo y actualiza archivos auxiliares (deno.lock, CLI temp).
2026-02-05 15:52:56 -06:00
alexrg b1a90858dc revert 1af0358e65
Deploy Function / deploy (push) Failing after 43s
revert Merge pull request 'REFACTOR OpenAI service to manage env and convo creation' (#12) from issue/9-hacer-una-funcin-que-inserte-el-id-de-conversacin into main

Reviewed-on: AlexRG/genesis-2#12
2026-02-05 20:41:28 +00:00
roberto.silva 132a51133b revert e1d865e6c3
Deploy Function / deploy (push) Failing after 45s
revert posible solución a issue #60
2026-02-05 16:11:09 +00:00
alexrg 1af0358e65 Merge pull request 'REFACTOR OpenAI service to manage env and convo creation' (#12) from issue/9-hacer-una-funcin-que-inserte-el-id-de-conversacin into main
Deploy Function / deploy (push) Successful in 19s
Reviewed-on: AlexRG/genesis-2#12
2026-02-03 15:39:50 +00:00
alexrg 0b7d2e83d7 Refactor OpenAI service to manage env and convo creation
- Add fromEnv factory to OpenAIService to handle env vars
- Move conversation creation into OpenAIService
- Update create- chat-conversation function to use new OpenAIService
  methods
- Add CORS headers to responses
2026-02-03 09:38:56 -06:00
alexrg b6a2a08e20 Merge pull request 'Edge function que inserta el conversation_id' (#11) from issue/9-hacer-una-funcin-que-inserte-el-id-de-conversacin into main
Deploy Function / deploy (push) Successful in 23s
Reviewed-on: AlexRG/genesis-2#11
2026-02-03 15:27:13 +00:00
alexrg e024057e47 Add create-chat-conversation function and related configurations 2026-02-03 09:26:30 -06:00
Guillermo.Arrieta e1d865e6c3 posible solución a issue #60
Deploy Function / deploy (push) Successful in 21s
2026-01-30 12:24:59 -06:00
Guillermo.Arrieta fdc8b688b3 generacion de plane exitosa y cambios en BDD
Deploy Function / deploy (push) Successful in 24s
2026-01-22 14:34:26 -06:00
Guillermo.Arrieta 8ef3f24652 Versión funcional de creación de plan de estudios con IA 2026-01-22 14:32:22 -06:00
Guillermo.Arrieta f15ab86e7f wip 2026-01-22 14:31:47 -06:00
Guillermo.Arrieta 1727b09bfb Función de ai-structured simplificada + tipado de la entrada 2026-01-22 14:31:47 -06:00
Guillermo.Arrieta 7a29f1a87d Antes de cambio de ai-structured 2026-01-22 14:30:53 -06:00
Guillermo.Arrieta 3170ed6975 Primera version de ai-generate-plan 2026-01-22 14:30:53 -06:00
Guillermo.Arrieta d5a095876e wip 2026-01-22 14:30:53 -06:00
Guillermo.Arrieta bb734cddd8 wip 2026-01-22 14:30:52 -06:00
Guillermo.Arrieta 4f2c117eb8 Merge branch 'main' of https://github.lci.ulsa.mx/AlexRG/genesis-2
Deploy Function / deploy (push) Successful in 25s
2026-01-22 13:52:17 -06:00
Guillermo.Arrieta cd615d1f6e backup de base de datos 2026-01-22 13:52:12 -06:00
alexrg c8a1bbe8e5 Actualizar .gitea/workflows/deploy-functions.yaml
Deploy Function / deploy (push) Successful in 20s
2026-01-22 15:38:58 +00:00
alexrg 52ec28654a Actualizar .gitea/workflows/deploy-functions.yaml
Deploy Function / deploy (push) Successful in 19s
2026-01-22 15:36:30 +00:00
alexrg 88b3e04b41 Actualizar .gitea/workflows/deploy-functions.yaml
Deploy Function / deploy (push) Failing after 15s
2026-01-22 14:26:17 +00:00
alexrg c0b003877c Actualizar .gitea/workflows/deploy-functions.yaml
Deploy Function / deploy (push) Failing after 47s
2026-01-22 14:21:39 +00:00
alexrg cb722a75b3 Actualizar .gitea/workflows/deploy-functions.yaml
Deploy Function / deploy (push) Failing after 1m50s
2026-01-22 14:01:38 +00:00
alexrg 584ff53d8d Actualizar .gitea/workflows/deploy-functions.yaml
Deploy Function / deploy (push) Failing after 23s
2026-01-22 02:25:23 +00:00
alexrg 3012eb15f0 Actualizar .gitea/workflows/deploy-functions.yaml
Deploy Function / deploy (push) Failing after 20s
2026-01-22 00:37:59 +00:00
alexrg 90a3fabcf5 Actualizar .gitea/workflows/deploy-functions.yaml
Deploy Function / deploy (push) Failing after 47s
2026-01-22 00:34:14 +00:00
alexrg 49af8853ea Añadir .gitea/workflows/deploy-functions.yaml
Deploy Function / deploy (push) Failing after 10m50s
2026-01-22 00:07:30 +00:00
alexrg c51281856a feat: update deno.json and deno.lock to include OpenAI and Zod imports; add sample PDF file
- Added imports for OpenAI and Zod in deno.json
- Updated deno.lock with new versions for OpenAI and Zod
- Introduced a sample PDF file demonstrating bookmark functionality
- Refactored ai-structured function to improve error handling and logging
- Updated tests to reflect changes in input structure and expected output
2026-01-19 16:12:17 -06:00
alexrg 1d5d4b6a4e fix: update database queries to use 'template' instead of 'template_id' and adjust related references in ai_generate_plan function 2026-01-16 14:51:42 -06:00
alexrg 6c2faa97f1 test: enhance ai_generate_plan test for structured data validation and normalization 2026-01-16 11:04:28 -06:00
alexrg e321935286 feat: initialize database schema with essential tables, types, and functions for academic management system
- Created multiple tables including 'asignaturas', 'carreras', 'planes_estudio', and others to manage academic entities.
- Defined various ENUM types for categorizing academic roles, task statuses, and notification types.
- Implemented triggers and functions for automatic timestamp updates and validation of cycle numbers in subjects.
- Established foreign key relationships to maintain data integrity across tables.
- Added necessary extensions for enhanced functionality, including 'pgsodium', 'pg_graphql', and 'pg_stat_statements'.
2026-01-16 10:53:32 -06:00
alexrg 81262d706a Refactor input normalization and enhance logging for OpenAI function 2026-01-14 15:25:14 -06:00
alexrg 0d2345a6d6 Add Deno configuration and update dependencies for OpenAI and Supabase 2026-01-14 14:24:49 -06:00
alexrg 3d72e8bbf8 Add initial Supabase configuration and schema setup
- Created connection URL for PostgreSQL in pooler-url file.
- Added PostgreSQL version information in postgres-version file.
- Included project reference in project-ref file.
- Specified REST API version in rest-version file.
- Documented storage migration details in storage-migration file.
- Defined storage version in storage-version file.
- Updated ai-structured function to include logging for EDGE function.
- Established a comprehensive schema.sql file with multiple tables, types, functions, triggers, and permissions for the application.
2026-01-14 14:09:49 -06:00
alexrg 79e66aed63 Update deno.lock to include additional dependencies and specify versions for improved compatibility 2026-01-14 10:34:13 -06:00
alexrg 15b5fac951 Add launch and settings configuration for VSCode, remove unused bun.lock, and implement AI function with structured output handling and tests 2026-01-14 10:31:46 -06:00
alexrg 5917adbe75 Update dependencies in deno.lock and add tests for ai-structured function 2026-01-14 10:30:46 -06:00
alexrg 930556d862 Add configuration files and update dependencies for Supabase functions 2026-01-14 09:28:38 -06:00
alexrg 4fc445db61 Refactor dependency management and improve error handling in Supabase functions 2026-01-13 15:35:43 -06:00
alexrg 411e0f2154 Add deno.lock file and refactor AI function to streamline OpenAI integration 2026-01-13 11:10:41 -06:00