@mojaloop/sdk-scheme-adapter 24.2.0-csi-1210.6 → 24.2.1-snapshot.0
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/.yarn/cache/@hapi-hapi-npm-21.4.0-2644a983d1-4e6ccd65ba.zip +0 -0
- package/.yarn/cache/@hapi-statehood-npm-8.2.0-5844e85740-0ebe5fa44e.zip +0 -0
- package/.yarn/cache/@mojaloop-central-services-shared-npm-18.22.1-afa19f2925-27182cd5be.zip +0 -0
- package/.yarn/cache/{@mojaloop-event-sdk-npm-14.1.5-97dbf6c0e3-9d5836df5a.zip → @mojaloop-event-sdk-npm-14.3.0-2aa8149477-6173c7d96f.zip} +0 -0
- package/.yarn/cache/@mojaloop-inter-scheme-proxy-cache-lib-npm-2.3.7-87034262d3-37fe9b388c.zip +0 -0
- package/.yarn/cache/@mojaloop-sdk-standard-components-npm-19.10.0-snapshot.1-e9bbd7866c-90ec21d0f6.zip +0 -0
- package/.yarn/cache/{@types-node-npm-22.13.9-565bb4cd14-d36ae841fa.zip → @types-node-npm-22.13.10-af5336e62b-1cd6b899df.zip} +0 -0
- package/.yarn/cache/axios-npm-1.8.2-55671cda10-c47a43b79a.zip +0 -0
- package/.yarn/cache/ioredis-npm-5.6.0-2140ad9baf-b085cec251.zip +0 -0
- package/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +14 -0
- package/docker-compose.yml +10 -5
- package/modules/api-svc/package.json +5 -5
- package/modules/api-svc/src/config.js +4 -3
- package/modules/api-svc/src/index.js +60 -13
- package/modules/api-svc/src/lib/logger.js +47 -0
- package/modules/api-svc/src/lib/utils.js +1 -19
- package/modules/api-svc/test/integration/lib/cache.test.js +2 -7
- package/modules/api-svc/test/integration-pm4ml/mockServers/managementService/config.js +3 -2
- package/modules/api-svc/test/integration-pm4ml/mockServers/managementService/index.js +25 -24
- package/modules/api-svc/test/integration-pm4ml/mockServers/managementService/server.js +35 -2
- package/modules/api-svc/test/unit/BackendEventHandler.test.js +2 -2
- package/modules/api-svc/test/unit/ControlClient.test.js +5 -4
- package/modules/api-svc/test/unit/FSPIOPEventHandler.test.js +6 -5
- package/modules/api-svc/test/unit/InboundServer-iso20022.test.js +3 -3
- package/modules/api-svc/test/unit/InboundServer.test.js +3 -2
- package/modules/api-svc/test/unit/TestServer.test.js +10 -11
- package/modules/api-svc/test/unit/api/transfers/utils.js +2 -2
- package/modules/api-svc/test/unit/api/utils.js +4 -3
- package/modules/api-svc/test/unit/ilp.test.js +3 -2
- package/modules/api-svc/test/unit/inboundApi/handlers-iso20022.test.js +5 -5
- package/modules/api-svc/test/unit/inboundApi/handlers.test.js +28 -27
- package/modules/api-svc/test/unit/index.test.js +10 -13
- package/modules/api-svc/test/unit/lib/cache.test.js +2 -2
- package/modules/api-svc/test/unit/lib/model/AccountsModel.test.js +3 -2
- package/modules/api-svc/test/unit/lib/model/InboundTransfersModel.test.js +10 -8
- package/modules/api-svc/test/unit/lib/model/OutboundBulkQuotesModel.test.js +4 -4
- package/modules/api-svc/test/unit/lib/model/OutboundBulkTransfersModel.test.js +3 -2
- package/modules/api-svc/test/unit/lib/model/OutboundRequestToPayModel.test.js +5 -4
- package/modules/api-svc/test/unit/lib/model/OutboundRequestToPayTransferModel.test.js +4 -4
- package/modules/api-svc/test/unit/lib/model/OutboundTransfersISO20022.test.js +5 -6
- package/modules/api-svc/test/unit/lib/model/OutboundTransfersModel.test.js +4 -10
- package/modules/api-svc/test/unit/lib/model/lib/requests/backendRequests.test.js +3 -2
- package/modules/api-svc/test/unit/mockLogger.js +10 -7
- package/modules/outbound-command-event-handler/package.json +3 -3
- package/modules/outbound-domain-event-handler/package.json +2 -2
- package/modules/private-shared-lib/package.json +3 -3
- package/package.json +2 -2
|
@@ -35,15 +35,14 @@ process.env.SUPPORTED_CURRENCIES='USD';
|
|
|
35
35
|
jest.mock('redis');
|
|
36
36
|
jest.unmock('@mojaloop/sdk-standard-components');
|
|
37
37
|
|
|
38
|
-
const
|
|
38
|
+
const StateMachine = require('javascript-state-machine');
|
|
39
39
|
const { MojaloopRequests } = jest.requireActual('@mojaloop/sdk-standard-components');
|
|
40
40
|
|
|
41
41
|
const Cache = require('~/lib/cache');
|
|
42
|
-
const { MetricsClient } = require('~/lib/metrics');
|
|
43
42
|
const Model = require('~/lib/model').OutboundTransfersModel;
|
|
44
43
|
const PartiesModel = require('~/lib/model').PartiesModel;
|
|
45
|
-
|
|
46
|
-
const
|
|
44
|
+
const { createLogger } = require('~/lib/logger');
|
|
45
|
+
const { MetricsClient } = require('~/lib/metrics');
|
|
47
46
|
|
|
48
47
|
const defaultConfig = require('./data/defaultConfig');
|
|
49
48
|
const transferRequest = require('./data/transferRequest');
|
|
@@ -160,7 +159,7 @@ describe('API_TYPE="iso20022"', () => {
|
|
|
160
159
|
|
|
161
160
|
beforeEach(async () => {
|
|
162
161
|
config = JSON.parse(JSON.stringify(defaultConfig));
|
|
163
|
-
logger =
|
|
162
|
+
logger = createLogger({ context: { app: 'outbound-model-unit-tests-cache' }, stringify: () => '' });
|
|
164
163
|
cache = new Cache({
|
|
165
164
|
cacheUrl: 'redis://dummy:1234',
|
|
166
165
|
logger,
|
|
@@ -187,7 +186,7 @@ describe('API_TYPE="iso20022"', () => {
|
|
|
187
186
|
|
|
188
187
|
// mock the final method MojaloopRequests calls to send the http request
|
|
189
188
|
// this allows us to spy on the request body being sent
|
|
190
|
-
jest.spyOn(Object.getPrototypeOf(MojaloopRequests.prototype), '_request').mockImplementation(async (opts
|
|
189
|
+
jest.spyOn(Object.getPrototypeOf(MojaloopRequests.prototype), '_request').mockImplementation(async (opts) => {
|
|
191
190
|
// console.log(`_reqeust called ${opts}`);
|
|
192
191
|
if(opts.uri.includes('parties') && opts.method === 'GET') {
|
|
193
192
|
//get parties called
|
|
@@ -37,7 +37,7 @@ process.env.SUPPORTED_CURRENCIES='USD';
|
|
|
37
37
|
jest.mock('@mojaloop/sdk-standard-components');
|
|
38
38
|
jest.mock('redis');
|
|
39
39
|
|
|
40
|
-
const { MojaloopRequests
|
|
40
|
+
const { MojaloopRequests } = require('@mojaloop/sdk-standard-components');
|
|
41
41
|
const FSPIOPTransferStateEnum = require('@mojaloop/central-services-shared').Enum.Transfers.TransferState;
|
|
42
42
|
const StateMachine = require('javascript-state-machine');
|
|
43
43
|
|
|
@@ -45,6 +45,7 @@ const Model = require('~/lib/model').OutboundTransfersModel;
|
|
|
45
45
|
const PartiesModel = require('~/lib/model').PartiesModel;
|
|
46
46
|
const Cache = require('~/lib/cache');
|
|
47
47
|
const { MetricsClient } = require('~/lib/metrics');
|
|
48
|
+
const { createLogger } = require('~/lib/logger');
|
|
48
49
|
|
|
49
50
|
const mocks = require('./data/mocks');
|
|
50
51
|
const defaultConfig = require('./data/defaultConfig');
|
|
@@ -178,7 +179,7 @@ describe('OutboundTransfersModel Tests', () => {
|
|
|
178
179
|
}
|
|
179
180
|
|
|
180
181
|
beforeAll(async () => {
|
|
181
|
-
logger =
|
|
182
|
+
logger = createLogger({ context: { app: 'outbound-model-unit-tests-cache' }, stringify: () => '' });
|
|
182
183
|
quoteResponse = JSON.parse(JSON.stringify(quoteResponseTemplate));
|
|
183
184
|
metricsClient = new MetricsClient();
|
|
184
185
|
});
|
|
@@ -221,13 +222,6 @@ describe('OutboundTransfersModel Tests', () => {
|
|
|
221
222
|
expect(model.data.traceId.length).toBe(32);
|
|
222
223
|
});
|
|
223
224
|
|
|
224
|
-
// test('should generate traceId based on transferId value', async () => {
|
|
225
|
-
// const model = await createAndInitModel();
|
|
226
|
-
// expect(model.data.transferId.length).toBe(26);
|
|
227
|
-
// expect(model.data.traceId.length).toBe(32);
|
|
228
|
-
// // todo: check traceID value
|
|
229
|
-
// });
|
|
230
|
-
|
|
231
225
|
test('executes all three transfer stages without halting when AUTO_ACCEPT_PARTY and AUTO_ACCEPT_QUOTES are true', async () => {
|
|
232
226
|
config.autoAcceptParty = true;
|
|
233
227
|
config.autoAcceptQuotes = true;
|
|
@@ -1666,7 +1660,7 @@ describe('OutboundTransfersModel Tests', () => {
|
|
|
1666
1660
|
beforeEach(() => {
|
|
1667
1661
|
model = new Model({
|
|
1668
1662
|
cache,
|
|
1669
|
-
logger:
|
|
1663
|
+
logger: createLogger({ context: { app: 'outbound-model-fx-flow-unit-tests' } }),
|
|
1670
1664
|
metricsClient,
|
|
1671
1665
|
...config,
|
|
1672
1666
|
});
|
|
@@ -27,15 +27,16 @@
|
|
|
27
27
|
**********/
|
|
28
28
|
|
|
29
29
|
jest.unmock('@mojaloop/sdk-standard-components');
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
const { mockAxios } = require('../../../../../helpers');
|
|
32
|
+
const { createLogger } = require('~/lib/logger');
|
|
32
33
|
|
|
33
34
|
const { BackendRequests, HTTPResponseError } = require('../../../../../../src/lib/model/lib/requests');
|
|
34
35
|
const defaultConfig = require('../../data/defaultConfig');
|
|
35
36
|
|
|
36
37
|
const config = {
|
|
37
38
|
...defaultConfig,
|
|
38
|
-
logger:
|
|
39
|
+
logger: createLogger(),
|
|
39
40
|
};
|
|
40
41
|
|
|
41
42
|
describe('backendRequests Tests -->', () => {
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
- Paweł Marzec <pawel.marzec@modusbox.com>
|
|
27
27
|
--------------
|
|
28
28
|
******/
|
|
29
|
-
|
|
29
|
+
|
|
30
|
+
const { createLogger } = require('../../src/lib/logger');
|
|
30
31
|
|
|
31
32
|
function mockLogger(context, keepQuiet) {
|
|
32
33
|
// if keepQuite is undefined then be quiet
|
|
@@ -44,7 +45,8 @@ function mockLogger(context, keepQuiet) {
|
|
|
44
45
|
error: jest.fn(),
|
|
45
46
|
trace: jest.fn(),
|
|
46
47
|
info: jest.fn(),
|
|
47
|
-
fatal: jest.fn(),
|
|
48
|
+
// fatal: jest.fn(),
|
|
49
|
+
// todo: add all methods from ContextLogger
|
|
48
50
|
|
|
49
51
|
isVerboseEnabled: jest.fn(() => true),
|
|
50
52
|
isDebugEnabled: jest.fn(() => true),
|
|
@@ -52,16 +54,17 @@ function mockLogger(context, keepQuiet) {
|
|
|
52
54
|
isErrorEnabled: jest.fn(() => true),
|
|
53
55
|
isTraceEnabled: jest.fn(() => true),
|
|
54
56
|
isInfoEnabled: jest.fn(() => true),
|
|
55
|
-
isFatalEnabled: jest.fn(() => true)
|
|
57
|
+
// isFatalEnabled: jest.fn(() => true)
|
|
56
58
|
};
|
|
57
59
|
const mockLogger = ({
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
...methods,
|
|
61
|
+
push: jest.fn(() => mockLogger),
|
|
62
|
+
child: jest.fn(() => mockLogger)
|
|
63
|
+
});
|
|
61
64
|
|
|
62
65
|
return mockLogger;
|
|
63
66
|
}
|
|
64
|
-
return
|
|
67
|
+
return createLogger();
|
|
65
68
|
}
|
|
66
69
|
|
|
67
70
|
module.exports = mockLogger;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mojaloop/sdk-scheme-adapter-outbound-command-event-handler",
|
|
3
|
-
"version": "0.3.0-snapshot.
|
|
3
|
+
"version": "0.3.0-snapshot.25",
|
|
4
4
|
"description": "Mojaloop sdk scheme adapter command event handler",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/mojaloop/sdk-scheme-adapter/",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@mojaloop/api-snippets": "17.8.0",
|
|
45
|
-
"@mojaloop/central-services-shared": "18.
|
|
45
|
+
"@mojaloop/central-services-shared": "18.22.1",
|
|
46
46
|
"@mojaloop/logging-bc-client-lib": "0.5.8",
|
|
47
47
|
"@mojaloop/logging-bc-public-types-lib": "0.5.4",
|
|
48
48
|
"@mojaloop/sdk-scheme-adapter-private-shared-lib": "workspace:^",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@types/convict": "6.1.6",
|
|
60
60
|
"@types/express": "5.0.0",
|
|
61
61
|
"@types/jest": "29.5.14",
|
|
62
|
-
"@types/node": "22.13.
|
|
62
|
+
"@types/node": "22.13.10",
|
|
63
63
|
"@types/node-cache": "4.2.5",
|
|
64
64
|
"@types/supertest": "6.0.2",
|
|
65
65
|
"@types/swagger-ui-express": "4.1.8",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mojaloop/sdk-scheme-adapter-outbound-domain-event-handler",
|
|
3
|
-
"version": "0.3.0-snapshot.
|
|
3
|
+
"version": "0.3.0-snapshot.25",
|
|
4
4
|
"description": "mojaloop sdk scheme adapter outbound domain event handler",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/mojaloop/sdk-scheme-adapter/",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@types/convict": "6.1.6",
|
|
57
57
|
"@types/express": "5.0.0",
|
|
58
58
|
"@types/jest": "29.5.14",
|
|
59
|
-
"@types/node": "22.13.
|
|
59
|
+
"@types/node": "22.13.10",
|
|
60
60
|
"@types/node-cache": "4.2.5",
|
|
61
61
|
"@types/supertest": "6.0.2",
|
|
62
62
|
"@types/swagger-ui-express": "4.1.8",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mojaloop/sdk-scheme-adapter-private-shared-lib",
|
|
3
|
-
"version": "0.4.0-snapshot.
|
|
3
|
+
"version": "0.4.0-snapshot.25",
|
|
4
4
|
"description": "SDK Scheme Adapter private shared library.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/mojaloop/accounts-and-balances-bc/tree/main/modules/private-types",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@mojaloop/api-snippets": "17.8.0",
|
|
33
|
-
"@mojaloop/central-services-shared": "18.
|
|
33
|
+
"@mojaloop/central-services-shared": "18.22.1",
|
|
34
34
|
"@mojaloop/logging-bc-public-types-lib": "0.5.4",
|
|
35
35
|
"@mojaloop/platform-shared-lib-messaging-types-lib": "0.7.1",
|
|
36
36
|
"@mojaloop/platform-shared-lib-nodejs-kafka-client-lib": "0.5.18",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@eslint/compat": "1.2.7",
|
|
43
|
-
"@types/node": "22.13.
|
|
43
|
+
"@types/node": "22.13.10",
|
|
44
44
|
"@types/uuid": "10.0.0",
|
|
45
45
|
"@typescript-eslint/eslint-plugin": "8.26.0",
|
|
46
46
|
"@typescript-eslint/parser": "8.26.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mojaloop/sdk-scheme-adapter",
|
|
3
|
-
"version": "24.2.
|
|
3
|
+
"version": "24.2.1-snapshot.0",
|
|
4
4
|
"description": "mojaloop sdk-scheme-adapter",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/mojaloop/sdk-scheme-adapter",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@types/jest": "29.5.14",
|
|
85
|
-
"@types/node": "22.13.
|
|
85
|
+
"@types/node": "22.13.10",
|
|
86
86
|
"@types/node-cache": "4.2.5",
|
|
87
87
|
"@typescript-eslint/eslint-plugin": "8.26.0",
|
|
88
88
|
"@typescript-eslint/parser": "8.26.0",
|