twilio-taskrouter 0.7.2 → 0.8.1

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 CHANGED
@@ -1,3 +1,25 @@
1
+ 0.8.1
2
+ ==========
3
+ New Features
4
+ ----------
5
+ - Added status based retries
6
+
7
+ Maintenance
8
+ ----------
9
+ - Added babel transpiler as part of build process for ES6+ syntax
10
+ - Added sonarqube integration for code quality
11
+
12
+ 0.8.0
13
+ ==========
14
+ New Features
15
+ ----------
16
+ - Added exponential backoff time for retries
17
+ - Added unit and integration tests to test retries
18
+
19
+ Bug Fixes
20
+ ----------
21
+ - Fix for fetching more than 1000 workers
22
+
1
23
  0.7.2
2
24
  ==========
3
25
  Bug Fixes
@@ -763,7 +763,7 @@
763
763
  <span class="jsdoc-message">
764
764
  Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.7</a>
765
765
 
766
- on 2022-11-03T07:19:23+00:00
766
+ on 2023-03-29T06:54:49+00:00
767
767
 
768
768
  using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
769
769
  </span>
@@ -839,7 +839,7 @@
839
839
  <span class="jsdoc-message">
840
840
  Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.7</a>
841
841
 
842
- on 2022-11-03T07:19:23+00:00
842
+ on 2023-03-29T06:54:49+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.6.7</a>
477
477
 
478
- on 2022-11-03T07:19:23+00:00
478
+ on 2023-03-29T06:54:49+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.6.7</a>
1126
1126
 
1127
- on 2022-11-03T07:19:23+00:00
1127
+ on 2023-03-29T06:54:49+00:00
1128
1128
 
1129
1129
  using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
1130
1130
  </span>
@@ -5379,7 +5379,7 @@ upon rejecting the <a href="Reservation.html">Reservation</a></p></td>
5379
5379
  <span class="jsdoc-message">
5380
5380
  Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.7</a>
5381
5381
 
5382
- on 2022-11-03T07:19:23+00:00
5382
+ on 2023-03-29T06:54:49+00:00
5383
5383
 
5384
5384
  using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
5385
5385
  </span>
@@ -3352,7 +3352,7 @@
3352
3352
  <span class="jsdoc-message">
3353
3353
  Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.7</a>
3354
3354
 
3355
- on 2022-11-03T07:19:23+00:00
3355
+ on 2023-03-29T06:54:49+00:00
3356
3356
 
3357
3357
  using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
3358
3358
  </span>
@@ -619,7 +619,7 @@
619
619
  <span class="jsdoc-message">
620
620
  Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.7</a>
621
621
 
622
- on 2022-11-03T07:19:23+00:00
622
+ on 2023-03-29T06:54:49+00:00
623
623
 
624
624
  using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
625
625
  </span>
@@ -307,7 +307,7 @@
307
307
  <span class="jsdoc-message">
308
308
  Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.7</a>
309
309
 
310
- on 2022-11-03T07:19:23+00:00
310
+ on 2023-03-29T06:54:49+00:00
311
311
 
312
312
  using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
313
313
  </span>
@@ -3186,7 +3186,7 @@ provided, defaults to 'default' channel.</p></td>
3186
3186
  <span class="jsdoc-message">
3187
3187
  Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.7</a>
3188
3188
 
3189
- on 2022-11-03T07:19:23+00:00
3189
+ on 2023-03-29T06:54:49+00:00
3190
3190
 
3191
3191
  using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
3192
3192
  </span>
@@ -1985,7 +1985,7 @@
1985
1985
  <span class="jsdoc-message">
1986
1986
  Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.7</a>
1987
1987
 
1988
- on 2022-11-03T07:19:23+00:00
1988
+ on 2023-03-29T06:54:49+00:00
1989
1989
 
1990
1990
  using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
1991
1991
  </span>
@@ -3537,7 +3537,7 @@ No more attempts on the <a href="OutgoingTransfer.html">OutgoingTransfer</a> wil
3537
3537
  <span class="jsdoc-message">
3538
3538
  Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.7</a>
3539
3539
 
3540
- on 2022-11-03T07:19:23+00:00
3540
+ on 2023-03-29T06:54:49+00:00
3541
3541
 
3542
3542
  using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
3543
3543
  </span>
@@ -223,7 +223,7 @@ request/contribution process, <a href="https://gun.io/blog/how-to-github-fork-br
223
223
  <span class="jsdoc-message">
224
224
  Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.7</a>
225
225
 
226
- on 2022-11-03T07:19:23+00:00
226
+ on 2023-03-29T06:54:49+00:00
227
227
 
228
228
  using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
