comty.js 0.61.0 → 0.61.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/dist/index.js +12 -4
- package/dist/ws.js +7 -2
- package/package.json +5 -6
package/dist/index.js
CHANGED
|
@@ -30,7 +30,10 @@ if (globalThis.isServerMode) {
|
|
|
30
30
|
function createClient({
|
|
31
31
|
accessKey = null,
|
|
32
32
|
privateKey = null,
|
|
33
|
-
|
|
33
|
+
ws = {
|
|
34
|
+
enable: false,
|
|
35
|
+
autoConnect: false,
|
|
36
|
+
},
|
|
34
37
|
origin = _remotes2.default.origin,
|
|
35
38
|
eventBus = new (0, _events2.default)(),
|
|
36
39
|
} = {}) {
|
|
@@ -72,9 +75,14 @@ if (globalThis.isServerMode) {
|
|
|
72
75
|
return config
|
|
73
76
|
})
|
|
74
77
|
|
|
75
|
-
if (
|
|
76
|
-
|
|
77
|
-
|
|
78
|
+
if (typeof ws === "object") {
|
|
79
|
+
if (ws.enable === true) {
|
|
80
|
+
__comty_shared_state.ws = new (0, _ws2.default)()
|
|
81
|
+
|
|
82
|
+
if (ws.autoConnect === true) {
|
|
83
|
+
sharedState.ws.connectAll()
|
|
84
|
+
}
|
|
85
|
+
}
|
|
78
86
|
}
|
|
79
87
|
|
|
80
88
|
return sharedState
|
package/dist/ws.js
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
var _withStorage = require('./helpers/withStorage'); var _withStorage2 = _interopRequireDefault(_withStorage);
|
|
3
3
|
|
|
4
4
|
var _socketioclient = require('socket.io-client');
|
|
5
|
-
|
|
5
|
+
//import { RTEngineClient } from "linebridge-client"
|
|
6
|
+
var _src = require('../../linebridge/client/src');
|
|
6
7
|
|
|
7
8
|
class WebsocketManager {constructor() { WebsocketManager.prototype.__init.call(this); }
|
|
8
9
|
__init() {this.sockets = new Map()}
|
|
@@ -54,7 +55,7 @@ class WebsocketManager {constructor() { WebsocketManager.prototype.__init.call(t
|
|
|
54
55
|
remote,
|
|
55
56
|
)
|
|
56
57
|
|
|
57
|
-
const client = new (0,
|
|
58
|
+
const client = new (0, _src.RTEngineClient)({
|
|
58
59
|
url: `${_remotes2.default.origin}/${remote.namespace}`,
|
|
59
60
|
token: _withStorage2.default.engine.get("token"),
|
|
60
61
|
})
|
|
@@ -119,6 +120,10 @@ class WebsocketManager {constructor() { WebsocketManager.prototype.__init.call(t
|
|
|
119
120
|
await this.connect(remote)
|
|
120
121
|
}
|
|
121
122
|
} catch (error) {
|
|
123
|
+
console.error(
|
|
124
|
+
`Failed to connect to [${remote.namespace}]:`,
|
|
125
|
+
error,
|
|
126
|
+
)
|
|
122
127
|
globalThis.__comty_shared_state.eventBus.emit(
|
|
123
128
|
`wsmanager:${remote.namespace}:error`,
|
|
124
129
|
error,
|
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "comty.js",
|
|
3
|
-
"version": "0.61.
|
|
3
|
+
"version": "0.61.1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"author": "RageStudio <support@ragestudio.net>",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"test": "ava",
|
|
8
7
|
"build": "hermes build"
|
|
9
8
|
},
|
|
10
9
|
"files": [
|
|
@@ -13,15 +12,15 @@
|
|
|
13
12
|
"license": "MIT",
|
|
14
13
|
"dependencies": {
|
|
15
14
|
"@foxify/events": "^2.1.0",
|
|
16
|
-
"axios": "^1.4
|
|
15
|
+
"axios": "^1.8.4",
|
|
17
16
|
"js-cookie": "^3.0.5",
|
|
18
17
|
"jsonwebtoken": "^9.0.0",
|
|
19
18
|
"jwt-decode": "^4.0.0",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
19
|
+
"linebridge-client": "^0.2.0",
|
|
20
|
+
"luxon": "^3.6.0",
|
|
21
|
+
"socket.io-client": "^4.8.1"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"ava": "^6.1.2",
|
|
25
24
|
"@ragestudio/hermes": "^1.0.0"
|
|
26
25
|
}
|
|
27
26
|
}
|