account-lookup-service 17.10.1 → 17.10.3

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/.ncurc.yaml CHANGED
@@ -1,5 +1,7 @@
1
1
  ## Add a TODO comment indicating the reason for each rejected dependency upgrade added to this list, and what should be done to resolve it (i.e. handle it through a story, etc).
2
2
  reject: [
3
3
  # TODO: v6+ (ref: https://github.com/sindresorhus/get-port/releases/tag/v6.0.0) is an ESM library and thus not compatible with CommonJS. Future story needed to resolve.
4
- "get-port"
4
+ "get-port",
5
+ ## jest 30 is released but libraries that work with jest have not been updated to support it yet.
6
+ "jest"
5
7
  ]
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.10.3](https://github.com/mojaloop/account-lookup-service/compare/v17.10.2...v17.10.3) (2025-06-24)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * ensure timeout callbacks have content-type headers ([#555](https://github.com/mojaloop/account-lookup-service/issues/555)) ([3850241](https://github.com/mojaloop/account-lookup-service/commit/38502419d1900e5ccef869ddde07274974efb62d))
11
+
12
+ ### [17.10.2](https://github.com/mojaloop/account-lookup-service/compare/v17.10.1...v17.10.2) (2025-06-23)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * fix broken int test reporting ([#554](https://github.com/mojaloop/account-lookup-service/issues/554)) ([d69cb64](https://github.com/mojaloop/account-lookup-service/commit/d69cb641bec52d0e122361cfb2b36b0b066f6f86))
18
+
5
19
  ### [17.10.1](https://github.com/mojaloop/account-lookup-service/compare/v17.10.0...v17.10.1) (2025-05-30)
6
20
 
7
21
 
@@ -24,15 +24,18 @@
24
24
  },
