@@ -626,6 +626,46 @@ describe('AI API', () => {
626626 url : link ,
627627 } ,
628628 } )
629+ . get ( `/ai/providers/${ aiProviderId } /gateway/chat/completions` , undefined , {
630+ reqheaders : {
631+ Authorization : `Bearer ${ api . token } ` ,
632+ } ,
633+ } )
634+ . reply ( 200 , {
635+ data : field ,
636+ } )
637+ . post ( `/ai/providers/${ aiProviderId } /gateway/chat/completions` , field , {
638+ reqheaders : {
639+ Authorization : `Bearer ${ api . token } ` ,
640+ } ,
641+ } )
642+ . reply ( 200 , {
643+ data : field ,
644+ } )
645+ . put ( `/ai/providers/${ aiProviderId } /gateway/chat/completions` , field , {
646+ reqheaders : {
647+ Authorization : `Bearer ${ api . token } ` ,
648+ } ,
649+ } )
650+ . reply ( 200 , {
651+ data : field ,
652+ } )
653+ . patch ( `/ai/providers/${ aiProviderId } /gateway/chat/completions` , field , {
654+ reqheaders : {
655+ Authorization : `Bearer ${ api . token } ` ,
656+ } ,
657+ } )
658+ . reply ( 200 , {
659+ data : field ,
660+ } )
661+ . delete ( `/ai/providers/${ aiProviderId } /gateway/chat/completions` , undefined , {
662+ reqheaders : {
663+ Authorization : `Bearer ${ api . token } ` ,
664+ } ,
665+ } )
666+ . reply ( 200 , {
667+ data : field ,
668+ } )
629669 . get ( `/users/${ userId } /ai/settings/custom-placeholders` , undefined , {
630670 reqheaders : {
631671 Authorization : `Bearer ${ api . token } ` ,
@@ -1185,6 +1225,46 @@ describe('AI API', () => {
11851225 data : {
11861226 url : link ,
11871227 } ,
1228+ } )
1229+ . get ( `/users/${ userId } /ai/providers/${ aiProviderId } /gateway/chat/completions` , undefined , {
1230+ reqheaders : {
1231+ Authorization : `Bearer ${ api . token } ` ,
1232+ } ,
1233+ } )
1234+ . reply ( 200 , {
1235+ data : field ,
1236+ } )
1237+ . post ( `/users/${ userId } /ai/providers/${ aiProviderId } /gateway/chat/completions` , field , {
1238+ reqheaders : {
1239+ Authorization : `Bearer ${ api . token } ` ,
1240+ } ,
1241+ } )
1242+ . reply ( 200 , {
1243+ data : field ,
1244+ } )
1245+ . put ( `/users/${ userId } /ai/providers/${ aiProviderId } /gateway/chat/completions` , field , {
1246+ reqheaders : {
1247+ Authorization : `Bearer ${ api . token } ` ,
1248+ } ,
1249+ } )
1250+ . reply ( 200 , {
1251+ data : field ,
1252+ } )
1253+ . patch ( `/users/${ userId } /ai/providers/${ aiProviderId } /gateway/chat/completions` , field , {
1254+ reqheaders : {
1255+ Authorization : `Bearer ${ api . token } ` ,
1256+ } ,
1257+ } )
1258+ . reply ( 200 , {
1259+ data : field ,
1260+ } )
1261+ . delete ( `/users/${ userId } /ai/providers/${ aiProviderId } /gateway/chat/completions` , undefined , {
1262+ reqheaders : {
1263+ Authorization : `Bearer ${ api . token } ` ,
1264+ } ,
1265+ } )
1266+ . reply ( 200 , {
1267+ data : field ,
11881268 } ) ;
11891269 } ) ;
11901270
@@ -1461,6 +1541,31 @@ describe('AI API', () => {
14611541 expect ( res . data . url ) . toBe ( link ) ;
14621542 } ) ;
14631543
1544+ it ( 'Organization AI Gateway GET' , async ( ) => {
1545+ const res = await api . organizationAiGatewayGet ( aiProviderId , 'chat/completions' ) ;
1546+ expect ( res . data ) . toStrictEqual ( field ) ;
1547+ } ) ;
1548+
1549+ it ( 'Organization AI Gateway POST' , async ( ) => {
1550+ const res = await api . organizationAiGatewayPost ( aiProviderId , 'chat/completions' , field ) ;
1551+ expect ( res . data ) . toStrictEqual ( field ) ;
1552+ } ) ;
1553+
1554+ it ( 'Organization AI Gateway PUT' , async ( ) => {
1555+ const res = await api . organizationAiGatewayPut ( aiProviderId , 'chat/completions' , field ) ;
1556+ expect ( res . data ) . toStrictEqual ( field ) ;
1557+ } ) ;
1558+
1559+ it ( 'Organization AI Gateway PATCH' , async ( ) => {
1560+ const res = await api . organizationAiGatewayPatch ( aiProviderId , 'chat/completions' , field ) ;
1561+ expect ( res . data ) . toStrictEqual ( field ) ;
1562+ } ) ;
1563+
1564+ it ( 'Organization AI Gateway DELETE' , async ( ) => {
1565+ const res = await api . organizationAiGatewayDelete ( aiProviderId , 'chat/completions' ) ;
1566+ expect ( res . data ) . toStrictEqual ( field ) ;
1567+ } ) ;
1568+
14641569 it ( 'List AI User Custom Placeholders' , async ( ) => {
14651570 const placeholders = await api . listAiUserCustomPlaceholders ( userId ) ;
14661571 expect ( placeholders . data . length ) . toBe ( 1 ) ;
@@ -1729,4 +1834,29 @@ describe('AI API', () => {
17291834 const res = await api . downloadAiUserFileTranslationStrings ( userId , jobId ) ;
17301835 expect ( res . data . url ) . toBe ( link ) ;
17311836 } ) ;
1837+
1838+ it ( 'User AI Gateway GET' , async ( ) => {
1839+ const res = await api . userAiGatewayGet ( userId , aiProviderId , 'chat/completions' ) ;
1840+ expect ( res . data ) . toStrictEqual ( field ) ;
1841+ } ) ;
1842+
1843+ it ( 'User AI Gateway POST' , async ( ) => {
1844+ const res = await api . userAiGatewayPost ( userId , aiProviderId , 'chat/completions' , field ) ;
1845+ expect ( res . data ) . toStrictEqual ( field ) ;
1846+ } ) ;
1847+
1848+ it ( 'User AI Gateway PUT' , async ( ) => {
1849+ const res = await api . userAiGatewayPut ( userId , aiProviderId , 'chat/completions' , field ) ;
1850+ expect ( res . data ) . toStrictEqual ( field ) ;
1851+ } ) ;
1852+
1853+ it ( 'User AI Gateway PATCH' , async ( ) => {
1854+ const res = await api . userAiGatewayPatch ( userId , aiProviderId , 'chat/completions' , field ) ;
1855+ expect ( res . data ) . toStrictEqual ( field ) ;
1856+ } ) ;
1857+
1858+ it ( 'User AI Gateway DELETE' , async ( ) => {
1859+ const res = await api . userAiGatewayDelete ( userId , aiProviderId , 'chat/completions' ) ;
1860+ expect ( res . data ) . toStrictEqual ( field ) ;
1861+ } ) ;
17321862} ) ;
0 commit comments