@ekhein/sekiro-node-client 2.1.18 → 2.1.19
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/main.d.ts +1 -2
- package/dist/main.js +5 -7
- package/dist/utils/ws.util.d.ts +1 -1
- package/dist/utils/ws.util.js +1 -1
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { ErrorEvent, CloseEvent } from 'partysocket/ws.js';
|
|
|
2
2
|
import { W3CWebSocket } from './utils/ws.util';
|
|
3
3
|
export declare class SekiroClient extends W3CWebSocket {
|
|
4
4
|
readonly group: string;
|
|
5
|
-
readonly wsURL: string;
|
|
6
5
|
readonly clientId: string;
|
|
7
6
|
private readonly logger;
|
|
8
7
|
private readonly handlers;
|
|
@@ -10,7 +9,7 @@ export declare class SekiroClient extends W3CWebSocket {
|
|
|
10
9
|
onclose: (event: CloseEvent) => Promise<void>;
|
|
11
10
|
onerror: (event: ErrorEvent) => Promise<void>;
|
|
12
11
|
onmessage: (event: MessageEvent) => Promise<void>;
|
|
13
|
-
constructor(group?: string,
|
|
12
|
+
constructor(group?: string, clientId?: string);
|
|
14
13
|
private success;
|
|
15
14
|
private unknown;
|
|
16
15
|
private post;
|
package/dist/main.js
CHANGED
|
@@ -6,7 +6,6 @@ const logger_util_1 = require("./utils/logger.util");
|
|
|
6
6
|
const ws_util_1 = require("./utils/ws.util");
|
|
7
7
|
class SekiroClient extends ws_util_1.W3CWebSocket {
|
|
8
8
|
group;
|
|
9
|
-
wsURL;
|
|
10
9
|
clientId;
|
|
11
10
|
logger = new logger_util_1.Logger(this);
|
|
12
11
|
handlers = new Map();
|
|
@@ -43,13 +42,12 @@ class SekiroClient extends ws_util_1.W3CWebSocket {
|
|
|
43
42
|
await this.unknown(request, error.message);
|
|
44
43
|
}
|
|
45
44
|
};
|
|
46
|
-
constructor(group = process.env.namespace,
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
super({ wsURL
|
|
45
|
+
constructor(group = process.env.namespace, clientId = (0, uuid_1.v5)(group + ":" + process.env.pm_id, uuid_1.NIL).replace(/-/g, "")) {
|
|
46
|
+
const wsURL = new URL("/business-demo/register", process.env.SEKIRO_WS);
|
|
47
|
+
wsURL.searchParams.append("group", group);
|
|
48
|
+
wsURL.searchParams.append("clientId", clientId);
|
|
49
|
+
super({ wsURL });
|
|
51
50
|
this.group = group;
|
|
52
|
-
this.wsURL = wsURL;
|
|
53
51
|
this.clientId = clientId;
|
|
54
52
|
}
|
|
55
53
|
async success(request, data) {
|
package/dist/utils/ws.util.d.ts
CHANGED
package/dist/utils/ws.util.js
CHANGED
|
@@ -5,7 +5,7 @@ const partysocket_1 = require("partysocket");
|
|
|
5
5
|
const ws_1 = require("ws");
|
|
6
6
|
class W3CWebSocket extends partysocket_1.WebSocket {
|
|
7
7
|
constructor(options) {
|
|
8
|
-
super(options.wsURL, [], {
|
|
8
|
+
super(options.wsURL.href, [], {
|
|
9
9
|
debug: false,
|
|
10
10
|
connectionTimeout: 10e3,
|
|
11
11
|
maxEnqueuedMessages: -1,
|