diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..dcae267 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +charset = utf-8 + +[*.js] +indent_style = space +indent_size = 2 + +[{package.json,*.yml,*.cjson}] +indent_style = space +indent_size = 2 + +[*.md] +trim_trailing_whitespace = false diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..cf1b6bd --- /dev/null +++ b/.eslintignore @@ -0,0 +1,4 @@ +coverage +templates +docs +**/node_modules diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..52e5db5 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,29 @@ +{ + "parserOptions": { + "ecmaVersion": 9 + }, + "rules": { + "no-console": ["off"], + "indent": [ + 2, + 2 + ], + "quotes": [ + 2, + "single" + ], + "linebreak-style": [ + 2, + "unix" + ], + "semi": [ + 2, + "never" + ] + }, + "env": { + "es6": true, + "node": true + }, + "extends": "eslint:recommended" +} diff --git a/README.md b/README.md index 59732cc..516abc1 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,26 @@ # event-stream-processor ** EXPERIMENTAL** Event Stream Processor for Event Stream (logs, audits, errors, trace, etc) + +## 1. Pre-requisites + +### 1.1 Elasticsearch + +Ensure that you have created the `mojatemplate` based on the following config: [template](./config/template-mojaloop.json). + +#### 1.1.1 Create Template + ```curl + curl -X PUT "http://elasticsearch:9200/_template/mojatemplate?pretty" -H 'Content-Type: application/json' -d @config/template-mojaloop.json' + ``` + +#### 1.1.2 Delete Template +_Note: only needed if you need to remove the template_ + ```curl + curl -X DELETE "http://elasticsearch:9200/_template/mojatemplate" + ``` + + #### 1.1.3 Get Template + _Note: useful for debugging template issues_ + ```curl + curl -X GET "http://elasticsearch:9200/_template/mojatemplate" + ``` + diff --git a/app.js b/app.js index e79cb07..43d46cf 100644 --- a/app.js +++ b/app.js @@ -24,7 +24,7 @@ 'use strict' const setup = require('./src/setup').setup -const Logger = require('@mojaloop/central-services-shared').Logger +const Logger = require('@mojaloop/central-services-logger') try { setup() diff --git a/config/custom-environment-variables.json b/config/custom-environment-variables.json deleted file mode 100644 index 773e5b3..0000000 --- a/config/custom-environment-variables.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "emailSettings": { - "smtpConfig": { - "host": "MAIL_NOTIF_SMTP_HOST", - "port": "MAIL_NOTIF_SMTP_PORT", - "secureConnection": "MAIL_NOTIF_SMTP_SECURE_FLAG", - "tls": { - "ciphers":"MAIL_NOTIF_SMTP_TLS_CIPHERS" - }, - "auth": { - "user": "MAIL_NOTIF_SMTP_USER", - "pass": "MAIL_NOTIF_SMTP_PASS" - } - } - }, - "PORT": "MAIL_NOTIF_PORT" -} \ No newline at end of file diff --git a/config/default.json b/config/default.json index f1cb381..f8a15c6 100644 --- a/config/default.json +++ b/config/default.json @@ -7,9 +7,18 @@ "requireAckResponse": true, "namespace": "logstash" }, - "apm": { + "EFK_CLIENT": { + "host": "dev1-elasticsearch.mojaloop.live", + "log": "trace", + "index": { + "name": "mojaloop", + "template": "{{index}}-{{date}}" + } + }, + "APM": { "serviceName": "event-stream-processor", - "serverUrl": "http://dev1-apm.mojaloop.live:80" + "serverUrl": "http://dev1-apm.mojaloop.live:80", + "captureErrorLogStackTraces": "never" }, "PORT": 3082, "KAFKA": { @@ -45,6 +54,7 @@ "options": { "mode": 2, "batchSize": 1, + "pollFrequency": 10, "recursiveTimeout": 100, "messageCharset": "utf8", "messageAsJSON": true, @@ -55,16 +65,7 @@ "client.id": "cep-event-mediation", "group.id": "cep-event-mediation-group", "metadata.broker.list": "localhost:9092", - "socket.blocking.max.ms": 1, - "fetch.wait.max.ms": 1, - "fetch.error.backoff.ms": 1, - "queue.buffering.max.ms": 1, - "broker.version.fallback": "0.10.1.0", - "api.version.request": true, - "enable.auto.commit": false, - "auto.commit.interval.ms": 200, - "socket.keepalive.enable": true, - "socket.max.fails": 1 + "socket.keepalive.enable": true }, "topicConf": { "auto.offset.reset": "earliest" @@ -73,4 +74,4 @@ } } } -} \ No newline at end of file +} diff --git a/config/template-mojaloop.json b/config/template-mojaloop.json new file mode 100644 index 0000000..07fe0c4 --- /dev/null +++ b/config/template-mojaloop.json @@ -0,0 +1,211 @@ +{ + "index_patterns": ["mojaloop*"], + "settings": { + "number_of_shards": 1, + "number_of_replicas": 1 + }, + "mappings": { + "_source": { + "enabled": true + }, + "properties": { + "content": { + "type": "flattened" + }, + "from": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "id": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "metadata": { + "properties": { + "event": { + "properties": { + "action": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "createdAt": { + "type": "date" + }, + "id": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "responseTo": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "state": { + "properties": { + "code": { + "type": "long" + }, + "description": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "status": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + } + } + }, + "type": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + } + } + }, + "trace": { + "properties": { + "finishTimestamp": { + "type": "date" + }, + "parentSpanId": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "service": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "spanId": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "startTimestamp": { + "type": "date" + }, + "tags": { + "properties": { + "parentEventAction": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "parentEventType": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "transctionId": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "transctionType": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + } + } + }, + "traceId": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + } + } + } + } + }, + "to": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "type": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + } + } + } +} diff --git a/package-lock.json b/package-lock.json index 226e607..5324e85 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@mojaloop/event-stream-processor", - "version": "v7.4.0", + "version": "v8.1.0-snapshot", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -157,164 +157,652 @@ } }, "@grpc/proto-loader": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.5.1.tgz", - "integrity": "sha512-3y0FhacYAwWvyXshH18eDkUI40wT/uGio7MAegzY8lO5+wVsc19+1A7T0pPptae4kl7bdITL+0cHpnAPmryBjQ==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.5.2.tgz", + "integrity": "sha512-eBKD/FPxQoY1x6QONW2nBd54QUEyzcFP9FenujmoeDPy1rutVSHki1s/wR68F6O1QfCNDx+ayBH1O2CVNMzyyw==", "requires": { "lodash.camelcase": "^4.3.0", "protobufjs": "^6.8.6" } }, - "@modusbox/mojaloop-sdk-standard-components": { - "version": "0.0.36", - "resolved": "https://registry.npmjs.org/@modusbox/mojaloop-sdk-standard-components/-/mojaloop-sdk-standard-components-0.0.36.tgz", - "integrity": "sha512-wtRm+BOvImnkSaq2UkAWWj3SWaSR2c6l8ibrNWNfZXJaGmcaWb+T+caue/XYGTtQyOjL1+q5Qe4P8ppfc6ZRBA==", + "@hapi/accept": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@hapi/accept/-/accept-3.2.3.tgz", + "integrity": "sha512-qEzsOJkCAJZxwj3iF83bSG9Lxy8Bpbrt8mRLNdvSALT6vlU2cYh6ZEHKEZPy4h/Mo31Su3j0rJgFF91+W1RWDQ==", "requires": { - "base64url": "^3.0.1", - "ilp-packet": "2.2.0", - "jsonwebtoken": "^8.5.1", - "jws": "^3.2.2", - "request": "^2.34", - "request-promise-native": "^1.0.7" + "@hapi/boom": "7.x.x", + "@hapi/hoek": "8.x.x" + }, + "dependencies": { + "@hapi/hoek": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.2.4.tgz", + "integrity": "sha512-Ze5SDNt325yZvNO7s5C4fXDscjJ6dcqLFXJQ/M7dZRQCewuDj2iDUuBi6jLQt+APbW9RjjVEvLr35FXuOEqjow==" + } } }, - "@mojaloop/central-services-error-handling": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/@mojaloop/central-services-error-handling/-/central-services-error-handling-0.5.1.tgz", - "integrity": "sha512-IdDCVdD5RfNi/n5xUJBlm5u4kp8WI+Qaq0lB2cdPtuC+gMx2BmuDIQPCQj7RRKAeOe1fx1qIgS+WXVgEStqhGw==", + "@hapi/address": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@hapi/address/-/address-2.1.1.tgz", + "integrity": "sha512-DYuHzu978pP1XW1GD3HGvLnAFjbQTIgc2+V153FGkbS2pgo9haigCdwBnUDrbhaOkgiJlbZvoEqDrcxSLHpiWA==" + }, + "@hapi/ammo": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@hapi/ammo/-/ammo-3.1.1.tgz", + "integrity": "sha512-NYFK27VSPGyQ/KmOQedpQH4PSjE7awLntepX68vrYtRvuJO21W1kX0bK2p3C+6ltUwtCQSvmNT8a4uMVAysC6Q==", "requires": { - "@mojaloop/central-services-shared": "0.4.0" + "@hapi/hoek": "8.x.x" }, "dependencies": { - "@mojaloop/central-services-shared": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@mojaloop/central-services-shared/-/central-services-shared-0.4.0.tgz", - "integrity": "sha512-bqPVrgxgxdKH5G+oLnGEXf5JiCUWvJj1InIxhhbF7jsu9+7h9HBK2+zBwThzXFLEcq/SouZ+fKgpLrTAQEr7fA==", - "requires": { - "winston": "^2.4.0" - } + "@hapi/hoek": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.2.4.tgz", + "integrity": "sha512-Ze5SDNt325yZvNO7s5C4fXDscjJ6dcqLFXJQ/M7dZRQCewuDj2iDUuBi6jLQt+APbW9RjjVEvLr35FXuOEqjow==" } } }, - "@mojaloop/central-services-shared": { - "version": "3.7.1-snapshot", - "resolved": "https://registry.npmjs.org/@mojaloop/central-services-shared/-/central-services-shared-3.7.1-snapshot.tgz", - "integrity": "sha512-5n5x0gRUnAhfoQp00uYODWM4oORwANH27uM3z7eRhgV7XiyXi42oeCfeFHekTDN/lPa3dT36/FoEynco9d4Hvw==", + "@hapi/b64": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@hapi/b64/-/b64-4.2.1.tgz", + "integrity": "sha512-zqHpQuH5CBMw6hADzKfU/IGNrxq1Q+/wTYV+OiZRQN9F3tMyk+9BUMeBvFRMamduuqL8iSp62QAnJ+7ATiYLWA==", "requires": { - "async": "2.6.0", - "bluebird": "3.5.1", - "debug": "3.1.0", - "events": "3.0.0", - "node-rdkafka": "2.4.2", - "winston": "2.4.0" + "@hapi/hoek": "8.x.x" }, "dependencies": { - "async": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", - "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", + "@hapi/hoek": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.2.4.tgz", + "integrity": "sha512-Ze5SDNt325yZvNO7s5C4fXDscjJ6dcqLFXJQ/M7dZRQCewuDj2iDUuBi6jLQt+APbW9RjjVEvLr35FXuOEqjow==" + } + } + }, + "@hapi/boom": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@hapi/boom/-/boom-7.4.2.tgz", + "integrity": "sha512-T2CYcTI0AqSvC6YC7keu/fh9LVSMzfoMLharBnPbOwmc+Cexj9joIc5yNDKunaxYq9LPuOwMS0f2B3S1tFQUNw==", + "requires": { + "@hapi/hoek": "6.x.x" + } + }, + "@hapi/bounce": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@hapi/bounce/-/bounce-1.3.1.tgz", + "integrity": "sha512-/ecFQTRBom2MEbjMHvKKE6FZ/e1gYK72CeUIFzz++dKK1kYJ0KbRJ72mXroWoTT2hIv+8H0ua/eOkO0+hRdHcw==", + "requires": { + "@hapi/boom": "7.x.x", + "@hapi/hoek": "8.x.x" + }, + "dependencies": { + "@hapi/hoek": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.2.4.tgz", + "integrity": "sha512-Ze5SDNt325yZvNO7s5C4fXDscjJ6dcqLFXJQ/M7dZRQCewuDj2iDUuBi6jLQt+APbW9RjjVEvLr35FXuOEqjow==" + } + } + }, + "@hapi/bourne": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@hapi/bourne/-/bourne-1.3.2.tgz", + "integrity": "sha512-1dVNHT76Uu5N3eJNTYcvxee+jzX4Z9lfciqRRHCU27ihbUcYi+iSc2iml5Ke1LXe1SyJCLA0+14Jh4tXJgOppA==" + }, + "@hapi/call": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@hapi/call/-/call-5.1.1.tgz", + "integrity": "sha512-M6fC+9+K/ZB4hIdVQ8i0kc/6J5PWlW3PEWYKAAZpw0sk+28LiRTSF8BjOWwmiIjZWWs42AnEIiFJA0YrvcDnlw==", + "requires": { + "@hapi/boom": "7.x.x", + "@hapi/hoek": "8.x.x" + }, + "dependencies": { + "@hapi/hoek": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.2.4.tgz", + "integrity": "sha512-Ze5SDNt325yZvNO7s5C4fXDscjJ6dcqLFXJQ/M7dZRQCewuDj2iDUuBi6jLQt+APbW9RjjVEvLr35FXuOEqjow==" + } + } + }, + "@hapi/catbox": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/@hapi/catbox/-/catbox-10.2.2.tgz", + "integrity": "sha512-a4KejaKqDOMdwo/PIYoAaObVMmkfkG3RS85kPqNTTURjWnIV1+rrZ938f6RCz5EbrroKbuNC0bcvAt7lAD5LNg==", + "requires": { + "@hapi/boom": "7.x.x", + "@hapi/hoek": "8.x.x", + "@hapi/joi": "15.x.x", + "@hapi/podium": "3.x.x" + }, + "dependencies": { + "@hapi/hoek": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.2.4.tgz", + "integrity": "sha512-Ze5SDNt325yZvNO7s5C4fXDscjJ6dcqLFXJQ/M7dZRQCewuDj2iDUuBi6jLQt+APbW9RjjVEvLr35FXuOEqjow==" + } + } + }, + "@hapi/catbox-memory": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@hapi/catbox-memory/-/catbox-memory-4.1.1.tgz", + "integrity": "sha512-T6Hdy8DExzG0jY7C8yYWZB4XHfc0v+p1EGkwxl2HoaPYAmW7I3E59M/IvmSVpis8RPcIoBp41ZpO2aZPBpM2Ww==", + "requires": { + "@hapi/boom": "7.x.x", + "@hapi/hoek": "8.x.x" + }, + "dependencies": { + "@hapi/hoek": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.2.4.tgz", + "integrity": "sha512-Ze5SDNt325yZvNO7s5C4fXDscjJ6dcqLFXJQ/M7dZRQCewuDj2iDUuBi6jLQt+APbW9RjjVEvLr35FXuOEqjow==" + } + } + }, + "@hapi/content": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@hapi/content/-/content-4.1.0.tgz", + "integrity": "sha512-hv2Czsl49hnWDEfRZOFow/BmYbKyfEknmk3k83gOp6moFn5ceHB4xVcna8OwsGfy8dxO81lhpPy+JgQEaU4SWw==", + "requires": { + "@hapi/boom": "7.x.x" + } + }, + "@hapi/cryptiles": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@hapi/cryptiles/-/cryptiles-4.2.0.tgz", + "integrity": "sha512-P+ioMP1JGhwDOKPRuQls6sT/ln6Fk+Ks6d90mlBi6HcOu5itvdUiFv5Ynq2DvLadPDWaA43lwNxkfZrjE9s2MA==", + "requires": { + "@hapi/boom": "7.x.x" + } + }, + "@hapi/file": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@hapi/file/-/file-1.0.0.tgz", + "integrity": "sha512-Bsfp/+1Gyf70eGtnIgmScvrH8sSypO3TcK3Zf0QdHnzn/ACnAkI6KLtGACmNRPEzzIy+W7aJX5E+1fc9GwIABQ==" + }, + "@hapi/formula": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@hapi/formula/-/formula-1.2.0.tgz", + "integrity": "sha512-UFbtbGPjstz0eWHb+ga/GM3Z9EzqKXFWIbSOFURU0A/Gku0Bky4bCk9/h//K2Xr3IrCfjFNhMm4jyZ5dbCewGA==" + }, + "@hapi/hapi": { + "version": "18.3.2", + "resolved": "https://registry.npmjs.org/@hapi/hapi/-/hapi-18.3.2.tgz", + "integrity": "sha512-UJogSyMPe4VFfzjQW5v2ixLvTLZLSfPs1XV/DRnAl2znzsGCaNJI+tgNxjM9lszOjEEkMfxLgoXZadk9exnIxw==", + "requires": { + "@hapi/accept": "3.x.x", + "@hapi/ammo": "3.x.x", + "@hapi/boom": "7.x.x", + "@hapi/bounce": "1.x.x", + "@hapi/call": "5.x.x", + "@hapi/catbox": "10.x.x", + "@hapi/catbox-memory": "4.x.x", + "@hapi/heavy": "6.x.x", + "@hapi/hoek": "8.x.x", + "@hapi/joi": "15.x.x", + "@hapi/mimos": "4.x.x", + "@hapi/podium": "3.x.x", + "@hapi/shot": "4.x.x", + "@hapi/somever": "2.x.x", + "@hapi/statehood": "6.x.x", + "@hapi/subtext": "6.x.x", + "@hapi/teamwork": "3.x.x", + "@hapi/topo": "3.x.x" + }, + "dependencies": { + "@hapi/hoek": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.2.4.tgz", + "integrity": "sha512-Ze5SDNt325yZvNO7s5C4fXDscjJ6dcqLFXJQ/M7dZRQCewuDj2iDUuBi6jLQt+APbW9RjjVEvLr35FXuOEqjow==" + } + } + }, + "@hapi/heavy": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@hapi/heavy/-/heavy-6.2.1.tgz", + "integrity": "sha512-uaEyC4AtGCGKt/LLBbdDQxJP1bFAbxiot6n/fwa4kyo6w8ULpXXCh8FxLlJ5mC06lqbAxQv45JyozIB6P4Dsig==", + "requires": { + "@hapi/boom": "7.x.x", + "@hapi/hoek": "8.x.x", + "@hapi/joi": "15.x.x" + }, + "dependencies": { + "@hapi/hoek": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.2.4.tgz", + "integrity": "sha512-Ze5SDNt325yZvNO7s5C4fXDscjJ6dcqLFXJQ/M7dZRQCewuDj2iDUuBi6jLQt+APbW9RjjVEvLr35FXuOEqjow==" + } + } + }, + "@hapi/hoek": { + "version": "6.2.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-6.2.4.tgz", + "integrity": "sha512-HOJ20Kc93DkDVvjwHyHawPwPkX44sIrbXazAUDiUXaY2R9JwQGo2PhFfnQtdrsIe4igjG2fPgMra7NYw7qhy0A==" + }, + "@hapi/iron": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@hapi/iron/-/iron-5.1.1.tgz", + "integrity": "sha512-QYfm6nofZ19pIxm8LR0lsANBabrdxqe0vUYKKI+0w9VdCetoove+dxfbLfduVDM72kh/RNOQG6E5/xyI826PcA==", + "requires": { + "@hapi/b64": "4.x.x", + "@hapi/boom": "7.x.x", + "@hapi/cryptiles": "4.x.x", + "@hapi/hoek": "8.x.x" + }, + "dependencies": { + "@hapi/hoek": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.2.4.tgz", + "integrity": "sha512-Ze5SDNt325yZvNO7s5C4fXDscjJ6dcqLFXJQ/M7dZRQCewuDj2iDUuBi6jLQt+APbW9RjjVEvLr35FXuOEqjow==" + } + } + }, + "@hapi/joi": { + "version": "15.1.1", + "resolved": "https://registry.npmjs.org/@hapi/joi/-/joi-15.1.1.tgz", + "integrity": "sha512-entf8ZMOK8sc+8YfeOlM8pCfg3b5+WZIKBfUaaJT8UsjAAPjartzxIYm3TIbjvA4u+u++KbcXD38k682nVHDAQ==", + "requires": { + "@hapi/address": "2.x.x", + "@hapi/bourne": "1.x.x", + "@hapi/hoek": "8.x.x", + "@hapi/topo": "3.x.x" + }, + "dependencies": { + "@hapi/hoek": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.2.4.tgz", + "integrity": "sha512-Ze5SDNt325yZvNO7s5C4fXDscjJ6dcqLFXJQ/M7dZRQCewuDj2iDUuBi6jLQt+APbW9RjjVEvLr35FXuOEqjow==" + } + } + }, + "@hapi/mimos": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@hapi/mimos/-/mimos-4.1.1.tgz", + "integrity": "sha512-CXoi/zfcTWfKYX756eEea8rXJRIb9sR4d7VwyAH9d3BkDyNgAesZxvqIdm55npQc6S9mU3FExinMAQVlIkz0eA==", + "requires": { + "@hapi/hoek": "8.x.x", + "mime-db": "1.x.x" + }, + "dependencies": { + "@hapi/hoek": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.2.4.tgz", + "integrity": "sha512-Ze5SDNt325yZvNO7s5C4fXDscjJ6dcqLFXJQ/M7dZRQCewuDj2iDUuBi6jLQt+APbW9RjjVEvLr35FXuOEqjow==" + } + } + }, + "@hapi/nigel": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@hapi/nigel/-/nigel-3.1.1.tgz", + "integrity": "sha512-R9YWx4S8yu0gcCBrMUDCiEFm1SQT895dMlYoeNBp8I6YhF1BFF1iYPueKA2Kkp9BvyHdjmvrxCOns7GMmpl+Fw==", + "requires": { + "@hapi/hoek": "8.x.x", + "@hapi/vise": "3.x.x" + }, + "dependencies": { + "@hapi/hoek": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.2.4.tgz", + "integrity": "sha512-Ze5SDNt325yZvNO7s5C4fXDscjJ6dcqLFXJQ/M7dZRQCewuDj2iDUuBi6jLQt+APbW9RjjVEvLr35FXuOEqjow==" + } + } + }, + "@hapi/pez": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@hapi/pez/-/pez-4.1.1.tgz", + "integrity": "sha512-TUa2C7Xk6J69HWrm+Ad+O6dFvdVAG0BiFUYaRsmkdWjFIfwHBCaOI1dWT/juNukSb39Lj6/mDVyjN+H4nKB3xg==", + "requires": { + "@hapi/b64": "4.x.x", + "@hapi/boom": "7.x.x", + "@hapi/content": "4.x.x", + "@hapi/hoek": "8.x.x", + "@hapi/nigel": "3.x.x" + }, + "dependencies": { + "@hapi/hoek": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.2.4.tgz", + "integrity": "sha512-Ze5SDNt325yZvNO7s5C4fXDscjJ6dcqLFXJQ/M7dZRQCewuDj2iDUuBi6jLQt+APbW9RjjVEvLr35FXuOEqjow==" + } + } + }, + "@hapi/pinpoint": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@hapi/pinpoint/-/pinpoint-1.0.2.tgz", + "integrity": "sha512-dtXC/WkZBfC5vxscazuiJ6iq4j9oNx1SHknmIr8hofarpKUZKmlUVYVIhNVzIEgK5Wrc4GMHL5lZtt1uS2flmQ==" + }, + "@hapi/podium": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/@hapi/podium/-/podium-3.4.1.tgz", + "integrity": "sha512-WbwYr5nK+GIrCdgEbN8R7Mh7z+j9AgntOLQ/YQdeLtBp+uScVmW9FoycKdNS5uweO74xwICr28Ob0DU74a2zmg==", + "requires": { + "@hapi/hoek": "8.x.x", + "@hapi/joi": "15.x.x" + }, + "dependencies": { + "@hapi/hoek": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.2.4.tgz", + "integrity": "sha512-Ze5SDNt325yZvNO7s5C4fXDscjJ6dcqLFXJQ/M7dZRQCewuDj2iDUuBi6jLQt+APbW9RjjVEvLr35FXuOEqjow==" + } + } + }, + "@hapi/shot": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@hapi/shot/-/shot-4.1.1.tgz", + "integrity": "sha512-TrsqCyaq24XcdvD0bSi26hjwyQQy5q/nzpasbPNgPLoGnxW3sCWE7ws3ba6dd6Atb8TEh9QBD7mBQDCrMMz2Ig==", + "requires": { + "@hapi/hoek": "8.x.x", + "@hapi/joi": "15.x.x" + }, + "dependencies": { + "@hapi/hoek": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.2.4.tgz", + "integrity": "sha512-Ze5SDNt325yZvNO7s5C4fXDscjJ6dcqLFXJQ/M7dZRQCewuDj2iDUuBi6jLQt+APbW9RjjVEvLr35FXuOEqjow==" + } + } + }, + "@hapi/somever": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@hapi/somever/-/somever-2.1.1.tgz", + "integrity": "sha512-cic5Sto4KGd9B0oQSdKTokju+rYhCbdpzbMb0EBnrH5Oc1z048hY8PaZ1lx2vBD7I/XIfTQVQetBH57fU51XRA==", + "requires": { + "@hapi/bounce": "1.x.x", + "@hapi/hoek": "8.x.x" + }, + "dependencies": { + "@hapi/hoek": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.2.4.tgz", + "integrity": "sha512-Ze5SDNt325yZvNO7s5C4fXDscjJ6dcqLFXJQ/M7dZRQCewuDj2iDUuBi6jLQt+APbW9RjjVEvLr35FXuOEqjow==" + } + } + }, + "@hapi/statehood": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/@hapi/statehood/-/statehood-6.1.1.tgz", + "integrity": "sha512-tMfS6B8QdrqTaKRUhHv6Ur7oPK6kcEZcnnvBK4IuaPZA9ma5UsyprTXkzbiB0V+0E56dMg3RabO1SABeZkzy6g==", + "requires": { + "@hapi/boom": "7.x.x", + "@hapi/bounce": "1.x.x", + "@hapi/bourne": "1.x.x", + "@hapi/cryptiles": "4.x.x", + "@hapi/hoek": "8.x.x", + "@hapi/iron": "5.x.x", + "@hapi/joi": "15.x.x" + }, + "dependencies": { + "@hapi/hoek": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.2.4.tgz", + "integrity": "sha512-Ze5SDNt325yZvNO7s5C4fXDscjJ6dcqLFXJQ/M7dZRQCewuDj2iDUuBi6jLQt+APbW9RjjVEvLr35FXuOEqjow==" + } + } + }, + "@hapi/subtext": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/@hapi/subtext/-/subtext-6.1.1.tgz", + "integrity": "sha512-Y7NjKFRPwlzKRw5IdwRou42hR4IBQZolT+/DlvfSr/CBjGyu38n5+9LKfNKzqB/0AVEk+xynCijsx1o1UVWX8A==", + "requires": { + "@hapi/boom": "7.x.x", + "@hapi/bourne": "1.x.x", + "@hapi/content": "4.x.x", + "@hapi/file": "1.x.x", + "@hapi/hoek": "8.x.x", + "@hapi/pez": "4.x.x", + "@hapi/wreck": "15.x.x" + }, + "dependencies": { + "@hapi/hoek": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.2.4.tgz", + "integrity": "sha512-Ze5SDNt325yZvNO7s5C4fXDscjJ6dcqLFXJQ/M7dZRQCewuDj2iDUuBi6jLQt+APbW9RjjVEvLr35FXuOEqjow==" + } + } + }, + "@hapi/teamwork": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@hapi/teamwork/-/teamwork-3.3.1.tgz", + "integrity": "sha512-61tiqWCYvMKP7fCTXy0M4VE6uNIwA0qvgFoiDubgfj7uqJ0fdHJFQNnVPGrxhLWlwz0uBPWrQlBH7r8y9vFITQ==" + }, + "@hapi/topo": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-3.1.3.tgz", + "integrity": "sha512-JmS9/vQK6dcUYn7wc2YZTqzIKubAQcJKu2KCKAru6es482U5RT5fP1EXCPtlXpiK7PR0On/kpQKI4fRKkzpZBQ==", + "requires": { + "@hapi/hoek": "8.x.x" + }, + "dependencies": { + "@hapi/hoek": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.2.4.tgz", + "integrity": "sha512-Ze5SDNt325yZvNO7s5C4fXDscjJ6dcqLFXJQ/M7dZRQCewuDj2iDUuBi6jLQt+APbW9RjjVEvLr35FXuOEqjow==" + } + } + }, + "@hapi/vise": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@hapi/vise/-/vise-3.1.1.tgz", + "integrity": "sha512-OXarbiCSadvtg+bSdVPqu31Z1JoBL+FwNYz3cYoBKQ5xq1/Cr4A3IkGpAZbAuxU5y4NL5pZFZG3d2a3ZGm/dOQ==", + "requires": { + "@hapi/hoek": "8.x.x" + }, + "dependencies": { + "@hapi/hoek": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.2.4.tgz", + "integrity": "sha512-Ze5SDNt325yZvNO7s5C4fXDscjJ6dcqLFXJQ/M7dZRQCewuDj2iDUuBi6jLQt+APbW9RjjVEvLr35FXuOEqjow==" + } + } + }, + "@hapi/wreck": { + "version": "15.0.2", + "resolved": "https://registry.npmjs.org/@hapi/wreck/-/wreck-15.0.2.tgz", + "integrity": "sha512-D/7sGmx3XxxkaMWHZDKTMai8rIEfIgE+DnoZeKfmxhKGgvIpMu1f8BBmLADbdniccGer79w74IWWdXleNrT1Rw==", + "requires": { + "@hapi/boom": "7.x.x", + "@hapi/bourne": "1.x.x", + "@hapi/hoek": "8.x.x" + }, + "dependencies": { + "@hapi/hoek": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.2.4.tgz", + "integrity": "sha512-Ze5SDNt325yZvNO7s5C4fXDscjJ6dcqLFXJQ/M7dZRQCewuDj2iDUuBi6jLQt+APbW9RjjVEvLr35FXuOEqjow==" + } + } + }, + "@mojaloop/central-services-error-handling": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@mojaloop/central-services-error-handling/-/central-services-error-handling-7.5.0.tgz", + "integrity": "sha512-Spjllgyx6Y7En5vj7LaRVM5aTU+uuEykawPQaYzj3ZXAQdyHO4Slns8/ggwQ65T2qyMv1PXiqLK5dPBcIRlWYg==", + "requires": { + "@mojaloop/sdk-standard-components": "7.4.0", + "lodash": "4.17.15" + } + }, + "@mojaloop/central-services-health": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@mojaloop/central-services-health/-/central-services-health-8.1.0.tgz", + "integrity": "sha512-ty7Tjb6rm4ihF+nihFsubI7t7K8BLPq44+9KxEyCQn5XxvLrcnPThi8SYTaTBnf2Niph+Q9HUgWXbROKFNOY+g==", + "requires": { + "@hapi/hapi": "18.4.0", + "@mojaloop/central-services-error-handling": "7.5.0", + "@mojaloop/central-services-logger": "8.1.1", + "@mojaloop/central-services-shared": "8.1.0" + }, + "dependencies": { + "@hapi/hapi": { + "version": "18.4.0", + "resolved": "https://registry.npmjs.org/@hapi/hapi/-/hapi-18.4.0.tgz", + "integrity": "sha512-uk9zqknRLcNVQKgrPURm85DqkdroWP8eDRekh/IPoKvC4VjdZSn6EH2eUriOwyud/CldeBS3HDIJ/PtRj3VxDQ==", "requires": { - "lodash": "^4.14.0" + "@hapi/accept": "3.x.x", + "@hapi/ammo": "3.x.x", + "@hapi/boom": "7.x.x", + "@hapi/bounce": "1.x.x", + "@hapi/call": "5.x.x", + "@hapi/catbox": "10.x.x", + "@hapi/catbox-memory": "4.x.x", + "@hapi/heavy": "6.x.x", + "@hapi/hoek": "8.x.x", + "@hapi/joi": "15.x.x", + "@hapi/mimos": "4.x.x", + "@hapi/podium": "3.x.x", + "@hapi/shot": "4.x.x", + "@hapi/somever": "2.x.x", + "@hapi/statehood": "6.x.x", + "@hapi/subtext": "6.x.x", + "@hapi/teamwork": "3.x.x", + "@hapi/topo": "3.x.x" } }, - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "@hapi/hoek": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.2.4.tgz", + "integrity": "sha512-Ze5SDNt325yZvNO7s5C4fXDscjJ6dcqLFXJQ/M7dZRQCewuDj2iDUuBi6jLQt+APbW9RjjVEvLr35FXuOEqjow==" + }, + "@mojaloop/central-services-error-handling": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@mojaloop/central-services-error-handling/-/central-services-error-handling-7.5.0.tgz", + "integrity": "sha512-Spjllgyx6Y7En5vj7LaRVM5aTU+uuEykawPQaYzj3ZXAQdyHO4Slns8/ggwQ65T2qyMv1PXiqLK5dPBcIRlWYg==", "requires": { - "ms": "2.0.0" + "@mojaloop/sdk-standard-components": "7.4.0", + "lodash": "4.17.15" } }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "winston": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/winston/-/winston-2.4.0.tgz", - "integrity": "sha1-gIBQuT1SZh7Z+2wms/DIJnCLCu4=", + "@mojaloop/central-services-shared": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@mojaloop/central-services-shared/-/central-services-shared-8.1.0.tgz", + "integrity": "sha512-hdxPCa9nN22hYWxhVIwQ7rp8420OmJTyab9ArBioOUwpIirxwG8Hrck43WXCJstCYgB29u0BnTUniud1+qkXug==", "requires": { - "async": "~1.0.0", - "colors": "1.0.x", - "cycle": "1.0.x", - "eyes": "0.1.x", - "isstream": "0.1.x", - "stack-trace": "0.0.x" + "@hapi/catbox": "10.2.3", + "@hapi/catbox-memory": "4.1.1", + "@mojaloop/central-services-error-handling": "7.5.0", + "@mojaloop/central-services-logger": "8.1.1", + "@mojaloop/central-services-stream": "8.1.0", + "@mojaloop/event-sdk": "8.1.0", + "axios": "0.19.0", + "glob": "7.1.4", + "immutable": "3.8.2", + "lodash": "4.17.15", + "mustache": "3.1.0", + "raw-body": "2.4.1", + "uuid4": "1.1.4" }, "dependencies": { - "async": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async/-/async-1.0.0.tgz", - "integrity": "sha1-+PwEyjoTeErenhZBr5hXjPvWR6k=" + "@hapi/catbox": { + "version": "10.2.3", + "resolved": "https://registry.npmjs.org/@hapi/catbox/-/catbox-10.2.3.tgz", + "integrity": "sha512-kN9hXO4NYyOHW09CXiuj5qW1syc/0XeVOBsNNk0Tz89wWNQE5h21WF+VsfAw3uFR8swn/Wj3YEVBnWqo82m/JQ==", + "requires": { + "@hapi/boom": "7.x.x", + "@hapi/hoek": "8.x.x", + "@hapi/joi": "16.x.x", + "@hapi/podium": "3.x.x" + } + }, + "@hapi/joi": { + "version": "16.1.1", + "resolved": "https://registry.npmjs.org/@hapi/joi/-/joi-16.1.1.tgz", + "integrity": "sha512-v/XNMGNz+Nx7578Cx2bMunoQHuY4LFxRltJ6uA1LjS6LWakgPCJC4MTr1ucfCnjjbDtaQizrQx9oWXY3WcFcyw==", + "requires": { + "@hapi/address": "^2.1.1", + "@hapi/formula": "^1.2.0", + "@hapi/hoek": "^8.2.4", + "@hapi/pinpoint": "^1.0.2", + "@hapi/topo": "^3.1.3" + } } } + }, + "mustache": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-3.1.0.tgz", + "integrity": "sha512-3Bxq1R5LBZp7fbFPZzFe5WN4s0q3+gxZaZuZVY+QctYJiCiVgXHOTIC0/HgZuOPFt/6BQcx5u0H2CUOxT/RoGQ==" } } }, - "@mojaloop/central-services-stream": { - "version": "3.9.0-snapshot", - "resolved": "https://registry.npmjs.org/@mojaloop/central-services-stream/-/central-services-stream-3.9.0-snapshot.tgz", - "integrity": "sha512-jTkPBIWaDyvbTAKnLgqzPtMdKMeWJGe81hBi9C2eh2Ki19SGSnVCxRyZia/LSfKrhjfrhkRYZgLbXfaX44cFkg==", - "requires": { - "@mojaloop/central-services-shared": "3.9.1-snapshot", - "async": "2.6.0", - "bluebird": "3.5.1", - "debug": "3.1.0", - "events": "3.0.0", - "node-rdkafka": "2.4.2" + "@mojaloop/central-services-logger": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/@mojaloop/central-services-logger/-/central-services-logger-8.1.1.tgz", + "integrity": "sha512-ZAum8Mtl4NvW4IBfQ91bXsAvMwKFu1IDN0Ds81PemEB1Q6bQzAb4o5sIymeb55vwBxgR0msCsDsjMhIxBOjGMQ==", + "requires": { + "winston": "3.2.1" + } + }, + "@mojaloop/central-services-shared": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/@mojaloop/central-services-shared/-/central-services-shared-8.1.1.tgz", + "integrity": "sha512-Y6KlJhRzJW0kY9tqSt5B+StGt/Q1RC21j3QVONI4WeI8DAK/UNxT7GD/qMBw0LyawAYZsQmm6KobW4MNp4D4Iw==", + "requires": { + "@hapi/catbox": "10.2.3", + "@hapi/catbox-memory": "4.1.1", + "@mojaloop/central-services-error-handling": "7.5.0", + "@mojaloop/central-services-logger": "8.1.1", + "@mojaloop/central-services-stream": "8.1.0", + "@mojaloop/event-sdk": "8.1.0", + "axios": "0.19.0", + "glob": "7.1.4", + "immutable": "3.8.2", + "lodash": "4.17.15", + "mustache": "3.1.0", + "raw-body": "2.4.1", + "uuid4": "1.1.4" }, "dependencies": { - "@mojaloop/central-services-shared": { - "version": "3.9.1-snapshot", - "resolved": "https://registry.npmjs.org/@mojaloop/central-services-shared/-/central-services-shared-3.9.1-snapshot.tgz", - "integrity": "sha512-QjFQpeuzI0Maesn9DaqToIcq71rh7VbnlFCa0wq+8zn42h5/AnhjyBiZREIH/t1tMOv9j6A7P/aDAA/CVLszFw==", + "@hapi/catbox": { + "version": "10.2.3", + "resolved": "https://registry.npmjs.org/@hapi/catbox/-/catbox-10.2.3.tgz", + "integrity": "sha512-kN9hXO4NYyOHW09CXiuj5qW1syc/0XeVOBsNNk0Tz89wWNQE5h21WF+VsfAw3uFR8swn/Wj3YEVBnWqo82m/JQ==", "requires": { - "async": "2.6.0", - "debug": "3.1.0", - "winston": "2.4.0" + "@hapi/boom": "7.x.x", + "@hapi/hoek": "8.x.x", + "@hapi/joi": "16.x.x", + "@hapi/podium": "3.x.x" } }, - "async": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", - "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", - "requires": { - "lodash": "^4.14.0" - } + "@hapi/hoek": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.2.4.tgz", + "integrity": "sha512-Ze5SDNt325yZvNO7s5C4fXDscjJ6dcqLFXJQ/M7dZRQCewuDj2iDUuBi6jLQt+APbW9RjjVEvLr35FXuOEqjow==" }, - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "@hapi/joi": { + "version": "16.1.1", + "resolved": "https://registry.npmjs.org/@hapi/joi/-/joi-16.1.1.tgz", + "integrity": "sha512-v/XNMGNz+Nx7578Cx2bMunoQHuY4LFxRltJ6uA1LjS6LWakgPCJC4MTr1ucfCnjjbDtaQizrQx9oWXY3WcFcyw==", "requires": { - "ms": "2.0.0" + "@hapi/address": "^2.1.1", + "@hapi/formula": "^1.2.0", + "@hapi/hoek": "^8.2.4", + "@hapi/pinpoint": "^1.0.2", + "@hapi/topo": "^3.1.3" } }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "winston": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/winston/-/winston-2.4.0.tgz", - "integrity": "sha1-gIBQuT1SZh7Z+2wms/DIJnCLCu4=", - "requires": { - "async": "~1.0.0", - "colors": "1.0.x", - "cycle": "1.0.x", - "eyes": "0.1.x", - "isstream": "0.1.x", - "stack-trace": "0.0.x" - }, - "dependencies": { - "async": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async/-/async-1.0.0.tgz", - "integrity": "sha1-+PwEyjoTeErenhZBr5hXjPvWR6k=" - } - } + "mustache": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-3.1.0.tgz", + "integrity": "sha512-3Bxq1R5LBZp7fbFPZzFe5WN4s0q3+gxZaZuZVY+QctYJiCiVgXHOTIC0/HgZuOPFt/6BQcx5u0H2CUOxT/RoGQ==" + } + } + }, + "@mojaloop/central-services-stream": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@mojaloop/central-services-stream/-/central-services-stream-8.1.0.tgz", + "integrity": "sha512-ZCg9UMDbmWG9Vy7mxi+1Q1aXXp2L3eDISYIXMC3xv6n5ubNUm/DVCxc6qbYzdzBWxs3TgsE5+/J7UZlSG+GfyQ==", + "requires": { + "@mojaloop/central-services-logger": "8.1.1", + "async": "3.1.0", + "base64url": "3.0.1", + "clone": "2.1.2", + "data-urls": "1.1.0", + "debug": "4.1.1", + "events": "3.0.0", + "node-rdkafka": "2.7.1", + "raw-body": "2.4.1" + }, + "dependencies": { + "async": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/async/-/async-3.1.0.tgz", + "integrity": "sha512-4vx/aaY6j/j3Lw3fbCHNWP0pPaTCew3F6F3hYyl/tHs/ndmV1q7NW9T5yuJ2XAGwdQrP+6Wu20x06U4APo/iQQ==" } } }, @@ -370,173 +858,79 @@ } }, "@mojaloop/event-sdk": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@mojaloop/event-sdk/-/event-sdk-7.4.0.tgz", - "integrity": "sha512-Zgq2g00RJQrsAcZZEgFGy9i+eOPJgYI7hTTrsEXFzadURNeMx6D7Vyy20LSf1Aj/5KYq0p0fSiLYUtXZAin7bA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@mojaloop/event-sdk/-/event-sdk-8.1.0.tgz", + "integrity": "sha512-n5SWH5FlUHvNGTuHMxANC8RSRAidCxWv6P4++OwWjWhY2Pe7xMI/2kRJEn3bBj0krBbtS8LtrEuwHT4+vM+fSg==", "requires": { - "@grpc/proto-loader": "0.5.1", - "@mojaloop/central-services-shared": "7.2.0", + "@grpc/proto-loader": "0.5.2", + "@mojaloop/central-services-logger": "8.1.1", "@types/protobufjs": "6.0.0", "brototype": "0.0.6", - "grpc": "1.21.1", + "error-callsites": "^2.0.2", + "grpc": "1.23.3", "lodash": "4.17.15", "moment": "2.24.0", "parse-strings-in-object": "1.2.0", "protobufjs": "6.8.8", "rc": "1.2.8", - "sinon": "7.3.2", + "serialize-error": "^4.1.0", + "sinon": "7.4.2", "traceparent": "1.0.0", "uuid4": "1.1.4" }, "dependencies": { - "@mojaloop/central-services-error-handling": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/@mojaloop/central-services-error-handling/-/central-services-error-handling-7.2.2.tgz", - "integrity": "sha512-nDzMRXF8OlqE0gFGMv3f3jo5Dx7YverVya3REhV6xlmXTCVytSmk2smefNFYloGumMsfcC8QTaiUhTQIU2KJfA==", - "requires": { - "@modusbox/mojaloop-sdk-standard-components": "0.0.36", - "@mojaloop/central-services-shared": "6.4.1", - "lodash": "4.17.15" - }, - "dependencies": { - "@mojaloop/central-services-shared": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/@mojaloop/central-services-shared/-/central-services-shared-6.4.1.tgz", - "integrity": "sha512-ihtRxZiMghJgqXdstVi/qr0VepOfr2uA1VYfnPNB16TZoojWtG0xt538XG/3TfYJfxVOaShc+WlJBVoxUs774w==", - "requires": { - "async": "3.1.0", - "debug": "4.1.1", - "winston": "3.2.1" - } - } - } - }, - "@mojaloop/central-services-shared": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@mojaloop/central-services-shared/-/central-services-shared-7.2.0.tgz", - "integrity": "sha512-dBjthgRj38GINGn2UaVHykrSaQHt9CUsxmdCEjKMOPXs67wzg7QFJJf7fOouuIqynvJnz7rBM0Df5pyM+k3ICg==", - "requires": { - "@mojaloop/central-services-error-handling": "7.2.2", - "@mojaloop/central-services-stream": "6.2.2", - "axios": "0.19.0", - "catbox": "10.0.6", - "catbox-memory": "4.0.1", - "glob": "7.1.4", - "immutable": "3.8.2", - "lodash": "4.17.15", - "mustache": "3.0.1", - "raw-body": "2.4.1", - "uuid4": "1.1.4", - "winston": "3.2.1" - } - }, - "@mojaloop/central-services-stream": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/@mojaloop/central-services-stream/-/central-services-stream-6.2.2.tgz", - "integrity": "sha512-NsKMYRjNQdBJ1290xP1/Kjs1MKgtBINFs3CLcnhrWW1sMwdfLakAwoVdiaZmJMguk5sung7T5hbHWC/XNQOyoQ==", - "requires": { - "@mojaloop/central-services-shared": "5.2.0", - "async": "2.6.2", - "base64url": "3.0.1", - "bluebird": "3.5.3", - "clone": "2.1.2", - "data-urls": "^1.1.0", - "debug": "4.1.1", - "events": "3.0.0", - "node-rdkafka": "2.6.1", - "raw-body": "2.4.0" - }, - "dependencies": { - "@mojaloop/central-services-shared": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@mojaloop/central-services-shared/-/central-services-shared-5.2.0.tgz", - "integrity": "sha512-wcHlPdJKziJMqjDIbYp8WLXT5ZI/0ITdrxl2QHDK03geZ6UWJ0B6EnRe1LPKWM2M/bBzzybB9vHU8UI+/QwXgw==", - "requires": { - "async": "2.6.2", - "debug": "4.1.1", - "winston": "3.2.1" - } - }, - "async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", - "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", - "requires": { - "lodash": "^4.17.11" - } - }, - "raw-body": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", - "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", - "requires": { - "bytes": "3.1.0", - "http-errors": "1.7.2", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - } - } - } - }, "@sinonjs/formatio": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.2.1.tgz", "integrity": "sha512-tsHvOB24rvyvV2+zKMmPkZ7dXX6LSLKZ7aOtXY6Edklp0uRcgGpOsQTTGTcWViFyx4uhWc6GV8QdnALbIbIdeQ==", "requires": { "@sinonjs/commons": "^1", - "@sinonjs/samsam": "^3.1.0" - } - }, - "async": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/async/-/async-3.1.0.tgz", - "integrity": "sha512-4vx/aaY6j/j3Lw3fbCHNWP0pPaTCew3F6F3hYyl/tHs/ndmV1q7NW9T5yuJ2XAGwdQrP+6Wu20x06U4APo/iQQ==" - }, - "bluebird": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.3.tgz", - "integrity": "sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw==" + "@sinonjs/samsam": "^3.1.0" + } }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + "@sinonjs/samsam": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-3.3.3.tgz", + "integrity": "sha512-bKCMKZvWIjYD0BLGnNrxVuw4dkWCYsLqFOUWw8VgKF/+5Y+mE7LfHWPIYoDXowH+3a9LsWDMo0uAP8YDosPvHQ==", + "requires": { + "@sinonjs/commons": "^1.3.0", + "array-from": "^2.1.1", + "lodash": "^4.17.15" + } }, - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + "error-callsites": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/error-callsites/-/error-callsites-2.0.2.tgz", + "integrity": "sha512-s35ELWAKAY9oPqnnfP1V4AnasWV0r2ihaLlpsCGrykZgcR/YKsMXV3q8Ap4Mmp8U90VxJqxKJE5Io0IkkRhJIg==" }, "lolex": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lolex/-/lolex-4.2.0.tgz", "integrity": "sha512-gKO5uExCXvSm6zbF562EvM+rd1kQDnB9AZBbiQVzf1ZmdDpxUSvpnAaVOP83N/31mRK8Ml8/VE8DMvsAZQ+7wg==" }, - "mustache": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mustache/-/mustache-3.0.1.tgz", - "integrity": "sha512-jFI/4UVRsRYdUbuDTKT7KzfOp7FiD5WzYmmwNwXyUVypC0xjoTL78Fqc0jHUPIvvGD+6DQSPHIt1NE7D1ArsqA==" - }, - "node-rdkafka": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-rdkafka/-/node-rdkafka-2.6.1.tgz", - "integrity": "sha512-mBRq7/7hgnRmbfX8TLPK0JVQYxu/kkuHVT4W7vLXc6wQoV5JfInpV0hWtkGIBjNzFyYSk0faJDIqlDQ2k9vy9Q==", + "nise": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/nise/-/nise-1.5.2.tgz", + "integrity": "sha512-/6RhOUlicRCbE9s+94qCUsyE+pKlVJ5AhIv+jEE7ESKwnbXqulKZ1FYU+XAtHHWE9TinYvAxDUJAb912PwPoWA==", "requires": { - "bindings": "^1.3.1", - "nan": "^2.11.1" + "@sinonjs/formatio": "^3.2.1", + "@sinonjs/text-encoding": "^0.7.1", + "just-extend": "^4.0.2", + "lolex": "^4.1.0", + "path-to-regexp": "^1.7.0" } }, "sinon": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-7.3.2.tgz", - "integrity": "sha512-thErC1z64BeyGiPvF8aoSg0LEnptSaWE7YhdWWbWXgelOyThent7uKOnnEh9zBxDbKixtr5dEko+ws1sZMuFMA==", + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-7.4.2.tgz", + "integrity": "sha512-pY5RY99DKelU3pjNxcWo6XqeB1S118GBcVIIdDi6V+h6hevn1izcg2xv1hTHW/sViRXU7sUOxt4wTUJ3gsW2CQ==", "requires": { "@sinonjs/commons": "^1.4.0", "@sinonjs/formatio": "^3.2.1", - "@sinonjs/samsam": "^3.3.1", + "@sinonjs/samsam": "^3.3.3", "diff": "^3.5.0", - "lolex": "^4.0.1", - "nise": "^1.4.10", + "lolex": "^4.2.0", + "nise": "^1.5.2", "supports-color": "^5.5.0" } }, @@ -547,32 +941,6 @@ "requires": { "has-flag": "^3.0.0" } - }, - "winston": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.2.1.tgz", - "integrity": "sha512-zU6vgnS9dAWCEKg/QYigd6cgMVVNwyTzKs81XZtTFuRwJOcDdBg7AU0mXVyNbs7O5RH2zdv+BdNZUlx7mXPuOw==", - "requires": { - "async": "^2.6.1", - "diagnostics": "^1.1.1", - "is-stream": "^1.1.0", - "logform": "^2.1.1", - "one-time": "0.0.4", - "readable-stream": "^3.1.1", - "stack-trace": "0.0.x", - "triple-beam": "^1.3.0", - "winston-transport": "^4.3.0" - }, - "dependencies": { - "async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", - "requires": { - "lodash": "^4.17.14" - } - } - } } } }, @@ -581,6 +949,19 @@ "resolved": "https://registry.npmjs.org/@mojaloop/opentracing/-/opentracing-6.4.0-snapshot.tgz", "integrity": "sha512-/KejCrKOrrofPsoJR3D+LrlS5+LXiLTn44vI3FCi5N63LMns7e8CHIBzGwX7MXLca2RfugLcywGh1ajCprY80A==" }, + "@mojaloop/sdk-standard-components": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@mojaloop/sdk-standard-components/-/sdk-standard-components-7.4.0.tgz", + "integrity": "sha512-5bpw0oFuSon9Zd7qNOhWoLozHLBPGqcu0vFhxMcLecSA5UPjyq5JJf3tAcaAtnJspkTMDW/GieI0uCr9pCEJzA==", + "requires": { + "base64url": "^3.0.1", + "ilp-packet": "2.2.0", + "jsonwebtoken": "^8.5.1", + "jws": "^3.2.2", + "request": "^2.34", + "request-promise-native": "^1.0.7" + } + }, "@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", @@ -656,6 +1037,7 @@ "version": "3.3.2", "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-3.3.2.tgz", "integrity": "sha512-ILO/rR8LfAb60Y1Yfp9vxfYAASK43NFC2mLzpvLUbCQY/Qu8YwReboseu8aheCEkyElZF2L2T9mHcR2bgdvZyA==", + "dev": true, "requires": { "@sinonjs/commons": "^1.0.2", "array-from": "^2.1.1", @@ -667,15 +1049,24 @@ "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==" }, + "@types/bytebuffer": { + "version": "5.0.40", + "resolved": "https://registry.npmjs.org/@types/bytebuffer/-/bytebuffer-5.0.40.tgz", + "integrity": "sha512-h48dyzZrPMz25K6Q4+NCwWaxwXany2FhQg/ErOcdZS1ZpsaDnDMZg8JYLMTGz7uvXKrcKGJUZJlZObyfgdaN9g==", + "requires": { + "@types/long": "*", + "@types/node": "*" + } + }, "@types/long": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.0.tgz", "integrity": "sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q==" }, "@types/node": { - "version": "10.14.16", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.16.tgz", - "integrity": "sha512-/opXIbfn0P+VLt+N8DE4l8Mn8rbhiJgabU96ZJ0p9mxOkIks5gh6RUnpHak7Yh0SFkyjO/ODbxsQQPV2bpMmyA==" + "version": "10.14.18", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.18.tgz", + "integrity": "sha512-ryO3Q3++yZC/+b8j8BdKd/dn9JlzlHBPdm80656xwYUdmPkpTGTjkAdt6BByiNupGPE8w0FhBgvYy/fX9hRNGQ==" }, "@types/protobufjs": { "version": "6.0.0", @@ -686,9 +1077,9 @@ } }, "abab": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz", - "integrity": "sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.1.tgz", + "integrity": "sha512-1zSbbCuoIjafKZ3mblY5ikvAb0ODUbqBnFuUb7f6uLeQhhGJ0vEV4ntmtxKLT2WgXCO94E07BjunsIw1jOMPZw==" }, "acorn": { "version": "5.7.3", @@ -718,6 +1109,14 @@ "resolved": "https://registry.npmjs.org/after-all-results/-/after-all-results-2.0.0.tgz", "integrity": "sha1-asL8ICtQD4jaj09VMM+hAPTGotA=" }, + "agentkeepalive": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.5.2.tgz", + "integrity": "sha512-e0L/HNe6qkQ7H19kTlRRqUibEAwDK5AFk6y3PtMsuut2VAH6+Q4xZml1tNDJD7kSAyqmbG/K08K5WEJYtUrSlQ==", + "requires": { + "humanize-ms": "^1.2.1" + } + }, "ajv": { "version": "6.10.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", @@ -749,8 +1148,7 @@ "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" }, "append-transform": { "version": "1.0.0", @@ -822,9 +1220,12 @@ "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" }, "async": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async/-/async-1.0.0.tgz", - "integrity": "sha1-+PwEyjoTeErenhZBr5hXjPvWR6k=" + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", + "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", + "requires": { + "lodash": "^4.17.11" + } }, "async-cache": { "version": "1.1.0", @@ -926,11 +1327,6 @@ "file-uri-to-path": "1.0.0" } }, - "bluebird": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", - "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==" - }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -940,11 +1336,6 @@ "concat-map": "0.0.1" } }, - "brackets2dots": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brackets2dots/-/brackets2dots-1.1.0.tgz", - "integrity": "sha1-Pz1AN1/GYM4P0AT6J9Z7NPlGmsM=" - }, "breadth-filter": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/breadth-filter/-/breadth-filter-2.0.0.tgz", @@ -975,13 +1366,6 @@ "integrity": "sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0=", "requires": { "long": "~3" - }, - "dependencies": { - "long": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", - "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=" - } } }, "bytes": { @@ -1019,67 +1403,18 @@ "camelcase": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", - "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==" + "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==", + "dev": true }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" }, - "catbox": { - "version": "10.0.6", - "resolved": "https://registry.npmjs.org/catbox/-/catbox-10.0.6.tgz", - "integrity": "sha512-gQWCnF/jbHcfwGbQ4FQxyRiAwLRipqWTTXjpq7rTqqdcsnZosFa0L3LsCZcPTF33QIeMMkS7QmFBHt6QdzGPvg==", - "requires": { - "boom": "7.x.x", - "hoek": "6.x.x", - "joi": "14.x.x" - }, - "dependencies": { - "boom": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/boom/-/boom-7.3.0.tgz", - "integrity": "sha512-Swpoyi2t5+GhOEGw8rEsKvTxFLIDiiKoUc2gsoV6Lyr43LHBIzch3k2MvYUs8RTROrIkVJ3Al0TkaOGjnb+B6A==", - "requires": { - "hoek": "6.x.x" - } - }, - "hoek": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-6.1.3.tgz", - "integrity": "sha512-YXXAAhmF9zpQbC7LEcREFtXfGq5K1fmd+4PHkBq8NUqmzW3G+Dq10bI/i0KucLRwss3YYFQ0fSfoxBZYiGUqtQ==" - } - } - }, - "catbox-memory": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/catbox-memory/-/catbox-memory-4.0.1.tgz", - "integrity": "sha512-ZmqNiLsYCIu9qvBJ/MQbznDV2bFH5gFiH67TgIJgSSffJFtTXArT+MM3AvJQlby9NSkLHOX4eH/uuUqnch/Ldw==", - "requires": { - "boom": "7.x.x", - "hoek": "6.x.x" - }, - "dependencies": { - "boom": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/boom/-/boom-7.3.0.tgz", - "integrity": "sha512-Swpoyi2t5+GhOEGw8rEsKvTxFLIDiiKoUc2gsoV6Lyr43LHBIzch3k2MvYUs8RTROrIkVJ3Al0TkaOGjnb+B6A==", - "requires": { - "hoek": "6.x.x" - } - }, - "hoek": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-6.1.3.tgz", - "integrity": "sha512-YXXAAhmF9zpQbC7LEcREFtXfGq5K1fmd+4PHkBq8NUqmzW3G+Dq10bI/i0KucLRwss3YYFQ0fSfoxBZYiGUqtQ==" - } - } - }, "chalk": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, "requires": { "ansi-styles": "^2.2.1", "escape-string-regexp": "^1.0.2", @@ -1094,11 +1429,6 @@ "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", "dev": true }, - "check-types": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/check-types/-/check-types-7.4.0.tgz", - "integrity": "sha512-YbulWHdfP99UfZ73NcUDlNJhEIDgm9Doq9GhpyXbF+7Aegi3CVV7qqMCKTTqJxlvEvnQBp9IA+dxsGN6xK/nSg==" - }, "circular-json": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", @@ -1202,11 +1532,6 @@ "resolved": "https://registry.npmjs.org/colornames/-/colornames-1.1.1.tgz", "integrity": "sha1-+IiQMGhcfE/54qVZ9Qd+t2qBb5Y=" }, - "colors": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", - "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=" - }, "colorspace": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.2.tgz", @@ -1285,14 +1610,6 @@ } } }, - "config": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/config/-/config-3.0.0.tgz", - "integrity": "sha512-QMr3BCOcHdgXx8t8cLfBhWtHcIAAMikaxUc2XASuH2A93g9kOIRch7sXFQdSvdMxhQobnctWm2y68YJYRttJlw==", - "requires": { - "json5": "^1.0.1" - } - }, "console-log-level": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/console-log-level/-/console-log-level-1.4.1.tgz", @@ -1354,19 +1671,6 @@ "which": "^1.2.9" } }, - "curry2": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/curry2/-/curry2-1.0.3.tgz", - "integrity": "sha1-OBkdVfEGC/6kfKCACThbuHj2YS8=", - "requires": { - "fast-bind": "^1.0.0" - } - }, - "cycle": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", - "integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI=" - }, "d": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", @@ -1476,6 +1780,11 @@ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" }, + "deserialize-error": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/deserialize-error/-/deserialize-error-0.0.3.tgz", + "integrity": "sha1-9WhjNXLXwsxGpVpfwlS23857P8o=" + }, "diagnostics": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/diagnostics/-/diagnostics-1.1.1.tgz", @@ -1500,11 +1809,6 @@ "esutils": "^2.0.2" } }, - "dotsplit.js": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/dotsplit.js/-/dotsplit.js-1.1.0.tgz", - "integrity": "sha1-JaI56r6SKpH/pdKhctbJ+4JFHgI=" - }, "duplexer": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", @@ -1544,6 +1848,16 @@ "unicode-byte-truncate": "^1.0.0" } }, + "elasticsearch": { + "version": "16.3.0", + "resolved": "https://registry.npmjs.org/elasticsearch/-/elasticsearch-16.3.0.tgz", + "integrity": "sha512-Xy4vma+YJD2I3vudoV5RIgcMFnc/69SVef/BGOtmicvgUdzYs5mLY66FIANb5KnVS60i+zsnhvf/bYJYJklBsg==", + "requires": { + "agentkeepalive": "^3.4.1", + "chalk": "^1.0.0", + "lodash": "^4.17.10" + } + }, "emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", @@ -1687,8 +2001,7 @@ "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "escodegen": { "version": "1.12.0", @@ -2080,16 +2393,6 @@ "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" }, - "eyes": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", - "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=" - }, - "fast-bind": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fast-bind/-/fast-bind-1.0.0.tgz", - "integrity": "sha1-f6llLLMyX1zR4lLWy08WDeGnbnU=" - }, "fast-deep-equal": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", @@ -2421,10 +2724,11 @@ "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==" }, "grpc": { - "version": "1.21.1", - "resolved": "https://registry.npmjs.org/grpc/-/grpc-1.21.1.tgz", - "integrity": "sha512-PFsZQazf62nP05a0xm23mlImMuw5oVlqF/0zakmsdqJgvbABe+d6VThY2PfhqJmWEL/FhQ6QNYsxS5EAM6++7g==", + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/grpc/-/grpc-1.23.3.tgz", + "integrity": "sha512-7vdzxPw9s5UYch4aUn4hyM5tMaouaxUUkwkgJlwbR4AXMxiYZJOv19N2ps2eKiuUbJovo5fnGF9hg/X91gWYjw==", "requires": { + "@types/bytebuffer": "^5.0.40", "lodash.camelcase": "^4.3.0", "lodash.clone": "^4.5.0", "nan": "^2.13.2", @@ -2465,7 +2769,7 @@ } }, "chownr": { - "version": "1.1.1", + "version": "1.1.2", "bundled": true }, "code-point-at": { @@ -2484,6 +2788,13 @@ "version": "1.0.2", "bundled": true }, + "debug": { + "version": "3.2.6", + "bundled": true, + "requires": { + "ms": "^2.1.1" + } + }, "deep-extend": { "version": "0.6.0", "bundled": true @@ -2497,7 +2808,7 @@ "bundled": true }, "fs-minipass": { - "version": "1.2.5", + "version": "1.2.6", "bundled": true, "requires": { "minipass": "^2.2.1" @@ -2521,12 +2832,24 @@ "wide-align": "^1.1.0" } }, + "glob": { + "version": "7.1.4", + "bundled": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "has-unicode": { "version": "2.0.1", "bundled": true }, "iconv-lite": { - "version": "0.4.23", + "version": "0.4.24", "bundled": true, "requires": { "safer-buffer": ">= 2.1.2 < 3" @@ -2548,7 +2871,7 @@ } }, "inherits": { - "version": "2.0.3", + "version": "2.0.4", "bundled": true }, "ini": { @@ -2605,26 +2928,17 @@ } } }, + "ms": { + "version": "2.1.2", + "bundled": true + }, "needle": { - "version": "2.3.1", + "version": "2.4.0", "bundled": true, "requires": { - "debug": "^4.1.0", + "debug": "^3.2.6", "iconv-lite": "^0.4.4", "sax": "^1.2.4" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "bundled": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.1", - "bundled": true - } } }, "node-pre-gyp": { @@ -2656,7 +2970,7 @@ "bundled": true }, "npm-packlist": { - "version": "1.4.1", + "version": "1.4.4", "bundled": true, "requires": { "ignore-walk": "^3.0.1", @@ -2709,7 +3023,7 @@ "bundled": true }, "process-nextick-args": { - "version": "2.0.0", + "version": "2.0.1", "bundled": true }, "protobufjs": { @@ -2747,24 +3061,10 @@ } }, "rimraf": { - "version": "2.6.3", + "version": "2.7.1", "bundled": true, "requires": { "glob": "^7.1.3" - }, - "dependencies": { - "glob": { - "version": "7.1.4", - "bundled": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } } }, "safe-buffer": { @@ -2780,7 +3080,7 @@ "bundled": true }, "semver": { - "version": "5.7.0", + "version": "5.7.1", "bundled": true }, "set-blocking": { @@ -2819,16 +3119,16 @@ "bundled": true }, "tar": { - "version": "4.4.8", + "version": "4.4.10", "bundled": true, "requires": { "chownr": "^1.1.1", "fs-minipass": "^1.2.5", - "minipass": "^2.3.4", - "minizlib": "^1.1.1", + "minipass": "^2.3.5", + "minizlib": "^1.2.1", "mkdirp": "^0.5.0", "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" + "yallist": "^3.0.3" } }, "util-deprecate": { @@ -2898,7 +3198,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, "requires": { "ansi-regex": "^2.0.0" } @@ -2906,8 +3205,7 @@ "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" }, "has-symbols": { "version": "1.0.0", @@ -2923,11 +3221,6 @@ "is-stream": "^1.0.1" } }, - "healthcheck-server": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/healthcheck-server/-/healthcheck-server-1.0.0.tgz", - "integrity": "sha512-J7iXk7xbB5vKaJSDz9tXRj763T1SdoGEVpvYDhdVS+4Pw+Qr+1fHS+upcS7HxBnlA0DYALfD1V6Sf/8L/hdcXA==" - }, "home-or-tmp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", @@ -2944,22 +3237,15 @@ "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==" }, "http-errors": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", - "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz", + "integrity": "sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==", "requires": { "depd": "~1.1.2", - "inherits": "2.0.3", + "inherits": "2.0.4", "setprototypeof": "1.1.1", "statuses": ">= 1.5.0 < 2", "toidentifier": "1.0.0" - }, - "dependencies": { - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - } } }, "http-headers": { @@ -2980,6 +3266,14 @@ "sshpk": "^1.7.0" } }, + "humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=", + "requires": { + "ms": "^2.0.0" + } + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -3008,13 +3302,6 @@ "extensible-error": "^1.0.2", "long": "^3.2.0", "oer-utils": "^1.3.2" - }, - "dependencies": { - "long": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", - "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=" - } } }, "immutable": { @@ -3279,14 +3566,6 @@ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, - "isemail": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/isemail/-/isemail-3.2.0.tgz", - "integrity": "sha512-zKqkK+O+dGqevc93KNsbZ/TqTUFd46MwWjYOoMrjIMZ51eU7DtQG3Wmd9SQQT7i7RVnuTPEiYEWHU3MSbxC1Tg==", - "requires": { - "punycode": "2.x.x" - } - }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -3380,23 +3659,6 @@ "handlebars": "^4.1.2" } }, - "joi": { - "version": "14.3.1", - "resolved": "https://registry.npmjs.org/joi/-/joi-14.3.1.tgz", - "integrity": "sha512-LQDdM+pkOrpAn4Lp+neNIFV3axv1Vna3j38bisbQhETPMANYRbFJFUyOZcOClYvM/hppMhGWuKSFEK9vjrB+bQ==", - "requires": { - "hoek": "6.x.x", - "isemail": "3.x.x", - "topo": "3.x.x" - }, - "dependencies": { - "hoek": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-6.1.3.tgz", - "integrity": "sha512-YXXAAhmF9zpQbC7LEcREFtXfGq5K1fmd+4PHkBq8NUqmzW3G+Dq10bI/i0KucLRwss3YYFQ0fSfoxBZYiGUqtQ==" - } - } - }, "js-tokens": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", @@ -3429,28 +3691,6 @@ "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" }, - "json-rules-engine": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/json-rules-engine/-/json-rules-engine-2.3.0.tgz", - "integrity": "sha512-pX3sutCVTqzCfmj91rqg6CYwU3BPts5QR59pl9yuoBmUDN1jq82dHFL9QUjS0fT97uCTx1+U6V33lYqK8O8uUw==", - "requires": { - "clone": "^2.1.1", - "debug": "^3.1.0", - "lodash.isobjectlike": "^4.0.0", - "object-hash": "^1.2.0", - "selectn": "^1.1.2" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "requires": { - "ms": "^2.1.1" - } - } - } - }, "json-schema": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", @@ -3481,14 +3721,6 @@ "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, - "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "requires": { - "minimist": "^1.2.0" - } - }, "jsonify": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", @@ -3593,11 +3825,6 @@ "colornames": "^1.1.1" } }, - "lazy-ass": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/lazy-ass/-/lazy-ass-1.6.0.tgz", - "integrity": "sha1-eZllXoZGwX8In90YfRUNMyTVRRM=" - }, "lcid": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", @@ -3700,11 +3927,6 @@ "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=" }, - "lodash.isobjectlike": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/lodash.isobjectlike/-/lodash.isobjectlike-4.0.0.tgz", - "integrity": "sha1-dCxfxlrdJ5JNPSQZFoGqmheytg0=" - }, "lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", @@ -3751,9 +3973,9 @@ "dev": true }, "long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", + "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=" }, "lru-cache": { "version": "4.1.5", @@ -3966,6 +4188,7 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/nise/-/nise-1.5.0.tgz", "integrity": "sha512-Z3sfYEkLFzFmL8KY6xnSJLRxwQwYBjOXi/24lb62ZnZiGA0JUzGGTI6TBIgfCSMIDl9Jlu8SRmHNACLTemDHww==", + "dev": true, "requires": { "@sinonjs/formatio": "^3.1.0", "@sinonjs/text-encoding": "^0.7.1", @@ -3978,6 +4201,7 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.2.1.tgz", "integrity": "sha512-tsHvOB24rvyvV2+zKMmPkZ7dXX6LSLKZ7aOtXY6Edklp0uRcgGpOsQTTGTcWViFyx4uhWc6GV8QdnALbIbIdeQ==", + "dev": true, "requires": { "@sinonjs/commons": "^1", "@sinonjs/samsam": "^3.1.0" @@ -3986,17 +4210,18 @@ "lolex": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/lolex/-/lolex-4.1.0.tgz", - "integrity": "sha512-BYxIEXiVq5lGIXeVHnsFzqa1TxN5acnKnPCdlZSpzm8viNEOhiigupA4vTQ9HEFQ6nLTQ9wQOgBknJgzUYQ9Aw==" + "integrity": "sha512-BYxIEXiVq5lGIXeVHnsFzqa1TxN5acnKnPCdlZSpzm8viNEOhiigupA4vTQ9HEFQ6nLTQ9wQOgBknJgzUYQ9Aw==", + "dev": true } } }, "node-rdkafka": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/node-rdkafka/-/node-rdkafka-2.4.2.tgz", - "integrity": "sha512-sOfVLlLUChJZqmJV5lTdL/psAg4TvkDnSprly6UQenCK8W69ee7Q20v8nzFESsdZWTRgpNHu3WEmz9I+Ef6Bog==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/node-rdkafka/-/node-rdkafka-2.7.1.tgz", + "integrity": "sha512-LrPTNtAoENJedyvYDI/AhBieq+aaFD+ImEIFAxJzL1HAYDZdCwe+TjivSK6N4YLXtxlbXVA1i43DK04VOWebeA==", "requires": { - "bindings": "1.x", - "nan": "2.x" + "bindings": "^1.3.1", + "nan": "^2.14.0" } }, "nodemailer": { @@ -4251,11 +4476,6 @@ "resolved": "https://registry.npmjs.org/object-filter-sequence/-/object-filter-sequence-1.0.0.tgz", "integrity": "sha512-CsubGNxhIEChNY4cXYuA6KXafztzHqzLLZ/y3Kasf3A+sa3lL9thq3z+7o0pZqzEinjXT6lXDPAfVWI59dUyzQ==" }, - "object-hash": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.1.tgz", - "integrity": "sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA==" - }, "object-inspect": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz", @@ -4374,6 +4594,12 @@ "lcid": "^1.0.0" } }, + "os-shim": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/os-shim/-/os-shim-0.1.3.tgz", + "integrity": "sha1-a2LDeRz3kJ6jXtRuF2WLtBfLORc=", + "dev": true + }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -4524,6 +4750,28 @@ "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", "dev": true }, + "pre-commit": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/pre-commit/-/pre-commit-1.2.2.tgz", + "integrity": "sha1-287g7p3nI15X95xW186UZBpp7sY=", + "dev": true, + "requires": { + "cross-spawn": "^5.0.1", + "spawn-sync": "^1.0.15", + "which": "1.2.x" + }, + "dependencies": { + "which": { + "version": "1.2.14", + "resolved": "https://registry.npmjs.org/which/-/which-1.2.14.tgz", + "integrity": "sha1-mofEN48D6CfOyvGs31bHNsAcFOU=", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", @@ -4559,6 +4807,13 @@ "@types/long": "^4.0.0", "@types/node": "^10.1.0", "long": "^4.0.0" + }, + "dependencies": { + "long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + } } }, "proxyquire": { @@ -4635,20 +4890,6 @@ "http-errors": "1.7.3", "iconv-lite": "0.4.24", "unpipe": "1.0.0" - }, - "dependencies": { - "http-errors": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz", - "integrity": "sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==", - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.4", - "setprototypeof": "1.1.1", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.0" - } - } } }, "rc": { @@ -4948,37 +5189,19 @@ "integrity": "sha512-1HwIYD/8UlOtFS3QO3w7ey+SdSDFE4HRNLZoZRYVQefrOY3l17epswImeB1ijgJFQJodIaHcwkp3r/myBjFVbg==", "dev": true }, - "selectn": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/selectn/-/selectn-1.1.2.tgz", - "integrity": "sha1-/IrNkd8/RaywGJHGdzrlKYUdaxc=", - "requires": { - "brackets2dots": "^1.1.0", - "curry2": "^1.0.0", - "debug": "^2.5.2", - "dotsplit.js": "^1.0.3" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - } - } - }, "semver": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.1.1.tgz", "integrity": "sha512-rWYq2e5iYW+fFe/oPPtYJxYgjBm8sC4rmoGdUOgBB7VnwKt6HrL793l2voH1UlsyYZpJ4g0wfjnTEO1s1NP2eQ==" }, + "serialize-error": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-4.1.0.tgz", + "integrity": "sha512-5j9GgyGsP9vV9Uj1S0lDCvlsd+gc2LEPVK7HHHte7IyPwOD4lVQFeaX143gx3U5AnoCi+wbcb3mvaxVysjpxEw==", + "requires": { + "type-fest": "^0.3.0" + } + }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -5095,6 +5318,16 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" }, + "spawn-sync": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/spawn-sync/-/spawn-sync-1.0.15.tgz", + "integrity": "sha1-sAeZVX63+wyDdsKdROih6mfldHY=", + "dev": true, + "requires": { + "concat-stream": "^1.4.7", + "os-shim": "^0.1.2" + } + }, "spawn-wrap": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-1.4.3.tgz", @@ -5612,8 +5845,7 @@ "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" }, "table": { "version": "4.0.2", @@ -5876,21 +6108,6 @@ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" }, - "topo": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/topo/-/topo-3.0.3.tgz", - "integrity": "sha512-IgpPtvD4kjrJ7CRA3ov2FhWQADwv+Tdqbsf1ZnPUSAtCJ9e1Z44MmoSGDXGk4IppoZA7jd/QRkNddlLJWlUZsQ==", - "requires": { - "hoek": "6.x.x" - }, - "dependencies": { - "hoek": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-6.1.3.tgz", - "integrity": "sha512-YXXAAhmF9zpQbC7LEcREFtXfGq5K1fmd+4PHkBq8NUqmzW3G+Dq10bI/i0KucLRwss3YYFQ0fSfoxBZYiGUqtQ==" - } - } - }, "tough-cookie": { "version": "2.4.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", @@ -5977,6 +6194,11 @@ "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==" }, + "type-fest": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", + "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==" + }, "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -6126,16 +6348,19 @@ "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=" }, "winston": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/winston/-/winston-2.4.4.tgz", - "integrity": "sha512-NBo2Pepn4hK4V01UfcWcDlmiVTs7VTB1h7bgnB0rgP146bYhMxX0ypCz3lBOfNxCO4Zuek7yeT+y/zM1OfMw4Q==", - "requires": { - "async": "~1.0.0", - "colors": "1.0.x", - "cycle": "1.0.x", - "eyes": "0.1.x", - "isstream": "0.1.x", - "stack-trace": "0.0.x" + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.2.1.tgz", + "integrity": "sha512-zU6vgnS9dAWCEKg/QYigd6cgMVVNwyTzKs81XZtTFuRwJOcDdBg7AU0mXVyNbs7O5RH2zdv+BdNZUlx7mXPuOw==", + "requires": { + "async": "^2.6.1", + "diagnostics": "^1.1.1", + "is-stream": "^1.1.0", + "logform": "^2.1.1", + "one-time": "0.0.4", + "readable-stream": "^3.1.1", + "stack-trace": "0.0.x", + "triple-beam": "^1.3.0", + "winston-transport": "^4.3.0" } }, "winston-transport": { diff --git a/package.json b/package.json index c821218..20f7760 100644 --- a/package.json +++ b/package.json @@ -1,28 +1,24 @@ { "name": "@mojaloop/event-stream-processor", - "version": "v7.4.0", + "version": "v8.1.0", "description": "event stream processor to monitor kafka event topic and create traces and store logs to efk stack with APM", "main": "app.js", "dependencies": { - "@mojaloop/central-services-error-handling": "0.5.1", - "@mojaloop/central-services-shared": "3.7.1-snapshot", - "@mojaloop/central-services-stream": "3.9.0-snapshot", + "@hapi/hapi": "18.3.2", + "@mojaloop/central-services-error-handling": "7.5.0", + "@mojaloop/central-services-health": "8.1.0", + "@mojaloop/central-services-logger": "8.1.1", + "@mojaloop/central-services-shared": "8.1.1", + "@mojaloop/central-services-stream": "8.1.0", "@mojaloop/elastic-apm-node": "6.4.0-snapshot", "@mojaloop/elastic-apm-node-opentracing": "6.4.1-snapshot", - "@mojaloop/event-sdk": "7.4.0", "@mojaloop/opentracing": "6.4.0-snapshot", - "camelcase": "5.0.0", - "check-types": "7.4.0", - "config": "3.0.0", + "deserialize-error": "0.0.3", + "elasticsearch": "16.3.0", "fluent-logger": "3.3.1", "fluent-logger-stream": "0.0.1", - "healthcheck-server": "1.0.0", - "json-rules-engine": "2.3.0", - "lazy-ass": "1.6.0", - "lodash": "4.17.15", + "moment": "2.24.0", "mustache": "3.0.0", - "request": "2.88.0", - "request-promise-native": "1.0.7", "rxjs": "6.3.3", "rxjs-compat": "6.3.3", "tape": "4.9.1", @@ -33,17 +29,28 @@ "scripts": { "start": "WITH_SASL=0&&LD_LIBRARY_PATH=$PWD/node_modules/node-rdkafka/build/deps&& node app.js", "test": "npm run test:unit | faucet", + "standard": "standard", "test:unit": "tape 'test/unit/**/*.test.js'", "test:xunit": "tape 'test/unit/**/*.test.js' | tap-xunit", "test:coverage": "istanbul cover tape -- 'test/unit/**/*.test.js'", - "test:coverage-check": "npm run test:coverage && istanbul check-coverage" + "test:coverage-check": "npm run test:coverage && istanbul check-coverage", + "dep:check": "npx ncu -e 2", + "dep:update": "npx ncu -u" }, + "pre-commit": [ + "dep:check", + "standard" + ], "repository": { "type": "git", "url": "git+https://github.com/mojaloop/email-notifier" }, - "author": "Valentin Genev", - "license": "MIT", + "author": "ModusBox", + "contributors": [ + "Valentin Genev ", + "Miguel de Barros " + ], + "license": "Apache-2.0", "bugs": { "url": "https://github.com/mojaloop/email-notifier" }, @@ -54,6 +61,7 @@ "nodemailer-mock": "1.3.14", "npm-run-all": "4.0.1", "nyc": "14.1.1", + "pre-commit": "1.2.2", "proxyquire": "2.1.0", "rewire": "4.0.1", "rxjs-marbles": "5.0.0", diff --git a/src/lib/config.js b/src/lib/config.js index 28f76c5..ba6be30 100644 --- a/src/lib/config.js +++ b/src/lib/config.js @@ -1,3 +1,8 @@ -const config = require('config') +const RC = require('parse-strings-in-object')(require('rc')('EVENTSP', require('../../config/default.json'))) -module.exports = config +module.exports = { + PORT: RC.PORT, + EFK_CLIENT: RC.EFK_CLIENT, + APM: RC.APM, + KAFKA_CONFIG: RC.KAFKA +} diff --git a/src/lib/efk/index.js b/src/lib/efk/index.js index a845b6d..750fa65 100644 --- a/src/lib/efk/index.js +++ b/src/lib/efk/index.js @@ -1,15 +1,104 @@ -const logger = require('fluent-logger') +/***** + * @file This registers all handlers for the central-ledger API + License + -------------- + Copyright © 2017 Bill & Melinda Gates Foundation + 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 -module.exports.initLogger = async (prefix, options) => { - logger.configure(prefix, options) + http://www.apache.org/licenses/LICENSE-2.0 - logger.on('connect', () => { + 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. + + Contributors + -------------- + This is the official list of the Mojaloop project contributors for this file. + Names of the original copyright holders (individuals or organizations) + should be listed with a '*' in the first column. People who have + contributed from an organization can be listed under the organization + that actually holds the copyright for their contributions (see the + Gates Foundation organization for an example). Those individuals should have + their names indented and be marked with a '-'. Email address can be added + optionally within square brackets . + + * Gates Foundation + - Name Surname + + * ModusBox + - Valentin Genev + - Miguel de Barros + + -------------- + ******/ + +'use strict' + +const flogger = require('fluent-logger') +const Config = require('../../lib/config') +const Logger = require('@mojaloop/central-services-logger') +const Mustache = require('mustache') +const Moment = require('moment') + +const initLogger = async (prefix, options) => { + flogger.configure(prefix, options) + + flogger.on('connect', () => { Promise.resolve({ status: 'succes' }) }) - logger.on('error', (error) => { + flogger.on('error', (error) => { Promise.reject(error) }) } -module.exports.logger = logger +const elasticsearch = require('elasticsearch') + +const ElasticSearchClient = (() => { + let instance + let index + let currentDate + const createInstance = async () => { + try { + const client = new elasticsearch.Client({ + host: Config.EFK_CLIENT.host, + log: Config.EFK_CLIENT.log + }) + const resultPing = await client.ping({ + // ping usually has a 3000ms timeout + requestTimeout: 1000 + }) + Logger.info(`elasticsearch client connection result - ${resultPing}`) + return client + } catch (e) { + Logger.error(e) + throw e + } + } + + return { + getIndex: () => { + const nowDate = Moment() + if (!index || nowDate.diff(currentDate, 'days') > 0) { + const indexConfig = Config.EFK_CLIENT.index + currentDate = nowDate + const dateString = currentDate.format('YYYY.MM.DD') + index = Mustache.render(indexConfig.template, { + index: indexConfig.name, + date: dateString + }) + } + return index + }, + getInstance: async () => { + if (!instance) { + instance = await createInstance() + } + return instance + } + } +})() + +module.exports = { + initLogger, + logger: flogger, + ElasticSearchClient +} diff --git a/src/lib/kafka/index.js b/src/lib/healthCheck/subServiceHealth.js similarity index 60% rename from src/lib/kafka/index.js rename to src/lib/healthCheck/subServiceHealth.js index 6be8bc5..ef800e2 100644 --- a/src/lib/kafka/index.js +++ b/src/lib/healthCheck/subServiceHealth.js @@ -1,13 +1,11 @@ + /***** License -------------- Copyright © 2017 Bill & Melinda Gates Foundation 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 - http://www.apache.org/licenses/LICENSE-2.0 - 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. - Contributors -------------- This is the official list of the Mojaloop project contributors for this file. @@ -18,23 +16,40 @@ Gates Foundation organization for an example). Those individuals should have their names indented and be marked with a '-'. Email address can be added optionally within square brackets . - * Gates Foundation - Name Surname - * Rajiv Mothilal - * Miguel de Barros - + * Lewis Daly -------------- ******/ 'use strict' +const { statusEnum, serviceName } = require('@mojaloop/central-services-shared').HealthCheck.HealthCheckEnums +const Logger = require('@mojaloop/central-services-logger') +const Consumer = require('@mojaloop/central-services-shared').Util.Kafka.Consumer + /** - * @module src/handlers/lib/kafka + * @function getSubServiceHealthBroker + * + * @description Gets the health for the broker + * @returns Promise The SubService health object for the broker */ - -const Producer = require('./producer') +const getSubServiceHealthBroker = async () => { + const consumerTopics = Consumer.getListOfTopics() + let status = statusEnum.OK + try { + await Promise.all(consumerTopics.map(t => Consumer.isConnected(t))) + } catch (err) { + Logger.debug(`HealthCheck.getSubServiceHealthBroker failed with error ${err.message}.`) + status = statusEnum.DOWN + } + + return { + name: serviceName.broker, + status + } +} module.exports = { - Producer + getSubServiceHealthBroker } diff --git a/src/lib/kafka/consumer.js b/src/lib/kafka/consumer.js deleted file mode 100644 index 809f71f..0000000 --- a/src/lib/kafka/consumer.js +++ /dev/null @@ -1,160 +0,0 @@ -/***** - License - -------------- - Copyright © 2017 Bill & Melinda Gates Foundation - 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 - http://www.apache.org/licenses/LICENSE-2.0 - 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. - Contributors - -------------- - This is the official list of the Mojaloop project contributors for this file. - Names of the original copyright holders (individuals or organizations) - should be listed with a '*' in the first column. People who have - contributed from an organization can be listed under the organization - that actually holds the copyright for their contributions (see the - Gates Foundation organization for an example). Those individuals should have - their names indented and be marked with a '-'. Email address can be added - optionally within square brackets . - * Gates Foundation - - Name Surname - * Rajiv Mothilal - * Miguel de Barros - -------------- - ******/ - -'use strict' - -/** - * @module src/lib/kafka/consumer - */ - -const Consumer = require('@mojaloop/central-services-stream').Kafka.Consumer -const Logger = require('@mojaloop/central-services-shared').Logger -const Utility = require('./util') -const Enum = require('../enum') -let listOfConsumers = {} - -/** - * @function isConsumerAutoCommitEnabled - * - * @param {string} topicName - the topic name to locate a specific consumer - * - * @description This is used to get a consumer with the topic name to commit the messages that have been received - * - * @returns {Consumer} - Returns consumer - * @throws {Error} - if consumer not found for topic name - */ -const isConsumerAutoCommitEnabled = (topicName) => { - if (listOfConsumers[topicName]) { - return listOfConsumers[topicName].autoCommitEnabled - } else { - throw Error(`No consumer found for topic ${topicName}`) - } -} - -/** - * @function CreateHandler - * - * @param {string} topicName - the topic name to be registered for the required handler. Example: 'topic-dfsp1-transfer-prepare' - * @param {object} config - the config for the consumer for the specific functionality and action, retrieved from the default.json. Example: found in default.json 'KAFKA.CONSUMER.TRANSFER.PREPARE' - * @param {function} command - the callback handler for the topic. Will be called when the topic is produced against. Example: Command.prepareHandler() - * - * @description Parses the accountUri into a participant name from the uri string - * - * @returns {object} - Returns a Promise - * @throws {Error} - if failure occurs - */ - -const createHandler = async (topicName, config) => { - try { - Logger.info(`CreateHandle::connect - creating Consumer for topics: [${topicName}]`) - let consumer = {} - if (Array.isArray(topicName)) { - consumer = new Consumer(topicName, config) - } else { - consumer = new Consumer([topicName], config) - } - - let autoCommitEnabled = true - if (config.rdkafkaConf !== undefined && config.rdkafkaConf['enable.auto.commit'] !== undefined) { - autoCommitEnabled = config.rdkafkaConf['enable.auto.commit'] - } - - await consumer.connect().then(async () => { - Logger.info(`CreateHandle::connect - successful connected to topics: [${topicName}]`) - await consumer.consume() - if (Array.isArray(topicName)) { - for (let topic of topicName) { // NOT OK - listOfConsumers[topic] = { - consumer: consumer, - autoCommitEnabled: autoCommitEnabled - } - } - } else { - listOfConsumers[topicName] = { - consumer: consumer, - autoCommitEnabled: autoCommitEnabled - } - } - }).catch((e) => { - Logger.error(`CreateHandle::connect - error: ${e}`) - throw e - }) - } catch (e) { - Logger.error(`CreateHandle::connect - error: ${e}`) - throw e - } -} - -/** - * @function GetConsumer - * - * @param {string} topicName - the topic name to locate a specific consumer - * - * @description This is used to get a consumer with the topic name to commit the messages that have been received - * - * @returns {Consumer} - Returns consumer - * @throws {Error} - if consumer not found for topic name - */ -const getConsumer = (topicName) => { - if (listOfConsumers[topicName]) { - return listOfConsumers[topicName].consumer - } else { - throw Error(`No consumer found for topic ${topicName}`) - } -} - -/** - * @function registerNotificationHandler - * - * @description This is used to register the handler for the Notification topic according to a specified Kafka congfiguration - * - * @returns true - * @throws {Error} - if handler failed to create - */ -const registerEventHandler = async () => { - try { - let functionality = 'event' - if (Enum.topicMap[functionality]) { - functionality = Enum.topicMap[functionality].functionality - } - const EventHandler = { - topicName: Utility.createGeneralTopicConf(functionality).topicName, - config: Utility.getKafkaConfig(Utility.ENUMS.CONSUMER, functionality.toUpperCase()) - - } - EventHandler.config.rdkafkaConf['client.id'] = EventHandler.topicName - await createHandler(EventHandler.topicName, EventHandler.config) - return true - } catch (e) { - Logger.error(e) - throw e - } -} - -module.exports = { - createHandler, - getConsumer, - isConsumerAutoCommitEnabled, - registerEventHandler -} diff --git a/src/lib/kafka/producer.js b/src/lib/kafka/producer.js deleted file mode 100644 index b7a5877..0000000 --- a/src/lib/kafka/producer.js +++ /dev/null @@ -1,136 +0,0 @@ -/***** - License - -------------- - Copyright © 2017 Bill & Melinda Gates Foundation - 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 - - http://www.apache.org/licenses/LICENSE-2.0 - - 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. - - Contributors - -------------- - This is the official list of the Mojaloop project contributors for this file. - Names of the original copyright holders (individuals or organizations) - should be listed with a '*' in the first column. People who have - contributed from an organization can be listed under the organization - that actually holds the copyright for their contributions (see the - Gates Foundation organization for an example). Those individuals should have - their names indented and be marked with a '-'. Email address can be added - optionally within square brackets . - - * Gates Foundation - - Name Surname - - * Rajiv Mothilal - * Miguel de Barros - - -------------- - ******/ -'use strict' - -/** - * @module src/handlers/lib/kafka - */ - -const Producer = require('@mojaloop/central-services-stream').Kafka.Producer -const Logger = require('@mojaloop/central-services-shared').Logger - -let listOfProducers = {} - -/** - * @function ProduceMessage - * - * @param {object} messageProtocol - message being created against topic - * @param {object} topicConf - configuration for the topic to produce to - * @param {object} config - Producer configuration, eg: to produce batch or poll - * - * @description Creates a producer on Kafka for the specified topic and configuration - * - * @returns {boolean} - returns true if producer successfully created and producers to - * @throws {error} - if not successfully create/produced to - */ -const produceMessage = async (messageProtocol, topicConf, config) => { - try { - let producer - if (listOfProducers[topicConf.topicName]) { - producer = listOfProducers[topicConf.topicName] - } else { - Logger.info('Producer::start::topic=' + topicConf.topicName) - producer = new Producer(config) - Logger.info('Producer::connect::start') - await producer.connect() - Logger.info('Producer::connect::end') - listOfProducers[topicConf.topicName] = producer - } - Logger.info(`Producer.sendMessage::messageProtocol:'${JSON.stringify(messageProtocol)}'`) - await producer.sendMessage(messageProtocol, topicConf) - Logger.info('Producer::end') - return true - } catch (e) { - Logger.error(e) - Logger.info(`Producer error has occurred for ${topicConf.topicName}`) - throw e - } -} - -/** - * @function Disconnect - * - * @param {string} topicName - Producer of the specified topic to be disconnected. If this is null, then ALL producers will be disconnected. Defaults: null. - * - * @description Disconnects a specific producer, or ALL producers from Kafka - * - * @returns {object} Promise - */ -const disconnect = async (topicName = null) => { - if (topicName && typeof topicName === 'string') { - try { - await getProducer(topicName).disconnect() - } catch (e) { - throw e - } - } else if (topicName === null) { - let isError = false - let errorTopicList = [] - - let tpName - for (tpName in listOfProducers) { - try { - await getProducer(tpName).disconnect() - } catch (e) { - isError = true - errorTopicList.push({ topic: tpName, error: e.toString() }) - } - } - if (isError) { - throw Error(`The following Producers could not be disconnected: ${JSON.stringify(errorTopicList)}`) - } - } else { - throw Error(`Unable to disconnect Producer: ${topicName}`) - } -} - -/** - * @function GetProducer - * - * @param {string} topicName - the topic name to locate a specific producer - * - * @description This is used to get a producer with the topic name to send messages to a kafka topic - * - * @returns {Producer} - Returns consumer - * @throws {Error} - if consumer not found for topic name - */ -const getProducer = (topicName) => { - if (listOfProducers[topicName]) { - return listOfProducers[topicName] - } else { - throw Error(`No producer found for topic ${topicName}`) - } -} - -module.exports = { - getProducer, - produceMessage, - disconnect -} diff --git a/src/lib/kafka/util.js b/src/lib/kafka/util.js deleted file mode 100644 index d00bddf..0000000 --- a/src/lib/kafka/util.js +++ /dev/null @@ -1,178 +0,0 @@ -/***** - License - -------------- - Copyright © 2017 Bill & Melinda Gates Foundation - 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 - - http://www.apache.org/licenses/LICENSE-2.0 - - 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. - - Contributors - -------------- - This is the official list of the Mojaloop project contributors for this file. - Names of the original copyright holders (individuals or organizations) - should be listed with a '*' in the first column. People who have - contributed from an organization can be listed under the organization - that actually holds the copyright for their contributions (see the - Gates Foundation organization for an example). Those individuals should have - their names indented and be marked with a '-'. Email address can be added - optionally within square brackets . - - * Gates Foundation - - Name Surname - - * Rajiv Mothilal - - -------------- - ******/ - -'use strict' - -const Config = require('../../lib/config') -const Mustache = require('mustache') -const KafkaConfig = Config.KAFKA -const Logger = require('@mojaloop/central-services-shared').Logger -const Kafka = require('./index') -const Enum = require('../../lib/enum') - -/** - * The Producer config required - * - * @description This ENUM is for the PRODUCER of the topic being created - * - * @enum {object} ENUMS~PRODUCER - * @property {string} PRODUCER - PRODUCER config to be fetched - */ -const PRODUCER = 'PRODUCER' -const CONSUMER = 'CONSUMER' - -/** - * ENUMS - * - * @description Global ENUMS object - * - * @enum {string} ENUMS - * @property {string} PRODUCER - This ENUM is for the PRODUCER - * @property {string} CONSUMER - This ENUM is for the CONSUMER - */ -const ENUMS = { - PRODUCER, - CONSUMER -} - -/** - * @function GeneralTopicTemplate - * - * @description Generates a general topic name from the 2 inputs, which are used in the placeholder general topic template found in the default.json - * - * @param {string} functionality - the functionality flow. Example: 'event' - * - * @returns {string} - Returns topic name to be created, throws error if failure occurs - */ -const generalTopicTemplate = (functionality) => { - try { - return Mustache.render(Config.KAFKA.TOPIC_TEMPLATES.GENERAL_TOPIC_TEMPLATE.TEMPLATE, { functionality }) - } catch (e) { - Logger.error(e) - throw e - } -} - -/** - * @function TransformGeneralTopicName - * - * @description generalTopicTemplate called which generates a general topic name from the input, which are used in the placeholder general topic template found in the default.json - * - * @param {string} functionality - the functionality flow. Example: 'event' - * - * @returns {string} - Returns topic name to be created, throws error if failure occurs - */ -const transformGeneralTopicName = (functionality) => { - try { - if (Enum.topicMap[functionality] && Enum.topicMap[functionality]) { - return generalTopicTemplate(Enum.topicMap[functionality].functionality) - } - return generalTopicTemplate(functionality) - } catch (e) { - throw e - } -} - -/** - * @function GetKafkaConfig - * - * @description participantTopicTemplate called which generates a participant topic name from the 2 inputs, which are used in the placeholder participant topic template found in the default.json - * - * @param {string} flow - This is required for the config for the Stream Processing API. Example: 'PRODUCER' ie: note the case of text - * @param {string} functionality - the functionality flow. Example: 'EVENT' ie: note the case of text - * - * @returns {string} - Returns topic name to be created, throws error if failure occurs - */ -const getKafkaConfig = (flow, functionality) => { - try { - const flowObject = KafkaConfig[flow] - const functionalityObject = flowObject[functionality] - functionalityObject.config.logger = Logger - return functionalityObject.config - } catch (e) { - throw new Error(`No config found for those parameters flow='${flow}', functionality='${functionality}'`) - } -} - -/** - * @function createGeneralTopicConfig - * - * @param {string} functionality - the functionality flow. Example: 'transfer' ie: note the case of text - * @param {string} key - the key that gets assigned to the topic - * @param {number} partition - optional partition to produce to - * @param {*} opaqueKey - optional opaque token, which gets passed along to your delivery reports - * - * @returns {object} - Returns newly created general topicConfig - */ -const createGeneralTopicConf = (functionality, key = null, partition = null, opaqueKey = null) => { - return { - topicName: transformGeneralTopicName(functionality), - key, - partition, - opaqueKey - } -} - -/** - * @function produceGeneralMessage - * - * @async - * @description This is an async method that produces a message against a generated Kafka topic. it is called multiple times - * - * Kafka.Producer.produceMessage called to persist the message to the configured topic on Kafka - * Utility.updateMessageProtocolMetadata called updates the messages metadata - * Utility.createGeneralTopicConf called dynamically generates the general topic configuration - * Utility.getKafkaConfig called dynamically gets Kafka configuration - * - * @param {string} functionality - the functionality flow. Example: 'event' ie: note the case of text - * @param {object} message - a list of messages to consume for the relevant topic - * @param {string} key - key applicable to topic - * @param {string} partition - which partition the message should be produced to - * - * @returns {object} - Returns a boolean: true if successful, or throws and error if failed - */ -const produceGeneralMessage = async (functionality, message, key, partition) => { - let functionalityMapped = functionality - if (Enum.topicMap[functionality] && Enum.topicMap[functionality]) { - functionalityMapped = Enum.topicMap[functionality].functionality - } - Logger.info(`topicConf: ${JSON.stringify(createGeneralTopicConf(functionalityMapped, key, partition))}`) - let result = await Kafka.Producer.produceMessage(message, - createGeneralTopicConf(functionalityMapped, key, partition), - getKafkaConfig(ENUMS.PRODUCER, functionalityMapped.toUpperCase())) - return result -} - -module.exports = { - ENUMS, - transformGeneralTopicName, - getKafkaConfig, - createGeneralTopicConf, - produceGeneralMessage -} diff --git a/src/lib/tracer/index.js b/src/lib/tracer/index.js index e2a25ee..c2bde5a 100644 --- a/src/lib/tracer/index.js +++ b/src/lib/tracer/index.js @@ -1,11 +1,11 @@ const Agent = require('@mojaloop/elastic-apm-node') const Tracer = require('@mojaloop/elastic-apm-node-opentracing') const Config = require('../config') -const configuration = Config.util.toObject() const agent = (function () { - let self = Agent.start(configuration.apm) + let self = Agent.start(Config.APM) this.agent = self + self.captureError() return this })() diff --git a/src/observables/apmTracerObservable.js b/src/observables/apmTracerObservable.js index bd73c4a..56ebb63 100644 --- a/src/observables/apmTracerObservable.js +++ b/src/observables/apmTracerObservable.js @@ -1,7 +1,8 @@ const TraceParent = require('traceparent') const Rx = require('rxjs') -const Logger = require('@mojaloop/central-services-shared').Logger +const Logger = require('@mojaloop/central-services-logger') const { tracer } = require('../lib/tracer') +const deserializeError = require('deserialize-error') const apmTracerObservable = ({ message }) => { return Rx.Observable.create(observable => { @@ -26,10 +27,19 @@ const apmTracerObservable = ({ message }) => { span.setTag('error', true) !!code && span.setTag('errorCode', code) !!description && span.setTag('errorDescription', `error code: ${code} :: description: ${description}`) - !!description && span.log({ - event: 'error', - 'error.object': description - }) + if (!message.value.content.error) { + let passedError = message.value.content.payload ? new Error(message.value.content.payload) : Object.assign(new Error(description), message.value.content) + span.log({ + event: 'error', + 'error.object': passedError + }) + } else { + span.log({ + event: 'error', + 'error.object': deserializeError(message.value.content.error) + }) + // span._span._agent.captureError(deserializeError(message.value.content.error)) + } } span.finish(Date.parse(finishTimestamp)) observable.next({ span }) diff --git a/src/lib/enum.js b/src/observables/elastic-logger.js similarity index 50% rename from src/lib/enum.js rename to src/observables/elastic-logger.js index 6d4cebd..7180a9a 100644 --- a/src/lib/enum.js +++ b/src/observables/elastic-logger.js @@ -23,30 +23,57 @@ * Gates Foundation - Name Surname - * Rajiv Mothilal + * ModusBox + - Valentin Genev + - Miguel de Barros -------------- ******/ -'use strict' - -const eventType = { - EVENT: 'event' -} -const eventAction = { - AUDIT: 'audit', - LOG: 'log', - TRACE: 'trace' +const addElasticsearchMetaData = (value) => { + if (value.metadata && value.metadata.event && value.metadata.trace) { + const elasticsearchMetaData = { + 'processor': { + 'name': 'transaction', + 'event': 'transaction' + }, + 'trace': { + 'id': value.metadata.trace.traceId + }, + '@timestamp': value.metadata.event.createdAt, + 'transaction': { + 'result': (value.metadata.event.state.status === 'success') ? 'success' : 'error', + 'name': value.metadata.trace.service, + 'id': value.metadata.trace.spanId, + 'sampled': !value.metadata.trace.sampled + } + } + return {...value, ...elasticsearchMetaData} + } else { + return value + } } -const topicMap = { - 'event': { - functionality: eventType.EVENT - } +const Rx = require('rxjs') +const { ElasticSearchClient } = require('../lib/efk') +const Logger = require('@mojaloop/central-services-logger') + +const elasticsearchClientObservable = ({ message }) => { + return Rx.Observable.create(async observable => { + try { + const client = await ElasticSearchClient.getInstance() + await client.index({ + index: ElasticSearchClient.getIndex(), + body: addElasticsearchMetaData(message.value) + }) + observable.complete() + } catch (e) { + observable.error(e) + Logger.error(e) + } + }) } module.exports = { - eventType, - eventAction, - topicMap + elasticsearchClientObservable } diff --git a/src/observables/fluentd-logger.js b/src/observables/fluentd-logger.js index 98ac9eb..eb2add4 100644 --- a/src/observables/fluentd-logger.js +++ b/src/observables/fluentd-logger.js @@ -1,13 +1,11 @@ const Rx = require('rxjs') -const logger = require('../lib/efk').logger +const logger = require('../lib/efk').flogger const Config = require('../lib/config') -const configuration = Config.util.toObject() - const FluentdLoggerObservable = ({ message }) => { return Rx.Observable.create(observable => { try { - logger.emit(configuration.efk.namespace, message.value, (err) => { + logger.emit(Config.efk.namespace, message.value, (err) => { if (err) { observable.error(err) } }) observable.complete() diff --git a/src/observables/index.js b/src/observables/index.js index 7faf03f..ace2e47 100644 --- a/src/observables/index.js +++ b/src/observables/index.js @@ -26,5 +26,6 @@ module.exports = { fluentdObservable: require('./fluentd-logger').FluentdLoggerObservable, - apmTracerObservable: require('./apmTracerObservable').apmTracerObservable + apmTracerObservable: require('./apmTracerObservable').apmTracerObservable, + elasticsearchClientObservable: require('./elastic-logger').elasticsearchClientObservable } diff --git a/src/observables/log_it.js b/src/observables/log_it.js deleted file mode 100644 index 758eb70..0000000 --- a/src/observables/log_it.js +++ /dev/null @@ -1,6 +0,0 @@ -var message = {message: 'helloworld_new'} - -var Logger = require('fluent-logger-stream') -var logger = new Logger({tag: 'logstash', type: 'http', host: 'dev1-fluentd.mojaloop.live', port: 80}) //in_http -logger.send('logstash', message) - diff --git a/src/setup.js b/src/setup.js index 1e6865f..fb3e159 100644 --- a/src/setup.js +++ b/src/setup.js @@ -27,34 +27,28 @@ /** * @module src/setup */ -const Consumer = require('./lib/kafka/consumer') -const Utility = require('./lib/kafka/util') -const Enums = require('./lib/enum') -const Logger = require('@mojaloop/central-services-shared').Logger + +const Kafka = require('@mojaloop/central-services-shared').Util.Kafka +const Consumer = Kafka.Consumer +const Enum = require('@mojaloop/central-services-shared').Enum +const Logger = require('@mojaloop/central-services-logger') const Rx = require('rxjs') const { share, filter, flatMap } = require('rxjs/operators') -const createHealtcheck = require('healthcheck-server') const Config = require('./lib/config') -const { initLogger } = require('./lib/efk') -const configuration = Config.util.toObject() -// const { initTracer } = require('./lib/tracer') +const HealthCheck = require('@mojaloop/central-services-shared').HealthCheck.HealthCheck +const { createHealthCheckServer, defaultHealthHandler } = require('@mojaloop/central-services-health') +const packageJson = require('../package.json') +const { getSubServiceHealthBroker } = require('./lib/healthCheck/subServiceHealth') const Observables = require('./observables') const setup = async () => { - await initLogger(configuration.efk.namespace, configuration.efk) - // await initTracer(configuration.apm) - await Consumer.registerEventHandler() - const topicName = Utility.transformGeneralTopicName(Enums.eventType.EVENT) + await registerEventHandler() + const topicName = Kafka.transformGeneralTopicName(Config.KAFKA_CONFIG.TOPIC_TEMPLATES.GENERAL_TOPIC_TEMPLATE.TEMPLATE, Enum.Events.Event.Action.EVENT) const consumer = Consumer.getConsumer(topicName) - - createHealtcheck({ - port: Config.get('PORT'), - path: '/health', - status: ({ cpu, memory }) => { - if (consumer._status.running) return true - else return false - } - }) + const healthCheck = new HealthCheck(packageJson, [ + getSubServiceHealthBroker + ]) + await createHealthCheckServer(Config.PORT, defaultHealthHandler(healthCheck)) const topicObservable = Rx.Observable.create((observer) => { consumer.on('message', async (message) => { @@ -69,10 +63,15 @@ const setup = async () => { const sharedMessageObservable = topicObservable.pipe(share()) sharedMessageObservable.subscribe(async props => { - Observables.fluentdObservable(props).subscribe({ + // Observables.fluentdObservable(props).subscribe({ + // next: v => Logger.info(v), + // error: (e) => Logger.error(e), + // completed: () => Logger.info('fluentd log completed') + // }) + Observables.elasticsearchClientObservable(props).subscribe({ next: v => Logger.info(v), error: (e) => Logger.error(e), - completed: () => Logger.info('fluentd log completed') + completed: () => Logger.info('elastic API log completed') }) }) @@ -91,6 +90,30 @@ const setup = async () => { }) } +/** + * @function registerEventHandler + * + * @description This is used to register the handler for the Event topic according to a specified Kafka congfiguration + * + * @returns true + * @throws {Error} - if handler failed to create + */ +const registerEventHandler = async () => { + try { + const EventHandler = { + topicName: Kafka.transformGeneralTopicName(Config.KAFKA_CONFIG.TOPIC_TEMPLATES.GENERAL_TOPIC_TEMPLATE.TEMPLATE, Enum.Events.Event.Action.EVENT), + config: Kafka.getKafkaConfig(Config.KAFKA_CONFIG, Enum.Kafka.Config.CONSUMER, Enum.Events.Event.Type.EVENT.toUpperCase()) + + } + EventHandler.config.rdkafkaConf['client.id'] = EventHandler.topicName + await Consumer.createHandler(EventHandler.topicName, EventHandler.config) + return true + } catch (e) { + Logger.error(e) + throw e + } +} + module.exports = { setup } diff --git a/src/templates/register.js b/src/templates/register.js new file mode 100644 index 0000000..72761c5 --- /dev/null +++ b/src/templates/register.js @@ -0,0 +1,68 @@ +/***** + License + -------------- + Copyright © 2017 Bill & Melinda Gates Foundation + 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 + http://www.apache.org/licenses/LICENSE-2.0 + 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. + Contributors + -------------- + This is the official list of the Mojaloop project contributors for this file. + Names of the original copyright holders (individuals or organizations) + should be listed with a '*' in the first column. People who have + contributed from an organization can be listed under the organization + that actually holds the copyright for their contributions (see the + Gates Foundation organization for an example). Those individuals should have + their names indented and be marked with a '-'. Email address can be added + optionally within square brackets . + * Gates Foundation + - Name Surname + + * ModusBox + - Miguel de Barros + -------------- + ******/ +'use strict' + +const Logger = require('@mojaloop/central-services-logger') +const Config = require('../lib/config').util.toObject() + +const elasticsearch = require('elasticsearch') +const client = new elasticsearch.Client({ + host: Config.efkClient.host, + log: Config.efkClient.log +}) + +/** + * Function to register Mojaloop Templates for a Mojaloop specific Index on Elasticsearch. + * This is required as the event.content model needs to be `flattened` to support the dynamic content. + * Note that the content field must be of type Object (not a stirng, etc) to be correctly indexed. + * + * TODO: To be added to an init or migration script on startup. This file is manually executed at this moment. The init-script would need to first check if the template exists, and/if not it would then create the template. + * + * One can also run the following curl commands from project root: + * curl -X PUT "http://localhost:9200/_template/mojatemplate?pretty" -H 'Content-Type: application/json' -d @config/template-mojaloop.json' + * curl -X DELETE "http://localhost:9200/_template/mojatemplate" + * curl -X GET "http://localhost:9200/_template/mojatemplate" | jq + * + * @returns {Promise} + */ +const registerMojaloopTemplate = async () => { + const resultPing = await client.ping({ + // ping usually has a 3000ms timeout + requestTimeout: 1000 + }) + + Logger.debug(`connection result=${resultPing}`) + + const templateMojaloop = require('../../config/template-mojaloop.json') + const resultTemplate = await client.indices.putTemplate({ + name: 'mojatemplate', + create: false, + body: templateMojaloop + }) + + Logger.debug(`template create result=${JSON.stringify(resultTemplate)}`) +} + +registerMojaloopTemplate()