retell-sdk 1.0.11 → 1.0.13

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 +29 -29
  2. package/index.ts +29 -29
  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?" +
@@ -80,7 +80,7 @@ class Retell {
80
80
  },
81
81
  data: {
82
82
  apiKey: this.apiKey,
83
- agentId: options.agentId,
83
+ agentId: options === null || options === void 0 ? void 0 : options.agentId,
84
84
  },
85
85
  });
86
86
  console.log(response.data);
@@ -94,7 +94,7 @@ class Retell {
94
94
  },
95
95
  data: {
96
96
  apiKey: this.apiKey,
97
- eventId: options.eventId,
97
+ eventId: options === null || options === void 0 ? void 0 : options.eventId,
98
98
  },
99
99
  });
100
100
  console.log(response.data);
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 +
@@ -92,7 +92,7 @@ export default class Retell {
92
92
  },
93
93
  data: {
94
94
  apiKey: this.apiKey,
95
- agentId: options.agentId,
95
+ agentId: options?.agentId,
96
96
  },
97
97
  });
98
98
  console.log(response.data);
@@ -107,7 +107,7 @@ export default class Retell {
107
107
  },
108
108
  data: {
109
109
  apiKey: this.apiKey,
110
- eventId: options.eventId,
110
+ eventId: options?.eventId,
111
111
  },
112
112
  });
113
113
  console.log(response.data);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "retell-sdk",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "retell sdk",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",