@mojaloop/sdk-scheme-adapter 24.10.4 → 24.10.6-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/{@redis-bloom-npm-5.7.0-67cf00b3fc-65b7e59fd7.zip → @redis-bloom-npm-5.8.0-436cff1687-a4ab9add75.zip} +0 -0
- package/.yarn/cache/{@redis-client-npm-5.7.0-3c2124ad4d-d419b092b6.zip → @redis-client-npm-5.8.0-3bdc0e2d9d-7db93f3e6f.zip} +0 -0
- package/.yarn/cache/{@redis-json-npm-5.7.0-a3d55d5e1b-3db824b752.zip → @redis-json-npm-5.8.0-c6aea5063f-3347bfd1ec.zip} +0 -0
- package/.yarn/cache/{@redis-search-npm-5.7.0-50287b6a92-bfd745e5ae.zip → @redis-search-npm-5.8.0-cd8c59f8e9-055c9804f9.zip} +0 -0
- package/.yarn/cache/{@redis-time-series-npm-5.7.0-34a6d1bcea-0f972a32e4.zip → @redis-time-series-npm-5.8.0-a8eada922a-98a8123a5b.zip} +0 -0
- package/.yarn/cache/{@types-node-npm-24.1.0-b409136c60-02c3d91e14.zip → @types-node-npm-24.2.0-62c65eafa6-b81501e05f.zip} +0 -0
- package/.yarn/cache/{@typescript-eslint-eslint-plugin-npm-8.38.0-2ba76441bb-60a97f671d.zip → @typescript-eslint-eslint-plugin-npm-8.39.0-7cc58b0ab6-31f879990a.zip} +0 -0
- package/.yarn/cache/{@typescript-eslint-parser-npm-8.38.0-8f23c01a78-c39e56a281.zip → @typescript-eslint-parser-npm-8.39.0-c138f72ca9-9785994ff0.zip} +0 -0
- package/.yarn/cache/@typescript-eslint-project-service-npm-8.39.0-4cecf00a1b-990ae23308.zip +0 -0
- package/.yarn/cache/@typescript-eslint-scope-manager-npm-8.39.0-45f3f86773-c2b232a172.zip +0 -0
- package/.yarn/cache/@typescript-eslint-tsconfig-utils-npm-8.39.0-444fac8997-3457da49e7.zip +0 -0
- package/.yarn/cache/{@typescript-eslint-type-utils-npm-8.38.0-1030fb6e99-e28302119b.zip → @typescript-eslint-type-utils-npm-8.39.0-02f1fd51a1-3efe4001b6.zip} +0 -0
- package/.yarn/cache/@typescript-eslint-types-npm-8.39.0-c051b2516d-b08a42e8b5.zip +0 -0
- package/.yarn/cache/@typescript-eslint-typescript-estree-npm-8.39.0-73bf7427a0-7e9dc461fe.zip +0 -0
- package/.yarn/cache/@typescript-eslint-utils-npm-8.39.0-26129b3d3c-ed340f36fa.zip +0 -0
- package/.yarn/cache/@typescript-eslint-visitor-keys-npm-8.39.0-76eaf78702-2eb89b9e4d.zip +0 -0
- package/.yarn/cache/on-headers-npm-1.1.0-7d18779060-98aa64629f.zip +0 -0
- package/.yarn/cache/{redis-npm-5.7.0-622a7e4dff-1bf7910937.zip → redis-npm-5.8.0-e751103f9d-8a645185df.zip} +0 -0
- package/.yarn/cache/{ts-jest-npm-29.4.0-9f040f13a5-fe501f3d99.zip → ts-jest-npm-29.4.1-ab76d85d32-6aed48232c.zip} +0 -0
- package/.yarn/cache/typescript-npm-5.9.2-d00cd8b149-cc2fe6c822.zip +0 -0
- package/.yarn/cache/typescript-patch-bcfe2ebaf8-bd810ab13e.zip +0 -0
- package/.yarn/cache/{undici-types-npm-7.8.0-86f3e2d23e-fcff3fbab2.zip → undici-types-npm-7.10.0-cd8324b9eb-1f3fe77793.zip} +0 -0
- package/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +8 -0
- package/modules/api-svc/package.json +2 -2
- package/modules/api-svc/src/lib/cache.js +54 -0
- package/modules/api-svc/src/lib/model/OutboundTransfersModel.js +93 -118
- package/modules/api-svc/src/lib/model/common/TimeoutError.js +41 -0
- package/modules/api-svc/src/lib/model/common/index.js +2 -0
- package/modules/api-svc/test/unit/api/transfers/transfers.test.js +1 -1
- package/modules/outbound-command-event-handler/package.json +7 -7
- package/modules/outbound-domain-event-handler/package.json +7 -7
- package/modules/private-shared-lib/package.json +7 -7
- package/package.json +12 -6
- package/{sbom-v24.10.3.csv → sbom-v24.10.5.csv} +1002 -999
- package/.yarn/cache/brace-expansion-npm-1.1.11-fb95eb05ad-faf34a7bb0.zip +0 -0
- package/.yarn/cache/concat-map-npm-0.0.1-85a921b7ee-9680699c8e.zip +0 -0
- package/.yarn/cache/cookie-npm-0.6.0-362d6a2e45-c1f8f2ea7d.zip +0 -0
- package/.yarn/cache/cookie-npm-0.7.1-f01524ff99-aec6a6aa07.zip +0 -0
- package/.yarn/cache/express-npm-4.19.2-f81334a22a-3fcd792536.zip +0 -0
- package/.yarn/cache/finalhandler-npm-1.2.0-593d001463-635718cb20.zip +0 -0
- package/.yarn/cache/formidable-npm-2.1.2-40ba18d67f-d385180e04.zip +0 -0
- package/.yarn/cache/hexoid-npm-1.0.0-2274609209-f2271b8b6b.zip +0 -0
- package/.yarn/cache/merge-descriptors-npm-1.0.1-615287aaa8-5abc259d2a.zip +0 -0
- package/.yarn/cache/on-headers-npm-1.0.2-e7cd3ea25e-870766c163.zip +0 -0
- package/.yarn/cache/qs-npm-6.11.0-caf1bc9dea-5a3bfea3e2.zip +0 -0
- package/.yarn/cache/send-npm-0.18.0-faadf6353f-ec66c0ad10.zip +0 -0
- package/.yarn/cache/serve-static-npm-1.15.0-86c81879f5-699b2d4c29.zip +0 -0
- package/.yarn/cache/typescript-npm-5.8.3-fbd7aef456-65c40944c5.zip +0 -0
- package/.yarn/cache/typescript-patch-f64146f279-b9b1e73dab.zip +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
# Changelog: [mojaloop/sdk-scheme-adapter](https://github.com/mojaloop/sdk-scheme-adapter)
|
|
2
|
+
### [24.10.5](https://github.com/mojaloop/sdk-scheme-adapter/compare/v24.10.4...v24.10.5) (2025-08-01)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Chore
|
|
6
|
+
|
|
7
|
+
* fix vuls and update deps ([#599](https://github.com/mojaloop/sdk-scheme-adapter/issues/599)) ([f40131a](https://github.com/mojaloop/sdk-scheme-adapter/commit/f40131a9f65b888dce3cea5eb0149c1044e5a062))
|
|
8
|
+
* **sbom:** update sbom [skip ci] ([f42ef94](https://github.com/mojaloop/sdk-scheme-adapter/commit/f42ef94e6708d0fc8483d0da50c820a9838182e0))
|
|
9
|
+
|
|
2
10
|
### [24.10.4](https://github.com/mojaloop/sdk-scheme-adapter/compare/v24.10.3...v24.10.4) (2025-07-31)
|
|
3
11
|
|
|
4
12
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mojaloop/sdk-scheme-adapter-api-svc",
|
|
3
|
-
"version": "21.0.0-snapshot.
|
|
3
|
+
"version": "21.0.0-snapshot.50",
|
|
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",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"prom-client": "15.1.3",
|
|
97
97
|
"promise-timeout": "1.3.0",
|
|
98
98
|
"random-word-slugs": "0.1.7",
|
|
99
|
-
"redis": "5.
|
|
99
|
+
"redis": "5.8.0",
|
|
100
100
|
"uuidv4": "6.2.13",
|
|
101
101
|
"ws": "8.18.3"
|
|
102
102
|
},
|
|
@@ -27,6 +27,8 @@
|
|
|
27
27
|
'use strict';
|
|
28
28
|
|
|
29
29
|
const redis = require('redis');
|
|
30
|
+
const EventEmitter = require('events');
|
|
31
|
+
const { TimeoutError } = require('./model/common/TimeoutError');
|
|
30
32
|
|
|
31
33
|
const CONN_ST = {
|
|
32
34
|
CONNECTED: 'CONNECTED',
|
|
@@ -41,6 +43,7 @@ const CONN_ST = {
|
|
|
41
43
|
class Cache {
|
|
42
44
|
constructor(config) {
|
|
43
45
|
this._config = config;
|
|
46
|
+
this._channelEmitter = new EventEmitter();
|
|
44
47
|
|
|
45
48
|
if(!config.cacheUrl || !config.logger) {
|
|
46
49
|
throw new Error('Cache config requires cacheUrl and logger properties');
|
|
@@ -196,6 +199,57 @@ class Cache {
|
|
|
196
199
|
return id;
|
|
197
200
|
}
|
|
198
201
|
|
|
202
|
+
/**
|
|
203
|
+
* Subscribes to a channel for some period and always returns resolved promise
|
|
204
|
+
*
|
|
205
|
+
* @param {string} channel - The channel name to subscribe to
|
|
206
|
+
* @param {boolean} [needParse=true] - specify if the message should be parsed before returning
|
|
207
|
+
*
|
|
208
|
+
* @returns {Promise} - Promise that resolves with a message or an error
|
|
209
|
+
*/
|
|
210
|
+
async subscribeToOneMessageWithTimerNew(channel, requestProcessingTimeoutSeconds, needParse = true) {
|
|
211
|
+
let subscription;
|
|
212
|
+
|
|
213
|
+
return new Promise((resolve, reject) => {
|
|
214
|
+
|
|
215
|
+
const timer = setTimeout(async () => {
|
|
216
|
+
if (subscription) {
|
|
217
|
+
this._channelEmitter.removeListener(channel, subscription);
|
|
218
|
+
}
|
|
219
|
+
// If there are no listeners left for this channel, we can unsubscribe
|
|
220
|
+
if (this._channelEmitter.listenerCount(channel) === 0) {
|
|
221
|
+
if (this._subscriptionClient) {
|
|
222
|
+
await this._subscriptionClient.unsubscribe(channel);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
const errMessage = 'Timeout error';
|
|
226
|
+
this._logger.push({ channel }).warn(errMessage);
|
|
227
|
+
reject(new TimeoutError(errMessage));
|
|
228
|
+
}, requestProcessingTimeoutSeconds * 1000);
|
|
229
|
+
|
|
230
|
+
subscription = (message) => {
|
|
231
|
+
this._logger.push({ channel, message, needParse }).debug('subscribeToOneMessageWithTimer is done');
|
|
232
|
+
clearTimeout(timer);
|
|
233
|
+
resolve(needParse ? JSON.parse(message) : message);
|
|
234
|
+
};
|
|
235
|
+
this._channelEmitter.once(channel, subscription);
|
|
236
|
+
|
|
237
|
+
this._subscriptionClient.subscribe(channel, async (msg) => {
|
|
238
|
+
this._channelEmitter.emit(channel, msg);
|
|
239
|
+
// If there are no listeners left for this channel, we can unsubscribe
|
|
240
|
+
if (this._channelEmitter.listenerCount(channel) === 0) {
|
|
241
|
+
if (this._subscriptionClient) {
|
|
242
|
+
await this._subscriptionClient.unsubscribe(channel);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
})
|
|
246
|
+
.catch(err => {
|
|
247
|
+
this._logger.push({ channel, err }).warn(`error in subscribeToOneMessageWithTimer: ${err.message}`);
|
|
248
|
+
reject(err);
|
|
249
|
+
});
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
|
|
199
253
|
/**
|
|
200
254
|
* Subscribes to a channel for some period and always returns resolved promise
|
|
201
255
|
*
|
|
@@ -40,6 +40,7 @@ const PartiesModel = require('./PartiesModel');
|
|
|
40
40
|
const {
|
|
41
41
|
AmountTypes,
|
|
42
42
|
BackendError,
|
|
43
|
+
TimeoutError,
|
|
43
44
|
CacheKeyPrefixes,
|
|
44
45
|
Directions,
|
|
45
46
|
ErrorMessages,
|
|
@@ -321,147 +322,121 @@ class OutboundTransfersModel {
|
|
|
321
322
|
|
|
322
323
|
let latencyTimerDone;
|
|
323
324
|
|
|
324
|
-
//
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
}
|
|
330
|
-
this.metrics.partyLookupResponses.inc();
|
|
331
|
-
|
|
332
|
-
this.data.getPartiesResponse = JSON.parse(msg);
|
|
333
|
-
if (this.data.getPartiesResponse.body?.errorInformation) {
|
|
334
|
-
// this is an error response to our GET /parties request
|
|
335
|
-
const err = new BackendError(`Got an error response resolving party: ${safeStringify(this.data.getPartiesResponse.body, { depth: Infinity })}`, 500);
|
|
336
|
-
err.mojaloopError = this.data.getPartiesResponse.body;
|
|
337
|
-
// cancel the timeout handler
|
|
338
|
-
clearTimeout(timeout);
|
|
339
|
-
return reject(err);
|
|
340
|
-
}
|
|
341
|
-
let payee = this.data.getPartiesResponse.body;
|
|
342
|
-
|
|
343
|
-
if(!payee.party) {
|
|
344
|
-
// we should never get a non-error response without a party, but just in case...
|
|
345
|
-
// cancel the timeout handler
|
|
346
|
-
clearTimeout(timeout);
|
|
347
|
-
return reject(new Error(`Resolved payee has no party object: ${safeStringify(payee)}`));
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
payee = payee.party;
|
|
351
|
-
|
|
352
|
-
// cancel the timeout handler
|
|
353
|
-
clearTimeout(timeout);
|
|
354
|
-
|
|
355
|
-
this._logger.isVerboseEnabled && this._logger.push({ payee }).verbose('Payee resolved');
|
|
325
|
+
// now we have a timeout handler and a cache subscriber hooked up we can fire off
|
|
326
|
+
// a GET /parties request to the switch
|
|
327
|
+
try {
|
|
328
|
+
const channel = payeeKey;
|
|
329
|
+
const subscribing = this._cache.subscribeToOneMessageWithTimerNew(channel, this._requestProcessingTimeoutSeconds);
|
|
356
330
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
this.
|
|
361
|
-
|
|
362
|
-
|
|
331
|
+
latencyTimerDone = this.metrics.partyLookupLatency.startTimer();
|
|
332
|
+
const res = await this._requests.getParties(
|
|
333
|
+
this.data.to.idType,
|
|
334
|
+
this.data.to.idValue,
|
|
335
|
+
this.data.to.idSubValue,
|
|
336
|
+
this.data.to.fspId,
|
|
337
|
+
this.#createOtelHeaders()
|
|
338
|
+
);
|
|
363
339
|
|
|
364
|
-
|
|
365
|
-
if(payee.partyIdInfo.partyIdType !== this.data.to.idType) {
|
|
366
|
-
const err = new Error(`Expecting resolved payee party IdType to be ${this.data.to.idType} but got ${payee.partyIdInfo.partyIdType}`);
|
|
367
|
-
return reject(err);
|
|
368
|
-
}
|
|
340
|
+
this.data.getPartiesRequest = res.originalRequest;
|
|
369
341
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
return reject(err);
|
|
373
|
-
}
|
|
342
|
+
this.metrics.partyLookupRequests.inc();
|
|
343
|
+
this._logger.isDebugEnabled && this._logger.push({ peer: res }).debug('Party lookup sent to peer');
|
|
374
344
|
|
|
375
|
-
|
|
376
|
-
const err = new Error(`Expecting resolved payee party subTypeId to be ${this.data.to.idSubValue} but got ${payee.partyIdInfo.partySubIdOrType}`);
|
|
377
|
-
return reject(err);
|
|
378
|
-
}
|
|
345
|
+
const message = await subscribing;
|
|
379
346
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
347
|
+
if(latencyTimerDone) {
|
|
348
|
+
latencyTimerDone();
|
|
349
|
+
}
|
|
350
|
+
this.metrics.partyLookupResponses.inc();
|
|
384
351
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
this
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
this.data.to.firstName = payee.personalInfo.complexName.firstName || this.data.to.firstName;
|
|
394
|
-
this.data.to.middleName = payee.personalInfo.complexName.middleName || this.data.to.middleName;
|
|
395
|
-
this.data.to.lastName = payee.personalInfo.complexName.lastName || this.data.to.lastName;
|
|
396
|
-
}
|
|
397
|
-
this.data.to.dateOfBirth = payee.personalInfo.dateOfBirth;
|
|
398
|
-
}
|
|
352
|
+
this.data.getPartiesResponse = message;
|
|
353
|
+
if (this.data.getPartiesResponse.body?.errorInformation) {
|
|
354
|
+
// this is an error response to our GET /parties request
|
|
355
|
+
const err = new BackendError(`Got an error response resolving party: ${safeStringify(this.data.getPartiesResponse.body, { depth: Infinity })}`, 500);
|
|
356
|
+
err.mojaloopError = this.data.getPartiesResponse.body;
|
|
357
|
+
return reject(err);
|
|
358
|
+
}
|
|
359
|
+
let payee = this.data.getPartiesResponse.body;
|
|
399
360
|
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
361
|
+
if(!payee.party) {
|
|
362
|
+
// we should never get a non-error response without a party, but just in case...
|
|
363
|
+
return reject(new Error(`Resolved payee has no party object: ${safeStringify(payee)}`));
|
|
364
|
+
}
|
|
404
365
|
|
|
405
|
-
|
|
406
|
-
this.data.supportedCurrencies = payee.supportedCurrencies;
|
|
407
|
-
}
|
|
366
|
+
payee = payee.party;
|
|
408
367
|
|
|
409
|
-
|
|
410
|
-
transferId: this.data.transferId,
|
|
411
|
-
homeTransactionId: this.data.homeTransactionId,
|
|
412
|
-
needFx: this.data.needFx,
|
|
413
|
-
}).verbose('Payee validation passed');
|
|
368
|
+
this._logger.isVerboseEnabled && this._logger.push({ payee }).verbose('Payee resolved');
|
|
414
369
|
|
|
415
|
-
|
|
370
|
+
// check we got the right payee and info we need
|
|
371
|
+
if(payee.partyIdInfo.partyIdType !== this.data.to.idType) {
|
|
372
|
+
const err = new Error(`Expecting resolved payee party IdType to be ${this.data.to.idType} but got ${payee.partyIdInfo.partyIdType}`);
|
|
373
|
+
return reject(err);
|
|
416
374
|
}
|
|
417
|
-
|
|
375
|
+
|
|
376
|
+
if(payee.partyIdInfo.partyIdentifier !== this.data.to.idValue) {
|
|
377
|
+
const err = new Error(`Expecting resolved payee party identifier to be ${this.data.to.idValue} but got ${payee.partyIdInfo.partyIdentifier}`);
|
|
418
378
|
return reject(err);
|
|
419
379
|
}
|
|
420
|
-
});
|
|
421
380
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
381
|
+
if(payee.partyIdInfo.partySubIdOrType !== this.data.to.idSubValue) {
|
|
382
|
+
const err = new Error(`Expecting resolved payee party subTypeId to be ${this.data.to.idSubValue} but got ${payee.partyIdInfo.partySubIdOrType}`);
|
|
383
|
+
return reject(err);
|
|
384
|
+
}
|
|
425
385
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
}
|
|
386
|
+
if(!payee.partyIdInfo.fspId) {
|
|
387
|
+
const err = new Error(`Expecting resolved payee party to have an FSPID: ${safeStringify(payee.partyIdInfo)}`);
|
|
388
|
+
return reject(err);
|
|
389
|
+
}
|
|
430
390
|
|
|
431
|
-
|
|
432
|
-
|
|
391
|
+
// now we got the payee, add the details to our data so we can use it
|
|
392
|
+
// in the quote request
|
|
393
|
+
this.data.to.fspId = payee.partyIdInfo.fspId;
|
|
394
|
+
if(payee.partyIdInfo.extensionList) {
|
|
395
|
+
this.data.to.extensionList = payee.partyIdInfo.extensionList.extension;
|
|
396
|
+
}
|
|
397
|
+
if(payee.personalInfo) {
|
|
398
|
+
if(payee.personalInfo.complexName) {
|
|
399
|
+
this.data.to.firstName = payee.personalInfo.complexName.firstName || this.data.to.firstName;
|
|
400
|
+
this.data.to.middleName = payee.personalInfo.complexName.middleName || this.data.to.middleName;
|
|
401
|
+
this.data.to.lastName = payee.personalInfo.complexName.lastName || this.data.to.lastName;
|
|
402
|
+
}
|
|
403
|
+
this.data.to.dateOfBirth = payee.personalInfo.dateOfBirth;
|
|
433
404
|
}
|
|
434
405
|
|
|
435
|
-
|
|
436
|
-
|
|
406
|
+
if (Array.isArray(payee.supportedCurrencies)) {
|
|
407
|
+
if (!payee.supportedCurrencies.length) {
|
|
408
|
+
throw new Error(ErrorMessages.noSupportedCurrencies);
|
|
409
|
+
}
|
|
437
410
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
latencyTimerDone = this.metrics.partyLookupLatency.startTimer();
|
|
442
|
-
const res = await this._requests.getParties(
|
|
443
|
-
this.data.to.idType,
|
|
444
|
-
this.data.to.idValue,
|
|
445
|
-
this.data.to.idSubValue,
|
|
446
|
-
this.data.to.fspId,
|
|
447
|
-
this.#createOtelHeaders()
|
|
448
|
-
);
|
|
411
|
+
this.data.needFx = this._isFxNeeded(this._supportedCurrencies, payee.supportedCurrencies, this.data.currency, this.data.amountType);
|
|
412
|
+
this.data.supportedCurrencies = payee.supportedCurrencies;
|
|
413
|
+
}
|
|
449
414
|
|
|
450
|
-
this.
|
|
415
|
+
this._logger.isVerboseEnabled && this._logger.push({
|
|
416
|
+
transferId: this.data.transferId,
|
|
417
|
+
homeTransactionId: this.data.homeTransactionId,
|
|
418
|
+
needFx: this.data.needFx,
|
|
419
|
+
}).verbose('Payee validation passed');
|
|
451
420
|
|
|
452
|
-
|
|
453
|
-
this._logger.isDebugEnabled && this._logger.push({ peer: res }).debug('Party lookup sent to peer');
|
|
421
|
+
return resolve(payee);
|
|
454
422
|
}
|
|
455
423
|
catch(err) {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
424
|
+
this._logger.isErrorEnabled && this._logger.error(`Error in resolvePayee ${payeeKey}: ${err.stack || safeStringify(err)}`);
|
|
425
|
+
// If type of error is BackendError, it will be handled by the state machine
|
|
426
|
+
if (err instanceof BackendError) {
|
|
427
|
+
this.data.lastError = err;
|
|
428
|
+
return reject(err);
|
|
429
|
+
}
|
|
430
|
+
// Check if the error is a TimeoutError, and if so, reject with a BackendError
|
|
431
|
+
if (err instanceof TimeoutError) {
|
|
432
|
+
const error = new BackendError(`Timeout resolving payee for transfer ${this.data.transferId}`, 504);
|
|
433
|
+
this.data.lastError = error;
|
|
434
|
+
return reject(error);
|
|
435
|
+
}
|
|
436
|
+
// otherwise, just throw a generic error
|
|
437
|
+
const error = new BackendError(`Error resolving payee for transfer ${this.data.transferId}: ${err.message}`, 500);
|
|
438
|
+
this.data.lastError = error;
|
|
439
|
+
return reject(error);
|
|
465
440
|
}
|
|
466
441
|
});
|
|
467
442
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
- Name Surname <name.surname@mojaloop.io>
|
|
24
|
+
|
|
25
|
+
* Infitx
|
|
26
|
+
- Vijay Kumar Guthi - <vijaya.guthi@infitx.com>
|
|
27
|
+
--------------
|
|
28
|
+
******/
|
|
29
|
+
'use strict';
|
|
30
|
+
|
|
31
|
+
class TimeoutError extends Error {
|
|
32
|
+
constructor(msg) {
|
|
33
|
+
super(msg);
|
|
34
|
+
this.name = 'TimeoutError';
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
module.exports = {
|
|
40
|
+
TimeoutError
|
|
41
|
+
};
|
|
@@ -28,10 +28,12 @@
|
|
|
28
28
|
******/
|
|
29
29
|
const Enums = require('./Enums');
|
|
30
30
|
const { BackendError } = require('./BackendError');
|
|
31
|
+
const { TimeoutError } = require('./TimeoutError');
|
|
31
32
|
const PersistentStateMachine = require('./PersistentStateMachine');
|
|
32
33
|
|
|
33
34
|
module.exports = {
|
|
34
35
|
...Enums,
|
|
35
36
|
BackendError,
|
|
37
|
+
TimeoutError,
|
|
36
38
|
PersistentStateMachine
|
|
37
39
|
};
|
|
@@ -147,7 +147,7 @@ describe('Outbound Transfers API', () => {
|
|
|
147
147
|
parties: {
|
|
148
148
|
put: () => new Promise(
|
|
149
149
|
resolve => setTimeout(() => resolve(putPartiesBody),
|
|
150
|
-
|
|
150
|
+
3000)),
|
|
151
151
|
},
|
|
152
152
|
};
|
|
153
153
|
return testPostTransfers(putBodyFn, 504, postTransfersErrorTimeoutResponse);
|
|
@@ -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.47",
|
|
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,7 +51,7 @@
|
|
|
51
51
|
"convict": "6.2.4",
|
|
52
52
|
"express": "4.21.2",
|
|
53
53
|
"openapi-backend": "5.13.0",
|
|
54
|
-
"redis": "5.
|
|
54
|
+
"redis": "5.8.0",
|
|
55
55
|
"swagger-ui-express": "5.0.1",
|
|
56
56
|
"yamljs": "0.3.0"
|
|
57
57
|
},
|
|
@@ -60,13 +60,13 @@
|
|
|
60
60
|
"@types/convict": "6.1.6",
|
|
61
61
|
"@types/express": "5.0.3",
|
|
62
62
|
"@types/jest": "30.0.0",
|
|
63
|
-
"@types/node": "24.
|
|
63
|
+
"@types/node": "24.2.0",
|
|
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.
|
|
69
|
-
"@typescript-eslint/parser": "8.
|
|
68
|
+
"@typescript-eslint/eslint-plugin": "8.39.0",
|
|
69
|
+
"@typescript-eslint/parser": "8.39.0",
|
|
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.4.
|
|
77
|
+
"ts-jest": "29.4.1",
|
|
78
78
|
"ts-node": "10.9.2",
|
|
79
|
-
"typescript": "5.
|
|
79
|
+
"typescript": "5.9.2"
|
|
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.
|
|
3
|
+
"version": "0.3.0-snapshot.47",
|
|
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,7 +49,7 @@
|
|
|
49
49
|
"convict": "6.2.4",
|
|
50
50
|
"express": "4.21.2",
|
|
51
51
|
"openapi-backend": "5.13.0",
|
|
52
|
-
"redis": "5.
|
|
52
|
+
"redis": "5.8.0",
|
|
53
53
|
"swagger-ui-express": "5.0.1",
|
|
54
54
|
"yamljs": "0.3.0"
|
|
55
55
|
},
|
|
@@ -57,13 +57,13 @@
|
|
|
57
57
|
"@types/convict": "6.1.6",
|
|
58
58
|
"@types/express": "5.0.3",
|
|
59
59
|
"@types/jest": "30.0.0",
|
|
60
|
-
"@types/node": "24.
|
|
60
|
+
"@types/node": "24.2.0",
|
|
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.
|
|
66
|
-
"@typescript-eslint/parser": "8.
|
|
65
|
+
"@typescript-eslint/eslint-plugin": "8.39.0",
|
|
66
|
+
"@typescript-eslint/parser": "8.39.0",
|
|
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.4.
|
|
74
|
+
"ts-jest": "29.4.1",
|
|
75
75
|
"ts-node": "10.9.2",
|
|
76
|
-
"typescript": "5.
|
|
76
|
+
"typescript": "5.9.2"
|
|
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.
|
|
3
|
+
"version": "0.4.0-snapshot.47",
|
|
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,23 +35,23 @@
|
|
|
35
35
|
"@mojaloop/platform-shared-lib-messaging-types-lib": "0.7.3",
|
|
36
36
|
"@mojaloop/platform-shared-lib-nodejs-kafka-client-lib": "0.5.18",
|
|
37
37
|
"ajv": "8.17.1",
|
|
38
|
-
"redis": "5.
|
|
38
|
+
"redis": "5.8.0",
|
|
39
39
|
"uuid": "11.1.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@eslint/compat": "1.3.1",
|
|
43
|
-
"@types/node": "24.
|
|
43
|
+
"@types/node": "24.2.0",
|
|
44
44
|
"@types/uuid": "10.0.0",
|
|
45
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
46
|
-
"@typescript-eslint/parser": "8.
|
|
45
|
+
"@typescript-eslint/eslint-plugin": "8.39.0",
|
|
46
|
+
"@typescript-eslint/parser": "8.39.0",
|
|
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.4.
|
|
52
|
+
"ts-jest": "29.4.1",
|
|
53
53
|
"tslib": "2.8.1",
|
|
54
|
-
"typescript": "5.
|
|
54
|
+
"typescript": "5.9.2"
|
|
55
55
|
},
|
|
56
56
|
"standard-version": {
|
|
57
57
|
"scripts": {
|