@mojaloop/bulk-api-adapter 17.1.6

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 (82) hide show
  1. package/.circleci/config.yml +11 -0
  2. package/.dockerignore +17 -0
  3. package/.editorconfig +10 -0
  4. package/.env +0 -0
  5. package/.gitattributes +2 -0
  6. package/.ncurc.yaml +5 -0
  7. package/.nvmrc +1 -0
  8. package/.nycrc.yml +20 -0
  9. package/.versionrc +15 -0
  10. package/API.md +2 -0
  11. package/CHANGELOG.md +257 -0
  12. package/CODEOWNERS +38 -0
  13. package/Dockerfile +44 -0
  14. package/LICENSE.md +10 -0
  15. package/README.md +40 -0
  16. package/audit-ci.jsonc +9 -0
  17. package/config/default.json +164 -0
  18. package/docker/bulk-api-adapter/default.json +147 -0
  19. package/docker/central-ledger/default.json +460 -0
  20. package/docker/kafka/scripts/provision.sh +42 -0
  21. package/docker/sql-init/01_permissions.sql +2 -0
  22. package/docker/wait-for/wait-for-bulk-api-adapter.sh +11 -0
  23. package/docker/wait-for/wait-for-central-ledger.sh +13 -0
  24. package/docker/wait-for/wait-for-kafka.sh +7 -0
  25. package/docker/wait-for/wait-for-mockserver.sh +20 -0
  26. package/docker/wait-for/wait-for-mysql.sh +11 -0
  27. package/docker/wait-for/wait-for-objstore.sh +7 -0
  28. package/docker/wait-for/wait-for.env +11 -0
  29. package/docker/wait-for/wait-for.sh +81 -0
  30. package/docker-compose.yml +167 -0
  31. package/jsdoc.json +38 -0
  32. package/package.json +152 -0
  33. package/sonar-project.properties +17 -0
  34. package/src/api/handlers/bulkTransfers/{id}/error.js +71 -0
  35. package/src/api/handlers/bulkTransfers/{id}.js +98 -0
  36. package/src/api/handlers/bulkTransfers.js +77 -0
  37. package/src/api/handlers/endpointcache.js +48 -0
  38. package/src/api/handlers/health.js +52 -0
  39. package/src/api/handlers/metrics.js +50 -0
  40. package/src/api/index.js +42 -0
  41. package/src/api/routes.js +42 -0
  42. package/src/domain/bulkTransfer/index.js +219 -0
  43. package/src/domain/participant/index.js +61 -0
  44. package/src/domain/participant/lib/cache/participantEndpoint.js +127 -0
  45. package/src/handlers/api/health/plugin.js +51 -0
  46. package/src/handlers/api/health/routes.js +42 -0
  47. package/src/handlers/api/metrics/handler.js +34 -0
  48. package/src/handlers/api/metrics/plugin.js +52 -0
  49. package/src/handlers/api/metrics/routes.js +43 -0
  50. package/src/handlers/index.js +82 -0
  51. package/src/handlers/notification/index.js +362 -0
  52. package/src/handlers/register.js +54 -0
  53. package/src/interface/swagger.yaml +672 -0
  54. package/src/lib/config.js +100 -0
  55. package/src/lib/headers.js +78 -0
  56. package/src/lib/healthCheck/subServiceHealth.js +88 -0
  57. package/src/models/participant/facade.js +61 -0
  58. package/src/models/participant/participantEndpoint.js +79 -0
  59. package/src/shared/plugins.js +111 -0
  60. package/src/shared/setup.js +204 -0
  61. package/test/fixtures/.gitkeep +0 -0
  62. package/test/functional/.gitkeep +0 -0
  63. package/test/helpers.js +79 -0
  64. package/test/integration/.gitkeep +0 -0
  65. package/test/unit/api/handlers/bulkTransfers/{id}/error.test.js +140 -0
  66. package/test/unit/api/handlers/bulkTransfers/{id}.test.js +209 -0
  67. package/test/unit/api/handlers/notification/index.test.js +252 -0
  68. package/test/unit/data/bulkTransfers/{id}/error.js +28 -0
  69. package/test/unit/data/bulkTransfers/{id}.js +49 -0
  70. package/test/unit/data/bulkTransfers.js +28 -0
  71. package/test/unit/data/metrics.js +28 -0
  72. package/test/unit/data/mockgen.js +13 -0
  73. package/test/unit/data/transfers/{id}/error.js +28 -0
  74. package/test/unit/domain/bulkTransfers/index.test.js +181 -0
  75. package/test/unit/endpointcache.test.js +52 -0
  76. package/test/unit/handlers/notification/handler.test.js +323 -0
  77. package/test/unit/health.test.js +75 -0
  78. package/test/unit/lib/config.test.js +83 -0
  79. package/test/unit/lib/headers.test.js +111 -0
  80. package/test/unit/metrics.test.js +71 -0
  81. package/test-integration.Dockerfile +24 -0
  82. package/test.Dockerfile +22 -0
