Skip to content

Commit

Permalink
2.0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
flexrouting+ci committed Aug 24, 2024
1 parent b796dc9 commit 5aa56b0
Show file tree
Hide file tree
Showing 60 changed files with 168,173 additions and 1 deletion.
1,251 changes: 1,251 additions & 0 deletions dist/docs/Activity.html

Large diffs are not rendered by default.

1,826 changes: 1,826 additions & 0 deletions dist/docs/Channel.html

Large diffs are not rendered by default.

735 changes: 735 additions & 0 deletions dist/docs/IncomingTransfer.html

Large diffs are not rendered by default.

1,435 changes: 1,435 additions & 0 deletions dist/docs/OutgoingTransfer.html

Large diffs are not rendered by default.

4,023 changes: 4,023 additions & 0 deletions dist/docs/Reservation.html

Large diffs are not rendered by default.

4,845 changes: 4,845 additions & 0 deletions dist/docs/Supervisor.html

Large diffs are not rendered by default.

4,894 changes: 4,894 additions & 0 deletions dist/docs/Task.html

Large diffs are not rendered by default.

1,729 changes: 1,729 additions & 0 deletions dist/docs/TaskQueue.html

Large diffs are not rendered by default.

841 changes: 841 additions & 0 deletions dist/docs/Transfers.html

Large diffs are not rendered by default.

4,243 changes: 4,243 additions & 0 deletions dist/docs/Worker.html

Large diffs are not rendered by default.

1,325 changes: 1,325 additions & 0 deletions dist/docs/Workspace.html

Large diffs are not rendered by default.

5,440 changes: 5,440 additions & 0 deletions dist/docs/classes.list.html

Large diffs are not rendered by default.

Binary file added dist/docs/fonts/glyphicons-halflings-regular.eot
Binary file not shown.
288 changes: 288 additions & 0 deletions dist/docs/fonts/glyphicons-halflings-regular.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/docs/fonts/glyphicons-halflings-regular.ttf
Binary file not shown.
Binary file added dist/docs/fonts/glyphicons-halflings-regular.woff
Binary file not shown.
Binary file not shown.
4,997 changes: 4,997 additions & 0 deletions dist/docs/global.html

Large diffs are not rendered by default.

Binary file added dist/docs/img/glyphicons-halflings-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/docs/img/glyphicons-halflings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
349 changes: 349 additions & 0 deletions dist/docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,349 @@
<!DOCTYPE html><html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Documentation Index</title>

<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">

<link type="text/css" rel="stylesheet" href="styles/site.simplex.css">

</head>

<body>

<div class="navbar navbar-default navbar-fixed-top ">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="index.html">Documentation</a>
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="navbar-collapse collapse" id="topNavigation">
<ul class="nav navbar-nav">

<li class="dropdown">
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li><a href="Activity.html">Activity</a></li><li><a href="Channel.html">Channel</a></li><li><a href="IncomingTransfer.html">IncomingTransfer</a></li><li><a href="OutgoingTransfer.html">OutgoingTransfer</a></li><li><a href="Reservation.html">Reservation</a></li><li><a href="Supervisor.html">Supervisor</a></li><li><a href="Task.html">Task</a></li><li><a href="TaskQueue.html">TaskQueue</a></li><li><a href="Transfers.html">Transfers</a></li><li><a href="Worker.html">Worker</a></li><li><a href="Workspace.html">Workspace</a></li>
</ul>
</li>

