d i f f   - - g i t   a / d e n o . j s o n   b / d e n o . j s o n 
 
 i n d e x   6 0 f 8 1 6 d . . 2 1 2 8 f e 4   1 0 0 6 4 4 
 
 - - -   a / d e n o . j s o n 
 
 + + +   b / d e n o . j s o n 
 
 @ @   - 7 , 6   + 7 , 1 0   @ @ 
 
       " i m p o r t s " :   { 
 
           " @ o p e n a i / o p e n a i " :   " j s r : @ o p e n a i / o p e n a i @ ^ 6 . 1 6 . 0 " , 
 
           " @ z o d / z o d " :   " j s r : @ z o d / z o d @ ^ 4 . 3 . 5 " , 
 
 -         " @ d a v i d / d a x " :   " j s r : @ d a v i d / d a x @ ^ 0 . 4 4 . 2 " 
 
 +         " @ d a v i d / d a x " :   " j s r : @ d a v i d / d a x @ ^ 0 . 4 4 . 2 " , 
 
 +         " z o d " :   " h t t p s : / / d e n o . l a n d / x / z o d @ v 3 . 2 2 . 4 / m o d . t s " , 
 
 +         " o p e n a i " :   " n p m : o p e n a i @ 6 . 1 6 . 0 " , 
 
 +         " @ s u p a b a s e / s u p a b a s e - j s " :   " n p m : @ s u p a b a s e / s u p a b a s e - j s @ 2 " , 
 
 +         " @ s u p a b a s e / f u n c t i o n s - j s / e d g e - r u n t i m e . d . t s " :   " j s r : @ s u p a b a s e / f u n c t i o n s - j s @ ^ 2 / e d g e - r u n t i m e . d . t s " 
 
       } 
 
   } 
 
 d i f f   - - g i t   a / d i f f . t x t   b / d i f f . t x t 
 
 i n d e x   b 2 7 0 4 f c . . e 6 9 d e 2 9   1 0 0 6 4 4 
 
 B i n a r y   f i l e s   a / d i f f . t x t   a n d   b / d i f f . t x t   d i f f e r 
 
 d i f f   - - g i t   a / s u p a b a s e / f u n c t i o n s / _ s h a r e d / d a t a b a s e . t y p e s . t s   b / s u p a b a s e / f u n c t i o n s / _ s h a r e d / d a t a b a s e . t y p e s . t s 
 
 i n d e x   f a 3 e f 8 e . . b f 4 b 9 6 0   1 0 0 6 4 4 
 
 - - -   a / s u p a b a s e / f u n c t i o n s / _ s h a r e d / d a t a b a s e . t y p e s . t s 
 
 + + +   b / s u p a b a s e / f u n c t i o n s / _ s h a r e d / d a t a b a s e . t y p e s . t s 
 
 @ @   - 4 , 7   + 4 , 7   @ @ 
 
           |   b o o l e a n 
 
           |   n u l l 
 
           |   {   [ k e y :   s t r i n g ] :   J s o n   |   u n d e f i n e d   } 
 
 -         |   J s o n [ ] ; 
 
 +         |   A r r a y < J s o n > ; 
 
   
 
   e x p o r t   t y p e   D a t a b a s e   =   { 
 
           / /   A l l o w s   t o   a u t o m a t i c a l l y   i n s t a n t i a t e   c r e a t e C l i e n t   w i t h   r i g h t   o p t i o n s 
 
 @ @   - 9 0 , 6   + 9 0 , 7   @ @   e x p o r t   t y p e   D a t a b a s e   =   { 
 
                                   R o w :   { 
 
                                           a c t u a l i z a d o _ e n :   s t r i n g ; 
 
                                           a c t u a l i z a d o _ p o r :   s t r i n g   |   n u l l ; 
 
 +                                         a s i g n a t u r a _ h a s h :   s t r i n g   |   n u l l ; 
 
                                           c o d i g o :   s t r i n g   |   n u l l ; 
 
                                           c o n t e n i d o _ t e m a t i c o :   J s o n ; 
 
                                           c r e a d o _ e n :   s t r i n g ; 
 
 @ @   - 9 7 , 8   + 9 8 , 8   @ @   e x p o r t   t y p e   D a t a b a s e   =   { 
 
                                           c r e d i t o s :   n u m b e r ; 
 
                                           d a t o s :   J s o n ; 
 
                                           e s t r u c t u r a _ i d :   s t r i n g   |   n u l l ; 
 
 -                                         f a c u l t a d _ p r o p i e t a r i a _ i d :   s t r i n g   |   n u l l ; 
 
 -                                         h o r a s _ s e m a n a :   n u m b e r   |   n u l l ; 
 
 +                                         h o r a s _ a c a d e m i c a s :   n u m b e r   |   n u l l ; 
 
 +                                         h o r a s _ i n d e p e n d i e n t e s :   n u m b e r   |   n u l l ; 
 
                                           i d :   s t r i n g ; 
 
                                           l i n e a _ p l a n _ i d :   s t r i n g   |   n u l l ; 
 
                                           m e t a _ o r i g e n :   J s o n ; 
 
 @ @   - 1 1 4 , 6   + 1 1 5 , 7   @ @   e x p o r t   t y p e   D a t a b a s e   =   { 
 
                                   I n s e r t :   { 
 
                                           a c t u a l i z a d o _ e n ? :   s t r i n g ; 
 
                                           a c t u a l i z a d o _ p o r ? :   s t r i n g   |   n u l l ; 
 
 +                                         a s i g n a t u r a _ h a s h ? :   s t r i n g   |   n u l l ; 
 
                                           c o d i g o ? :   s t r i n g   |   n u l l ; 
 
                                           c o n t e n i d o _ t e m a t i c o ? :   J s o n ; 
 
                                           c r e a d o _ e n ? :   s t r i n g ; 
 
 @ @   - 1 2 1 , 8   + 1 2 3 , 8   @ @   e x p o r t   t y p e   D a t a b a s e   =   { 
 
                                           c r e d i t o s :   n u m b e r ; 
 
                                           d a t o s ? :   J s o n ; 
 
                                           e s t r u c t u r a _ i d ? :   s t r i n g   |   n u l l ; 
 
 -                                         f a c u l t a d _ p r o p i e t a r i a _ i d ? :   s t r i n g   |   n u l l ; 
 
 -                                         h o r a s _ s e m a n a ? :   n u m b e r   |   n u l l ; 
 
 +                                         h o r a s _ a c a d e m i c a s ? :   n u m b e r   |   n u l l ; 
 
 +                                         h o r a s _ i n d e p e n d i e n t e s ? :   n u m b e r   |   n u l l ; 
 
                                           i d ? :   s t r i n g ; 
 
                                           l i n e a _ p l a n _ i d ? :   s t r i n g   |   n u l l ; 
 
                                           m e t a _ o r i g e n ? :   J s o n ; 
 
 @ @   - 1 3 8 , 6   + 1 4 0 , 7   @ @   e x p o r t   t y p e   D a t a b a s e   =   { 
 
                                   U p d a t e :   { 
 
                                           a c t u a l i z a d o _ e n ? :   s t r i n g ; 
 
                                           a c t u a l i z a d o _ p o r ? :   s t r i n g   |   n u l l ; 
 
 +                                         a s i g n a t u r a _ h a s h ? :   s t r i n g   |   n u l l ; 
 
                                           c o d i g o ? :   s t r i n g   |   n u l l ; 
 
                                           c o n t e n i d o _ t e m a t i c o ? :   J s o n ; 
 
                                           c r e a d o _ e n ? :   s t r i n g ; 
 
 @ @   - 1 4 5 , 8   + 1 4 8 , 8   @ @   e x p o r t   t y p e   D a t a b a s e   =   { 
 
                                           c r e d i t o s ? :   n u m b e r ; 
 
                                           d a t o s ? :   J s o n ; 
 
                                           e s t r u c t u r a _ i d ? :   s t r i n g   |   n u l l ; 
 
 -                                         f a c u l t a d _ p r o p i e t a r i a _ i d ? :   s t r i n g   |   n u l l ; 
 
 -                                         h o r a s _ s e m a n a ? :   n u m b e r   |   n u l l ; 
 
 +                                         h o r a s _ a c a d e m i c a s ? :   n u m b e r   |   n u l l ; 
 
 +                                         h o r a s _ i n d e p e n d i e n t e s ? :   n u m b e r   |   n u l l ; 
 
                                           i d ? :   s t r i n g ; 
 
                                           l i n e a _ p l a n _ i d ? :   s t r i n g   |   n u l l ; 
 
                                           m e t a _ o r i g e n ? :   J s o n ; 
 
 @ @   - 1 8 1 , 1 4   + 1 8 4 , 6   @ @   e x p o r t   t y p e   D a t a b a s e   =   { 
 
                                                   r e f e r e n c e d R e l a t i o n :   " e s t r u c t u r a s _ a s i g n a t u r a " ; 
 
                                                   r e f e r e n c e d C o l u m n s :   [ " i d " ] ; 
 
                                           } , 
 
 -                                         { 
 
 -                                                 f o r e i g n K e y N a m e : 
 
 -                                                         " a s i g n a t u r a s _ f a c u l t a d _ p r o p i e t a r i a _ i d _ f k e y " ; 
 
 -                                                 c o l u m n s :   [ " f a c u l t a d _ p r o p i e t a r i a _ i d " ] ; 
 
 -                                                 i s O n e T o O n e :   f a l s e ; 
 
 -                                                 r e f e r e n c e d R e l a t i o n :   " f a c u l t a d e s " ; 
 
 -                                                 r e f e r e n c e d C o l u m n s :   [ " i d " ] ; 
 
 -                                         } , 
 
                                           { 
 
                                                   f o r e i g n K e y N a m e :   " a s i g n a t u r a s _ l i n e a _ p l a n _ f k _ c o m p u e s t a " ; 
 
                                                   c o l u m n s :   [ " l i n e a _ p l a n _ i d " ,   " p l a n _ e s t u d i o _ i d " ] ; 
 
 @ @   - 3 3 2 , 8   + 3 2 7 , 8   @ @   e x p o r t   t y p e   D a t a b a s e   =   { 
 
                                           c a m b i a d o _ p o r :   s t r i n g   |   n u l l ; 
 
                                           c a m p o :   s t r i n g   |   n u l l ; 
 
                                           i d :   s t r i n g ; 
 
 -                                         i n t e r a c c i o n _ i a _ i d :   s t r i n g   |   n u l l ; 
 
                                           p l a n _ e s t u d i o _ i d :   s t r i n g ; 
 
 +                                         r e s p o n s e _ i d :   s t r i n g   |   n u l l ; 
 
                                           t i p o :   D a t a b a s e [ " p u b l i c " ] [ " E n u m s " ] [ " t i p o _ c a m b i o " ] ; 
 
                                           v a l o r _ a n t e r i o r :   J s o n   |   n u l l ; 
 
                                           v a l o r _ n u e v o :   J s o n   |   n u l l ; 
 
 @ @   - 3 4 3 , 8   + 3 3 8 , 8   @ @   e x p o r t   t y p e   D a t a b a s e   =   { 
 
                                           c a m b i a d o _ p o r ? :   s t r i n g   |   n u l l ; 
 
                                           c a m p o ? :   s t r i n g   |   n u l l ; 
 
                                           i d ? :   s t r i n g ; 
 
 -                                         i n t e r a c c i o n _ i a _ i d ? :   s t r i n g   |   n u l l ; 
 
                                           p l a n _ e s t u d i o _ i d :   s t r i n g ; 
 
 +                                         r e s p o n s e _ i d ? :   s t r i n g   |   n u l l ; 
 
                                           t i p o :   D a t a b a s e [ " p u b l i c " ] [ " E n u m s " ] [ " t i p o _ c a m b i o " ] ; 
 
                                           v a l o r _ a n t e r i o r ? :   J s o n   |   n u l l ; 
 
                                           v a l o r _ n u e v o ? :   J s o n   |   n u l l ; 
 
 @ @   - 3 5 4 , 8   + 3 4 9 , 8   @ @   e x p o r t   t y p e   D a t a b a s e   =   { 
 
                                           c a m b i a d o _ p o r ? :   s t r i n g   |   n u l l ; 
 
                                           c a m p o ? :   s t r i n g   |   n u l l ; 
 
                                           i d ? :   s t r i n g ; 
 
 -                                         i n t e r a c c i o n _ i a _ i d ? :   s t r i n g   |   n u l l ; 
 
                                           p l a n _ e s t u d i o _ i d ? :   s t r i n g ; 
 
 +                                         r e s p o n s e _ i d ? :   s t r i n g   |   n u l l ; 
 
                                           t i p o ? :   D a t a b a s e [ " p u b l i c " ] [ " E n u m s " ] [ " t i p o _ c a m b i o " ] ; 
 
                                           v a l o r _ a n t e r i o r ? :   J s o n   |   n u l l ; 
 
                                           v a l o r _ n u e v o ? :   J s o n   |   n u l l ; 
 
 @ @   - 3 6 8 , 2 0   + 3 6 3 , 6   @ @   e x p o r t   t y p e   D a t a b a s e   =   { 
 
                                                   r e f e r e n c e d R e l a t i o n :   " u s u a r i o s _ a p p " ; 
 
                                                   r e f e r e n c e d C o l u m n s :   [ " i d " ] ; 
 
                                           } , 
 
 -                                         { 
 
 -                                                 f o r e i g n K e y N a m e :   " c a m b i o s _ p l a n _ p l a n _ e s t u d i o _ i d _ f k e y " ; 
 
 -                                                 c o l u m n s :   [ " p l a n _ e s t u d i o _ i d " ] ; 
 
 -                                                 i s O n e T o O n e :   f a l s e ; 
 
 -                                                 r e f e r e n c e d R e l a t i o n :   " p l a n e s _ e s t u d i o " ; 
 
 -                                                 r e f e r e n c e d C o l u m n s :   [ " i d " ] ; 
 
 -                                         } , 
 
 -                                         { 
 
 -                                                 f o r e i g n K e y N a m e :   " c a m b i o s _ p l a n _ p l a n _ e s t u d i o _ i d _ f k e y " ; 
 
 -                                                 c o l u m n s :   [ " p l a n _ e s t u d i o _ i d " ] ; 
 
 -                                                 i s O n e T o O n e :   f a l s e ; 
 
 -                                                 r e f e r e n c e d R e l a t i o n :   " p l a n t i l l a _ p l a n " ; 
 
 -                                                 r e f e r e n c e d C o l u m n s :   [ " p l a n _ e s t u d i o _ i d " ] ; 
 
 -                                         } , 
 
                                   ] ; 
 
                           } ; 
 
                           c a r r e r a s :   { 
 
 @ @   - 7 0 8 , 6   + 6 8 9 , 7   @ @   e x p o r t   t y p e   D a t a b a s e   =   { 
 
                                           a c t u a l i z a d o _ e n :   s t r i n g ; 
 
                                           a c t u a l i z a d o _ p o r :   s t r i n g   |   n u l l ; 
 
                                           c a r r e r a _ i d :   s t r i n g ; 
 
 +                                         c o n v e r s a t i o n _ i d :   s t r i n g   |   n u l l ; 
 
                                           c r e a d o _ e n :   s t r i n g ; 
 
                                           c r e a d o _ p o r :   s t r i n g   |   n u l l ; 
 
                                           d a t o s :   J s o n ; 
 
 @ @   - 7 1 9 , 6   + 7 0 1 , 7   @ @   e x p o r t   t y p e   D a t a b a s e   =   { 
 
                                           n o m b r e :   s t r i n g ; 
 
                                           n o m b r e _ s e a r c h :   s t r i n g   |   n u l l ; 
 
                                           n u m e r o _ c i c l o s :   n u m b e r ; 
 
 +                                         p l a n _ h a s h :   s t r i n g   |   n u l l ; 
 
                                           t i p o _ c i c l o :   D a t a b a s e [ " p u b l i c " ] [ " E n u m s " ] [ " t i p o _ c i c l o " ] ; 
 
                                           t i p o _ o r i g e n : 
 
                                                   |   D a t a b a s e [ " p u b l i c " ] [ " E n u m s " ] [ " t i p o _ o r i g e n " ] 
 
 @ @   - 7 2 9 , 6   + 7 1 2 , 7   @ @   e x p o r t   t y p e   D a t a b a s e   =   { 
 
                                           a c t u a l i z a d o _ e n ? :   s t r i n g ; 
 
                                           a c t u a l i z a d o _ p o r ? :   s t r i n g   |   n u l l ; 
 
                                           c a r r e r a _ i d :   s t r i n g ; 
 
 +                                         c o n v e r s a t i o n _ i d ? :   s t r i n g   |   n u l l ; 
 
                                           c r e a d o _ e n ? :   s t r i n g ; 
 
                                           c r e a d o _ p o r ? :   s t r i n g   |   n u l l ; 
 
                                           d a t o s ? :   J s o n ; 
 
 @ @   - 7 4 0 , 6   + 7 2 4 , 7   @ @   e x p o r t   t y p e   D a t a b a s e   =   { 
 
                                           n o m b r e :   s t r i n g ; 
 
                                           n o m b r e _ s e a r c h ? :   s t r i n g   |   n u l l ; 
 
                                           n u m e r o _ c i c l o s :   n u m b e r ; 
 
 +                                         p l a n _ h a s h ? :   s t r i n g   |   n u l l ; 
 
                                           t i p o _ c i c l o :   D a t a b a s e [ " p u b l i c " ] [ " E n u m s " ] [ " t i p o _ c i c l o " ] ; 
 
                                           t i p o _ o r i g e n ? : 
 
                                                   |   D a t a b a s e [ " p u b l i c " ] [ " E n u m s " ] [ " t i p o _ o r i g e n " ] 
 
 @ @   - 7 5 0 , 6   + 7 3 5 , 7   @ @   e x p o r t   t y p e   D a t a b a s e   =   { 
 
                                           a c t u a l i z a d o _ e n ? :   s t r i n g ; 
 
                                           a c t u a l i z a d o _ p o r ? :   s t r i n g   |   n u l l ; 
 
                                           c a r r e r a _ i d ? :   s t r i n g ; 
 
 +                                         c o n v e r s a t i o n _ i d ? :   s t r i n g   |   n u l l ; 
 
                                           c r e a d o _ e n ? :   s t r i n g ; 
 
                                           c r e a d o _ p o r ? :   s t r i n g   |   n u l l ; 
 
                                           d a t o s ? :   J s o n ; 
 
 @ @   - 7 6 1 , 6   + 7 4 7 , 7   @ @   e x p o r t   t y p e   D a t a b a s e   =   { 
 
                                           n o m b r e ? :   s t r i n g ; 
 
                                           n o m b r e _ s e a r c h ? :   s t r i n g   |   n u l l ; 
 
                                           n u m e r o _ c i c l o s ? :   n u m b e r ; 
 
 +                                         p l a n _ h a s h ? :   s t r i n g   |   n u l l ; 
 
                                           t i p o _ c i c l o ? :   D a t a b a s e [ " p u b l i c " ] [ " E n u m s " ] [ " t i p o _ c i c l o " ] ; 
 
                                           t i p o _ o r i g e n ? : 
 
                                                   |   D a t a b a s e [ " p u b l i c " ] [ " E n u m s " ] [ " t i p o _ o r i g e n " ] 
 
 @ @   - 1 1 4 0 , 7   + 1 1 2 7 , 7   @ @   e x p o r t   t y p e   D a t a b a s e   =   { 
 
                           f u e n t e _ c a m b i o :   " H U M A N O "   |   " I A " ; 
 
                           n i v e l _ p l a n _ e s t u d i o : 
 
                                   |   " L i c e n c i a t u r a " 
 
 -                                 |   " M a e s t r    ,% a " 
 
 +                                 |   " M a e s t r % a " 
 
                                   |   " D o c t o r a d o " 
 
                                   |   " E s p e c i a l i d a d " 
 
                                   |   " D i p l o m a d o " 
 
 @ @   - 1 1 6 3 , 7   + 1 1 5 0 , 8   @ @   e x p o r t   t y p e   D a t a b a s e   =   { 
 
                                   |   " A C T U A L I Z A C I O N _ M A P A " 
 
                                   |   " T R A N S I C I O N _ E S T A D O " 
 
                                   |   " O T R O " 
 
 -                                 |   " C R E A C I O N " ; 
 
 +                                 |   " C R E A C I O N " 
 
 +                                 |   " A C T U A L I Z A C I O N " ; 
 
                           t i p o _ c i c l o :   " S e m e s t r e "   |   " C u a t r i m e s t r e "   |   " T r i m e s t r e "   |   " O t r o " ; 
 
                           t i p o _ e s t r u c t u r a _ p l a n :   " C U R R I C U L A R "   |   " N O _ C U R R I C U L A R " ; 
 
                           t i p o _ f u e n t e _ b i b l i o g r a f i a :   " M A N U A L "   |   " B I B L I O T E C A " ; 
 
 @ @   - 1 3 4 3 , 7   + 1 3 3 1 , 7   @ @   e x p o r t   c o n s t   C o n s t a n t s   =   { 
 
                           f u e n t e _ c a m b i o :   [ " H U M A N O " ,   " I A " ] , 
 
                           n i v e l _ p l a n _ e s t u d i o :   [ 
 
                                   " L i c e n c i a t u r a " , 
 
 -                                 " M a e s t r    ,% a " , 
 
 +                                 " M a e s t r % a " , 
 
                                   " D o c t o r a d o " , 
 
                                   " E s p e c i a l i d a d " , 
 
                                   " D i p l o m a d o " , 
 
 @ @   - 1 3 7 0 , 6   + 1 3 5 8 , 7   @ @   e x p o r t   c o n s t   C o n s t a n t s   =   { 
 
                                   " T R A N S I C I O N _ E S T A D O " , 
 
                                   " O T R O " , 
 
                                   " C R E A C I O N " , 
 
 +                                 " A C T U A L I Z A C I O N " , 
 
                           ] , 
 
                           t i p o _ c i c l o :   [ " S e m e s t r e " ,   " C u a t r i m e s t r e " ,   " T r i m e s t r e " ,   " O t r o " ] , 
 
                           t i p o _ e s t r u c t u r a _ p l a n :   [ " C U R R I C U L A R " ,   " N O _ C U R R I C U L A R " ] , 
 
 d i f f   - - g i t   a / s u p a b a s e / f u n c t i o n s / a i - g e n e r a t e - p l a n / i n d e x . t s   b / s u p a b a s e / f u n c t i o n s / a i - g e n e r a t e - p l a n / i n d e x . t s 
 
 i n d e x   0 f 3 1 8 5 b . . 1 d b 2 e e f   1 0 0 6 4 4 
 
 - - -   a / s u p a b a s e / f u n c t i o n s / a i - g e n e r a t e - p l a n / i n d e x . t s 
 
 + + +   b / s u p a b a s e / f u n c t i o n s / a i - g e n e r a t e - p l a n / i n d e x . t s 
 
 @ @   - 3 , 1 0   + 3 , 1 0   @ @ 
 
   / /   T h i s   e n a b l e s   a u t o c o m p l e t e ,   g o   t o   d e f i n i t i o n ,   e t c . 
 
   
 
   / /   S e t u p   t y p e   d e f i n i t i o n s   f o r   b u i l t - i n   S u p a b a s e   R u n t i m e   A P I s 
 
 - i m p o r t   " j s r : @ s u p a b a s e / f u n c t i o n s - j s / e d g e - r u n t i m e . d . t s " ; 
 
 + i m p o r t   " @ s u p a b a s e / f u n c t i o n s - j s / e d g e - r u n t i m e . d . t s " ; 
 
   i m p o r t   {   c o r s H e a d e r s   }   f r o m   " . . / _ s h a r e d / c o r s . t s " ; 
 
   i m p o r t   {   H t t p E r r o r ,   s e n d E r r o r ,   s e n d S u c c e s s   }   f r o m   " . . / _ s h a r e d / u t i l s . t s " ; 
 
 - i m p o r t   {   c r e a t e C l i e n t   }   f r o m   " n p m : @ s u p a b a s e / s u p a b a s e - j s @ 2 " ; 
 
 + i m p o r t   {   c r e a t e C l i e n t   }   f r o m   " @ s u p a b a s e / s u p a b a s e - j s " ; 
 
   i m p o r t   t y p e   {   D a t a b a s e ,   J s o n   }   f r o m   " . . / _ s h a r e d / d a t a b a s e . t y p e s . t s " ; 
 
   i m p o r t   t y p e   {   A I G e n e r a t e P l a n I n p u t   }   f r o m   " . / t y p e s . t s " ; 
 
   i m p o r t   {   z   }   f r o m   " z o d " ; 
 
 d i f f   - - g i t   a / s u p a b a s e / f u n c t i o n s / a i - g e n e r a t e - s u b j e c t / d e n o . j s o n   b / s u p a b a s e / f u n c t i o n s / a i - g e n e r a t e - s u b j e c t / d e n o . j s o n 
 
 i n d e x   f 6 c a 8 4 5 . . 8 b 2 0 4 c a   1 0 0 6 4 4 
 
 - - -   a / s u p a b a s e / f u n c t i o n s / a i - g e n e r a t e - s u b j e c t / d e n o . j s o n 
 
 + + +   b / s u p a b a s e / f u n c t i o n s / a i - g e n e r a t e - s u b j e c t / d e n o . j s o n 
 
 @ @   - 1 , 3   + 1 , 8   @ @ 
 
   { 
 
 -     " i m p o r t s " :   { } 
 
 +     " i m p o r t s " :   { 
 
 +         " z o d " :   " h t t p s : / / d e n o . l a n d / x / z o d @ v 3 . 2 2 . 4 / m o d . t s " , 
 
 +         " o p e n a i " :   " n p m : o p e n a i @ 6 . 1 6 . 0 " , 
 
 +         " @ s u p a b a s e / s u p a b a s e - j s " :   " n p m : @ s u p a b a s e / s u p a b a s e - j s @ 2 " , 
 
 +         " @ s u p a b a s e / f u n c t i o n s - j s / e d g e - r u n t i m e . d . t s " :   " j s r : @ s u p a b a s e / f u n c t i o n s - j s @ ^ 2 / e d g e - r u n t i m e . d . t s " 
 
 +     } 
 
   } 
 
 d i f f   - - g i t   a / s u p a b a s e / f u n c t i o n s / a i - g e n e r a t e - s u b j e c t / i n d e x . t s   b / s u p a b a s e / f u n c t i o n s / a i - g e n e r a t e - s u b j e c t / i n d e x . t s 
 
 i n d e x   e 9 7 4 e a 3 . . 9 0 4 5 8 5 4   1 0 0 6 4 4 
 
 - - -   a / s u p a b a s e / f u n c t i o n s / a i - g e n e r a t e - s u b j e c t / i n d e x . t s 
 
 + + +   b / s u p a b a s e / f u n c t i o n s / a i - g e n e r a t e - s u b j e c t / i n d e x . t s 
 
 @ @   - 1 , 1 2   + 1 , 1 5   @ @ 
 
 - i m p o r t   " j s r : @ s u p a b a s e / f u n c t i o n s - j s / e d g e - r u n t i m e . d . t s " ; 
 
 + i m p o r t   " @ s u p a b a s e / f u n c t i o n s - j s / e d g e - r u n t i m e . d . t s " ; 
 
   i m p o r t   {   c o r s H e a d e r s   }   f r o m   " . . / _ s h a r e d / c o r s . t s " ; 
 
   i m p o r t   {   H t t p E r r o r ,   s e n d E r r o r ,   s e n d S u c c e s s   }   f r o m   " . . / _ s h a r e d / u t i l s . t s " ; 
 
 - i m p o r t   {   c r e a t e C l i e n t   }   f r o m   " n p m : @ s u p a b a s e / s u p a b a s e - j s @ 2 " ; 
 
 + i m p o r t   {   c r e a t e C l i e n t   }   f r o m   " @ s u p a b a s e / s u p a b a s e - j s " ; 
 
   i m p o r t   t y p e   {   D a t a b a s e ,   J s o n   }   f r o m   " . . / _ s h a r e d / d a t a b a s e . t y p e s . t s " ; 
 
 + i m p o r t   {   z   }   f r o m   " z o d " ; 
 
 + i m p o r t   { 
 
 +     O p e n A I S e r v i c e , 
 
 +     t y p e   S t r u c t u r e d R e s p o n s e O p t i o n s , 
 
 + }   f r o m   " . . / _ s h a r e d / o p e n a i - s e r v i c e . t s " ; 
 
   
 
 - c o n s o l e . l o g ( " H e l l o   f r o m   F u n c t i o n s ! " ) ; 
 
 - 
 
 - D e n o . s e r v e ( a s y n c   ( r e q )   = >   { 
 
 + D e n o . s e r v e ( a s y n c   ( r e q :   R e q u e s t ) :   P r o m i s e < R e s p o n s e >   = >   { 
 
       c o n s t   u r l   =   n e w   U R L ( r e q . u r l ) ; 
 
       c o n s t   f u n c t i o n N a m e   =   u r l . p a t h n a m e . s p l i t ( " / " ) . p o p ( ) ; 
 
       c o n s o l e . l o g ( 
 
 @ @   - 1 8 , 6   + 2 1 , 5 2   @ @   D e n o . s e r v e ( a s y n c   ( r e q )   = >   { 
 
       } 
 
   
 
       t r y   { 
 
 +         c o n s t   m e t h o d   =   r e q . m e t h o d ; 
 
 +         i f   ( m e t h o d   ! = =   " P O S T " )   { 
 
 +             c o n s o l e . e r r o r ( 
 
 +                 ` [ $ { 
 
 +                     n e w   D a t e ( ) . t o I S O S t r i n g ( ) 
 
 +                 } ] [ $ { f u n c t i o n N a m e } ] :   I n v a l i d   m e t h o d :   $ { m e t h o d } ` , 
 
 +             ) ; 
 
 +             t h r o w   n e w   H t t p E r r o r ( 
 
 +                 4 0 5 , 
 
 +                 " M % t o d o   n o   p e r m i t i d o . " , 
 
 +                 " M E T H O D _ N O T _ A L L O W E D " , 
 
 +                 {   m e t h o d   } , 
 
 +             ) ; 
 
 +         } 
 
 + 
 
 +         c o n s t   a u t h H e a d e r R a w   =   r e q . h e a d e r s . g e t ( " A u t h o r i z a t i o n " )   ? ? 
 
 +             r e q . h e a d e r s . g e t ( " a u t h o r i z a t i o n " ) ; 
 
 +         i f   ( ! a u t h H e a d e r R a w )   { 
 
 +             c o n s o l e . e r r o r ( 
 
 +                 ` [ $ { 
 
 +                     n e w   D a t e ( ) . t o I S O S t r i n g ( ) 
 
 +                 } ] [ $ { f u n c t i o n N a m e } ] :   M i s s i n g   A u t h o r i z a t i o n   h e a d e r ` , 
 
 +             ) ; 
 
 +             t h r o w   n e w   H t t p E r r o r ( 
 
 +                 4 0 1 , 
 
 +                 " N o   a u t o r i z a d o . " , 
 
 +                 " U N A U T H O R I Z E D " , 
 
 +                 {   r e a s o n :   " m i s s i n g _ a u t h o r i z a t i o n _ h e a d e r "   } , 
 
 +             ) ; 
 
 +         } 
 
 + 
 
 +         c o n s t   c o n t e n t T y p e   =   ( r e q . h e a d e r s . g e t ( " c o n t e n t - t y p e " )   | |   " " ) . t o L o w e r C a s e ( ) ; 
 
 +         i f   ( ! c o n t e n t T y p e . s t a r t s W i t h ( " m u l t i p a r t / f o r m - d a t a " ) )   { 
 
 +             c o n s o l e . e r r o r ( 
 
 +                 ` [ $ { 
 
 +                     n e w   D a t e ( ) . t o I S O S t r i n g ( ) 
 
 +                 } ] [ $ { f u n c t i o n N a m e } ] :   U n s u p p o r t e d   c o n t e n t   t y p e :   $ { c o n t e n t T y p e } ` , 
 
 +             ) ; 
 
 +             t h r o w   n e w   H t t p E r r o r ( 
 
 +                 4 1 5 , 
 
 +                 " C o n t e n t - T y p e   n o   s o p o r t a d o . " , 
 
 +                 " U N S U P P O R T E D _ M E D I A _ T Y P E " , 
 
 +                 {   c o n t e n t T y p e   } , 
 
 +             ) ; 
 
 +         } 
 
 + 
 
           c o n s t   S U P A B A S E _ U R L   =   D e n o . e n v . g e t ( " S U P A B A S E _ U R L " ) ; 
 
           c o n s t   S U P A B A S E _ A N O N _ K E Y   =   D e n o . e n v . g e t ( " S U P A B A S E _ A N O N _ K E Y " ) ; 
 
           i f   ( ! S U P A B A S E _ U R L   | |   ! S U P A B A S E _ A N O N _ K E Y )   { 
 
 @ @   - 5 9 , 2 0   + 1 0 8 , 2 0 7   @ @   D e n o . s e r v e ( a s y n c   ( r e q )   = >   { 
 
               S E R V I C E _ R O L E _ K E Y , 
 
           ) ; 
 
   
 
 -         / /   I N I C I O   D E   C O D I G O   P A R A   D E B B U G G I N G 
 
 +         c o n s t   f o r m D a t a   =   a w a i t   r e q . f o r m D a t a ( ) ; 
 
 +         c o n s t   v a l i d a t i o n   =   p a r s e A n d V a l i d a t e ( f o r m D a t a ) ; 
 
 +         i f   ( ! v a l i d a t i o n . s u c c e s s )   { 
 
 +             c o n s o l e . e r r o r ( 
 
 +                 ` [ $ { n e w   D a t e ( ) . t o I S O S t r i n g ( ) } ] [ $ { f u n c t i o n N a m e } ] :   V a l i d a t i o n   e r r o r s : ` , 
 
 +                 v a l i d a t i o n . e r r o r s , 
 
 +             ) ; 
 
 +             c o n s t   m e s s a g e   =   v a l i d a t i o n . e r r o r s 
 
 +                 . m a p ( ( e ,   i )   = >   ` $ { i   +   1 } .   $ { e } ` ) 
 
 +                 . j o i n ( " \ n " ) ; 
 
 +             t h r o w   n e w   H t t p E r r o r ( 
 
 +                 4 2 2 , 
 
 +                 m e s s a g e , 
 
 +                 " V A L I D A T I O N _ E R R O R " , 
 
 +                 {   e r r o r s :   v a l i d a t i o n . e r r o r s   } , 
 
 +             ) ; 
 
 +         } 
 
 + 
 
 +         c o n s t   p a y l o a d   =   v a l i d a t i o n . d a t a ; 
 
 + 
 
 +         c o n s t   {   d a t a :   e s t r u c t u r a ,   e r r o r :   e s t r u c t u r a E r r o r   }   =   a w a i t   s u p a b a s e S e r v i c e 
 
 +             . f r o m ( " e s t r u c t u r a s _ a s i g n a t u r a " ) 
 
 +             . s e l e c t ( " i d , n o m b r e , d e f i n i c i o n , v e r s i o n " ) 
 
 +             . e q ( " i d " ,   p a y l o a d . d a t o s B a s i c o s . e s t r u c t u r a I d ) 
 
 +             . s i n g l e ( ) ; 
 
 +         i f   ( e s t r u c t u r a E r r o r )   { 
 
 +             c o n s t   m a y b e C o d e   =   ( e s t r u c t u r a E r r o r   a s   {   c o d e ? :   s t r i n g   } ) . c o d e ; 
 
 +             i f   ( m a y b e C o d e   = = =   " P G R S T 1 1 6 " )   { 
 
 +                 t h r o w   n e w   H t t p E r r o r ( 
 
 +                     4 0 4 , 
 
 +                     " N o   s e   e n c o n t r %%  l a   e s t r u c t u r a   d e   l a   a s i g n a t u r a . " , 
 
 +                     " N O T _ F O U N D " , 
 
 +                     { 
 
 +                         t a b l e :   " e s t r u c t u r a s _ a s i g n a t u r a " , 
 
 +                         i d :   p a y l o a d . d a t o s B a s i c o s . e s t r u c t u r a I d , 
 
 +                     } , 
 
 +                 ) ; 
 
 +             } 
 
 +             t h r o w   n e w   H t t p E r r o r ( 
 
 +                 5 0 0 , 
 
 +                 " N o   s e   p u d o   o b t e n e r   l a   e s t r u c t u r a   d e   l a   a s i g n a t u r a . " , 
 
 +                 " S U P A B A S E _ Q U E R Y _ F A I L E D " , 
 
 +                 e s t r u c t u r a E r r o r , 
 
 +             ) ; 
 
 +         } 
 
 + 
 
 +         c o n s t   s y s t e m P r o m p t   = 
 
 +             " E r e s   u n   a s i s t e n t e   e x p e r t o   e n   d i s e %%o   c u r r i c u l a r .   R e s p o n d e   %Q%n i c a m e n t e   c o n   J S O N   v % l i d o   q u e   c u m p l a   e s t r i c t a m e n t e   e l   J S O N   S c h e m a   p r o p o r c i o n a d o . " ; 
 
 + 
 
 +         c o n s t   u s e r P r o m p t   = 
 
 +             ` G e n e r a   u n   b o r r a d o r   c o m p l e t o   c o m p l e t o   d e   u n a   A S I G N A T U R A   c o n   b a s e   e n   l o   s i g u i e n t e : \ n `   + 
 
 +             ` -   N o m b r e   d e   l a   a s i g n a t u r a :   $ { p a y l o a d . d a t o s B a s i c o s . n o m b r e } \ n `   + 
 
 +             ` -   C %%d i g o   ( c l a v e   d e   l a   a s i g n a t u r a ) :   $ { 
 
 +                 p a y l o a d . d a t o s B a s i c o s . c o d i g o   ? ?   " ( n o   e s p e c i f i c a d o ) " 
 
 +             } \ n `   + 
 
 +             ` -   T i p o :   $ { p a y l o a d . d a t o s B a s i c o s . t i p o   ? ?   " ( n o   e s p e c i f i c a d o ) " } \ n `   + 
 
 +             ` -   N %Q%m e r o   d e   c r % d i t o s :   $ { p a y l o a d . d a t o s B a s i c o s . c r e d i t o s } \ n `   + 
 
 +             ` -   H o r a s   a c a d % m i c a s :   $ { 
 
 +                 p a y l o a d . d a t o s B a s i c o s . h o r a s A c a d e m i c a s   ? ?   " ( n o   e s p e c i f i c a d o ) " 
 
 +             } \ n `   + 
 
 +             ` -   H o r a s   i n d e p e n d i e n t e s :   $ { 
 
 +                 p a y l o a d . d a t o s B a s i c o s . h o r a s I n d e p e n d i e n t e s   ? ?   " ( n o   e s p e c i f i c a d o ) " 
 
 +             } \ n `   + 
 
 +             ` -   D e s c r i p c i %%n   d e l   e n f o q u e   a c a d % m i c o   ( s o b r e   e l   c o n t e n i d o   d e   l a   r e s p u e s t a   g e n e r a d a ) :   $ { 
 
 +                 p a y l o a d . i a C o n f i g ? . d e s c r i p c i o n E n f o q u e A c a d e m i c o   ? ?   " ( n i n g u n a ) " 
 
 +             } \ n `   + 
 
 +             ` -   I n s t r u c c i o n e s   a d i c i o n a l e s   ( s o b r e   e l   f o r m a t o   d e   l a   r e s p u e s t a   g e n e r a d a ) :   $ { 
 
 +                 p a y l o a d . i a C o n f i g ? . i n s t r u c c i o n e s A d i c i o n a l e s I A   ? ?   " ( n i n g u n a ) " 
 
 +             } ` ; 
 
 + 
 
 +         c o n s t   s c h e m a D e f :   R e c o r d < s t r i n g ,   u n k n o w n >   = 
 
 +             t y p e o f   e s t r u c t u r a ? . d e f i n i c i o n   = = =   " o b j e c t "   & & 
 
 +                 e s t r u c t u r a ? . d e f i n i c i o n   ! = =   n u l l 
 
 +                 ?   ( e s t r u c t u r a . d e f i n i c i o n   a s   R e c o r d < s t r i n g ,   u n k n o w n > ) 
 
 +                 :   { } ; 
 
 + 
 
 +         c o n s t   a i S t r u c t u r e d P a y l o a d :   S t r u c t u r e d R e s p o n s e O p t i o n s   =   { 
 
 +             m o d e l :   " g p t - 5 - n a n o " , 
 
 +             i n p u t :   [ 
 
 +                 {   r o l e :   " s y s t e m " ,   c o n t e n t :   s y s t e m P r o m p t   } , 
 
 +                 {   r o l e :   " u s e r " ,   c o n t e n t :   u s e r P r o m p t   } , 
 
 +             ] , 
 
 +             t e x t :   { 
 
 +                 f o r m a t :   { 
 
 +                     t y p e :   " j s o n _ s c h e m a " , 
 
 +                     n a m e :   " a s i g n a t u r a _ c o n t e n i d o _ t e m a t i c o " , 
 
 +                     s c h e m a :   s c h e m a D e f , 
 
 +                     s t r i c t :   t r u e , 
 
 +                 } , 
 
 +             } , 
 
 +         } ; 
 
 + 
 
 +         c o n s t   s v c   =   O p e n A I S e r v i c e . f r o m E n v ( ) ; 
 
 +         i f   ( ! ( s v c   i n s t a n c e o f   O p e n A I S e r v i c e ) )   { 
 
 +             t h r o w   n e w   H t t p E r r o r ( 
 
 +                 5 0 0 , 
 
 +                 " C o n f i g u r a c i %%n   d e l   s e r v i d o r   i n c o m p l e t a . " , 
 
 +                 " O P E N A I _ M I S C O N F I G U R E D " , 
 
 +                 s v c , 
 
 +             ) ; 
 
 +         } 
 
 + 
 
 +         c o n s t   a i R e s u l t   =   a w a i t   s v c . c r e a t e S t r u c t u r e d R e s p o n s e ( 
 
 +             a i S t r u c t u r e d P a y l o a d , 
 
 +             p a y l o a d . a r c h i v o s A d j u n t o s , 
 
 +         ) ; 
 
 +         i f   ( ! a i R e s u l t . o k )   { 
 
 +             c o n s t   s t a t u s   =   a i R e s u l t . c o d e   = = =   " M i s s i n g E n v "   ?   5 0 0   :   5 0 2 ; 
 
 +             t h r o w   n e w   H t t p E r r o r ( 
 
 +                 s t a t u s , 
 
 +                 " N o   s e   p u d o   g e n e r a r   l a   a s i g n a t u r a   c o n   I A . " , 
 
 +                 " O P E N A I _ R E Q U E S T _ F A I L E D " , 
 
 +                 a i R e s u l t , 
 
 +             ) ; 
 
 +         } 
 
 + 
 
 +         l e t   a i O u t p u t   =   a i R e s u l t . o u t p u t   ? ?   n u l l ; 
 
 +         i f   ( a i O u t p u t   = =   n u l l   & &   a i R e s u l t . o u t p u t T e x t )   { 
 
 +             t r y   { 
 
 +                 a i O u t p u t   =   J S O N . p a r s e ( a i R e s u l t . o u t p u t T e x t ) ; 
 
 +             }   c a t c h   { 
 
 +                 t h r o w   n e w   H t t p E r r o r ( 
 
 +                     5 0 2 , 
 
 +                     " L a   r e s p u e s t a   d e   l a   I A   n o   e s   J S O N   v % l i d o . " , 
 
 +                     " O P E N A I _ I N V A L I D _ J S O N " , 
 
 +                     {   o u t p u t T e x t :   a i R e s u l t . o u t p u t T e x t   } , 
 
 +                 ) ; 
 
 +             } 
 
 +         } 
 
 +         i f   ( ! a i O u t p u t )   { 
 
 +             t h r o w   n e w   H t t p E r r o r ( 
 
 +                 5 0 2 , 
 
 +                 " L a   r e s p u e s t a   d e   l a   I A   n o   c o n t i e n e   s a l i d a   e s t r u c t u r a d a . " , 
 
 +                 " O P E N A I _ M I S S I N G _ S T R U C T U R E D _ O U T P U T " , 
 
 +                 {   o u t p u t T e x t :   a i R e s u l t . o u t p u t T e x t   ? ?   n u l l   } , 
 
 +             ) ; 
 
 +         } 
 
 + 
 
 +         c o n s t   a i O u t p u t J s o n :   J s o n   =   a i O u t p u t   a s   u n k n o w n   a s   J s o n ; 
 
 + 
 
 +         c o n s t   a s i g n a t u r a I n s e r t : 
 
 +             D a t a b a s e [ " p u b l i c " ] [ " T a b l e s " ] [ " a s i g n a t u r a s " ] [ " I n s e r t " ]   =   { 
 
 +                 p l a n _ e s t u d i o _ i d :   p a y l o a d . p l a n _ e s t u d i o _ i d , 
 
 +                 e s t r u c t u r a _ i d :   p a y l o a d . d a t o s B a s i c o s . e s t r u c t u r a I d , 
 
 +                 n o m b r e :   p a y l o a d . d a t o s B a s i c o s . n o m b r e , 
 
 +                 c o d i g o :   p a y l o a d . d a t o s B a s i c o s . c o d i g o   ? ?   n u l l , 
 
 +                 c r e d i t o s :   p a y l o a d . d a t o s B a s i c o s . c r e d i t o s , 
 
 +                 h o r a s _ a c a d e m i c a s :   p a y l o a d . d a t o s B a s i c o s . h o r a s A c a d e m i c a s   ? ?   n u l l , 
 
 +                 h o r a s _ i n d e p e n d i e n t e s :   p a y l o a d . d a t o s B a s i c o s . h o r a s I n d e p e n d i e n t e s   ? ?   n u l l , 
 
 +                 t i p o :   ( p a y l o a d . d a t o s B a s i c o s . t i p o   ? ?   u n d e f i n e d )   a s   D a t a b a s e [ " p u b l i c " ] [ 
 
 +                     " T a b l e s " 
 
 +                 ] [ " a s i g n a t u r a s " ] [ " I n s e r t " ] [ " t i p o " ] , 
 
 +                 t i p o _ o r i g e n :   " I A " , 
 
 +                 d a t o s :   a i O u t p u t J s o n , 
 
 +                 m e t a _ o r i g e n :   { 
 
 +                     g e n e r a d o _ p o r :   " a i _ g e n e r a t e _ s u b j e c t " , 
 
 +                     a i :   { 
 
 +                         r e s p o n s e I d :   a i R e s u l t . r e s p o n s e I d   ? ?   n u l l , 
 
 +                         c o n v e r s a t i o n I d :   a i R e s u l t . c o n v e r s a t i o n I d   ? ?   n u l l , 
 
 +                         m o d e l :   a i R e s u l t . m o d e l , 
 
 +                         u s a g e :   a i R e s u l t . u s a g e   ? ?   n u l l , 
 
 +                     } , 
 
 +                     r e f e r e n c i a s :   { 
 
 +                         a r c h i v o s R e f e r e n c i a I d s :   p a y l o a d . i a C o n f i g ? . a r c h i v o s R e f e r e n c i a   ? ?   n u l l , 
 
 +                         r e p o s i t o r i o s R e f e r e n c i a :   p a y l o a d . i a C o n f i g ? . r e p o s i t o r i o s R e f e r e n c i a   ? ? 
 
 +                             n u l l , 
 
 +                     } , 
 
 +                     i a C o n f i g :   { 
 
 +                         d e s c r i p c i o n E n f o q u e A c a d e m i c o : 
 
 +                             p a y l o a d . i a C o n f i g ? . d e s c r i p c i o n E n f o q u e A c a d e m i c o   ? ?   n u l l , 
 
 +                         i n s t r u c c i o n e s A d i c i o n a l e s I A : 
 
 +                             p a y l o a d . i a C o n f i g ? . i n s t r u c c i o n e s A d i c i o n a l e s I A   ? ?   n u l l , 
 
 +                     } , 
 
 +                 }   a s   u n k n o w n   a s   J s o n , 
 
 +             } ; 
 
 + 
 
 +         c o n s t   {   d a t a :   a s i g n a t u r a ,   e r r o r :   a s i g n a t u r a E r r o r   }   =   a w a i t   s u p a b a s e S e r v i c e 
 
 +             . f r o m ( " a s i g n a t u r a s " ) 
 
 +             . i n s e r t ( a s i g n a t u r a I n s e r t ) 
 
 +             . s e l e c t ( 
 
 +                 " i d , n o m b r e , c o d i g o , t i p o , c r e d i t o s , h o r a s _ a c a d e m i c a s , h o r a s _ i n d e p e n d i e n t e s , e s t r u c t u r a _ i d , p l a n _ e s t u d i o _ i d , c o n t e n i d o _ t e m a t i c o , m e t a _ o r i g e n , c r e a d o _ e n , a c t u a l i z a d o _ e n " , 
 
 +             ) 
 
 +             . s i n g l e ( ) ; 
 
 + 
 
 +         i f   ( a s i g n a t u r a E r r o r )   { 
 
 +             c o n s t   m a y b e C o d e   =   ( a s i g n a t u r a E r r o r   a s   {   c o d e ? :   s t r i n g   } ) . c o d e ; 
 
 +             c o n s t   s t a t u s   =   m a y b e C o d e   ?   4 0 9   :   5 0 0 ; 
 
 +             t h r o w   n e w   H t t p E r r o r ( 
 
 +                 s t a t u s , 
 
 +                 " N o   s e   p u d o   g u a r d a r   l a   a s i g n a t u r a . " , 
 
 +                 " S U P A B A S E _ I N S E R T _ F A I L E D " , 
 
 +                 {   . . . a s i g n a t u r a E r r o r ,   c o d e :   m a y b e C o d e   } , 
 
 +             ) ; 
 
 +         } 
 
 + 
 
           c o n s o l e . l o g ( 
 
               ` [ $ { 
 
                   n e w   D a t e ( ) . t o I S O S t r i n g ( ) 
 
               } ] [ $ { f u n c t i o n N a m e } ] :   R e q u e s t   p r o c e s s e d   s u c c e s s f u l l y ` , 
 
           ) ; 
 
 -         c o n s t   {   d a t a :   a s i g n a t u r a _ d e b u g ,   e r r o r :   a s i g n a t u r a _ e r r o r   }   = 
 
 -             a w a i t   s u p a b a s e S e r v i c e 
 
 -                 . f r o m ( " a s i g n a t u r a s " ) 
 
 -                 . s e l e c t ( " * " ) 
 
 -                 . e q ( " i d " ,   " 9 d 4 d d a 6 a - 4 8 8 f - 4 2 8 a - 8 a 0 7 - 3 8 0 8 1 5 9 2 a 6 4 1 " ) 
 
 -                 . s i n g l e ( ) ; 
 
 -         r e t u r n   s e n d S u c c e s s ( a s i g n a t u r a _ d e b u g ) ; 
 
 -         / /   F I N   D E   C O D I G O   P A R A   D E B B U G G I N G 
 
 +         r e t u r n   s e n d S u c c e s s ( a s i g n a t u r a ) ; 
 
       }   c a t c h   ( e r r o r )   { 
 
           i f   ( e r r o r   i n s t a n c e o f   H t t p E r r o r )   { 
 
               c o n s o l e . e r r o r ( 
 
 @ @   - 1 0 5 , 3   + 3 4 1 , 8 3   @ @   D e n o . s e r v e ( a s y n c   ( r e q )   = >   { 
 
           ) ; 
 
       } 
 
   } ) ; 
 
 + 
 
 + c o n s t   j s o n F r o m S t r i n g   =   < T   e x t e n d s   z . Z o d T y p e A n y > ( s c h e m a :   T )   = > 
 
 +     z . s t r i n g ( ) . t r a n s f o r m ( ( s t r ,   c t x )   = >   { 
 
 +         t r y   { 
 
 +             r e t u r n   J S O N . p a r s e ( s t r ) ; 
 
 +         }   c a t c h   { 
 
 +             c t x . a d d I s s u e ( { 
 
 +                 c o d e :   z . Z o d I s s u e C o d e . c u s t o m , 
 
 +                 m e s s a g e :   " E l   f o r m a t o   n o   e s   u n   J S O N   v % l i d o " , 
 
 +             } ) ; 
 
 +             r e t u r n   z . N E V E R ; 
 
 +         } 
 
 +     } ) . p i p e ( s c h e m a ) ; 
 
 + 
 
 + c o n s t   j s o n F r o m S t r i n g O p t i o n a l   =   < T   e x t e n d s   z . Z o d T y p e A n y > ( s c h e m a :   T )   = > 
 
 +     z . s t r i n g ( ) . o p t i o n a l ( ) . d e f a u l t ( " { } " ) . t r a n s f o r m ( ( s t r ,   c t x )   = >   { 
 
 +         t r y   { 
 
 +             r e t u r n   J S O N . p a r s e ( s t r ) ; 
 
 +         }   c a t c h   { 
 
 +             c t x . a d d I s s u e ( { 
 
 +                 c o d e :   z . Z o d I s s u e C o d e . c u s t o m , 
 
 +                 m e s s a g e :   " E l   f o r m a t o   n o   e s   u n   J S O N   v % l i d o " , 
 
 +             } ) ; 
 
 +             r e t u r n   z . N E V E R ; 
 
 +         } 
 
 +     } ) . p i p e ( s c h e m a ) ; 
 
 + 
 
 + c o n s t   D a t o s B a s i c o s S c h e m a   =   z . o b j e c t ( { 
 
 +     n o m b r e :   z . s t r i n g ( ) . m i n ( 1 ,   " E l   n o m b r e   e s   r e q u e r i d o " ) , 
 
 +     c o d i g o :   z . s t r i n g ( ) . m i n ( 1 ) . o p t i o n a l ( ) . n u l l a b l e ( ) , 
 
 +     t i p o :   z . u n i o n ( [ z . s t r i n g ( ) . m i n ( 1 ) ,   z . n u l l ( ) ] ) . o p t i o n a l ( ) . t r a n s f o r m ( ( v )   = > 
 
 +         v   ? ?   n u l l 
 
 +     ) , 
 
 +     c r e d i t o s :   z . n u m b e r ( {   i n v a l i d _ t y p e _ e r r o r :   " C r % d i t o s   d e b e   s e r   n u m % r i c o "   } ) 
 
 +         . p o s i t i v e ( " C r % d i t o s   d e b e   s e r   > =   0 " ) , 
 
 +     h o r a s A c a d e m i c a s :   z . n u m b e r ( ) . i n t ( ) . n o n n e g a t i v e ( ) . o p t i o n a l ( ) . n u l l a b l e ( ) , 
 
 +     h o r a s I n d e p e n d i e n t e s :   z . n u m b e r ( ) . i n t ( ) . n o n n e g a t i v e ( ) . o p t i o n a l ( ) . n u l l a b l e ( ) , 
 
 +     e s t r u c t u r a I d :   z . s t r i n g ( ) . u u i d ( " e s t r u c t u r a I d   d e b e   s e r   u n   U U I D " ) , 
 
 + } ) ; 
 
 + 
 
 + c o n s t   I A C o n f i g S c h e m a   =   z . o b j e c t ( { 
 
 +     d e s c r i p c i o n E n f o q u e A c a d e m i c o :   z . s t r i n g ( ) . o p t i o n a l ( ) , 
 
 +     i n s t r u c c i o n e s A d i c i o n a l e s I A :   z . s t r i n g ( ) . o p t i o n a l ( ) , 
 
 +     a r c h i v o s R e f e r e n c i a :   z . a r r a y ( z . s t r i n g ( ) . u u i d ( ) ) . o p t i o n a l ( ) , 
 
 +     r e p o s i t o r i o s R e f e r e n c i a :   z . a r r a y ( z . s t r i n g ( ) . u u i d ( ) ) . o p t i o n a l ( ) , 
 
 + } ) . p a r t i a l ( ) ; 
 
 + 
 
 + c o n s t   S o l i c i t u d S c h e m a   =   z . o b j e c t ( { 
 
 +     p l a n _ e s t u d i o _ i d :   z . s t r i n g ( ) . u u i d ( " p l a n _ e s t u d i o _ i d   d e b e   s e r   u n   U U I D " ) , 
 
 +     d a t o s B a s i c o s :   j s o n F r o m S t r i n g ( D a t o s B a s i c o s S c h e m a ) , 
 
 +     i a C o n f i g :   j s o n F r o m S t r i n g O p t i o n a l ( I A C o n f i g S c h e m a ) , 
 
 +     a r c h i v o s A d j u n t o s :   z . a r r a y ( z . i n s t a n c e o f ( F i l e ) ) . o p t i o n a l ( ) . d e f a u l t ( [ ] ) , 
 
 + } ) ; 
 
 + 
 
 + t y p e   E d g e A I G e n e r a t e S u b j e c t I n p u t   =   z . i n f e r < t y p e o f   S o l i c i t u d S c h e m a > ; 
 
 + 
 
 + f u n c t i o n   p a r s e A n d V a l i d a t e ( 
 
 +     f o r m D a t a :   F o r m D a t a , 
 
 + ) :   {   s u c c e s s :   t r u e ;   d a t a :   E d g e A I G e n e r a t e S u b j e c t I n p u t   }   |   { 
 
 +     s u c c e s s :   f a l s e ; 
 
 +     e r r o r s :   s t r i n g [ ] ; 
 
 + }   { 
 
 +     c o n s t   r a w I n p u t   =   { 
 
 +         p l a n _ e s t u d i o _ i d :   f o r m D a t a . g e t ( " p l a n _ e s t u d i o _ i d " ) , 
 
 +         d a t o s B a s i c o s :   f o r m D a t a . g e t ( " d a t o s B a s i c o s " ) , 
 
 +         i a C o n f i g :   f o r m D a t a . g e t ( " i a C o n f i g " ) , 
 
 +         a r c h i v o s A d j u n t o s :   f o r m D a t a . g e t A l l ( " a r c h i v o s A d j u n t o s " ) , 
 
 +     } ; 
 
 + 
 
 +     c o n s t   r e s u l t   =   S o l i c i t u d S c h e m a . s a f e P a r s e ( r a w I n p u t ) ; 
 
 +     i f   ( ! r e s u l t . s u c c e s s )   { 
 
 +         c o n s t   e r r o r s   =   r e s u l t . e r r o r . e r r o r s . m a p ( ( i s s u e )   = >   { 
 
 +             c o n s t   p a t h   =   i s s u e . p a t h . l e n g t h   ?   ` $ { i s s u e . p a t h . j o i n ( " . " ) } :   `   :   " " ; 
 
 +             r e t u r n   ` $ { p a t h } $ { i s s u e . m e s s a g e } ` ; 
 
 +         } ) ; 
 
 +         r e t u r n   {   s u c c e s s :   f a l s e ,   e r r o r s   } ; 
 
 +     } 
 
 + 
 
 +     r e t u r n   {   s u c c e s s :   t r u e ,   d a t a :   r e s u l t . d a t a   } ; 
 
 + } 
 
 