@mojaloop/sdk-scheme-adapter 24.7.0 → 24.8.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.
Files changed (45) hide show
  1. package/.yarn/cache/{@mojaloop-central-services-shared-npm-18.23.2-5627dda2e3-5fb84a745d.zip → @mojaloop-central-services-shared-npm-18.24.0-34d9578f93-8c24dea9e4.zip} +0 -0
  2. package/.yarn/cache/@mojaloop-inter-scheme-proxy-cache-lib-npm-2.5.0-eeb80fe407-bf7e14ce33.zip +0 -0
  3. package/.yarn/cache/{@mojaloop-sdk-standard-components-npm-19.11.2-d6fd02bca7-0cbc9e56e2.zip → @mojaloop-sdk-standard-components-npm-19.14.0-snapshot.3-1229293931-a3faf5f3ac.zip} +0 -0
  4. package/.yarn/cache/{@types-node-npm-22.14.0-a09e354ed5-8bfae1d3c4.zip → @types-node-npm-22.14.1-ff7e0a29d7-e22363f40a.zip} +0 -0
  5. package/.yarn/cache/{@typescript-eslint-eslint-plugin-npm-8.29.0-9227710d0b-83475d3a47.zip → @typescript-eslint-eslint-plugin-npm-8.30.1-f4da10f397-dbdc516ad9.zip} +0 -0
  6. package/.yarn/cache/{@typescript-eslint-parser-npm-8.29.0-510bf7f523-96a1a8cc8a.zip → @typescript-eslint-parser-npm-8.30.1-bcee4d456e-cac3cfe1c1.zip} +0 -0
  7. package/.yarn/cache/{@typescript-eslint-scope-manager-npm-8.29.0-6046e43075-89a5999ba8.zip → @typescript-eslint-scope-manager-npm-8.30.1-4b479f2d73-cef9e70016.zip} +0 -0
  8. package/.yarn/cache/{@typescript-eslint-type-utils-npm-8.29.0-1674862818-553fde7826.zip → @typescript-eslint-type-utils-npm-8.30.1-0e1c22c03c-6283d4b4d0.zip} +0 -0
  9. package/.yarn/cache/@typescript-eslint-types-npm-8.30.1-8bfe1eac21-264c4d8e1b.zip +0 -0
  10. package/.yarn/cache/{@typescript-eslint-typescript-estree-npm-8.29.0-92fb2cc910-7275c61dc5.zip → @typescript-eslint-typescript-estree-npm-8.30.1-185919bfaf-f57a34e36d.zip} +0 -0
  11. package/.yarn/cache/{@typescript-eslint-utils-npm-8.29.0-ebf0886c15-81d1afc5de.zip → @typescript-eslint-utils-npm-8.30.1-e8c9d86e99-637b3b8b3d.zip} +0 -0
  12. package/.yarn/cache/{@typescript-eslint-visitor-keys-npm-8.29.0-e8a9b1561e-d306a7d96b.zip → @typescript-eslint-visitor-keys-npm-8.30.1-e4b2f0ebba-7878f1e3e2.zip} +0 -0
  13. package/.yarn/cache/dotenv-npm-16.5.0-67343a179e-6543fe87b5.zip +0 -0
  14. package/.yarn/cache/ioredis-npm-5.6.1-d69383b35a-89100a97b2.zip +0 -0
  15. package/.yarn/cache/{koa-npm-2.16.0-fccb365a23-01be3231d4.zip → koa-npm-2.16.1-7f26717794-4946d19efb.zip} +0 -0
  16. package/.yarn/cache/openapi-backend-npm-5.12.0-b2560843ff-0b13c6f128.zip +0 -0
  17. package/.yarn/cache/{ts-jest-npm-29.3.1-c9a9791a5c-7320bbfab2.zip → ts-jest-npm-29.3.2-cda1b1f7ad-aad8f81ba5.zip} +0 -0
  18. package/.yarn/cache/{type-fest-npm-4.39.1-227092867f-71ce0e2582.zip → type-fest-npm-4.40.0-18c72d1d94-af2863a707.zip} +0 -0
  19. package/.yarn/cache/{typescript-npm-5.8.2-b95d637f6a-7f9e3d7ac1.zip → typescript-npm-5.8.3-fbd7aef456-cb1d081c88.zip} +0 -0
  20. package/.yarn/cache/{typescript-patch-ef570fb450-a58d19ff98.zip → typescript-patch-9106e8a080-1b503525a8.zip} +0 -0
  21. package/.yarn/cache/yaml-npm-2.7.1-9e92f81b45-385f8115dd.zip +0 -0
  22. package/.yarn/install-state.gz +0 -0
  23. package/CHANGELOG.md +7 -0
  24. package/modules/api-svc/package.json +6 -6
  25. package/modules/api-svc/src/InboundServer/api.yaml +172 -133
  26. package/modules/api-svc/src/InboundServer/api_iso20022.yaml +39 -0
  27. package/modules/api-svc/src/InboundServer/api_template.yaml +170 -66
  28. package/modules/api-svc/src/InboundServer/handlers.js +26 -6
  29. package/modules/api-svc/src/InboundServer/index.js +2 -1
  30. package/modules/api-svc/src/InboundServer/middlewares.js +61 -21
  31. package/modules/api-svc/src/config.js +1 -0
  32. package/modules/api-svc/src/lib/model/InboundPingModel.js +100 -0
  33. package/modules/api-svc/src/lib/model/index.js +3 -2
  34. package/modules/api-svc/test/__mocks__/@mojaloop/sdk-standard-components.js +2 -0
  35. package/modules/api-svc/test/unit/lib/model/InboundPingModel.test.js +124 -0
  36. package/modules/outbound-command-event-handler/package.json +8 -8
  37. package/modules/outbound-domain-event-handler/package.json +7 -7
  38. package/modules/private-shared-lib/package.json +7 -7
  39. package/package.json +6 -6
  40. package/.yarn/cache/@mojaloop-api-snippets-npm-17.10.1-4e48158984-9a0f1d2fd2.zip +0 -0
  41. package/.yarn/cache/@mojaloop-central-services-logger-npm-11.7.0-bd1e0d14fc-386d668607.zip +0 -0
  42. package/.yarn/cache/@mojaloop-inter-scheme-proxy-cache-lib-npm-2.4.0-cc60317958-8e539f65c3.zip +0 -0
  43. package/.yarn/cache/@mojaloop-ml-schema-transformer-lib-npm-2.7.0-bc64d97e72-bad585bd7d.zip +0 -0
  44. package/.yarn/cache/@rollup-rollup-linux-x64-musl-npm-4.37.0-51462d4265-8.zip +0 -0
  45. package/.yarn/cache/@typescript-eslint-types-npm-8.29.0-be9f1bbfb7-30bf710e21.zip +0 -0
