rdh-socket-client 1.1.4 → 1.1.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rdh-socket-client",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "Client Socket for rdh-socket",
5
5
  "main": "src/index.ts",
6
6
  "type": "module",
@@ -10,7 +10,6 @@
10
10
  "author": "RAKOTONDRAMANANA David Henintsoa",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "axios": "^1.6.2",
14
13
  "socket.io-client": "^4.7.2"
15
14
  }
16
15
  }
package/src/index.ts CHANGED
@@ -1,4 +1,3 @@
1
- import axios from "axios";
2
1
  import Channel from "./Channel";
3
2
  import { Options } from "./types";
4
3
  import io, { Socket } from 'socket.io-client';
@@ -7,10 +6,8 @@ export default class RdhClientSocket {
7
6
  private options: Options;
8
7
  private ws_host: string;
9
8
  private socket: Socket;
10
- private api_url: string;
11
-
9
+ $
12
10
  constructor(options: Options) {
13
- this.api_url = "https://rdh-socket.wuaze.com/api/subscribe"
14
11
 
15
12
  if (!options.app_ws) {
16
13
  this.ws_host = "https://rdh-websocket.onrender.com"
@@ -23,25 +20,9 @@ export default class RdhClientSocket {
23
20
  }
24
21
 
25
22
  async init() {
26
- const status = await this.verifyToken()
27
- this.options.status = status;
28
23
  this.socket = io(this.ws_host, {
29
24
  query: this.options
30
25
  });
31
-
32
- if (!status) {
33
- console.error("Invalid TOKEN");
34
- }
35
- }
36
-
37
- async verifyToken() {
38
- const fullURL = this.api_url+`?app_id=${this.options.app_id}&app_key=${this.options.app_key}`
39
-
40
- return await axios.get(fullURL).then(response => {
41
- return response.data.status;
42
- }).catch(() => {
43
- return false;
44
- })
45
26
  }
46
27
 
47
28
  channel(channel_name: string): Channel {
@@ -4,5 +4,4 @@ export type Options = {
4
4
  app_id: string;
5
5
  app_ws: string | null | undefined;
6
6
  app_key: string;
7
- status: boolean | false;
8
7
  };