229
229
  </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 ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorkerWorkspace 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 Workspace 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.6.7 on 2022-11-03T07:19:23+00:00 using the DocStrap template. "},"index.html":{"id":"index.html","title":"Index","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorkerWorkspace 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.js 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. 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. Installation NPM npm install twilio-taskrouter Usage The 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 =&gt; { console.log(`Worker ${readyAlice.sid} is now ready for work`); }); alice.on('reservationCreated', reservation =&gt; { console.log(`Reservation ${reservation.sid} has been created for ${alice.sid}`); console.log(`Task attributes are: ${reservation.task.attributes}`); reservation.on('accepted', acceptedReservation =&gt; { console.log(`Reservation ${acceptedReservation.sid} was accepted.`); }); reservation.accept().then(acceptedReservation =&gt; { console.log(`Reservation status is ${acceptedReservation.status}`); }).catch((err) =&gt; { 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(); } Changelog See CHANGELOG.md. License See LICENSE.md. Building Fork and clone the repository. Use npm to install node 8 (other versions may run into problems). Then, install dependencies with: yarn install Then run the build script: yarn build The builds and docs will be placed in the dist/ directory. Before commits, be sure to validate by running: make lint Testing Create a twilio account copy ./test/integration_test_setup/.env.example to ./test/integration_test_setup/.env set ACCOUNT_SID, AUTH_TOKEN, SIGNING_KEY_SID, SIGNING_KEY_SECRET Run ./test/integration_test_setup/RunIntegrationTestLocal.sh this will create everything needed for running E2E tests and run the tests Contributing Bug 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.6.7 on 2022-11-03T07:19:23+00:00 using the DocStrap template. "},"Activity.html":{"id":"Activity.html","title":"Class: Activity","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorkerWorkspace 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 &lt;optional&gt; Returns: Rejected if the Worker's activity state could not be set Type Promise.&lt;this&gt; Type Definitions UpdateOptions Type: Object Properties: Name Type Argument Default Description rejectPendingReservations boolean &lt;optional&gt; false Represents whether all pending reservations should be rejected with the update to an unavailable Activity. × Search results Close Documentation generated by JSDoc 3.6.7 on 2022-11-03T07:19:23+00:00 using the DocStrap template. "},"Channel.html":{"id":"Channel.html","title":"Class: Channel","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorkerWorkspace 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.6.7 on 2022-11-03T07:19:23+00:00 using the DocStrap template. "},"IncomingTransfer.html":{"id":"IncomingTransfer.html","title":"Class: IncomingTransfer","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorkerWorkspace 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.6.7 on 2022-11-03T07:19:23+00:00 using the DocStrap template. "},"OutgoingTransfer.html":{"id":"OutgoingTransfer.html","title":"Class: OutgoingTransfer","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorkerWorkspace 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 &lt;async&gt; cancel() Cancel the ongoing OutgoingTransfer Returns: Rejected if the OutgoingTransfer state could not be updated to 'canceled' Type Promise.&lt;this&gt; 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.6.7 on 2022-11-03T07:19:23+00:00 using the DocStrap template. "},"Reservation.html":{"id":"Reservation.html","title":"Class: Reservation","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorkerWorkspace 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 version string The version of 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.&lt;this&gt; 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 &lt;optional&gt; Returns: Rejected if unable to issue Call instruction on the Reservation Type Promise.&lt;this&gt; complete() Complete the Reservation Returns: Rejected if unable to issue Complete instruction on the Reservation Type Promise.&lt;this&gt; conference( [options]) Conference the active Call tied to this Reservation to the Worker Parameters: Name Type Argument Description options Reservation.ConferenceOptions &lt;optional&gt; Returns: Rejected if unable to issue Conference instruction on the link Reservation Type Promise.&lt;this&gt; 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 &lt;optional&gt; Returns: Rejected if unable to issue Dequeue instruction on the Reservation Type Promise.&lt;this&gt; fetchLatestVersion() Fetch the last version of this Reservation Returns: Type Promise.&lt;Reservation&gt; 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 &lt;optional&gt; Returns: Rejected if unable to issue Redirect instruction on the Reservation Type Promise.&lt;this&gt; reject( [options]) Reject the Reservation Parameters: Name Type Argument Description options Reservation.RejectOptions &lt;optional&gt; Returns: Rejected if unable to issue Reject instruction on the Reservation Type Promise.&lt;this&gt; updateParticipant( [options]) Update the Worker's leg in the Conference associated to this Reservation Parameters: Name Type Argument Description options Reservation.ParticipantOptions &lt;optional&gt; Returns: Rejected if unable to update the Worker's leg in the Conference tied to the Reservation Type Promise.&lt;this&gt; wrap() Wrap the Reservation Returns: Rejected if unable to issue Wrap instruction on the Reservation Type Promise.&lt;this&gt; Type Definitions CallOptions Type: Object Properties: Name Type Argument Default Description accept boolean &lt;optional&gt; false Represents whether the Task should be accepted before initiating the call record string &lt;optional&gt; 'do-not-record' To record the call or not statusCallbackUrl string &lt;optional&gt; null A valid status status callback url to string &lt;optional&gt; 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 &lt;optional&gt; 60 The integer number of seconds Twilio should allow the phone associated to &quot;contact_uri&quot; to ring ConferenceOptions Type: Object Properties: Name Type Argument Default Description to string &lt;optional&gt; 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 &lt;optional&gt; null The caller id for the call to the Worker. Must be a verified Twilio number. timeout int &lt;optional&gt; 60 The integer number of seconds that Twilio should allow the call to ring before assuming there is no answer. statusCallback string &lt;optional&gt; null The URL endpoint to receive call status events of the Worker leg. statusCallbackMethod string &lt;optional&gt; 'POST' The HTTP method for the Status Callback URL. statusCallbackEvent string &lt;optional&gt; 'completed' A comma separated list of events to subscribe to. The possible list of events are: ['initiated', 'ringing', 'answered', 'completed']. record string &lt;optional&gt; 'do-not-record' Whether to record the Worker leg of the Conference. muted boolean &lt;optional&gt; false Whether the Worker leg of the Conference is muted. beep string | boolean &lt;optional&gt; true Whether the Worker leg should be when entering the Conference. The options for beep are: [true, false, 'onEnter', 'onExit']. startConferenceOnEnter boolean &lt;optional&gt; true Whether the Conference should start when the Worker leg enters. endConferenceOnExit boolean &lt;optional&gt; false Whether the Conference should end when the Worker leg exits. endConferenceOnCustomerExit boolean &lt;optional&gt; false Whether the Conference should end when the customer leg exits. beepOnCustomerEntrance boolean &lt;optional&gt; true Whether the Conference should beep when the customer leg enters. waitUrl string &lt;optional&gt; default Twilio hold music The URL endpoint to play when waiting for the Conference to begin. waitMethod string &lt;optional&gt; 'POST' The HTTP method for the Wait URL. earlyMedia boolean &lt;optional&gt; true Whether Twilio should feed early media to be played directly into a Conference. maxParticipants int &lt;optional&gt; 10 The number of max participants allowed in a Conference. conferenceStatusCallback string &lt;optional&gt; null The URL endpoint to receive Conference status events. conferenceStatusCallbackMethod string &lt;optional&gt; 'POST' The HTTP method for the Conference Status Callback URL. conferenceStatusCallbackEvent string &lt;optional&gt; '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 &lt;optional&gt; false Whether the entire Conference should be recorded. The possible options for conferenceRecord are: [true, false, 'record-from-start', 'do-not-record']. conferenceTrim string &lt;optional&gt; 'trim-silence' Whether to trim the Conference recording. The options for conferenceTrim are: ['trim-silence', 'do-not-trim']. recordingChannels string &lt;optional&gt; 'mono' Which channel of the Conference to record. The options are: ['mono', 'dual']. recordingStatusCallback string &lt;optional&gt; null The URL endpoint to receive recording status events. recordingStatusCallbackMethod string &lt;optional&gt; 'POST' The HTTP method for the Recording Status Callback URL. conferenceRecordingStatusCallback string &lt;optional&gt; null The URl endpoint to receive Conference events. conferenceRecordingStatusCallbackMethod string &lt;optional&gt; 'POST' The HTTP method of the Conference Recording Status Callback. region string &lt;optional&gt; null The specific region. The options for region are: ['us1', 'ie1', 'sg1', 'br1', 'au1', 'jp1']. sipAuthUsername string &lt;optional&gt; null The SIP auth username to use. sipAuthPassword string &lt;optional&gt; null The SIP auth password to use. DequeueOptions Type: Object Properties: Name Type Argument Default Description from string &lt;optional&gt; null The caller id for the call to the Worker. Must be a verified Twilio number. to string &lt;optional&gt; 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 &lt;optional&gt; null The activitySid to update the Worker to after dequeuing the Reservation. record string &lt;optional&gt; 'do-not-record' Defines which legs of the call should be recorded. timeout int &lt;optional&gt; 60 The integer number of seconds that Twilio should allow the call to ring before assuming there is no answer. statusCallbackUrl string &lt;optional&gt; null A URL that Twilio will send asynchronous webhook this._request. to on a completed call event. statusCallbackEvents string &lt;optional&gt; null A comma separated string of the events to subscribe to ParticipantOptions Type: Object Properties: Name Type Argument Default Description endConferenceOnExit boolean &lt;optional&gt; null Whether the Conference should end when this Worker participant leaves the Conference mute boolean &lt;optional&gt; null Mute or unmute this Worker participant beepOnExit boolean &lt;optional&gt; 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 &lt;optional&gt; 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.6.7 on 2022-11-03T07:19:23+00:00 using the DocStrap template. "},"Task.html":{"id":"Task.html","title":"Class: Task","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorkerWorkspace 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 version string The version of this 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.&lt;this&gt; fetchLatestVersion() Fetch the last version of this Task Returns: Type Promise.&lt;Task&gt; 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 &lt;optional&gt; 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.&lt;this&gt; 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.&lt;this&gt; 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 &lt;optional&gt; Returns: Type Promise.&lt;this&gt; updateParticipant( [options]) Update the Customer leg in the Conference associated to this Task Parameters: Name Type Argument Description options Task.ParticipantOptions &lt;optional&gt; Returns: Rejected if unable to update the Customers's leg in the Conference tied to the Task Type Promise.&lt;this&gt; 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.&lt;this&gt; Type Definitions HoldOptions Type: Object Properties: Name Type Argument Default Description holdUrl string &lt;optional&gt; default Twilio hold music The URL endpoint to play when participant is on hold. holdMethod string &lt;optional&gt; 'GET' The HTTP method for the hold URL. ParticipantOptions Type: Object Properties: Name Type Argument Default Description hold boolean &lt;optional&gt; null Whether to hold the customer leg of the Conference referenced by the Task holdUrl string &lt;optional&gt; default Twilio hold music The URL endpoint to play when participant is on hold. holdMethod string &lt;optional&gt; 'GET' The HTTP method for the hold URL. TransferOptions Type: Object Properties: Name Type Argument Default Description attributes Object &lt;optional&gt; Updated attributes for the task mode string &lt;optional&gt; 'WARM' 'WARM' or 'COLD' priority number &lt;optional&gt; Updated priority for the task WrappingOptions Type: Object Properties: Name Type Argument Default Description reason string &lt;optional&gt; 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.6.7 on 2022-11-03T07:19:23+00:00 using the DocStrap template. "},"TaskQueue.html":{"id":"TaskQueue.html","title":"Class: TaskQueue","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorkerWorkspace 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 queueSid 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 queueName 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.6.7 on 2022-11-03T07:19:23+00:00 using the DocStrap template. "},"Transfers.html":{"id":"Transfers.html","title":"Class: Transfers","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorkerWorkspace 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.6.7 on 2022-11-03T07:19:23+00:00 using the DocStrap template. "},"Worker.html":{"id":"Worker.html","title":"Class: Worker","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorkerWorkspace 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 &lt;optional&gt; Properties: Name Type Description accountSid string The sid of the Twilio account activities Map.&lt;string, Activity&gt; The list of possible states a Worker can be activity Activity The current Activity of the Worker activitySid string The sid of the Activity the Worker is currently in activityName string The current Activity name the Worker is currently in attributes Object A JSON representation of the Worker's attributes available boolean Whether or not the Worker is available to take on Tasks channels Map.&lt;string, Channel&gt; 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.&lt;string, Reservation&gt; 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 workerSid string The sid of the Worker, duplicates sid field for backwards compatibility workerActivitySid string The sid of the Activity the Worker is currently in, duplicates activitySid field for backwards compatibility dateActivityChanged Date The date when the Worker's state was last changed, duplicates dateStatusChanged field for backwards compatibility friendlyName string The friendly name of the Worker, duplicates name field for backwards compatibility version string The version of 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 &quot;outbound_to&quot; from string The contact uri of the Worker. Stored in the Task's attributes as &quot;from&quot; 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 &lt;optional&gt; Returns: Rejected if unable to create a Task on behalf of the Worker. Returns the TaskSid of the created Task. Type Promise.&lt;String&gt; disconnect() Gracefully disconnect the client. Returns: Type void fetchLatestVersion() Fetch the last version of this Worker Returns: Type Promise.&lt;Worker&gt; 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.&lt;this&gt; 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 &lt;optional&gt; '' The Activity state of the Worker upon connect closeExistingSessions boolean &lt;optional&gt; false Whether other open sessions of this Worker should be terminated logLevel string &lt;optional&gt; 'error' The level of logging to enable ['error', 'warn', 'info', 'debug', 'trace', 'silent'] region string the realm for connections (ex. &quot;stage-us1&quot;) edge string the ingress for connections (ex. &quot;sydney&quot;) TaskOptions Type: Object Properties: Name Type Argument Default Description attributes object &lt;optional&gt; null Additional attributes for the Task taskChannelUniqueName string &lt;optional&gt; null The friendly name of the Channel this Task belongs to. If not provided, defaults to 'default' channel. taskChannelSid string &lt;optional&gt; 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.6.7 on 2022-11-03T07:19:23+00:00 using the DocStrap template. "},"Workspace.html":{"id":"Workspace.html","title":"Class: Workspace","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorkerWorkspace 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: Workspace Workspace Create a Workspace client representing a TaskRouter Workspace new Workspace(jwt [, options], workspaceSid) Parameters: Name Type Argument Description jwt string The string token options Workspace.Options &lt;optional&gt; workspaceSid string Sid of this Workspace, has to be provided if JWE token is passed Throws: Exception if workspaceSid is not passed with JWE token Methods fetchTaskQueue(queueSid) Fetch task queue of this Workspace by given sid Parameters: Name Type Description queueSid string the sid of the task queue to fetch Returns: A task queue with given sid Type Promise.&lt;TaskQueue&gt; fetchTaskQueues( [options]) Fetch task queues of this Workspace Parameters: Name Type Argument Description options Workspace.FetchTaskQueuesParams &lt;optional&gt; Returns: A map with the task queues Type Promise.&lt;Map.&lt;string, TaskQueue&gt;&gt; fetchWorker(workerSid) Fetch worker of this Workspace by given sid Parameters: Name Type Description workerSid string the sid of the worker to fetch Returns: A worker with given sid Type Promise.&lt;Worker&gt; fetchWorkers( [options]) Fetch workers of this Workspace Parameters: Name Type Argument Description options Workspace.FetchWorkersParams &lt;optional&gt; Returns: A map with the workers Type Promise.&lt;Map.&lt;string, Worker&gt;&gt; updateToken(newToken) Update token Parameters: Name Type Description newToken string The new token that should be used for authentication Returns: throws error if unable to update token Type void Type Definitions FetchTaskQueuesParams Type: Object Properties: Name Type Argument Default Description AfterSid string &lt;optional&gt; null FriendlyName string &lt;optional&gt; null Ordering string &lt;optional&gt; null FetchWorkersParams Type: Object Properties: Name Type Argument Default Description AfterSid string &lt;optional&gt; null FriendlyName string &lt;optional&gt; null ActivitySid string &lt;optional&gt; null ActivityName string &lt;optional&gt; null Ordering string &lt;optional&gt; null TargetWorkersExpression string &lt;optional&gt; null maxWorkers number &lt;optional&gt; null Options Type: Object Properties: Name Type Argument Default Description region string the realm for connections (ex. &quot;stage-us1&quot;) edge string the ingress for connections (ex. &quot;sydney&quot;) pageSize string The number of items returned in each request logLevel string &lt;optional&gt; 'error' The level of logging to enable ['error', 'warn', 'info', 'debug', 'trace', 'silent'] × Search results Close Documentation generated by JSDoc 3.6.7 on 2022-11-03T07:19:23+00:00 using the DocStrap template. "}}
9
+ {"classes.list.html":{"id":"classes.list.html","title":"Classes","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorkerWorkspace 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 Workspace 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.6.7 on 2023-03-29T06:54:49+00:00 using the DocStrap template. "},"index.html":{"id":"index.html","title":"Index","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorkerWorkspace 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.js 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. 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. Installation NPM npm install twilio-taskrouter Usage The 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 =&gt; { console.log(`Worker ${readyAlice.sid} is now ready for work`); }); alice.on('reservationCreated', reservation =&gt; { console.log(`Reservation ${reservation.sid} has been created for ${alice.sid}`); console.log(`Task attributes are: ${reservation.task.attributes}`); reservation.on('accepted', acceptedReservation =&gt; { console.log(`Reservation ${acceptedReservation.sid} was accepted.`); }); reservation.accept().then(acceptedReservation =&gt; { console.log(`Reservation status is ${acceptedReservation.status}`); }).catch((err) =&gt; { 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(); } Changelog See CHANGELOG.md. License See LICENSE.md. Building Fork and clone the repository. Use npm to install node 8 (other versions may run into problems). Then, install dependencies with: yarn install Then run the build script: yarn build The builds and docs will be placed in the dist/ directory. Before commits, be sure to validate by running: make lint Testing Create a twilio account copy ./test/integration_test_setup/.env.example to ./test/integration_test_setup/.env set ACCOUNT_SID, AUTH_TOKEN, SIGNING_KEY_SID, SIGNING_KEY_SECRET Run ./test/integration_test_setup/RunIntegrationTestLocal.sh this will create everything needed for running E2E tests and run the tests Contributing Bug 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.6.7 on 2023-03-29T06:54:49+00:00 using the DocStrap template. "},"Activity.html":{"id":"Activity.html","title":"Class: Activity","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorkerWorkspace 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 &lt;optional&gt; Returns: Rejected if the Worker's activity state could not be set Type Promise.&lt;this&gt; Type Definitions UpdateOptions Type: Object Properties: Name Type Argument Default Description rejectPendingReservations boolean &lt;optional&gt; false Represents whether all pending reservations should be rejected with the update to an unavailable Activity. × Search results Close Documentation generated by JSDoc 3.6.7 on 2023-03-29T06:54:49+00:00 using the DocStrap template. "},"Channel.html":{"id":"Channel.html","title":"Class: Channel","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorkerWorkspace 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.6.7 on 2023-03-29T06:54:49+00:00 using the DocStrap template. "},"IncomingTransfer.html":{"id":"IncomingTransfer.html","title":"Class: IncomingTransfer","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorkerWorkspace 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.6.7 on 2023-03-29T06:54:49+00:00 using the DocStrap template. "},"OutgoingTransfer.html":{"id":"OutgoingTransfer.html","title":"Class: OutgoingTransfer","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorkerWorkspace 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 &lt;async&gt; cancel() Cancel the ongoing OutgoingTransfer Returns: Rejected if the OutgoingTransfer state could not be updated to 'canceled' Type Promise.&lt;this&gt; 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.6.7 on 2023-03-29T06:54:49+00:00 using the DocStrap template. "},"Reservation.html":{"id":"Reservation.html","title":"Class: Reservation","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorkerWorkspace 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 version string The version of 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.&lt;this&gt; 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 &lt;optional&gt; Returns: Rejected if unable to issue Call instruction on the Reservation Type Promise.&lt;this&gt; complete() Complete the Reservation Returns: Rejected if unable to issue Complete instruction on the Reservation Type Promise.&lt;this&gt; conference( [options]) Conference the active Call tied to this Reservation to the Worker Parameters: Name Type Argument Description options Reservation.ConferenceOptions &lt;optional&gt; Returns: Rejected if unable to issue Conference instruction on the link Reservation Type Promise.&lt;this&gt; 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 &lt;optional&gt; Returns: Rejected if unable to issue Dequeue instruction on the Reservation Type Promise.&lt;this&gt; fetchLatestVersion() Fetch the last version of this Reservation Returns: Type Promise.&lt;Reservation&gt; 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 &lt;optional&gt; Returns: Rejected if unable to issue Redirect instruction on the Reservation Type Promise.&lt;this&gt; reject( [options]) Reject the Reservation Parameters: Name Type Argument Description options Reservation.RejectOptions &lt;optional&gt; Returns: Rejected if unable to issue Reject instruction on the Reservation Type Promise.&lt;this&gt; updateParticipant( [options]) Update the Worker's leg in the Conference associated to this Reservation Parameters: Name Type Argument Description options Reservation.ParticipantOptions &lt;optional&gt; Returns: Rejected if unable to update the Worker's leg in the Conference tied to the Reservation Type Promise.&lt;this&gt; wrap() Wrap the Reservation Returns: Rejected if unable to issue Wrap instruction on the Reservation Type Promise.&lt;this&gt; Type Definitions CallOptions Type: Object Properties: Name Type Argument Default Description accept boolean &lt;optional&gt; false Represents whether the Task should be accepted before initiating the call record string &lt;optional&gt; 'do-not-record' To record the call or not statusCallbackUrl string &lt;optional&gt; null A valid status status callback url to string &lt;optional&gt; 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 &lt;optional&gt; 60 The integer number of seconds Twilio should allow the phone associated to &quot;contact_uri&quot; to ring ConferenceOptions Type: Object Properties: Name Type Argument Default Description to string &lt;optional&gt; 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 &lt;optional&gt; null The caller id for the call to the Worker. Must be a verified Twilio number. timeout int &lt;optional&gt; 60 The integer number of seconds that Twilio should allow the call to ring before assuming there is no answer. statusCallback string &lt;optional&gt; null The URL endpoint to receive call status events of the Worker leg. statusCallbackMethod string &lt;optional&gt; 'POST' The HTTP method for the Status Callback URL. statusCallbackEvent string &lt;optional&gt; 'completed' A comma separated list of events to subscribe to. The possible list of events are: ['initiated', 'ringing', 'answered', 'completed']. record string &lt;optional&gt; 'do-not-record' Whether to record the Worker leg of the Conference. muted boolean &lt;optional&gt; false Whether the Worker leg of the Conference is muted. beep string | boolean &lt;optional&gt; true Whether the Worker leg should be when entering the Conference. The options for beep are: [true, false, 'onEnter', 'onExit']. startConferenceOnEnter boolean &lt;optional&gt; true Whether the Conference should start when the Worker leg enters. endConferenceOnExit boolean &lt;optional&gt; false Whether the Conference should end when the Worker leg exits. endConferenceOnCustomerExit boolean &lt;optional&gt; false Whether the Conference should end when the customer leg exits. beepOnCustomerEntrance boolean &lt;optional&gt; true Whether the Conference should beep when the customer leg enters. waitUrl string &lt;optional&gt; default Twilio hold music The URL endpoint to play when waiting for the Conference to begin. waitMethod string &lt;optional&gt; 'POST' The HTTP method for the Wait URL. earlyMedia boolean &lt;optional&gt; true Whether Twilio should feed early media to be played directly into a Conference. maxParticipants int &lt;optional&gt; 10 The number of max participants allowed in a Conference. conferenceStatusCallback string &lt;optional&gt; null The URL endpoint to receive Conference status events. conferenceStatusCallbackMethod string &lt;optional&gt; 'POST' The HTTP method for the Conference Status Callback URL. conferenceStatusCallbackEvent string &lt;optional&gt; '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 &lt;optional&gt; false Whether the entire Conference should be recorded. The possible options for conferenceRecord are: [true, false, 'record-from-start', 'do-not-record']. conferenceTrim string &lt;optional&gt; 'trim-silence' Whether to trim the Conference recording. The options for conferenceTrim are: ['trim-silence', 'do-not-trim']. recordingChannels string &lt;optional&gt; 'mono' Which channel of the Conference to record. The options are: ['mono', 'dual']. recordingStatusCallback string &lt;optional&gt; null The URL endpoint to receive recording status events. recordingStatusCallbackMethod string &lt;optional&gt; 'POST' The HTTP method for the Recording Status Callback URL. conferenceRecordingStatusCallback string &lt;optional&gt; null The URl endpoint to receive Conference events. conferenceRecordingStatusCallbackMethod string &lt;optional&gt; 'POST' The HTTP method of the Conference Recording Status Callback. region string &lt;optional&gt; null The specific region. The options for region are: ['us1', 'ie1', 'sg1', 'br1', 'au1', 'jp1']. sipAuthUsername string &lt;optional&gt; null The SIP auth username to use. sipAuthPassword string &lt;optional&gt; null The SIP auth password to use. DequeueOptions Type: Object Properties: Name Type Argument Default Description from string &lt;optional&gt; null The caller id for the call to the Worker. Must be a verified Twilio number. to string &lt;optional&gt; 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 &lt;optional&gt; null The activitySid to update the Worker to after dequeuing the Reservation. record string &lt;optional&gt; 'do-not-record' Defines which legs of the call should be recorded. timeout int &lt;optional&gt; 60 The integer number of seconds that Twilio should allow the call to ring before assuming there is no answer. statusCallbackUrl string &lt;optional&gt; null A URL that Twilio will send asynchronous webhook this._request. to on a completed call event. statusCallbackEvents string &lt;optional&gt; null A comma separated string of the events to subscribe to ParticipantOptions Type: Object Properties: Name Type Argument Default Description endConferenceOnExit boolean &lt;optional&gt; null Whether the Conference should end when this Worker participant leaves the Conference mute boolean &lt;optional&gt; null Mute or unmute this Worker participant beepOnExit boolean &lt;optional&gt; 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 &lt;optional&gt; 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.6.7 on 2023-03-29T06:54:49+00:00 using the DocStrap template. "},"Task.html":{"id":"Task.html","title":"Class: Task","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorkerWorkspace 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 version string The version of this 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.&lt;this&gt; fetchLatestVersion() Fetch the last version of this Task Returns: Type Promise.&lt;Task&gt; 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 &lt;optional&gt; 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.&lt;this&gt; 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.&lt;this&gt; 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 &lt;optional&gt; Returns: Type Promise.&lt;this&gt; updateParticipant( [options]) Update the Customer leg in the Conference associated to this Task Parameters: Name Type Argument Description options Task.ParticipantOptions &lt;optional&gt; Returns: Rejected if unable to update the Customers's leg in the Conference tied to the Task Type Promise.&lt;this&gt; 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.&lt;this&gt; Type Definitions HoldOptions Type: Object Properties: Name Type Argument Default Description holdUrl string &lt;optional&gt; default Twilio hold music The URL endpoint to play when participant is on hold. holdMethod string &lt;optional&gt; 'GET' The HTTP method for the hold URL. ParticipantOptions Type: Object Properties: Name Type Argument Default Description hold boolean &lt;optional&gt; null Whether to hold the customer leg of the Conference referenced by the Task holdUrl string &lt;optional&gt; default Twilio hold music The URL endpoint to play when participant is on hold. holdMethod string &lt;optional&gt; 'GET' The HTTP method for the hold URL. TransferOptions Type: Object Properties: Name Type Argument Default Description attributes Object &lt;optional&gt; Updated attributes for the task mode string &lt;optional&gt; 'WARM' 'WARM' or 'COLD' priority number &lt;optional&gt; Updated priority for the task WrappingOptions Type: Object Properties: Name Type Argument Default Description reason string &lt;optional&gt; 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.6.7 on 2023-03-29T06:54:49+00:00 using the DocStrap template. "},"TaskQueue.html":{"id":"TaskQueue.html","title":"Class: TaskQueue","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorkerWorkspace 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 queueSid 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 queueName 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.6.7 on 2023-03-29T06:54:49+00:00 using the DocStrap template. "},"Transfers.html":{"id":"Transfers.html","title":"Class: Transfers","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorkerWorkspace 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.6.7 on 2023-03-29T06:54:49+00:00 using the DocStrap template. "},"Worker.html":{"id":"Worker.html","title":"Class: Worker","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorkerWorkspace 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 &lt;optional&gt; Properties: Name Type Description accountSid string The sid of the Twilio account activities Map.&lt;string, Activity&gt; The list of possible states a Worker can be activity Activity The current Activity of the Worker activitySid string The sid of the Activity the Worker is currently in activityName string The current Activity name the Worker is currently in attributes Object A JSON representation of the Worker's attributes available boolean Whether or not the Worker is available to take on Tasks channels Map.&lt;string, Channel&gt; 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.&lt;string, Reservation&gt; 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 workerSid string The sid of the Worker, duplicates sid field for backwards compatibility workerActivitySid string The sid of the Activity the Worker is currently in, duplicates activitySid field for backwards compatibility dateActivityChanged Date The date when the Worker's state was last changed, duplicates dateStatusChanged field for backwards compatibility friendlyName string The friendly name of the Worker, duplicates name field for backwards compatibility version string The version of 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 &quot;outbound_to&quot; from string The contact uri of the Worker. Stored in the Task's attributes as &quot;from&quot; 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 &lt;optional&gt; Returns: Rejected if unable to create a Task on behalf of the Worker. Returns the TaskSid of the created Task. Type Promise.&lt;String&gt; disconnect() Gracefully disconnect the client. Returns: Type void fetchLatestVersion() Fetch the last version of this Worker Returns: Type Promise.&lt;Worker&gt; 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.&lt;this&gt; 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 &lt;optional&gt; '' The Activity state of the Worker upon connect closeExistingSessions boolean &lt;optional&gt; false Whether other open sessions of this Worker should be terminated logLevel string &lt;optional&gt; 'error' The level of logging to enable ['error', 'warn', 'info', 'debug', 'trace', 'silent'] region string the realm for connections (ex. &quot;stage-us1&quot;) edge string the ingress for connections (ex. &quot;sydney&quot;) TaskOptions Type: Object Properties: Name Type Argument Default Description attributes object &lt;optional&gt; null Additional attributes for the Task taskChannelUniqueName string &lt;optional&gt; null The friendly name of the Channel this Task belongs to. If not provided, defaults to 'default' channel. taskChannelSid string &lt;optional&gt; 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.6.7 on 2023-03-29T06:54:49+00:00 using the DocStrap template. "},"Workspace.html":{"id":"Workspace.html","title":"Class: Workspace","body":" Documentation Classes ActivityChannelIncomingTransferOutgoingTransferReservationTaskTaskQueueTransfersWorkerWorkspace 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: Workspace Workspace Create a Workspace client representing a TaskRouter Workspace new Workspace(jwt [, options], workspaceSid) Parameters: Name Type Argument Description jwt string The string token options Workspace.Options &lt;optional&gt; workspaceSid string Sid of this Workspace, has to be provided if JWE token is passed Throws: Exception if workspaceSid is not passed with JWE token Methods fetchTaskQueue(queueSid) Fetch task queue of this Workspace by given sid Parameters: Name Type Description queueSid string the sid of the task queue to fetch Returns: A task queue with given sid Type Promise.&lt;TaskQueue&gt; fetchTaskQueues( [options]) Fetch task queues of this Workspace Parameters: Name Type Argument Description options Workspace.FetchTaskQueuesParams &lt;optional&gt; Returns: A map with the task queues Type Promise.&lt;Map.&lt;string, TaskQueue&gt;&gt; fetchWorker(workerSid) Fetch worker of this Workspace by given sid Parameters: Name Type Description workerSid string the sid of the worker to fetch Returns: A worker with given sid Type Promise.&lt;Worker&gt; fetchWorkers( [options]) Fetch workers of this Workspace Parameters: Name Type Argument Description options Workspace.FetchWorkersParams &lt;optional&gt; Returns: A map with the workers Type Promise.&lt;Map.&lt;string, Worker&gt;&gt; updateToken(newToken) Update token Parameters: Name Type Description newToken string The new token that should be used for authentication Returns: throws error if unable to update token Type void Type Definitions FetchTaskQueuesParams Type: Object Properties: Name Type Argument Default Description AfterSid string &lt;optional&gt; null FriendlyName string &lt;optional&gt; null Ordering string &lt;optional&gt; null FetchWorkersParams Type: Object Properties: Name Type Argument Default Description AfterSid string &lt;optional&gt; null FriendlyName string &lt;optional&gt; null ActivitySid string &lt;optional&gt; null ActivityName string &lt;optional&gt; null Ordering string &lt;optional&gt; null TargetWorkersExpression string &lt;optional&gt; null maxWorkers number &lt;optional&gt; null Options Type: Object Properties: Name Type Argument Default Description region string the realm for connections (ex. &quot;stage-us1&quot;) edge string the ingress for connections (ex. &quot;sydney&quot;) pageSize string The number of items returned in each request logLevel string &lt;optional&gt; 'error' The level of logging to enable ['error', 'warn', 'info', 'debug', 'trace', 'silent'] × Search results Close Documentation generated by JSDoc 3.6.7 on 2023-03-29T06:54:49+00:00 using the DocStrap template. "}}
10
10
  </script>
11
11
 
12
12
  <script type="text/javascript">