@mojaloop/sdk-scheme-adapter 24.10.0 → 24.10.1

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 (26) hide show
  1. package/.yarn/cache/@redis-bloom-npm-5.5.6-4d657f1bec-72cef8eef4.zip +0 -0
  2. package/.yarn/cache/@redis-client-npm-5.5.6-94287e1111-dbf486100a.zip +0 -0
  3. package/.yarn/cache/@redis-json-npm-5.5.6-6730f82510-804cec9bb4.zip +0 -0
  4. package/.yarn/cache/@redis-search-npm-5.5.6-f14acc1d78-efe82ab0a6.zip +0 -0
  5. package/.yarn/cache/@redis-time-series-npm-5.5.6-bba24eca4c-0db2337daf.zip +0 -0
  6. package/.yarn/cache/@types-express-npm-5.0.3-78da63908b-bb6f10c14c.zip +0 -0
  7. package/.yarn/cache/{@types-node-npm-22.15.29-b40796f35f-201aabe361.zip → @types-node-npm-22.15.30-04ae714c4d-c380ad1765.zip} +0 -0
  8. package/.yarn/cache/{eslint-plugin-jest-npm-28.12.0-a05d8a1874-8d0bcb2133.zip → eslint-plugin-jest-npm-28.13.0-f1bc2edf00-1be5c0fcc4.zip} +0 -0
  9. package/.yarn/cache/redis-npm-5.5.6-882f3de1bd-1d383caedf.zip +0 -0
  10. package/.yarn/install-state.gz +0 -0
  11. package/CHANGELOG.md +7 -0
  12. package/modules/api-svc/package.json +4 -3
  13. package/modules/api-svc/src/InboundServer/index.js +0 -11
  14. package/modules/api-svc/src/index.js +66 -6
  15. package/modules/api-svc/test/unit/InboundServer.test.js +0 -54
  16. package/modules/outbound-command-event-handler/package.json +4 -4
  17. package/modules/outbound-domain-event-handler/package.json +4 -4
  18. package/modules/private-shared-lib/package.json +3 -3
  19. package/package.json +2 -2
  20. package/.yarn/cache/@redis-bloom-npm-5.5.5-08ba788570-bde4c98288.zip +0 -0
  21. package/.yarn/cache/@redis-client-npm-5.5.5-de45fa1462-638e7e85fb.zip +0 -0
  22. package/.yarn/cache/@redis-json-npm-5.5.5-6caae5d1e6-26c0deb195.zip +0 -0
  23. package/.yarn/cache/@redis-search-npm-5.5.5-be3d1b0301-6b269f544a.zip +0 -0
  24. package/.yarn/cache/@redis-time-series-npm-5.5.5-3a80ea3c7f-5d5d7cc857.zip +0 -0
  25. package/.yarn/cache/@types-express-npm-5.0.2-da02de3116-c6f73c75c2.zip +0 -0
  26. package/.yarn/cache/redis-npm-5.5.5-e30d8c3be4-fa4864e201.zip +0 -0
Binary file
package/CHANGELOG.md CHANGED
@@ -1,4 +1,11 @@
1
1
  # Changelog: [mojaloop/sdk-scheme-adapter](https://github.com/mojaloop/sdk-scheme-adapter)
