Skip to content

Commit

Permalink
Add enum (#2)
Browse files Browse the repository at this point in the history
Add connect.ReferenceType enum
  • Loading branch information
scoland authored Dec 7, 2020
1 parent be367c0 commit 9e6c362
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ agent.createTask(newTask, {

```

## Enumerations

### `connect.ReferenceType`
This enumeration lists the different reference types for a task. Currently there is only one reference type, URL.

* `ReferenceType.URL`: A URL reference.

## Security

See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
Expand Down
2 changes: 1 addition & 1 deletion dist/amazon-connect-task.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "amazon-connect-taskjs",
"version": "1.0.0",
"version": "1.1.0",
"author": "Amazon Web Services",
"license": "Apache-2.0",
"description": "Provides task support to AmazonConnect customers",
Expand Down
6 changes: 5 additions & 1 deletion src/core/agentApis.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
const ReferenceType = connect.makeEnum([
'URL'
]);

const createTask = function(taskContact, callbacks) {
connect.assertNotNull(taskContact, 'Task contact object');
connect.assertNotNull(taskContact.name, 'Task name');
Expand All @@ -11,4 +15,4 @@ const createTask = function(taskContact, callbacks) {
client.call(connect.ClientMethods.CREATE_TASK_CONTACT, taskContact, callbacks);
};

export { createTask };
export { createTask, ReferenceType };
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { TaskSessionObject } from './core/taskSession';
import { createTask } from './core/agentApis';
import { createTask, ReferenceType } from './core/agentApis';

global.connect = global.connect || {};
connect.TaskSession = TaskSessionObject;

if (!connect.Agent.prototype.createTask) connect.Agent.prototype.createTask = createTask;

connect.ReferenceType = ReferenceType;

export const TaskSession = TaskSessionObject;

0 comments on commit 9e6c362

Please sign in to comment.