@@ -0,0 +1,124 @@
1
+ /*****
2
+ License
3
+ --------------
4
+ Copyright © 2020-2025 Mojaloop Foundation
5
+ The Mojaloop files are made available by the Mojaloop Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
10
+
11
+ Contributors
12
+ --------------
13
+ This is the official list of the Mojaloop project contributors for this file.
14
+ Names of the original copyright holders (individuals or organizations)
15
+ should be listed with a '*' in the first column. People who have
16
+ contributed from an organization can be listed under the organization
17
+ that actually holds the copyright for their contributions (see the
18
+ Mojaloop Foundation for an example). Those individuals should have
19
+ their names indented and be marked with a '-'. Email address can be added
20
+ optionally within square brackets <email>.
21
+
22
+ * Mojaloop Foundation
23
+ * Eugen Klymniuk <eugen.klymniuk@infitx.com>
24
+
25
+ --------------
26
+ ******/
27
+
28
+ const { mockAxios, jsonContentTypeHeader} = require('../../../helpers');
29
+ const { Headers } = require('@mojaloop/central-services-shared').Enum.Http;
30
+
31
+ const InboundPingModel = require('../../../../src/lib/model/InboundPingModel');
32
+ const { logger } = require('../../../../src/lib/logger');
33
+ const defaultConfig = require('./data/defaultConfig');
34
+
35
+ const createInboundPingModel = (conf = configDto()) => new InboundPingModel(conf);
36
+
37
+ const configDto = ({
38
+ dfspId = 'mojaloop-sdk',
39
+ jwsSign = false,
40
+ wso2 = { auth: null }
41
+ } = {}) => ({
42
+ ...defaultConfig,
43
+ logger,
44
+ dfspId,
45
+ jwsSign,
46
+ wso2
47
+ });
48
+
49
+ const postPingParamsDto = ({
50
+ jwsPingValidationResult,
51
+ sourceFspId = 'sourceDfsp',
52
+ requestId = String(Date.now()),
53
+ headers = pingHeadersDto({ source: sourceFspId })
54
+ } = {}) => ({
55
+ jwsPingValidationResult,
56
+ sourceFspId,
57
+ body: { requestId },
58
+ headers
59
+ });
60
+
61
+ const pingHeadersDto = ({
62
+ source = 'sourceDfsp',
63
+ destination = configDto().dfspId,
64
+ signature
65
+ } = {}) => ({
66
+ ...jsonContentTypeHeader,
67
+ [Headers.FSPIOP.SOURCE]: source,
68
+ [Headers.FSPIOP.DESTINATION]: destination,
69
+ ...(signature && { [Headers.FSPIOP.SIGNATURE]: signature })
70
+ });
71
+
72
+ describe.skip('InboundPingModel Tests -->', () => {
73
+ beforeEach(() => {
74
+ mockAxios.reset();
75
+ });
76
+
77
+ test('should create InboundPingModel instance with default config', () => {
78
+ const model = createInboundPingModel();
79
+ expect(model).toBeDefined();
80
+ });
81
+
82
+ test('should send successful ping callback', async () => {
83
+ expect.hasAssertions();
84
+ const jwsPingValidationResult = true;
85
+ const requestId = String(Date.now());
86
+ const sourceFspId = 'fromDfsp';
87
+ const dfspId = 'theSDK';
88
+ mockAxios.onPut().reply((reqConfig) => {
89
+ expect(reqConfig.url).toBe(`/ping/${requestId}/`);
90
+ expect(reqConfig.headers[Headers.FSPIOP.SOURCE]).toBe(dfspId);
91
+ expect(reqConfig.headers[Headers.FSPIOP.DESTINATION]).toBe(sourceFspId);
92
+ return [200];
93
+ });
94
+ const model = createInboundPingModel(configDto({ dfspId }));
95
+
96
+ await model.postPing(postPingParamsDto({
97
+ jwsPingValidationResult, requestId, sourceFspId
98
+ }));
99
+ });
100
+
101
+ test('should send error callback, if jwsPingValidationResult is undefined (no validationKeys)', async () => {
102
+ expect.hasAssertions();
103
+ const requestId = String(Date.now());
104
+ mockAxios.onPut().reply((reqConfig) => {
105
+ expect(reqConfig.url).toBe(`/ping/${requestId}/error`);
106
+ return [200];
107
+ });
108
+ const model = createInboundPingModel();
109
+ await model.postPing(postPingParamsDto({ requestId }));
110
+ });
111
+
112
+ test('should send error callback, if jwsPingValidationResult is validation error', async () => {
113
+ expect.hasAssertions();
114
+ const jwsPingValidationResult = new Error('Validation Error');
115
+ const requestId = String(Date.now());
116
+ mockAxios.onPut().reply((reqConfig) => {
117
+ expect(reqConfig.url).toBe(`/ping/${requestId}/error`);
118
+ return [200];
119
+ });
120
+ const model = createInboundPingModel();
121
+ await model.postPing(postPingParamsDto({ jwsPingValidationResult, requestId }));
122
+ });
123
+ });
124
+
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter-outbound-command-event-handler",
3
- "version": "0.3.0-snapshot.30",
3
+ "version": "0.3.0-snapshot.31",
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.10.2",
45
- "@mojaloop/central-services-shared": "18.23.2",
45
+ "@mojaloop/central-services-shared": "18.24.0",
46
46
  "@mojaloop/logging-bc-client-lib": "0.5.8",
