@mojaloop/sdk-scheme-adapter 24.10.9-snapshot.1 → 24.11.0-csi-1680.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter-api-svc",
3
- "version": "21.0.0-snapshot.53",
3
+ "version": "21.0.0-snapshot.54",
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",
@@ -1071,19 +1071,19 @@ const postFxTransfers = async (ctx) => {
1071
1071
  };
1072
1072
 
1073
1073
  const patchFxTransfersById = async (ctx) => {
1074
- const req = {
1075
- headers: { ...ctx.request.headers },
1076
- data: { ...ctx.request.body }
1077
- };
1074
+ if (ctx.state.conf.isIsoApi) {
1075
+ ctx.state.logger.push(ctx.request.body).debug('Transforming incoming ISO20022 patch fxTransfers body to FSPIOP');
1076
+ const target = await TransformFacades.FSPIOPISO20022.fxTransfers.patch({ body: ctx.request.body }, { rollUpUnmappedAsExtensions: true });
1077
+ ctx.request.body = target.body;
1078
+ }
1079
+
1080
+ const data = { ...ctx.request.body };
1078
1081
  const idValue = ctx.state.path.params.ID;
1079
1082
 
1080
1083
  const model = createInboundTransfersModel(ctx);
1084
+ const response = await model.sendFxPutNotificationToBackend(data, idValue);
1081
1085
 
1082
- const response = await model.sendFxPutNotificationToBackend(req.data, idValue);
1083
-
1084
- // log the result
1085
- ctx.state.logger.isDebugEnabled && ctx.state.logger.push({response}).
1086
- debug('Inbound Transfers model handled PATCH /fxTransfers/{ID} request');
1086
+ ctx.state.logger.push({ response }).debug('Inbound Transfers model handled PATCH /fxTransfers/{ID} request');
1087
1087
  };
1088
1088
 
1089
1089
  /**
@@ -956,7 +956,7 @@ class InboundTransfersModel {
956
956
  async sendFxPutNotificationToBackend(body, conversionId) {
957
957
  const log = this._logger.child({ conversionId });
958
958
  try {
959
- log.verbose('sendFxPutNotificationToBackend payload: ', { body });
959
+ log.verbose('sendFxPutNotificationToBackend - incoming payload: ', { body });
960
960
  this.data = await this.loadFxState(conversionId);
961
961
 
962
962
  if(!this.data) {
@@ -976,7 +976,14 @@ class InboundTransfersModel {
976
976
 
977
977
  await this.saveFxState();
978
978
 
979
- const res = await this._backendRequests.putFxTransfersNotification(body, conversionId);
979
+ const responseBody = {
980
+ conversionState: body.conversionState, // one of ABORTED, COMMITTED, RESERVED
981
+ completedTimestamp: body.completedTimestamp
982
+ };
983
+ log.verbose('sendFxPutNotificationToBackend - body sent to cc: ', { responseBody });
984
+
985
+
986
+ const res = await this._backendRequests.putFxTransfersNotification(responseBody, conversionId);
980
987
  return res;
981
988
  } catch (err) {
982
989
  log.error('error in sendFxPutNotificationToBackend: ', err);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter-outbound-command-event-handler",
3
- "version": "0.3.0-snapshot.49",
3
+ "version": "0.3.0-snapshot.50",
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/",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter-outbound-domain-event-handler",
3
- "version": "0.3.0-snapshot.49",
3
+ "version": "0.3.0-snapshot.50",
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/",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter-private-shared-lib",
3
- "version": "0.4.0-snapshot.49",
3
+ "version": "0.4.0-snapshot.50",
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",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter",
3
- "version": "24.10.9-snapshot.1",
3
+ "version": "24.11.0-csi-1680.0",
4
4
  "description": "mojaloop sdk-scheme-adapter",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/mojaloop/sdk-scheme-adapter",