Constructor
new VivochaChannel()
Extends
- external:EventEmitter
Members
(readonly) contacts
Master contact list, contains all contacts known to the channel. Contacts are removed from this list once terminate, completed, transferred or joined by other agents.
(readonly) contacts
Master contact list, contains all contacts known to the channel. Contacts are removed from this list once terminate, completed, transferred or joined by other agents.
(readonly) contacts
Master contact list, contains all contacts known to the channel. Contacts are removed from this list once terminate, completed, transferred or joined by other agents.
Methods
ws(type, cmd, queryopt, optsopt) → {Promise}
Invokes a Vivocha V1 REST Web Service. The function uses
The fetch()
API internally.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
type |
string | The type of web service to call |
|
cmd |
string | The command to execute |
|
query |
object |
<optional> |
The data to send to the server in the query string. |
opts |
object |
<optional> |
Options with the same format of the |
Returns:
Resolves to the result of the requested Web Service.
- Type
- Promise
disconnect()
Disconnects the Channel from the Vivocha servers.
isConnected() → {boolean}
Returns the current connection state
Returns:
- Type
- boolean
ws(type, cmd, queryopt, optsopt) → {Promise}
Invokes a Vivocha V1 REST Web Service. The function uses
The fetch()
API internally.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
type |
string | The type of web service to call |
|
cmd |
string | The command to execute |
|
query |
object |
<optional> |
The data to send to the server in the query string. |
opts |
object |
<optional> |
Options with the same format of the |
Returns:
Resolves to the result of the requested Web Service.
- Type
- Promise
disconnect()
Disconnects the Channel from the Vivocha servers.
isConnected() → {boolean}
Returns the current connection state
Returns:
- Type
- boolean
ws(type, cmd, queryopt, optsopt) → {Promise}
Invokes a Vivocha V1 REST Web Service. The function uses
The fetch()
API internally.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
type |
string | The type of web service to call |
|
cmd |
string | The command to execute |
|
query |
object |
<optional> |
The data to send to the server in the query string. |
opts |
object |
<optional> |
Options with the same format of the |
Returns:
Resolves to the result of the requested Web Service.
- Type
- Promise
disconnect()
Disconnects the Channel from the Vivocha servers.
isConnected() → {boolean}
Returns the current connection state
Returns:
- Type
- boolean
Events
connecting
The Channel is trying to connect to the first time to the Vivocha servers.
reconnecting
The connection to the Vivocha servers was lost and the Channel is trying to restore it.
connect
The Channel successfully established a connection to the Vivocha servers.
reconnect
The connection to the Vivocha servers was restored.
disconnect
The connection was terminated and it won't be reestablished. This event can be triggered for two reasons: as a result of calling the VivochaChannel.disconnect method and if a lost connection couldn't be restored after the maximum number of attempts.
failed
A connection to the Vivocha servers was not possible. This event is triggered only if a successful connection was never obtained.
connecting
The Channel is trying to connect to the first time to the Vivocha servers.
reconnecting
The connection to the Vivocha servers was lost and the Channel is trying to restore it.
connect
The Channel successfully established a connection to the Vivocha servers.
reconnect
The connection to the Vivocha servers was restored.
disconnect
The connection was terminated and it won't be reestablished. This event can be triggered for two reasons: as a result of calling the VivochaChannel.disconnect method and if a lost connection couldn't be restored after the maximum number of attempts.
failed
A connection to the Vivocha servers was not possible. This event is triggered only if a successful connection was never obtained.
connecting
The Channel is trying to connect to the first time to the Vivocha servers.
reconnecting
The connection to the Vivocha servers was lost and the Channel is trying to restore it.
connect
The Channel successfully established a connection to the Vivocha servers.
reconnect
The connection to the Vivocha servers was restored.
disconnect
The connection was terminated and it won't be reestablished. This event can be triggered for two reasons: as a result of calling the VivochaChannel.disconnect method and if a lost connection couldn't be restored after the maximum number of attempts.
failed
A connection to the Vivocha servers was not possible. This event is triggered only if a successful connection was never obtained.