47
47
  "@mojaloop/logging-bc-public-types-lib": "0.5.5",
48
48
  "@mojaloop/sdk-scheme-adapter-private-shared-lib": "workspace:^",
@@ -50,7 +50,7 @@
50
50
  "ajv-formats": "3.0.1",
51
51
  "convict": "6.2.4",
52
52
  "express": "4.21.2",
53
- "openapi-backend": "5.11.1",
53
+ "openapi-backend": "5.12.0",
54
54
  "redis": "4.7.0",
55
55
  "swagger-ui-express": "5.0.1",
56
56
  "yamljs": "0.3.0"
@@ -60,13 +60,13 @@
60
60
  "@types/convict": "6.1.6",
61
61
  "@types/express": "5.0.1",
62
62
  "@types/jest": "29.5.14",
63
- "@types/node": "22.14.0",
63
+ "@types/node": "22.14.1",
64
64
  "@types/node-cache": "4.2.5",
65
65
  "@types/supertest": "6.0.3",
66
66
  "@types/swagger-ui-express": "4.1.8",
67
67
  "@types/yamljs": "0.2.34",
68
- "@typescript-eslint/eslint-plugin": "8.29.0",
69
- "@typescript-eslint/parser": "8.29.0",
68
+ "@typescript-eslint/eslint-plugin": "8.30.1",
69
+ "@typescript-eslint/parser": "8.30.1",
70
70
  "copyfiles": "2.4.1",
71
71
  "eslint": "9.15.0",
72
72
  "jest": "29.7.0",
@@ -74,9 +74,9 @@
74
74
  "npm-check-updates": "16.7.10",
75
75
  "replace": "1.2.2",
76
76
  "standard-version": "9.5.0",
77
- "ts-jest": "29.3.1",
77
+ "ts-jest": "29.3.2",
78
78
  "ts-node": "10.9.2",
79
- "typescript": "5.8.2"
79
+ "typescript": "5.8.3"
80
80
  },
