email-notifier 14.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/.circleci/config.yml +11 -0
  2. package/.dockerignore +17 -0
  3. package/.github/ISSUE_TEMPLATE/config.yml +1 -0
  4. package/.github/ISSUE_TEMPLATE/no-issue-template.md +18 -0
  5. package/.ncurc.yaml +2 -0
  6. package/.nvmrc +1 -0
  7. package/.nycrc.yml +19 -0
  8. package/.versionrc +15 -0
  9. package/CHANGELOG.md +68 -0
  10. package/CODEOWNERS +5 -0
  11. package/Dockerfile +44 -0
  12. package/LICENSE.md +10 -0
  13. package/README.md +135 -0
  14. package/app.js +34 -0
  15. package/audit-ci.jsonc +9 -0
  16. package/config/custom-environment-variables.json +17 -0
  17. package/config/default.json +96 -0
  18. package/istanbul.yml +14 -0
  19. package/onboarding.md +182 -0
  20. package/package.json +114 -0
  21. package/src/lib/config.js +3 -0
  22. package/src/lib/enum.js +149 -0
  23. package/src/lib/healthCheck/subServiceHealth.js +83 -0
  24. package/src/lib/kafka/consumer.js +200 -0
  25. package/src/lib/kafka/index.js +43 -0
  26. package/src/lib/kafka/producer.js- +136 -0
  27. package/src/lib/utility.js +251 -0
  28. package/src/nodeMailer/sendMail.js +101 -0
  29. package/src/observables/actions.js +91 -0
  30. package/src/observables/index.js +30 -0
  31. package/src/setup.js +81 -0
  32. package/templates/en/adjustment/dfspEmail.mustache +7 -0
  33. package/templates/en/adjustment/hubEmail.mustache +4 -0
  34. package/templates/en/breach/dfspEmail.mustache +11 -0
  35. package/templates/en/breach/hubEmail.mustache +10 -0
  36. package/templates/en/position/dfspEmail.mustache +6 -0
  37. package/templates/en/position/hubEmail.mustache +5 -0
  38. package/templates/index.js +36 -0
  39. package/test/messageSubmitter.js +21 -0
  40. package/test/unit/hanlder.test--.js +944 -0
  41. package/test/unit/lib/healthCheck/subServiceHealth.test.js +110 -0
  42. package/test/unit/lib/kafka/consumer.test.js +365 -0
  43. package/test/unit/lib/kafka/producer.test--.js +323 -0
  44. package/test/unit/lib/utility.test.js +152 -0
  45. package/test/unit/nodeMailer/sendMail.test.js +239 -0
  46. package/test/unit/observables/action.test.js +315 -0
  47. package/test/unit/setup.mmtest.js +151 -0
  48. package/test/unit/setup.test.js +123 -0
  49. package/test/unit/templates/empty.mustache +0 -0
  50. package/test/unit/templates/index.test.js +97 -0
  51. package/test/unit/templates/ok.template +1 -0
