account-lookup-service 17.0.3 → 17.2.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.
Files changed (122) hide show
  1. package/.circleci/config.yml +2 -1
  2. package/CHANGELOG.md +24 -0
  3. package/docker-compose.yml +8 -2
  4. package/jest.config.js +1 -0
  5. package/migrations/01_currency.js +5 -5
  6. package/migrations/02_endpointType.js +5 -5
  7. package/migrations/03_endpointType-indexes.js +5 -5
  8. package/migrations/04_partyIdType.js +5 -5
  9. package/migrations/05_partyIdType-indexes.js +5 -5
  10. package/migrations/08_oracleEndpoint.js +5 -5
  11. package/migrations/09_oracleEndpoint-indexes.js +5 -5
  12. package/migrations/10_oracleEndpoint-remove-constraints.js +5 -5
  13. package/package.json +17 -16
  14. package/scripts/_wait4_all.js +3 -1
  15. package/seeds/currency.js +5 -5
  16. package/seeds/endpointType.js +4 -4
  17. package/seeds/partyIdType.js +4 -4
  18. package/src/api/endpointcache.js +4 -4
  19. package/src/api/health.js +4 -4
  20. package/src/api/index.js +4 -4
  21. package/src/api/oracles/{ID}.js +31 -6
  22. package/src/api/oracles.js +33 -7
  23. package/src/api/participants/{ID}/error.js +5 -5
  24. package/src/api/participants/{ID}.js +5 -5
  25. package/src/api/participants/{Type}/{ID}/error.js +22 -6
  26. package/src/api/participants/{Type}/{ID}/{SubId}/error.js +5 -5
  27. package/src/api/participants/{Type}/{ID}/{SubId}.js +99 -5
  28. package/src/api/participants/{Type}/{ID}.js +83 -10
  29. package/src/api/participants.js +19 -6
  30. package/src/api/parties/{Type}/{ID}/error.js +20 -6
  31. package/src/api/parties/{Type}/{ID}/{SubId}/error.js +32 -7
  32. package/src/api/parties/{Type}/{ID}/{SubId}.js +55 -7
  33. package/src/api/parties/{Type}/{ID}.js +37 -10
  34. package/src/api/routes.js +5 -5
  35. package/src/domain/oracle/index.js +5 -5
  36. package/src/domain/oracle/oracle.js +11 -45
  37. package/src/domain/participants/index.js +5 -5
  38. package/src/domain/participants/participants.js +20 -59
  39. package/src/domain/parties/getPartiesByTypeAndID.js +9 -14
  40. package/src/domain/parties/index.js +5 -5
  41. package/src/domain/parties/parties.js +12 -23
  42. package/src/domain/timeout/dto.js +14 -2
  43. package/src/domain/timeout/index.js +6 -12
  44. package/src/handlers/TimeoutHandler.js +3 -3
  45. package/src/handlers/index.js +3 -3
  46. package/src/handlers/register.js +3 -3
  47. package/src/index.js +4 -4
  48. package/src/interface/admin-swagger.yaml +4 -0
  49. package/src/interface/admin_swagger.json +902 -900
  50. package/src/interface/api_swagger.json +2824 -2824
  51. package/src/interface/thirdparty/admin-swagger.yaml +2 -2
  52. package/src/interface/thirdparty/admin_swagger.json +902 -902
  53. package/src/interface/thirdparty/api_swagger.json +2917 -2917
  54. package/src/lib/argv.js +5 -5
  55. package/src/lib/cache.js +5 -5
  56. package/src/lib/config.js +5 -5
  57. package/src/lib/db.js +5 -5
  58. package/src/lib/headers.js +5 -5
  59. package/src/lib/healthCheck/subServiceHealth.js +5 -5
  60. package/src/lib/util.js +20 -2
  61. package/src/models/currency/currency.js +7 -16
  62. package/src/models/currency/index.js +5 -5
  63. package/src/models/endpointType/endpointType.js +7 -16
  64. package/src/models/endpointType/index.js +5 -5
  65. package/src/models/misc/migrationLock.js +5 -5
  66. package/src/models/oracle/facade.js +5 -5
  67. package/src/models/oracle/index.js +5 -5
  68. package/src/models/oracle/oracleEndpoint.js +17 -71
  69. package/src/models/oracle/oracleEndpointCached.js +5 -5
  70. package/src/models/participantEndpoint/facade.js +5 -5
  71. package/src/models/partyIdType/index.js +5 -5
  72. package/src/models/partyIdType/partyIdType.js +7 -16
  73. package/src/plugins.js +4 -4
  74. package/src/server.js +8 -12
  75. package/test/integration/api/parties.test.js +5 -5
  76. package/test/integration/domain/oracle/index.test.js +23 -5
  77. package/test/integration/domain/timeout/index.test.js +1 -1
  78. package/test/integration/models/currency/currency.test.js +5 -5
  79. package/test/integration/plugins.test.js +5 -5
  80. package/test/unit/api/health.test.js +5 -5
  81. package/test/unit/api/oracles/{ID}.test.js +5 -5
  82. package/test/unit/api/oracles.test.js +5 -5
  83. package/test/unit/api/participants/participants.test.js +5 -5
  84. package/test/unit/api/participants/{Type}/{ID}/error.test.js +7 -5
  85. package/test/unit/api/participants/{Type}/{ID}/{SubId}/error.test.js +5 -5
  86. package/test/unit/api/participants/{Type}/{ID}/{SubId}.test.js +5 -5
  87. package/test/unit/api/participants/{Type}/{ID}.test.js +5 -5
  88. package/test/unit/api/participants.test.js +5 -5
  89. package/test/unit/api/parties/endpointcache.test.js +5 -5
  90. package/test/unit/api/parties/parties.test.js +5 -5
  91. package/test/unit/api/parties/{Type}/{ID}/error.test.js +8 -6
  92. package/test/unit/api/parties/{Type}/{ID}/{SubId}/error.test.js +15 -5
  93. package/test/unit/api/parties/{Type}/{ID}/{SubId}.test.js +5 -5
  94. package/test/unit/api/parties/{Type}/{ID}.test.js +5 -5
  95. package/test/unit/domain/oracle/oracle.test.js +5 -5
  96. package/test/unit/domain/participants/participants.test.js +6 -6
  97. package/test/unit/domain/parties/parties.test.js +8 -8
  98. package/test/unit/domain/parties/utils.test.js +5 -5
  99. package/test/unit/domain/timeout/index.test.js +3 -3
  100. package/test/unit/handlers/TimeoutHandler.test.js +3 -3
  101. package/test/unit/handlers/index.test.js +3 -3
  102. package/test/unit/handlers/register.test.js +3 -3
  103. package/test/unit/index.test.js +5 -5
  104. package/test/unit/iso20022/partiesValidation.test.js +5 -5
  105. package/test/unit/lib/argv.test.js +5 -5
  106. package/test/unit/lib/config.test.js +5 -5
  107. package/test/unit/lib/healthCheck/subServiceHealth.test.js +5 -5
  108. package/test/unit/lib/migrator.test.js +5 -5
  109. package/test/unit/lib/util.test.js +5 -5
  110. package/test/unit/mocks.js +3 -3
  111. package/test/unit/models/currency/currency.test.js +5 -5
  112. package/test/unit/models/endpointType/endpointType.test.js +5 -5
  113. package/test/unit/models/misc/migrationLock.test.js +5 -5
  114. package/test/unit/models/oracle/facade.test.js +5 -5
  115. package/test/unit/models/oracle/oracleEndpoint.test.js +5 -5
  116. package/test/unit/models/oracle/oracleEndpointCached.test.js +5 -5
  117. package/test/unit/models/participantEndpoint/facade.test.js +5 -5
  118. package/test/unit/models/partyIdType/partyIdType.test.js +5 -5
  119. package/test/unit/plugins.test.js +5 -5
  120. package/test/util/helper.js +5 -5
  121. package/test/util/mockgen.js +5 -5
  122. package/test/util/testConfig.js +5 -5
