retell-sdk 1.0.11 → 1.0.12

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.
Files changed (3) hide show
  1. package/dist/index.js +27 -27
  2. package/index.ts +27 -27
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10,33 +10,33 @@ class Retell {
10
10
  return;
11
11
  }
12
12
  var client = new WebSocketClient();
13
- // client.on("connectFailed", function (error: any) {
14
- // console.log("Connect Error: " + error.toString());
15
- // });
16
- // client.on("connect", function (connection: any) {
17
- // console.log("WebSocket Client Connected");
18
- // connection.on("error", function (error: any) {
19
- // console.log("Connection Error: " + error.toString());
20
- // });
21
- // connection.on("close", function () {
22
- // console.log("echo-protocol Connection Closed");
23
- // });
24
- // connection.on("message", function (message: any) {
25
- // if (message.type === "utf8") {
26
- // console.log("Received: '" + message.utf8Data + "'");
27
- // }
28
- // connection.send("12345");
29
- // });
30
- // function sendNumber() {
31
- // if (connection.connected) {
32
- // var number = Math.round(Math.random() * 0xffffff);
33
- // // connection.sendUTF(number.toString());
34
- // connection.sendUTF("12345");
35
- // setTimeout(sendNumber, 1000);
36
- // }
37
- // }
38
- // sendNumber();
39
- // });
13
+ client.on("connectFailed", function (error) {
14
+ console.log("Connect Error: " + error.toString());
15
+ });
16
+ client.on("connect", function (connection) {
17
+ console.log("WebSocket Client Connected");
18
+ connection.on("error", function (error) {
19
+ console.log("Connection Error: " + error.toString());
20
+ });
21
+ connection.on("close", function () {
22
+ console.log("echo-protocol Connection Closed");
23
+ });
24
+ connection.on("message", function (message) {
25
+ if (message.type === "utf8") {
26
+ console.log("Received: '" + message.utf8Data + "'");
27
+ }
28
+ connection.send("12345");
29
+ });
30
+ function sendNumber() {
31
+ if (connection.connected) {
32
+ var number = Math.round(Math.random() * 0xffffff);
33
+ // connection.sendUTF(number.toString());
34
+ connection.sendUTF("12345");
35
+ setTimeout(sendNumber, 1000);
36
+ }
37
+ }
38
+ sendNumber();
39
+ });
40
40
  await client.connect("ws://" +
41
41
  this.ip +
42
42
  "/create-socket?" +
package/index.ts CHANGED
@@ -16,35 +16,35 @@ export default class Retell {
16
16
  return;
17
17
  }
18
18
  var client = new WebSocketClient();
19
- // client.on("connectFailed", function (error: any) {
20
- // console.log("Connect Error: " + error.toString());
21
- // });
19
+ client.on("connectFailed", function (error: any) {
20
+ console.log("Connect Error: " + error.toString());
21
+ });
22
22
 
23
- // client.on("connect", function (connection: any) {
24
- // console.log("WebSocket Client Connected");
25
- // connection.on("error", function (error: any) {
26
- // console.log("Connection Error: " + error.toString());
27
- // });
28
- // connection.on("close", function () {
29
- // console.log("echo-protocol Connection Closed");
30
- // });
31
- // connection.on("message", function (message: any) {
32
- // if (message.type === "utf8") {
33
- // console.log("Received: '" + message.utf8Data + "'");
34
- // }
35
- // connection.send("12345");
36
- // });
23
+ client.on("connect", function (connection: any) {
24
+ console.log("WebSocket Client Connected");
25
+ connection.on("error", function (error: any) {
26
+ console.log("Connection Error: " + error.toString());
27
+ });
28
+ connection.on("close", function () {
29
+ console.log("echo-protocol Connection Closed");
30
+ });
31
+ connection.on("message", function (message: any) {
32
+ if (message.type === "utf8") {
33
+ console.log("Received: '" + message.utf8Data + "'");
34
+ }
35
+ connection.send("12345");
36
+ });
37
37
 
38
- // function sendNumber() {
39
- // if (connection.connected) {
40
- // var number = Math.round(Math.random() * 0xffffff);
41
- // // connection.sendUTF(number.toString());
42
- // connection.sendUTF("12345");
43
- // setTimeout(sendNumber, 1000);
44
- // }
45
- // }
46
- // sendNumber();
47
- // });
38
+ function sendNumber() {
39
+ if (connection.connected) {
40
+ var number = Math.round(Math.random() * 0xffffff);
41
+ // connection.sendUTF(number.toString());
42
+ connection.sendUTF("12345");
43
+ setTimeout(sendNumber, 1000);
44
+ }
45
+ }
46
+ sendNumber();
47
+ });
48
48
  await client.connect(
49
49
  "ws://" +
50
50
  this.ip +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "retell-sdk",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "retell sdk",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",