@@ -143,6 +143,8 @@ const MapProject = () => {
143143 const [ searchStr , setSearchStr ] = React . useState ( '' ) // concept search
144144 const [ candidatesOrder , setCandidatesOrder ] = React . useState ( 'desc' )
145145 const [ candidatesOrderBy , setCandidatesOrderBy ] = React . useState ( 'search_meta.search_score' )
146+ const [ matchAPI , setMatchAPI ] = React . useState ( '' )
147+ const [ matchAPIToken , setMatchAPIToken ] = React . useState ( '' )
146148
147149 const abortRef = React . useRef ( false ) ;
148150
@@ -260,6 +262,8 @@ const MapProject = () => {
260262 setDescription ( response . data ?. description || '' )
261263 setOwner ( response . data ?. owner_url )
262264 setRetired ( Boolean ( response . data ?. include_retired ) )
265+ setMatchAPI ( response . data ?. match_api_url )
266+ setMatchAPIToken ( response . data ?. match_api_token )
263267 setProject ( response . data )
264268 setConfigure ( false )
265269 } )
@@ -527,6 +531,10 @@ const MapProject = () => {
527531 formData . append ( 'target_repo_url' , repoVersion . version_url )
528532 formData . append ( 'matching_algorithm' , algo )
529533 formData . append ( 'include_retired' , retired )
534+ if ( matchAPI ) {
535+ formData . append ( 'match_api_url' , matchAPI )
536+ formData . append ( 'match_api_token' , matchAPIToken )
537+ }
530538 let service = APIService . new ( ) . overrideURL ( owner ) . appendToUrl ( 'map-projects/' )
531539 if ( project ?. id )
532540 service = service . appendToUrl ( project . id + '/' ) . put ( formData , null , { "Content-Type" : "multipart/form-data" } )
@@ -583,6 +591,17 @@ const MapProject = () => {
583591 }
584592 }
585593
594+ const getMatchAPIService = ( ) => {
595+ let service ;
596+ if ( matchAPI ) {
597+ service = APIService . new ( )
598+ service . URL = matchAPI
599+ } else {
600+ service = APIService . concepts ( ) . appendToUrl ( '$match/' )
601+ }
602+ return service
603+ }
604+
586605
587606 const getRowsResults = async ( rows ) => {
588607 abortRef . current = false ;
@@ -602,13 +621,17 @@ const MapProject = () => {
602621 const payload = getPayloadForMatching ( rowBatch , _repo )
603622
604623 try {
605- const response = await APIService . concepts ( )
606- . appendToUrl ( '$match/' )
607- . post ( payload , null , null , {
608- includeSearchMeta : true ,
609- semantic : algo === 'llm' ,
610- bestMatch : true
611- } ) ;
624+ const service = getMatchAPIService ( )
625+ const response = await service . post (
626+ payload ,
627+ ( matchAPI && matchAPIToken ) ? matchAPIToken : null ,
628+ null ,
629+ {
630+ includeSearchMeta : true ,
631+ semantic : algo === 'llm' ,
632+ bestMatch : true
633+ }
634+ ) ;
612635
613636 return response . data || [ ] ;
614637 } catch {
@@ -1047,9 +1070,12 @@ const MapProject = () => {
10471070 let __row = isEmpty ( _row ) ? row : _row
10481071 setIsLoadingInDecisionView ( true )
10491072 const payload = getPayloadForMatching ( [ __row ] , repo )
1050- APIService . concepts ( )
1051- . appendToUrl ( '$match/' )
1052- . post ( payload , null , null , {
1073+ const service = getMatchAPIService ( )
1074+ service . post (
1075+ payload ,
1076+ ( matchAPI && matchAPIToken ) ? matchAPIToken : null ,
1077+ null ,
1078+ {
10531079 includeSearchMeta : true ,
10541080 includeMappings : true ,
10551081 includeRetired : isBoolean ( _retired ) ? _retired : retired ,
@@ -1232,6 +1258,10 @@ const MapProject = () => {
12321258 setColumnVisibilityModel = { setColumnVisibilityModel }
12331259 onSave = { onSave }
12341260 isSaving = { isSaving }
1261+ matchAPI = { matchAPI }
1262+ setMatchAPI = { setMatchAPI }
1263+ matchAPIToken = { matchAPIToken }
1264+ setMatchAPIToken = { setMatchAPIToken }
12351265 />
12361266 </ div >
12371267 }
@@ -1562,6 +1592,11 @@ const MapProject = () => {
15621592 setColumnVisibilityModel = { setColumnVisibilityModel }
15631593 onSave = { onSave }
15641594 isSaving = { isSaving }
1595+ matchAPI = { matchAPI }
1596+ setMatchAPI = { setMatchAPI }
1597+ matchAPIToken = { matchAPIToken }
1598+ setMatchAPIToken = { setMatchAPIToken }
1599+
15651600 />
15661601 </ div > :
15671602 (
0 commit comments