account-lookup-service 16.1.0-iso.0 → 16.1.0-iso.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/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": "16.1.0-iso.0",
4
+ "version": "16.1.0-iso.1",
5
5
  "license": "Apache-2.0",
6
6
  "author": "ModusBox",
7
7
  "contributors": [
package/src/constants.js CHANGED
@@ -1,6 +1,5 @@
1
1
  const ERROR_MESSAGES = Object.freeze({
2
2
  sourceFspNotFound: 'Requester FSP not found',
3
- partySourceFspNotFound: 'Requester FSP not found', // todo: use sourceFspNotFound
4
3
  partyDestinationFspNotFound: 'Destination FSP not found',
5
4
  partyProxyNotFound: 'Proxy not found',
6
5
  proxyConnectionError: 'Proxy connection error',
@@ -52,7 +52,7 @@ const validateRequester = async ({ source, proxy, proxyCache }) => {
52
52
  }
53
53
 
54
54
  if (!proxy) {
55
- const errMessage = ERROR_MESSAGES.partySourceFspNotFound
55
+ const errMessage = ERROR_MESSAGES.sourceFspNotFound
56
56
  throw ErrorHandler.Factory.createFSPIOPError(ErrorHandler.Enums.FSPIOPErrorCodes.ID_NOT_FOUND, errMessage)
57
57
  }
58
58
 
@@ -81,7 +81,7 @@ const putPartiesByTypeAndID = async (headers, params, method, payload, dataUri,
81
81
  const requesterParticipant = await participant.validateParticipant(source)
82
82
  if (!requesterParticipant) {
83
83
  if (!proxyEnabled || !proxy) {
84
- const errMessage = ERROR_MESSAGES.partySourceFspNotFound
84
+ const errMessage = ERROR_MESSAGES.sourceFspNotFound
85
85
  throw ErrorHandler.Factory.createFSPIOPError(ErrorHandler.Enums.FSPIOPErrorCodes.ID_NOT_FOUND, errMessage)
86
86
  }
87
87
  step = 'addDfspIdToProxyMapping-1'
@@ -61,7 +61,6 @@ const participantsCallHeadersDto = ({
61
61
  contentType: interopHeader('participants', contentTypeVersion)
62
62
  })
63
63
 
64
- // todo: add ISO mode support
65
64
  const interopHeader = (resource, version = '1') => `application/vnd.interoperability.${resource}+json;version=${version}`
66
65
 
67
66
  const oracleRequestResponseDto = ({
@@ -251,7 +251,7 @@ describe('Parties Tests', () => {
251
251
 
252
252
  const { errorInformation } = participant.sendErrorToParticipant.getCall(0).args[2]
253
253
  expect(errorInformation.errorCode).toBe('3200')
254
- expect(errorInformation.errorDescription).toContain(ERROR_MESSAGES.partySourceFspNotFound)
254
+ expect(errorInformation.errorDescription).toContain(ERROR_MESSAGES.sourceFspNotFound)
255
255
  })
256
256
 
257
257
  it('should send error callback, if proxy-header is present, but no proxy in the scheme', async () => {
@@ -634,7 +634,7 @@ describe('Parties Tests', () => {
634
634
  // Assert
635
635
  expect(participant.sendErrorToParticipant.callCount).toBe(1)
636
636
  const firstLoggerCallArgs = loggerStub.getCall(0).args
637
- expect(firstLoggerCallArgs[1].message).toBe(ERROR_MESSAGES.partySourceFspNotFound)
637
+ expect(firstLoggerCallArgs[1].message).toBe(ERROR_MESSAGES.sourceFspNotFound)
638
638
  loggerStub.reset()
639
639
  participant.sendErrorToParticipant.reset()
640
640
  })
@@ -50,16 +50,18 @@ jest.mock('@mojaloop/central-services-shared', () => ({
50
50
  Participants: { getParticipant: mockGetParticipant },
51
51
  Request: { sendRequest: mockSendRequest },
52
52
  Http: { SwitchDefaultHeaders: jest.fn() },
53
- HeaderValidation: { getHubNameRegex: jest.fn().mockReturnValue(new RegExp(mockHubName)) }
53
+ HeaderValidation: { getHubNameRegex: jest.fn().mockReturnValue(new RegExp(mockHubName)) },
54
+ Hapi: jest.requireActual('@mojaloop/central-services-shared').Util.Hapi
54
55
  },
55
56
  Enum: mockEnums
56
57
  }))
57
58
 
58
59
  const Logger = require('@mojaloop/central-services-logger')
59
60
  const fixtures = require('../../../fixtures')
61
+ const { API_TYPES } = require('@mojaloop/central-services-shared').Util.Hapi
60
62
 
61
63
  const mockConfigDto = ({
62
- apiType = 'fspiop', // todo: use API_TYPES
64
+ apiType = API_TYPES.fspiop,
63
65
  jwsSign = false
64
66
  } = {}) => ({
65
67
  API_TYPE: apiType,