@dokebi/websocket-hub 0.0.0-stage → 0.2.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.
- package/AI.md +76 -0
- package/LICENSE +21 -0
- package/README.md +101 -2
- package/dist/delivery.d.ts +51 -0
- package/dist/delivery.js +196 -0
- package/dist/event-queue.d.ts +12 -0
- package/dist/event-queue.js +66 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +66 -0
- package/dist/install.d.ts +11 -0
- package/dist/install.js +12 -0
- package/dist/leader.d.ts +16 -0
- package/dist/leader.js +331 -0
- package/dist/local.d.ts +20 -0
- package/dist/local.js +243 -0
- package/dist/node.d.ts +23 -0
- package/dist/node.js +294 -0
- package/dist/options.d.ts +35 -0
- package/dist/options.js +122 -0
- package/dist/peer-client.d.ts +24 -0
- package/dist/peer-client.js +489 -0
- package/dist/protocol.d.ts +13 -0
- package/dist/protocol.js +141 -0
- package/dist/status-cli.d.ts +2 -0
- package/dist/status-cli.js +95 -0
- package/dist/status.d.ts +22 -0
- package/dist/status.js +62 -0
- package/dist/store.d.ts +35 -0
- package/dist/store.js +180 -0
- package/dist/types.d.ts +125 -0
- package/dist/types.js +8 -0
- package/dist/wire.d.ts +10 -0
- package/dist/wire.js +62 -0
- package/options.schema.json +170 -0
- package/package.json +64 -4
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"additionalProperties": false,
|
|
5
|
+
"properties": {
|
|
6
|
+
"mode": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"enum": ["local", "cluster"],
|
|
9
|
+
"default": "local",
|
|
10
|
+
"description": "local: one process, in memory (no Redis/NATS). cluster: several processes or servers share presence through Redis (D-0029)."
|
|
11
|
+
},
|
|
12
|
+
"allowInCluster": {
|
|
13
|
+
"type": "boolean",
|
|
14
|
+
"default": false,
|
|
15
|
+
"description": "Allow mode local in a node:cluster worker (each worker then has its own hub)."
|
|
16
|
+
},
|
|
17
|
+
"namespace": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"minLength": 1,
|
|
20
|
+
"maxLength": 64
|
|
21
|
+
},
|
|
22
|
+
"serverId": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"minLength": 1,
|
|
25
|
+
"maxLength": 64
|
|
26
|
+
},
|
|
27
|
+
"redisConnection": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"minLength": 1,
|
|
30
|
+
"maxLength": 64,
|
|
31
|
+
"description": "Required in cluster mode."
|
|
32
|
+
},
|
|
33
|
+
"natsConnection": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"minLength": 1,
|
|
36
|
+
"maxLength": 64,
|
|
37
|
+
"description": "Optional in cluster mode: leader-change notifications; without it peers notice by Redis polling (pollMs)."
|
|
38
|
+
},
|
|
39
|
+
"host": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"minLength": 1,
|
|
42
|
+
"maxLength": 253
|
|
43
|
+
},
|
|
44
|
+
"advertiseHost": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"minLength": 1,
|
|
47
|
+
"maxLength": 253
|
|
48
|
+
},
|
|
49
|
+
"secret": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"minLength": 32,
|
|
52
|
+
"maxLength": 256,
|
|
53
|
+
"writeOnly": true,
|
|
54
|
+
"description": "Shared private-network peer authentication secret. Configure explicitly; never send to WebSocket clients."
|
|
55
|
+
},
|
|
56
|
+
"port": {
|
|
57
|
+
"type": "integer",
|
|
58
|
+
"minimum": 0,
|
|
59
|
+
"maximum": 65535,
|
|
60
|
+
"default": 0
|
|
61
|
+
},
|
|
62
|
+
"leaseMs": {
|
|
63
|
+
"type": "integer",
|
|
64
|
+
"minimum": 500,
|
|
65
|
+
"maximum": 60000,
|
|
66
|
+
"default": 3000
|
|
67
|
+
},
|
|
68
|
+
"pollMs": {
|
|
69
|
+
"type": "integer",
|
|
70
|
+
"minimum": 25,
|
|
71
|
+
"maximum": 10000,
|
|
72
|
+
"default": 500
|
|
73
|
+
},
|
|
74
|
+
"ownerTtlMs": {
|
|
75
|
+
"type": "integer",
|
|
76
|
+
"minimum": 1500,
|
|
77
|
+
"maximum": 120000,
|
|
78
|
+
"default": 15000
|
|
79
|
+
},
|
|
80
|
+
"startupMs": {
|
|
81
|
+
"type": "integer",
|
|
82
|
+
"minimum": 1000,
|
|
83
|
+
"maximum": 120000,
|
|
84
|
+
"default": 15000
|
|
85
|
+
},
|
|
86
|
+
"maxFrameBytes": {
|
|
87
|
+
"type": "integer",
|
|
88
|
+
"minimum": 16384,
|
|
89
|
+
"maximum": 4194304,
|
|
90
|
+
"default": 1048576
|
|
91
|
+
},
|
|
92
|
+
"maxPayloadBytes": {
|
|
93
|
+
"type": "integer",
|
|
94
|
+
"minimum": 1,
|
|
95
|
+
"maximum": 262144,
|
|
96
|
+
"default": 65536
|
|
97
|
+
},
|
|
98
|
+
"maxConnections": {
|
|
99
|
+
"type": "integer",
|
|
100
|
+
"minimum": 1,
|
|
101
|
+
"maximum": 4096,
|
|
102
|
+
"default": 128
|
|
103
|
+
},
|
|
104
|
+
"maxOwners": {
|
|
105
|
+
"type": "integer",
|
|
106
|
+
"minimum": 1,
|
|
107
|
+
"maximum": 1024,
|
|
108
|
+
"default": 64
|
|
109
|
+
},
|
|
110
|
+
"maxTotalConnections": {
|
|
111
|
+
"type": "integer",
|
|
112
|
+
"minimum": 1,
|
|
113
|
+
"maximum": 100000,
|
|
114
|
+
"default": 8192
|
|
115
|
+
},
|
|
116
|
+
"maxPending": {
|
|
117
|
+
"type": "integer",
|
|
118
|
+
"minimum": 1,
|
|
119
|
+
"maximum": 4096,
|
|
120
|
+
"default": 128
|
|
121
|
+
},
|
|
122
|
+
"queueBytes": {
|
|
123
|
+
"type": "integer",
|
|
124
|
+
"minimum": 16384,
|
|
125
|
+
"maximum": 67108864,
|
|
126
|
+
"default": 4194304
|
|
127
|
+
},
|
|
128
|
+
"deliveryTimeoutMs": {
|
|
129
|
+
"type": "integer",
|
|
130
|
+
"minimum": 1000,
|
|
131
|
+
"maximum": 120000,
|
|
132
|
+
"default": 60000
|
|
133
|
+
},
|
|
134
|
+
"retryMs": {
|
|
135
|
+
"type": "integer",
|
|
136
|
+
"minimum": 100,
|
|
137
|
+
"maximum": 5000,
|
|
138
|
+
"default": 1000
|
|
139
|
+
},
|
|
140
|
+
"maxDeliveries": {
|
|
141
|
+
"type": "integer",
|
|
142
|
+
"minimum": 1,
|
|
143
|
+
"maximum": 100000,
|
|
144
|
+
"default": 10000
|
|
145
|
+
},
|
|
146
|
+
"deliveryBytes": {
|
|
147
|
+
"type": "integer",
|
|
148
|
+
"minimum": 16384,
|
|
149
|
+
"maximum": 268435456,
|
|
150
|
+
"default": 67108864
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"if": {
|
|
154
|
+
"properties": {
|
|
155
|
+
"mode": {
|
|
156
|
+
"const": "cluster"
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"required": ["mode"]
|
|
160
|
+
},
|
|
161
|
+
"then": {
|
|
162
|
+
"properties": {
|
|
163
|
+
"namespace": true,
|
|
164
|
+
"serverId": true,
|
|
165
|
+
"redisConnection": true,
|
|
166
|
+
"secret": true
|
|
167
|
+
},
|
|
168
|
+
"required": ["namespace", "serverId", "redisConnection", "secret"]
|
|
169
|
+
}
|
|
170
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,66 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dokebi/websocket-hub",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"bin": {
|
|
10
|
+
"dokebi-hub-status": "./dist/status-cli.js"
|
|
11
|
+
},
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"options.schema.json",
|
|
21
|
+
"README.md",
|
|
22
|
+
"AI.md",
|
|
23
|
+
"LICENSE"
|
|
24
|
+
],
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=24.0.0"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsc -p tsconfig.json",
|
|
30
|
+
"typecheck": "tsc -p tsconfig.test.json --noEmit",
|
|
31
|
+
"test": "tsc -p tsconfig.test.json && node --test \".tmp/tests/tests/*.test.js\""
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"@dokebi/core": "^0.2.0",
|
|
35
|
+
"@dokebi/nats": "^0.1.0",
|
|
36
|
+
"@dokebi/redis": "^0.1.0 || ^0.2.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@dokebi/nats": "0.1.1",
|
|
40
|
+
"@dokebi/redis": "0.2.0"
|
|
41
|
+
},
|
|
42
|
+
"dokebi": {
|
|
43
|
+
"schemaVersion": 2,
|
|
44
|
+
"id": "dokebi-websocket-hub",
|
|
45
|
+
"core": "^0.2.0",
|
|
46
|
+
"dependencies": [
|
|
47
|
+
{
|
|
48
|
+
"name": "dokebi-redis",
|
|
49
|
+
"version": "^0.1.0 || ^0.2.0",
|
|
50
|
+
"optional": true
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "dokebi-nats",
|
|
54
|
+
"version": "^0.1.0",
|
|
55
|
+
"optional": true
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"optionsSchema": "options.schema.json",
|
|
59
|
+
"documentation": "AI.md",
|
|
60
|
+
"installModule": "dist/install.js"
|
|
61
|
+
},
|
|
62
|
+
"publishConfig": {
|
|
63
|
+
"access": "public",
|
|
64
|
+
"registry": "https://registry.npmjs.org/"
|
|
65
|
+
}
|
|
66
|
+
}
|