@mojaloop/central-services-shared 18.6.1-snapshot.0 → 18.6.2
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 +14 -0
- package/package.json +1 -1
- package/src/util/endpoints.js +3 -4
- package/test/unit/util/endpoints.test.js +1 -1
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
|
+
### [18.6.2](https://github.com/mojaloop/central-services-shared/compare/v18.6.1...v18.6.2) (2024-07-08)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Chore
|
|
9
|
+
|
|
10
|
+
* align proxy config ([#391](https://github.com/mojaloop/central-services-shared/issues/391)) ([d92f8db](https://github.com/mojaloop/central-services-shared/commit/d92f8db4694b1e40a84060b5df46ceccb71063ff))
|
|
11
|
+
|
|
12
|
+
### [18.6.1](https://github.com/mojaloop/central-services-shared/compare/v18.6.0...v18.6.1) (2024-07-08)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Chore
|
|
16
|
+
|
|
17
|
+
* update index.d file ([#390](https://github.com/mojaloop/central-services-shared/issues/390)) ([93b8048](https://github.com/mojaloop/central-services-shared/commit/93b8048310b71f89993dede5a8d58d0f6283d00f))
|
|
18
|
+
|
|
5
19
|
## [18.6.0](https://github.com/mojaloop/central-services-shared/compare/v18.5.2...v18.6.0) (2024-07-05)
|
|
6
20
|
|
|
7
21
|
|
package/package.json
CHANGED
package/src/util/endpoints.js
CHANGED
|
@@ -148,16 +148,15 @@ exports.getEndpoint = async (switchUrl, fsp, endpointType, options = {}, renderO
|
|
|
148
148
|
switchEndpoint = switchUrl
|
|
149
149
|
Logger.isDebugEnabled && Logger.debug(`participantEndpointCache::getEndpoint::endpointType - ${endpointType}`)
|
|
150
150
|
let proxyId
|
|
151
|
-
const result = url => proxyConfig ? { url, proxyId } : url
|
|
151
|
+
const result = url => proxyConfig?.enabled ? { url, proxyId } : url
|
|
152
152
|
try {
|
|
153
153
|
// If a service passes in `getDecoratedValue` as true, then an object
|
|
154
154
|
// { value, cached, report } is returned, where value is the cached value,
|
|
155
155
|
// cached is null on a cache miss.
|
|
156
156
|
let endpoints = await policy.get(fsp)
|
|
157
|
-
if (!endpoints && proxyConfig) {
|
|
157
|
+
if (!endpoints && proxyConfig?.enabled) {
|
|
158
158
|
if (!proxy) {
|
|
159
|
-
|
|
160
|
-
proxy = proxyLib.createProxyCache(type, config)
|
|
159
|
+
proxy = proxyLib.createProxyCache(proxyConfig.type, proxyConfig.proxyConfig)
|
|
161
160
|
await proxy.connect()
|
|
162
161
|
}
|
|
163
162
|
proxyId = await proxy.lookupProxyByDfspId(fsp)
|
|
@@ -153,7 +153,7 @@ Test('Cache Test', (cacheTest) => {
|
|
|
153
153
|
endpointType,
|
|
154
154
|
{ transferId: '97b01bd3-b223-415b-b37b-ab5bef9bdbed' },
|
|
155
155
|
undefined,
|
|
156
|
-
{}
|
|
156
|
+
{ enabled: true }
|
|
157
157
|
)
|
|
158
158
|
test.deepEqual(result, expected, 'The results match')
|
|
159
159
|
test.equal(await Cache.healthCheckProxy(), true, 'Health check proxy')
|