ml-testing-toolkit 18.17.0-snapshot.2 → 18.17.0-snapshot.6

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ml-testing-toolkit",
3
3
  "description": "Testing Toolkit for Mojaloop implementations",
4
- "version": "18.17.0-snapshot.2",
4
+ "version": "18.17.0-snapshot.6",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Vijaya Kumar Guthi, ModusBox Inc. ",
7
7
  "contributors": [
@@ -141,7 +141,9 @@ const handleTransferIlp = (context, response) => {
141
141
  }
142
142
  }
143
143
 
144
+ customLogger.logMessage('debug', 'Generated callback body', { additionalData: { context, response }, request: context.request })
144
145
  if (context.request.method === 'get' && response.method === 'put' && pathMatch.test(response.path)) {
146
+ customLogger.logMessage('debug', 'success', { additionalData: { context, response }, request: context.request })
145
147
  const transferId = response.path.match(pathMatch)[1]
146
148
  const storedTransfer = context.storedTransfers?.[transferId]
147
149
 
@@ -319,14 +319,15 @@ const generateAsyncCallback = async (item, context, req) => {
319
319
  }
320
320
  } else {
321
321
  // Store transfers early - right after validation
322
- const transferPathMatch = /\/transfers\/([^/]+)$/
323
- const fxTransferPathMatch = /\/fxTransfers\/([^/]+)$/
322
+ const transferPathMatch = /\/transfers(?:\/([^/]+))?$/
323
+ const fxTransferPathMatch = /\/fxTransfers(?:\/([^/]+))?$/
324
+ customLogger.logMessage('debug', 'Processing transfer request', { additionalData: { method: req.method, path: req.path }, request: req })
324
325
  if (req.method === 'post' && (transferPathMatch.test(req.path) || fxTransferPathMatch.test(req.path))) {
325
326
  if (!context.storedTransfers) {
326
327
  context.storedTransfers = {}
327
328
  }
328
329
  const isFxTransfer = fxTransferPathMatch.test(req.path)
329
- const transferId = req.path.match(isFxTransfer ? fxTransferPathMatch : transferPathMatch)[1]
330
+ const transferId = (req.payload && req.payload.transferId) || (req.payload && req.payload.commitRequestId)
330
331
  customLogger.logMessage('debug', 'Storing transfer for validation', { additionalData: { transferId }, request: req })
331
332
 
332
333
  context.storedTransfers[transferId] = {
@@ -443,7 +444,7 @@ const generateAsyncCallback = async (item, context, req) => {
443
444
  return
444
445
  }
445
446
  }
446
-
447
+ customLogger.logMessage('debug', 'Generated callback body', { additionalData: { body: generatedCallback.body }, request: req })
447
448
  if (generatedCallback.body) {
448
449
  // Append ILP properties to callback
449
450
  const fulfilment = IlpModel.handleQuoteIlp(context, generatedCallback)