2
+ ### [24.10.1](https://github.com/mojaloop/sdk-scheme-adapter/compare/v24.10.0...v24.10.1) (2025-06-09)
3
+
4
+
5
+ ### Chore
6
+
7
+ * **csi-1494:** more restarting logic ([#587](https://github.com/mojaloop/sdk-scheme-adapter/issues/587)) ([fcaa375](https://github.com/mojaloop/sdk-scheme-adapter/commit/fcaa3753ccb974669f1814d2cd7ca031305b8e8f))
8
+
2
9
  ## [24.10.0](https://github.com/mojaloop/sdk-scheme-adapter/compare/v24.9.7...v24.10.0) (2025-06-05)
3
10
 
4
11
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter-api-svc",
3
- "version": "21.0.0-snapshot.37",
3
+ "version": "21.0.0-snapshot.49",
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",
@@ -86,6 +86,7 @@
86
86
  "javascript-state-machine": "3.1.0",
87
87
  "js-yaml": "4.1.0",
88
88
  "json-schema-ref-parser": "9.0.9",
89
+ "knex": "3.1.0",
89
90
  "koa": "3.0.0",
90
91
  "koa-body": "6.0.1",
91
92
  "lodash": "4.17.21",
@@ -95,7 +96,7 @@
95
96
  "prom-client": "15.1.3",
96
97
  "promise-timeout": "1.3.0",
97
98
  "random-word-slugs": "0.1.7",
98
- "redis": "5.5.5",
99
+ "redis": "5.5.6",
99
100
  "uuidv4": "6.2.13",
100
101
  "ws": "8.18.2"
101
102
  },
@@ -109,7 +110,7 @@
109
110
  "eslint": "9.15.0",
110
111
  "eslint-config-airbnb-base": "15.0.0",
111
112
  "eslint-plugin-import": "2.31.0",
112
- "eslint-plugin-jest": "28.12.0",
113
+ "eslint-plugin-jest": "28.13.0",
113
114
  "jest": "29.7.0",
114
115
  "jest-junit": "16.0.0",
115
116
  "npm-check-updates": "16.7.10",
@@ -26,7 +26,6 @@
26
26
  ******/
27
27
  const Koa = require('koa');
28
28
 
29
- const _ = require('lodash');
30
29
  const assert = require('assert').strict;
31
30
  const https = require('https');
32
31
  const http = require('http');
@@ -87,16 +86,6 @@ class InboundApi extends EventEmitter {
87
86
  return this._api.callback();
88
87
  }
89
88
 
90
- _updatePeerJwsKeys(peerJwsKeys) {
91
- if (this._conf.pm4mlEnabled && !_.isEqual(this._jwsVerificationKeys, peerJwsKeys) &&
92
- this._jwsVerificationKeys && typeof this._jwsVerificationKeys === 'object') {
93
- this._logger && this._logger.isVerboseEnabled && this._logger.verbose('Clearing existing JWS verification keys');
94
- Object.keys(this._jwsVerificationKeys).forEach(key => delete this._jwsVerificationKeys[key]);
95
- this._logger && this._logger.isVerboseEnabled && this._logger.verbose('Assigning new peer JWS keys');
96
- Object.assign(this._jwsVerificationKeys, peerJwsKeys);
97
- }
98
- }
99
-
100
89
  _startJwsWatcher() {
101
90
  const FS_EVENT_TYPES = {
102
91
  CHANGE: 'change',
@@ -140,8 +140,60 @@ class Server extends EventEmitter {
140
140
  }
141
141
 
142
142
  _shouldUpdateInboundServer(newConf) {
143
- return !_.isEqual(this.conf.inbound, newConf.inbound)
144
- || !_.isEqual(this.conf.outbound, newConf.outbound);
143
+ const isInboundDifferent = !_.isEqual(this.conf.inbound, newConf.inbound);
144
+ const isOutboundDifferent = !_.isEqual(this.conf.outbound, newConf.outbound);
145
+ const isPeerJWSKeysDifferent = !_.isEqual(this.conf.peerJWSKeys, newConf.peerJWSKeys);
146
+ const isJwsSigningKeyDifferent = !_.isEqual(this.conf.jwsSigningKey, newConf.jwsSigningKey);
147
+
148
+ if (isInboundDifferent) {
149
+ this.logger.debug('Inbound config is different', {
150
+ oldInbound: this.conf.inbound,
151
+ newInbound: newConf.inbound
152
+ });
153
+ }
154
+ if (isOutboundDifferent) {
155
+ this.logger.debug('Outbound config is different (checked in inbound update)', {
156
+ oldOutbound: this.conf.outbound,
157
+ newOutbound: newConf.outbound
158
+ });
159
+ }
160
+
161
+ if (isPeerJWSKeysDifferent) {
162
+ this.logger.debug('Peer JWS Keys config is different', {
163
+ oldPeerJWSKeys: this.conf.peerJWSKeys,
164
+ newPeerJWSKeys: newConf.peerJWSKeys
165
+ });
166
+ }
167
+
168
+ if (isJwsSigningKeyDifferent) {
169
+ this.logger.debug('JWS Signing Key config is different', {
170
+ oldJwsSigningKey: this.conf.jwsSigningKey,
171
+ newJwsSigningKey: newConf.jwsSigningKey
172
+ });
173
+ }
174
+
175
+ return isInboundDifferent || isOutboundDifferent || isPeerJWSKeysDifferent || isJwsSigningKeyDifferent;
176
+ }
177
+
178
+ _shouldUpdateOutboundServer(newConf) {
179
+ const isOutboundDifferent = !_.isEqual(this.conf.outbound, newConf.outbound);
180
+ const isJwsSigningKeyDifferent = !_.isEqual(this.conf.jwsSigningKey, newConf.jwsSigningKey);
181
+
182
+ if (isOutboundDifferent) {
183
+ this.logger.debug('Outbound config is different', {
184
+ oldOutbound: this.conf.outbound,
185
+ newOutbound: newConf.outbound
186
+ });
187
+ }
188
+
189
+ if (isJwsSigningKeyDifferent) {
190
+ this.logger.debug('JWS Signing Key config is different', {
191
+ oldJwsSigningKey: this.conf.jwsSigningKey,
192
+ newJwsSigningKey: newConf.jwsSigningKey
193
+ });
194
+ }
195
+
196
+ return isOutboundDifferent || isJwsSigningKeyDifferent;
145
197
  }
146
198
 
147
199
  async start() {
@@ -229,8 +281,11 @@ class Server extends EventEmitter {
229
281
  }
230
282
 
231
283
  this.logger.isDebugEnabled && this.logger.push({ oldConf: this.conf.inbound, newConf: newConf.inbound }).debug('Inbound server configuration');
232
- const updateInboundServer = this._shouldUpdateInboundServer(this.conf, newConf);
284
+ const updateInboundServer = this._shouldUpdateInboundServer(newConf);
233
285
  if (updateInboundServer) {
286
+ const stopStartLabel = 'InboundServer stop/start duration';
287
+ // eslint-disable-next-line no-console
288
+ console.time(stopStartLabel);
234
289
  await this.inboundServer.stop();
235
290
  this.inboundServer = new InboundServer(
236
291
  newConf,
@@ -244,14 +299,17 @@ class Server extends EventEmitter {
244
299
  this.emit('error', errMessage);
245
300
  });
246
301
  await this.inboundServer.start();
302
+ // eslint-disable-next-line no-console
303
+ console.timeEnd(stopStartLabel);
247
304
  restartActionsTaken.updateInboundServer = true;
248
305
  }
249
306
 
250
- this.inboundServer._api._updatePeerJwsKeys(newConf.peerJWSKeys);
251
-
252
307
  this.logger.isDebugEnabled && this.logger.push({ oldConf: this.conf.outbound, newConf: newConf.outbound }).debug('Outbound server configuration');
253
- const updateOutboundServer = !_.isEqual(this.conf.outbound, newConf.outbound);
308
+ const updateOutboundServer = this._shouldUpdateOutboundServer(newConf);
254
309
  if (updateOutboundServer) {
310
+ const stopStartLabel = 'OutboundServer stop/start duration';
311
+ // eslint-disable-next-line no-console
312
+ console.time(stopStartLabel);
255
313
  await this.outboundServer.stop();
256
314
  this.outboundServer = new OutboundServer(
257
315
  newConf,
@@ -266,6 +324,8 @@ class Server extends EventEmitter {
266
324
  this.emit('error', errMessage);
267
325
  });
268
326
  await this.outboundServer.start();
327
+ // eslint-disable-next-line no-console
328
+ console.timeEnd(stopStartLabel);
269
329
  restartActionsTaken.updateOutboundServer = true;
270
330
  }
271
331
 
@@ -490,59 +490,5 @@ describe('Inbound Server', () => {
490
490
 
491
491
  expect(Jws.validator.__validationKeys['mock-jws'].toString()).toEqual('foo-key-updated');
492
492
  });
493
-
494
- it('should overwrite an existing peer JWS key when _updatePeerJwsKeys is called with the same key name', async () => {
495
- // Arrange
496
- const serverConfig = JSON.parse(JSON.stringify(defaultConfig));
497
- serverConfig.validateInboundJws = true;
498
- const cache = new Cache({
499
- cacheUrl: serverConfig.cacheUrl,
500
- logger: logger.push({ component: 'cache' }),
501
- unsubscribeTimeoutMs: serverConfig.unsubscribeTimeoutMs,
502
- });
503
- serverConfig.validateInboundJws = true;
504
- serverConfig.pm4mlEnabled = true;
505
- serverConfig.peerJWSKeys = {
506
- 'peer1': 'original-key'
507
- };
508
- const svr = new InboundServer(serverConfig, logger, cache);
509
-
510
- // Save reference before update
511
- const keysRef = svr._api._jwsVerificationKeys;
512
-
513
- // Act: Overwrite the key
514
- svr._api._updatePeerJwsKeys({ 'peer1': 'new-key' });
515
-
516
- // Assert
517
- expect(svr._api._jwsVerificationKeys['peer1']).toBe('new-key');
518
- expect(svr._api._jwsVerificationKeys).toBe(keysRef); // memory reference unchanged
519
- });
520
-
521
- it('should add a new peer JWS key when _updatePeerJwsKeys is called with a new key name', async () => {
522
- // Arrange
523
- const serverConfig = JSON.parse(JSON.stringify(defaultConfig));
524
- serverConfig.validateInboundJws = true;
525
- const cache = new Cache({
526
- cacheUrl: serverConfig.cacheUrl,
527
- logger: logger.push({ component: 'cache' }),
528
- unsubscribeTimeoutMs: serverConfig.unsubscribeTimeoutMs,
529
- });
530
- serverConfig.validateInboundJws = true;
531
- serverConfig.pm4mlEnabled = true;
532
- serverConfig.peerJWSKeys = {
533
- 'peer1': 'original-key'
534
- };
535
- const svr = new InboundServer(serverConfig, logger, cache);
536
-
537
- // Save reference before update
538
- const keysRef = svr._api._jwsVerificationKeys;
539
-
540
- // Act: Add a new key
541
- svr._api._updatePeerJwsKeys({ 'peer1': 'original-key', 'peer2': 'another-key' });
542
- // Assert
543
- expect(svr._api._jwsVerificationKeys['peer1']).toBe('original-key');
544
- expect(svr._api._jwsVerificationKeys['peer2']).toBe('another-key');
545
- expect(svr._api._jwsVerificationKeys).toBe(keysRef); // memory reference unchanged
546
- });
547
493
  });
548
494
  });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter-outbound-command-event-handler",
