@mojaloop/central-ledger 19.8.3 → 19.8.4-db.0
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.
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*****
|
|
2
|
+
License
|
|
3
|
+
--------------
|
|
4
|
+
Copyright © 2020-2025 Mojaloop Foundation
|
|
5
|
+
The Mojaloop files are made available by the Mojaloop 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
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
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.
|
|
10
|
+
|
|
11
|
+
Contributors
|
|
12
|
+
--------------
|
|
13
|
+
This is the official list of the Mojaloop project contributors for this file.
|
|
14
|
+
Names of the original copyright holders (individuals or organizations)
|
|
15
|
+
should be listed with a '*' in the first column. People who have
|
|
16
|
+
contributed from an organization can be listed under the organization
|
|
17
|
+
that actually holds the copyright for their contributions (see the
|
|
18
|
+
Mojaloop Foundation for an example). Those individuals should have
|
|
19
|
+
their names indented and be marked with a '-'. Email address can be added
|
|
20
|
+
optionally within square brackets <email>.
|
|
21
|
+
|
|
22
|
+
* Mojaloop Foundation
|
|
23
|
+
- Name Surname <name.surname@mojaloop.io>
|
|
24
|
+
|
|
25
|
+
- Kalin Krustev <kalin.krustev@infitx.com>
|
|
26
|
+
--------------
|
|
27
|
+
******/
|
|
28
|
+
|
|
29
|
+
'use strict'
|
|
30
|
+
|
|
31
|
+
// this migration deletes duplicates and enables unique constraint on the columns participantId and endpointTypeId,
|
|
32
|
+
// so that deadlocks can be avoided during inserts against massively repeated inactive endpoints
|
|
33
|
+
exports.up = function (knex) {
|
|
34
|
+
// delete inactive, where active exists for same participantId and endpointId
|
|
35
|
+
knex('participantEndpoint').whereIn('participantEndpointId',
|
|
36
|
+
knex.fromRaw(
|
|
37
|
+
`(${knex('participantEndpoint').where('isActive', 0).whereIn(['participantId', 'endpointTypeId'],
|
|
38
|
+
knex.select('participantId', 'endpointTypeId').from('participantEndpoint').where('isActive', 1)
|
|
39
|
+
).select('participantEndpointId')}) as temp`
|
|
40
|
+
).select('participantEndpointId')
|
|
41
|
+
).delete()
|
|
42
|
+
|
|
43
|
+
// delete duplicates, leave row with max id
|
|
44
|
+
knex('participantEndpoint').where('participantEndpointId', '>', '0').whereNotIn('participantEndpointId',
|
|
45
|
+
knex.fromRaw(
|
|
46
|
+
`(${knex('participantEndpoint').max('participantEndpointId').groupBy('participantId', 'endpointTypeId')}) as temp`
|
|
47
|
+
).select('participantEndpointId')
|
|
48
|
+
).delete()
|
|
49
|
+
|
|
50
|
+
return knex.schema.table('participantEndpoint', (t) => {
|
|
51
|
+
t.unique(['participantId', 'endpointTypeId'])
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
exports.down = function (knex) {
|
|
56
|
+
return knex.schema.table('participantEndpoint', (t) => {
|
|
57
|
+
t.dropUnique(['participantId', 'endpointTypeId'])
|
|
58
|
+
})
|
|
59
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mojaloop/central-ledger",
|
|
3
|
-
"version": "19.8.
|
|
3
|
+
"version": "19.8.4-db.0",
|
|
4
4
|
"description": "Central ledger hosted by a scheme to record and settle transfers",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "ModusBox",
|
|
@@ -85,14 +85,14 @@
|
|
|
85
85
|
"@hapi/basic": "7.0.2",
|
|
86
86
|
"@hapi/catbox-memory": "6.0.2",
|
|
87
87
|
"@hapi/good": "9.0.1",
|
|
88
|
-
"@hapi/hapi": "21.4.
|
|
88
|
+
"@hapi/hapi": "21.4.3",
|
|
89
89
|
"@hapi/inert": "7.1.0",
|
|
90
90
|
"@hapi/vision": "7.0.3",
|
|
91
91
|
"@mojaloop/central-services-error-handling": "13.1.0",
|
|
92
92
|
"@mojaloop/central-services-health": "15.1.0",
|
|
93
93
|
"@mojaloop/central-services-logger": "11.9.0",
|
|
94
94
|
"@mojaloop/central-services-metrics": "12.6.0",
|
|
95
|
-
"@mojaloop/central-services-shared": "18.30.
|
|
95
|
+
"@mojaloop/central-services-shared": "18.30.7",
|
|
96
96
|
"@mojaloop/central-services-stream": "11.8.2",
|
|
97
97
|
"@mojaloop/database-lib": "11.3.2",
|
|
98
98
|
"@mojaloop/event-sdk": "14.6.1",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"base64url": "3.0.1",
|
|
106
106
|
"blipp": "4.0.2",
|
|
107
107
|
"commander": "14.0.0",
|
|
108
|
-
"cron": "4.3.
|
|
108
|
+
"cron": "4.3.3",
|
|
109
109
|
"decimal.js": "10.6.0",
|
|
110
110
|
"docdash": "2.0.2",
|
|
111
111
|
"event-stream": "4.0.1",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"hapi-auth-bearer-token": "8.0.0",
|
|
115
115
|
"hapi-swagger": "17.3.2",
|
|
116
116
|
"ilp-packet": "2.2.0",
|
|
117
|
-
"joi": "
|
|
117
|
+
"joi": "18.0.1",
|
|
118
118
|
"knex": "3.1.0",
|
|
119
119
|
"lodash": "4.17.21",
|
|
120
120
|
"moment": "2.30.1",
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
},
|
|
129
129
|
"devDependencies": {
|
|
130
130
|
"@opentelemetry/api": "^1.9.0",
|
|
131
|
-
"@opentelemetry/auto-instrumentations-node": "^0.62.
|
|
131
|
+
"@opentelemetry/auto-instrumentations-node": "^0.62.1",
|
|
132
132
|
"@types/mock-knex": "0.4.8",
|
|
133
133
|
"async-retry": "1.3.3",
|
|
134
134
|
"audit-ci": "^7.1.0",
|
|
@@ -164,6 +164,12 @@
|
|
|
164
164
|
"swagger2openapi": "7.0.8",
|
|
165
165
|
"markdown-it": "12.3.2"
|
|
166
166
|
},
|
|
167
|
+
"hapi-auth-bearer-token": {
|
|
168
|
+
"joi": "18.0.1"
|
|
169
|
+
},
|
|
170
|
+
"hapi-swagger": {
|
|
171
|
+
"joi": "18.0.1"
|
|
172
|
+
},
|
|
167
173
|
"jsonwebtoken": "9.0.0",
|
|
168
174
|
"jsonpointer": "5.0.0",
|
|
169
175
|
"on-headers": "1.1.0",
|