@mojaloop/central-services-shared 15.3.0-snapshot.2 → 17.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.circleci/config.yml +236 -110
- package/.ncurc.js +7 -0
- package/.nvmrc +1 -1
- package/CHANGELOG.md +32 -3
- package/README.md +48 -0
- package/audit-resolve.json +33 -72
- package/package.json +69 -58
- package/src/util/hapi/plugins/headerValidation.js +2 -2
- package/src/util/request.js +1 -1
- package/src/util/streaming/protocol/index.js +2 -2
- package/.env +0 -1
- package/.ncurc.json +0 -4
- package/sonar-project.properties +0 -16
package/.circleci/config.yml
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# CircleCI v2
|
|
1
|
+
# CircleCI v2 Config
|
|
2
2
|
version: 2.1
|
|
3
3
|
|
|
4
4
|
##
|
|
@@ -7,9 +7,9 @@ version: 2.1
|
|
|
7
7
|
# Orbs used in this pipeline
|
|
8
8
|
##
|
|
9
9
|
orbs:
|
|
10
|
-
slack: circleci/slack@3.
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
slack: circleci/slack@4.9.3 # Ref: https://github.com/mojaloop/ci-config/tree/master/slack-templates
|
|
11
|
+
pr-tools: mojaloop/pr-tools@0.1.10 # Ref: https://github.com/mojaloop/ci-config/
|
|
12
|
+
gh: circleci/github-cli@2.1.0
|
|
13
13
|
|
|
14
14
|
##
|
|
15
15
|
# defaults
|
|
@@ -21,25 +21,24 @@ defaults_Dependencies: &defaults_Dependencies |
|
|
|
21
21
|
apk --no-cache add ca-certificates
|
|
22
22
|
apk --no-cache add curl
|
|
23
23
|
apk --no-cache add openssh-client
|
|
24
|
-
apk --no-cache
|
|
25
|
-
apk add --no-cache -t build-dependencies make gcc g++ python libtool autoconf automake jq
|
|
24
|
+
apk add --no-cache -t build-dependencies make gcc g++ python3 libtool autoconf automake jq
|
|
26
25
|
npm config set unsafe-perm true
|
|
27
26
|
npm install -g node-gyp
|
|
28
27
|
|
|
29
28
|
defaults_awsCliDependencies: &defaults_awsCliDependencies |
|
|
30
|
-
apk
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
pip3 install --upgrade pip awscli==1.14.5 s3cmd==2.0.1 python-magic
|
|
29
|
+
apk --no-cache add aws-cli
|
|
30
|
+
|
|
31
|
+
defaults_license_scanner: &defaults_license_scanner
|
|
32
|
+
name: Install and set up license-scanner
|
|
33
|
+
command: |
|
|
34
|
+
git clone https://github.com/mojaloop/license-scanner /tmp/license-scanner
|
|
35
|
+
cd /tmp/license-scanner && make build default-files set-up
|
|
38
36
|
|
|
39
37
|
defaults_npm_auth: &defaults_npm_auth
|
|
40
38
|
name: Update NPM registry auth token
|
|
41
39
|
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
|
|
42
40
|
|
|
41
|
+
|
|
43
42
|
defaults_npm_publish_release: &defaults_npm_publish_release
|
|
44
43
|
name: Publish NPM $RELEASE_TAG artifact
|
|
45
44
|
command: |
|
|
@@ -47,18 +46,18 @@ defaults_npm_publish_release: &defaults_npm_publish_release
|
|
|
47
46
|
echo "Publishing tag $RELEASE_TAG"
|
|
48
47
|
npm publish --tag $RELEASE_TAG --access public
|
|
49
48
|
|
|
50
|
-
|
|
51
|
-
name:
|
|
49
|
+
defaults_export_version_from_package: &defaults_export_version_from_package
|
|
50
|
+
name: Format the changelog into the github release body and get release tag
|
|
52
51
|
command: |
|
|
53
|
-
|
|
54
|
-
echo
|
|
55
|
-
|
|
52
|
+
git diff --no-indent-heuristic master~1 HEAD CHANGELOG.md | sed -n '/^+[^+]/ s/^+//p' > /tmp/changes
|
|
53
|
+
echo 'export RELEASE_CHANGES=`cat /tmp/changes`' >> $BASH_ENV
|
|
54
|
+
echo 'export RELEASE_TAG=`cat package-lock.json | jq -r .version`' >> $BASH_ENV
|
|
56
55
|
|
|
57
|
-
|
|
58
|
-
name:
|
|
56
|
+
defaults_configure_git: &defaults_configure_git
|
|
57
|
+
name: Configure git
|
|
59
58
|
command: |
|
|
60
|
-
git
|
|
61
|
-
|
|
59
|
+
git config user.email ${GIT_CI_EMAIL}
|
|
60
|
+
git config user.name ${GIT_CI_USER}
|
|
62
61
|
|
|
63
62
|
##
|
|
64
63
|
# Executors
|
|
@@ -67,19 +66,15 @@ defaults_license_scanner: &defaults_license_scanner
|
|
|
67
66
|
##
|
|
68
67
|
executors:
|
|
69
68
|
default-docker:
|
|
70
|
-
working_directory: /home/circleci/project
|
|
69
|
+
working_directory: &WORKING_DIR /home/circleci/project
|
|
71
70
|
docker:
|
|
72
|
-
- image: node:
|
|
71
|
+
- image: node:16.15.0-alpine
|
|
73
72
|
|
|
74
73
|
default-machine:
|
|
74
|
+
working_directory: *WORKING_DIR
|
|
75
75
|
machine:
|
|
76
|
-
image: ubuntu-
|
|
76
|
+
image: ubuntu-2004:current
|
|
77
77
|
|
|
78
|
-
##
|
|
79
|
-
# Jobs
|
|
80
|
-
#
|
|
81
|
-
# A map of CircleCI jobs
|
|
82
|
-
##
|
|
83
78
|
jobs:
|
|
84
79
|
setup:
|
|
85
80
|
executor: default-docker
|
|
@@ -88,23 +83,40 @@ jobs:
|
|
|
88
83
|
name: Install general dependencies
|
|
89
84
|
command: *defaults_Dependencies
|
|
90
85
|
- checkout
|
|
91
|
-
- restore_cache:
|
|
92
|
-
keys:
|
|
93
|
-
- dependency-cache-{{ checksum "package-lock.json" }}
|
|
94
|
-
- run:
|
|
95
|
-
name: Access npm folder as root
|
|
96
|
-
command: cd $(npm root -g)/npm
|
|
97
86
|
- run:
|
|
98
87
|
name: Update NPM install
|
|
99
88
|
command: npm ci
|
|
100
|
-
- run:
|
|
101
|
-
name: Delete build dependencies
|
|
102
|
-
command: apk del build-dependencies
|
|
103
89
|
- save_cache:
|
|
104
|
-
key: dependency-cache-{{
|
|
90
|
+
key: dependency-cache-{{ .Environment.CIRCLE_SHA1 }}
|
|
105
91
|
paths:
|
|
106
92
|
- node_modules
|
|
107
93
|
|
|
94
|
+
test-dependencies:
|
|
95
|
+
executor: default-docker
|
|
96
|
+
steps:
|
|
97
|
+
- run:
|
|
98
|
+
name: Install general dependencies
|
|
99
|
+
command: *defaults_Dependencies
|
|
100
|
+
- checkout
|
|
101
|
+
- restore_cache:
|
|
102
|
+
key: dependency-cache-{{ .Environment.CIRCLE_SHA1 }}
|
|
103
|
+
- run:
|
|
104
|
+
name: Execute dependency tests
|
|
105
|
+
command: npm run dep:check
|
|
106
|
+
|
|
107
|
+
test-lint:
|
|
108
|
+
executor: default-docker
|
|
109
|
+
steps:
|
|
110
|
+
- run:
|
|
111
|
+
name: Install general dependencies
|
|
112
|
+
command: *defaults_Dependencies
|
|
113
|
+
- checkout
|
|
114
|
+
- restore_cache:
|
|
115
|
+
key: dependency-cache-{{ .Environment.CIRCLE_SHA1 }}
|
|
116
|
+
- run:
|
|
117
|
+
name: Execute lint tests
|
|
118
|
+
command: npm run lint
|
|
119
|
+
|
|
108
120
|
test-unit:
|
|
109
121
|
executor: default-docker
|
|
110
122
|
steps:
|
|
@@ -113,22 +125,23 @@ jobs:
|
|
|
113
125
|
command: *defaults_Dependencies
|
|
114
126
|
- checkout
|
|
115
127
|
- restore_cache:
|
|
116
|
-
key: dependency-cache-{{
|
|
128
|
+
key: dependency-cache-{{ .Environment.CIRCLE_SHA1 }}
|
|
129
|
+
- run:
|
|
130
|
+
# This is needed for legacy core tests. Remove this once 'tape' is fully deprecated.
|
|
131
|
+
name: Install tape, tapes and tap-xunit
|
|
132
|
+
command: npm install tape tapes tap-xunit
|
|
117
133
|
- run:
|
|
118
134
|
name: Create dir for test results
|
|
119
135
|
command: mkdir -p ./test/results
|
|
120
|
-
- run:
|
|
121
|
-
name: Install testing dependencies
|
|
122
|
-
command: npm install tape tapes tap-xunit
|
|
123
136
|
- run:
|
|
124
137
|
name: Execute unit tests
|
|
125
|
-
command: npm -s run test:xunit
|
|
138
|
+
command: npm -s run test:xunit
|
|
126
139
|
- store_artifacts:
|
|
127
140
|
path: ./test/results
|
|
128
141
|
prefix: test
|
|
129
142
|
- store_test_results:
|
|
130
143
|
path: ./test/results
|
|
131
|
-
|
|
144
|
+
|
|
132
145
|
test-coverage:
|
|
133
146
|
executor: default-docker
|
|
134
147
|
steps:
|
|
@@ -140,10 +153,7 @@ jobs:
|
|
|
140
153
|
command: *defaults_awsCliDependencies
|
|
141
154
|
- checkout
|
|
142
155
|
- restore_cache:
|
|
143
|
-
key: dependency-cache-{{
|
|
144
|
-
- run:
|
|
145
|
-
name: Install testing dependencies
|
|
146
|
-
command: npm install tape tapes tap-xunit
|
|
156
|
+
key: dependency-cache-{{ .Environment.CIRCLE_SHA1 }}
|
|
147
157
|
- run:
|
|
148
158
|
name: Execute code coverage check
|
|
149
159
|
command: npm -s run test:coverage-check
|
|
@@ -151,14 +161,14 @@ jobs:
|
|
|
151
161
|
path: coverage
|
|
152
162
|
prefix: test
|
|
153
163
|
- store_test_results:
|
|
154
|
-
path: coverage
|
|
164
|
+
path: coverage
|
|
155
165
|
- run:
|
|
156
166
|
name: Copy code coverage to SonarQube
|
|
157
167
|
command: |
|
|
158
168
|
if [ "${CIRCLE_BRANCH}" == "master" ];
|
|
159
169
|
then
|
|
160
170
|
echo "Sending lcov.info to SonarQube..."
|
|
161
|
-
aws s3 cp coverage/lcov.info $AWS_S3_DIR_SONARQUBE/
|
|
171
|
+
aws s3 cp coverage/lcov.info $AWS_S3_DIR_SONARQUBE/${CIRCLE_PROJECT_REPONAME}/lcov.info
|
|
162
172
|
else
|
|
163
173
|
echo "Not a release (env CIRCLE_BRANCH != 'master'), skipping sending lcov.info to SonarQube."
|
|
164
174
|
fi
|
|
@@ -171,7 +181,7 @@ jobs:
|
|
|
171
181
|
command: *defaults_Dependencies
|
|
172
182
|
- checkout
|
|
173
183
|
- restore_cache:
|
|
174
|
-
key: dependency-cache-{{
|
|
184
|
+
key: dependency-cache-{{ .Environment.CIRCLE_SHA1 }}
|
|
175
185
|
- run:
|
|
176
186
|
name: Create dir for test results
|
|
177
187
|
command: mkdir -p ./audit/results
|
|
@@ -188,14 +198,11 @@ jobs:
|
|
|
188
198
|
- run:
|
|
189
199
|
name: Install general dependencies
|
|
190
200
|
command: *defaults_Dependencies
|
|
191
|
-
- checkout
|
|
192
201
|
- run:
|
|
193
202
|
<<: *defaults_license_scanner
|
|
203
|
+
- checkout
|
|
194
204
|
- restore_cache:
|
|
195
|
-
key: dependency-cache-{{
|
|
196
|
-
- run:
|
|
197
|
-
name: Prune non-production packages before running license-scanner
|
|
198
|
-
command: npm prune --production
|
|
205
|
+
key: dependency-cache-{{ .Environment.CIRCLE_SHA1 }}
|
|
199
206
|
- run:
|
|
200
207
|
name: Run the license-scanner
|
|
201
208
|
command: cd /tmp/license-scanner && pathToRepo=$CIRCLE_WORKING_DIRECTORY make run
|
|
@@ -212,25 +219,26 @@ jobs:
|
|
|
212
219
|
- checkout
|
|
213
220
|
- restore_cache:
|
|
214
221
|
keys:
|
|
215
|
-
- dependency-cache-{{
|
|
222
|
+
- dependency-cache-{{ .Environment.CIRCLE_SHA1 }}
|
|
216
223
|
- run:
|
|
217
|
-
|
|
218
|
-
command: |
|
|
219
|
-
git config user.email ${GIT_CI_EMAIL}
|
|
220
|
-
git config user.name ${GIT_CI_USER}
|
|
221
|
-
git checkout ${CIRCLE_BRANCH}
|
|
224
|
+
<<: *defaults_configure_git
|
|
222
225
|
- run:
|
|
223
|
-
name:
|
|
226
|
+
name: Setup Slack config
|
|
224
227
|
command: |
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
+
echo "export SLACK_PROJECT_NAME=${CIRCLE_PROJECT_REPONAME}" >> $BASH_ENV
|
|
229
|
+
echo "export SLACK_RELEASE_TYPE='GitHub Release'" >> $BASH_ENV
|
|
230
|
+
echo "export SLACK_RELEASE_TAG='${RELEASE_TAG} on ${CIRCLE_BRANCH} branch'" >> $BASH_ENV
|
|
231
|
+
echo "export SLACK_BUILD_ID=${CIRCLE_BUILD_NUM}" >> $BASH_ENV
|
|
232
|
+
echo "export SLACK_CI_URL=${CIRCLE_BUILD_URL}" >> $BASH_ENV
|
|
228
233
|
- run:
|
|
229
234
|
name: Generate changelog and bump package version
|
|
230
|
-
command: npm run release
|
|
235
|
+
command: npm run release -- --no-verify
|
|
231
236
|
- run:
|
|
232
237
|
name: Push the release
|
|
233
238
|
command: git push --follow-tags origin ${CIRCLE_BRANCH}
|
|
239
|
+
- slack/notify:
|
|
240
|
+
event: fail
|
|
241
|
+
template: SLACK_TEMP_RELEASE_FAILURE
|
|
234
242
|
|
|
235
243
|
github-release:
|
|
236
244
|
executor: default-machine
|
|
@@ -239,34 +247,40 @@ jobs:
|
|
|
239
247
|
name: Install git
|
|
240
248
|
command: |
|
|
241
249
|
sudo apt-get update && sudo apt-get install -y git
|
|
250
|
+
- gh/install
|
|
242
251
|
- checkout
|
|
252
|
+
- run:
|
|
253
|
+
<<: *defaults_configure_git
|
|
243
254
|
- run:
|
|
244
255
|
name: Fetch updated release branch
|
|
245
256
|
command: |
|
|
246
|
-
git config user.email ${GIT_CI_EMAIL}
|
|
247
|
-
git config user.name ${GIT_CI_USER}
|
|
248
257
|
git fetch origin
|
|
249
258
|
git checkout origin/${CIRCLE_BRANCH}
|
|
250
259
|
- run:
|
|
251
|
-
|
|
252
|
-
name: Format the changelog into the github release body and get release tag
|
|
253
|
-
command: |
|
|
254
|
-
git diff --no-indent-heuristic master~1 HEAD CHANGELOG.md | sed -n '/^+[^+]/ s/^+//p' > /tmp/changes
|
|
255
|
-
echo 'export RELEASE_CHANGES=`cat /tmp/changes`' >> $BASH_ENV
|
|
256
|
-
echo 'export RELEASE_TAG=`cat package.json | jq -r .version`' >> $BASH_ENV
|
|
260
|
+
<<: *defaults_export_version_from_package
|
|
257
261
|
- run:
|
|
258
|
-
name:
|
|
262
|
+
name: Check the release changes
|
|
259
263
|
command: |
|
|
260
264
|
echo "Changes are: ${RELEASE_CHANGES}"
|
|
261
|
-
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
265
|
+
- run:
|
|
266
|
+
name: Setup Slack config
|
|
267
|
+
command: |
|
|
268
|
+
echo "export SLACK_PROJECT_NAME=${CIRCLE_PROJECT_REPONAME}" >> $BASH_ENV
|
|
269
|
+
echo "export SLACK_RELEASE_TYPE='Github Release'" >> $BASH_ENV
|
|
270
|
+
echo "export SLACK_RELEASE_TAG=v${RELEASE_TAG}" >> $BASH_ENV
|
|
271
|
+
echo "export SLACK_RELEASE_URL=https://github.com/mojaloop/${CIRCLE_PROJECT_REPONAME}/releases/tag/v${RELEASE_TAG}" >> $BASH_ENV
|
|
272
|
+
echo "export SLACK_BUILD_ID=${CIRCLE_BUILD_NUM}" >> $BASH_ENV
|
|
273
|
+
echo "export SLACK_CI_URL=${CIRCLE_BUILD_URL}" >> $BASH_ENV
|
|
274
|
+
- run:
|
|
275
|
+
name: Create Release
|
|
276
|
+
command: |
|
|
277
|
+
gh release create "v${RELEASE_TAG}" --title "v${RELEASE_TAG} Release" --draft=false --notes "${RELEASE_CHANGES}" ./CHANGELOG.md
|
|
278
|
+
- slack/notify:
|
|
279
|
+
event: pass
|
|
280
|
+
template: SLACK_TEMP_RELEASE_SUCCESS
|
|
281
|
+
- slack/notify:
|
|
282
|
+
event: fail
|
|
283
|
+
template: SLACK_TEMP_RELEASE_FAILURE
|
|
270
284
|
|
|
271
285
|
publish:
|
|
272
286
|
executor: default-docker
|
|
@@ -276,34 +290,114 @@ jobs:
|
|
|
276
290
|
command: *defaults_Dependencies
|
|
277
291
|
- checkout
|
|
278
292
|
- restore_cache:
|
|
279
|
-
key: dependency-cache-{{
|
|
293
|
+
key: dependency-cache-{{ .Environment.CIRCLE_SHA1 }}
|
|
294
|
+
- run:
|
|
295
|
+
name: Setup for LATEST release
|
|
296
|
+
command: |
|
|
297
|
+
echo "export RELEASE_TAG=$RELEASE_TAG_PROD" >> $BASH_ENV
|
|
298
|
+
echo "RELEASE_TAG=$RELEASE_TAG_PROD"
|
|
299
|
+
|
|
300
|
+
PACKAGE_VERSION=$(cat package-lock.json | jq -r .version)
|
|
301
|
+
echo "export PACKAGE_VERSION=${PACKAGE_VERSION}" >> $BASH_ENV
|
|
302
|
+
echo "PACKAGE_VERSION=${PACKAGE_VERSION}"
|
|
280
303
|
- run:
|
|
281
|
-
name:
|
|
304
|
+
name: Setup Slack config
|
|
282
305
|
command: |
|
|
283
|
-
echo
|
|
306
|
+
echo "export SLACK_PROJECT_NAME=${CIRCLE_PROJECT_REPONAME}" >> $BASH_ENV
|
|
307
|
+
echo "export SLACK_RELEASE_TYPE='NPM Release'" >> $BASH_ENV
|
|
308
|
+
echo "export SLACK_RELEASE_TAG=v${CIRCLE_TAG:1}" >> $BASH_ENV
|
|
309
|
+
echo "export SLACK_RELEASE_URL=https://www.npmjs.com/package/@mojaloop/${CIRCLE_PROJECT_REPONAME}/v/${CIRCLE_TAG:1}" >> $BASH_ENV
|
|
310
|
+
echo "export SLACK_BUILD_ID=${CIRCLE_BUILD_NUM}" >> $BASH_ENV
|
|
311
|
+
echo "export SLACK_CI_URL=${CIRCLE_BUILD_URL}" >> $BASH_ENV
|
|
284
312
|
- run:
|
|
285
313
|
<<: *defaults_npm_auth
|
|
286
314
|
- run:
|
|
287
315
|
<<: *defaults_npm_publish_release
|
|
316
|
+
- slack/notify:
|
|
317
|
+
event: pass
|
|
318
|
+
template: SLACK_TEMP_RELEASE_SUCCESS
|
|
319
|
+
- slack/notify:
|
|
320
|
+
event: fail
|
|
321
|
+
template: SLACK_TEMP_RELEASE_FAILURE
|
|
322
|
+
|
|
323
|
+
publish-snapshot:
|
|
324
|
+
executor: default-docker
|
|
325
|
+
steps:
|
|
326
|
+
- run:
|
|
327
|
+
name: Install general dependencies
|
|
328
|
+
command: *defaults_Dependencies
|
|
329
|
+
- checkout
|
|
330
|
+
- restore_cache:
|
|
331
|
+
key: dependency-cache-{{ .Environment.CIRCLE_SHA1 }}
|
|
332
|
+
- run:
|
|
333
|
+
name: Setup for SNAPSHOT release
|
|
334
|
+
command: |
|
|
335
|
+
echo "export RELEASE_TAG=${RELEASE_TAG_SNAPSHOT}" >> $BASH_ENV
|
|
336
|
+
echo "RELEASE_TAG=${RELEASE_TAG_SNAPSHOT}"
|
|
337
|
+
|
|
338
|
+
echo "Override package version: ${CIRCLE_TAG:1}"
|
|
339
|
+
npx standard-version --skip.tag --skip.commit --skip.changelog --release-as ${CIRCLE_TAG:1}
|
|
340
|
+
|
|
341
|
+
PACKAGE_VERSION=$(cat package-lock.json | jq -r .version)
|
|
342
|
+
echo "export PACKAGE_VERSION=${PACKAGE_VERSION}" >> $BASH_ENV
|
|
343
|
+
echo "PACKAGE_VERSION=${PACKAGE_VERSION}"
|
|
344
|
+
- run:
|
|
345
|
+
name: Setup Slack config
|
|
346
|
+
command: |
|
|
347
|
+
echo "export SLACK_PROJECT_NAME=${CIRCLE_PROJECT_REPONAME}" >> $BASH_ENV
|
|
348
|
+
echo "export SLACK_RELEASE_TYPE='NPM Snapshot'" >> $BASH_ENV
|
|
349
|
+
echo "export SLACK_RELEASE_TAG=v${CIRCLE_TAG:1}" >> $BASH_ENV
|
|
350
|
+
echo "export SLACK_RELEASE_URL=https://www.npmjs.com/package/@mojaloop/${CIRCLE_PROJECT_REPONAME}/v/${CIRCLE_TAG:1}" >> $BASH_ENV
|
|
351
|
+
echo "export SLACK_BUILD_ID=${CIRCLE_BUILD_NUM}" >> $BASH_ENV
|
|
352
|
+
echo "export SLACK_CI_URL=${CIRCLE_BUILD_URL}" >> $BASH_ENV
|
|
353
|
+
- run:
|
|
354
|
+
<<: *defaults_npm_auth
|
|
355
|
+
- run:
|
|
356
|
+
<<: *defaults_npm_publish_release
|
|
357
|
+
- slack/notify:
|
|
358
|
+
event: pass
|
|
359
|
+
template: SLACK_TEMP_RELEASE_SUCCESS
|
|
360
|
+
- slack/notify:
|
|
361
|
+
event: fail
|
|
362
|
+
template: SLACK_TEMP_RELEASE_FAILURE
|
|
288
363
|
|
|
289
|
-
##
|
|
290
|
-
# Workflows
|
|
291
|
-
#
|
|
292
|
-
# CircleCI Workflow config
|
|
293
|
-
##
|
|
294
364
|
workflows:
|
|
295
365
|
version: 2
|
|
296
366
|
build_and_test:
|
|
297
367
|
jobs:
|
|
298
368
|
- pr-tools/pr-title-check:
|
|
299
369
|
context: org-global
|
|
300
|
-
|
|
301
370
|
- setup:
|
|
302
371
|
context: org-global
|
|
303
372
|
filters:
|
|
304
373
|
tags:
|
|
305
374
|
only: /.*/
|
|
306
|
-
|
|
375
|
+
branches:
|
|
376
|
+
ignore:
|
|
377
|
+
- /feature*/
|
|
378
|
+
- /bugfix*/
|
|
379
|
+
- test-dependencies:
|
|
380
|
+
context: org-global
|
|
381
|
+
requires:
|
|
382
|
+
- setup
|
|
383
|
+
filters:
|
|
384
|
+
tags:
|
|
385
|
+
only: /.*/
|
|
386
|
+
branches:
|
|
387
|
+
ignore:
|
|
388
|
+
- /feature*/
|
|
389
|
+
- /bugfix*/
|
|
390
|
+
- test-lint:
|
|
391
|
+
context: org-global
|
|
392
|
+
requires:
|
|
393
|
+
- setup
|
|
394
|
+
filters:
|
|
395
|
+
tags:
|
|
396
|
+
only: /.*/
|
|
397
|
+
branches:
|
|
398
|
+
ignore:
|
|
399
|
+
- /feature*/
|
|
400
|
+
- /bugfix*/
|
|
307
401
|
- test-unit:
|
|
308
402
|
context: org-global
|
|
309
403
|
requires:
|
|
@@ -311,7 +405,10 @@ workflows:
|
|
|
311
405
|
filters:
|
|
312
406
|
tags:
|
|
313
407
|
only: /.*/
|
|
314
|
-
|
|
408
|
+
branches:
|
|
409
|
+
ignore:
|
|
410
|
+
- /feature*/
|
|
411
|
+
- /bugfix*/
|
|
315
412
|
- test-coverage:
|
|
316
413
|
context: org-global
|
|
317
414
|
requires:
|
|
@@ -319,38 +416,48 @@ workflows:
|
|
|
319
416
|
filters:
|
|
320
417
|
tags:
|
|
321
418
|
only: /.*/
|
|
322
|
-
|
|
419
|
+
branches:
|
|
420
|
+
ignore:
|
|
421
|
+
- /feature*/
|
|
422
|
+
- /bugfix*/
|
|
323
423
|
- vulnerability-check:
|
|
324
424
|
context: org-global
|
|
325
425
|
requires:
|
|
326
426
|
- setup
|
|
327
|
-
- test-unit
|
|
328
|
-
- test-coverage
|
|
329
427
|
filters:
|
|
330
428
|
tags:
|
|
331
429
|
only: /.*/
|
|
332
|
-
|
|
430
|
+
branches:
|
|
431
|
+
ignore:
|
|
432
|
+
- /feature*/
|
|
433
|
+
- /bugfix*/
|
|
333
434
|
- audit-licenses:
|
|
334
435
|
context: org-global
|
|
335
436
|
requires:
|
|
336
437
|
- setup
|
|
337
|
-
- test-unit
|
|
338
|
-
- test-coverage
|
|
339
438
|
filters:
|
|
340
439
|
tags:
|
|
341
440
|
only: /.*/
|
|
342
|
-
|
|
441
|
+
branches:
|
|
442
|
+
ignore:
|
|
443
|
+
- /feature*/
|
|
444
|
+
- /bugfix*/
|
|
343
445
|
# New commits to master release automatically
|
|
344
446
|
- release:
|
|
345
447
|
context: org-global
|
|
346
448
|
requires:
|
|
347
|
-
-
|
|
449
|
+
- pr-tools/pr-title-check
|
|
450
|
+
- test-dependencies
|
|
451
|
+
- test-lint
|
|
452
|
+
- test-unit
|
|
453
|
+
- test-coverage
|
|
348
454
|
- vulnerability-check
|
|
455
|
+
- audit-licenses
|
|
349
456
|
filters:
|
|
350
457
|
branches:
|
|
351
458
|
only:
|
|
352
459
|
- master
|
|
353
|
-
|
|
460
|
+
- /release\/v.*/
|
|
354
461
|
- github-release:
|
|
355
462
|
context: org-global
|
|
356
463
|
requires:
|
|
@@ -359,15 +466,34 @@ workflows:
|
|
|
359
466
|
branches:
|
|
360
467
|
only:
|
|
361
468
|
- master
|
|
362
|
-
|
|
469
|
+
- /release\/v.*/
|
|
363
470
|
- publish:
|
|
364
471
|
context: org-global
|
|
365
472
|
requires:
|
|
473
|
+
- pr-tools/pr-title-check
|
|
474
|
+
- test-lint
|
|
475
|
+
- test-unit
|
|
476
|
+
- test-coverage
|
|
366
477
|
- vulnerability-check
|
|
367
478
|
- audit-licenses
|
|
368
479
|
filters:
|
|
369
480
|
tags:
|
|
370
|
-
only:
|
|
481
|
+
only: /v[0-9]+(\.[0-9]+)*/
|
|
482
|
+
branches:
|
|
483
|
+
ignore:
|
|
484
|
+
- /.*/
|
|
485
|
+
- publish-snapshot:
|
|
486
|
+
context: org-global
|
|
487
|
+
requires:
|
|
488
|
+
- pr-tools/pr-title-check
|
|
489
|
+
- test-lint
|
|
490
|
+
- test-unit
|
|
491
|
+
- test-coverage
|
|
492
|
+
- vulnerability-check
|
|
493
|
+
- audit-licenses
|
|
494
|
+
filters:
|
|
495
|
+
tags:
|
|
496
|
+
only: /v[0-9]+(\.[0-9]+)*\-snapshot+((\.[0-9]+)?)/
|
|
371
497
|
branches:
|
|
372
498
|
ignore:
|
|
373
499
|
- /.*/
|
package/.ncurc.js
ADDED
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
16.15.0
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,35 @@
|
|
|
2
2
|
|
|
3
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
4
|
|
|
5
|
+
### [17.0.1](https://github.com/mojaloop/central-services-shared/compare/v17.0.0...v17.0.1) (2022-05-19)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* removed typescript build from ci config ([cc75c8a](https://github.com/mojaloop/central-services-shared/commit/cc75c8ab6326b2ef3fb1116a328f3aa3792bcd7e))
|
|
11
|
+
|
|
12
|
+
## [17.0.0](https://github.com/mojaloop/central-services-shared/compare/v16.0.0...v17.0.0) (2022-05-19)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### ⚠ BREAKING CHANGES
|
|
16
|
+
|
|
17
|
+
* **mojaloop/#2092:** major version bump for node v16 LTS support, and re-structuring of project directories to align to core Mojaloop repositories!
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* **mojaloop/#2092:** upgrade nodeJS version for core services ([#330](https://github.com/mojaloop/central-services-shared/issues/330)) ([4778864](https://github.com/mojaloop/central-services-shared/commit/477886485299940b08a29d3db5a4ceaab431d47d)), closes [mojaloop/#2092](https://github.com/mojaloop/project/issues/2092)
|
|
22
|
+
|
|
23
|
+
## [16.0.0](https://github.com/mojaloop/central-services-shared/compare/v15.3.0...v16.0.0) (2022-03-03)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### ⚠ BREAKING CHANGES
|
|
27
|
+
|
|
28
|
+
* **mojaloop/#2704:** - headerValidation.FSPIOPHeaderValidation now expects the`supportedProtocolContentVersions` options argument to be a list, the same as `supportedProtocolAcceptVersions`
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
|
|
32
|
+
* **mojaloop/#2704:** core-services support for non-breaking backward api compatibility ([#325](https://github.com/mojaloop/central-services-shared/issues/325)) ([cb81f7e](https://github.com/mojaloop/central-services-shared/commit/cb81f7ec92376e0d6ce45e2ce046379ce1996167)), closes [mojaloop/#2704](https://github.com/mojaloop/project/issues/2704)
|
|
33
|
+
|
|
5
34
|
## [15.3.0](https://github.com/mojaloop/central-services-shared/compare/v15.2.0...v15.3.0) (2022-02-07)
|
|
6
35
|
|
|
7
36
|
|
|
@@ -14,7 +43,7 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
14
43
|
|
|
15
44
|
### Features
|
|
16
45
|
|
|
17
|
-
* **mojaloop/#2608:** injected resource versions config for outbound requests ([#319](https://github.com/mojaloop/central-services-shared/issues/319)) ([13a3d9d](https://github.com/mojaloop/central-services-shared/commit/13a3d9dc8ab8d4815db2aea22563317e3670a19b)), closes [mojaloop/#2608](https://github.com/mojaloop/
|
|
46
|
+
* **mojaloop/#2608:** injected resource versions config for outbound requests ([#319](https://github.com/mojaloop/central-services-shared/issues/319)) ([13a3d9d](https://github.com/mojaloop/central-services-shared/commit/13a3d9dc8ab8d4815db2aea22563317e3670a19b)), closes [mojaloop/#2608](https://github.com/mojaloop/project/issues/2608)
|
|
18
47
|
|
|
19
48
|
## [15.1.0](https://github.com/mojaloop/central-services-shared/compare/v15.0.1...v15.1.0) (2021-11-17)
|
|
20
49
|
|
|
@@ -39,7 +68,7 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
39
68
|
|
|
40
69
|
### Bug Fixes
|
|
41
70
|
|
|
42
|
-
* **mojaloop/#2536:** fspiop api version negotiation not handled by transfers service ([#315](https://github.com/mojaloop/central-services-shared/issues/315)) ([e3a8748](https://github.com/mojaloop/central-services-shared/commit/e3a874829794ed8b85b6487dd58bcb58f31a5dd1)), closes [mojaloop/#2536](https://github.com/mojaloop/
|
|
71
|
+
* **mojaloop/#2536:** fspiop api version negotiation not handled by transfers service ([#315](https://github.com/mojaloop/central-services-shared/issues/315)) ([e3a8748](https://github.com/mojaloop/central-services-shared/commit/e3a874829794ed8b85b6487dd58bcb58f31a5dd1)), closes [mojaloop/#2536](https://github.com/mojaloop/project/issues/2536)
|
|
43
72
|
|
|
44
73
|
## [14.0.0](https://github.com/mojaloop/central-services-shared/compare/v13.4.1...v14.0.0) (2021-09-10)
|
|
45
74
|
|
|
@@ -50,7 +79,7 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
50
79
|
|
|
51
80
|
### Bug Fixes
|
|
52
81
|
|
|
53
|
-
* **mojaloop/#2470:** central-services-shared streamingprotocol encode/decode functionality fix ([#313](https://github.com/mojaloop/central-services-shared/issues/313)) ([cedc359](https://github.com/mojaloop/central-services-shared/commit/cedc3595508ebe2fd67517f732e8e1da35635171)), closes [mojaloop/#2470](https://github.com/mojaloop/
|
|
82
|
+
* **mojaloop/#2470:** central-services-shared streamingprotocol encode/decode functionality fix ([#313](https://github.com/mojaloop/central-services-shared/issues/313)) ([cedc359](https://github.com/mojaloop/central-services-shared/commit/cedc3595508ebe2fd67517f732e8e1da35635171)), closes [mojaloop/#2470](https://github.com/mojaloop/project/issues/2470)
|
|
54
83
|
|
|
55
84
|
### [13.4.1](https://github.com/mojaloop/central-services-shared/compare/v13.4.0...v13.4.1) (2021-08-25)
|
|
56
85
|
|
package/README.md
CHANGED
|
@@ -6,3 +6,51 @@
|
|
|
6
6
|
[](https://circleci.com/gh/mojaloop/central-services-shared)
|
|
7
7
|
|
|
8
8
|
Shared code for central services
|
|
9
|
+
|
|
10
|
+
## Auditing Dependencies
|
|
11
|
+
|
|
12
|
+
We use `npm-audit-resolver` along with `npm audit` to check dependencies for node vulnerabilities, and keep track of resolved dependencies with an `audit-resolve.json` file.
|
|
13
|
+
|
|
14
|
+
To start a new resolution process, run:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm run audit:resolve
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
You can then check to see if the CI will pass based on the current dependencies with:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm run audit:check
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
And commit the changed `audit-resolve.json` to ensure that CircleCI will build correctly.
|
|
27
|
+
|
|
28
|
+
## Automated Releases
|
|
29
|
+
|
|
30
|
+
As part of our CI/CD process, we use a combination of CircleCI, standard-version
|
|
31
|
+
npm package and github-release CircleCI orb to automatically trigger our releases
|
|
32
|
+
and image builds. This process essentially mimics a manual tag and release.
|
|
33
|
+
|
|
34
|
+
On a merge to master, CircleCI is configured to use the mojaloopci github account
|
|
35
|
+
to push the latest generated CHANGELOG and package version number.
|
|
36
|
+
|
|
37
|
+
Once those changes are pushed, CircleCI will pull the updated master, tag and
|
|
38
|
+
push a release triggering another subsequent build that also publishes a docker image.
|
|
39
|
+
|
|
40
|
+
### Potential problems
|
|
41
|
+
|
|
42
|
+
* There is a case where the merge to master workflow will resolve successfully, triggering
|
|
43
|
+
a release. Then that tagged release workflow subsequently failing due to the image scan,
|
|
44
|
+
audit check, vulnerability check or other "live" checks.
|
|
45
|
+
|
|
46
|
+
This will leave master without an associated published build. Fixes that require
|
|
47
|
+
a new merge will essentially cause a skip in version number or require a clean up
|
|
48
|
+
of the master branch to the commit before the CHANGELOG and bump.
|
|
49
|
+
|
|
50
|
+
This may be resolved by relying solely on the previous checks of the
|
|
51
|
+
merge to master workflow to assume that our tagged release is of sound quality.
|
|
52
|
+
We are still mulling over this solution since catching bugs/vulnerabilities/etc earlier
|
|
53
|
+
is a boon.
|
|
54
|
+
|
|
55
|
+
* It is unknown if a race condition might occur with multiple merges with master in
|
|
56
|
+
quick succession, but this is a suspected edge case.
|
package/audit-resolve.json
CHANGED
|
@@ -1,98 +1,59 @@
|
|
|
1
1
|
{
|
|
2
2
|
"decisions": {
|
|
3
|
-
"
|
|
3
|
+
"1067553|better-ajv-errors>jsonpointer": {
|
|
4
4
|
"decision": "ignore",
|
|
5
|
-
"madeAt":
|
|
6
|
-
"expiresAt":
|
|
5
|
+
"madeAt": 1652887989276,
|
|
6
|
+
"expiresAt": 1655479973082
|
|
7
7
|
},
|
|
8
|
-
"
|
|
8
|
+
"1070256|ejs": {
|
|
9
9
|
"decision": "ignore",
|
|
10
|
-
"madeAt":
|
|
11
|
-
"expiresAt":
|
|
10
|
+
"madeAt": 1652887990649,
|
|
11
|
+
"expiresAt": 1655479973082
|
|
12
12
|
},
|
|
13
|
-
"
|
|
13
|
+
"1070030|shins>markdown-it": {
|
|
14
14
|
"decision": "ignore",
|
|
15
|
-
"madeAt":
|
|
16
|
-
"expiresAt":
|
|
15
|
+
"madeAt": 1652951732905,
|
|
16
|
+
"expiresAt": 1655543725868
|
|
17
17
|
},
|
|
18
|
-
"
|
|
18
|
+
"1068155|shins>markdown-it>sanitize-html": {
|
|
19
19
|
"decision": "ignore",
|
|
20
|
-
"madeAt":
|
|
21
|
-
"expiresAt":
|
|
20
|
+
"madeAt": 1652887992740,
|
|
21
|
+
"expiresAt": 1655479973082
|
|
22
22
|
},
|
|
23
|
-
"
|
|
23
|
+
"1070260|shins>markdown-it>sanitize-html": {
|
|
24
24
|
"decision": "ignore",
|
|
25
|
-
"madeAt":
|
|
26
|
-
"expiresAt":
|
|
25
|
+
"madeAt": 1652887993909,
|
|
26
|
+
"expiresAt": 1655479973082
|
|
27
27
|
},
|
|
28
|
-
"
|
|
28
|
+
"1068310|widdershins>oas-resolver>yargs>yargs-parser": {
|
|
29
29
|
"decision": "ignore",
|
|
30
|
-
"madeAt":
|
|
31
|
-
"expiresAt":
|
|
30
|
+
"madeAt": 1652887994946,
|
|
31
|
+
"expiresAt": 1655479973082
|
|
32
32
|
},
|
|
33
|
-
"
|
|
33
|
+
"1067946|widdershins>oas-resolver>yargs>yargs-parser>swagger2openapi>oas-validator>ajv": {
|
|
34
34
|
"decision": "ignore",
|
|
35
|
-
"madeAt":
|
|
36
|
-
"expiresAt":
|
|
35
|
+
"madeAt": 1652887996204,
|
|
36
|
+
"expiresAt": 1655479973082
|
|
37
37
|
},
|
|
38
|
-
"
|
|
38
|
+
"1070030|widdershins>markdown-it": {
|
|
39
39
|
"decision": "ignore",
|
|
40
|
-
"madeAt":
|
|
41
|
-
"expiresAt":
|
|
40
|
+
"madeAt": 1652951732905,
|
|
41
|
+
"expiresAt": 1655543725868
|
|
42
42
|
},
|
|
43
|
-
"
|
|
43
|
+
"1067553|swagger2openapi>better-ajv-errors>jsonpointer": {
|
|
44
44
|
"decision": "ignore",
|
|
45
|
-
"madeAt":
|
|
46
|
-
"expiresAt":
|
|
45
|
+
"madeAt": 1652951735762,
|
|
46
|
+
"expiresAt": 1655543725868
|
|
47
47
|
},
|
|
48
|
-
"
|
|
48
|
+
"1067946|swagger2openapi>better-ajv-errors>jsonpointer>oas-validator>ajv": {
|
|
49
49
|
"decision": "ignore",
|
|
50
|
-
"madeAt":
|
|
51
|
-
"expiresAt":
|
|
50
|
+
"madeAt": 1652951738877,
|
|
51
|
+
"expiresAt": 1655543725868
|
|
52
52
|
},
|
|
53
|
-
"
|
|
53
|
+
"1068310|widdershins>markdown-it>yargs>yargs-parser": {
|
|
54
54
|
"decision": "ignore",
|
|
55
|
-
"madeAt":
|
|
56
|
-
"expiresAt":
|
|
57
|
-
},
|
|
58
|
-
"1004946|widdershins>yargs>string-width>strip-ansi>ansi-regex": {
|
|
59
|
-
"decision": "ignore",
|
|
60
|
-
"madeAt": 1644227616947,
|
|
61
|
-
"expiresAt": 1646819457744
|
|
62
|
-
},
|
|
63
|
-
"1004946|widdershins>yargs>cliui>string-width>strip-ansi>ansi-regex": {
|
|
64
|
-
"decision": "ignore",
|
|
65
|
-
"madeAt": 1644227616947,
|
|
66
|
-
"expiresAt": 1646819457744
|
|
67
|
-
},
|
|
68
|
-
"1005383|shins>sanitize-html": {
|
|
69
|
-
"decision": "ignore",
|
|
70
|
-
"madeAt": 1644227618453,
|
|
71
|
-
"expiresAt": 1646819457744
|
|
72
|
-
},
|
|
73
|
-
"1005384|shins>sanitize-html": {
|
|
74
|
-
"decision": "ignore",
|
|
75
|
-
"madeAt": 1644227618454,
|
|
76
|
-
"expiresAt": 1646819457744
|
|
77
|
-
},
|
|
78
|
-
"1005534|widdershins>yargs>yargs-parser": {
|
|
79
|
-
"decision": "ignore",
|
|
80
|
-
"madeAt": 1644227619978,
|
|
81
|
-
"expiresAt": 1646819457744
|
|
82
|
-
},
|
|
83
|
-
"1006899|widdershins>node-fetch": {
|
|
84
|
-
"decision": "fix",
|
|
85
|
-
"madeAt": 1644227510867
|
|
86
|
-
},
|
|
87
|
-
"1006846|shins>sanitize-html>postcss": {
|
|
88
|
-
"decision": "ignore",
|
|
89
|
-
"madeAt": 1644227621510,
|
|
90
|
-
"expiresAt": 1646819457744
|
|
91
|
-
},
|
|
92
|
-
"1006886|shins>markdown-it": {
|
|
93
|
-
"decision": "ignore",
|
|
94
|
-
"madeAt": 1644227622831,
|
|
95
|
-
"expiresAt": 1646819457744
|
|
55
|
+
"madeAt": 1652951741588,
|
|
56
|
+
"expiresAt": 1655543725868
|
|
96
57
|
}
|
|
97
58
|
},
|
|
98
59
|
"rules": {},
|
package/package.json
CHANGED
|
@@ -1,101 +1,107 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mojaloop/central-services-shared",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "17.0.1",
|
|
4
4
|
"description": "Shared code for mojaloop central services",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"standard:fix": "standard --fix",
|
|
11
|
-
"lint": "npm run standard",
|
|
12
|
-
"lint:fix": "npm run standard:fix",
|
|
13
|
-
"test": "npm run test:unit",
|
|
14
|
-
"test:unit": "tape 'test/unit/**/*.test.js' | tap-spec",
|
|
15
|
-
"test:xunit": "tape 'test/unit/**/*.test.js' | tap-xunit",
|
|
16
|
-
"test:coverage": "nyc --reporter=lcov --reporter=text-summary tapes -- 'test/unit/**/**.test.js'",
|
|
17
|
-
"test:coverage-check": "npm run test:coverage && nyc check-coverage",
|
|
18
|
-
"audit:resolve": "SHELL=sh resolve-audit --production",
|
|
19
|
-
"audit:check": "SHELL=sh check-audit --production",
|
|
20
|
-
"dep:check": "npx ncu -e 2",
|
|
21
|
-
"dep:update": "npx ncu -u",
|
|
22
|
-
"release": "standard-version --releaseCommitMessageFormat 'chore(release): {{currentTag}} [skip ci]'"
|
|
23
|
-
},
|
|
24
|
-
"pre-commit": [
|
|
25
|
-
"lint",
|
|
26
|
-
"dep:check",
|
|
27
|
-
"test"
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"author": "ModusBox",
|
|
7
|
+
"contributors": [
|
|
8
|
+
"ModusBox",
|
|
9
|
+
"Dwolla"
|
|
28
10
|
],
|
|
11
|
+
"homepage": "https://github.com/mojaloop/central-services-shared#readme",
|
|
29
12
|
"repository": {
|
|
30
13
|
"type": "git",
|
|
31
14
|
"url": "git+https://github.com/mojaloop/central-services-shared.git"
|
|
32
15
|
},
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/mojaloop/central-services-shared/issues"
|
|
18
|
+
},
|
|
33
19
|
"keywords": [
|
|
34
20
|
"shared",
|
|
35
21
|
"central",
|
|
36
|
-
"services"
|
|
22
|
+
"services",
|
|
23
|
+
"mojaloop"
|
|
37
24
|
],
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
"
|
|
25
|
+
"main": "src/index.js",
|
|
26
|
+
"types": "src/index.d.ts",
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": "=16.x"
|
|
29
|
+
},
|
|
30
|
+
"pre-commit": [
|
|
31
|
+
"lint",
|
|
32
|
+
"dep:check",
|
|
33
|
+
"test"
|
|
42
34
|
],
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
"
|
|
35
|
+
"scripts": {
|
|
36
|
+
"pretest": "npm run lint",
|
|
37
|
+
"standard": "npx standard",
|
|
38
|
+
"standard:fix": "npm run standard -- --fix",
|
|
39
|
+
"lint": "npm run standard",
|
|
40
|
+
"lint:fix": "npm run standard:fix",
|
|
41
|
+
"test": "npm run test:unit",
|
|
42
|
+
"test:unit": "npx tape 'test/unit/**/*.test.js' | tap-spec",
|
|
43
|
+
"test:xunit": "npx tape 'test/unit/**/**.test.js' | tap-xunit > ./test/results/xunit.xml",
|
|
44
|
+
"test:coverage": "npx nyc --reporter=lcov --reporter=text-summary tapes -- 'test/unit/**/**.test.js'",
|
|
45
|
+
"test:coverage-check": "npm run test:coverage && nyc check-coverage",
|
|
46
|
+
"audit:resolve": "npx resolve-audit --production",
|
|
47
|
+
"audit:check": "npx check-audit --production",
|
|
48
|
+
"dep:check": "npx ncu -e 2",
|
|
49
|
+
"dep:update": "npx ncu -u",
|
|
50
|
+
"release": "npx standard-version --no-verify --releaseCommitMessageFormat 'chore(release): {{currentTag}} [skip ci]'",
|
|
51
|
+
"snapshot": "npx standard-version --no-verify --skip.changelog --prerelease snapshot --releaseCommitMessageFormat 'chore(snapshot): {{currentTag}}'"
|
|
46
52
|
},
|
|
47
|
-
"homepage": "https://github.com/mojaloop/central-services-shared#readme",
|
|
48
53
|
"dependencies": {
|
|
49
|
-
"@hapi/catbox": "
|
|
54
|
+
"@hapi/catbox": "12.0.0",
|
|
50
55
|
"@hapi/catbox-memory": "5.0.1",
|
|
51
|
-
"axios": "0.
|
|
56
|
+
"axios": "0.27.2",
|
|
52
57
|
"clone": "2.1.2",
|
|
53
|
-
"dotenv": "16.0.
|
|
58
|
+
"dotenv": "16.0.1",
|
|
54
59
|
"env-var": "7.1.1",
|
|
55
60
|
"event-stream": "4.0.1",
|
|
56
61
|
"immutable": "4.0.0",
|
|
57
62
|
"lodash": "4.17.21",
|
|
58
63
|
"mustache": "4.2.0",
|
|
59
|
-
"openapi-backend": "5.
|
|
60
|
-
"raw-body": "2.
|
|
64
|
+
"openapi-backend": "5.3.0",
|
|
65
|
+
"raw-body": "2.5.1",
|
|
61
66
|
"rc": "1.2.8",
|
|
62
67
|
"shins": "2.6.0",
|
|
63
68
|
"uuid4": "2.0.2",
|
|
64
|
-
"widdershins": "4.0.1",
|
|
65
|
-
"yaml": "1.
|
|
69
|
+
"widdershins": "^4.0.1",
|
|
70
|
+
"yaml": "2.1.0"
|
|
66
71
|
},
|
|
67
72
|
"devDependencies": {
|
|
68
|
-
"@hapi/hapi": "20.2.
|
|
73
|
+
"@hapi/hapi": "20.2.2",
|
|
69
74
|
"@hapi/joi": "17.1.1",
|
|
70
|
-
"@mojaloop/central-services-error-handling": "
|
|
71
|
-
"@mojaloop/central-services-logger": "
|
|
72
|
-
"@mojaloop/central-services-metrics": "
|
|
73
|
-
"@mojaloop/event-sdk": "
|
|
74
|
-
"@mojaloop/sdk-standard-components": "
|
|
75
|
-
"ajv": "8.
|
|
75
|
+
"@mojaloop/central-services-error-handling": "12.0.1",
|
|
76
|
+
"@mojaloop/central-services-logger": "11.0.0",
|
|
77
|
+
"@mojaloop/central-services-metrics": "12.0.2",
|
|
78
|
+
"@mojaloop/event-sdk": "^11.0.1",
|
|
79
|
+
"@mojaloop/sdk-standard-components": "17.0.0",
|
|
80
|
+
"ajv": "8.11.0",
|
|
76
81
|
"ajv-keywords": "5.1.0",
|
|
77
82
|
"base64url": "3.0.1",
|
|
78
83
|
"chance": "1.1.8",
|
|
79
|
-
"npm-audit-resolver": "
|
|
80
|
-
"npm-check-updates": "
|
|
84
|
+
"npm-audit-resolver": "3.0.0-7",
|
|
85
|
+
"npm-check-updates": "13.0.1",
|
|
81
86
|
"nyc": "15.1.0",
|
|
82
87
|
"pre-commit": "1.2.2",
|
|
83
88
|
"proxyquire": "2.1.3",
|
|
89
|
+
"replace": "^1.2.1",
|
|
84
90
|
"rewire": "6.0.0",
|
|
85
|
-
"sinon": "
|
|
86
|
-
"standard": "
|
|
87
|
-
"standard-version": "9.
|
|
91
|
+
"sinon": "14.0.0",
|
|
92
|
+
"standard": "17.0.0",
|
|
93
|
+
"standard-version": "9.5.0",
|
|
88
94
|
"tap-spec": "^5.0.0",
|
|
89
95
|
"tap-xunit": "2.4.1",
|
|
90
|
-
"tape": "5.5.
|
|
96
|
+
"tape": "5.5.3",
|
|
91
97
|
"tapes": "4.1.0"
|
|
92
98
|
},
|
|
93
99
|
"peerDependencies": {
|
|
94
|
-
"@mojaloop/central-services-error-handling": "
|
|
95
|
-
"@mojaloop/central-services-logger": "
|
|
96
|
-
"@mojaloop/central-services-metrics": "
|
|
97
|
-
"@mojaloop/event-sdk": "
|
|
98
|
-
"ajv": "8.
|
|
100
|
+
"@mojaloop/central-services-error-handling": "12.0.1",
|
|
101
|
+
"@mojaloop/central-services-logger": "11.0.0",
|
|
102
|
+
"@mojaloop/central-services-metrics": "12.0.2",
|
|
103
|
+
"@mojaloop/event-sdk": "11.0.0",
|
|
104
|
+
"ajv": "8.11.0",
|
|
99
105
|
"ajv-keywords": "5.1.0"
|
|
100
106
|
},
|
|
101
107
|
"peerDependenciesMeta": {
|
|
@@ -123,5 +129,10 @@
|
|
|
123
129
|
},
|
|
124
130
|
"publishConfig": {
|
|
125
131
|
"registry": "https://registry.npmjs.org/"
|
|
132
|
+
},
|
|
133
|
+
"standard-version": {
|
|
134
|
+
"scripts": {
|
|
135
|
+
"postchangelog": "replace '\\[mojaloop/#(\\d+)\\]\\(https://github.com/mojaloop/(.*)/issues/(\\d+)\\)' '[mojaloop/#$1](https://github.com/mojaloop/project/issues/$1)' CHANGELOG.md"
|
|
136
|
+
}
|
|
126
137
|
}
|
|
127
138
|
}
|
|
@@ -97,7 +97,8 @@ const plugin = {
|
|
|
97
97
|
errorMessages.INVALID_CONTENT_TYPE_HEADER
|
|
98
98
|
)
|
|
99
99
|
}
|
|
100
|
-
if (!supportedProtocolContentVersions.includes(contentType.version)) {
|
|
100
|
+
// if (!supportedProtocolContentVersions.includes(contentType.version)) {
|
|
101
|
+
if (!supportedProtocolContentVersions.some(supportedVer => contentType.version === supportedVer)) {
|
|
101
102
|
const supportedVersionExtensionListMap = convertSupportedVersionToExtensionList(supportedProtocolContentVersions)
|
|
102
103
|
throw createFSPIOPError(
|
|
103
104
|
Enums.FSPIOPErrorCodes.UNACCEPTABLE_VERSION,
|
|
@@ -107,7 +108,6 @@ const plugin = {
|
|
|
107
108
|
supportedVersionExtensionListMap
|
|
108
109
|
)
|
|
109
110
|
}
|
|
110
|
-
|
|
111
111
|
return h.continue
|
|
112
112
|
})
|
|
113
113
|
}
|
package/src/util/request.js
CHANGED
|
@@ -48,7 +48,7 @@ const updateMessageProtocolMetadata = (messageProtocol, metadataType, metadataAc
|
|
|
48
48
|
id: Uuid(),
|
|
49
49
|
type: metadataType,
|
|
50
50
|
action: metadataAction,
|
|
51
|
-
state
|
|
51
|
+
state
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
} else {
|
|
@@ -85,7 +85,7 @@ const createMessage = (id, to, from, metadata, headers, payload, uriParams = und
|
|
|
85
85
|
type: type || Enum.Http.Headers.DEFAULT.APPLICATION_JSON,
|
|
86
86
|
content: {
|
|
87
87
|
uriParams: uriParams || undefined,
|
|
88
|
-
headers
|
|
88
|
+
headers,
|
|
89
89
|
payload: payload || {}
|
|
90
90
|
},
|
|
91
91
|
metadata
|
package/.env
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
LOG_LEVEL = info
|
package/.ncurc.json
DELETED
package/sonar-project.properties
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# Required metadata
|
|
2
|
-
sonar.projectKey=central-services-shared
|
|
3
|
-
sonar.projectName=central-services-shared
|
|
4
|
-
sonar.projectVersion=1.0
|
|
5
|
-
|
|
6
|
-
# Comma-separated paths to directories with sources (required)
|
|
7
|
-
sonar.sources=src,test
|
|
8
|
-
|
|
9
|
-
# Language
|
|
10
|
-
sonar.language=js
|
|
11
|
-
|
|
12
|
-
# Encoding of the source files
|
|
13
|
-
sonar.sourceEncoding=UTF-8
|
|
14
|
-
|
|
15
|
-
# To import the LCOV report
|
|
16
|
-
sonar.javascript.lcov.reportPath=lcov.info
|