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.
- package/.circleci/config.yml +2 -1
- package/CHANGELOG.md +24 -0
- package/docker-compose.yml +8 -2
- package/jest.config.js +1 -0
- package/migrations/01_currency.js +5 -5
- package/migrations/02_endpointType.js +5 -5
- package/migrations/03_endpointType-indexes.js +5 -5
- package/migrations/04_partyIdType.js +5 -5
- package/migrations/05_partyIdType-indexes.js +5 -5
- package/migrations/08_oracleEndpoint.js +5 -5
- package/migrations/09_oracleEndpoint-indexes.js +5 -5
- package/migrations/10_oracleEndpoint-remove-constraints.js +5 -5
- package/package.json +17 -16
- package/scripts/_wait4_all.js +3 -1
- package/seeds/currency.js +5 -5
- package/seeds/endpointType.js +4 -4
- package/seeds/partyIdType.js +4 -4
- package/src/api/endpointcache.js +4 -4
- package/src/api/health.js +4 -4
- package/src/api/index.js +4 -4
- package/src/api/oracles/{ID}.js +31 -6
- package/src/api/oracles.js +33 -7
- package/src/api/participants/{ID}/error.js +5 -5
- package/src/api/participants/{ID}.js +5 -5
- package/src/api/participants/{Type}/{ID}/error.js +22 -6
- package/src/api/participants/{Type}/{ID}/{SubId}/error.js +5 -5
- package/src/api/participants/{Type}/{ID}/{SubId}.js +99 -5
- package/src/api/participants/{Type}/{ID}.js +83 -10
- package/src/api/participants.js +19 -6
- package/src/api/parties/{Type}/{ID}/error.js +20 -6
- package/src/api/parties/{Type}/{ID}/{SubId}/error.js +32 -7
- package/src/api/parties/{Type}/{ID}/{SubId}.js +55 -7
- package/src/api/parties/{Type}/{ID}.js +37 -10
- package/src/api/routes.js +5 -5
- package/src/domain/oracle/index.js +5 -5
- package/src/domain/oracle/oracle.js +11 -45
- package/src/domain/participants/index.js +5 -5
- package/src/domain/participants/participants.js +20 -59
- package/src/domain/parties/getPartiesByTypeAndID.js +9 -14
- package/src/domain/parties/index.js +5 -5
- package/src/domain/parties/parties.js +12 -23
- package/src/domain/timeout/dto.js +14 -2
- package/src/domain/timeout/index.js +6 -12
- package/src/handlers/TimeoutHandler.js +3 -3
- package/src/handlers/index.js +3 -3
- package/src/handlers/register.js +3 -3
- package/src/index.js +4 -4
- package/src/interface/admin-swagger.yaml +4 -0
- package/src/interface/admin_swagger.json +902 -900
- package/src/interface/api_swagger.json +2824 -2824
- package/src/interface/thirdparty/admin-swagger.yaml +2 -2
- package/src/interface/thirdparty/admin_swagger.json +902 -902
- package/src/interface/thirdparty/api_swagger.json +2917 -2917
- package/src/lib/argv.js +5 -5
- package/src/lib/cache.js +5 -5
- package/src/lib/config.js +5 -5
- package/src/lib/db.js +5 -5
- package/src/lib/headers.js +5 -5
- package/src/lib/healthCheck/subServiceHealth.js +5 -5
- package/src/lib/util.js +20 -2
- package/src/models/currency/currency.js +7 -16
- package/src/models/currency/index.js +5 -5
- package/src/models/endpointType/endpointType.js +7 -16
- package/src/models/endpointType/index.js +5 -5
- package/src/models/misc/migrationLock.js +5 -5
- package/src/models/oracle/facade.js +5 -5
- package/src/models/oracle/index.js +5 -5
- package/src/models/oracle/oracleEndpoint.js +17 -71
- package/src/models/oracle/oracleEndpointCached.js +5 -5
- package/src/models/participantEndpoint/facade.js +5 -5
- package/src/models/partyIdType/index.js +5 -5
- package/src/models/partyIdType/partyIdType.js +7 -16
- package/src/plugins.js +4 -4
- package/src/server.js +8 -12
- package/test/integration/api/parties.test.js +5 -5
- package/test/integration/domain/oracle/index.test.js +23 -5
- package/test/integration/domain/timeout/index.test.js +1 -1
- package/test/integration/models/currency/currency.test.js +5 -5
- package/test/integration/plugins.test.js +5 -5
- package/test/unit/api/health.test.js +5 -5
- package/test/unit/api/oracles/{ID}.test.js +5 -5
- package/test/unit/api/oracles.test.js +5 -5
- package/test/unit/api/participants/participants.test.js +5 -5
- package/test/unit/api/participants/{Type}/{ID}/error.test.js +7 -5
- package/test/unit/api/participants/{Type}/{ID}/{SubId}/error.test.js +5 -5
- package/test/unit/api/participants/{Type}/{ID}/{SubId}.test.js +5 -5
- package/test/unit/api/participants/{Type}/{ID}.test.js +5 -5
- package/test/unit/api/participants.test.js +5 -5
- package/test/unit/api/parties/endpointcache.test.js +5 -5
- package/test/unit/api/parties/parties.test.js +5 -5
- package/test/unit/api/parties/{Type}/{ID}/error.test.js +8 -6
- package/test/unit/api/parties/{Type}/{ID}/{SubId}/error.test.js +15 -5
- package/test/unit/api/parties/{Type}/{ID}/{SubId}.test.js +5 -5
- package/test/unit/api/parties/{Type}/{ID}.test.js +5 -5
- package/test/unit/domain/oracle/oracle.test.js +5 -5
- package/test/unit/domain/participants/participants.test.js +6 -6
- package/test/unit/domain/parties/parties.test.js +8 -8
- package/test/unit/domain/parties/utils.test.js +5 -5
- package/test/unit/domain/timeout/index.test.js +3 -3
- package/test/unit/handlers/TimeoutHandler.test.js +3 -3
- package/test/unit/handlers/index.test.js +3 -3
- package/test/unit/handlers/register.test.js +3 -3
- package/test/unit/index.test.js +5 -5
- package/test/unit/iso20022/partiesValidation.test.js +5 -5
- package/test/unit/lib/argv.test.js +5 -5
- package/test/unit/lib/config.test.js +5 -5
- package/test/unit/lib/healthCheck/subServiceHealth.test.js +5 -5
- package/test/unit/lib/migrator.test.js +5 -5
- package/test/unit/lib/util.test.js +5 -5
- package/test/unit/mocks.js +3 -3
- package/test/unit/models/currency/currency.test.js +5 -5
- package/test/unit/models/endpointType/endpointType.test.js +5 -5
- package/test/unit/models/misc/migrationLock.test.js +5 -5
- package/test/unit/models/oracle/facade.test.js +5 -5
- package/test/unit/models/oracle/oracleEndpoint.test.js +5 -5
- package/test/unit/models/oracle/oracleEndpointCached.test.js +5 -5
- package/test/unit/models/participantEndpoint/facade.test.js +5 -5
- package/test/unit/models/partyIdType/partyIdType.test.js +5 -5
- package/test/unit/plugins.test.js +5 -5
- package/test/util/helper.js +5 -5
- package/test/util/mockgen.js +5 -5
- package/test/util/testConfig.js +5 -5
@@ -1,8 +1,8 @@
|
|
1
1
|
/*****
|
2
2
|
License
|
3
3
|
--------------
|
4
|
-
Copyright ©
|
5
|
-
The Mojaloop files are made available by the
|
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
|
-
|
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
|
-
*
|
19
|
-
* Name Surname <name.surname@
|
18
|
+
* Mojaloop Foundation
|
19
|
+
* Name Surname <name.surname@mojaloop.io>
|
20
20
|
|
21
21
|
* Rajiv Mothilal <rajiv.mothilal@modusbox.com>
|
22
22
|
|
@@ -25,6 +25,8 @@
|
|
25
25
|
'use strict'
|
26
26
|
|
27
27
|
const Enum = require('@mojaloop/central-services-shared').Enum
|
28
|
+
const EventFrameworkUtil = require('@mojaloop/central-services-shared').Util.EventFramework
|
29
|
+
const EventSdk = require('@mojaloop/event-sdk')
|
28
30
|
const LibUtil = require('../../../../../lib/util')
|
29
31
|
const parties = require('../../../../../domain/parties')
|
30
32
|
const Metrics = require('@mojaloop/central-services-metrics')
|
@@ -40,15 +42,38 @@ module.exports = {
|
|
40
42
|
* produces: application/json
|
41
43
|
* responses: 200, 400, 401, 403, 404, 405, 406, 501, 503
|
42
44
|
*/
|
43
|
-
put: function (context, request, h) {
|
45
|
+
put: async function (context, request, h) {
|
44
46
|
const histTimerEnd = Metrics.getHistogram(
|
45
47
|
'ing_putPartiesErrorByTypeIDAndSubID',
|
46
48
|
'Ingress - Put parties error by Type, ID and SubId',
|
47
49
|
['success']
|
48
50
|
).startTimer()
|
49
51
|
const { cache, proxyCache } = request.server.app
|
52
|
+
|
53
|
+
const { headers, payload, method, path, params, span } = request
|
54
|
+
const spanTags = LibUtil.getSpanTags(request, Enum.Events.Event.Type.PARTY, Enum.Events.Event.Action.PUT)
|
55
|
+
span.setTags(spanTags)
|
56
|
+
const queryTags = EventFrameworkUtil.Tags.getQueryTags(
|
57
|
+
Enum.Tags.QueryTags.serviceName.accountLookupService,
|
58
|
+
Enum.Tags.QueryTags.auditType.transactionFlow,
|
59
|
+
Enum.Tags.QueryTags.contentType.httpRequest,
|
60
|
+
Enum.Tags.QueryTags.operation.putPartiesErrorByTypeIDAndSubID,
|
61
|
+
{
|
62
|
+
httpMethod: method,
|
63
|
+
httpPath: path,
|
64
|
+
partyIdType: params.Type,
|
65
|
+
partyIdentifier: params.ID,
|
66
|
+
partySubIdOrType: params.SubId
|
67
|
+
}
|
68
|
+
)
|
69
|
+
span.setTags(queryTags)
|
70
|
+
await span.audit({
|
71
|
+
headers,
|
72
|
+
payload
|
73
|
+
}, EventSdk.AuditEventAction.start)
|
74
|
+
|
50
75
|
parties.putPartiesErrorByTypeAndID(request.headers, request.params, request.payload, request.dataUri, request.span, cache, proxyCache).catch(err => {
|
51
|
-
request.server.log(['error'], `ERROR -
|
76
|
+
request.server.log(['error'], `ERROR - putPartiesErrorByTypeIDAndSubID: ${LibUtil.getStackOrInspect(err)}`)
|
52
77
|
})
|
53
78
|
histTimerEnd({ success: true })
|
54
79
|
return h.response().code(Enum.Http.ReturnCodes.OK.CODE)
|
@@ -1,8 +1,8 @@
|
|
1
1
|
/*****
|
2
2
|
License
|
3
3
|
--------------
|
4
|
-
Copyright ©
|
5
|
-
The Mojaloop files are made available by the
|
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
|
-
|
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
|
-
*
|
19
|
-
* Name Surname <name.surname@
|
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>
|
@@ -26,6 +26,8 @@
|
|
26
26
|
'use strict'
|
27
27
|
|
28
28
|
const Enum = require('@mojaloop/central-services-shared').Enum
|
29
|
+
const EventFrameworkUtil = require('@mojaloop/central-services-shared').Util.EventFramework
|
30
|
+
const EventSdk = require('@mojaloop/event-sdk')
|
29
31
|
const LibUtil = require('../../../../lib/util')
|
30
32
|
const parties = require('../../../../domain/parties')
|
31
33
|
const Metrics = require('@mojaloop/central-services-metrics')
|
@@ -41,13 +43,36 @@ module.exports = {
|
|
41
43
|
* produces: application/json
|
42
44
|
* responses: 202, 400, 401, 403, 404, 405, 406, 501, 503
|
43
45
|
*/
|
44
|
-
get: function (context, request, h) {
|
46
|
+
get: async function (context, request, h) {
|
45
47
|
const histTimerEnd = Metrics.getHistogram(
|
46
48
|
'ing_getPartiesByTypeIDAndSubID',
|
47
49
|
'Ingress - Get party by Type, ID and SubId',
|
48
50
|
['success']
|
49
51
|
).startTimer()
|
50
52
|
const { cache, proxyCache } = request.server.app
|
53
|
+
|
54
|
+
const { headers, payload, method, path, params, span } = request
|
55
|
+
const spanTags = LibUtil.getSpanTags(request, Enum.Events.Event.Type.PARTY, Enum.Events.Event.Action.GET)
|
56
|
+
span.setTags(spanTags)
|
57
|
+
const queryTags = EventFrameworkUtil.Tags.getQueryTags(
|
58
|
+
Enum.Tags.QueryTags.serviceName.accountLookupService,
|
59
|
+
Enum.Tags.QueryTags.auditType.transactionFlow,
|
60
|
+
Enum.Tags.QueryTags.contentType.httpRequest,
|
61
|
+
Enum.Tags.QueryTags.operation.getPartiesByTypeIDAndSubID,
|
62
|
+
{
|
63
|
+
httpMethod: method,
|
64
|
+
httpPath: path,
|
65
|
+
partyIdType: params.Type,
|
66
|
+
partyIdentifier: params.ID,
|
67
|
+
partySubIdOrType: params.SubId
|
68
|
+
}
|
69
|
+
)
|
70
|
+
span.setTags(queryTags)
|
71
|
+
await span.audit({
|
72
|
+
headers,
|
73
|
+
payload
|
74
|
+
}, EventSdk.AuditEventAction.start)
|
75
|
+
|
51
76
|
parties.getPartiesByTypeAndID(request.headers, request.params, request.method, request.query, request.span, cache, proxyCache).catch(err => {
|
52
77
|
request.server.log(['error'], `ERROR - getPartiesByTypeAndID: ${LibUtil.getStackOrInspect(err)}`)
|
53
78
|
})
|
@@ -61,13 +86,36 @@ module.exports = {
|
|
61
86
|
* produces: application/json
|
62
87
|
* responses: 200, 400, 401, 403, 404, 405, 406, 501, 503
|
63
88
|
*/
|
64
|
-
put: function (context, request, h) {
|
89
|
+
put: async function (context, request, h) {
|
65
90
|
const histTimerEnd = Metrics.getHistogram(
|
66
91
|
'ing_putPartiesByTypeIDAndSubID',
|
67
92
|
'Ingress - Put parties by Type, ID and SubId',
|
68
93
|
['success']
|
69
94
|
).startTimer()
|
70
95
|
const { cache, proxyCache } = request.server.app
|
96
|
+
|
97
|
+
const { headers, payload, method, path, params, span } = request
|
98
|
+
const spanTags = LibUtil.getSpanTags(request, Enum.Events.Event.Type.PARTY, Enum.Events.Event.Action.PUT)
|
99
|
+
span.setTags(spanTags)
|
100
|
+
const queryTags = EventFrameworkUtil.Tags.getQueryTags(
|
101
|
+
Enum.Tags.QueryTags.serviceName.accountLookupService,
|
102
|
+
Enum.Tags.QueryTags.auditType.transactionFlow,
|
103
|
+
Enum.Tags.QueryTags.contentType.httpRequest,
|
104
|
+
Enum.Tags.QueryTags.operation.putPartiesByTypeIDAndSubID,
|
105
|
+
{
|
106
|
+
httpMethod: method,
|
107
|
+
httpPath: path,
|
108
|
+
partyIdType: params.Type,
|
109
|
+
partyIdentifier: params.ID,
|
110
|
+
partySubIdOrType: params.SubId
|
111
|
+
}
|
112
|
+
)
|
113
|
+
span.setTags(queryTags)
|
114
|
+
await span.audit({
|
115
|
+
headers,
|
116
|
+
payload
|
117
|
+
}, EventSdk.AuditEventAction.start)
|
118
|
+
|
71
119
|
parties.putPartiesByTypeAndID(request.headers, request.params, request.method, request.payload, request.dataUri, cache, proxyCache).catch(err => {
|
72
120
|
request.server.log(['error'], `ERROR - putPartiesByTypeAndID: ${LibUtil.getStackOrInspect(err)}`)
|
73
121
|
})
|
@@ -1,8 +1,8 @@
|
|
1
1
|
/*****
|
2
2
|
License
|
3
3
|
--------------
|
4
|
-
Copyright ©
|
5
|
-
The Mojaloop files are made available by the
|
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
|
-
|
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
|
-
*
|
19
|
-
* Name Surname <name.surname@
|
18
|
+
* Mojaloop Foundation
|
19
|
+
* Name Surname <name.surname@mojaloop.io>
|
20
20
|
|
21
21
|
* Rajiv Mothilal <rajiv.mothilal@modusbox.com>
|
22
22
|
|
@@ -24,7 +24,8 @@
|
|
24
24
|
******/
|
25
25
|
'use strict'
|
26
26
|
|
27
|
-
const
|
27
|
+
const Enum = require('@mojaloop/central-services-shared').Enum
|
28
|
+
const EventFrameworkUtil = require('@mojaloop/central-services-shared').Util.EventFramework
|
28
29
|
const EventSdk = require('@mojaloop/event-sdk')
|
29
30
|
const Metrics = require('@mojaloop/central-services-metrics')
|
30
31
|
const parties = require('../../../domain/parties')
|
@@ -47,11 +48,24 @@ module.exports = {
|
|
47
48
|
'Ingress - Get party by Type and Id',
|
48
49
|
['success']
|
49
50
|
).startTimer()
|
50
|
-
const { headers, payload,
|
51
|
+
const { headers, payload, method, path, params, query, span } = request
|
51
52
|
const { cache, proxyCache } = request.server.app
|
52
53
|
|
53
|
-
const spanTags = LibUtil.getSpanTags({ headers }, Type.PARTY, Action.LOOKUP)
|
54
|
+
const spanTags = LibUtil.getSpanTags({ headers }, Enum.Events.Event.Type.PARTY, Enum.Events.Event.Action.LOOKUP)
|
54
55
|
span.setTags(spanTags)
|
56
|
+
const queryTags = EventFrameworkUtil.Tags.getQueryTags(
|
57
|
+
Enum.Tags.QueryTags.serviceName.accountLookupService,
|
58
|
+
Enum.Tags.QueryTags.auditType.transactionFlow,
|
59
|
+
Enum.Tags.QueryTags.contentType.httpRequest,
|
60
|
+
Enum.Tags.QueryTags.operation.getPartiesByTypeAndID,
|
61
|
+
{
|
62
|
+
httpMethod: method,
|
63
|
+
httpPath: path,
|
64
|
+
partyIdType: params.Type,
|
65
|
+
partyIdentifier: params.ID
|
66
|
+
}
|
67
|
+
)
|
68
|
+
span.setTags(queryTags)
|
55
69
|
await span.audit({
|
56
70
|
headers,
|
57
71
|
payload
|
@@ -78,11 +92,24 @@ module.exports = {
|
|
78
92
|
'Ingress - Put party by Type and Id',
|
79
93
|
['success']
|
80
94
|
).startTimer()
|
81
|
-
const { headers, payload,
|
95
|
+
const { headers, payload, method, path, params, dataUri, span } = request
|
82
96
|
const { cache, proxyCache } = request.server.app
|
83
97
|
|
84
|
-
const spanTags = LibUtil.getSpanTags({ headers }, Type.PARTY, Action.PUT)
|
98
|
+
const spanTags = LibUtil.getSpanTags({ headers }, Enum.Events.Event.Type.PARTY, Enum.Events.Event.Action.PUT)
|
85
99
|
span.setTags(spanTags)
|
100
|
+
const queryTags = EventFrameworkUtil.Tags.getQueryTags(
|
101
|
+
Enum.Tags.QueryTags.serviceName.accountLookupService,
|
102
|
+
Enum.Tags.QueryTags.auditType.transactionFlow,
|
103
|
+
Enum.Tags.QueryTags.contentType.httpRequest,
|
104
|
+
Enum.Tags.QueryTags.operation.putPartiesByTypeAndID,
|
105
|
+
{
|
106
|
+
httpMethod: method,
|
107
|
+
httpPath: path,
|
108
|
+
partyIdType: params.Type,
|
109
|
+
partyIdentifier: params.ID
|
110
|
+
}
|
111
|
+
)
|
112
|
+
span.setTags(queryTags)
|
86
113
|
await span.audit({
|
87
114
|
headers,
|
88
115
|
payload
|
package/src/api/routes.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
/*****
|
2
2
|
License
|
3
3
|
--------------
|
4
|
-
Copyright ©
|
5
|
-
The Mojaloop files are made available by the
|
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
|
-
|
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
|
-
*
|
19
|
-
- Name Surname <name.surname@
|
18
|
+
* Mojaloop Foundation
|
19
|
+
- Name Surname <name.surname@mojaloop.io>
|
20
20
|
|
21
21
|
* ModusBox
|
22
22
|
- Steven Oderayi <steven.oderayi@modusbox.com>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
/*****
|
2
2
|
License
|
3
3
|
--------------
|
4
|
-
Copyright ©
|
5
|
-
The Mojaloop files are made available by the
|
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
|
-
|
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
|
-
*
|
19
|
-
- Name Surname <name.surname@
|
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 ©
|
5
|
-
The Mojaloop files are made available by the
|
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,14 +12,14 @@
|
|
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
|
-
|
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
|
-
*
|
19
|
-
- Name Surname <name.surname@
|
18
|
+
* Mojaloop Foundation
|
19
|
+
- Name Surname <name.surname@mojaloop.io>
|
20
20
|
|
21
21
|
- Rajiv Mothilal <rajiv.mothilal@modusbox.com>
|
22
|
-
- Name Surname <name.surname@
|
22
|
+
- Name Surname <name.surname@mojaloop.io>
|
23
23
|
|
24
24
|
--------------
|
25
25
|
******/
|
@@ -35,6 +35,7 @@ const cachedOracleEndpoint = require('../../models/oracle/oracleEndpointCached')
|
|
35
35
|
const partyIdType = require('../../models/partyIdType')
|
36
36
|
const endpointType = require('../../models/endpointType')
|
37
37
|
const currency = require('../../models/currency')
|
38
|
+
const util = require('../../lib/util')
|
38
39
|
|
39
40
|
/**
|
40
41
|
* @function createOracle
|
@@ -49,7 +50,6 @@ exports.createOracle = async (payload) => {
|
|
49
50
|
'Create Oracle',
|
50
51
|
['success']
|
51
52
|
).startTimer()
|
52
|
-
const errorCounter = Metrics.getCounter('errorCount')
|
53
53
|
let step
|
54
54
|
|
55
55
|
try {
|
@@ -91,15 +91,7 @@ exports.createOracle = async (payload) => {
|
|
91
91
|
histTimerEnd({ success: false })
|
92
92
|
Logger.isErrorEnabled && Logger.error(err)
|
93
93
|
const fspiopError = ErrorHandler.Factory.reformatFSPIOPError(err)
|
94
|
-
|
95
|
-
const system = extensions.find((element) => element.key === 'system')?.value || ''
|
96
|
-
errorCounter.inc({
|
97
|
-
code: fspiopError?.apiErrorCode?.code,
|
98
|
-
system,
|
99
|
-
operation: 'createOracle',
|
100
|
-
step
|
101
|
-
})
|
102
|
-
throw fspiopError
|
94
|
+
util.rethrowAndCountFspiopError(fspiopError, { operation: 'createOracle', step })
|
103
95
|
}
|
104
96
|
}
|
105
97
|
|
@@ -116,7 +108,6 @@ exports.getOracle = async (query) => {
|
|
116
108
|
'Get Oracle',
|
117
109
|
['success']
|
118
110
|
).startTimer()
|
119
|
-
const errorCounter = Metrics.getCounter('errorCount')
|
120
111
|
let step
|
121
112
|
try {
|
122
113
|
let oracleEndpointModelList
|
@@ -160,15 +151,7 @@ exports.getOracle = async (query) => {
|
|
160
151
|
histTimerEnd({ success: false })
|
161
152
|
Logger.isErrorEnabled && Logger.error(err)
|
162
153
|
const fspiopError = ErrorHandler.Factory.reformatFSPIOPError(err)
|
163
|
-
|
164
|
-
const system = extensions.find((element) => element.key === 'system')?.value || ''
|
165
|
-
errorCounter.inc({
|
166
|
-
code: fspiopError?.apiErrorCode?.code,
|
167
|
-
system,
|
168
|
-
operation: 'getOracle',
|
169
|
-
step
|
170
|
-
})
|
171
|
-
throw fspiopError
|
154
|
+
util.rethrowAndCountFspiopError(fspiopError, { operation: 'getOracle', step })
|
172
155
|
}
|
173
156
|
}
|
174
157
|
|
@@ -186,7 +169,6 @@ exports.updateOracle = async (params, payload) => {
|
|
186
169
|
'Update Oracle',
|
187
170
|
['success']
|
188
171
|
).startTimer()
|
189
|
-
const errorCounter = Metrics.getCounter('errorCount')
|
190
172
|
let step
|
191
173
|
try {
|
192
174
|
step = 'getOracleEndpointById-1'
|
@@ -247,15 +229,7 @@ exports.updateOracle = async (params, payload) => {
|
|
247
229
|
histTimerEnd({ success: false })
|
248
230
|
Logger.isErrorEnabled && Logger.error(err)
|
249
231
|
const fspiopError = ErrorHandler.Factory.reformatFSPIOPError(err)
|
250
|
-
|
251
|
-
const system = extensions.find((element) => element.key === 'system')?.value || ''
|
252
|
-
errorCounter.inc({
|
253
|
-
code: fspiopError?.apiErrorCode?.code,
|
254
|
-
system,
|
255
|
-
operation: 'updateOracle',
|
256
|
-
step
|
257
|
-
})
|
258
|
-
throw fspiopError
|
232
|
+
util.rethrowAndCountFspiopError(fspiopError, { operation: 'updateOracle', step })
|
259
233
|
}
|
260
234
|
}
|
261
235
|
|
@@ -272,7 +246,6 @@ exports.deleteOracle = async (params) => {
|
|
272
246
|
'Delete Oracle',
|
273
247
|
['success']
|
274
248
|
).startTimer()
|
275
|
-
const errorCounter = Metrics.getCounter('errorCount')
|
276
249
|
try {
|
277
250
|
await oracleEndpoint.destroyOracleEndpointById(params.ID)
|
278
251
|
histTimerEnd({ success: true })
|
@@ -281,13 +254,6 @@ exports.deleteOracle = async (params) => {
|
|
281
254
|
histTimerEnd({ success: false })
|
282
255
|
Logger.isErrorEnabled && Logger.error(err)
|
283
256
|
const fspiopError = ErrorHandler.Factory.reformatFSPIOPError(err)
|
284
|
-
|
285
|
-
const system = extensions.find((element) => element.key === 'system')?.value || ''
|
286
|
-
errorCounter.inc({
|
287
|
-
code: fspiopError?.apiErrorCode?.code,
|
288
|
-
system,
|
289
|
-
operation: 'deleteOracle'
|
290
|
-
})
|
291
|
-
throw fspiopError
|
257
|
+
util.rethrowAndCountFspiopError(fspiopError, { operation: 'deleteOracle' })
|
292
258
|
}
|
293
259
|
}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
/*****
|
2
2
|
License
|
3
3
|
--------------
|
4
|
-
Copyright ©
|
5
|
-
The Mojaloop files are made available by the
|
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
|
-
|
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
|
-
*
|
19
|
-
- Name Surname <name.surname@
|
18
|
+
* Mojaloop Foundation
|
19
|
+
- Name Surname <name.surname@mojaloop.io>
|
20
20
|
|
21
21
|
- Rajiv Mothilal <rajiv.mothilal@modusbox.com>
|
22
22
|
|