<li class="dropdown">
<a href="events.list.html" class="dropdown-toggle" data-toggle="dropdown">Events<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li><a href="Channel.html#event:availabilityUpdated">Channel#event:availabilityUpdated</a></li><li><a href="Channel.html#event:capacityUpdated">Channel#event:capacityUpdated</a></li><li><a href="OutgoingTransfer.html#event:attemptFailed">OutgoingTransfer#event:attemptFailed</a></li><li><a href="OutgoingTransfer.html#event:canceled">OutgoingTransfer#event:canceled</a></li><li><a href="OutgoingTransfer.html#event:completed">OutgoingTransfer#event:completed</a></li><li><a href="OutgoingTransfer.html#event:failed">OutgoingTransfer#event:failed</a></li><li><a href="Reservation.html#event:accepted">Reservation#event:accepted</a></li><li><a href="Reservation.html#event:canceled">Reservation#event:canceled</a></li><li><a href="Reservation.html#event:completed">Reservation#event:completed</a></li><li><a href="Reservation.html#event:rejected">Reservation#event:rejected</a></li><li><a href="Reservation.html#event:rescinded">Reservation#event:rescinded</a></li><li><a href="Reservation.html#event:timeout">Reservation#event:timeout</a></li><li><a href="Reservation.html#event:wrapup">Reservation#event:wrapup</a></li><li><a href="Supervisor.html#event:activityUpdated">Supervisor#event:activityUpdated</a></li><li><a href="Supervisor.html#event:attributesUpdated">Supervisor#event:attributesUpdated</a></li><li><a href="Supervisor.html#event:disconnected">Supervisor#event:disconnected</a></li><li><a href="Supervisor.html#event:error">Supervisor#event:error</a></li><li><a href="Supervisor.html#event:monitor">Supervisor#event:monitor</a></li><li><a href="Supervisor.html#event:ready">Supervisor#event:ready</a></li><li><a href="Supervisor.html#event:reservationCreated">Supervisor#event:reservationCreated</a></li><li><a href="Supervisor.html#event:reservationFailed">Supervisor#event:reservationFailed</a></li><li><a href="Supervisor.html#event:tokenExpired">Supervisor#event:tokenExpired</a></li><li><a href="Supervisor.html#event:tokenUpdated">Supervisor#event:tokenUpdated</a></li><li><a href="Task.html#event:canceled">Task#event:canceled</a></li><li><a href="Task.html#event:completed">Task#event:completed</a></li><li><a href="Task.html#event:transferAttemptFailed">Task#event:transferAttemptFailed</a></li><li><a href="Task.html#event:transferCanceled">Task#event:transferCanceled</a></li><li><a href="Task.html#event:transferCompleted">Task#event:transferCompleted</a></li><li><a href="Task.html#event:transferFailed">Task#event:transferFailed</a></li><li><a href="Task.html#event:transferInitiated">Task#event:transferInitiated</a></li><li><a href="Task.html#event:updated">Task#event:updated</a></li><li><a href="Task.html#event:wrapup">Task#event:wrapup</a></li><li><a href="Worker.html#event:activityUpdated">Worker#event:activityUpdated</a></li><li><a href="Worker.html#event:attributesUpdated">Worker#event:attributesUpdated</a></li><li><a href="Worker.html#event:disconnected">Worker#event:disconnected</a></li><li><a href="Worker.html#event:error">Worker#event:error</a></li><li><a href="Worker.html#event:ready">Worker#event:ready</a></li><li><a href="Worker.html#event:reservationCreated">Worker#event:reservationCreated</a></li><li><a href="Worker.html#event:reservationFailed">Worker#event:reservationFailed</a></li><li><a href="Worker.html#event:tokenExpired">Worker#event:tokenExpired</a></li><li><a href="Worker.html#event:tokenUpdated">Worker#event:tokenUpdated</a></li>
</ul>
</li>

<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li><a href="global.html">Global</a></li>
</ul>
</li>

</ul>

<div class="col-sm-3 col-md-3">
<form class="navbar-form" role="search">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search" name="q" id="search-input">
<div class="input-group-btn">
<button class="btn btn-default" id="search-submit"><i class="glyphicon glyphicon-search"></i></button>
</div>
</div>
</form>
</div>

</div>

</div>
</div>


<div class="container" id="toc-content">
<div class="row">


<div class="col-md-8">

<div id="main">






