@@ -0,0 +1,11 @@
1
+ version: 2.1
2
+ setup: true
3
+ orbs:
4
+ build: mojaloop/build@1.0.55
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
package/.editorconfig ADDED
@@ -0,0 +1,10 @@
1
+ root = true
2
+
3
+ [*]
4
+ indent_style = space
5
+ indent_size = 2
6
+ trim_trailing_whitespace = true
7
+ insert_final_newline = true
8
+
9
+ [*.md]
10
+ trim_trailing_whitespace = false
package/.env ADDED
File without changes
package/.gitattributes ADDED
@@ -0,0 +1,2 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
package/.ncurc.yaml ADDED
@@ -0,0 +1,5 @@
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: [
3
+ # Issues created to resolve this: https://github.com/mojaloop/project/issues/3260
4
+ "@mojaloop/central-services-shared"
5
+ ]
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 18.20.4
package/.nycrc.yml ADDED
@@ -0,0 +1,20 @@
1
+ temp-directory: "./.nyc_output"
2
+ check-coverage: true
3
+ per-file: true
4
+ lines: 0
5
+ statements: 0
6
+ functions: 0
7
+ branches: 0
8
+ all: true
9
+ include: [
10
+ "src/**/*.js"
11
+ ]
12
+ reporter: [
13
+ "lcov",
14
+ "text-summary"
15
+ ]
16
+ exclude: [
17
+ "**/node_modules/**",
18
+ '**/migrations/**',
19
+ '**/docs/**'
20
+ ]
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/API.md ADDED
@@ -0,0 +1,2 @@
1
+ # BULK API ADAPTER API
2
+ ***
package/CHANGELOG.md ADDED
@@ -0,0 +1,257 @@
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
+ ### [17.1.6](https://github.com/mojaloop/bulk-api-adapter/compare/v17.1.5...v17.1.6) (2025-02-20)
6
+
7
+
8
+ ### Chore
9
+
10
+ * update orb version ([#121](https://github.com/mojaloop/bulk-api-adapter/issues/121)) ([8003ec3](https://github.com/mojaloop/bulk-api-adapter/commit/8003ec3968fc7281531a888d058adea7f332267a))
11
+
12
+ ### [17.1.5](https://github.com/mojaloop/bulk-api-adapter/compare/v17.1.4...v17.1.5) (2025-02-20)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * added xxx and xts test currency ([#120](https://github.com/mojaloop/bulk-api-adapter/issues/120)) ([da71844](https://github.com/mojaloop/bulk-api-adapter/commit/da718442c7c2b6d3325ccdfc0833c8df7a242d31))
18
+
19
+ ### [17.1.4](https://github.com/mojaloop/bulk-api-adapter/compare/v17.1.3...v17.1.4) (2025-01-28)
20
+
21
+
22
+ ### Chore
23
+
24
+ * maintenance updates ([#119](https://github.com/mojaloop/bulk-api-adapter/issues/119)) ([6c15a70](https://github.com/mojaloop/bulk-api-adapter/commit/6c15a7039a7156647374fb51e55ccac8b0fac269))
25
+
26
+ ### [17.1.3](https://github.com/mojaloop/bulk-api-adapter/compare/v17.1.2...v17.1.3) (2025-01-17)
27
+
28
+
29
+ ### Chore
30
+
31
+ * replace request with axios ([#112](https://github.com/mojaloop/bulk-api-adapter/issues/112)) ([bb2b689](https://github.com/mojaloop/bulk-api-adapter/commit/bb2b689ee90849008ab1ea1de445d5f4c555a2d6))
32
+
33
+ ### [17.1.2](https://github.com/mojaloop/bulk-api-adapter/compare/v17.1.1...v17.1.2) (2025-01-15)
34
+
35
+
36
+ ### Chore
37
+
38
+ * **deps:** bump axios and @mojaloop/central-services-shared ([#113](https://github.com/mojaloop/bulk-api-adapter/issues/113)) ([d7456ad](https://github.com/mojaloop/bulk-api-adapter/commit/d7456ad9b360a710d3539bcad71cd3529d4a2446))
39
+ * **deps:** bump cookie and express ([#114](https://github.com/mojaloop/bulk-api-adapter/issues/114)) ([252b6a6](https://github.com/mojaloop/bulk-api-adapter/commit/252b6a60bbfa6d4337c1d69bf30abd49418c3cb6))
40
+ * fix vulnerabilities, update deps ([#117](https://github.com/mojaloop/bulk-api-adapter/issues/117)) ([f6ebe09](https://github.com/mojaloop/bulk-api-adapter/commit/f6ebe0972bbe6fde1f83a12e9d0446d8fc7efef5))
41
+
42
+ ### [17.1.1](https://github.com/mojaloop/bulk-api-adapter/compare/v17.1.0...v17.1.1) (2024-09-18)
43
+
44
+
45
+ ### Bug Fixes
46
+
47
+ * fix catbox integration ([#110](https://github.com/mojaloop/bulk-api-adapter/issues/110)) ([3896a03](https://github.com/mojaloop/bulk-api-adapter/commit/3896a038aecd96988741f519683a71fee747a7f0))
48
+
49
+ ## [17.1.0](https://github.com/mojaloop/bulk-api-adapter/compare/v17.0.2...v17.1.0) (2024-06-26)
50
+
51
+
52
+ ### Features
53
+
54
+ * **csi-164:** parameterize switch id ([#109](https://github.com/mojaloop/bulk-api-adapter/issues/109)) ([17a63f6](https://github.com/mojaloop/bulk-api-adapter/commit/17a63f6f98aef48bec72925ff48ed96d7c426a38))
55
+
56
+ ### [17.0.2](https://github.com/mojaloop/bulk-api-adapter/compare/v17.0.1...v17.0.2) (2024-06-14)
57
+
58
+
59
+ ### Chore
60
+
61
+ * updates to tough cookie dependency ([#108](https://github.com/mojaloop/bulk-api-adapter/issues/108)) ([2a5de21](https://github.com/mojaloop/bulk-api-adapter/commit/2a5de2179f41ad5703a7e9d94a31974189b472ee))
62
+
63
+ ### [17.0.1](https://github.com/mojaloop/bulk-api-adapter/compare/v17.0.0...v17.0.1) (2024-06-12)
64
+
65
+
66
+ ### Chore
67
+
68
+ * dependency updates and minor maintenance ([#107](https://github.com/mojaloop/bulk-api-adapter/issues/107)) ([b9ed50a](https://github.com/mojaloop/bulk-api-adapter/commit/b9ed50a38b8ee344803c638457063512c528361c))
69
+ * **deps:** bump express from 4.18.2 to 4.19.2 ([#104](https://github.com/mojaloop/bulk-api-adapter/issues/104)) ([115e80d](https://github.com/mojaloop/bulk-api-adapter/commit/115e80d95c7325683906a35c87ed65b07bb295be))
70
+ * **deps:** bump follow-redirects from 1.15.2 to 1.15.6 ([#105](https://github.com/mojaloop/bulk-api-adapter/issues/105)) ([8b7a834](https://github.com/mojaloop/bulk-api-adapter/commit/8b7a834c8a9385d6b544a033ac022a27f815ff84))
71
+
72
+ ## [17.0.0](https://github.com/mojaloop/bulk-api-adapter/compare/v16.0.1...v17.0.0) (2023-11-06)
73
+
74
+
75
+ ### Bug Fixes
76
+
77
+ * **mojaloop/#3615:** update dependencies ([#103](https://github.com/mojaloop/bulk-api-adapter/issues/103)) ([326dbd0](https://github.com/mojaloop/bulk-api-adapter/commit/326dbd07744e555d7fe1d06d3d899cd1e9c10abe)), closes [mojaloop/#3615](https://github.com/mojaloop/project/issues/3615)
78
+
79
+ ### [16.0.1](https://github.com/mojaloop/bulk-api-adapter/compare/v16.0.0...v16.0.1) (2023-10-20)
80
+
81
+
82
+ ### Bug Fixes
83
+
84
+ * **mojaloop/#3589:** fix mongoose 'promiseLibrary' option bug ([#102](https://github.com/mojaloop/bulk-api-adapter/issues/102)) ([b770c0a](https://github.com/mojaloop/bulk-api-adapter/commit/b770c0ab9a92effbb5017d56bce9ee76b4d1fd29)), closes [#3589](https://github.com/mojaloop/bulk-api-adapter/issues/3589)
85
+
86
+ ## [16.0.0](https://github.com/mojaloop/bulk-api-adapter/compare/v15.0.4...v16.0.0) (2023-09-14)
87
+
88
+
89
+ ### CI
90
+
91
+ * fix nodejs version for image and license scans ([#100](https://github.com/mojaloop/bulk-api-adapter/issues/100)) ([0389050](https://github.com/mojaloop/bulk-api-adapter/commit/038905006163807f99525f6ca2d7c3e68b10eec5))
92
+
93
+ ### [15.0.4](https://github.com/mojaloop/bulk-api-adapter/compare/v15.0.3...v15.0.4) (2023-09-12)
94
+
95
+
96
+ ### Chore
97
+
98
+ * **mojaloop/#3447:** nodejs upgrade ([#99](https://github.com/mojaloop/bulk-api-adapter/issues/99)) ([b8de756](https://github.com/mojaloop/bulk-api-adapter/commit/b8de756651eb9975f965e817481c29b3aac32915)), closes [mojaloop/#3447](https://github.com/mojaloop/project/issues/3447)
99
+
100
+ ### [15.0.3](https://github.com/mojaloop/bulk-api-adapter/compare/v15.0.2...v15.0.3) (2023-03-30)
101
+
102
+
103
+ ### Bug Fixes
104
+
105
+ * **mojaloop/#3260:** incoming requests are failing with argument stream failure ([#98](https://github.com/mojaloop/bulk-api-adapter/issues/98) ([64960c5](https://github.com/mojaloop/bulk-api-adapter/commit/64960c52e1477b08becd01209048fccd491a9437)), closes [mojaloop/#3260](https://github.com/mojaloop/project/issues/3260)
106
+
107
+ ### [15.0.2](https://github.com/mojaloop/bulk-api-adapter/compare/v15.0.1...v15.0.2) (2023-03-29)
108
+
109
+
110
+ ### Bug Fixes
111
+
112
+ * removed connection string for mongodb being logged to log ([#97](https://github.com/mojaloop/bulk-api-adapter/issues/97)) ([839f515](https://github.com/mojaloop/bulk-api-adapter/commit/839f515648081d9e8cb99c94cc89300d3e6f8284))
113
+
114
+ ### [15.0.1](https://github.com/mojaloop/bulk-api-adapter/compare/v15.0.0...v15.0.1) (2023-03-29)
115
+
116
+
117
+ ### Bug Fixes
118
+
119
+ * **mojaloop/#3255:** mongoDB connection uRI failing when auth details contain special chars ([#96](https://github.com/mojaloop/bulk-api-adapter/issues/96)) ([5ceb464](https://github.com/mojaloop/bulk-api-adapter/commit/5ceb464ce7f1f8e8625087097955d9ae3a3a2b1d)), closes [mojaloop/#3255](https://github.com/mojaloop/project/issues/3255)
120
+
121
+ ## [15.0.0](https://github.com/mojaloop/bulk-api-adapter/compare/v14.2.0...v15.0.0) (2023-02-22)
122
+
123
+
124
+ ### ⚠ BREAKING CHANGES
125
+
126
+ * **mojaloop/#3131:** seperate mongo uri config (#95)
127
+
128
+ ### Features
129
+
130
+ * **mojaloop/#3131:** seperate mongo uri config ([#95](https://github.com/mojaloop/bulk-api-adapter/issues/95)) ([5ae3f18](https://github.com/mojaloop/bulk-api-adapter/commit/5ae3f18a362950ac514613f08dfac6ec84e29a17)), closes [mojaloop/#3131](https://github.com/mojaloop/project/issues/3131)
131
+
132
+ ## [14.2.0](https://github.com/mojaloop/bulk-api-adapter/compare/v14.1.1...v14.2.0) (2022-11-11)
133
+
134
+
135
+ ### Features
136
+
137
+ * **mojaloop/2867:** switch as fspiop source ([#90](https://github.com/mojaloop/bulk-api-adapter/issues/90)) ([af5680d](https://github.com/mojaloop/bulk-api-adapter/commit/af5680d9db79ffebc43842f100d1dc261501a9c8))
138
+
139
+ ### [14.1.1](https://github.com/mojaloop/bulk-api-adapter/compare/v14.1.0...v14.1.1) (2022-08-18)
140
+
141
+
142
+ ### Bug Fixes
143
+
144
+ * **mojaloop/#2863:** fix put callback http code ([#89](https://github.com/mojaloop/bulk-api-adapter/issues/89)) ([c6699ad](https://github.com/mojaloop/bulk-api-adapter/commit/c6699ad695e0a4627fd76d4288b9ef6e64cd2130))
145
+
146
+ ## [14.1.0](https://github.com/mojaloop/bulk-api-adapter/compare/v14.0.2...v14.1.0) (2022-08-12)
147
+
148
+
149
+ ### Features
150
+
151
+ * **mojaloop/#2796:** duplicate transaction not getting callback for post /bulkTransfers ([#86](https://github.com/mojaloop/bulk-api-adapter/issues/86)) ([fcc7799](https://github.com/mojaloop/bulk-api-adapter/commit/fcc7799368c54adf54c729627ce1e424cbd2df16)), closes [mojaloop/#2796](https://github.com/mojaloop/project/issues/2796)
152
+
153
+ ### [14.0.2](https://github.com/mojaloop/bulk-api-adapter/compare/v14.0.1...v14.0.2) (2022-08-11)
154
+
155
+
156
+ ### Bug Fixes
157
+
158
+ * remove buiness logic from bulk-api-adapter ([#87](https://github.com/mojaloop/bulk-api-adapter/issues/87)) ([4fac6a8](https://github.com/mojaloop/bulk-api-adapter/commit/4fac6a8662336d1fc911156dff8e5aeadea76d6d))
159
+
160
+ ### [14.0.1](https://github.com/mojaloop/bulk-api-adapter/compare/v14.0.0...v14.0.1) (2022-08-01)
161
+
162
+
163
+ ### Bug Fixes
164
+
165
+ * update bulkPrepare kafka message to use headers ([#83](https://github.com/mojaloop/bulk-api-adapter/issues/83)) ([4c39f3d](https://github.com/mojaloop/bulk-api-adapter/commit/4c39f3dfe9b84d6802e024eca77d35f0f1f2280d))
166
+
167
+ ## [14.0.0](https://github.com/mojaloop/bulk-api-adapter/compare/v13.0.1...v14.0.0) (2022-07-07)
168
+
169
+
170
+ ### ⚠ BREAKING CHANGES
171
+
172
+ * upgrade ci, image, packages, audit (#82)
173
+
174
+ ### Features
175
+
176
+ * upgrade ci, image, packages, audit ([#82](https://github.com/mojaloop/bulk-api-adapter/issues/82)) ([a7c67bd](https://github.com/mojaloop/bulk-api-adapter/commit/a7c67bdae473f85ff4523a4a450b1634fc3fb784))
177
+
178
+ ### [13.0.1](https://github.com/mojaloop/bulk-api-adapter/compare/v13.0.0...v13.0.1) (2022-03-07)
179
+
180
+
181
+ ### Bug Fixes
182
+
183
+ * core-services support for non-breaking backward api compatibility ([#77](https://github.com/mojaloop/bulk-api-adapter/issues/77)) ([d3275b0](https://github.com/mojaloop/bulk-api-adapter/commit/d3275b0c82b18fb48de3e32e8d2e2c0a2a551aa1)), closes [#2704](https://github.com/mojaloop/bulk-api-adapter/issues/2704)
184
+
185
+ ## [13.0.0](https://github.com/mojaloop/bulk-api-adapter/compare/v12.1.0...v13.0.0) (2022-03-04)
186
+
187
+
188
+ ### ⚠ BREAKING CHANGES
189
+
190
+ * **mojaloop/#2704:** - Config PROTOCOL_VERSIONS.CONTENT has now been modified to support backward compatibility for minor versions (i.e. v1.0 & 1.1) as follows:
191
+
192
+ > ```
193
+ > "PROTOCOL_VERSIONS": {
194
+ > "CONTENT": "1.1", <-- used when generating messages from the "SWITCH", and validate incoming FSPIOP API requests/callbacks CONTENT-TYPE headers
195
+ > "ACCEPT": {
196
+ > "DEFAULT": "1", <-- used when generating messages from the "SWITCH"
197
+ > "VALIDATELIST": [ <-- used to validate incoming FSPIOP API requests/callbacks ACCEPT headers
198
+ > "1",
199
+ > "1.0",
200
+ > "1.1"
201
+ > ]
202
+ > }
203
+ > },
204
+ > ```
205
+ >
206
+ > to be consistent with the ACCEPT structure as follows:
207
+ >
208
+ > ```
209
+ > "PROTOCOL_VERSIONS": {
210
+ > "CONTENT": {
211
+ > "DEFAULT": "1.1", <-- used when generating messages from the "SWITCH"
212
+ > "VALIDATELIST": [ <-- used to validate incoming FSPIOP API requests/callbacks CONTENT-TYPE headers
213
+ > "1.1",
214
+ > "1.0"
215
+ > ]
216
+ > },
217
+ > "ACCEPT": {
218
+ > "DEFAULT": "1", <-- used when generating messages from the "SWITCH"
219
+ > "VALIDATELIST": [ <-- used to validate incoming FSPIOP API requests/callbacks ACCEPT headers
220
+ > "1",
221
+ > "1.0",
222
+ > "1.1"
223
+ > ]
224
+ > }
225
+ > },
226
+ > ```
227
+
228
+ ### Features
229
+
230
+ * **mojaloop/#2704:** core-services support for non-breaking backward api compatibility ([#74](https://github.com/mojaloop/bulk-api-adapter/issues/74)) ([62afc4e](https://github.com/mojaloop/bulk-api-adapter/commit/62afc4e9637599474f8761617b084a3da9ca4398)), closes [mojaloop/#2704](https://github.com/mojaloop/project/issues/2704)
231
+
232
+ ## [12.1.0](https://github.com/mojaloop/bulk-api-adapter/compare/v12.0.2...v12.1.0) (2021-12-14)
233
+
234
+
235
+ ### Features
236
+
237
+ * **mojaloop/#2608:** injected resource versions config for outbound requests ([#70](https://github.com/mojaloop/bulk-api-adapter/issues/70)) ([a2c6a91](https://github.com/mojaloop/bulk-api-adapter/commit/a2c6a918799bb833ede26924b3598ffa954023ff)), closes [mojaloop/#2608](https://github.com/mojaloop/project/issues/2608)
238
+
239
+ ### [12.0.2](https://github.com/mojaloop/bulk-api-adapter/compare/v12.0.1...v12.0.2) (2021-11-22)
240
+
241
+
242
+ ### Bug Fixes
243
+
244
+ * release v13.1.0 ([#69](https://github.com/mojaloop/bulk-api-adapter/issues/69)) ([5464a62](https://github.com/mojaloop/bulk-api-adapter/commit/5464a62348782ae3b75997b1fa8dfd4bcdb10cef)), closes [mojaloop/#2584](https://github.com/mojaloop/project/issues/2584)
245
+
246
+ ### [12.0.1](https://github.com/mojaloop/bulk-api-adapter/compare/v12.0.0...v12.0.1) (2021-11-18)
247
+
248
+ ## [12.0.0](https://github.com/mojaloop/bulk-api-adapter/compare/v11.1.4...v12.0.0) (2021-11-17)
249
+
250
+
251
+ ### ⚠ BREAKING CHANGES
252
+
253
+ * **mojaloop/#2538:** Forcing a major version change for awareness of the config changes. The `LIB_RESOURCE_VERSIONS` env var is now deprecated, and this is now also controlled by the PROTOCOL_VERSIONS config in the default.json. This has been done for consistency between all API services going forward and unifies the config for both inbound and outbound Protocol API validation/transformation features.
254
+
255
+ ### Bug Fixes
256
+
257
+ * **mojaloop/#2538:** fspiop api version negotiation not handled ([#67](https://github.com/mojaloop/bulk-api-adapter/issues/67)) ([416293a](https://github.com/mojaloop/bulk-api-adapter/commit/416293af3bded50986437a5a91797c65ce2b9c38)), closes [mojaloop/#2538](https://github.com/mojaloop/project/issues/2538)
package/CODEOWNERS ADDED
@@ -0,0 +1,38 @@
1
+ # This is a comment.
2
+ # Each line is a file pattern followed by one or more owners.
3
+
4
+ ## These owners will be the default owners for everything in
5
+ ## the repo. Unless a later match takes precedence,
6
+ ## @global-owner1 and @global-owner2 will be requested for
7
+ ## review when someone opens a pull request.
8
+ #* @global-owner1 @global-owner2
9
+ * @elnyry-sam-k @vijayg10 @kleyow @oderayi @bushjames @geka-evk @shashi165 @gibaros
10
+
11
+ ## Order is important; the last matching pattern takes the most
12
+ ## precedence. When someone opens a pull request that only
13
+ ## modifies JS files, only @js-owner and not the global
14
+ ## owner(s) will be requested for a review.
15
+ # *.js @js-owner
16
+
17
+ ## You can also use email addresses if you prefer. They'll be
18
+ ## used to look up users just like we do for commit author
19
+ ## emails.
20
+ #*.go docs@example.com
21
+
22
+ # In this example, @doctocat owns any files in the build/logs
23
+ # directory at the root of the repository and any of its
24
+ # subdirectories.
25
+ # /build/logs/ @doctocat
26
+
27
+ ## The `docs/*` pattern will match files like
28
+ ## `docs/getting-started.md` but not further nested files like
29
+ ## `docs/build-app/troubleshooting.md`.
30
+ # docs/* docs@example.com
31
+
32
+ ## In this example, @octocat owns any file in an apps directory
33
+ ## anywhere in your repository.
34
+ #apps/ @octocat
35
+
36
+ ## In this example, @doctocat owns any file in the `/docs`
37
+ ## directory in the root of your repository.
38
+ #/docs/ @doctocat
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
+
16
+ USER root
17
+
18
+ WORKDIR /opt/app/
19
+
20
+ RUN apk add --no-cache -t build-dependencies git make gcc g++ python3 py3-setuptools libtool autoconf automake bash \
21
+ && cd $(npm root -g)/npm
22
+
23
+ COPY package.json package-lock.json* /opt/app/
24
+ RUN npm ci
25
+
26
+ COPY src /opt/app/src
27
+ COPY config /opt/app/config
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: app-user
37
+ RUN adduser -D app-user
38
+ USER app-user
39
+
40
+ COPY --chown=app-user --from=builder /opt/app/ .
41
+ RUN npm prune --production
42
+
43
+ EXPOSE 3000
44
+ CMD ["node src/api/index.js"]
package/LICENSE.md ADDED
@@ -0,0 +1,10 @@
1
+ # LICENSE
2
+
3
+ Copyright © 2020-2025 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,40 @@
1
+ # bulk-api-adapter
2
+ [![Git Commit](https://img.shields.io/github/last-commit/mojaloop/bulk-api-adapter.svg?style=flat)](https://github.com/mojaloop/bulk-api-adapter/commits/main)
3
+ [![Git Releases](https://img.shields.io/github/release/mojaloop/bulk-api-adapter.svg?style=flat)](https://github.com/mojaloop/bulk-api-adapter/releases)
4
+ [![Docker pulls](https://img.shields.io/docker/pulls/mojaloop/bulk-api-adapter.svg?style=flat)](https://hub.docker.com/r/mojaloop/bulk-api-adapter)
5
+ [![CircleCI](https://circleci.com/gh/mojaloop/bulk-api-adapter.svg?style=svg)](https://app.circleci.com/pipelines/github/mojaloop/bulk-api-adapter)
6
+
7
+ Bulk Transfers API and notifications.
8
+
9
+ ## API Definition
10
+
11
+ Swagger API [location](./src/interface/swagger.yaml)
12
+
13
+ ## Auditing Dependencies
14
+
15
+ We use `audit-ci` along with `npm audit` to check dependencies for node vulnerabilities, and keep track of resolved dependencies with an `audit-ci.jsonc` file.
16
+
17
+ To start a new resolution process, run:
18
+
19
+ ```bash
20
+ npm run audit:fix
21
+ ```
22
+
23
+ You can then check to see if the CI will pass based on the current dependencies with:
24
+
25
+ ```bash
26
+ npm run audit:check
27
+ ```
28
+
29
+ The [audit-ci.jsonc](./audit-ci.jsonc) contains any audit-exceptions that cannot be fixed to ensure that CircleCI will build correctly.
30
+
31
+ ## Container Scans
32
+
33
+ As part of our CI/CD process, we use anchore-cli to scan our built docker container for vulnerabilities upon release.
34
+
35
+ 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.
36
+
37
+ For more information on anchore and anchore-cli, refer to:
38
+ - [Anchore CLI](https://github.com/anchore/anchore-cli)
39
+ - [Circle Orb Registry](https://circleci.com/orbs/registry/orb/anchore/anchore-engine)
40
+
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": [ // NOTE: Please add as much information as possible to any items added to the allowList
7
+ // Currently no fixes available for the following
8
+ ]
9
+ }
@@ -0,0 +1,164 @@
1
+ {
2
+ "HUB_PARTICIPANT": {
3
+ "ID": 1,
4
+ "NAME": "Hub"
5
+ },
6
+ "PORT": 3003,
7
+ "HOSTNAME": "http://bulk-api-adapter",
8
+ "PROTOCOL_VERSIONS": {
9
+ "CONTENT": {
10
+ "DEFAULT": "1.1",
11
+ "VALIDATELIST": [
12
+ "1.1",
13
+ "1.0"
14
+ ]
15
+ },
16
+ "ACCEPT": {
17
+ "DEFAULT": "1",
18
+ "VALIDATELIST": [
19
+ "1",
20
+ "1.0",
21
+ "1.1"
22
+ ]
23
+ }
24
+ },
25
+ "ENDPOINT_SOURCE_URL": "http://localhost:3001/participants/{{fsp}}/endpoints",
26
+ "ENDPOINT_HEALTH_URL": "http://localhost:3001/health",
27
+ "ENDPOINT_CACHE_CONFIG": {
28
+ "expiresIn": 180000,
29
+ "generateTimeout": 30000
30
+ },
31
+ "MONGODB": {
32
+ "HOST": "localhost",
33
+ "PORT": 27017,
34
+ "USER": "",
35
+ "PASSWORD": "",
36
+ "DATABASE": "mlos"
37
+ },
38
+ "ENDPOINT_SECURITY":{
39
+ "TLS": {
40
+ "rejectUnauthorized": true
41
+ },
42
+ "JWS": {
43
+ "JWS_SIGN": false,
44
+ "JWS_SIGNING_KEY_PATH": "secrets/jwsSigningKey.key"
45
+ }
46
+ },
47
+ "MAX_FULFIL_TIMEOUT_DURATION_SECONDS": 300,
48
+ "AMOUNT": {
49
+ "PRECISION": 10,
50
+ "SCALE": 2
51
+ },
52
+ "HANDLERS": {
53
+ "DISABLED": false,
54
+ "API": {
55
+ "DISABLED": false
56
+ }
57
+ },
58
+ "INSTRUMENTATION": {
59
+ "METRICS": {
60
+ "DISABLED": false,
61
+ "config": {
62
+ "timeout": 5000,
63
+ "prefix": "moja_bl_",
64
+ "defaultLabels": {
65
+ "serviceName": "bulk-service"
66
+ }
67
+ }
68
+ }
69
+ },
70
+ "KAFKA": {
71
+ "TOPIC_TEMPLATES": {
72
+ "GENERAL_TOPIC_TEMPLATE": {
73
+ "TEMPLATE": "topic-{{functionality}}-{{action}}",
74
+ "REGEX": "topic-(.*)-(.*)"
75
+ }
76
+ },
77
+ "CONSUMER": {
78
+ "NOTIFICATION": {
79
+ "EVENT": {
80
+ "config": {
81
+ "options": {
82
+ "mode": 2,
83
+ "batchSize": 1,
84
+ "pollFrequency": 10,
85
+ "recursiveTimeout": 100,
86
+ "messageCharset": "utf8",
87
+ "messageAsJSON": true,
88
+ "sync": true,
89
+ "consumeTimeout": 1000
90
+ },
91
+ "rdkafkaConf": {
92
+ "client.id": "bulk-con-notification-event",
93
+ "group.id": "bulk-group-notification-event",
94
+ "metadata.broker.list": "localhost:9092",
95
+ "allow.auto.create.topics": true,
96
+ "socket.keepalive.enable": true
97
+ },
98
+ "topicConf": {
99
+ "auto.offset.reset": "earliest"
100
+ }
101
+ }
102
+ }
103
+ }
104
+ },
105
+ "PRODUCER": {
106
+ "BULK": {
107
+ "PREPARE": {
108
+ "config": {
109
+ "options": {
110
+ "messageCharset": "utf8"
111
+ },
112
+ "rdkafkaConf": {
113
+ "metadata.broker.list": "localhost:9092",
114
+ "client.id": "bulk-prod-bulk-prepare",
115
+ "event_cb": true,
116
+ "dr_cb": true,
117
+ "socket.keepalive.enable": true,
118
+ "queue.buffering.max.messages": 10000000
119
+ },
120
+ "topicConf": {
121
+ "request.required.acks": "all"
122
+ }
123
+ }
124
+ },
125
+ "FULFIL": {
126
+ "config": {
127
+ "options": {
128
+ "messageCharset": "utf8"
129
+ },
130
+ "rdkafkaConf": {
131
+ "metadata.broker.list": "localhost:9092",
132
+ "client.id": "bulk-prod-bulk-fulfil",
133
+ "event_cb": true,
134
+ "dr_cb": true,
135
+ "socket.keepalive.enable": true,
136
+ "queue.buffering.max.messages": 10000000
137
+ },
138
+ "topicConf": {
139
+ "request.required.acks": "all"
140
+ }
141
+ }
142
+ },
143
+ "GET": {
144
+ "config": {
145
+ "options": {
146
+ "messageCharset": "utf8"
147
+ },
148
+ "rdkafkaConf": {
149
+ "metadata.broker.list": "localhost:9092",
150
+ "client.id": "bulk-prod-bulk-get",
151
+ "event_cb": true,
152
+ "dr_cb": true,
153
+ "socket.keepalive.enable": true,
154
+ "queue.buffering.max.messages": 10000000
155
+ },
156
+ "topicConf": {
157
+ "request.required.acks": "all"
158
+ }
159
+ }
160
+ }
161
+ }
162
+ }
163
+ }
164
+ }