diff --git a/src/sri.ts b/src/sri.ts index 54fab86..043f23a 100644 --- a/src/sri.ts +++ b/src/sri.ts @@ -19,7 +19,7 @@ axiosRetry(axios, { /** convert object of arrays into array of unique IDs */ function combineInputs(userInput: ResolverInput): string[] { - const result = Object.keys(userInput).reduce(function(r, k) { + const result = Object.keys(userInput).reduce(function (r, k) { return r.concat(userInput[k]); }, []); return [...new Set(result)]; @@ -32,9 +32,9 @@ function combineInputs(userInput: ResolverInput): string[] { async function query(api_input: string[]) { const url = { dev: 'https://nodenormalization-sri.renci.org/get_normalized_nodes', - ci: 'https://nodenorm.ci.transltr.io/1.3/get_normalized_nodes', - test: 'https://nodenorm.test.transltr.io/1.3/get_normalized_nodes', - prod: 'https://nodenorm.transltr.io/1.3/get_normalized_nodes', + ci: 'https://nodenorm.ci.transltr.io/get_normalized_nodes', + test: 'https://nodenorm.test.transltr.io/get_normalized_nodes', + prod: 'https://nodenorm.transltr.io/get_normalized_nodes', }[process.env.INSTANCE_ENV ?? 'prod']; const chunked_input = _.chunk(api_input, 1000); @@ -44,7 +44,11 @@ async function query(api_input: string[]) { `Node/${process.version} ${process.platform}`, ].join(' '); const axios_queries = chunked_input.map((input) => { - return axios.post(url, { curies: input }, { headers: { 'User-Agent': userAgent } }); + return axios.post( + url, + { curies: input, conflate: true, drug_chemical_conflate: true }, + { headers: { 'User-Agent': userAgent } }, + ); }); //convert res array into single object with all curies let res = await Promise.all(axios_queries);