@mojaloop/central-services-shared 15.2.0 → 15.3.0-snapshot.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/.ncurc.json CHANGED
@@ -1,5 +1,4 @@
1
1
  {
2
2
  "reject": [
3
- "@mojaloop/sdk-standard-components"
4
3
  ]
5
4
  }
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
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
+ ## [15.3.0](https://github.com/mojaloop/central-services-shared/compare/v15.2.0...v15.3.0) (2022-02-07)
6
+
7
+
8
+ ### Features
9
+
10
+ * **mojaloop/project#2556:** implement patch notification for failure scenarios (following v1.1 update) ([#321](https://github.com/mojaloop/central-services-shared/issues/321)) ([92015a7](https://github.com/mojaloop/central-services-shared/commit/92015a7d9eec7e01e85eff86af5cc6e6147e5f20)), closes [mojaloop/project#2556](https://github.com/mojaloop/project/issues/2556)
11
+
5
12
  ## [15.2.0](https://github.com/mojaloop/central-services-shared/compare/v15.1.0...v15.2.0) (2021-12-13)
6
13
 
7
14
 
@@ -42,43 +42,57 @@
42
42
  },
43
43
  "1004854|widdershins>openapi-sampler>json-pointer": {
44
44
  "decision": "ignore",
45
- "madeAt": 1637925238134,
46
- "expiresAt": 1640517233443
45
+ "madeAt": 1644227612906,
46
+ "expiresAt": 1646819457744
47
47
  },
48
48
  "1004869|widdershins>swagger2openapi>better-ajv-errors>jsonpointer": {
49
49
  "decision": "ignore",
50
- "madeAt": 1637925239670,
51
- "expiresAt": 1640517233443
50
+ "madeAt": 1644227615371,
51
+ "expiresAt": 1646819457744
52
52
  },
53
53
  "1004869|widdershins>swagger2openapi>oas-validator>better-ajv-errors>jsonpointer": {
54
54
  "decision": "ignore",
55
- "madeAt": 1637925239670,
56
- "expiresAt": 1640517233443
55
+ "madeAt": 1644227615371,
56
+ "expiresAt": 1646819457744
57
57
  },
58
58
  "1004946|widdershins>yargs>string-width>strip-ansi>ansi-regex": {
59
59
  "decision": "ignore",
60
- "madeAt": 1637925241156,
61
- "expiresAt": 1640517233443
60
+ "madeAt": 1644227616947,
61
+ "expiresAt": 1646819457744
62
62
  },
63
63
  "1004946|widdershins>yargs>cliui>string-width>strip-ansi>ansi-regex": {
64
64
  "decision": "ignore",
65
- "madeAt": 1637925241156,
66
- "expiresAt": 1640517233443
65
+ "madeAt": 1644227616947,
66
+ "expiresAt": 1646819457744
67
67
  },
68
68
  "1005383|shins>sanitize-html": {
69
69
  "decision": "ignore",
70
- "madeAt": 1637925243300,
71
- "expiresAt": 1640517233443
70
+ "madeAt": 1644227618453,
71
+ "expiresAt": 1646819457744
72
72
  },
73
73
  "1005384|shins>sanitize-html": {
74
74
  "decision": "ignore",
75
- "madeAt": 1637925243300,
76
- "expiresAt": 1640517233443
75
+ "madeAt": 1644227618454,
76
+ "expiresAt": 1646819457744
77
77
  },
78
78
  "1005534|widdershins>yargs>yargs-parser": {
79
79
  "decision": "ignore",
80
- "madeAt": 1637925244682,
81
- "expiresAt": 1640517233443
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
82
96
  }
83
97
  },