25
25
  "PROTOCOL_VERSIONS": {
26
26
  "CONTENT": {
27
- "DEFAULT": "1.1",
27
+ "DEFAULT": "2.0",
28
28
  "VALIDATELIST": [
29
+ "2.0",
29
30
  "1.1",
30
31
  "1.0"
31
32
  ]
32
33
  },
33
34
  "ACCEPT": {
34
- "DEFAULT": "1",
35
+ "DEFAULT": "2",
35
36
  "VALIDATELIST": [
37
+ "2",
38
+ "2.0",
36
39
  "1",
37
40
  "1.0",
38
41
  "1.1"
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.10.1",
4
+ "version": "17.10.3",
5
5
  "license": "Apache-2.0",
6
6
  "author": "ModusBox",
7
7
  "contributors": [
@@ -56,7 +56,7 @@
56
56
  "test:xunit": "npm run test:junit",
57
57
  "test:functional": "bash ./scripts/test-functional.sh",
58
58
  "test:int": "npm run migrate && npm run onboarding && jest --config=./jest-int.config.js --runInBand",
59
- "test:integration": "npm run dc:up && npm run wait-4-docker && npm run test:int | tee ./test/results/test-int.log",
59
+ "test:integration": "./test/scripts/test-integration.sh",
60
60
  "test:integration-runner": "TEST_MODE=rm ./test/integration-runner.sh",
61
61
  "onboarding": "node test/integration/prepareTestParticipants.js",
62
62
  "cover": "npx nyc --all report --reporter=lcov npm run test",
@@ -94,10 +94,10 @@
94
94
  "@mojaloop/central-services-health": "15.1.0",
95
95
  "@mojaloop/central-services-logger": "11.9.0",
96
96
  "@mojaloop/central-services-metrics": "12.6.0",
97
- "@mojaloop/central-services-shared": "18.26.2",
98
- "@mojaloop/central-services-stream": "11.6.0",
97
+ "@mojaloop/central-services-shared": "18.28.3",
98
+ "@mojaloop/central-services-stream": "11.7.0",
99
99
  "@mojaloop/database-lib": "11.2.0",
100
- "@mojaloop/event-sdk": "14.5.1",
100
+ "@mojaloop/event-sdk": "14.6.1",
101
101
  "@mojaloop/inter-scheme-proxy-cache-lib": "2.6.0",
102
102
  "@mojaloop/ml-schema-transformer-lib": "2.7.1",
103
103
  "@mojaloop/sdk-standard-components": "19.15.2",
@@ -160,9 +160,9 @@
160
160
  "validator": "13.7.0"
161
161
  },
162
162
  "devDependencies": {
163
- "@types/jest": "29.5.14",
163
+ "@types/jest": "30.0.0",
164
164
  "audit-ci": "^7.1.0",
165
- "axios": "1.9.0",
165
+ "axios": "1.10.0",
166
166
  "axios-retry": "^4.5.0",
167
167
  "docdash": "2.0.2",
168
168
  "dotenv": "^16.5.0",
@@ -177,7 +177,7 @@
177
177
  "pre-commit": "1.2.2",
178
178
  "proxyquire": "2.1.3",
179
179
  "replace": "^1.2.2",
180
- "sinon": "20.0.0",
180
+ "sinon": "21.0.0",
181
181
  "standard": "17.1.2",
182
182
  "standard-version": "^9.5.0",
183
183
  "swagmock": "1.0.0"
@@ -31,9 +31,10 @@ const { decodePayload } = require('@mojaloop/central-services-shared').Util.Stre
31
31
  const { initStepState } = require('../../../lib/util')
32
32
  const { createCallbackHeaders } = require('../../../lib/headers')
33
33
  const { ERROR_MESSAGES } = require('../../../constants')
34
+ const { makeAcceptContentTypeHeader } = require('@mojaloop/central-services-shared').Util.Headers
34
35
 
35
36
  const { FspEndpointTypes, FspEndpointTemplates } = Enum.EndPoints
36
- const { Headers, RestMethods } = Enum.Http
37
+ const { Headers, RestMethods, HeaderResources } = Enum.Http
37
38
 
38
39
  /**
39
40
  * @typedef {Object} PartiesDeps
@@ -246,10 +247,15 @@ class BasePartiesService {
246
247
  return cbHeaders
247
248
  }
248
249
 
249
- static createHubErrorCallbackHeaders (hubName, destination) {
250
+ static createHubErrorCallbackHeaders (hubName, destination, config) {
250
251
  return {
251
252
  [Headers.FSPIOP.SOURCE]: hubName,
252
- [Headers.FSPIOP.DESTINATION]: destination
253
+ [Headers.FSPIOP.DESTINATION]: destination,
254
+ [Headers.GENERAL.CONTENT_TYPE.value]: makeAcceptContentTypeHeader(
255
+ HeaderResources.PARTIES,
256
+ config.PROTOCOL_VERSIONS.CONTENT.DEFAULT.toString(),
257
+ config.API_TYPE
258
+ )
253
259
  }
254
260
  }
255
261
 
@@ -41,7 +41,7 @@ class TimeoutPartiesService extends PutPartiesErrorService {
41
41
  */
42
42
  static createInstance (deps, cacheKey, spanName) {
43
43
  const { destination, partyType, partyId } = TimeoutPartiesService.parseExpiredKey(cacheKey)
44
- const headers = TimeoutPartiesService.createHubErrorCallbackHeaders(deps.config.HUB_NAME, destination)
44
+ const headers = TimeoutPartiesService.createHubErrorCallbackHeaders(deps.config.HUB_NAME, destination, deps.config)
45
45
  const params = { Type: partyType, ID: partyId } // todo: think, if we need to handle party SubId
46
46
  const childSpan = createSpan(spanName, headers, params)
47
47
 
@@ -26,7 +26,7 @@
26
26
  ******/
27
27
 
28
28
  const { randomUUID } = require('node:crypto')
29
- const { Enum, Util } = jest.requireActual('@mojaloop/central-services-shared')
29
+ const { Enum, Util } = require('@mojaloop/central-services-shared')
30
30
  const isoFixtures = require('./iso')
31
31
 
32
32
  const { Headers } = Enum.Http
@@ -91,10 +91,12 @@ describe('Timeout Handler', () => {
91
91
  expect(await checkKeysExistence(keys)).toEqual([0, 0])
92
92
 
93
93
  expect(history.length).toBe(2)
94
- const path0 = history.find(h => h.path.includes(partyIds[0])).path
95
- const path1 = history.find(h => h.path.includes(partyIds[1])).path
96
- expect(path0).toBe(`/parties/${PARTY_ID_TYPE}/${partyIds[0]}/error`)
97
- expect(path1).toBe(`/parties/${PARTY_ID_TYPE}/${partyIds[1]}/error`)
94
+ const entry0 = history.find(h => h.path.includes(partyIds[0]))
95
+ const entry1 = history.find(h => h.path.includes(partyIds[1]))
96
+ expect(entry0.path).toBe(`/parties/${PARTY_ID_TYPE}/${partyIds[0]}/error`)
97
+ expect(entry1.path).toBe(`/parties/${PARTY_ID_TYPE}/${partyIds[1]}/error`)
98
+ expect(entry0.headers['content-type']).toContain('parties')
99
+ expect(entry1.headers['content-type']).toContain('parties')
98
100
  })
99
101
 
100
102
  it('should pass timeoutProxyGetPartiesLookups flow', async () => {
@@ -122,9 +124,11 @@ describe('Timeout Handler', () => {
122
124
  expect(await checkKeysExistence(keys)).toEqual([0, 0])
123
125
 
124
126
  expect(history.length).toBe(2)
125
- const path1 = history.find(h => h.path.includes(partyId1)).path
126
- const path2 = history.find(h => h.path.includes(partyId2)).path
127
- expect(path1).toBe(`/parties/${PARTY_ID_TYPE}/${partyId1}/error`)
128
- expect(path2).toBe(`/parties/${PARTY_ID_TYPE}/${partyId2}/error`)
127
+ const entry1 = history.find(h => h.path.includes(partyId1))
128
+ const entry2 = history.find(h => h.path.includes(partyId2))
129
+ expect(entry1.path).toBe(`/parties/${PARTY_ID_TYPE}/${partyId1}/error`)
130
+ expect(entry2.path).toBe(`/parties/${PARTY_ID_TYPE}/${partyId2}/error`)
131
+ expect(entry1.headers['content-type']).toContain('parties')
132
+ expect(entry2.headers['content-type']).toContain('parties')
129
133
  })
130
134
  })
@@ -1,11 +1,11 @@
1
1
  require('./setup')
2
2
 
3
- const Logger = require('@mojaloop/central-services-logger')
3
+ const { logger } = require('../../src/lib')
4
4
  const { onboarding } = require('../util')
5
5
  const { PROXY_NAME, PAYER_DFSP } = require('../integration/constants')
6
6
 
7
7
  const pause = async (ms = 1000) => new Promise(resolve => {
8
- Logger.info(`pause for ${ms / 1000} sec....`)
8
+ logger.info(`pause for ${ms / 1000} sec....`)
9
9
  setTimeout(resolve, ms)
10
10
  })
11
11
 
@@ -21,10 +21,10 @@ const prepareTestParticipants = async () => {
21
21
  })
22
22
 
23
23
  await onboarding.createOracle()
24
- Logger.info('prepareTestParticipants is finished')
24
+ logger.info('prepareTestParticipants is finished')
25
25
  }
26
26
 
27
27
  prepareTestParticipants().catch(err => {
28
- Logger.error(err)
28
+ logger.error('error in prepareTestParticipants: ', err)
29
29
  throw err
30
30
  })
@@ -0,0 +1,14 @@
1
+ #!/bin/bash
2
+ set -euxo pipefail
3
+
4
+ docker load -i /tmp/docker-image.tar
5
+
6
+ npm run dc:up
7
+ npm run wait-4-docker
8
+
9
+ EXIT_CODE=0
10
+ npm run test:int || EXIT_CODE="$?"
11
+ echo "==> integration tests exited with code: $EXIT_CODE"
12
+
13
+ npm run dc:down
14
+ exit $EXIT_CODE
@@ -51,8 +51,9 @@ jest.mock('@mojaloop/central-services-shared', () => ({
51
51
  Request: { sendRequest: mockSendRequest },
52
52
  Http: { SwitchDefaultHeaders: jest.fn() },
53
53
  HeaderValidation: { getHubNameRegex: jest.fn().mockReturnValue(new RegExp(mockHubName)) },
54
+ Hapi: jest.requireActual('@mojaloop/central-services-shared').Util.Hapi,
54
55
  rethrow: jest.requireActual('@mojaloop/central-services-shared').Util.rethrow,
55
- Hapi: jest.requireActual('@mojaloop/central-services-shared').Util.Hapi
56
+ StreamingProtocol: jest.requireActual('@mojaloop/central-services-shared').Util.StreamingProtocol
56
57
  },
57
58
  Enum: mockEnums
58
59
  }))