@@ -0,0 +1,11 @@
1
+ version: 2.1
2
+ setup: true
3
+ orbs:
4
+ build: mojaloop/build@1.0.22
5
+ workflows:
6
+ setup:
7
+ jobs:
8
+ - build/workflow:
9
+ filters:
10
+ tags:
11
+ only: /v\d+(\.\d+){2}(-[a-zA-Z-][0-9a-zA-Z-]*\.\d+)?/
package/.dockerignore ADDED
@@ -0,0 +1,17 @@
1
+ deploy/
2
+ coverage/
3
+ node_modules/
4
+ .dockerignore
5
+ .editorconfig
6
+ .git/
7
+ .gitignore
8
+ .istanbul.yml
9
+ circle.yml
10
+ docker-compose.circle.yml
11
+ docker-compose.dev.yml
12
+ docker-compose.functional.yml
13
+ docker-compose.yml
14
+ Dockerfile
15
+ LICENSE
16
+ README.md
17
+ sonar-project.properties
@@ -0,0 +1 @@
1
+ blank_issues_enabled: false
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: No Issue Template
3
+ about: " A template which asks users to post issues in the mojaloop/project repo "
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ <!--
11
+ This issue tracker is not monitored, and issues created here will be deleted. Please use the issue tracker in https://github.com/mojaloop/project
12
+
13
+ For other questions and help:
14
+ - Mojaloop Documentation - https://mojaloop.io/documentation
15
+ - Mojaloop on Github - https://github.com/mojaloop
16
+ - Mojaloop community Slack - https://mojaloop.slack.com (register here: https://mojaloop-slack.herokuapp.com/)
17
+
18
+ -->
package/.ncurc.yaml ADDED
@@ -0,0 +1,2 @@
1
+ ## Add a TODO comment indicating the reason for each rejected dependency upgrade added to this list, and what should be done to resolve it (i.e. handle it through a story, etc).
2
+ reject: []
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 18.20.4
package/.nycrc.yml ADDED
@@ -0,0 +1,19 @@
1
+ temp-directory: "./.nyc_output"
2
+ check-coverage: true
3
+ per-file: true
4
+ lines: 90
5
+ statements: 90
6
+ functions: 90
7
+ # branches: 90 ## TODO: This should be un-commented to 90 once code-coverage is improved!
8
+ all: true
9
+ include: [
10
+ "src/**/*.js"
11
+ ]
12
+ reporter: [
13
+ "lcov"
14
+ ]
15
+ exclude: [
16
+ "src/setup.js", # Ignoring this until there is a reason to test this file. Currently just exports the library functions.
17
+ "src/lib/kafka/index.js", # Ignoring this until there is a reason to test this file. Currently just exports the library functions.
18
+ "**/node_modules/**"
19
+ ]
package/.versionrc ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "types": [
3
+ {"type": "feat", "section": "Features"},
4
+ {"type": "fix", "section": "Bug Fixes"},
5
+ {"type": "docs", "section": "Documentation"},
6
+ {"type": "style", "section": "Styling"},
7
+ {"type": "refactor", "section": "Refactors"},
8
+ {"type": "perf", "section": "Performance"},
9
+ {"type": "test", "section": "Tests"},
10
+ {"type": "build", "section": "Build System"},
11
+ {"type": "ci", "section": "CI"},
12
+ {"type": "chore", "section": "Chore"},
13
+ {"type": "revert", "section": "Reverts"}
14
+ ]
15
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,68 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
+
5
+ ### [14.0.2](https://github.com/mojaloop/email-notifier/compare/v14.0.1...v14.0.2) (2025-01-16)
6
+
7
+ ### [14.0.1](https://github.com/mojaloop/email-notifier/compare/v14.0.0...v14.0.1) (2025-01-15)
8
+
9
+
10
+ ### Chore
11
+
12
+ * dependency updates pi26 ([#215](https://github.com/mojaloop/email-notifier/issues/215)) ([7f864f6](https://github.com/mojaloop/email-notifier/commit/7f864f69ffcf751be92c8a28363437277cd8cdf3))
13
+
14
+ ## [14.0.0](https://github.com/mojaloop/email-notifier/compare/v13.0.1...v14.0.0) (2023-11-06)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **mojaloop/#3615:** update dependencies ([#212](https://github.com/mojaloop/email-notifier/issues/212)) ([ba5373e](https://github.com/mojaloop/email-notifier/commit/ba5373eb9e5e6bd413fc562c1a6e721f45752aee)), closes [mojaloop/#3615](https://github.com/mojaloop/project/issues/3615)
20
+
21
+ ### [13.0.1](https://github.com/mojaloop/email-notifier/compare/v13.0.0...v13.0.1) (2023-10-31)
22
+
23
+
24
+ ### CI
25
+
26
+ * **mojaloop/#3533:** fix release pipeline ([#211](https://github.com/mojaloop/email-notifier/issues/211)) ([c3d33e1](https://github.com/mojaloop/email-notifier/commit/c3d33e1c3f1e31e5a4005e286338c3172a16a4ab))
27
+
28
+ ## [13.0.0](https://github.com/mojaloop/email-notifier/compare/v11.0.2...v13.0.0) (2023-10-12)
29
+
30
+
31
+ ### ⚠ BREAKING CHANGES
32
+
33
+ * upgrade ci, image, packages, audit (#202)
34
+
35
+ ### Features
36
+
37
+ * upgrade ci, image, packages, audit ([#202](https://github.com/mojaloop/email-notifier/issues/202)) ([9ff5ddb](https://github.com/mojaloop/email-notifier/commit/9ff5ddb5190905680a2759a45b0c6246c136b089))
38
+
39
+
40
+ ### Bug Fixes
41
+
42
+ * [Security] Bump hosted-git-info from 2.8.8 to 2.8.9 ([#182](https://github.com/mojaloop/email-notifier/issues/182)) ([209bc84](https://github.com/mojaloop/email-notifier/commit/209bc8420fa1e258e06de9176afda8975a21e18a))
43
+
44
+
45
+ ### Chore
46
+
47
+ * **#864-2:** change instanbul to nyc for coverage on all projects ([#192](https://github.com/mojaloop/email-notifier/issues/192)) ([c43e3c0](https://github.com/mojaloop/email-notifier/commit/c43e3c0daf44ee0316b7e966556971126b13105b)), closes [#864-2](https://github.com/mojaloop/email-notifier/issues/864-2) [#864-2](https://github.com/mojaloop/email-notifier/issues/864-2)
48
+ * **#864:** change instanbul to nyc for coverage on all projects ([#191](https://github.com/mojaloop/email-notifier/issues/191)) ([46d315f](https://github.com/mojaloop/email-notifier/commit/46d315f94df29ef324e4878c09218142cd6af7c6)), closes [#864](https://github.com/mojaloop/email-notifier/issues/864) [#864](https://github.com/mojaloop/email-notifier/issues/864)
49
+ * install replace ([#203](https://github.com/mojaloop/email-notifier/issues/203)) ([a8b2481](https://github.com/mojaloop/email-notifier/commit/a8b2481c70d90f797adf70ef820538cbc4d083a2))
50
+ * **mojaloop/#3446:** nodejs upgrade ([#209](https://github.com/mojaloop/email-notifier/issues/209)) ([e81a174](https://github.com/mojaloop/email-notifier/commit/e81a1742e421b7efb16e2763bb24ec3800c39b75)), closes [mojaloop/#3446](https://github.com/mojaloop/project/issues/3446)
51
+ * **release:** 12.0.0 [skip ci] ([#204](https://github.com/mojaloop/email-notifier/issues/204)) ([71aeec7](https://github.com/mojaloop/email-notifier/commit/71aeec72e0b6c2b39e222751fe5ab54e0abde5df))
52
+ * update libraries ([#210](https://github.com/mojaloop/email-notifier/issues/210)) ([0b19bb1](https://github.com/mojaloop/email-notifier/commit/0b19bb10eb91640018bd8213517abc61344d9964))
53
+
54
+ ## [12.0.0](https://github.com/mojaloop/email-notifier/compare/v11.0.2...v12.0.0) (2022-07-20)
55
+
56
+
57
+ ### ⚠ BREAKING CHANGES
58
+
59
+ * upgrade ci, image, packages, audit (#202)
60
+
61
+ ### Features
62
+
63
+ * upgrade ci, image, packages, audit ([#202](https://github.com/mojaloop/email-notifier/issues/202)) ([9ff5ddb](https://github.com/mojaloop/email-notifier/commit/9ff5ddb5190905680a2759a45b0c6246c136b089))
64
+
65
+
66
+ ### Bug Fixes
67
+
68
+ * [Security] Bump hosted-git-info from 2.8.8 to 2.8.9 ([#182](https://github.com/mojaloop/email-notifier/issues/182)) ([209bc84](https://github.com/mojaloop/email-notifier/commit/209bc8420fa1e258e06de9176afda8975a21e18a))
package/CODEOWNERS ADDED
@@ -0,0 +1,5 @@
1
+ # These owners will be the default owners for everything in
2
+ # the repo. Unless a later match takes precedence,
3
+ # The below users will be requested for
4
+ # review when someone opens a pull request.
5
+ * @mdebarros @elnyry-sam-k @vijayg10
package/Dockerfile ADDED
@@ -0,0 +1,44 @@
1
+ # Arguments
2
+ ARG NODE_VERSION=lts-alpine
3
+
4
+ # NOTE: Ensure you set NODE_VERSION Build Argument as follows...
5
+ #
6
+ # export NODE_VERSION="$(cat .nvmrc)-alpine" \
7
+ # docker build \
8
+ # --build-arg NODE_VERSION=$NODE_VERSION \
9
+ # -t mojaloop/sdk-scheme-adapter:local \
10
+ # . \
11
+ #
12
+
13
+ # Build Image
14
+ FROM node:${NODE_VERSION} as builder
15
+ WORKDIR /opt/app
16
+
17
+ RUN apk --no-cache add git
18
+ RUN apk add --no-cache -t build-dependencies make gcc g++ python3 libtool openssl-dev autoconf automake bash \
19
+ && cd $(npm root -g)/npm
20
+
21
+ COPY package.json package-lock.json* /opt/app/
22
+ RUN npm ci
23
+
24
+ COPY src /opt/app/src
25
+ COPY config /opt/app/config
26
+ COPY app.js /opt/app/
27
+ COPY templates /opt/app/templates
28
+
29
+ FROM node:${NODE_VERSION}
30
+ WORKDIR /opt/app
31
+
32
+ # Create empty log file & link stdout to the application log file
33
+ RUN mkdir ./logs && touch ./logs/combined.log
34
+ RUN ln -sf /dev/stdout ./logs/combined.log
35
+
36
+ # Create a non-root user: ml-user
37
+ RUN adduser -D ml-user
38
+ USER ml-user
39
+
40
+ COPY --chown=ml-user --from=builder /opt/app .
41
+ RUN npm prune --production
42
+
43
+ EXPOSE 3081
44
+ CMD node app.js
package/LICENSE.md ADDED
@@ -0,0 +1,10 @@
1
+ # LICENSE
2
+
3
+ Copyright © 2020 Mojaloop Foundation
4
+
5
+ The Mojaloop files are made available by the Mojaloop Foundation under the Apache License, Version 2.0
6
+ (the "License") and you may not use these files except in compliance with the [License](http://www.apache.org/licenses/LICENSE-2.0).
7
+
8
+ You may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
9
+
10
+ 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](http://www.apache.org/licenses/LICENSE-2.0).
package/README.md ADDED
@@ -0,0 +1,135 @@
1
+ # email-notifier
2
+ [![Git Commit](https://img.shields.io/github/last-commit/mojaloop/email-notifier.svg?style=flat)](https://github.com/mojaloop/email-notifier/commits/main)
3
+ [![Git Releases](https://img.shields.io/github/release/mojaloop/email-notifier.svg?style=flat)](https://github.com/mojaloop/email-notifier/releases)
4
+ [![Docker pulls](https://img.shields.io/docker/pulls/mojaloop/email-notifier.svg?style=flat)](https://hub.docker.com/r/mojaloop/email-notifier)
5
+ [![CircleCI](https://circleci.com/gh/mojaloop/email-notifier.svg?style=svg)](https://app.circleci.com/pipelines/github/mojaloop/email-notifier)
6
+
7
+ Email Notifier is a stand-alone email service that consumes messages from kafka topic, produced by the central-event-processor service.
8
+ The central-event-processor repo is available [here](https://github.com/mojaloop/central-event-processor/tree/main)
9
+ The email-notifier flow is available [here](https://github.com/mojaloop/central-event-processor/tree/main#Notifierflowseparateservice)
10
+
11
+ ## Contents
12
+
13
+ - [email-notifier](#email-notifier)
14
+ - [Contents](#contents)
15
+ - [Todo](#todo)
16
+ - [Config](#config)
17
+ - [Troubleshooting `npm install` on MacOS](#troubleshooting-npm-install-on-macos)
18
+ - [Auditing Dependencies](#auditing-dependencies)
19
+ - [Container Scans](#container-scans)
20
+
21
+ ## Todo
22
+
23
+ - Improve code-coverage to 90% across the board: [.nycrc.yml](./.nycrc.yml). Don't forget to un-comment out the branches code-coverage rule.
24
+
25
+ ## Config
26
+
27
+ Refer to [`./config/default.json`](config/default.json) for a detailed look at the configuration options.
28
+
29
+ For configuring email:
30
+
31
+ ```json
32
+ "emailSettings": {
33
+ "smtpConfig": {
34
+ "host": "smtp.gmail.com",
35
+ "port": 587,
36
+ "secureConnection": false,
37
+ "tls": {
38
+ "ciphers":"SSLv3"
39
+ },
40
+ "auth": {
41
+ "user": "modusboxnotifier@gmail.com",
42
+ "pass": "m0dusb0xn0t1f13r"
43
+ }
44
+ }
45
+ }
46
+ ```
47
+
48
+ Those can be passed as the following environment variables:
49
+
50
+ ```json
51
+ {
52
+ "emailSettings": {
53
+ "smtpConfig": {
54
+ "host": "MAIL_NOTIF_SMTP_HOST",
55
+ "port": "MAIL_NOTIF_SMTP_PORT",
56
+ "secureConnection": "MAIL_NOTIF_SMTP_SECURE_FLAG",
57
+ "tls": {
58
+ "ciphers":"MAIL_NOTIF_SMTP_TLS_CIPHERS"
59
+ },
60
+ "auth": {
61
+ "user": "MAIL_NOTIF_SMTP_USER",
62
+ "pass": "MAIL_NOTIF_SMTP_PASS"
63
+ }
64
+ }
65
+ }
66
+ }
67
+ ```
68
+
69
+ ## Troubleshooting `npm install` on MacOS
70
+
71
+ If you have this or similar error during installation:
72
+
73
+ ```bash
74
+ npm install
75
+ > node-gyp rebuild
76
+ clang: error: linker command failed with exit code 1
77
+ ```
78
+
79
+ add the following environment variables:
80
+ ```bash
81
+ export CPPFLAGS=-I/usr/local/opt/openssl/include
82
+ export LDFLAGS=-L/usr/local/opt/openssl/lib
83
+ ```
84
+
85
+ ## Auditing Dependencies
86
+
87
+ We use `audit-ci` along with `npm audit` to check dependencies for node vulnerabilities, and keep track of resolved dependencies with an `audit-ci.json` file.
88
+
89
+ To start a new resolution process, run:
90
+
91
+ ```bash
92
+ npm run audit:fix
93
+ ```
94
+
95
+ You can then check to see if the CI will pass based on the current dependencies with:
96
+
97
+ ```bash
98
+ npm run audit:check
99
+ ```
100
+
101
+ The [audit-ci.jsonc](./audit-ci.jsonc) contains any audit-exceptions that cannot be fixed to ensure that CircleCI will build correctly.
102
+
103
+ ## Container Scans
104
+
105
+ As part of our CI/CD process, we use anchore-cli to scan our built docker container for vulnerabilities upon release.
106
+
107
+ If you find your release builds are failing, refer to the [container scanning](https://github.com/mojaloop/ci-config#container-scanning) in our shared Mojaloop CI config repo. There is a good chance you simply need to update the `mojaloop-policy-generator.js` file and re-run the circleci workflow.
108
+
109
+ For more information on anchore and anchore-cli, refer to:
110
+
111
+ - [Anchore CLI](https://github.com/anchore/anchore-cli)
112
+ - [Circle Orb Registry](https://circleci.com/orbs/registry/orb/anchore/anchore-engine)
113
+
114
+ ## Automated Releases
115
+
116
+ As part of our CI/CD process, we use a combination of CircleCI, standard-version
117
+ npm package and github-release CircleCI orb to automatically trigger our releases
118
+ and image builds. This process essentially mimics a manual tag and release.
119
+ On a merge to main, CircleCI is configured to use the mojaloopci github account
120
+ to push the latest generated CHANGELOG and package version number.
121
+ Once those changes are pushed, CircleCI will pull the updated main, tag and
122
+ push a release triggering another subsequent build that also publishes a docker image.
123
+ ### Potential problems
124
+ * There is a case where the merge to main workflow will resolve successfully, triggering
125
+ a release. Then that tagged release workflow subsequently failing due to the image scan,
126
+ audit check, vulnerability check or other "live" checks.
127
+ This will leave main without an associated published build. Fixes that require
128
+ a new merge will essentially cause a skip in version number or require a clean up
129
+ of the main branch to the commit before the CHANGELOG and bump.
130
+ This may be resolved by relying solely on the previous checks of the
131
+ merge to main workflow to assume that our tagged release is of sound quality.
132
+ We are still mulling over this solution since catching bugs/vulnerabilities/etc earlier
133
+ is a boon.
134
+ * It is unknown if a race condition might occur with multiple merges with main in
135
+ quick succession, but this is a suspected edge case.
package/app.js ADDED
@@ -0,0 +1,34 @@
1
+ /*****
2
+ License
3
+ --------------
4
+ Copyright © 2017 Bill & Melinda Gates Foundation
5
+ The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
6
+ http://www.apache.org/licenses/LICENSE-2.0
7
+ Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
8
+ Contributors
9
+ --------------
10
+ This is the official list of the Mojaloop project contributors for this file.
11
+ Names of the original copyright holders (individuals or organizations)
12
+ should be listed with a '*' in the first column. People who have
13
+ contributed from an organization can be listed under the organization
14
+ that actually holds the copyright for their contributions (see the
15
+ Gates Foundation organization for an example). Those individuals should have
16
+ their names indented and be marked with a '-'. Email address can be added
17
+ optionally within square brackets <email>.
18
+ * Gates Foundation
19
+ - Name Surname <name.surname@gatesfoundation.com>
20
+ * Valentin Genev <valentin.genev@modusbox.com>
21
+ * Deon Botha <deon.botha@modusbox.com>
22
+ --------------
23
+ ******/
24
+
25
+ 'use strict'
26
+
27
+ const setup = require('./src/setup').setup
28
+ const Logger = require('@mojaloop/central-services-logger')
29
+
30
+ try {
31
+ setup()
32
+ } catch (err) {
33
+ Logger.info(`Notifier throws an error ${err}`)
34
+ }
package/audit-ci.jsonc ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "https://github.com/IBM/audit-ci/raw/main/docs/schema.json",
3
+ // audit-ci supports reading JSON, JSONC, and JSON5 config files.
4
+ // Only use one of ["low": true, "moderate": true, "high": true, "critical": true]
5
+ "moderate": true,
6
+ "allowlist": [
7
+
8
+ ]
9
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "emailSettings": {
3
+ "smtpConfig": {
4
+ "host": "MAIL_NOTIF_SMTP_HOST",
5
+ "port": "MAIL_NOTIF_SMTP_PORT",
6
+ "secureConnection": "MAIL_NOTIF_SMTP_SECURE_FLAG",
7
+ "tls": {
8
+ "ciphers":"MAIL_NOTIF_SMTP_TLS_CIPHERS"
9
+ },
10
+ "auth": {
11
+ "user": "MAIL_NOTIF_SMTP_USER",
12
+ "pass": "MAIL_NOTIF_SMTP_PASS"
13
+ }
14
+ }
15
+ },
16
+ "PORT": "MAIL_NOTIF_PORT"
17
+ }
@@ -0,0 +1,96 @@
1
+ {
2
+ "emailSettings": {
3
+ "smtpConfig": {
4
+ "host": "test.smpt.server",
5
+ "port": 587,
6
+ "secureConnection": true,
7
+ "tls": {
8
+ "ciphers": "SSLv3"
9
+ },
10
+ "auth": {
11
+ "user": "user",
12
+ "pass": "password"
13
+ }
14
+ }
15
+ },
16
+ "PORT": 3081,
17
+ "KAFKA": {
18
+ "TOPIC_TEMPLATES": {
19
+ "NOTIFICATION_TOPIC_TEMPLATE": {
20
+ "TEMPLATE": "topic-notification-event",
21
+ "REGEX": "topic-notification-event"
22
+ },
23
+ "GENERAL_TOPIC_TEMPLATE": {
24
+ "TEMPLATE": "topic-{{functionality}}-{{action}}",
25
+ "REGEX": "topic-(.*)-(.*)"
26
+ }
27
+ },
28
+ "CONSUMER": {
29
+ "NOTIFICATION": {
30
+ "EVENT": {
31
+ "config": {
32
+ "options": {
33
+ "mode": 2,
34
+ "batchSize": 1,
35
+ "recursiveTimeout": 100,
36
+ "messageCharset": "utf8",
37
+ "messageAsJSON": true,
38
+ "sync": true,
39
+ "consumeTimeout": 1000
40
+ },
41
+ "rdkafkaConf": {
42
+ "client.id": "enotifier-con",
43
+ "group.id": "enotifier-group",
44
+ "metadata.broker.list": "localhost:9092",
45
+ "socket.blocking.max.ms": 1,
46
+ "fetch.wait.max.ms": 1,
47
+ "fetch.error.backoff.ms": 1,
48
+ "queue.buffering.max.ms": 1,
49
+ "broker.version.fallback": "0.10.1.0",
50
+ "api.version.request": true,
51
+ "enable.auto.commit": false,
52
+ "auto.commit.interval.ms": 200,
53
+ "socket.keepalive.enable": true,
54
+ "socket.max.fails": 1,
55
+ "allow.auto.create.topics": true
56
+ },
57
+ "topicConf": {
58
+ "auto.offset.reset": "earliest"
59
+ }
60
+ }
61
+ }
62
+ }
63
+ },
64
+ "PRODUCER": {
65
+ "NOTIFICATION": {
66
+ "EVENT": {
67
+ "config": {
68
+ "options": {
69
+ "messageCharset": "utf8"
70
+ },
71
+ "rdkafkaConf": {
72
+ "debug": "all",
73
+ "metadata.broker.list": "localhost:9092",
74
+ "client.id": "enotifier-prod",
75
+ "event_cb": true,
76
+ "compression.codec": "none",
77
+ "retry.backoff.ms": 100,
78
+ "message.send.max.retries": 2,
79
+ "socket.keepalive.enable": true,
80
+ "queue.buffering.max.messages": 10000000,
81
+ "batch.num.messages": 100,
82
+ "dr_cb": true,
83
+ "socket.blocking.max.ms": 1,
84
+ "queue.buffering.max.ms": 1,
85
+ "broker.version.fallback": "0.10.1.0",
86
+ "api.version.request": true
87
+ }
88
+ }
89
+ }
90
+ }
91
+ }
92
+ },
93
+ "HUB_PARTICIPANT": {
94
+ "NAME": "Hub"
95
+ }
96
+ }
package/istanbul.yml ADDED
@@ -0,0 +1,14 @@
1
+ instrumentation:
2
+ include-all-sources: true
3
+ excludes: []
4
+ check:
5
+ global:
6
+ statements: 90
7
+ lines: 90
8
+ branches: 90
9
+ functions: 90
10
+ each:
11
+ statements: 90
12
+ lines: 90
13
+ branches: 90
14
+ functions: 90