81
81
  "nodemonConfig": {
82
82
  "watch": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter-outbound-domain-event-handler",
3
- "version": "0.3.0-snapshot.30",
3
+ "version": "0.3.0-snapshot.31",
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/",
@@ -48,7 +48,7 @@
48
48
  "ajv-formats": "3.0.1",
49
49
  "convict": "6.2.4",
50
50
  "express": "4.21.2",
51
- "openapi-backend": "5.11.1",
51
+ "openapi-backend": "5.12.0",
52
52
  "redis": "4.7.0",
53
53
  "swagger-ui-express": "5.0.1",
54
54
  "yamljs": "0.3.0"
@@ -57,13 +57,13 @@
57
57
  "@types/convict": "6.1.6",
58
58
  "@types/express": "5.0.1",
59
59
  "@types/jest": "29.5.14",
60
- "@types/node": "22.14.0",
60
+ "@types/node": "22.14.1",
61
61
  "@types/node-cache": "4.2.5",
62
62
  "@types/supertest": "6.0.3",
63
63
  "@types/swagger-ui-express": "4.1.8",
64
64
  "@types/yamljs": "0.2.34",
65
- "@typescript-eslint/eslint-plugin": "8.29.0",
66
- "@typescript-eslint/parser": "8.29.0",
65
+ "@typescript-eslint/eslint-plugin": "8.30.1",
66
+ "@typescript-eslint/parser": "8.30.1",
67
67
  "copyfiles": "2.4.1",
68
68
  "eslint": "9.15.0",
69
69
  "jest": "29.7.0",
@@ -71,9 +71,9 @@
71
71
  "npm-check-updates": "16.7.10",
72
72
  "replace": "1.2.2",
73
73
  "standard-version": "9.5.0",
74
- "ts-jest": "29.3.1",
74
+ "ts-jest": "29.3.2",
75
75
  "ts-node": "10.9.2",
76
- "typescript": "5.8.2"
76
+ "typescript": "5.8.3"
77
77
  },
78
78
  "nodemonConfig": {
79
79
  "watch": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter-private-shared-lib",
3
- "version": "0.4.0-snapshot.30",
3
+ "version": "0.4.0-snapshot.31",
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.10.2",
33
- "@mojaloop/central-services-shared": "18.23.2",
33
+ "@mojaloop/central-services-shared": "18.24.0",
34
34
  "@mojaloop/logging-bc-public-types-lib": "0.5.5",
35
35
  "@mojaloop/platform-shared-lib-messaging-types-lib": "0.7.2",
36
36
  "@mojaloop/platform-shared-lib-nodejs-kafka-client-lib": "0.5.18",
@@ -40,18 +40,18 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "@eslint/compat": "1.2.8",
43
- "@types/node": "22.14.0",
43
+ "@types/node": "22.14.1",
44
44
  "@types/uuid": "10.0.0",
45
- "@typescript-eslint/eslint-plugin": "8.29.0",
46
- "@typescript-eslint/parser": "8.29.0",
45
+ "@typescript-eslint/eslint-plugin": "8.30.1",
46
+ "@typescript-eslint/parser": "8.30.1",
47
47
  "eslint": "9.15.0",
48
48
  "jest": "29.7.0",
49
49
  "npm-check-updates": "16.7.10",
50
50
  "replace": "1.2.2",
51
51
  "standard-version": "9.5.0",
52
- "ts-jest": "29.3.1",
52
+ "ts-jest": "29.3.2",
53
53
  "tslib": "2.8.1",
54
- "typescript": "5.8.2"
54
+ "typescript": "5.8.3"
55
55
  },
56
56
  "standard-version": {
57
57
  "scripts": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter",
3
- "version": "24.7.0",
3
+ "version": "24.8.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,10 +82,10 @@
82
82
  },
83
83
  "devDependencies": {
84
84
  "@types/jest": "29.5.14",
85
- "@types/node": "22.14.0",
85
+ "@types/node": "22.14.1",
86
86
  "@types/node-cache": "4.2.5",
87
- "@typescript-eslint/eslint-plugin": "8.29.0",
88
- "@typescript-eslint/parser": "8.29.0",
87
+ "@typescript-eslint/eslint-plugin": "8.30.1",
88
+ "@typescript-eslint/parser": "8.30.1",
89
89
  "audit-ci": "7.1.0",
90
90
  "eslint": "9.15.0",
91
91
  "eslint-config-airbnb-typescript": "18.0.0",
@@ -96,9 +96,9 @@
96
96
  "npm-check-updates": "16.7.10",
97
97
  "replace": "1.2.2",
98
98
  "standard-version": "9.5.0",
99
- "ts-jest": "29.3.1",
99
+ "ts-jest": "29.3.2",
100
100
  "ts-node": "10.9.2",
101
- "typescript": "5.8.2",
101
+ "typescript": "5.8.3",
102
102
  "yarn-audit-fix": "10.1.1"
103
103
  },
104
104
  "overrides": {