3
- "version": "0.3.0-snapshot.34",
3
+ "version": "0.3.0-snapshot.46",
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/",
@@ -51,16 +51,16 @@
51
51
  "convict": "6.2.4",
52
52
  "express": "4.21.2",
53
53
  "openapi-backend": "5.12.0",
54
- "redis": "5.5.5",
54
+ "redis": "5.5.6",
55
55
  "swagger-ui-express": "5.0.1",
56
56
  "yamljs": "0.3.0"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@eslint/compat": "1.2.9",
60
60
  "@types/convict": "6.1.6",
61
- "@types/express": "5.0.2",
61
+ "@types/express": "5.0.3",
62
62
  "@types/jest": "29.5.14",
63
- "@types/node": "22.15.29",
63
+ "@types/node": "22.15.30",
64
64
  "@types/node-cache": "4.2.5",
65
65
  "@types/supertest": "6.0.3",
66
66
  "@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.34",
3
+ "version": "0.3.0-snapshot.46",
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/",
@@ -49,15 +49,15 @@
49
49
  "convict": "6.2.4",
50
50
  "express": "4.21.2",
51
51
  "openapi-backend": "5.12.0",
52
- "redis": "5.5.5",
52
+ "redis": "5.5.6",
53
53
  "swagger-ui-express": "5.0.1",
