@mojaloop/sdk-scheme-adapter 24.5.0-snapshot.2 → 24.6.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.
Binary file
package/CHANGELOG.md CHANGED
@@ -1,4 +1,25 @@
1
1
  # Changelog: [mojaloop/sdk-scheme-adapter](https://github.com/mojaloop/sdk-scheme-adapter)
2
+ ## [24.6.0](https://github.com/mojaloop/sdk-scheme-adapter/compare/v24.5.0...v24.6.0) (2025-03-24)
3
+
4
+
5
+ ### Features
6
+
7
+ * add ajv-formats package and integrate with OpenAPI backend validation ([#565](https://github.com/mojaloop/sdk-scheme-adapter/issues/565)) ([2de111c](https://github.com/mojaloop/sdk-scheme-adapter/commit/2de111c18cce717e8cb55fd50594d4a8b31b5ad3))
8
+
9
+ ## [24.5.0](https://github.com/mojaloop/sdk-scheme-adapter/compare/v24.4.1...v24.5.0) (2025-03-23)
10
+
11
+
12
+ ### Features
13
+
14
+ * update accounts to handle non currency tied participants ([#564](https://github.com/mojaloop/sdk-scheme-adapter/issues/564)) ([9e2c1da](https://github.com/mojaloop/sdk-scheme-adapter/commit/9e2c1da42042b461be813a30ab0a083a85f8e4e4))
15
+
16
+ ### [24.4.1](https://github.com/mojaloop/sdk-scheme-adapter/compare/v24.4.0...v24.4.1) (2025-03-20)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * **csi-1328:** add sdk 2.1 spec files for ttksims ([#563](https://github.com/mojaloop/sdk-scheme-adapter/issues/563)) ([b5e498e](https://github.com/mojaloop/sdk-scheme-adapter/commit/b5e498ee7bf22fd48c6c2d2c4d53347b72ee70cc))
22
+
2
23
  ## [24.4.0](https://github.com/mojaloop/sdk-scheme-adapter/compare/v24.3.2...v24.4.0) (2025-03-19)
3
24
 
4
25
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter-api-svc",
3
- "version": "21.0.0-snapshot.34",
3
+ "version": "21.0.0-snapshot.31",
4
4
  "description": "An adapter for connecting to Mojaloop API enabled switches.",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -64,7 +64,7 @@
64
64
  },
65
65
  "dependencies": {
66
66
  "@koa/cors": "5.0.0",
67
- "@mojaloop/api-snippets": "17.10.0",
67
+ "@mojaloop/api-snippets": "17.10.1",
68
68
  "@mojaloop/central-services-error-handling": "13.0.7",
69
69
  "@mojaloop/central-services-logger": "11.7.0",
70
70
  "@mojaloop/central-services-metrics": "12.5.0",
@@ -321,7 +321,7 @@ class AccountsModel {
321
321
  request = {
322
322
  requestId: this._idGenerator(),
323
323
  partyList: [],
324
- currency: account.currency,
324
+ currency: account?.currency,
325
325
  };
326
326
  requests.push(request);
327
327
  }
@@ -52,13 +52,23 @@ const transferRequest = require('./data/transferRequest');
52
52
 
53
53
  function generateAccounts(count, currencies) {
54
54
  const accounts = [];
55
- for (let currencyIndex = 0; currencyIndex < currencies.length; currencyIndex++) {
55
+ if (currencies) {
56
+ for (let currencyIndex = 0; currencyIndex < currencies.length; currencyIndex++) {
57
+ for (let i = 1; i <= count; i++) {
58
+ accounts.push({
59
+ idType: 'MSISDN',
60
+ idValue: String(i * (currencyIndex + 1)).padStart(9, '0'),
61
+ idSubValue: `Sub_${String(i * (currencyIndex + 1))}`.padStart(5, '0'),
62
+ currency: currencies[currencyIndex],
63
+ });
64
+ }
65
+ }
66
+ } else {
56
67
  for (let i = 1; i <= count; i++) {
57
68
  accounts.push({
58
69
  idType: 'MSISDN',
59
- idValue: String(i * (currencyIndex + 1)).padStart(9, '0'),
60
- idSubValue: `Sub_${String(i * (currencyIndex + 1))}`.padStart(5, '0'),
61
- currency: currencies[currencyIndex],
70
+ idValue: String(i).padStart(9, '0'),
71
+ idSubValue: `Sub_${String(i)}`.padStart(5, '0'),
62
72
  });
63
73
  }
64
74
  }
@@ -82,7 +92,7 @@ describe('AccountsModel', () => {
82
92
  partyId: party,
83
93
  // errorInformation: null
84
94
  })),
85
- currency: request.currency,
95
+ currency: request?.currency,
86
96
  },
87
97
  headers: {}
88
98
  },
@@ -104,8 +114,7 @@ describe('AccountsModel', () => {
104
114
 
105
115
  // wait for the model to reach a terminal state
106
116
  const result = await model.run();
107
-
108
- const expectedRequestsCount = currencies.length *
117
+ const expectedRequestsCount = (currencies?.length || 1) *
109
118
  (Math.floor(count / MAX_ITEMS_PER_REQUEST) + ((count % MAX_ITEMS_PER_REQUEST) ? 1 : 0));
110
119
  expect(MojaloopRequests.__postParticipants).toHaveBeenCalledTimes(expectedRequestsCount);
111
120
 
@@ -143,4 +152,8 @@ describe('AccountsModel', () => {
143
152
 
144
153
  test('create 20000 accounts', () =>
145
154
  testCreateAccount(20000, ['USD', 'EUR']));
155
+
156
+ test('create 100 accounts without currencies', () =>
157
+ testCreateAccount(100, null));
158
+
146
159
  });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter-outbound-command-event-handler",
3
- "version": "0.3.0-snapshot.32",
3
+ "version": "0.3.0-snapshot.29",
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/",
@@ -41,12 +41,13 @@
41
41
  "snapshot": "standard-version --no-verify --skip.changelog --prerelease snapshot --releaseCommitMessageFormat 'chore(snapshot): {{currentTag}}'"
42
42
  },
43
43
  "dependencies": {
44
- "@mojaloop/api-snippets": "17.10.0",
44
+ "@mojaloop/api-snippets": "17.10.1",
45
45
  "@mojaloop/central-services-shared": "18.23.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:^",
49
49
  "ajv": "8.17.1",
50
+ "ajv-formats": "3.0.1",
50
51
  "convict": "6.2.4",
51
52
  "express": "4.21.2",
52
53
  "openapi-backend": "5.11.1",
@@ -59,7 +60,7 @@
59
60
  "@types/convict": "6.1.6",
60
61
  "@types/express": "5.0.1",
61
62
  "@types/jest": "29.5.14",
62
- "@types/node": "22.13.10",
63
+ "@types/node": "22.13.11",
63
64
  "@types/node-cache": "4.2.5",
64
65
  "@types/supertest": "6.0.2",
65
66
  "@types/swagger-ui-express": "4.1.8",
@@ -26,9 +26,9 @@
26
26
  --------------
27
27
  ******/
28
28
 
29
-
30
29
  import { ILogger } from '@mojaloop/logging-bc-public-types-lib';
31
30
  import Express, { Application } from 'express';
31
+ import addFormats from 'ajv-formats';
32
32
  import OpenAPIBackend from 'openapi-backend';
33
33
  import type { Request } from 'openapi-backend';
34
34
  import swaggerUi from 'swagger-ui-express';
@@ -75,6 +75,7 @@ export const CreateExpressServer =
75
75
  // API routes based on the swagger file
76
76
  const api = new OpenAPIBackend({
77
77
  definition: openApiSpecFilePath,
78
+ customizeAjv: ajv => addFormats(ajv),
78
79
  handlers: {
79
80
  ...Handlers,
80
81
  validationFail: async (c, _req: Express.Request, res: Express.Response) =>
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter-outbound-domain-event-handler",
3
- "version": "0.3.0-snapshot.32",
3
+ "version": "0.3.0-snapshot.29",
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/",
@@ -41,10 +41,11 @@
41
41
  "snapshot": "standard-version --no-verify --skip.changelog --prerelease snapshot --releaseCommitMessageFormat 'chore(snapshot): {{currentTag}}'"
42
42
  },
43
43
  "dependencies": {
44
- "@mojaloop/api-snippets": "17.10.0",
44
+ "@mojaloop/api-snippets": "17.10.1",
45
45
  "@mojaloop/logging-bc-client-lib": "0.5.8",
46
46
  "@mojaloop/logging-bc-public-types-lib": "0.5.5",
47
47
  "@mojaloop/sdk-scheme-adapter-private-shared-lib": "workspace:^",
48
+ "ajv-formats": "3.0.1",
48
49
  "convict": "6.2.4",
49
50
  "express": "4.21.2",
50
51
  "openapi-backend": "5.11.1",
@@ -56,7 +57,7 @@
56
57
  "@types/convict": "6.1.6",
57
58
  "@types/express": "5.0.1",
58
59
  "@types/jest": "29.5.14",
59
- "@types/node": "22.13.10",
60
+ "@types/node": "22.13.11",
60
61
  "@types/node-cache": "4.2.5",
61
62
  "@types/supertest": "6.0.2",
62
63
  "@types/swagger-ui-express": "4.1.8",
@@ -28,6 +28,7 @@
28
28
  ******/
29
29
  import { ILogger } from '@mojaloop/logging-bc-public-types-lib';
30
30
  import Express, { Application } from 'express';
31
+ import addFormats from 'ajv-formats';
31
32
  import OpenAPIBackend from 'openapi-backend';
32
33
  import type { Request } from 'openapi-backend';
33
34
  import swaggerUi from 'swagger-ui-express';
@@ -74,6 +75,7 @@ export const CreateExpressServer =
74
75
  // API routes based on the swagger file
75
76
  const api = new OpenAPIBackend({
76
77
  definition: openApiSpecFilePath,
78
+ customizeAjv: ajv => addFormats(ajv),
77
79
  handlers: {
78
80
  ...Handlers,
79
81
  validationFail: async (c, _req: Express.Request, res: Express.Response) =>
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter-private-shared-lib",
3
- "version": "0.4.0-snapshot.32",
3
+ "version": "0.4.0-snapshot.29",
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",
@@ -29,7 +29,7 @@
29
29
  "snapshot": "standard-version --no-verify --skip.changelog --prerelease snapshot --releaseCommitMessageFormat 'chore(snapshot): {{currentTag}}'"
30
30
  },
31
31
  "dependencies": {
32
- "@mojaloop/api-snippets": "17.10.0",
32
+ "@mojaloop/api-snippets": "17.10.1",
33
33
  "@mojaloop/central-services-shared": "18.23.0",
34
34
  "@mojaloop/logging-bc-public-types-lib": "0.5.5",
35
35
  "@mojaloop/platform-shared-lib-messaging-types-lib": "0.7.1",
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "@eslint/compat": "1.2.7",
43
- "@types/node": "22.13.10",
43
+ "@types/node": "22.13.11",
44
44
  "@types/uuid": "10.0.0",
45
45
  "@typescript-eslint/eslint-plugin": "8.27.0",
46
46
  "@typescript-eslint/parser": "8.27.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter",
3
- "version": "24.5.0-snapshot.2",
3
+ "version": "24.6.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.10",
85
+ "@types/node": "22.13.11",
86
86
  "@types/node-cache": "4.2.5",
87
87
  "@typescript-eslint/eslint-plugin": "8.27.0",
88
88
  "@typescript-eslint/parser": "8.27.0",