@superhero/eventflow-db 4.0.3 → 4.0.5
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/config.js +2 -5
- package/index.js +16 -2
- package/index.test.js +6 -5
- package/package.json +2 -2
package/config.js
CHANGED
package/index.js
CHANGED
|
@@ -28,9 +28,23 @@ export default class DB
|
|
|
28
28
|
this.gateway = gateway
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
destroy()
|
|
32
32
|
{
|
|
33
|
-
|
|
33
|
+
return new Promise((resolve, reject) =>
|
|
34
|
+
{
|
|
35
|
+
setImmediate(async () =>
|
|
36
|
+
{
|
|
37
|
+
try
|
|
38
|
+
{
|
|
39
|
+
await this.gateway.close()
|
|
40
|
+
resolve()
|
|
41
|
+
}
|
|
42
|
+
catch(error)
|
|
43
|
+
{
|
|
44
|
+
reject(error)
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
})
|
|
34
48
|
}
|
|
35
49
|
|
|
36
50
|
async createTableCertificate()
|
package/index.test.js
CHANGED
|
@@ -36,11 +36,12 @@ suite('@superhero/eventflow-db', async () =>
|
|
|
36
36
|
{
|
|
37
37
|
const hubs = await db.readOnlineHubs()
|
|
38
38
|
assert.ok(hubs.length > 0, 'Online hubs should be returned')
|
|
39
|
-
|
|
40
|
-
assert.equal(
|
|
41
|
-
assert.equal(
|
|
42
|
-
assert.equal(
|
|
43
|
-
assert.equal(
|
|
39
|
+
const onlineHub = hubs[hubs.length - 1]
|
|
40
|
+
assert.equal(onlineHub.id, hub.id)
|
|
41
|
+
assert.equal(onlineHub.external_ip, hub.external_ip)
|
|
42
|
+
assert.equal(onlineHub.internal_ip, hub.internal_ip)
|
|
43
|
+
assert.equal(onlineHub.external_port, hub.external_port)
|
|
44
|
+
assert.equal(onlineHub.internal_port, hub.internal_port)
|
|
44
45
|
})
|
|
45
46
|
|
|
46
47
|
await sub.test('Persisting an event should generate an ID if not provided', async (sub) =>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superhero/eventflow-db",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.5",
|
|
4
4
|
"description": "Eventflow db is a set of common database logic in the eventflow ecosystem.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eventflow"
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@superhero/locator": "4.2.0"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
|
-
"test-build": "docker ps -q -f name=eventflow-mysql | grep -q . && docker stop eventflow-mysql; docker run --rm --name eventflow-mysql -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=eventflow -p 3306:3306 --health-cmd=\"mysqladmin ping -h 127.0.0.1 -uroot -proot --silent || exit 1\" --health-interval=10s --health-timeout=5s --health-retries=5 -d mysql:latest; until [ \"$(docker inspect --format='{{.State.Health.Status}}' eventflow-mysql)\" == \"healthy\" ]; do sleep 1; done
|
|
23
|
+
"test-build": "docker ps -q -f name=eventflow-mysql | grep -q . && docker stop eventflow-mysql; docker run --rm --name eventflow-mysql -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=eventflow -p 3306:3306 --health-cmd=\"mysqladmin ping -h 127.0.0.1 -uroot -proot --silent || exit 1\" --health-interval=10s --health-timeout=5s --health-retries=5 -d mysql:latest; until [ \"$(docker inspect --format='{{.State.Health.Status}}' eventflow-mysql)\" == \"healthy\" ]; do sleep 1; done",
|
|
24
24
|
"test": "node --trace-warnings --test --experimental-test-coverage"
|
|
25
25
|
},
|
|
26
26
|
"author": {
|