@ekhein/sekiro-node-client 2.1.3 → 2.1.4

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 CHANGED
@@ -3,10 +3,10 @@ export declare class SekiroClient extends WebSocket {
3
3
  readonly clientId: string;
4
4
  readonly host: string;
5
5
  readonly port: string;
6
- readonly scope: string;
6
+ readonly namespace: string;
7
7
  private readonly logger;
8
8
  private readonly handlers;
9
- constructor(clientId?: string, host?: string, port?: string, scope?: string);
9
+ constructor(clientId?: string, host?: string, port?: string, namespace?: string);
10
10
  private onOpen;
11
11
  private onClose;
12
12
  private onError;
package/dist/main.js CHANGED
@@ -10,16 +10,16 @@ class SekiroClient extends partysocket_1.WebSocket {
10
10
  clientId;
11
11
  host;
12
12
  port;
13
- scope;
13
+ namespace;
14
14
  logger = new logger_util_1.Logger(this);
15
15
  handlers = new Map();
16
- constructor(clientId = (0, crypto_1.randomUUID)().replace(/-/g, ""), host = process.env.SEKIRO_HOST, port = process.env.SEKIRO_PORT, scope = process.env.SEKIRO_SCOPE) {
16
+ constructor(clientId = (0, crypto_1.randomUUID)().replace(/-/g, ""), host = process.env.SEKIRO_HOST, port = process.env.SEKIRO_PORT, namespace = process.env.namespace) {
17
17
  super("ws://", [], {
18
18
  debug: false,
19
19
  maxEnqueuedMessages: -1,
20
20
  WebSocket: class extends ws_1.WebSocket {
21
21
  constructor() {
22
- const group = String(scope).toLowerCase();
22
+ const group = String(namespace).toLowerCase();
23
23
  const wsURL = new URL("/business-demo/register", "ws://" + host + ":" + port);
24
24
  wsURL.searchParams.append("group", group);
25
25
  wsURL.searchParams.append("clientId", clientId);
@@ -30,7 +30,7 @@ class SekiroClient extends partysocket_1.WebSocket {
30
30
  this.clientId = clientId;
31
31
  this.host = host;
32
32
  this.port = port;
33
- this.scope = scope;
33
+ this.namespace = namespace;
34
34
  super.addEventListener("open", this.onOpen.bind(this));
35
35
  super.addEventListener("message", this.onData.bind(this));
36
36
  super.addEventListener("close", this.onClose.bind(this));
@@ -1,7 +1,7 @@
1
1
  export declare class Logger {
2
2
  private readonly context;
3
3
  constructor(context: {
4
- scope: string;
4
+ namespace: string;
5
5
  clientId: string;
6
6
  });
7
7
  private log;
@@ -9,9 +9,9 @@ class Logger {
9
9
  }
10
10
  log(level, message) {
11
11
  const time = new Date().toLocaleString();
12
- const scope = String(this.context.scope);
12
+ const namespace = String(this.context.namespace);
13
13
  const clientId = String(this.context.clientId);
14
- const base = (0, util_1.format)("[%s] [%s] [%s] [%s] [%s]", level, time, scope, clientId);
14
+ const base = (0, util_1.format)("[%s] [%s] [%s] [%s] [%s]", level, time, namespace, clientId);
15
15
  switch (level) {
16
16
  case "INFO":
17
17
  console.info(base, ...message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ekhein/sekiro-node-client",
3
- "version": "2.1.3",
3
+ "version": "2.1.4",
4
4
  "license": "MIT",
5
5
  "author": "ekhein",
6
6
  "main": "./dist/main.js",