@mojaloop/sdk-scheme-adapter 12.2.1 → 12.2.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/.env.example +1 -1
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/config.js +8 -8
- package/test/unit/config.test.js +1 -1
package/.env.example
CHANGED
|
@@ -141,7 +141,7 @@ ALLOW_TRANSFER_WITHOUT_QUOTE=false
|
|
|
141
141
|
# To enable request for notification on fulfiled transfer
|
|
142
142
|
RESERVE_NOTIFICATION=true
|
|
143
143
|
|
|
144
|
-
# resources API versions should be string in format: "
|
|
144
|
+
# resources API versions should be string in format: "resourceOneName=1.0,resourceTwoName=1.1"
|
|
145
145
|
RESOURCE_VERSIONS="transfers=1.1,participants=1.1"
|
|
146
146
|
|
|
147
147
|
# Management API websocket connection settings.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
# Changelog: [mojaloop/thirdparty-api-svc](https://github.com/mojaloop/thirdparty-api-svc)
|
|
2
|
+
### [12.2.2](https://github.com/mojaloop/sdk-scheme-adapter/compare/v12.2.1...v12.2.2) (2022-04-22)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* make management url config option optional ([#310](https://github.com/mojaloop/sdk-scheme-adapter/issues/310)) ([93c4048](https://github.com/mojaloop/sdk-scheme-adapter/commit/93c4048d5a604be81ce90365ff3f9cd42b531fef))
|
|
8
|
+
|
|
2
9
|
### [12.2.1](https://github.com/mojaloop/sdk-scheme-adapter/compare/v12.2.0...v12.2.1) (2022-04-21)
|
|
3
10
|
|
|
4
11
|
|
package/package.json
CHANGED
package/src/config.js
CHANGED
|
@@ -22,8 +22,8 @@ function getFileContent (path) {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
* Gets Resources versions from
|
|
26
|
-
* should be string in format: "
|
|
25
|
+
* Gets Resources versions from environmental variable RESOURCES_VERSIONS
|
|
26
|
+
* should be string in format: "resourceOneName=1.0,resourceTwoName=1.1"
|
|
27
27
|
*/
|
|
28
28
|
function getVersionFromConfig (resourceString) {
|
|
29
29
|
const resourceVersionMap = {};
|
|
@@ -44,7 +44,7 @@ function parseResourceVersions (resourceString) {
|
|
|
44
44
|
const resourceFormatRegex = /(([A-Za-z])\w*)=([0-9]+).([0-9]+)([^;:|],*)/g;
|
|
45
45
|
const noSpResources = resourceString.replace(/\s/g,'');
|
|
46
46
|
if (!resourceFormatRegex.test(noSpResources)) {
|
|
47
|
-
throw new Error('Resource versions format should be in format: "
|
|
47
|
+
throw new Error('Resource versions format should be in format: "resourceOneName=1.0,resourceTwoName=1.1"');
|
|
48
48
|
}
|
|
49
49
|
return getVersionFromConfig(noSpResources);
|
|
50
50
|
}
|
|
@@ -58,10 +58,6 @@ const env = from(process.env, {
|
|
|
58
58
|
|
|
59
59
|
module.exports = {
|
|
60
60
|
__parseResourceVersion: parseResourceVersions,
|
|
61
|
-
control: {
|
|
62
|
-
mgmtAPIWsUrl: env.get('MGMT_API_WS_URL').required().asString(),
|
|
63
|
-
mgmtAPIWsPort: env.get('MGMT_API_WS_PORT').default('4005').asPortNumber()
|
|
64
|
-
},
|
|
65
61
|
mutualTLS: {
|
|
66
62
|
inboundRequests: {
|
|
67
63
|
enabled: env.get('INBOUND_MUTUAL_TLS_ENABLED').default('false').asBool(),
|
|
@@ -157,7 +153,7 @@ module.exports = {
|
|
|
157
153
|
|
|
158
154
|
proxyConfig: env.get('PROXY_CONFIG_PATH').asYamlConfig(),
|
|
159
155
|
reserveNotification: env.get('RESERVE_NOTIFICATION').default('false').asBool(),
|
|
160
|
-
// resourceVersions config should be string in format: "
|
|
156
|
+
// resourceVersions config should be string in format: "resourceOneName=1.0,resourceTwoName=1.1"
|
|
161
157
|
resourceVersions: env.get('RESOURCE_VERSIONS').default('').asResourceVersions(),
|
|
162
158
|
|
|
163
159
|
// in 3PPI DFSP's generate their own `transferId` which is associated with
|
|
@@ -166,4 +162,8 @@ module.exports = {
|
|
|
166
162
|
allowDifferentTransferTransactionId: env.get('ALLOW_DIFFERENT_TRANSFER_TRANSACTION_ID').default('false').asBool(),
|
|
167
163
|
|
|
168
164
|
pm4mlEnabled: env.get('PM4ML_ENABLED').default('false').asBool(),
|
|
165
|
+
control: {
|
|
166
|
+
mgmtAPIWsUrl: env.get('MGMT_API_WS_URL').default('127.0.0.1').asString(),
|
|
167
|
+
mgmtAPIWsPort: env.get('MGMT_API_WS_PORT').default('4005').asPortNumber()
|
|
168
|
+
},
|
|
169
169
|
};
|
package/test/unit/config.test.js
CHANGED
|
@@ -114,7 +114,7 @@ describe('config', () => {
|
|
|
114
114
|
|
|
115
115
|
it('should throw an err if the resource string is not correctly formed', () => {
|
|
116
116
|
const parseResourceVersion = require('~/config').__parseResourceVersion;
|
|
117
|
-
expect(() => parseResourceVersion('resourceOneName=1.0;resourceTwoName=1.1')).toThrowError(new Error('Resource versions format should be in format: "
|
|
117
|
+
expect(() => parseResourceVersion('resourceOneName=1.0;resourceTwoName=1.1')).toThrowError(new Error('Resource versions format should be in format: "resourceOneName=1.0,resourceTwoName=1.1"'));
|
|
118
118
|
});
|
|
119
119
|
|
|
120
120
|
});
|