54
54
  "yamljs": "0.3.0"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@types/convict": "6.1.6",
58
- "@types/express": "5.0.2",
58
+ "@types/express": "5.0.3",
59
59
  "@types/jest": "29.5.14",
60
- "@types/node": "22.15.29",
60
+ "@types/node": "22.15.30",
61
61
  "@types/node-cache": "4.2.5",
62
62
  "@types/supertest": "6.0.3",
63
63
  "@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.34",
3
+ "version": "0.4.0-snapshot.46",
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",
@@ -35,12 +35,12 @@
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",
37
37
  "ajv": "8.17.1",
38
- "redis": "5.5.5",
38
+ "redis": "5.5.6",
39
39
  "uuid": "11.1.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@eslint/compat": "1.2.9",
43
- "@types/node": "22.15.29",
43
+ "@types/node": "22.15.30",
44
44
  "@types/uuid": "10.0.0",
45
45
  "@typescript-eslint/eslint-plugin": "8.33.1",
46
46
  "@typescript-eslint/parser": "8.33.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter",
3
- "version": "24.10.0",
3
+ "version": "24.10.1",
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.15.29",
85
+ "@types/node": "22.15.30",
86
86
  "@types/node-cache": "4.2.5",
87
87
  "@typescript-eslint/eslint-plugin": "8.33.1",
88
88
  "@typescript-eslint/parser": "8.33.1",