twilio-taskrouter 0.5.2 → 0.5.6
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/CHANGELOG.md +28 -0
- package/README.md +3 -6
- package/dist/docs/Activity.html +1 -1
- package/dist/docs/Channel.html +1 -1
- package/dist/docs/IncomingTransfer.html +1 -1
- package/dist/docs/OutgoingTransfer.html +1 -1
- package/dist/docs/Reservation.html +1 -1
- package/dist/docs/Task.html +1 -1
- package/dist/docs/TaskQueue.html +1 -1
- package/dist/docs/Transfers.html +1 -1
- package/dist/docs/Worker.html +51 -1
- package/dist/docs/classes.list.html +51 -1
- package/dist/docs/index.html +3 -6
- package/dist/docs/quicksearch.html +1 -1
- package/dist/index.commonjs2.js +4 -16
- package/dist/index.window.js +4 -30
- package/dist/types.d.ts +167 -0
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
0.5.6
|
|
2
|
+
==========
|
|
3
|
+
Maintenance
|
|
4
|
+
----------
|
|
5
|
+
- Add type declarations for TaskRouterEventHandler and Worker.createTask
|
|
6
|
+
|
|
7
|
+
0.5.5
|
|
8
|
+
==========
|
|
9
|
+
New Features
|
|
10
|
+
----------
|
|
11
|
+
- Updated Task Event Emitter to provide the Task object upon Task Updates
|
|
12
|
+
- Export TaskRouterEventHandler
|
|
13
|
+
|
|
14
|
+
0.5.4
|
|
15
|
+
==========
|
|
16
|
+
Maintenance
|
|
17
|
+
----------
|
|
18
|
+
- Clean up flaky tests
|
|
19
|
+
- Include types.d.ts in build
|
|
20
|
+
|
|
21
|
+
0.5.3
|
|
22
|
+
==========
|
|
23
|
+
New Features
|
|
24
|
+
----------
|
|
25
|
+
- Add explicit logging for server, programmatic, client disconnects
|
|
26
|
+
- Updates the Worker disconnected event emitter to also include the reason for disconnect
|
|
27
|
+
- Additional unit and integration tests to confirm logging
|
|
28
|
+
|
|
1
29
|
0.5.2
|
|
2
30
|
==========
|
|
3
31
|
Maintenance
|
package/README.md
CHANGED
|
@@ -10,11 +10,6 @@ TaskRouter is Twilio's skills based routing system. With this library, you can m
|
|
|
10
10
|
**NOTE: This SDK is in a Developer Preview Release**. This version of TaskRouter is intended for Twilio Flex. If you are using it outside of Twilio Flex, you may encounter bugs and instability, and
|
|
11
11
|
the underlying APIs available in this release may change in subsequent releases.
|
|
12
12
|
|
|
13
|
-
**We want your feedback!** Email Tyler Cole
|
|
14
|
-
at [tcole@twilio.com](mailto:tcole@twilio.com) with suggested
|
|
15
|
-
improvements, feature requests and general feedback. If you need technical
|
|
16
|
-
support, contact [help@twilio.com](mailto:help@twilio.com).
|
|
17
|
-
|
|
18
13
|
Installation
|
|
19
14
|
------------
|
|
20
15
|
|
|
@@ -94,7 +89,9 @@ See [LICENSE.md](https://github.com/twilio/twilio-taskrouter.js/blob/master/LICE
|
|
|
94
89
|
Building
|
|
95
90
|
--------
|
|
96
91
|
|
|
97
|
-
Fork and clone the repository.
|
|
92
|
+
Fork and clone the repository. Use npm to install node 8 (other versions may run into problems).
|
|
93
|
+
|
|
94
|
+
Then, install dependencies with:
|
|
98
95
|
|
|
99
96
|
```
|
|
100
97
|
yarn install
|
package/dist/docs/Activity.html
CHANGED
|
@@ -763,7 +763,7 @@
|
|
|
763
763
|
<span class="jsdoc-message">
|
|
764
764
|
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
|
765
765
|
|
|
766
|
-
on
|
|
766
|
+
on 2021-11-25T08:41:13+00:00
|
|
767
767
|
|
|
768
768
|
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
|
|
769
769
|
</span>
|
package/dist/docs/Channel.html
CHANGED
|
@@ -839,7 +839,7 @@
|
|
|
839
839
|
<span class="jsdoc-message">
|
|
840
840
|
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
|
841
841
|
|
|
842
|
-
on
|
|
842
|
+
on 2021-11-25T08:41:13+00:00
|
|
843
843
|
|
|
844
844
|
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
|
|
845
845
|
</span>
|
|
@@ -475,7 +475,7 @@
|
|
|
475
475
|
<span class="jsdoc-message">
|
|
476
476
|
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
|
477
477
|
|
|
478
|
-
on
|
|
478
|
+
on 2021-11-25T08:41:13+00:00
|
|
479
479
|
|
|
480
480
|
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
|
|
481
481
|
</span>
|
|
@@ -1124,7 +1124,7 @@ No more attempts on the <a href="OutgoingTransfer.html">OutgoingTransfer</a> wil
|
|
|
1124
1124
|
<span class="jsdoc-message">
|
|
1125
1125
|
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
|
1126
1126
|
|
|
1127
|
-
on
|
|
1127
|
+
on 2021-11-25T08:41:13+00:00
|
|
1128
1128
|
|
|
1129
1129
|
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
|
|
1130
1130
|
</span>
|
|
@@ -5257,7 +5257,7 @@
|
|
|
5257
5257
|
<span class="jsdoc-message">
|
|
5258
5258
|
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
|
5259
5259
|
|
|
5260
|
-
on
|
|
5260
|
+
on 2021-11-25T08:41:13+00:00
|
|
5261
5261
|
|
|
5262
5262
|
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
|
|
5263
5263
|
</span>
|
package/dist/docs/Task.html
CHANGED
|
@@ -3230,7 +3230,7 @@
|
|
|
3230
3230
|
<span class="jsdoc-message">
|
|
3231
3231
|
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
|
3232
3232
|
|
|
3233
|
-
on
|
|
3233
|
+
on 2021-11-25T08:41:13+00:00
|
|
3234
3234
|
|
|
3235
3235
|
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
|
|
3236
3236
|
</span>
|
package/dist/docs/TaskQueue.html
CHANGED
|
@@ -571,7 +571,7 @@
|
|
|
571
571
|
<span class="jsdoc-message">
|
|
572
572
|
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
|
573
573
|
|
|
574
|
-
on
|
|
574
|
+
on 2021-11-25T08:41:13+00:00
|
|
575
575
|
|
|
576
576
|
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
|
|
577
577
|
</span>
|
package/dist/docs/Transfers.html
CHANGED
|
@@ -307,7 +307,7 @@
|
|
|
307
307
|
<span class="jsdoc-message">
|
|
308
308
|
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
|
309
309
|
|
|
310
|
-
on
|
|
310
|
+
on 2021-11-25T08:41:13+00:00
|
|
311
311
|
|
|
312
312
|
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
|
|
313
313
|
</span>
|
package/dist/docs/Worker.html
CHANGED
|
@@ -2094,6 +2094,56 @@ should be terminated</li>
|
|
|
2094
2094
|
|
|
2095
2095
|
|
|
2096
2096
|
|
|
2097
|
+
<h5>Parameters:</h5>
|
|
2098
|
+
|
|
2099
|
+
|
|
2100
|
+
<table class="params table table-striped">
|
|
2101
|
+
<thead>
|
|
2102
|
+
<tr>
|
|
2103
|
+
|
|
2104
|
+
<th>Name</th>
|
|
2105
|
+
|
|
2106
|
+
|
|
2107
|
+
<th>Type</th>
|
|
2108
|
+
|
|
2109
|
+
|
|
2110
|
+
|
|
2111
|
+
|
|
2112
|
+
|
|
2113
|
+
<th class="last">Description</th>
|
|
2114
|
+
</tr>
|
|
2115
|
+
</thead>
|
|
2116
|
+
|
|
2117
|
+
<tbody>
|
|
2118
|
+
|
|
2119
|
+
|
|
2120
|
+
<tr>
|
|
2121
|
+
|
|
2122
|
+
<td class="name"><code>reason</code></td>
|
|
2123
|
+
|
|
2124
|
+
|
|
2125
|
+
<td class="type">
|
|
2126
|
+
|
|
2127
|
+
|
|
2128
|
+
<span class="param-type">Object</span>
|
|
2129
|
+
|
|
2130
|
+
|
|
2131
|
+
|
|
2132
|
+
|
|
2133
|
+
</td>
|
|
2134
|
+
|
|
2135
|
+
|
|
2136
|
+
|
|
2137
|
+
|
|
2138
|
+
|
|
2139
|
+
<td class="description last"><p>The reason the <a href="Worker.html">Worker</a> websocket disconnected</p></td>
|
|
2140
|
+
</tr>
|
|
2141
|
+
|
|
2142
|
+
|
|
2143
|
+
</tbody>
|
|
2144
|
+
</table>
|
|
2145
|
+
|
|
2146
|
+
|
|
2097
2147
|
|
|
2098
2148
|
|
|
2099
2149
|
<dl class="details">
|
|
@@ -2814,7 +2864,7 @@ should be terminated</li>
|
|
|
2814
2864
|
<span class="jsdoc-message">
|
|
2815
2865
|
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
|
2816
2866
|
|
|
2817
|
-
on
|
|
2867
|
+
on 2021-11-25T08:41:13+00:00
|
|
2818
2868
|
|
|
2819
2869
|
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
|
|
2820
2870
|
</span>
|
|
@@ -2764,6 +2764,56 @@ No more attempts on the <a href="OutgoingTransfer.html">OutgoingTransfer</a> wil
|
|
|
2764
2764
|
|
|
2765
2765
|
|
|
2766
2766
|
|
|
2767
|
+
<h5>Parameters:</h5>
|
|
2768
|
+
|
|
2769
|
+
|
|
2770
|
+
<table class="params table table-striped">
|
|
2771
|
+
<thead>
|
|
2772
|
+
<tr>
|
|
2773
|
+
|
|
2774
|
+
<th>Name</th>
|
|
2775
|
+
|
|
2776
|
+
|
|
2777
|
+
<th>Type</th>
|
|
2778
|
+
|
|
2779
|
+
|
|
2780
|
+
|
|
2781
|
+
|
|
2782
|
+
|
|
2783
|
+
<th class="last">Description</th>
|
|
2784
|
+
</tr>
|
|
2785
|
+
</thead>
|
|
2786
|
+
|
|
2787
|
+
<tbody>
|
|
2788
|
+
|
|
2789
|
+
|
|
2790
|
+
<tr>
|
|
2791
|
+
|
|
2792
|
+
<td class="name"><code>reason</code></td>
|
|
2793
|
+
|
|
2794
|
+
|
|
2795
|
+
<td class="type">
|
|
2796
|
+
|
|
2797
|
+
|
|
2798
|
+
<span class="param-type">Object</span>
|
|
2799
|
+
|
|
2800
|
+
|
|
2801
|
+
|
|
2802
|
+
|
|
2803
|
+
</td>
|
|
2804
|
+
|
|
2805
|
+
|
|
2806
|
+
|
|
2807
|
+
|
|
2808
|
+
|
|
2809
|
+
<td class="description last"><p>The reason the <a href="Worker.html">Worker</a> websocket disconnected</p></td>
|
|
2810
|
+
</tr>
|
|
2811
|
+
|
|
2812
|
+
|
|
2813
|
+
</tbody>
|
|
2814
|
+
</table>
|
|
2815
|
+
|
|
2816
|
+
|
|
2767
2817
|
|
|
2768
2818
|
|
|
2769
2819
|
<dl class="details">
|
|
@@ -3484,7 +3534,7 @@ No more attempts on the <a href="OutgoingTransfer.html">OutgoingTransfer</a> wil
|
|
|
3484
3534
|
<span class="jsdoc-message">
|
|
3485
3535
|
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
|
3486
3536
|
|
|
3487
|
-
on
|
|
3537
|
+
on 2021-11-25T08:41:13+00:00
|
|
3488
3538
|
|
|
3489
3539
|
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
|
|
3490
3540
|
</span>
|
package/dist/docs/index.html
CHANGED
|
@@ -95,10 +95,6 @@
|
|
|
95
95
|
<h1>twilio-taskrouter.js</h1><p>TaskRouter is Twilio's skills based routing system. With this library, you can manage your Workers in the browser or view the state of your Workspace.</p>
|
|
96
96
|
<p><strong>NOTE: This SDK is in a Developer Preview Release</strong>. This version of TaskRouter is intended for Twilio Flex. If you are using it outside of Twilio Flex, you may encounter bugs and instability, and
|
|
97
97
|
the underlying APIs available in this release may change in subsequent releases.</p>
|
|
98
|
-
<p><strong>We want your feedback!</strong> Email Tyler Cole
|
|
99
|
-
at <a href="mailto:tcole@twilio.com">tcole@twilio.com</a> with suggested
|
|
100
|
-
improvements, feature requests and general feedback. If you need technical
|
|
101
|
-
support, contact <a href="mailto:help@twilio.com">help@twilio.com</a>.</p>
|
|
102
98
|
<h2>Installation</h2><h3>NPM</h3><pre class="prettyprint source"><code>npm install twilio-taskrouter</code></pre><h2>Usage</h2><p>The following is a simple example showing a Worker waiting for Reservations.
|
|
103
99
|
For more information, refer to the
|
|
104
100
|
<a href="//twilio.github.io/twilio-taskrouter.js/index.html">API Docs</a>.</p>
|
|
@@ -150,7 +146,8 @@ function createAccessToken(accountSid, signingKeySid, signingKeySecret, workspac
|
|
|
150
146
|
}
|
|
151
147
|
</code></pre><h2>Changelog</h2><p>See <a href="https://github.com/twilio/twilio-taskrouter.js/blob/master/CHANGELOG.md">CHANGELOG.md</a>.</p>
|
|
152
148
|
<h2>License</h2><p>See <a href="https://github.com/twilio/twilio-taskrouter.js/blob/master/LICENSE.md">LICENSE.md</a>.</p>
|
|
153
|
-
<h2>Building</h2><p>Fork and clone the repository.
|
|
149
|
+
<h2>Building</h2><p>Fork and clone the repository. Use npm to install node 8 (other versions may run into problems).</p>
|
|
150
|
+
<p>Then, install dependencies with:</p>
|
|
154
151
|
<pre class="prettyprint source"><code>yarn install</code></pre><p>Then run the <code>build</code> script:</p>
|
|
155
152
|
<pre class="prettyprint source"><code>yarn build</code></pre><p>The builds and docs will be placed in the <code>dist/</code> directory.</p>
|
|
156
153
|
<p>Before commits, be sure to validate by running:</p>
|
|
@@ -201,7 +198,7 @@ request/contribution process, <a href="https://gun.io/blog/how-to-github-fork-br
|
|
|
201
198
|
<span class="jsdoc-message">
|
|
202
199
|
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
|
203
200
|
|
|
204
|
-
on
|
|
201
|
+
on 2021-11-25T08:41:13+00:00
|
|
205
202
|
|
|
206
203
|
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
|
|
207
204
|
</span>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<script src="scripts/fulltext-search.js"></script>
|
|
7
7
|
|
|
8
8
|
<script type="text/x-docstrap-searchdb">
|
|
9
|
-
{"classes.list.html":{"id":"classes.list.html","title":"Classes","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorker Events Channel#event:availabilityUpdatedChannel#event:capacityUpdatedOutgoingTransfer#event:attemptFailedOutgoingTransfer#event:canceledOutgoingTransfer#event:completedOutgoingTransfer#event:failedReservation#event:acceptedReservation#event:canceledReservation#event:completedReservation#event:rejectedReservation#event:rescindedReservation#event:timeoutReservation#event:wrapupTask#event:canceledTask#event:completedTask#event:transferInitiatedTask#event:updatedTask#event:wrapupWorker#event:activityUpdatedWorker#event:attributesUpdatedWorker#event:disconnectedWorker#event:errorWorker#event:readyWorker#event:reservationCreatedWorker#event:reservationFailedWorker#event:tokenExpiredWorker#event:tokenUpdated Classes Classes Activity Channel IncomingTransfer OutgoingTransfer Reservation Task TaskQueue Transfers Worker Events availabilityUpdated The availability of this Channel was updated Parameters: Name Type Description channel Channel The Channel whose availability was updated capacityUpdated The capacity of this Channel was updated Parameters: Name Type Description channel Channel The Channel whose capacity was updated attemptFailed The attempt to transfer the Task to the desired entity failed Parameters: Name Type Description outgoingTransfer OutgoingTransfer The OutgoingTransfer that had an attempt failure canceled The Task's current OutgoingTransfer has successfully been cancelled Parameters: Name Type Description outgoingTransfer OutgoingTransfer The OutgoingTransfer that was canceled completed The OutgoingTransfer has successfully been transferred to the desired entity Parameters: Name Type Description outgoingTransfer OutgoingTransfer The OutgoingTransfer that was completed failed All attempts to transfer the Task to the desired entity have failed. No more attempts on the OutgoingTransfer will be made. Parameters: Name Type Description outgoingTransfer OutgoingTransfer The OutgoingTransfer that has failed accepted Fired when a Reservation has been accepted for this Worker Parameters: Name Type Description reservation Reservation The accepted Reservation canceled Fired when a Reservation has been canceled for this Worker Parameters: Name Type Description reservation Reservation The canceled Reservation completed Fired when an accepted Reservation has been completed for this Worker Parameters: Name Type Description reservation Reservation The completed Reservation rejected Fired when a Reservation has been rejected for this Worker Parameters: Name Type Description reservation Reservation The rejected Reservation rescinded Fired when a Reservation has been rescinded for the Worker Parameters: Name Type Description reservation Reservation The rescinded Reservation timeout Fired when a Reservation has been timed out for this Worker Parameters: Name Type Description reservation Reservation The timed out Reservation wrapup Fired when a Reservation has been wrapped up for the Worker Parameters: Name Type Description reservation Reservation The wrapped up Reservation canceled The Task was canceled Parameters: Name Type Description task Task The Task who was canceled completed The Task was completed Parameters: Name Type Description task Task The Task who was completed transferInitiated An OutgoingTransfer has been initiated for Task Parameters: Name Type Description outgoingTransfer OutgoingTransfer The currently in process OutgoingTransfer updated The attributes of this Task was updated Parameters: Name Type Description task Task The Task whose attributes were updated wrapup The Task was wrapped up Parameters: Name Type Description task Task The Task who was wrapped up activityUpdated Worker activity has updated Parameters: Name Type Description worker Worker The updated Worker attributesUpdated Worker attributes have updated Parameters: Name Type Description worker Worker The updated Worker disconnected The signaling layer has lost the websocket connection error An error has occurred Parameters: Name Type Description error Error The Error that occurred ready Worker is ready to listen for events and take action reservationCreated A Reservation has been created for the Worker Parameters: Name Type Description reservation Reservation The created Reservation reservationFailed Worker was unable to receive a Reservation for the Task it created Parameters: Name Type Description task Object The raw Task-like payload that failed to generate a Reservation tokenExpired The Worker token has expired tokenUpdated The Worker token has successfully updated × Search results Close Documentation generated by JSDoc 3.5.5 on 2020-07-16T16:29:06+00:00 using the DocStrap template. "},"index.html":{"id":"index.html","title":"Index","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorker Events Channel#event:availabilityUpdatedChannel#event:capacityUpdatedOutgoingTransfer#event:attemptFailedOutgoingTransfer#event:canceledOutgoingTransfer#event:completedOutgoingTransfer#event:failedReservation#event:acceptedReservation#event:canceledReservation#event:completedReservation#event:rejectedReservation#event:rescindedReservation#event:timeoutReservation#event:wrapupTask#event:canceledTask#event:completedTask#event:transferInitiatedTask#event:updatedTask#event:wrapupWorker#event:activityUpdatedWorker#event:attributesUpdatedWorker#event:disconnectedWorker#event:errorWorker#event:readyWorker#event:reservationCreatedWorker#event:reservationFailedWorker#event:tokenExpiredWorker#event:tokenUpdated twilio-taskrouter.jsTaskRouter is Twilio's skills based routing system. With this library, you can manage your Workers in the browser or view the state of your Workspace. NOTE: This SDK is in a Developer Preview Release. This version of TaskRouter is intended for Twilio Flex. If you are using it outside of Twilio Flex, you may encounter bugs and instability, and the underlying APIs available in this release may change in subsequent releases. We want your feedback! Email Tyler Cole at tcole@twilio.com with suggested improvements, feature requests and general feedback. If you need technical support, contact help@twilio.com. InstallationNPMnpm install twilio-taskrouterUsageThe following is a simple example showing a Worker waiting for Reservations. For more information, refer to the API Docs. const TaskRouter = require('twilio-taskrouter'); const Twilio = require('twilio'); const AccessToken = Twilio.jwt.AccessToken; const TaskRouterGrant = AccessToken.TaskRouterGrant; const accountSid = ''; const signingKeySid = ''; const signingKeySecret = ''; const workspaceSid = ''; const workerSid = ''; const token = createAccessToken(accountSid, signingKeySid, signingKeySecret, workspaceSid, workerSid); const alice = new TaskRouter.Worker(token); alice.on('ready', readyAlice => { console.log(`Worker ${readyAlice.sid} is now ready for work`); }); alice.on('reservationCreated', reservation => { console.log(`Reservation ${reservation.sid} has been created for ${alice.sid}`); console.log(`Task attributes are: ${reservation.task.attributes}`); reservation.on('accepted', acceptedReservation => { console.log(`Reservation ${acceptedReservation.sid} was accepted.`); }); reservation.accept().then(acceptedReservation => { console.log(`Reservation status is ${acceptedReservation.status}`); }).catch((err) => { console.log(`Error: ${err}`); }); }); function createAccessToken(accountSid, signingKeySid, signingKeySecret, workspaceSid, workerSid) { const taskRouterGrant = new TaskRouterGrant({ workerSid: workerSid, workspaceSid: workspaceSid, role: 'worker' }); const accessToken = new AccessToken(accountSid, signingKeySid, signingKeySecret); accessToken.addGrant(taskRouterGrant); accessToken.identity = 'alice'; return accessToken.toJwt(); } ChangelogSee CHANGELOG.md. LicenseSee LICENSE.md. BuildingFork and clone the repository. Then, install dependencies with yarn installThen run the build script: yarn buildThe builds and docs will be placed in the dist/ directory. Before commits, be sure to validate by running: make lintContributingBug fixes welcome! If you're not familiar with the GitHub pull request/contribution process, this is a nice tutorial. × Search results Close Documentation generated by JSDoc 3.5.5 on 2020-07-16T16:29:06+00:00 using the DocStrap template. "},"Activity.html":{"id":"Activity.html","title":"Class: Activity","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorker Events Channel#event:availabilityUpdatedChannel#event:capacityUpdatedOutgoingTransfer#event:attemptFailedOutgoingTransfer#event:canceledOutgoingTransfer#event:completedOutgoingTransfer#event:failedReservation#event:acceptedReservation#event:canceledReservation#event:completedReservation#event:rejectedReservation#event:rescindedReservation#event:timeoutReservation#event:wrapupTask#event:canceledTask#event:completedTask#event:transferInitiatedTask#event:updatedTask#event:wrapupWorker#event:activityUpdatedWorker#event:attributesUpdatedWorker#event:disconnectedWorker#event:errorWorker#event:readyWorker#event:reservationCreatedWorker#event:reservationFailedWorker#event:tokenExpiredWorker#event:tokenUpdated Class: Activity Activity An Activity represents a state that a Worker can be in (e.g. Idle, Offline, Busy, ...) new Activity(worker, descriptor) Parameters: Name Type Description worker Worker The Worker descriptor ActivityDescriptor The ActivityDescriptor of this Activity Properties: Name Type Description accountSid string The sid of the Twilio account available boolean If the Worker can handle Tasks in this state dateCreated Date The date this Activity was created dateUpdated Date The date this Activity was last updated isCurrent boolean If this particular Activity represents the current state of the Worker name string The friendly name of this Activity sid string The sid of this Activity workspaceSid string The sid of the Workspace owning this Activity Methods setAsCurrent( [options]) Make this Activity the current state of the Worker Parameters: Name Type Argument Description options Activity.UpdateOptions <optional> Returns: Rejected if the Worker's activity state could not be set Type Promise.<this> Type Definitions UpdateOptions Type: Object Properties: Name Type Argument Default Description rejectPendingReservations boolean <optional> false Represents whether all pending reservations should be rejected with the update to an unavailable Activity. × Search results Close Documentation generated by JSDoc 3.5.5 on 2020-07-16T16:29:06+00:00 using the DocStrap template. "},"Channel.html":{"id":"Channel.html","title":"Class: Channel","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorker Events Channel#event:availabilityUpdatedChannel#event:capacityUpdatedOutgoingTransfer#event:attemptFailedOutgoingTransfer#event:canceledOutgoingTransfer#event:completedOutgoingTransfer#event:failedReservation#event:acceptedReservation#event:canceledReservation#event:completedReservation#event:rejectedReservation#event:rescindedReservation#event:timeoutReservation#event:wrapupTask#event:canceledTask#event:completedTask#event:transferInitiatedTask#event:updatedTask#event:wrapupWorker#event:activityUpdatedWorker#event:attributesUpdatedWorker#event:disconnectedWorker#event:errorWorker#event:readyWorker#event:reservationCreatedWorker#event:reservationFailedWorker#event:tokenExpiredWorker#event:tokenUpdated Class: Channel Channel A Channel distinguishes Tasks into specific types (e.g. Default, Chat, SMS, Video, Voice) new Channel(worker, request, descriptor) Parameters: Name Type Description worker Worker The Worker request Request The Request descriptor WorkerChannelDescriptor The data descriptor which describes this Channel Properties: Name Type Description accountSid string The sid of the Twilio account assignedTasks int The number of Tasks assigned to this Channel available boolean If the Worker should be assigned Tasks of this Channel type availableCapacityPercentage int The current available capacity of this Worker to handle Tasks of this Channel type capacity int The number of Tasks that a Worker can handle of this Channel type lastReservedTime Date The date when the Channel last saw a Task dateCreated Date The date this Channel was created dateUpdated Date The date this Channel was last updated sid string The sid of this Activity taskChannelSid string The sid of the TaskChannel associated to this Worker Channel taskChannelUniqueName string The friendly name of this Channel workerSid string The sid of the Worker owning this Channel workspaceSid string The sid of the Workspace owning this Activity Fires: Channel#event:capacityUpdated Channel#event:availabilityUpdated Events availabilityUpdated The availability of this Channel was updated Parameters: Name Type Description channel Channel The Channel whose availability was updated capacityUpdated The capacity of this Channel was updated Parameters: Name Type Description channel Channel The Channel whose capacity was updated × Search results Close Documentation generated by JSDoc 3.5.5 on 2020-07-16T16:29:06+00:00 using the DocStrap template. "},"IncomingTransfer.html":{"id":"IncomingTransfer.html","title":"Class: IncomingTransfer","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorker Events Channel#event:availabilityUpdatedChannel#event:capacityUpdatedOutgoingTransfer#event:attemptFailedOutgoingTransfer#event:canceledOutgoingTransfer#event:completedOutgoingTransfer#event:failedReservation#event:acceptedReservation#event:canceledReservation#event:completedReservation#event:rejectedReservation#event:rescindedReservation#event:timeoutReservation#event:wrapupTask#event:canceledTask#event:completedTask#event:transferInitiatedTask#event:updatedTask#event:wrapupWorker#event:activityUpdatedWorker#event:attributesUpdatedWorker#event:disconnectedWorker#event:errorWorker#event:readyWorker#event:reservationCreatedWorker#event:reservationFailedWorker#event:tokenExpiredWorker#event:tokenUpdated Class: IncomingTransfer IncomingTransfer An IncomingTransfer represents the transfer of work for the Worker via another Worker or queue new IncomingTransfer(worker, transferDescriptor) Parameters: Name Type Description worker Worker The Worker transferDescriptor TransferDescriptor The transfer descriptor which describes this IncomingTransfer Properties: Name Type Description dateCreated Date The timestamp when this IncomingTransfer was created dateUpdated Date The timestamp when this IncomingTransfer was last updated mode string Transfer mode ['WARM', 'COLD'] reservationSid string The sid of the initiating Reservation. sid string The sid of this IncomingTransfer status string ['INITIATED', 'FAILED', 'COMPLETE', 'CANCELED'] to string The sid of the Worker or TaskQueue this IncomingTransfer is intended for type string The transfer type ['QUEUE', 'WORKER'] workerSid string The sid of the initiating Worker × Search results Close Documentation generated by JSDoc 3.5.5 on 2020-07-16T16:29:06+00:00 using the DocStrap template. "},"OutgoingTransfer.html":{"id":"OutgoingTransfer.html","title":"Class: OutgoingTransfer","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorker Events Channel#event:availabilityUpdatedChannel#event:capacityUpdatedOutgoingTransfer#event:attemptFailedOutgoingTransfer#event:canceledOutgoingTransfer#event:completedOutgoingTransfer#event:failedReservation#event:acceptedReservation#event:canceledReservation#event:completedReservation#event:rejectedReservation#event:rescindedReservation#event:timeoutReservation#event:wrapupTask#event:canceledTask#event:completedTask#event:transferInitiatedTask#event:updatedTask#event:wrapupWorker#event:activityUpdatedWorker#event:attributesUpdatedWorker#event:disconnectedWorker#event:errorWorker#event:readyWorker#event:reservationCreatedWorker#event:reservationFailedWorker#event:tokenExpiredWorker#event:tokenUpdated Class: OutgoingTransfer OutgoingTransfer An OutgoingTransfer represents the currently active outgoing transfer initiated by the Worker to another Worker or queue new OutgoingTransfer(worker, request, taskSid, transferDescriptor) Parameters: Name Type Description worker Worker The Worker request Request The Request taskSid string The sid of the owning Task transferDescriptor TransferDescriptor The transfer descriptor which describes this OutgoingTransfer Properties: Name Type Description dateCreated Date The timestamp when this OutgoingTransfer was created dateUpdated Date The timestamp when this OutgoingTransfer was last updated mode string Transfer mode ['WARM', 'COLD'] reservationSid string The sid of the initiating Reservation. sid string The sid of this OutgoingTransfer status string ['INITIATED', 'FAILED', 'COMPLETED', 'CANCELED'] to string The sid of the Worker or TaskQueue this OutgoingTransfer is intended for transferFailedReason string The reason, if applicable, for why the transfer failed type string The transfer type ['QUEUE', 'WORKER'] workerSid string The sid of the initiating Worker Methods <async> cancel() Cancel the ongoing OutgoingTransfer Returns: Rejected if the OutgoingTransfer state could not be updated to 'canceled' Type Promise.<this> Events attemptFailed The attempt to transfer the Task to the desired entity failed Parameters: Name Type Description outgoingTransfer OutgoingTransfer The OutgoingTransfer that had an attempt failure canceled The Task's current OutgoingTransfer has successfully been cancelled Parameters: Name Type Description outgoingTransfer OutgoingTransfer The OutgoingTransfer that was canceled completed The OutgoingTransfer has successfully been transferred to the desired entity Parameters: Name Type Description outgoingTransfer OutgoingTransfer The OutgoingTransfer that was completed failed All attempts to transfer the Task to the desired entity have failed. No more attempts on the OutgoingTransfer will be made. Parameters: Name Type Description outgoingTransfer OutgoingTransfer The OutgoingTransfer that has failed × Search results Close Documentation generated by JSDoc 3.5.5 on 2020-07-16T16:29:06+00:00 using the DocStrap template. "},"Reservation.html":{"id":"Reservation.html","title":"Class: Reservation","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorker Events Channel#event:availabilityUpdatedChannel#event:capacityUpdatedOutgoingTransfer#event:attemptFailedOutgoingTransfer#event:canceledOutgoingTransfer#event:completedOutgoingTransfer#event:failedReservation#event:acceptedReservation#event:canceledReservation#event:completedReservation#event:rejectedReservation#event:rescindedReservation#event:timeoutReservation#event:wrapupTask#event:canceledTask#event:completedTask#event:transferInitiatedTask#event:updatedTask#event:wrapupWorker#event:activityUpdatedWorker#event:attributesUpdatedWorker#event:disconnectedWorker#event:errorWorker#event:readyWorker#event:reservationCreatedWorker#event:reservationFailedWorker#event:tokenExpiredWorker#event:tokenUpdated Class: Reservation Reservation A Reservation correlates a Task and a Worker new Reservation(worker, request, descriptor) Construct a Reservation. Parameters: Name Type Description worker Worker The Worker request Request The Request descriptor ReservationDescriptor The data descriptor which describes this Reservation Properties: Name Type Description accountSid string The sid of the Twilio account dateCreated Date The date the Reservation was created dateUpdated Date The date the Reservation was last updated canceledReasonCode int The reason code received when Reservation is canceled sid string The sid of the Reservation status string The current state of the Reservation. Options: ['pending', 'accepted', 'rejected', 'timeout', 'canceled', 'rescinded', 'wrapping', 'completed']. task Task The Task tied to the Reservation timeout int The number of seconds until the Task times out workerSid string The sid of the Worker workspaceSid string The sid of the Workspace owning this Reservation Fires: Reservation#event:accepted Reservation#event:canceled Reservation#event:completed Reservation#event:rejected Reservation#event:rescinded Reservation#event:timeout Reservation#event:wrapup Methods accept() Accept the Reservation Returns: Rejected if unable to issue Accept instruction on the Reservation Type Promise.<this> call(from, url [, options]) Issue a Call to a Worker Parameters: Name Type Argument Description from string The caller id for the call to a Worker url string A valid TwiML URI that is executed on the answering Worker's leg options Reservation.CallOptions <optional> Returns: Rejected if unable to issue Call instruction on the Reservation Type Promise.<this> complete() Complete the Reservation Returns: Rejected if unable to issue Complete instruction on the Reservation Type Promise.<this> conference( [options]) Conference the active Call tied to this Reservation to the Worker Parameters: Name Type Argument Description options Reservation.ConferenceOptions <optional> Returns: Rejected if unable to issue Conference instruction on the link Reservation Type Promise.<this> dequeue( [options]) Dequeue the Reservation to the Worker. This will perform telephony to dequeue a Task that was enqueued using the Enqueue TwiML verb. A contact_uri must exist in the Worker's attributes for this call to go through. Parameters: Name Type Argument Description options Reservation.DequeueOptions <optional> Returns: Rejected if unable to issue Dequeue instruction on the Reservation Type Promise.<this> redirect(callSid, url [, options]) Redirect the active Call tied to this Reservation Parameters: Name Type Argument Description callSid string The sid of the Call to redirect url string A valid TwiML URI that is executed on the Caller's leg upon redirecting options Reservation.RedirectOptions <optional> Returns: Rejected if unable to issue Redirect instruction on the Reservation Type Promise.<this> reject( [options]) Reject the Reservation Parameters: Name Type Argument Description options Reservation.RejectOptions <optional> Returns: Rejected if unable to issue Reject instruction on the Reservation Type Promise.<this> updateParticipant( [options]) Update the Worker's leg in the Conference associated to this Reservation Parameters: Name Type Argument Description options Reservation.ParticipantOptions <optional> Returns: Rejected if unable to update the Worker's leg in the Conference tied to the Reservation Type Promise.<this> wrap() Wrap the Reservation Returns: Rejected if unable to issue Wrap instruction on the Reservation Type Promise.<this> Type Definitions CallOptions Type: Object Properties: Name Type Argument Default Description accept boolean <optional> false Represents whether the Task should be accepted before initiating the call record string <optional> 'do-not-record' To record the call or not statusCallbackUrl string <optional> null A valid status status callback url to string <optional> null The number or endpoint that should be called. If not provided, the contact_uri defined in the Worker attributes will be used timeout number <optional> 60 The integer number of seconds Twilio should allow the phone associated to "contact_uri" to ring ConferenceOptions Type: Object Properties: Name Type Argument Default Description to string <optional> null The contact uri of the Worker; can be a phone number or a client ID. Required, if no contact_uri on the Worker's attributes. from string <optional> null The caller id for the call to the Worker. Must be a verified Twilio number. timeout int <optional> 60 The integer number of seconds that Twilio should allow the call to ring before assuming there is no answer. statusCallback string <optional> null The URL endpoint to receive call status events of the Worker leg. statusCallbackMethod string <optional> 'POST' The HTTP method for the Status Callback URL. statusCallbackEvent string <optional> 'completed' A comma separated list of events to subscribe to. The possible list of events are: ['initiated', 'ringing', 'answered', 'completed']. record string <optional> 'do-not-record' Whether to record the Worker leg of the Conference. muted boolean <optional> false Whether the Worker leg of the Conference is muted. beep string | boolean <optional> true Whether the Worker leg should be when entering the Conference. The options for beep are: [true, false, 'onEnter', 'onExit']. startConferenceOnEnter boolean <optional> true Whether the Conference should start when the Worker leg enters. endConferenceOnExit boolean <optional> false Whether the Conference should end when the Worker leg exits. endConferenceOnCustomerExit boolean <optional> false Whether the Conference should end when the customer leg exits. beepOnCustomerEntrance boolean <optional> true Whether the Conference should beep when the customer leg enters. waitUrl string <optional> default Twilio hold music The URL endpoint to play when waiting for the Conference to begin. waitMethod string <optional> 'POST' The HTTP method for the Wait URL. earlyMedia boolean <optional> true Whether Twilio should feed early media to be played directly into a Conference. maxParticipants int <optional> 10 The number of max participants allowed in a Conference. conferenceStatusCallback string <optional> null The URL endpoint to receive Conference status events. conferenceStatusCallbackMethod string <optional> 'POST' The HTTP method for the Conference Status Callback URL. conferenceStatusCallbackEvent string <optional> 'start,end' A comma separated list of Conference events to subscribe to. The possible list of events are: ['start', 'end', 'join', 'leave', 'mute', 'hold', 'speaker']. conferenceRecord string | boolean <optional> false Whether the entire Conference should be recorded. The possible options for conferenceRecord are: [true, false, 'record-from-start', 'do-not-record']. conferenceTrim string <optional> 'trim-silence' Whether to trim the Conference recording. The options for conferenceTrim are: ['trim-silence', 'do-not-trim']. recordingChannels string <optional> 'mono' Which channel of the Conference to record. The options are: ['mono', 'dual']. recordingStatusCallback string <optional> null The URL endpoint to receive recording status events. recordingStatusCallbackMethod string <optional> 'POST' The HTTP method for the Recording Status Callback URL. conferenceRecordingStatusCallback string <optional> null The URl endpoint to receive Conference events. conferenceRecordingStatusCallbackMethod string <optional> 'POST' The HTTP method of the Conference Recording Status Callback. region string <optional> null The specific region. The options for region are: ['us1', 'ie1', 'sg1', 'br1', 'au1', 'jp1']. sipAuthUsername string <optional> null The SIP auth username to use. sipAuthPassword string <optional> null The SIP auth password to use. DequeueOptions Type: Object Properties: Name Type Argument Default Description from string <optional> null The caller id for the call to the Worker. Must be a verified Twilio number. to string <optional> null The contact uri of the Worker; can be a phone number or a client ID. Required, if no contact_uri on the Worker's attributes. postWorkActivitySid string <optional> null The activitySid to update the Worker to after dequeuing the Reservation. record string <optional> 'do-not-record' Defines which legs of the call should be recorded. timeout int <optional> 60 The integer number of seconds that Twilio should allow the call to ring before assuming there is no answer. statusCallbackUrl string <optional> null A URL that Twilio will send asynchronous webhook this._request. to on a completed call event. statusCallbackEvents string <optional> null A comma separated string of the events to subscribe to ParticipantOptions Type: Object Properties: Name Type Argument Default Description endConferenceOnExit boolean <optional> null Whether the Conference should end when this Worker participant leaves the Conference mute boolean <optional> null Mute or unmute this Worker participant beepOnExit boolean <optional> null Whether there should be a beep sound when this Worker participant leaves the Conference RedirectOptions Type: Object Properties: Name Type Argument Default Description accept boolean <optional> false Represents whether the Task should be accepted before initiating the call RejectOptions Type: Object Properties: Name Type Description activitySid string The sid of the Activity to update the worker to upon rejecting the Reservation Events accepted Fired when a Reservation has been accepted for this Worker Parameters: Name Type Description reservation Reservation The accepted Reservation canceled Fired when a Reservation has been canceled for this Worker Parameters: Name Type Description reservation Reservation The canceled Reservation completed Fired when an accepted Reservation has been completed for this Worker Parameters: Name Type Description reservation Reservation The completed Reservation rejected Fired when a Reservation has been rejected for this Worker Parameters: Name Type Description reservation Reservation The rejected Reservation rescinded Fired when a Reservation has been rescinded for the Worker Parameters: Name Type Description reservation Reservation The rescinded Reservation timeout Fired when a Reservation has been timed out for this Worker Parameters: Name Type Description reservation Reservation The timed out Reservation wrapup Fired when a Reservation has been wrapped up for the Worker Parameters: Name Type Description reservation Reservation The wrapped up Reservation × Search results Close Documentation generated by JSDoc 3.5.5 on 2020-07-16T16:29:06+00:00 using the DocStrap template. "},"Task.html":{"id":"Task.html","title":"Class: Task","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorker Events Channel#event:availabilityUpdatedChannel#event:capacityUpdatedOutgoingTransfer#event:attemptFailedOutgoingTransfer#event:canceledOutgoingTransfer#event:completedOutgoingTransfer#event:failedReservation#event:acceptedReservation#event:canceledReservation#event:completedReservation#event:rejectedReservation#event:rescindedReservation#event:timeoutReservation#event:wrapupTask#event:canceledTask#event:completedTask#event:transferInitiatedTask#event:updatedTask#event:wrapupWorker#event:activityUpdatedWorker#event:attributesUpdatedWorker#event:disconnectedWorker#event:errorWorker#event:readyWorker#event:reservationCreatedWorker#event:reservationFailedWorker#event:tokenExpiredWorker#event:tokenUpdated Class: Task Task A Task represents an item of work new Task(worker, request, reservationSid, descriptor) Parameters: Name Type Description worker Worker The Worker request Request The Request reservationSid string The SID of the Reservation associated with this Task descriptor TaskDescriptor The data descriptor which describes this Task Properties: Name Type Description addOns Object The addons attached to the Task age int The age of the Task in seconds attributes Object The attributes of the Task dateCreated Date The date the Task was created dateUpdated Date The date the Task was last updated priority int The priority of the Task queueName string The friendly name of the TaskQueue the Task is currently in queueSid string The sid of the TaskQueue the Task is currently in reason string The reason the Task was completed or canceled, if applicable routingTarget string The target Sid of the Worker, TaskQueue, or Workflow this Task will be routed to. sid string The sid of the Task status string The status of the Task. Options: ['reserved', 'assigned', 'canceled', 'wrapping', 'completed', 'transferring'] taskChannelSid string The sid of the Task Channel associated to the Task in MultiTask mode taskChannelUniqueName string The unique name of the Task Channel associated to the Task in MultiTask mode timeout int The number of seconds the Task is allowed to live transfers Transfers The IncomingTransfer and OutgoingTransfer related to this Task, if applicable workflowName string The name of the Workflow responsible for routing the Task workflowSid string The sid of the Workflow responsible for routing the Task Fires: Task#event:canceled Task#event:completed Task#event:transferAttemptFailed Task#event:transferCanceled Task#event:transferCompleted Task#event:transferFailed Task#event:transferInitiated Task#event:updated Task#event:wrapup Methods complete(reason) Update the Task status to 'completed' Parameters: Name Type Description reason string The reason for completing the Task Returns: Rejected if the Task state could not be updated to 'completed' Type Promise.<this> hold(targetWorkerSid, onHold [, options]) Hold the worker's call leg in the Conference associated to this Task and specified TargetWorkerSid Parameters: Name Type Argument Description targetWorkerSid String The target worker's sid which should be put onhold or unhold onHold boolean Whether to hold or unhold the specified worker's call leg in the Conference referenced by the Task options Task.HoldOptions <optional> kick(workerSid) Kick another active Worker participant from the ongoing conference Parameters: Name Type Description workerSid string The Sid of the Worker who is currently in the conference that should be kicked Returns: Rejected if unable to kick the call leg of the targeted Worker in the Conference tied to the Task Type Promise.<this> setAttributes(attributes) Update the Task attributes to the given attributes. Parameters: Name Type Description attributes Object A JSON to update the attributes. Returns: Rejected if the attributes cannot be set Type Promise.<this> transfer(to [, options]) Transfer the Task to another entity. Parameters: Name Type Argument Description to string The Worker or TaskQueue entity sid to transfer the task to. options Task.TransferOptions <optional> Returns: Type Promise.<this> updateParticipant( [options]) Update the Customer leg in the Conference associated to this Task Parameters: Name Type Argument Description options Task.ParticipantOptions <optional> Returns: Rejected if unable to update the Customers's leg in the Conference tied to the Task Type Promise.<this> wrapUp() Update the Task status to 'wrapping' in a multi-task enabled Workspace Returns: Rejected if the Task state could not be updated to 'wrapping' Type Promise.<this> Type Definitions HoldOptions Type: Object Properties: Name Type Argument Default Description holdUrl string <optional> default Twilio hold music The URL endpoint to play when participant is on hold. holdMethod string <optional> 'GET' The HTTP method for the hold URL. ParticipantOptions Type: Object Properties: Name Type Argument Default Description hold boolean <optional> null Whether to hold the customer leg of the Conference referenced by the Task holdUrl string <optional> default Twilio hold music The URL endpoint to play when participant is on hold. holdMethod string <optional> 'GET' The HTTP method for the hold URL. TransferOptions Type: Object Properties: Name Type Argument Default Description attributes string <optional> Updated attributes for the task mode string <optional> 'WARM' 'WARM' or 'COLD' priority string <optional> Updated priority for the task WrappingOptions Type: Object Properties: Name Type Argument Default Description reason string <optional> null The reason for wrapping up the Task Events canceled The Task was canceled Parameters: Name Type Description task Task The Task who was canceled completed The Task was completed Parameters: Name Type Description task Task The Task who was completed transferInitiated An OutgoingTransfer has been initiated for Task Parameters: Name Type Description outgoingTransfer OutgoingTransfer The currently in process OutgoingTransfer updated The attributes of this Task was updated Parameters: Name Type Description task Task The Task whose attributes were updated wrapup The Task was wrapped up Parameters: Name Type Description task Task The Task who was wrapped up × Search results Close Documentation generated by JSDoc 3.5.5 on 2020-07-16T16:29:06+00:00 using the DocStrap template. "},"TaskQueue.html":{"id":"TaskQueue.html","title":"Class: TaskQueue","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorker Events Channel#event:availabilityUpdatedChannel#event:capacityUpdatedOutgoingTransfer#event:attemptFailedOutgoingTransfer#event:canceledOutgoingTransfer#event:completedOutgoingTransfer#event:failedReservation#event:acceptedReservation#event:canceledReservation#event:completedReservation#event:rejectedReservation#event:rescindedReservation#event:timeoutReservation#event:wrapupTask#event:canceledTask#event:completedTask#event:transferInitiatedTask#event:updatedTask#event:wrapupWorker#event:activityUpdatedWorker#event:attributesUpdatedWorker#event:disconnectedWorker#event:errorWorker#event:readyWorker#event:reservationCreatedWorker#event:reservationFailedWorker#event:tokenExpiredWorker#event:tokenUpdated Class: TaskQueue TaskQueue A TaskQueue represents a set of Tasks awaiting assignment. new TaskQueue(descriptor) Parameters: Name Type Description descriptor TaskQueueDescriptor The TaskQueueDescriptor of this TaskQueue Properties: Name Type Description sid string The Sid of the TaskQueue accountSid string The Sid of the owning Account of the TaskQueue} workspaceSid string The Sid of the Workspace the TaskQueue belongs to name string The friendly name of the TaskQueue assignmentActivityName string The Activity name for the reservation of the TaskQueue reservationActivityName string The Activity name for the assignment of the TaskQueue assignmentActivitySid string The Sid of the assignment Activity for the TaskQueue reservationActivitySid string The Sid of the reservation Activity for the TaskQueue targetWorkers string The expression used to target workers maxReservedWorkers int The maximum number of reserved workers for the TaskQueue taskOrder string The task order for the TaskQueue FIFO or LIFO dateCreated Date The date when the TaskQueue was created dateUpdated Date The date when the TaskQueue was last updated × Search results Close Documentation generated by JSDoc 3.5.5 on 2020-07-16T16:29:06+00:00 using the DocStrap template. "},"Transfers.html":{"id":"Transfers.html","title":"Class: Transfers","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorker Events Channel#event:availabilityUpdatedChannel#event:capacityUpdatedOutgoingTransfer#event:attemptFailedOutgoingTransfer#event:canceledOutgoingTransfer#event:completedOutgoingTransfer#event:failedReservation#event:acceptedReservation#event:canceledReservation#event:completedReservation#event:rejectedReservation#event:rescindedReservation#event:timeoutReservation#event:wrapupTask#event:canceledTask#event:completedTask#event:transferInitiatedTask#event:updatedTask#event:wrapupWorker#event:activityUpdatedWorker#event:attributesUpdatedWorker#event:disconnectedWorker#event:errorWorker#event:readyWorker#event:reservationCreatedWorker#event:reservationFailedWorker#event:tokenExpiredWorker#event:tokenUpdated Class: Transfers Transfers Transfers contains both the IncomingTransfer and OutgoingTransfer for the Worker new Transfers(worker, request, taskDescriptor) Parameters: Name Type Description worker Worker The Worker request Request The Request taskDescriptor TaskDescriptor The task descriptor which describes the related Task Properties: Name Type Description incoming IncomingTransfer The IncomingTransfer for the Worker if the related Reservation was initiated via transfer by another agent outgoing OutgoingTransfer The current active (initiated but not yet finished) OutgoingTransfer initiated by the Worker to another agent or queue × Search results Close Documentation generated by JSDoc 3.5.5 on 2020-07-16T16:29:06+00:00 using the DocStrap template. "},"Worker.html":{"id":"Worker.html","title":"Class: Worker","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorker Events Channel#event:availabilityUpdatedChannel#event:capacityUpdatedOutgoingTransfer#event:attemptFailedOutgoingTransfer#event:canceledOutgoingTransfer#event:completedOutgoingTransfer#event:failedReservation#event:acceptedReservation#event:canceledReservation#event:completedReservation#event:rejectedReservation#event:rescindedReservation#event:timeoutReservation#event:wrapupTask#event:canceledTask#event:completedTask#event:transferInitiatedTask#event:updatedTask#event:wrapupWorker#event:activityUpdatedWorker#event:attributesUpdatedWorker#event:disconnectedWorker#event:errorWorker#event:readyWorker#event:reservationCreatedWorker#event:reservationFailedWorker#event:tokenExpiredWorker#event:tokenUpdated Class: Worker Worker Create a Worker client representing a TaskRouter Worker new Worker(token [, options]) Parameters: Name Type Argument Description token string The string token options Worker.Options <optional> Properties: Name Type Description accountSid string The sid of the Twilio account activities Map.<string, Activity> The list of possible states a Worker can be activity Activity The current Activity of the Worker attributes Object A JSON representation of the Worker's attributes channels Map.<string, Channel> The list of available Channels connectActivitySid string The Activity to set the Worker as on connect dateCreated Date The date this Worker was created dateStatusChanged Date The date this Worker's activity was last changed dateUpdated Date The date this Worker was last updated name string The friendly name of the Worker reservations Map.<string, Reservation> A list of pending Reservations for the Worker sid string The sid of the Worker workspaceSid string The sid of the Workspace owning this Worker Fires: Worker#event:activityUpdated Worker#event:attributesUpdated Worker#event:disconnected Worker#event:error Worker#event:ready Worker#event:reservationCreated Worker#event:tokenExpired Worker#event:tokenUpdated Methods createTask(to, from, workflowSid, taskQueueSid [, options]) Create a Task Parameters: Name Type Argument Description to string The contact uri of the customer. Stored in the Task's attributes as "outbound_to" from string The contact uri of the Worker. Stored in the Task's attributes as "from" workflowSid string The Sid of the Workflow this Task should belong to taskQueueSid string The Sid of the TaskQueue this Task should belong to, used for reporting purposes only options Worker.TaskOptions <optional> Returns: Rejected if unable to create a Task on behalf of the Worker. Returns the TaskSid of the created Task. Type Promise.<String> disconnect() Gracefully disconnect the client. Returns: Type void setAttributes(attributes) Update attributes Parameters: Name Type Description attributes Object A JSON describing the Worker's attributes Returns: Rejected if the attributes cannot be set Type Promise.<this> updateToken(newToken) Update token Parameters: Name Type Description newToken string The new token that should be used for authentication Returns: Emits error if unable to update token Type void Type Definitions Options Type: Object Properties: Name Type Argument Default Description connectActivitySid string <optional> '' The Activity state of the Worker upon connect closeExistingSessions boolean <optional> false Whether other open sessions of this Worker should be terminated logLevel string <optional> 'error' The level of logging to enable ['error', 'warn', 'info', 'debug', 'trace', 'silent'] region string <optional> the ingress region for connections (ex. "ie1-ix") TaskOptions Type: Object Properties: Name Type Argument Default Description attributes object <optional> null Additional attributes for the Task taskChannelUniqueName string <optional> null The friendly name of the Channel this Task belongs to. If not provided, defaults to 'default' channel. taskChannelSid string <optional> null The Sid of the Channel this Task belongs to. If not provided, defaults to 'default' channel. Events activityUpdated Worker activity has updated Parameters: Name Type Description worker Worker The updated Worker attributesUpdated Worker attributes have updated Parameters: Name Type Description worker Worker The updated Worker disconnected The signaling layer has lost the websocket connection error An error has occurred Parameters: Name Type Description error Error The Error that occurred ready Worker is ready to listen for events and take action reservationCreated A Reservation has been created for the Worker Parameters: Name Type Description reservation Reservation The created Reservation reservationFailed Worker was unable to receive a Reservation for the Task it created Parameters: Name Type Description task Object The raw Task-like payload that failed to generate a Reservation tokenExpired The Worker token has expired tokenUpdated The Worker token has successfully updated × Search results Close Documentation generated by JSDoc 3.5.5 on 2020-07-16T16:29:06+00:00 using the DocStrap template. "}}
|
|
9
|
+
{"classes.list.html":{"id":"classes.list.html","title":"Classes","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorker Events Channel#event:availabilityUpdatedChannel#event:capacityUpdatedOutgoingTransfer#event:attemptFailedOutgoingTransfer#event:canceledOutgoingTransfer#event:completedOutgoingTransfer#event:failedReservation#event:acceptedReservation#event:canceledReservation#event:completedReservation#event:rejectedReservation#event:rescindedReservation#event:timeoutReservation#event:wrapupTask#event:canceledTask#event:completedTask#event:transferInitiatedTask#event:updatedTask#event:wrapupWorker#event:activityUpdatedWorker#event:attributesUpdatedWorker#event:disconnectedWorker#event:errorWorker#event:readyWorker#event:reservationCreatedWorker#event:reservationFailedWorker#event:tokenExpiredWorker#event:tokenUpdated Classes Classes Activity Channel IncomingTransfer OutgoingTransfer Reservation Task TaskQueue Transfers Worker Events availabilityUpdated The availability of this Channel was updated Parameters: Name Type Description channel Channel The Channel whose availability was updated capacityUpdated The capacity of this Channel was updated Parameters: Name Type Description channel Channel The Channel whose capacity was updated attemptFailed The attempt to transfer the Task to the desired entity failed Parameters: Name Type Description outgoingTransfer OutgoingTransfer The OutgoingTransfer that had an attempt failure canceled The Task's current OutgoingTransfer has successfully been cancelled Parameters: Name Type Description outgoingTransfer OutgoingTransfer The OutgoingTransfer that was canceled completed The OutgoingTransfer has successfully been transferred to the desired entity Parameters: Name Type Description outgoingTransfer OutgoingTransfer The OutgoingTransfer that was completed failed All attempts to transfer the Task to the desired entity have failed. No more attempts on the OutgoingTransfer will be made. Parameters: Name Type Description outgoingTransfer OutgoingTransfer The OutgoingTransfer that has failed accepted Fired when a Reservation has been accepted for this Worker Parameters: Name Type Description reservation Reservation The accepted Reservation canceled Fired when a Reservation has been canceled for this Worker Parameters: Name Type Description reservation Reservation The canceled Reservation completed Fired when an accepted Reservation has been completed for this Worker Parameters: Name Type Description reservation Reservation The completed Reservation rejected Fired when a Reservation has been rejected for this Worker Parameters: Name Type Description reservation Reservation The rejected Reservation rescinded Fired when a Reservation has been rescinded for the Worker Parameters: Name Type Description reservation Reservation The rescinded Reservation timeout Fired when a Reservation has been timed out for this Worker Parameters: Name Type Description reservation Reservation The timed out Reservation wrapup Fired when a Reservation has been wrapped up for the Worker Parameters: Name Type Description reservation Reservation The wrapped up Reservation canceled The Task was canceled Parameters: Name Type Description task Task The Task who was canceled completed The Task was completed Parameters: Name Type Description task Task The Task who was completed transferInitiated An OutgoingTransfer has been initiated for Task Parameters: Name Type Description outgoingTransfer OutgoingTransfer The currently in process OutgoingTransfer updated The attributes of this Task was updated Parameters: Name Type Description task Task The Task whose attributes were updated wrapup The Task was wrapped up Parameters: Name Type Description task Task The Task who was wrapped up activityUpdated Worker activity has updated Parameters: Name Type Description worker Worker The updated Worker attributesUpdated Worker attributes have updated Parameters: Name Type Description worker Worker The updated Worker disconnected The signaling layer has lost the websocket connection Parameters: Name Type Description reason Object The reason the Worker websocket disconnected error An error has occurred Parameters: Name Type Description error Error The Error that occurred ready Worker is ready to listen for events and take action reservationCreated A Reservation has been created for the Worker Parameters: Name Type Description reservation Reservation The created Reservation reservationFailed Worker was unable to receive a Reservation for the Task it created Parameters: Name Type Description task Object The raw Task-like payload that failed to generate a Reservation tokenExpired The Worker token has expired tokenUpdated The Worker token has successfully updated × Search results Close Documentation generated by JSDoc 3.5.5 on 2021-11-25T08:41:13+00:00 using the DocStrap template. "},"index.html":{"id":"index.html","title":"Index","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorker Events Channel#event:availabilityUpdatedChannel#event:capacityUpdatedOutgoingTransfer#event:attemptFailedOutgoingTransfer#event:canceledOutgoingTransfer#event:completedOutgoingTransfer#event:failedReservation#event:acceptedReservation#event:canceledReservation#event:completedReservation#event:rejectedReservation#event:rescindedReservation#event:timeoutReservation#event:wrapupTask#event:canceledTask#event:completedTask#event:transferInitiatedTask#event:updatedTask#event:wrapupWorker#event:activityUpdatedWorker#event:attributesUpdatedWorker#event:disconnectedWorker#event:errorWorker#event:readyWorker#event:reservationCreatedWorker#event:reservationFailedWorker#event:tokenExpiredWorker#event:tokenUpdated twilio-taskrouter.jsTaskRouter is Twilio's skills based routing system. With this library, you can manage your Workers in the browser or view the state of your Workspace. NOTE: This SDK is in a Developer Preview Release. This version of TaskRouter is intended for Twilio Flex. If you are using it outside of Twilio Flex, you may encounter bugs and instability, and the underlying APIs available in this release may change in subsequent releases. InstallationNPMnpm install twilio-taskrouterUsageThe following is a simple example showing a Worker waiting for Reservations. For more information, refer to the API Docs. const TaskRouter = require('twilio-taskrouter'); const Twilio = require('twilio'); const AccessToken = Twilio.jwt.AccessToken; const TaskRouterGrant = AccessToken.TaskRouterGrant; const accountSid = ''; const signingKeySid = ''; const signingKeySecret = ''; const workspaceSid = ''; const workerSid = ''; const token = createAccessToken(accountSid, signingKeySid, signingKeySecret, workspaceSid, workerSid); const alice = new TaskRouter.Worker(token); alice.on('ready', readyAlice => { console.log(`Worker ${readyAlice.sid} is now ready for work`); }); alice.on('reservationCreated', reservation => { console.log(`Reservation ${reservation.sid} has been created for ${alice.sid}`); console.log(`Task attributes are: ${reservation.task.attributes}`); reservation.on('accepted', acceptedReservation => { console.log(`Reservation ${acceptedReservation.sid} was accepted.`); }); reservation.accept().then(acceptedReservation => { console.log(`Reservation status is ${acceptedReservation.status}`); }).catch((err) => { console.log(`Error: ${err}`); }); }); function createAccessToken(accountSid, signingKeySid, signingKeySecret, workspaceSid, workerSid) { const taskRouterGrant = new TaskRouterGrant({ workerSid: workerSid, workspaceSid: workspaceSid, role: 'worker' }); const accessToken = new AccessToken(accountSid, signingKeySid, signingKeySecret); accessToken.addGrant(taskRouterGrant); accessToken.identity = 'alice'; return accessToken.toJwt(); } ChangelogSee CHANGELOG.md. LicenseSee LICENSE.md. BuildingFork and clone the repository. Use npm to install node 8 (other versions may run into problems). Then, install dependencies with: yarn installThen run the build script: yarn buildThe builds and docs will be placed in the dist/ directory. Before commits, be sure to validate by running: make lintContributingBug fixes welcome! If you're not familiar with the GitHub pull request/contribution process, this is a nice tutorial. × Search results Close Documentation generated by JSDoc 3.5.5 on 2021-11-25T08:41:13+00:00 using the DocStrap template. "},"Activity.html":{"id":"Activity.html","title":"Class: Activity","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorker Events Channel#event:availabilityUpdatedChannel#event:capacityUpdatedOutgoingTransfer#event:attemptFailedOutgoingTransfer#event:canceledOutgoingTransfer#event:completedOutgoingTransfer#event:failedReservation#event:acceptedReservation#event:canceledReservation#event:completedReservation#event:rejectedReservation#event:rescindedReservation#event:timeoutReservation#event:wrapupTask#event:canceledTask#event:completedTask#event:transferInitiatedTask#event:updatedTask#event:wrapupWorker#event:activityUpdatedWorker#event:attributesUpdatedWorker#event:disconnectedWorker#event:errorWorker#event:readyWorker#event:reservationCreatedWorker#event:reservationFailedWorker#event:tokenExpiredWorker#event:tokenUpdated Class: Activity Activity An Activity represents a state that a Worker can be in (e.g. Idle, Offline, Busy, ...) new Activity(worker, descriptor) Parameters: Name Type Description worker Worker The Worker descriptor ActivityDescriptor The ActivityDescriptor of this Activity Properties: Name Type Description accountSid string The sid of the Twilio account available boolean If the Worker can handle Tasks in this state dateCreated Date The date this Activity was created dateUpdated Date The date this Activity was last updated isCurrent boolean If this particular Activity represents the current state of the Worker name string The friendly name of this Activity sid string The sid of this Activity workspaceSid string The sid of the Workspace owning this Activity Methods setAsCurrent( [options]) Make this Activity the current state of the Worker Parameters: Name Type Argument Description options Activity.UpdateOptions <optional> Returns: Rejected if the Worker's activity state could not be set Type Promise.<this> Type Definitions UpdateOptions Type: Object Properties: Name Type Argument Default Description rejectPendingReservations boolean <optional> false Represents whether all pending reservations should be rejected with the update to an unavailable Activity. × Search results Close Documentation generated by JSDoc 3.5.5 on 2021-11-25T08:41:13+00:00 using the DocStrap template. "},"Channel.html":{"id":"Channel.html","title":"Class: Channel","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorker Events Channel#event:availabilityUpdatedChannel#event:capacityUpdatedOutgoingTransfer#event:attemptFailedOutgoingTransfer#event:canceledOutgoingTransfer#event:completedOutgoingTransfer#event:failedReservation#event:acceptedReservation#event:canceledReservation#event:completedReservation#event:rejectedReservation#event:rescindedReservation#event:timeoutReservation#event:wrapupTask#event:canceledTask#event:completedTask#event:transferInitiatedTask#event:updatedTask#event:wrapupWorker#event:activityUpdatedWorker#event:attributesUpdatedWorker#event:disconnectedWorker#event:errorWorker#event:readyWorker#event:reservationCreatedWorker#event:reservationFailedWorker#event:tokenExpiredWorker#event:tokenUpdated Class: Channel Channel A Channel distinguishes Tasks into specific types (e.g. Default, Chat, SMS, Video, Voice) new Channel(worker, request, descriptor) Parameters: Name Type Description worker Worker The Worker request Request The Request descriptor WorkerChannelDescriptor The data descriptor which describes this Channel Properties: Name Type Description accountSid string The sid of the Twilio account assignedTasks int The number of Tasks assigned to this Channel available boolean If the Worker should be assigned Tasks of this Channel type availableCapacityPercentage int The current available capacity of this Worker to handle Tasks of this Channel type capacity int The number of Tasks that a Worker can handle of this Channel type lastReservedTime Date The date when the Channel last saw a Task dateCreated Date The date this Channel was created dateUpdated Date The date this Channel was last updated sid string The sid of this Activity taskChannelSid string The sid of the TaskChannel associated to this Worker Channel taskChannelUniqueName string The friendly name of this Channel workerSid string The sid of the Worker owning this Channel workspaceSid string The sid of the Workspace owning this Activity Fires: Channel#event:capacityUpdated Channel#event:availabilityUpdated Events availabilityUpdated The availability of this Channel was updated Parameters: Name Type Description channel Channel The Channel whose availability was updated capacityUpdated The capacity of this Channel was updated Parameters: Name Type Description channel Channel The Channel whose capacity was updated × Search results Close Documentation generated by JSDoc 3.5.5 on 2021-11-25T08:41:13+00:00 using the DocStrap template. "},"IncomingTransfer.html":{"id":"IncomingTransfer.html","title":"Class: IncomingTransfer","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorker Events Channel#event:availabilityUpdatedChannel#event:capacityUpdatedOutgoingTransfer#event:attemptFailedOutgoingTransfer#event:canceledOutgoingTransfer#event:completedOutgoingTransfer#event:failedReservation#event:acceptedReservation#event:canceledReservation#event:completedReservation#event:rejectedReservation#event:rescindedReservation#event:timeoutReservation#event:wrapupTask#event:canceledTask#event:completedTask#event:transferInitiatedTask#event:updatedTask#event:wrapupWorker#event:activityUpdatedWorker#event:attributesUpdatedWorker#event:disconnectedWorker#event:errorWorker#event:readyWorker#event:reservationCreatedWorker#event:reservationFailedWorker#event:tokenExpiredWorker#event:tokenUpdated Class: IncomingTransfer IncomingTransfer An IncomingTransfer represents the transfer of work for the Worker via another Worker or queue new IncomingTransfer(worker, transferDescriptor) Parameters: Name Type Description worker Worker The Worker transferDescriptor TransferDescriptor The transfer descriptor which describes this IncomingTransfer Properties: Name Type Description dateCreated Date The timestamp when this IncomingTransfer was created dateUpdated Date The timestamp when this IncomingTransfer was last updated mode string Transfer mode ['WARM', 'COLD'] reservationSid string The sid of the initiating Reservation. sid string The sid of this IncomingTransfer status string ['INITIATED', 'FAILED', 'COMPLETE', 'CANCELED'] to string The sid of the Worker or TaskQueue this IncomingTransfer is intended for type string The transfer type ['QUEUE', 'WORKER'] workerSid string The sid of the initiating Worker × Search results Close Documentation generated by JSDoc 3.5.5 on 2021-11-25T08:41:13+00:00 using the DocStrap template. "},"OutgoingTransfer.html":{"id":"OutgoingTransfer.html","title":"Class: OutgoingTransfer","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorker Events Channel#event:availabilityUpdatedChannel#event:capacityUpdatedOutgoingTransfer#event:attemptFailedOutgoingTransfer#event:canceledOutgoingTransfer#event:completedOutgoingTransfer#event:failedReservation#event:acceptedReservation#event:canceledReservation#event:completedReservation#event:rejectedReservation#event:rescindedReservation#event:timeoutReservation#event:wrapupTask#event:canceledTask#event:completedTask#event:transferInitiatedTask#event:updatedTask#event:wrapupWorker#event:activityUpdatedWorker#event:attributesUpdatedWorker#event:disconnectedWorker#event:errorWorker#event:readyWorker#event:reservationCreatedWorker#event:reservationFailedWorker#event:tokenExpiredWorker#event:tokenUpdated Class: OutgoingTransfer OutgoingTransfer An OutgoingTransfer represents the currently active outgoing transfer initiated by the Worker to another Worker or queue new OutgoingTransfer(worker, request, taskSid, transferDescriptor) Parameters: Name Type Description worker Worker The Worker request Request The Request taskSid string The sid of the owning Task transferDescriptor TransferDescriptor The transfer descriptor which describes this OutgoingTransfer Properties: Name Type Description dateCreated Date The timestamp when this OutgoingTransfer was created dateUpdated Date The timestamp when this OutgoingTransfer was last updated mode string Transfer mode ['WARM', 'COLD'] reservationSid string The sid of the initiating Reservation. sid string The sid of this OutgoingTransfer status string ['INITIATED', 'FAILED', 'COMPLETED', 'CANCELED'] to string The sid of the Worker or TaskQueue this OutgoingTransfer is intended for transferFailedReason string The reason, if applicable, for why the transfer failed type string The transfer type ['QUEUE', 'WORKER'] workerSid string The sid of the initiating Worker Methods <async> cancel() Cancel the ongoing OutgoingTransfer Returns: Rejected if the OutgoingTransfer state could not be updated to 'canceled' Type Promise.<this> Events attemptFailed The attempt to transfer the Task to the desired entity failed Parameters: Name Type Description outgoingTransfer OutgoingTransfer The OutgoingTransfer that had an attempt failure canceled The Task's current OutgoingTransfer has successfully been cancelled Parameters: Name Type Description outgoingTransfer OutgoingTransfer The OutgoingTransfer that was canceled completed The OutgoingTransfer has successfully been transferred to the desired entity Parameters: Name Type Description outgoingTransfer OutgoingTransfer The OutgoingTransfer that was completed failed All attempts to transfer the Task to the desired entity have failed. No more attempts on the OutgoingTransfer will be made. Parameters: Name Type Description outgoingTransfer OutgoingTransfer The OutgoingTransfer that has failed × Search results Close Documentation generated by JSDoc 3.5.5 on 2021-11-25T08:41:13+00:00 using the DocStrap template. "},"Reservation.html":{"id":"Reservation.html","title":"Class: Reservation","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorker Events Channel#event:availabilityUpdatedChannel#event:capacityUpdatedOutgoingTransfer#event:attemptFailedOutgoingTransfer#event:canceledOutgoingTransfer#event:completedOutgoingTransfer#event:failedReservation#event:acceptedReservation#event:canceledReservation#event:completedReservation#event:rejectedReservation#event:rescindedReservation#event:timeoutReservation#event:wrapupTask#event:canceledTask#event:completedTask#event:transferInitiatedTask#event:updatedTask#event:wrapupWorker#event:activityUpdatedWorker#event:attributesUpdatedWorker#event:disconnectedWorker#event:errorWorker#event:readyWorker#event:reservationCreatedWorker#event:reservationFailedWorker#event:tokenExpiredWorker#event:tokenUpdated Class: Reservation Reservation A Reservation correlates a Task and a Worker new Reservation(worker, request, descriptor) Construct a Reservation. Parameters: Name Type Description worker Worker The Worker request Request The Request descriptor ReservationDescriptor The data descriptor which describes this Reservation Properties: Name Type Description accountSid string The sid of the Twilio account dateCreated Date The date the Reservation was created dateUpdated Date The date the Reservation was last updated canceledReasonCode int The reason code received when Reservation is canceled sid string The sid of the Reservation status string The current state of the Reservation. Options: ['pending', 'accepted', 'rejected', 'timeout', 'canceled', 'rescinded', 'wrapping', 'completed']. task Task The Task tied to the Reservation timeout int The number of seconds until the Task times out workerSid string The sid of the Worker workspaceSid string The sid of the Workspace owning this Reservation Fires: Reservation#event:accepted Reservation#event:canceled Reservation#event:completed Reservation#event:rejected Reservation#event:rescinded Reservation#event:timeout Reservation#event:wrapup Methods accept() Accept the Reservation Returns: Rejected if unable to issue Accept instruction on the Reservation Type Promise.<this> call(from, url [, options]) Issue a Call to a Worker Parameters: Name Type Argument Description from string The caller id for the call to a Worker url string A valid TwiML URI that is executed on the answering Worker's leg options Reservation.CallOptions <optional> Returns: Rejected if unable to issue Call instruction on the Reservation Type Promise.<this> complete() Complete the Reservation Returns: Rejected if unable to issue Complete instruction on the Reservation Type Promise.<this> conference( [options]) Conference the active Call tied to this Reservation to the Worker Parameters: Name Type Argument Description options Reservation.ConferenceOptions <optional> Returns: Rejected if unable to issue Conference instruction on the link Reservation Type Promise.<this> dequeue( [options]) Dequeue the Reservation to the Worker. This will perform telephony to dequeue a Task that was enqueued using the Enqueue TwiML verb. A contact_uri must exist in the Worker's attributes for this call to go through. Parameters: Name Type Argument Description options Reservation.DequeueOptions <optional> Returns: Rejected if unable to issue Dequeue instruction on the Reservation Type Promise.<this> redirect(callSid, url [, options]) Redirect the active Call tied to this Reservation Parameters: Name Type Argument Description callSid string The sid of the Call to redirect url string A valid TwiML URI that is executed on the Caller's leg upon redirecting options Reservation.RedirectOptions <optional> Returns: Rejected if unable to issue Redirect instruction on the Reservation Type Promise.<this> reject( [options]) Reject the Reservation Parameters: Name Type Argument Description options Reservation.RejectOptions <optional> Returns: Rejected if unable to issue Reject instruction on the Reservation Type Promise.<this> updateParticipant( [options]) Update the Worker's leg in the Conference associated to this Reservation Parameters: Name Type Argument Description options Reservation.ParticipantOptions <optional> Returns: Rejected if unable to update the Worker's leg in the Conference tied to the Reservation Type Promise.<this> wrap() Wrap the Reservation Returns: Rejected if unable to issue Wrap instruction on the Reservation Type Promise.<this> Type Definitions CallOptions Type: Object Properties: Name Type Argument Default Description accept boolean <optional> false Represents whether the Task should be accepted before initiating the call record string <optional> 'do-not-record' To record the call or not statusCallbackUrl string <optional> null A valid status status callback url to string <optional> null The number or endpoint that should be called. If not provided, the contact_uri defined in the Worker attributes will be used timeout number <optional> 60 The integer number of seconds Twilio should allow the phone associated to "contact_uri" to ring ConferenceOptions Type: Object Properties: Name Type Argument Default Description to string <optional> null The contact uri of the Worker; can be a phone number or a client ID. Required, if no contact_uri on the Worker's attributes. from string <optional> null The caller id for the call to the Worker. Must be a verified Twilio number. timeout int <optional> 60 The integer number of seconds that Twilio should allow the call to ring before assuming there is no answer. statusCallback string <optional> null The URL endpoint to receive call status events of the Worker leg. statusCallbackMethod string <optional> 'POST' The HTTP method for the Status Callback URL. statusCallbackEvent string <optional> 'completed' A comma separated list of events to subscribe to. The possible list of events are: ['initiated', 'ringing', 'answered', 'completed']. record string <optional> 'do-not-record' Whether to record the Worker leg of the Conference. muted boolean <optional> false Whether the Worker leg of the Conference is muted. beep string | boolean <optional> true Whether the Worker leg should be when entering the Conference. The options for beep are: [true, false, 'onEnter', 'onExit']. startConferenceOnEnter boolean <optional> true Whether the Conference should start when the Worker leg enters. endConferenceOnExit boolean <optional> false Whether the Conference should end when the Worker leg exits. endConferenceOnCustomerExit boolean <optional> false Whether the Conference should end when the customer leg exits. beepOnCustomerEntrance boolean <optional> true Whether the Conference should beep when the customer leg enters. waitUrl string <optional> default Twilio hold music The URL endpoint to play when waiting for the Conference to begin. waitMethod string <optional> 'POST' The HTTP method for the Wait URL. earlyMedia boolean <optional> true Whether Twilio should feed early media to be played directly into a Conference. maxParticipants int <optional> 10 The number of max participants allowed in a Conference. conferenceStatusCallback string <optional> null The URL endpoint to receive Conference status events. conferenceStatusCallbackMethod string <optional> 'POST' The HTTP method for the Conference Status Callback URL. conferenceStatusCallbackEvent string <optional> 'start,end' A comma separated list of Conference events to subscribe to. The possible list of events are: ['start', 'end', 'join', 'leave', 'mute', 'hold', 'speaker']. conferenceRecord string | boolean <optional> false Whether the entire Conference should be recorded. The possible options for conferenceRecord are: [true, false, 'record-from-start', 'do-not-record']. conferenceTrim string <optional> 'trim-silence' Whether to trim the Conference recording. The options for conferenceTrim are: ['trim-silence', 'do-not-trim']. recordingChannels string <optional> 'mono' Which channel of the Conference to record. The options are: ['mono', 'dual']. recordingStatusCallback string <optional> null The URL endpoint to receive recording status events. recordingStatusCallbackMethod string <optional> 'POST' The HTTP method for the Recording Status Callback URL. conferenceRecordingStatusCallback string <optional> null The URl endpoint to receive Conference events. conferenceRecordingStatusCallbackMethod string <optional> 'POST' The HTTP method of the Conference Recording Status Callback. region string <optional> null The specific region. The options for region are: ['us1', 'ie1', 'sg1', 'br1', 'au1', 'jp1']. sipAuthUsername string <optional> null The SIP auth username to use. sipAuthPassword string <optional> null The SIP auth password to use. DequeueOptions Type: Object Properties: Name Type Argument Default Description from string <optional> null The caller id for the call to the Worker. Must be a verified Twilio number. to string <optional> null The contact uri of the Worker; can be a phone number or a client ID. Required, if no contact_uri on the Worker's attributes. postWorkActivitySid string <optional> null The activitySid to update the Worker to after dequeuing the Reservation. record string <optional> 'do-not-record' Defines which legs of the call should be recorded. timeout int <optional> 60 The integer number of seconds that Twilio should allow the call to ring before assuming there is no answer. statusCallbackUrl string <optional> null A URL that Twilio will send asynchronous webhook this._request. to on a completed call event. statusCallbackEvents string <optional> null A comma separated string of the events to subscribe to ParticipantOptions Type: Object Properties: Name Type Argument Default Description endConferenceOnExit boolean <optional> null Whether the Conference should end when this Worker participant leaves the Conference mute boolean <optional> null Mute or unmute this Worker participant beepOnExit boolean <optional> null Whether there should be a beep sound when this Worker participant leaves the Conference RedirectOptions Type: Object Properties: Name Type Argument Default Description accept boolean <optional> false Represents whether the Task should be accepted before initiating the call RejectOptions Type: Object Properties: Name Type Description activitySid string The sid of the Activity to update the worker to upon rejecting the Reservation Events accepted Fired when a Reservation has been accepted for this Worker Parameters: Name Type Description reservation Reservation The accepted Reservation canceled Fired when a Reservation has been canceled for this Worker Parameters: Name Type Description reservation Reservation The canceled Reservation completed Fired when an accepted Reservation has been completed for this Worker Parameters: Name Type Description reservation Reservation The completed Reservation rejected Fired when a Reservation has been rejected for this Worker Parameters: Name Type Description reservation Reservation The rejected Reservation rescinded Fired when a Reservation has been rescinded for the Worker Parameters: Name Type Description reservation Reservation The rescinded Reservation timeout Fired when a Reservation has been timed out for this Worker Parameters: Name Type Description reservation Reservation The timed out Reservation wrapup Fired when a Reservation has been wrapped up for the Worker Parameters: Name Type Description reservation Reservation The wrapped up Reservation × Search results Close Documentation generated by JSDoc 3.5.5 on 2021-11-25T08:41:13+00:00 using the DocStrap template. "},"Task.html":{"id":"Task.html","title":"Class: Task","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorker Events Channel#event:availabilityUpdatedChannel#event:capacityUpdatedOutgoingTransfer#event:attemptFailedOutgoingTransfer#event:canceledOutgoingTransfer#event:completedOutgoingTransfer#event:failedReservation#event:acceptedReservation#event:canceledReservation#event:completedReservation#event:rejectedReservation#event:rescindedReservation#event:timeoutReservation#event:wrapupTask#event:canceledTask#event:completedTask#event:transferInitiatedTask#event:updatedTask#event:wrapupWorker#event:activityUpdatedWorker#event:attributesUpdatedWorker#event:disconnectedWorker#event:errorWorker#event:readyWorker#event:reservationCreatedWorker#event:reservationFailedWorker#event:tokenExpiredWorker#event:tokenUpdated Class: Task Task A Task represents an item of work new Task(worker, request, reservationSid, descriptor) Parameters: Name Type Description worker Worker The Worker request Request The Request reservationSid string The SID of the Reservation associated with this Task descriptor TaskDescriptor The data descriptor which describes this Task Properties: Name Type Description addOns Object The addons attached to the Task age int The age of the Task in seconds attributes Object The attributes of the Task dateCreated Date The date the Task was created dateUpdated Date The date the Task was last updated priority int The priority of the Task queueName string The friendly name of the TaskQueue the Task is currently in queueSid string The sid of the TaskQueue the Task is currently in reason string The reason the Task was completed or canceled, if applicable routingTarget string The target Sid of the Worker, TaskQueue, or Workflow this Task will be routed to. sid string The sid of the Task status string The status of the Task. Options: ['reserved', 'assigned', 'canceled', 'wrapping', 'completed', 'transferring'] taskChannelSid string The sid of the Task Channel associated to the Task in MultiTask mode taskChannelUniqueName string The unique name of the Task Channel associated to the Task in MultiTask mode timeout int The number of seconds the Task is allowed to live transfers Transfers The IncomingTransfer and OutgoingTransfer related to this Task, if applicable workflowName string The name of the Workflow responsible for routing the Task workflowSid string The sid of the Workflow responsible for routing the Task Fires: Task#event:canceled Task#event:completed Task#event:transferAttemptFailed Task#event:transferCanceled Task#event:transferCompleted Task#event:transferFailed Task#event:transferInitiated Task#event:updated Task#event:wrapup Methods complete(reason) Update the Task status to 'completed' Parameters: Name Type Description reason string The reason for completing the Task Returns: Rejected if the Task state could not be updated to 'completed' Type Promise.<this> hold(targetWorkerSid, onHold [, options]) Hold the worker's call leg in the Conference associated to this Task and specified TargetWorkerSid Parameters: Name Type Argument Description targetWorkerSid String The target worker's sid which should be put onhold or unhold onHold boolean Whether to hold or unhold the specified worker's call leg in the Conference referenced by the Task options Task.HoldOptions <optional> kick(workerSid) Kick another active Worker participant from the ongoing conference Parameters: Name Type Description workerSid string The Sid of the Worker who is currently in the conference that should be kicked Returns: Rejected if unable to kick the call leg of the targeted Worker in the Conference tied to the Task Type Promise.<this> setAttributes(attributes) Update the Task attributes to the given attributes. Parameters: Name Type Description attributes Object A JSON to update the attributes. Returns: Rejected if the attributes cannot be set Type Promise.<this> transfer(to [, options]) Transfer the Task to another entity. Parameters: Name Type Argument Description to string The Worker or TaskQueue entity sid to transfer the task to. options Task.TransferOptions <optional> Returns: Type Promise.<this> updateParticipant( [options]) Update the Customer leg in the Conference associated to this Task Parameters: Name Type Argument Description options Task.ParticipantOptions <optional> Returns: Rejected if unable to update the Customers's leg in the Conference tied to the Task Type Promise.<this> wrapUp() Update the Task status to 'wrapping' in a multi-task enabled Workspace Returns: Rejected if the Task state could not be updated to 'wrapping' Type Promise.<this> Type Definitions HoldOptions Type: Object Properties: Name Type Argument Default Description holdUrl string <optional> default Twilio hold music The URL endpoint to play when participant is on hold. holdMethod string <optional> 'GET' The HTTP method for the hold URL. ParticipantOptions Type: Object Properties: Name Type Argument Default Description hold boolean <optional> null Whether to hold the customer leg of the Conference referenced by the Task holdUrl string <optional> default Twilio hold music The URL endpoint to play when participant is on hold. holdMethod string <optional> 'GET' The HTTP method for the hold URL. TransferOptions Type: Object Properties: Name Type Argument Default Description attributes string <optional> Updated attributes for the task mode string <optional> 'WARM' 'WARM' or 'COLD' priority string <optional> Updated priority for the task WrappingOptions Type: Object Properties: Name Type Argument Default Description reason string <optional> null The reason for wrapping up the Task Events canceled The Task was canceled Parameters: Name Type Description task Task The Task who was canceled completed The Task was completed Parameters: Name Type Description task Task The Task who was completed transferInitiated An OutgoingTransfer has been initiated for Task Parameters: Name Type Description outgoingTransfer OutgoingTransfer The currently in process OutgoingTransfer updated The attributes of this Task was updated Parameters: Name Type Description task Task The Task whose attributes were updated wrapup The Task was wrapped up Parameters: Name Type Description task Task The Task who was wrapped up × Search results Close Documentation generated by JSDoc 3.5.5 on 2021-11-25T08:41:13+00:00 using the DocStrap template. "},"TaskQueue.html":{"id":"TaskQueue.html","title":"Class: TaskQueue","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorker Events Channel#event:availabilityUpdatedChannel#event:capacityUpdatedOutgoingTransfer#event:attemptFailedOutgoingTransfer#event:canceledOutgoingTransfer#event:completedOutgoingTransfer#event:failedReservation#event:acceptedReservation#event:canceledReservation#event:completedReservation#event:rejectedReservation#event:rescindedReservation#event:timeoutReservation#event:wrapupTask#event:canceledTask#event:completedTask#event:transferInitiatedTask#event:updatedTask#event:wrapupWorker#event:activityUpdatedWorker#event:attributesUpdatedWorker#event:disconnectedWorker#event:errorWorker#event:readyWorker#event:reservationCreatedWorker#event:reservationFailedWorker#event:tokenExpiredWorker#event:tokenUpdated Class: TaskQueue TaskQueue A TaskQueue represents a set of Tasks awaiting assignment. new TaskQueue(descriptor) Parameters: Name Type Description descriptor TaskQueueDescriptor The TaskQueueDescriptor of this TaskQueue Properties: Name Type Description sid string The Sid of the TaskQueue accountSid string The Sid of the owning Account of the TaskQueue} workspaceSid string The Sid of the Workspace the TaskQueue belongs to name string The friendly name of the TaskQueue assignmentActivityName string The Activity name for the reservation of the TaskQueue reservationActivityName string The Activity name for the assignment of the TaskQueue assignmentActivitySid string The Sid of the assignment Activity for the TaskQueue reservationActivitySid string The Sid of the reservation Activity for the TaskQueue targetWorkers string The expression used to target workers maxReservedWorkers int The maximum number of reserved workers for the TaskQueue taskOrder string The task order for the TaskQueue FIFO or LIFO dateCreated Date The date when the TaskQueue was created dateUpdated Date The date when the TaskQueue was last updated × Search results Close Documentation generated by JSDoc 3.5.5 on 2021-11-25T08:41:13+00:00 using the DocStrap template. "},"Transfers.html":{"id":"Transfers.html","title":"Class: Transfers","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorker Events Channel#event:availabilityUpdatedChannel#event:capacityUpdatedOutgoingTransfer#event:attemptFailedOutgoingTransfer#event:canceledOutgoingTransfer#event:completedOutgoingTransfer#event:failedReservation#event:acceptedReservation#event:canceledReservation#event:completedReservation#event:rejectedReservation#event:rescindedReservation#event:timeoutReservation#event:wrapupTask#event:canceledTask#event:completedTask#event:transferInitiatedTask#event:updatedTask#event:wrapupWorker#event:activityUpdatedWorker#event:attributesUpdatedWorker#event:disconnectedWorker#event:errorWorker#event:readyWorker#event:reservationCreatedWorker#event:reservationFailedWorker#event:tokenExpiredWorker#event:tokenUpdated Class: Transfers Transfers Transfers contains both the IncomingTransfer and OutgoingTransfer for the Worker new Transfers(worker, request, taskDescriptor) Parameters: Name Type Description worker Worker The Worker request Request The Request taskDescriptor TaskDescriptor The task descriptor which describes the related Task Properties: Name Type Description incoming IncomingTransfer The IncomingTransfer for the Worker if the related Reservation was initiated via transfer by another agent outgoing OutgoingTransfer The current active (initiated but not yet finished) OutgoingTransfer initiated by the Worker to another agent or queue × Search results Close Documentation generated by JSDoc 3.5.5 on 2021-11-25T08:41:13+00:00 using the DocStrap template. "},"Worker.html":{"id":"Worker.html","title":"Class: Worker","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorker Events Channel#event:availabilityUpdatedChannel#event:capacityUpdatedOutgoingTransfer#event:attemptFailedOutgoingTransfer#event:canceledOutgoingTransfer#event:completedOutgoingTransfer#event:failedReservation#event:acceptedReservation#event:canceledReservation#event:completedReservation#event:rejectedReservation#event:rescindedReservation#event:timeoutReservation#event:wrapupTask#event:canceledTask#event:completedTask#event:transferInitiatedTask#event:updatedTask#event:wrapupWorker#event:activityUpdatedWorker#event:attributesUpdatedWorker#event:disconnectedWorker#event:errorWorker#event:readyWorker#event:reservationCreatedWorker#event:reservationFailedWorker#event:tokenExpiredWorker#event:tokenUpdated Class: Worker Worker Create a Worker client representing a TaskRouter Worker new Worker(token [, options]) Parameters: Name Type Argument Description token string The string token options Worker.Options <optional> Properties: Name Type Description accountSid string The sid of the Twilio account activities Map.<string, Activity> The list of possible states a Worker can be activity Activity The current Activity of the Worker attributes Object A JSON representation of the Worker's attributes channels Map.<string, Channel> The list of available Channels connectActivitySid string The Activity to set the Worker as on connect dateCreated Date The date this Worker was created dateStatusChanged Date The date this Worker's activity was last changed dateUpdated Date The date this Worker was last updated name string The friendly name of the Worker reservations Map.<string, Reservation> A list of pending Reservations for the Worker sid string The sid of the Worker workspaceSid string The sid of the Workspace owning this Worker Fires: Worker#event:activityUpdated Worker#event:attributesUpdated Worker#event:disconnected Worker#event:error Worker#event:ready Worker#event:reservationCreated Worker#event:tokenExpired Worker#event:tokenUpdated Methods createTask(to, from, workflowSid, taskQueueSid [, options]) Create a Task Parameters: Name Type Argument Description to string The contact uri of the customer. Stored in the Task's attributes as "outbound_to" from string The contact uri of the Worker. Stored in the Task's attributes as "from" workflowSid string The Sid of the Workflow this Task should belong to taskQueueSid string The Sid of the TaskQueue this Task should belong to, used for reporting purposes only options Worker.TaskOptions <optional> Returns: Rejected if unable to create a Task on behalf of the Worker. Returns the TaskSid of the created Task. Type Promise.<String> disconnect() Gracefully disconnect the client. Returns: Type void setAttributes(attributes) Update attributes Parameters: Name Type Description attributes Object A JSON describing the Worker's attributes Returns: Rejected if the attributes cannot be set Type Promise.<this> updateToken(newToken) Update token Parameters: Name Type Description newToken string The new token that should be used for authentication Returns: Emits error if unable to update token Type void Type Definitions Options Type: Object Properties: Name Type Argument Default Description connectActivitySid string <optional> '' The Activity state of the Worker upon connect closeExistingSessions boolean <optional> false Whether other open sessions of this Worker should be terminated logLevel string <optional> 'error' The level of logging to enable ['error', 'warn', 'info', 'debug', 'trace', 'silent'] region string <optional> the ingress region for connections (ex. "ie1-ix") TaskOptions Type: Object Properties: Name Type Argument Default Description attributes object <optional> null Additional attributes for the Task taskChannelUniqueName string <optional> null The friendly name of the Channel this Task belongs to. If not provided, defaults to 'default' channel. taskChannelSid string <optional> null The Sid of the Channel this Task belongs to. If not provided, defaults to 'default' channel. Events activityUpdated Worker activity has updated Parameters: Name Type Description worker Worker The updated Worker attributesUpdated Worker attributes have updated Parameters: Name Type Description worker Worker The updated Worker disconnected The signaling layer has lost the websocket connection Parameters: Name Type Description reason Object The reason the Worker websocket disconnected error An error has occurred Parameters: Name Type Description error Error The Error that occurred ready Worker is ready to listen for events and take action reservationCreated A Reservation has been created for the Worker Parameters: Name Type Description reservation Reservation The created Reservation reservationFailed Worker was unable to receive a Reservation for the Task it created Parameters: Name Type Description task Object The raw Task-like payload that failed to generate a Reservation tokenExpired The Worker token has expired tokenUpdated The Worker token has successfully updated × Search results Close Documentation generated by JSDoc 3.5.5 on 2021-11-25T08:41:13+00:00 using the DocStrap template. "}}
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<script type="text/javascript">
|