@mojaloop/sdk-scheme-adapter 24.11.0-snapshot.2 → 24.11.0-snapshot.5

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter-api-svc",
3
- "version": "21.0.0-snapshot.60",
3
+ "version": "21.0.0-snapshot.63",
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",
@@ -66,9 +66,9 @@
66
66
  "@koa/cors": "5.0.0",
67
67
  "@mojaloop/api-snippets": "18.1.1",
68
68
  "@mojaloop/central-services-error-handling": "13.1.2",
69
- "@mojaloop/central-services-logger": "11.9.3",
69
+ "@mojaloop/central-services-logger": "11.10.0",
70
70
  "@mojaloop/central-services-metrics": "12.7.1",
71
- "@mojaloop/central-services-shared": "18.33.0",
71
+ "@mojaloop/central-services-shared": "18.33.2",
72
72
  "@mojaloop/event-sdk": "14.7.0",
73
73
  "@mojaloop/logging-bc-client-lib": "0.5.8",
74
74
  "@mojaloop/ml-schema-transformer-lib": "2.7.8",
@@ -530,6 +530,7 @@ class InboundTransfersModel {
530
530
  // Mark as notified to prevent duplicate notification
531
531
  await this._cache.set(cacheKey, true, 60);
532
532
  // Send notification to payee
533
+ this._logger.isInfoEnabled && this._logger.push({ transferId }).info('Received transfer callback for GET /transfers/{ID} request, sending notification to payee');
533
534
  await this.sendNotificationToPayee(message.data.body, transferId);
534
535
  break;
535
536
  }
