account-lookup-service 17.9.0-snapshot.1 → 17.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [17.9.1](https://github.com/mojaloop/account-lookup-service/compare/v17.9.0...v17.9.1) (2025-04-09)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * avoid exception when no proxy cache exists ([#548](https://github.com/mojaloop/account-lookup-service/issues/548)) ([37dd8fa](https://github.com/mojaloop/account-lookup-service/commit/37dd8fa8932694022d1cd9c4ad8e2ddf180133e5))
11
+
12
+ ## [17.9.0](https://github.com/mojaloop/account-lookup-service/compare/v17.8.1...v17.9.0) (2025-04-08)
13
+
14
+
15
+ ### Features
16
+
17
+ * **csi-1350:** refactored oracleRequest ([#546](https://github.com/mojaloop/account-lookup-service/issues/546)) ([3f76ef7](https://github.com/mojaloop/account-lookup-service/commit/3f76ef7f712590e82bcb5bf7e49a643b2aae63f3))
18
+
5
19
  ### [17.8.1](https://github.com/mojaloop/account-lookup-service/compare/v17.8.0...v17.8.1) (2025-04-07)
6
20
 
7
21
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "account-lookup-service",
3
3
  "description": "Account Lookup Service is used to validate Party and Participant lookups.",
4
- "version": "17.9.0-snapshot.1",
4
+ "version": "17.9.1",
5
5
  "license": "Apache-2.0",
6
6
  "author": "ModusBox",
7
7
  "contributors": [
@@ -100,7 +100,7 @@
100
100
  "@mojaloop/event-sdk": "14.4.0",
101
101
  "@mojaloop/inter-scheme-proxy-cache-lib": "2.5.0",
102
102
  "@mojaloop/ml-schema-transformer-lib": "2.7.1",
103
- "@mojaloop/sdk-standard-components": "19.11.3-snapshot.0",
103
+ "@mojaloop/sdk-standard-components": "19.11.3",
104
104
  "@now-ims/hapi-now-auth": "2.1.0",
105
105
  "ajv": "8.17.1",
106
106
  "ajv-keywords": "5.1.0",
@@ -316,7 +316,7 @@ class GetPartiesService extends BasePartiesService {
316
316
  if (isSentToProxy && isLocalSource) {
317
317
  this.stepInProgress('#setProxyGetPartiesTimeout')
318
318
  const alsReq = this.deps.partiesUtils.alsRequestDto(this.state.source, this.inputs.params)
319
- const isSet = await this.deps.proxyCache.setProxyGetPartiesTimeout(alsReq, sendTo)
319
+ const isSet = await this.deps.proxyCache?.setProxyGetPartiesTimeout(alsReq, sendTo)
320
320
  this.log.info('#setProxyGetPartiesTimeout is done', { isSet })
321
321
  return isSet
322
322
  }
@@ -408,6 +408,7 @@ const _getOracleEndpointByTypeCurrencyAndSubId = async (partyIdType, partyIdenti
408
408
  * @returns {object} - response from the oracle
409
409
  */
410
410
  const oracleBatchRequest = async (headers, method, requestPayload, type, payload) => {
411
+ let step = 'getOracleEndpoint'
411
412
  try {
412
413
  let oracleEndpointModel
413
414
  let url
@@ -416,33 +417,37 @@ const oracleBatchRequest = async (headers, method, requestPayload, type, payload
416
417
  } else {
417
418
  oracleEndpointModel = await oracleEndpointCached.getOracleEndpointByType(type)
418
419
  }
419
- if (oracleEndpointModel.length > 0) {
420
- if (oracleEndpointModel.length > 1) {
421
- for (const record of oracleEndpointModel) {
422
- if (record.isDefault) {
423
- url = record.value + Enums.EndPoints.FspEndpointTemplates.ORACLE_PARTICIPANTS_BATCH
424
- break
425
- }
420
+
421
+ if (!Array.isArray(oracleEndpointModel) || oracleEndpointModel.length === 0) {
422
+ const errMessage = `Oracle type:${type} not found`
423
+ logger.warn(errMessage)
424
+ throw ErrorHandler.Factory.createFSPIOPError(ErrorHandler.Enums.FSPIOPErrorCodes.ADD_PARTY_INFO_ERROR, errMessage)
425
+ }
426
+
427
+ if (oracleEndpointModel.length > 1) {
428
+ for (const record of oracleEndpointModel) {
429
+ if (record.isDefault) {
430
+ url = record.value + Enums.EndPoints.FspEndpointTemplates.ORACLE_PARTICIPANTS_BATCH
431
+ break
426
432
  }
427
- } else {
428
- url = oracleEndpointModel[0].value + Enums.EndPoints.FspEndpointTemplates.ORACLE_PARTICIPANTS_BATCH
429
433
  }
430
- logger.debug(`Oracle endpoints: ${url}`)
431
- return await sendHttpRequest({
432
- url,
433
- headers,
434
- source: headers[Headers.FSPIOP.SOURCE],
435
- destination: headers[Headers.FSPIOP.DESTINATION] || Config.HUB_NAME,
436
- method,
437
- payload
438
- })
439
434
  } else {
440
- logger.error(`Oracle type:${type} not found`)
441
- throw ErrorHandler.Factory.createFSPIOPError(ErrorHandler.Enums.FSPIOPErrorCodes.ADD_PARTY_INFO_ERROR, `Oracle type:${type} not found`)
435
+ url = oracleEndpointModel[0].value + Enums.EndPoints.FspEndpointTemplates.ORACLE_PARTICIPANTS_BATCH
442
436
  }
437
+ logger.verbose(`Oracle endpoint: ${url}`)
438
+
439
+ step = 'sendHttpRequest'
440
+ return await sendHttpRequest({
441
+ url,
442
+ headers,
443
+ source: headers[Headers.FSPIOP.SOURCE],
444
+ destination: headers[Headers.FSPIOP.DESTINATION] || Config.HUB_NAME,
445
+ method,
446
+ payload
447
+ })
443
448
  } catch (err) {
444
449
  logger.error('error in oracleBatchRequest: ', err)
445
- throw ErrorHandler.Factory.reformatFSPIOPError(err)
450
+ throw countFspiopError(err, { operation: 'oracleBatchRequest', step })
446
451
  }
447
452
  }
448
453