@@ -1,8 +1,8 @@
1
1
  /*****
2
2
  License
3
3
  --------------
4
- Copyright © 2017 Bill & Melinda Gates Foundation
5
- The Mojaloop files are made available by the Bill & Melinda Gates 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
4
+ Copyright © 2020-2025 Mojaloop Foundation
5
+ The Mojaloop files are made available by the 2020-2025 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
6
  http://www.apache.org/licenses/LICENSE-2.0
7
7
  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.
8
8
  Contributors
@@ -12,11 +12,11 @@
12
12
  should be listed with a '*' in the first column. People who have
13
13
  contributed from an organization can be listed under the organization
14
14
  that actually holds the copyright for their contributions (see the
15
- Gates Foundation organization for an example). Those individuals should have
15
+ Mojaloop Foundation organization for an example). Those individuals should have
16
16
  their names indented and be marked with a '-'. Email address can be added
17
17
  optionally within square brackets <email>.
18
- * Gates Foundation
19
- - Name Surname <name.surname@gatesfoundation.com>
18
+ * Mojaloop Foundation
19
+ - Name Surname <name.surname@mojaloop.io>
20
20
 
21
21
  - Rajiv Mothilal <rajiv.mothilal@modusbox.com>
22
22
  - Steven Oderayi <steven.oderayi@modusbox.com>
@@ -37,6 +37,7 @@ const participant = require('../../models/participantEndpoint/facade')
37
37
  const Config = require('../../lib/config')
38
38
  const { logger } = require('../../lib')
39
39
  const { ERROR_MESSAGES } = require('../../constants')
40
+ const util = require('../../lib/util')
40
41
 
41
42
  const { FSPIOPErrorCodes } = ErrorHandler.Enums
42
43
 
@@ -58,7 +59,6 @@ const getParticipantsByTypeAndID = async (headers, params, method, query, span,
58
59
  'Get participants by ID',
59
60
  ['success']
60
61
  ).startTimer()
61
- const errorCounter = Metrics.getCounter('errorCount')
62
62
  const log = logger.child('getParticipantsByTypeAndID')
63
63
  const type = params.Type
64
64
  const partySubIdOrType = params.SubId
@@ -128,14 +128,9 @@ const getParticipantsByTypeAndID = async (headers, params, method, query, span,
128
128
  } catch (err) {
129
129
  log.warn('error in getParticipantsByTypeAndID', err)
130
130
  fspiopError = ErrorHandler.Factory.reformatFSPIOPError(err, ErrorHandler.Enums.FSPIOPErrorCodes.ADD_PARTY_INFO_ERROR)
131
- const extensions = err.extensions || []
132
- const system = extensions.find((element) => element.key === 'system')?.value || ''
133
- errorCounter.inc({
134
- code: fspiopError?.apiErrorCode?.code,
135
- system,
136
- operation: 'getParticipantsByTypeAndID',
137
- step
138
- })
131
+ if (fspiopError) {
132
+ util.countFspiopError(fspiopError, { operation: 'getParticipantsByTypeAndID', step })
133
+ }
139
134
  try {
140
135
  await participant.sendErrorToParticipant(
141
136
  headers[Enums.Http.Headers.FSPIOP.SOURCE],
@@ -180,7 +175,6 @@ const putParticipantsByTypeAndID = async (headers, params, method, payload, cach
180
175
  'Put participants by type and ID',
181
176
  ['success']
182
177
  ).startTimer()
183
- const errorCounter = Metrics.getCounter('errorCount')
184
178
  let step
185
179
  try {
186
180
  logger.info('putParticipantsByTypeAndID::begin')
@@ -249,14 +243,9 @@ const putParticipantsByTypeAndID = async (headers, params, method, payload, cach
249
243
  // we've already sent a sync response- we cannot throw.
250
244
  logger.error('error in participant.sendErrorToParticipant:', exc)
251
245
  }
252
- const extensions = err.extensions || []
253
- const system = extensions.find((element) => element.key === 'system')?.value || ''
254
- errorCounter.inc({
255
- code: fspiopError?.apiErrorCode?.code,
256
- system,
257
- operation: 'putParticipantsByTypeAndID',
258
- step
259
- })
246
+ if (fspiopError) {
247
+ util.countFspiopError(fspiopError, { operation: 'putParticipantsByTypeAndID', step })
248
+ }
260
249
  histTimerEnd({ success: false })
261
250
  }
262
251
  }
@@ -280,7 +269,6 @@ const putParticipantsErrorByTypeAndID = async (headers, params, payload, dataUri
280
269
  'Put participants error by type and ID',
281
270
  ['success']
282
271
  ).startTimer()
283
- const errorCounter = Metrics.getCounter('errorCount')
284
272
  let step
285
273
  try {
286
274
  const partySubIdOrType = params.SubId || undefined
@@ -325,14 +313,7 @@ const putParticipantsErrorByTypeAndID = async (headers, params, payload, dataUri
325
313
  headers,
326
314
  params
327
315
  )
328
- const extensions = err.extensions || []
329
- const system = extensions.find((element) => element.key === 'system')?.value || ''
330
- errorCounter.inc({
331
- code: fspiopError?.apiErrorCode?.code,
332
- system,
333
- operation: 'putParticipantsErrorByTypeAndID',
334
- step
335
- })
316
+ util.countFspiopError(fspiopError, { operation: 'putParticipantsErrorByTypeAndID', step })
336
317
  } catch (exc) {
337
318
  // We can't do anything else here- we _must_ handle all errors _within_ this function because
338
319
  // we've already sent a sync response- we cannot throw.
@@ -359,7 +340,6 @@ const postParticipants = async (headers, method, params, payload, span, cache) =
359
340
  'Post participants',
360
341
  ['success']
361
342
  ).startTimer()
362
- const errorCounter = Metrics.getCounter('errorCount')
363
343
  const childSpan = span ? span.getChild('postParticipants') : undefined
364
344
  let fspiopError
365
345
  let step
@@ -431,14 +411,9 @@ const postParticipants = async (headers, method, params, payload, span, cache) =
431
411
  } catch (err) {
432
412
  logger.error('error in postParticipants:', err)
433
413
  fspiopError = ErrorHandler.Factory.reformatFSPIOPError(err, ErrorHandler.Enums.FSPIOPErrorCodes.ADD_PARTY_INFO_ERROR)
434
- const extensions = err.extensions || []
435
- const system = extensions.find((element) => element.key === 'system')?.value || ''
436
- errorCounter.inc({
437
- code: fspiopError?.apiErrorCode?.code,
438
- system,
439
- operation: 'postParticipants',
440
- step
441
- })
414
+ if (fspiopError) {
415
+ util.countFspiopError(fspiopError, { operation: 'postParticipants', step })
416
+ }
442
417
  try {
443
418
  const errorCallbackEndpointType = params.SubId
444
419
  ? Enums.EndPoints.FspEndpointTypes.FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT_ERROR
@@ -476,7 +451,6 @@ const postParticipantsBatch = async (headers, method, requestPayload, span) => {
476
451
  'Post participants batch',
477
452
  ['success']
478
453
  ).startTimer()
479
- const errorCounter = Metrics.getCounter('errorCount')
480
454
  const requestId = requestPayload.requestId
481
455
  const log = logger.child({ context: 'postParticipantsBatch', requestId })
482
456
  const childSpan = span ? span.getChild('postParticipantsBatch') : undefined
@@ -563,14 +537,9 @@ const postParticipantsBatch = async (headers, method, requestPayload, span) => {
563
537
  } catch (err) {
564
538
  log.error('error in postParticipantsBatch', err)
565
539
  fspiopError = ErrorHandler.Factory.reformatFSPIOPError(err)
566
- const extensions = err.extensions || []
567
- const system = extensions.find((element) => element.key === 'system')?.value || ''
568
- errorCounter.inc({
569
- code: fspiopError?.apiErrorCode?.code,
570
- system,
571
- operation: 'postParticipantsBatch',
572
- step
573
- })
540
+ if (fspiopError) {
541
+ util.countFspiopError(fspiopError, { operation: 'postParticipantsBatch', step })
542
+ }
574
543
  try {
575
544
  await participant.sendErrorToParticipant(headers[Enums.Http.Headers.FSPIOP.SOURCE], Enums.EndPoints.FspEndpointTypes.FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT_ERROR,
576
545
  fspiopError.toApiErrorObject(Config.ERROR_HANDLING), headers, undefined, requestPayload)
@@ -606,7 +575,6 @@ const deleteParticipants = async (headers, params, method, query, cache) => {
606
575
  'Delete participants',
607
576
  ['success']
608
577
  ).startTimer()
609
- const errorCounter = Metrics.getCounter('errorCount')
610
578
  const log = logger.child('deleteParticipants')
611
579
  let step
612
580
  try {
@@ -659,14 +627,7 @@ const deleteParticipants = async (headers, params, method, query, cache) => {
659
627
  const errorCallbackEndpointType = params.SubId ? Enums.EndPoints.FspEndpointTypes.FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT_ERROR : Enums.EndPoints.FspEndpointTypes.FSPIOP_CALLBACK_URL_PARTICIPANT_PUT_ERROR
660
628
  await participant.sendErrorToParticipant(headers[Enums.Http.Headers.FSPIOP.SOURCE], errorCallbackEndpointType,
661
629
  fspiopError.toApiErrorObject(Config.ERROR_HANDLING), headers, params)
662
- const extensions = err.extensions || []
663
- const system = extensions.find((element) => element.key === 'system')?.value || ''
664
- errorCounter.inc({
665
- code: fspiopError?.apiErrorCode?.code,
666
- system,
667
- operation: 'deleteParticipants',
668
- step
669
- })
630
+ util.countFspiopError(fspiopError, { operation: 'deleteParticipants', step })
670
631
  } catch (exc) {
671
632
  // We can't do anything else here- we _must_ handle all errors _within_ this function because
672
633
  // we've already sent a sync response- we cannot throw.
@@ -1,8 +1,8 @@
1
1
  /*****
2
2
  License
3
3
  --------------
4
- Copyright © 2017 Bill & Melinda Gates Foundation
5
- The Mojaloop files are made available by the Bill & Melinda Gates 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
4
+ Copyright © 2020-2025 Mojaloop Foundation
5
+ The Mojaloop files are made available by the 2020-2025 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
6
  http://www.apache.org/licenses/LICENSE-2.0
7
7
  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.
8
8
 
@@ -13,11 +13,11 @@
13
13
  should be listed with a '*' in the first column. People who have
14
14
  contributed from an organization can be listed under the organization
15
15
  that actually holds the copyright for their contributions (see the
16
- Gates Foundation organization for an example). Those individuals should have
16
+ Mojaloop Foundation organization for an example). Those individuals should have
17
17
  their names indented and be marked with a '-'. Email address can be added
18
18
  optionally within square brackets <email>.
19
- * Gates Foundation
20
- - Name Surname <name.surname@gatesfoundation.com>
19
+ * Mojaloop Foundation
20
+ - Name Surname <name.surname@mojaloop.io>
21
21
 
22
22
  * Eugen Klymniuk <eugen.klymniuk@infitx.com>
23
23
  --------------
@@ -35,6 +35,7 @@ const { ERROR_MESSAGES } = require('../../constants')
35
35
  const { logger } = require('../../lib')
36
36
  const Config = require('../../lib/config')
37
37
  const utils = require('./utils')
38
+ const util = require('../../lib/util')
38
39
 
39
40
  const { FspEndpointTypes, FspEndpointTemplates } = Enum.EndPoints
40
41
  const { Headers, RestMethods } = Enum.Http
@@ -87,7 +88,6 @@ const getPartiesByTypeAndID = async (headers, params, method, query, span, cache
87
88
  'Get party by Type and Id',
88
89
  ['success']
89
90
  ).startTimer()
90
- const errorCounter = Metrics.getCounter('errorCount')
91
91
  const proxyEnabled = !!(Config.PROXY_CACHE_CONFIG.enabled && proxyCache)
92
92
  const type = params.Type
93
93
  const partySubId = params.SubId
@@ -245,14 +245,9 @@ const getPartiesByTypeAndID = async (headers, params, method, query, span, cache
245
245
  } catch (err) {
246
246
  fspiopError = await handleErrorOnSendingCallback(err, headers, params, requester)
247
247
  histTimerEnd({ success: false })
248
- const extensions = err.extensions || []
249
- const system = extensions.find((element) => element.key === 'system')?.value || ''
250
- errorCounter.inc({
251
- code: fspiopError?.apiErrorCode?.code,
252
- system,
253
- operation: 'getPartiesByTypeAndID',
254
- step
255
- })
248
+ if (fspiopError) {
249
+ util.countFspiopError(fspiopError, { operation: 'getPartiesByTypeAndID', step })
250
+ }
256
251
  } finally {
257
252
  await utils.finishSpanWithError(childSpan, fspiopError)
258
253
  }
@@ -1,8 +1,8 @@
1
1
  /*****
2
2
  License
3
3
  --------------
4
- Copyright © 2017 Bill & Melinda Gates Foundation
5
- The Mojaloop files are made available by the Bill & Melinda Gates 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
4
+ Copyright © 2020-2025 Mojaloop Foundation
5
+ The Mojaloop files are made available by the 2020-2025 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
6
  http://www.apache.org/licenses/LICENSE-2.0
7
7
  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.
8
8
  Contributors
@@ -12,11 +12,11 @@
12
12
  should be listed with a '*' in the first column. People who have
13
13
  contributed from an organization can be listed under the organization
14
14
  that actually holds the copyright for their contributions (see the
15
- Gates Foundation organization for an example). Those individuals should have
15
+ Mojaloop Foundation organization for an example). Those individuals should have
16
16
  their names indented and be marked with a '-'. Email address can be added
17
17
  optionally within square brackets <email>.
18
- * Gates Foundation
19
- - Name Surname <name.surname@gatesfoundation.com>
18
+ * Mojaloop Foundation
19
+ - Name Surname <name.surname@mojaloop.io>
20
20
 
21
21
  - Rajiv Mothilal <rajiv.mothilal@modusbox.com>
22
22
 
@@ -1,8 +1,8 @@
1
1
  /*****
2
2
  License
3
3
  --------------
4
- Copyright © 2017 Bill & Melinda Gates Foundation
5
- The Mojaloop files are made available by the Bill & Melinda Gates 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
4
+ Copyright © 2020-2025 Mojaloop Foundation
5
+ The Mojaloop files are made available by the 2020-2025 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
6
  http://www.apache.org/licenses/LICENSE-2.0
7
7
  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.
8
8
  Contributors
@@ -12,11 +12,11 @@
12
12
  should be listed with a '*' in the first column. People who have
13
13
  contributed from an organization can be listed under the organization
14
14
  that actually holds the copyright for their contributions (see the
15
- Gates Foundation organization for an example). Those individuals should have
15
+ Mojaloop Foundation organization for an example). Those individuals should have
16
16
  their names indented and be marked with a '-'. Email address can be added
17
17
  optionally within square brackets <email>.
18
- * Gates Foundation
19
- - Name Surname <name.surname@gatesfoundation.com>
18
+ * Mojaloop Foundation
19
+ - Name Surname <name.surname@mojaloop.io>
20
20
 
21
21
  - Rajiv Mothilal <rajiv.mothilal@modusbox.com>
22
22
  - Henk Kodde <henk.kodde@modusbox.com>
@@ -41,6 +41,7 @@ const { ERROR_MESSAGES } = require('../../constants')
41
41
  const { logger } = require('../../lib')
42
42
  const Config = require('../../lib/config')
43
43
  const utils = require('./utils')
44
+ const util = require('../../lib/util')
44
45
  const getPartiesByTypeAndID = require('./getPartiesByTypeAndID')
45
46
 
46
47
  const log = logger.child('domain:put-parties')
@@ -65,7 +66,6 @@ const putPartiesByTypeAndID = async (headers, params, method, payload, dataUri,
65
66
  'Put parties by type and id',
66
67
  ['success']
67
68
  ).startTimer()
68
- const errorCounter = Metrics.getCounter('errorCount')
69
69
  const type = params.Type
70
70
  const partySubId = params.SubId
71
71
  const source = headers[Headers.FSPIOP.SOURCE]
@@ -134,14 +134,9 @@ const putPartiesByTypeAndID = async (headers, params, method, payload, dataUri,
134
134
  histTimerEnd({ success: true })
135
135
  } catch (err) {
136
136
  const fspiopError = await handleErrorOnSendingCallback(err, headers, params, sendTo)
137
- const extensions = err.extensions || []
138
- const system = extensions.find((element) => element.key === 'system')?.value || ''
139
- errorCounter.inc({
140
- code: fspiopError?.apiErrorCode?.code,
141
- system,
142
- operation: 'putPartiesByTypeAndID',
143
- step
144
- })
137
+ if (fspiopError) {
138
+ util.countFspiopError(fspiopError, { operation: 'putPartiesByTypeAndID', step })
139
+ }
145
140
  histTimerEnd({ success: false })
146
141
  }
147
142
  }
@@ -165,7 +160,6 @@ const putPartiesErrorByTypeAndID = async (headers, params, payload, dataUri, spa
165
160
  'Put parties error by type and id',
166
161
  ['success']
167
162
  ).startTimer()
168
- const errorCounter = Metrics.getCounter('errorCount')
169
163
  const partySubId = params.SubId
170
164
  const destination = headers[Headers.FSPIOP.DESTINATION]
171
165
  const callbackEndpointType = utils.errorPartyCbType(partySubId)
@@ -220,14 +214,9 @@ const putPartiesErrorByTypeAndID = async (headers, params, payload, dataUri, spa
220
214
  histTimerEnd({ success: true })
221
215
  } catch (err) {
222
216
  fspiopError = await handleErrorOnSendingCallback(err, headers, params, sendTo)
223
- const extensions = err.extensions || []
224
- const system = extensions.find((element) => element.key === 'system')?.value || ''
225
- errorCounter.inc({
226
- code: fspiopError?.apiErrorCode?.code,
227
- system,
228
- operation: 'putPartiesErrorByTypeAndID',
229
- step
230
- })
217
+ if (fspiopError) {
218
+ util.countFspiopError(fspiopError, { operation: 'putPartiesErrorByTypeAndID', step })
219
+ }
231
220
  histTimerEnd({ success: false })
232
221
  } finally {
233
222
  await utils.finishSpanWithError(childSpan, fspiopError)
@@ -5,9 +5,11 @@ const {
5
5
  const {
6
6
  Http: { Headers: { FSPIOP: FSPIOPHeaders } },
7
7
  Events: { Event: { Type: EventType, Action: EventAction } },
8
- EndPoints: { FspEndpointTypes }
8
+ EndPoints: { FspEndpointTypes },
9
+ Tags: { QueryTags: QueryTagsEnum }
9
10
  } = require('@mojaloop/central-services-shared').Enum
10
11
  const { Tracer } = require('@mojaloop/event-sdk')
12
+ const EventFrameworkUtil = require('@mojaloop/central-services-shared').Util.EventFramework
11
13
 
12
14
  const LibUtil = require('../../lib/util')
13
15
  const Config = require('../../lib/config')
@@ -33,7 +35,17 @@ const timeoutCallbackDto = async ({ destination, partyId, partyType }) => {
33
35
  const span = Tracer.createSpan('timeoutInterschemePartiesLookups', { headers: dto.headers })
34
36
  const spanTags = LibUtil.getSpanTags({ headers: dto.headers }, EventType.PARTY, EventAction.PUT)
35
37
  span.setTags(spanTags)
36
-
38
+ const queryTags = EventFrameworkUtil.Tags.getQueryTags(
39
+ QueryTagsEnum.serviceName.accountLookupService,
40
+ QueryTagsEnum.auditType.transactionFlow,
41
+ QueryTagsEnum.contentType.httpRequest,
42
+ QueryTagsEnum.operation.timeoutInterschemePartiesLookups,
43
+ {
44
+ partyIdType: params.Type,
45
+ partyIdentifier: params.ID
46
+ }
47
+ )
48
+ span.setTags(queryTags)
37
49
  return { ...dto, span }
38
50
  }
39
51
 
@@ -17,12 +17,12 @@
17
17
  should be listed with a '*' in the first column. People who have
18
18
  contributed from an organization can be listed under the organization
19
19
  that actually holds the copyright for their contributions (see the
20
- Gates Foundation organization for an example). Those individuals should have
20
+ Mojaloop Foundation organization for an example). Those individuals should have
21
21
  their names indented and be marked with a '-'. Email address can be added
22
22
  optionally within square brackets <email>.
23
23
 
24
- * Gates Foundation
25
- - Name Surname <name.surname@gatesfoundation.com>
24
+ * Mojaloop Foundation
25
+ - Name Surname <name.surname@mojaloop.io>
26
26
 
27
27
  * INFITX
28
28
  - Steven Oderayi <steven.oderayi@infitx.com>
@@ -46,6 +46,7 @@ const Participant = require('../../models/participantEndpoint/facade')
46
46
  const { ERROR_MESSAGES } = require('../../constants')
47
47
  const { timeoutCallbackDto } = require('./dto')
48
48
  const { logger } = require('../../lib')
49
+ const util = require('../../lib/util')
49
50
 
50
51
  const timeoutInterschemePartiesLookups = async ({ proxyCache, batchSize }) => {
51
52
  return proxyCache.processExpiredAlsKeys(sendTimeoutCallback, batchSize)
@@ -57,7 +58,6 @@ const sendTimeoutCallback = async (cacheKey) => {
57
58
  'Egress - Interscheme parties lookup timeout callback',
58
59
  ['success']
59
60
  ).startTimer()
60
- const errorCounter = Metrics.getCounter('errorCount')
61
61
  let step
62
62
  const [, destination, partyType, partyId] = cacheKey.split(':')
63
63
  const { errorInformation, params, headers, endpointType, span } = await timeoutCallbackDto({ destination, partyId, partyType })
@@ -74,14 +74,8 @@ const sendTimeoutCallback = async (cacheKey) => {
74
74
  logger.warn('error in sendTimeoutCallback: ', err)
75
75
  histTimerEnd({ success: false })
76
76
  const fspiopError = reformatFSPIOPError(err)
77
- const extensions = err.extensions || []
78
- const system = extensions.find((element) => element.key === 'system')?.value || ''
79
- errorCounter.inc({
80
- code: fspiopError?.apiErrorCode?.code,
81
- system,
82
- operation: 'sendTimeoutCallback',
83
- step
84
- })
77
+ util.countFspiopError(fspiopError, { operation: 'sendTimeoutCallback', step })
78
+
85
79
  await finishSpan(span, fspiopError)
86
80
  throw fspiopError
87
81
  }
@@ -17,12 +17,12 @@
17
17
  should be listed with a '*' in the first column. People who have
18
18
  contributed from an organization can be listed under the organization
19
19
  that actually holds the copyright for their contributions (see the
20
- Gates Foundation organization for an example). Those individuals should have
20
+ Mojaloop Foundation organization for an example). Those individuals should have
21
21
  their names indented and be marked with a '-'. Email address can be added
22
22
  optionally within square brackets <email>.
23
23
 
24
- * Gates Foundation
25
- - Name Surname <name.surname@gatesfoundation.com>
24
+ * Mojaloop Foundation
25
+ - Name Surname <name.surname@mojaloop.io>
26
26
 
27
27
  * INFITX
28
28
  - Steven Oderayi <steven.oderayi@infitx.com>
@@ -17,12 +17,12 @@
17
17
  should be listed with a '*' in the first column. People who have
18
18
  contributed from an organization can be listed under the organization
19
19
  that actually holds the copyright for their contributions (see the
20
- Gates Foundation organization for an example). Those individuals should have
20
+ Mojaloop Foundation organization for an example). Those individuals should have
21
21
  their names indented and be marked with a '-'. Email address can be added
22
22
  optionally within square brackets <email>.
23
23
 
24
- * Gates Foundation
25
- - Name Surname <name.surname@gatesfoundation.com>
24
+ * Mojaloop Foundation
25
+ - Name Surname <name.surname@mojaloop.io>
26
26
 
27
27
  * INFITX
28
28
  - Steven Oderayi <steven.oderayi@infitx.com>
@@ -17,12 +17,12 @@
17
17
  should be listed with a '*' in the first column. People who have
18
18
  contributed from an organization can be listed under the organization
19
19
  that actually holds the copyright for their contributions (see the
20
- Gates Foundation organization for an example). Those individuals should have
20
+ Mojaloop Foundation organization for an example). Those individuals should have
21
21
  their names indented and be marked with a '-'. Email address can be added
22
22
  optionally within square brackets <email>.
23
23
 
24
- * Gates Foundation
25
- - Name Surname <name.surname@gatesfoundation.com>
24
+ * Mojaloop Foundation
25
+ - Name Surname <name.surname@mojaloop.io>
26
26
 
27
27
  * INFITX
28
28
  - Steven Oderayi <steven.oderayi@infitx.com>
package/src/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /*****
2
2
  License
3
3
  --------------
4
- Copyright © 2017 Bill & Melinda Gates Foundation
5
- The Mojaloop files are made available by the Bill & Melinda Gates 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
4
+ Copyright © 2020-2025 Mojaloop Foundation
5
+ The Mojaloop files are made available by the 2020-2025 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
6
  http://www.apache.org/licenses/LICENSE-2.0
7
7
  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.
8
8
  Contributors
@@ -12,10 +12,10 @@
12
12
  should be listed with a '*' in the first column. People who have
13
13
  contributed from an organization can be listed under the organization
14
14
  that actually holds the copyright for their contributions (see the
15
- Gates Foundation organization for an example). Those individuals should have
15
+ Mojaloop Foundation organization for an example). Those individuals should have
16
16
  their names indented and be marked with a '-'. Email address can be added
17
17
  optionally within square brackets <email>.
18
- * Gates Foundation
18
+ * Mojaloop Foundation
19
19
 
20
20
  * Rajiv Mothilal <rajiv.mothilal@modusbox.com>
21
21
 
@@ -539,6 +539,8 @@ components:
539
539
  Another example of an alias is a username in the FSP system. The ALIAS identifier
540
540
  can be in any format. It is also possible to use the PartySubIdOrType element
541
541
  for identifying an account under an Alias defined by the PartyIdentifier.
542
+ - CONSENT - Third party CONSENT oracle
543
+ - THIRD_PARTY_LINK - Third party link
542
544
  enum:
543
545
  - MSISDN
544
546
  - EMAIL
@@ -548,6 +550,8 @@ components:
548
550
  - ACCOUNT_ID
549
551
  - IBAN
550
552
  - ALIAS
553
+ - CONSENT
554
+ - THIRD_PARTY_LINK
551
555
  Status:
552
556
  title: Status
553
557
  type: object