84
98
  "rules": {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/central-services-shared",
3
- "version": "15.2.0",
3
+ "version": "15.3.0-snapshot.1",
4
4
  "description": "Shared code for mojaloop central services",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -48,15 +48,15 @@
48
48
  "dependencies": {
49
49
  "@hapi/catbox": "11.1.1",
50
50
  "@hapi/catbox-memory": "5.0.1",
51
- "axios": "0.24.0",
51
+ "axios": "0.25.0",
52
52
  "clone": "2.1.2",
53
- "dotenv": "10.0.0",
53
+ "dotenv": "16.0.0",
54
54
  "env-var": "7.1.1",
55
55
  "event-stream": "4.0.1",
56
56
  "immutable": "4.0.0",
57
57
  "lodash": "4.17.21",
58
58
  "mustache": "4.2.0",
59
- "openapi-backend": "5.0.1",
59
+ "openapi-backend": "5.2.0",
60
60
  "raw-body": "2.4.2",
61
61
  "rc": "1.2.8",
62
62
  "shins": "2.6.0",
@@ -71,23 +71,23 @@
71
71
  "@mojaloop/central-services-logger": "10.6.2",
72
72
  "@mojaloop/central-services-metrics": "11.0.0",
73
73
  "@mojaloop/event-sdk": "10.7.1",
74
- "@mojaloop/sdk-standard-components": "10.3.2",
75
- "ajv": "8.8.2",
74
+ "@mojaloop/sdk-standard-components": "15.13.0",
75
+ "ajv": "8.10.0",
76
76
  "ajv-keywords": "5.1.0",
77
77
  "base64url": "3.0.1",
78
78
  "chance": "1.1.8",
79
79
  "npm-audit-resolver": "2.3.1",
80
- "npm-check-updates": "12.0.2",
80
+ "npm-check-updates": "12.2.1",
81
81
  "nyc": "15.1.0",
82
82
  "pre-commit": "1.2.2",
83
83
  "proxyquire": "2.1.3",
84
- "rewire": "5.0.0",
85
- "sinon": "12.0.1",
84
+ "rewire": "6.0.0",
85
+ "sinon": "13.0.1",
86
86
  "standard": "16.0.4",
87
87
  "standard-version": "9.3.2",
88
88
  "tap-spec": "^5.0.0",
89
89
  "tap-xunit": "2.4.1",
90
- "tape": "5.3.2",
90
+ "tape": "5.5.0",
91
91
  "tapes": "4.1.0"
92
92
  },
93
93
  "peerDependencies": {
@@ -95,7 +95,7 @@
95
95
  "@mojaloop/central-services-logger": "10.6.2",
96
96
  "@mojaloop/central-services-metrics": "11.0.0",
97
97
  "@mojaloop/event-sdk": "10.7.1",
98
- "ajv": "8.8.2",
98
+ "ajv": "8.10.0",
99
99
  "ajv-keywords": "5.1.0"
100
100
  },
101
101
  "peerDependenciesMeta": {
@@ -150,6 +150,10 @@ const TopicMap = {
150
150
  functionality: transferEventType.NOTIFICATION,
151
151
  action: transferEventAction.EVENT
152
152
  },
153
+ 'reserved-aborted': {
154
+ functionality: transferEventType.NOTIFICATION,
155
+ action: transferEventAction.EVENT
156
+ },
153
157
  'settlement-window': {
154
158
  functionality: transferEventType.NOTIFICATION,
155
159
  action: transferEventAction.EVENT
@@ -327,5 +327,8 @@ module.exports = {
327
327
  produceParticipantMessage,
328
328
  produceGeneralMessage,
329
329
  commitMessageSync,
330
- proceed
330
+ proceed,
331
+
332
+ // exported for testing purposes:
333
+ _getFunctionalityAction: getFunctionalityAction
331
334
  }
@@ -46,6 +46,7 @@ const Utility = require('../../../../src/util').Kafka
46
46
  const Enum = require('../../../../src').Enum
47
47
  const Config = require('../../../util/config')
48
48
  const clone = require('../../../../src/util').clone
49
+ const { _getFunctionalityAction } = require('../../../../src/util/kafka')
49
50
 
50
51
  let participantName
51
52
  const TRANSFER = Enum.Events.Event.Type.TRANSFER
@@ -124,6 +125,43 @@ Test('Utility Test', utilityTest => {
124
125
  test.end()
125
126
  })
126
127
 
128
+ utilityTest.test('getFunctionalityAction', gfaTest => {
129
+ gfaTest.test('should return config for transfer-prepare', test => {
130
+ // Arrange
131
+ const expected = { functionalityMapped: 'transfer', actionMapped: 'prepare' }
132
+ // Act
133
+ const result = _getFunctionalityAction('transfer', 'prepare')
134
+
135
+ // Assert
136
+ test.deepEqual(result, expected)
137
+ test.end()
138
+ })
139
+
140
+ gfaTest.test('should return config for NOTIFICATION ABORT_VALIDATION', test => {
141
+ // Arrange
142
+ const expected = { functionalityMapped: 'notification', actionMapped: 'event' }
143
+ // Act
144
+ const result = _getFunctionalityAction('notification', 'abort-validation')
145
+
146
+ // Assert
147
+ test.deepEqual(result, expected)
148
+ test.end()
149
+ })
150
+
151
+ gfaTest.test('should return config for transfer-reserved-aborted', test => {
152
+ // Arrange
153
+ const expected = { functionalityMapped: 'notification', actionMapped: 'event' }
154
+ // Act
155
+ const result = _getFunctionalityAction('notification', 'reserved-aborted')
156
+
157
+ // Assert
158
+ test.deepEqual(result, expected)
159
+ test.end()
160
+ })
161
+
162
+ gfaTest.end()
163
+ })
164
+
127
165
  utilityTest.test('createParticipantTopicConf should', createParticipantTopicConfTest => {
128
166
  createParticipantTopicConfTest.test('return a participant topic conf object', test => {
129
167
  const response = Utility.createParticipantTopicConf(Config.KAFKA_CONFIG.TOPIC_TEMPLATES.PARTICIPANT_TOPIC_TEMPLATE.TEMPLATE, participantName, TRANSFER, PREPARE, 0)