@@ -1042,8 +1043,8 @@ class InboundTransfersModel {
1042
1043
  log.verbose('sendFxPutNotificationToBackend body sent to cc: ', { responseBody });
1043
1044
 
1044
1045
  const { enabled, maxRetries, retryDelayMs, maxRetryDelayMs, backoffFactor } = this._backendRequestRetry || {};
1045
- let res;
1046
1046
  const shouldRetry = enabled !== false; // default to true if not set
1047
+ let res;
1047
1048
 
1048
1049
  if (shouldRetry) {
1049
1050
  const operation = retry.operation({
@@ -1056,30 +1057,28 @@ class InboundTransfersModel {
1056
1057
  await new Promise((resolve) => {
1057
1058
  operation.attempt(async (currentAttempt) => {
1058
1059
  try {
1060
+ log.verbose(`putFxTransfersNotification attempt ${currentAttempt} for conversionId ${conversionId}`);
1059
1061
  res = await this._backendRequests.putFxTransfersNotification(responseBody, conversionId);
1060
- if (res) {
1061
- return resolve();
1062
- }
1063
- log.warn(`putFxTransfersNotification attempt ${currentAttempt} got no response, retrying...`);
1064
- if (!operation.retry(new Error('No response'))) {
1065
- resolve();
1066
- }
1062
+ // Consider success as long as it doesn't throw
1063
+ // `sendRequest` only seems to return `data` of the request which could
1064
+ // be empty for a 200 response
1065
+ log.verbose(`putFxTransfersNotification attempt ${currentAttempt} succeeded for conversionId ${conversionId}`);
1066
+ resolve();
1067
1067
  } catch (err) {
1068
1068
  log.warn(`putFxTransfersNotification attempt ${currentAttempt} threw error, retrying...`, err);
1069
1069
  if (!operation.retry(err)) {
1070
+ log.verbose(`putFxTransfersNotification giving up after ${currentAttempt} attempts`);
1070
1071
  resolve();
1071
1072
  }
1072
1073
  }
1073
1074
  });
1074
1075
  });
1075
-
1076
- if (!res) {
1077
- log.error(`putFxTransfersNotification failed after ${operation.attempts()} attempts`);
1078
- }
1079
1076
  } else {
1080
- res = await this._backendRequests.putFxTransfersNotification(responseBody, conversionId);
1081
- if (!res) {
1082
- log.error('putFxTransfersNotification failed');
1077
+ try {
1078
+ log.verbose(`putFxTransfersNotification no-retry mode for conversionId ${conversionId}`);
1079
+ res = await this._backendRequests.putFxTransfersNotification(responseBody, conversionId);
1080
+ } catch (err) {
1081
+ log.error('putFxTransfersNotification failed', err);
1083
1082
  }
1084
1083
  }
1085
1084
  return res;
@@ -1091,6 +1090,7 @@ class InboundTransfersModel {
1091
1090
  * Forwards Switch notification for fulfiled transfer to the DFSP backend, when acting as a payee
1092
1091
  */
1093
1092
  async sendNotificationToPayee(body, transferId) {
1093
+ const log = this._logger.child({ transferId });
1094
1094
  try {
1095
1095
  // load any cached state for this transfer e.g. quote request/response etc...
1096
1096
  this.data = await this._load(transferId);
@@ -1139,32 +1139,32 @@ class InboundTransfersModel {
1139
1139
  await new Promise((resolve) => {
1140
1140
  operation.attempt(async (currentAttempt) => {
1141
1141
  try {
1142
+ log.verbose(`putTransfersNotification attempt ${currentAttempt} for transferId ${transferId}`);
1142
1143
  res = await this._backendRequests.putTransfersNotification(this.data, transferId);
1143
- if (res) {
1144
- const cacheKey = `patchNotificationSent_${transferId}`;
1145
- await this._cache.set(cacheKey, true, 60);
1146
- return resolve();
1147
- }
1148
- this._logger.warn(`putTransfersNotification attempt ${currentAttempt} got no response, retrying...`);
1149
- if (!operation.retry(new Error('No response'))) {
1150
- resolve();
1151
- }
1144
+ // Consider success as long as it doesn't throw
1145
+ // `sendRequest` only seems to return `data` of the request which could
1146
+ // be empty for a 200 response
1147
+ const cacheKey = `patchNotificationSent_${transferId}`;
1148
+ await this._cache.set(cacheKey, true, 60);
1149
+ log.verbose(`putTransfersNotification attempt ${currentAttempt} succeeded for transferId ${transferId}`);
1150
+ resolve();
1152
1151
  } catch (err) {
1153
1152
  this._logger.warn(`putTransfersNotification attempt ${currentAttempt} threw error, retrying...`, err);
1154
1153
  if (!operation.retry(err)) {
1154
+ log.verbose(`putTransfersNotification giving up after ${currentAttempt} attempts`);
1155
1155
  resolve();
1156
1156
  }
1157
1157
  }
1158
1158
  });
1159
1159
  });
1160
-
1161
- if (!res) {
1162
- this._logger.error(`putTransfersNotification failed after ${operation.attempts()} attempts`);
1163
- }
1164
1160
  } else {
1165
- res = await this._backendRequests.putTransfersNotification(this.data, transferId);
1166
- if (!res) {
1167
- this._logger.error('putTransfersNotification failed');
1161
+ try {
1162
+ log.verbose(`putTransfersNotification no-retry mode for transferId ${transferId}`);
1163
+ res = await this._backendRequests.putTransfersNotification(this.data, transferId);
1164
+ const cacheKey = `patchNotificationSent_${transferId}`;
1165
+ await this._cache.set(cacheKey, true, 60);
1166
+ } catch (err) {
1167
+ this._logger.error('putTransfersNotification failed', err);
1168
1168
  }
1169
1169
  }
1170
1170
  return res;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter-outbound-command-event-handler",
3
- "version": "0.3.0-snapshot.56",
3
+ "version": "0.3.0-snapshot.59",
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": "18.1.1",
45
- "@mojaloop/central-services-shared": "18.33.0",
45
+ "@mojaloop/central-services-shared": "18.33.2",
46
46
  "@mojaloop/logging-bc-client-lib": "0.5.8",
47
47
  "@mojaloop/logging-bc-public-types-lib": "0.5.6",
48
48
  "@mojaloop/sdk-scheme-adapter-private-shared-lib": "workspace:^",
@@ -60,7 +60,7 @@
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.5.1",
63
+ "@types/node": "24.5.2",
64
64
  "@types/node-cache": "4.2.5",
65
65
  "@types/supertest": "6.0.3",
66
66
  "@types/swagger-ui-express": "4.1.8",
@@ -74,7 +74,7 @@
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.2",
77
+ "ts-jest": "29.4.3",
78
78
  "ts-node": "10.9.2",
79
79
  "typescript": "5.9.2"
80
80
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter-outbound-domain-event-handler",
3
- "version": "0.3.0-snapshot.56",
3
+ "version": "0.3.0-snapshot.59",
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/",
@@ -57,7 +57,7 @@
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.5.1",
60
+ "@types/node": "24.5.2",
61
61
  "@types/node-cache": "4.2.5",
62
62
  "@types/supertest": "6.0.3",
63
63
  "@types/swagger-ui-express": "4.1.8",
@@ -71,7 +71,7 @@
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.2",
74
+ "ts-jest": "29.4.3",
75
75
  "ts-node": "10.9.2",
76
76
  "typescript": "5.9.2"
77
77
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter-private-shared-lib",
3
- "version": "0.4.0-snapshot.56",
3
+ "version": "0.4.0-snapshot.59",
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": "18.1.1",
33
- "@mojaloop/central-services-shared": "18.33.0",
33
+ "@mojaloop/central-services-shared": "18.33.2",
34
34
  "@mojaloop/logging-bc-public-types-lib": "0.5.6",
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",
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "@eslint/compat": "1.3.2",
43
- "@types/node": "24.5.1",
43
+ "@types/node": "24.5.2",
44
44
  "@types/uuid": "10.0.0",
45
45
  "@typescript-eslint/eslint-plugin": "8.44.0",
46
46
  "@typescript-eslint/parser": "8.44.0",
@@ -49,7 +49,7 @@
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.2",
52
+ "ts-jest": "29.4.3",
53
53
  "tslib": "2.8.1",
54
54
  "typescript": "5.9.2"
55
55
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter",
3
- "version": "24.11.0-snapshot.2",
3
+ "version": "24.11.0-snapshot.5",
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": "30.0.0",
85
- "@types/node": "24.5.1",
85
+ "@types/node": "24.5.2",
86
86
  "@types/node-cache": "4.2.5",
87
87
  "@typescript-eslint/eslint-plugin": "8.44.0",
88
88
  "@typescript-eslint/parser": "8.44.0",
@@ -97,7 +97,7 @@
97
97
  "npm-check-updates": "16.7.10",
98
98
  "replace": "1.2.2",
99
99
  "standard-version": "9.5.0",
100
- "ts-jest": "29.4.2",
100
+ "ts-jest": "29.4.3",
101
101
  "ts-node": "10.9.2",
102
102
  "typescript": "5.9.2",
103
103
  "yarn-audit-fix": "10.1.1"