Skip to content

Commit f1e7a3d

Browse files
authored
Feature/952 Implement ML Number Library (#71)
* Implemented MLNumber library. Upgraded dependencies. Fixed Logger library. Fixed issues with standard.js. Fixed license text issues * Bump up version * npm audit fix
1 parent a60187b commit f1e7a3d

34 files changed

+2309
-1612
lines changed

app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
'use strict'
2525

2626
const setup = require('./src/setup').setup
27-
const Logger = require('@mojaloop/central-services-shared').Logger
27+
const Logger = require('@mojaloop/central-services-logger')
2828

2929
try {
3030
setup()

config/default.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
{
2+
"PORT": 3080,
23
"notificationMinutes": {
34
"resetPeriod": 60,
45
"notificationInterval": 3,
56
"oscilateEvents": ["NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL"]
67
},
7-
"PORT": 3080,
8+
"AMOUNT": {
9+
"PRECISION": 18,
10+
"SCALE": 4
11+
},
812
"centralLedgerAPI": {
913
"adminHost": "localhost",
1014
"adminPort": 3001,

package-lock.json

Lines changed: 1978 additions & 1439 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
11
{
22
"name": "central-event-processor",
3-
"version": "7.3.0",
4-
"description": "CEP for Mojaloop Central-Ledger to monitor the notificaion kafka topic and act on it.",
3+
"version": "8.2.0",
4+
"description": "CEP for Mojaloop Central-Ledger to monitor the notificaion kafka topic and act on it",
55
"main": "app.js",
66
"dependencies": {
7-
"@hapi/hapi": "18.3.1",
8-
"@mojaloop/central-services-error-handling": "7.3.0",
9-
"@mojaloop/central-services-shared": "7.2.0",
10-
"@mojaloop/central-services-stream": "6.2.2",
11-
"@mojaloop/central-services-health": "7.0.0",
12-
"bluebird": "3.5.5",
7+
"@hapi/hapi": "18.4.0",
8+
"@mojaloop/central-services-error-handling": "8.2.0",
9+
"@mojaloop/central-services-health": "8.1.1",
10+
"@mojaloop/central-services-logger": "8.1.2",
11+
"@mojaloop/central-services-shared": "8.1.5",
12+
"@mojaloop/central-services-stream": "8.1.1",
13+
"@mojaloop/ml-number": "8.2.0",
14+
"bluebird": "3.7.0",
1315
"config": "3.2.2",
1416
"healthcheck-server": "1.0.0",
15-
"json-rules-engine": "3.1.0",
17+
"json-rules-engine": "4.1.0",
1618
"leaked-handles": "5.2.0",
1719
"moment": "2.24.0",
18-
"mongoose": "5.6.9",
20+
"mongoose": "5.7.3",
1921
"mongoose-unique-validator": "2.0.3",
20-
"mustache": "3.0.1",
21-
"proxyquire": "2.1.2",
22+
"mustache": "3.1.0",
23+
"proxyquire": "2.1.3",
2224
"rc": "1.2.8",
2325
"request": "2.88.0",
2426
"request-promise": "4.2.4",
25-
"rxjs": "6.5.2",
26-
"rxjs-compat": "6.5.2",
27+
"rxjs": "6.5.3",
28+
"rxjs-compat": "6.5.3",
2729
"uuid4": "1.1.4"
2830
},
2931
"scripts": {
@@ -50,19 +52,19 @@
5052
},
5153
"homepage": "https://github.com/mojaloop/central-event-processor#readme",
5254
"devDependencies": {
53-
"bluebird": "3.5.5",
55+
"bluebird": "3.7.0",
5456
"faucet": "0.0.1",
5557
"istanbul": "1.1.0-alpha.1",
5658
"jsonpath": "1.0.2",
57-
"mockgoose": "8.0.2",
58-
"mongodb-memory-server": "5.2.0",
59-
"npm-audit-resolver": "1.5.0",
59+
"mockgoose": "8.0.3",
60+
"mongodb-memory-server": "5.2.6",
61+
"npm-audit-resolver": "2.0.1",
6062
"npm-run-all": "4.1.5",
61-
"nodemon": "1.19.1",
63+
"nodemon": "1.19.3",
6264
"rewire": "4.0.1",
63-
"sinon": "7.4.1",
65+
"sinon": "7.5.0",
6466
"sinon-mongoose": "2.3.0",
65-
"standard": "13.1.0",
67+
"standard": "14.3.1",
6668
"tape": "4.11.0",
6769
"tapes": "4.1.0",
6870
"tap-xunit": "2.4.1"

src/lib/config.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
// const RC = require('rc')('CEP', require('../../config/default.json'))
2-
const config = require('config')
3-
4-
module.exports = config
1+
module.exports = require('config')

src/lib/database.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
--------------
44
Copyright © 2017 Bill & Melinda Gates Foundation
55
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
6+
67
http://www.apache.org/licenses/LICENSE-2.0
8+
79
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.
10+
811
Contributors
912
--------------
1013
This is the official list of the Mojaloop project contributors for this file.
@@ -15,20 +18,23 @@
1518
Gates Foundation organization for an example). Those individuals should have
1619
their names indented and be marked with a '-'. Email address can be added
1720
optionally within square brackets <email>.
21+
1822
* Gates Foundation
1923
- Name Surname <[email protected]>
20-
* Valentin Genev <[email protected]>
21-
* Deon Botha <[email protected]>
24+
25+
* ModusBox
26+
- Valentin Genev <[email protected]>
27+
- Deon Botha <[email protected]>
28+
2229
--------------
2330
******/
24-
2531
'use strict'
2632

2733
/**
2834
* @module src/lib/database
2935
*/
3036
const Mongoose = require('mongoose')
31-
const Logger = require('@mojaloop/central-services-shared').Logger
37+
const Logger = require('@mojaloop/central-services-logger')
3238

3339
const config = require('../lib/config')
3440

src/lib/enum.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/*****
2-
* @file This registers all handlers for the central-ledger API
32
License
43
--------------
54
Copyright © 2017 Bill & Melinda Gates Foundation
@@ -23,7 +22,8 @@
2322
* Gates Foundation
2423
- Name Surname <[email protected]>
2524
26-
* Georgi Georgiev <[email protected]>
25+
* ModusBox
26+
- Georgi Georgiev <[email protected]>
2727
2828
--------------
2929
******/
@@ -94,31 +94,31 @@ const headers = {
9494
}
9595
const topicMap = {
9696
notification: {
97-
'prepare': {
97+
prepare: {
9898
functionality: transferEventType.NOTIFICATION,
9999
action: transferEventAction.EVENT
100100
},
101101
'prepare-duplicate': {
102102
functionality: transferEventType.NOTIFICATION,
103103
action: transferEventAction.EVENT
104104
},
105-
'commit': {
105+
commit: {
106106
functionality: transferEventType.NOTIFICATION,
107107
action: transferEventAction.EVENT
108108
},
109-
'abort': {
109+
abort: {
110110
functionality: transferEventType.NOTIFICATION,
111111
action: transferEventAction.EVENT
112112
},
113113
'timeout-received': {
114114
functionality: transferEventType.NOTIFICATION,
115115
action: transferEventAction.EVENT
116116
},
117-
'reject': {
117+
reject: {
118118
functionality: transferEventType.NOTIFICATION,
119119
action: transferEventAction.EVENT
120120
},
121-
'get': {
121+
get: {
122122
functionality: transferEventType.NOTIFICATION,
123123
action: transferEventAction.EVENT
124124
},

src/lib/healthCheck/subServiceHealth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
const mongoose = require('mongoose')
2828
const { statusEnum, serviceName } = require('@mojaloop/central-services-shared').HealthCheck.HealthCheckEnums
29-
const Logger = require('@mojaloop/central-services-shared').Logger
29+
const Logger = require('@mojaloop/central-services-logger')
3030

3131
const Consumer = require('../kafka/consumer')
3232

src/lib/kafka/consumer.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,24 @@
1717
optionally within square brackets <email>.
1818
* Gates Foundation
1919
- Name Surname <[email protected]>
20-
* Rajiv Mothilal <[email protected]>
21-
* Miguel de Barros <[email protected]>
20+
21+
* ModusBox
22+
- Rajiv Mothilal <[email protected]>
23+
- Miguel de Barros <[email protected]>
24+
2225
--------------
2326
******/
24-
2527
'use strict'
2628

2729
/**
2830
* @module src/lib/kafka/consumer
2931
*/
3032

3133
const Consumer = require('@mojaloop/central-services-stream').Kafka.Consumer
32-
const Logger = require('@mojaloop/central-services-shared').Logger
34+
const Logger = require('@mojaloop/central-services-logger')
3335
const Utility = require('../utility')
3436
const ErrorHandler = require('@mojaloop/central-services-error-handling')
35-
let listOfConsumers = {}
37+
const listOfConsumers = {}
3638

3739
/**
3840
* @function isConsumerAutoCommitEnabled

src/lib/kafka/index.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@
33
--------------
44
Copyright © 2017 Bill & Melinda Gates Foundation
55
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
6-
76
http://www.apache.org/licenses/LICENSE-2.0
8-
97
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.
10-
118
Contributors
129
--------------
1310
This is the official list of the Mojaloop project contributors for this file.
@@ -18,12 +15,12 @@
1815
Gates Foundation organization for an example). Those individuals should have
1916
their names indented and be marked with a '-'. Email address can be added
2017
optionally within square brackets <email>.
21-
2218
* Gates Foundation
2319
- Name Surname <[email protected]>
2420
25-
* Rajiv Mothilal <[email protected]>
26-
* Miguel de Barros <[email protected]>
21+
* ModusBox
22+
- Rajiv Mothilal <[email protected]>
23+
- Miguel de Barros <[email protected]>
2724
2825
--------------
2926
******/

0 commit comments

Comments
 (0)