@superhero/eventflow-hub 4.0.4 → 4.0.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.
- package/README.md +7 -7
- package/config.js +2 -2
- package/index.js +2 -2
- package/index.test.js +9 -16
- package/package.json +4 -5
package/README.md
CHANGED
|
@@ -58,20 +58,20 @@ tests 14
|
|
|
58
58
|
suites 5
|
|
59
59
|
pass 14
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
file | line % | branch % | funcs % | uncovered
|
|
63
|
-
|
|
61
|
+
-------------------------------------------------------------------------------------------------------------
|
|
62
|
+
file | line % | branch % | funcs % | uncovered line
|
|
63
|
+
-------------------------------------------------------------------------------------------------------------
|
|
64
64
|
config.js | 100.00 | 100.00 | 100.00 |
|
|
65
|
-
index.js | 73.36 | 74.42 | 74.07 |
|
|
65
|
+
index.js | 73.36 | 74.42 | 74.07 | 44-47 120-124 144-146 150-154 157-161 183-185 254-2…
|
|
66
66
|
index.test.js | 100.00 | 100.00 | 100.00 |
|
|
67
67
|
manager | | | |
|
|
68
68
|
spokes.js | 100.00 | 100.00 | 100.00 |
|
|
69
69
|
spokes.test.js | 100.00 | 100.00 | 100.00 |
|
|
70
70
|
subscribers.js | 78.21 | 100.00 | 83.33 | 61-77
|
|
71
71
|
subscribers.test.js | 100.00 | 100.00 | 100.00 |
|
|
72
|
-
|
|
73
|
-
all files |
|
|
74
|
-
|
|
72
|
+
-------------------------------------------------------------------------------------------------------------
|
|
73
|
+
all files | 82.97 | 86.32 | 87.50 |
|
|
74
|
+
-------------------------------------------------------------------------------------------------------------
|
|
75
75
|
```
|
|
76
76
|
|
|
77
77
|
## License
|
package/config.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export default
|
|
5
5
|
{
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
bootstrap : { '@superhero/eventflow-hub' : true },
|
|
7
|
+
dependency : { '@superhero/eventflow-db' : true },
|
|
8
8
|
locator : { '@superhero/eventflow-hub' : true },
|
|
9
9
|
eventflow :
|
|
10
10
|
{
|
package/index.js
CHANGED
|
@@ -11,8 +11,8 @@ import { setInterval as asyncInterval } from 'node:timers/promises'
|
|
|
11
11
|
export function locate(locator)
|
|
12
12
|
{
|
|
13
13
|
const
|
|
14
|
-
config = locator
|
|
15
|
-
db = locator('@superhero/eventflow-db'),
|
|
14
|
+
config = locator.config.find('eventflow/hub', {}),
|
|
15
|
+
db = locator.locate('@superhero/eventflow-db'),
|
|
16
16
|
hub = new Hub(config, db)
|
|
17
17
|
|
|
18
18
|
return hub
|
package/index.test.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import assert from 'node:assert'
|
|
2
2
|
import util from 'node:util'
|
|
3
|
-
import Config from '@superhero/config'
|
|
4
3
|
import Locator from '@superhero/locator'
|
|
5
4
|
import Channel from '@superhero/tcp-record-channel'
|
|
6
5
|
import { suite, test, beforeEach, afterEach } from 'node:test'
|
|
@@ -16,13 +15,11 @@ suite('@superhero/eventflow-hub', () =>
|
|
|
16
15
|
if(beforeEach.skip) return
|
|
17
16
|
locator = new Locator()
|
|
18
17
|
locator.log.config.mute = true
|
|
19
|
-
|
|
20
|
-
await config.add('
|
|
21
|
-
|
|
22
|
-
config.assign({ eventflow: { hub: { certificates: { CERT_PASS_ENCRYPTION_KEY: 'encryptionKey123' }}}})
|
|
23
|
-
locator.set('@superhero/config', config)
|
|
18
|
+
await locator.config.add('@superhero/eventflow-db')
|
|
19
|
+
await locator.config.add('./config.js')
|
|
20
|
+
locator.config.assign({ eventflow: { hub: { certificates: { CERT_PASS_ENCRYPTION_KEY: 'encryptionKey123' }}}})
|
|
24
21
|
await locator.eagerload('@superhero/eventflow-db')
|
|
25
|
-
await locator.eagerload(config.find('locator'))
|
|
22
|
+
await locator.eagerload(locator.config.find('locator'))
|
|
26
23
|
hub = locator('@superhero/eventflow-hub')
|
|
27
24
|
hub.log.config.mute = true
|
|
28
25
|
await hub.bootstrap()
|
|
@@ -78,14 +75,11 @@ suite('@superhero/eventflow-hub', () =>
|
|
|
78
75
|
&& '50002' === port
|
|
79
76
|
&& hub2.destroy().then(accept))
|
|
80
77
|
|
|
81
|
-
const
|
|
82
|
-
locator2 = new Locator(),
|
|
83
|
-
config2 = new Config()
|
|
84
|
-
|
|
78
|
+
const locator2 = new Locator()
|
|
85
79
|
locator2.log.config.mute = true
|
|
86
|
-
await
|
|
87
|
-
await
|
|
88
|
-
|
|
80
|
+
await locator2.config.add('@superhero/eventflow-db')
|
|
81
|
+
await locator2.config.add('./config.js')
|
|
82
|
+
locator2.config.assign(
|
|
89
83
|
{ eventflow:
|
|
90
84
|
{ hub:
|
|
91
85
|
{ INTERNAL_PORT:50002,
|
|
@@ -93,9 +87,8 @@ suite('@superhero/eventflow-hub', () =>
|
|
|
93
87
|
certificates:
|
|
94
88
|
{ CERT_PASS_ENCRYPTION_KEY: 'encryptionKey123' }}}})
|
|
95
89
|
|
|
96
|
-
locator2.set('@superhero/config', config2)
|
|
97
90
|
await locator2.eagerload('@superhero/eventflow-db')
|
|
98
|
-
await locator2.eagerload(
|
|
91
|
+
await locator2.eagerload(locator2.config.find('locator'))
|
|
99
92
|
const hub2 = locator2('@superhero/eventflow-hub')
|
|
100
93
|
hub2.log.config.mute = true
|
|
101
94
|
await hub2.bootstrap()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superhero/eventflow-hub",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.6",
|
|
4
4
|
"description": "Eventflow hub is the central server component in the eventflow ecosystem.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eventflow",
|
|
@@ -14,17 +14,16 @@
|
|
|
14
14
|
"./manager/*": "./manager/*.js"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@superhero/eventflow-db": "^4.1.2",
|
|
18
17
|
"@superhero/id-name-generator": "^4.0.0",
|
|
19
18
|
"@superhero/log": "^4.0.0",
|
|
20
|
-
"@superhero/eventflow-certificates": "^4.0.
|
|
19
|
+
"@superhero/eventflow-certificates": "^4.0.5",
|
|
20
|
+
"@superhero/eventflow-db": "^4.2.1",
|
|
21
21
|
"@superhero/openssl": "^4.0.2",
|
|
22
22
|
"@superhero/tcp-record-channel": "^4.2.1",
|
|
23
23
|
"@superhero/deep": "^4.2.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@superhero/
|
|
27
|
-
"@superhero/locator": "^4.2.1"
|
|
26
|
+
"@superhero/locator": "^4.2.3"
|
|
28
27
|
},
|
|
29
28
|
"scripts": {
|
|
30
29
|
"test-build": "npm explore @superhero/eventflow-db -- npm run test-build",
|