<section class="readme-section">
<article><p><a href="https://github.com/twilio/twilio-taskrouter.js/actions/workflows/build.yml"><img src="https://github.com/twilio/twilio-taskrouter.js/actions/workflows/build.yml/badge.svg" alt="build"></a>
<a href="https://github.com/twilio/twilio-taskrouter.js/actions/workflows/release.yml"><img src="https://github.com/twilio/twilio-taskrouter.js/actions/workflows/release.yml/badge.svg" alt="Release"></a>
<a href="https://badge.fury.io/js/twilio-taskrouter"><img src="https://badge.fury.io/js/twilio-taskrouter.svg" alt="npm version"></a></p>
<h1>twilio-taskrouter.js</h1>
<p><a href="https://badge.fury.io/js/twilio-taskrouter"><img src="https://badge.fury.io/js/twilio-taskrouter.svg" alt="npm version"></a></p>
<p>TaskRouter is Twilio's skills based routing system. With this library, you can manage your Workers in the browser or view the state of your Workspace.</p>
<p>This version of TaskRouter SDK can be used with Twilio Flex and TaskRouter standalone instances.</p>
<h2>Installation</h2>
<h3>NPM</h3>
<pre class="prettyprint source"><code>npm install twilio-taskrouter
</code></pre>
<h2>Usage</h2>
<p>The following is a simple example showing a Worker waiting for Reservations.
For more information, refer to the
<a href="//twilio.github.io/twilio-taskrouter.js/index.html">API Docs</a>.</p>
<pre class="prettyprint source lang-js"><code>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();
}
</code></pre>
<h2>Changelog</h2>
<p>See <a href="https://github.com/twilio/twilio-taskrouter.js/blob/main/CHANGELOG.md">CHANGELOG.md</a>.</p>
<h2>License</h2>
<p>See <a href="https://github.com/twilio/twilio-taskrouter.js/blob/main/LICENSE.md">LICENSE.md</a>.</p>
<h2>Building</h2>
<p>Fork and clone the repository. Use npm to install node 8 (other versions may run into problems).</p>
<p>Then, install dependencies with:</p>
<pre class="prettyprint source"><code>yarn install
</code></pre>
<p>Then run the <code>build</code> script:</p>
<pre class="prettyprint source"><code>yarn build
</code></pre>
<p>The builds and docs will be placed in the <code>dist/</code> directory.</p>
<p>Before commits, be sure to validate by running:</p>
<pre class="prettyprint source"><code>make lint
</code></pre>
<h2>Testing</h2>
<ul>
<li>Create a twilio account</li>
<li>copy ./test/integration_test_setup/.env.example to ./test/integration_test_setup/.env</li>
<li>set ACCOUNT_SID, AUTH_TOKEN, SIGNING_KEY_SID, SIGNING_KEY_SECRET</li>
<li>Run ./test/integration_test_setup/RunIntegrationTestLocal.sh this will create everything needed for running E2E tests and run the tests</li>
</ul>
<h2>Test with Sample App</h2>
<ul>
<li>See <a href="sample-app/README.md">README.md</a></li>
</ul>
<h2>Contributing</h2>
<p>Bug fixes welcome! If you're not familiar with the GitHub pull
request/contribution process, <a href="https://gun.io/blog/how-to-github-fork-branch-and-pull-request/">this is a nice tutorial</a>.</p></article>
</section>







</div>
</div>

<div class="clearfix"></div>


<div class="col-md-3">
<div id="toc" class="col-md-3 hidden-xs hidden-sm hidden-md"></div>
</div>


</div>
</div>


<div class="modal fade" id="searchResults">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Search results</h4>
</div>
<div class="modal-body"></div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>


<footer>


<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a>

on 2024-08-24T14:56:30+00:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
</footer>

<script src="scripts/docstrap.lib.js"></script>
<script src="scripts/toc.js"></script>

<script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>


<script>
$( function () {
$( "[id*='$']" ).each( function () {
var $this = $( this );

$this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
} );

$( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
var $this = $( this );

var example = $this.find( "code" );
exampleText = example.html();
var lang = /{@lang (.*?)}/.exec( exampleText );
if ( lang && lang[1] ) {
exampleText = exampleText.replace( lang[0], "" );
example.html( exampleText );
lang = lang[1];
} else {
var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
lang = langClassMatch ? langClassMatch[1] : "javascript";
}

if ( lang ) {

$this
.addClass( "sunlight-highlight-" + lang )
.addClass( "linenums" )
.html( example.html() );

}
} );

Sunlight.highlightAll( {
lineNumbers : false,
showMenu : true,
enableDoclinks : true
} );

$.catchAnchorLinks( {
navbarOffset: 10
} );
$( "#toc" ).toc( {
anchorName : function ( i, heading, prefix ) {
return $( heading ).attr( "id" ) || ( prefix + i );
},
selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
showAndHide : false,
smoothScrolling: true
} );

$( "#main span[id^='toc']" ).addClass( "toc-shim" );
$( '.dropdown-toggle' ).dropdown();

$( "table" ).each( function () {
var $this = $( this );
$this.addClass('table');
} );

} );
</script>



<!--Navigation and Symbol Display-->


<!--Google Analytics-->



<script type="text/javascript">
$(document).ready(function() {
SearcherDisplay.init();
});
</script>



</body></html>
31 changes: 31 additions & 0 deletions dist/docs/quicksearch.html

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions dist/docs/scripts/docstrap.lib.js

Large diffs are not rendered by default.

Loading

0 comments on commit 5aa56b0

Please sign in to comment.