Skip to content

Commit 7a371b1

Browse files
authored
Merge pull request #545 from Cornel777/feature/voiceHandover-dataAugmentation
8x8 Feature Voice handover Node and Data Augmentation Node
2 parents ef1e57a + d5e99fc commit 7a371b1

File tree

66 files changed

+2017
-242
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+2017
-242
lines changed

extensions/8x8/README.md

+52-14
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
## Introduction
44
This Extension integrates with the 8x8 Statistics, CRM and Schedule API's.
55

6+
7+
## Upload extension to cognigy platform
8+
9+
1. Run `npm run publish:local` to generate a new tar.gz archive in the target folder.
10+
2. Go to the Cognigy Platform > Manage Section > Extensions.
11+
3. Click on the big blue `+ Upload extension` button and select the zip file from the target folder.
12+
613
## Connections
714

815
**8x8 Connection**
@@ -13,19 +20,16 @@ To use the 8x8 extension, you need to create a connection. To do so, follow thes
1320

1421
| Field | Description |
1522
| ------------------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
16-
| crmApiUsername | The username for 8x8's CRM API access. Check [Configure External CRM API access](https://docs.8x8.com/8x8WebHelp/VCC/configuration-manager-General/content/integrationcrmapitab.htm) for more information. |
17-
| crmApiPassword | The password for 8x8's CRM API access. Check [Configure External CRM API access](https://docs.8x8.com/8x8WebHelp/VCC/configuration-manager-General/content/integrationcrmapitab.htm) for more information.|
23+
| apiKey | The apiKey for 8x8's apps API access. Will be configured for the desired apps in Admin Console from an Admin's SSO panel. Contact Center Schedule, Contact Center Native CRM, Contact Center Chat Gateway and Analytics for Contact Center apps are needed for current nodes. |
1824
| tenantId | The tenant ID for 8x8's Contact Center API access. Check [Generate authentication tokens for 8x8 Contact Center APIs](https://docs.8x8.com/8x8WebHelp/VCC/configuration-manager-General/content/integrationapitokentab.htm) for more information. |
19-
| dataRequestToken | The data request token for 8x8's Contact Center API's limited to querying the data. Check [Generate authentication tokens for 8x8 Contact Center APIs](https://docs.8x8.com/8x8WebHelp/VCC/configuration-manager-General/content/integrationapitokentab.htm) for more information. |
20-
| actionRequestToken | The action request token for 8x8's Contact Center API's that permit triggering of actions. [Check Generate authentication tokens for 8x8 Contact Center APIs](https://docs.8x8.com/8x8WebHelp/VCC/configuration-manager-General/content/integrationapitokentab.htm) for more information. |
21-
| clusterBaseUrl | The cluster base URL from the Agent Workspace or CM instance (e.g. https://vcc-eu3.8x8.com). |
25+
| baseUrl | The base URL from the Agent Workspace or CM instance (https://api.8x8.com). |
2226

2327

2428
## Node: Get Customer
2529

2630
The node allows you to collect customer information and match it with the native CRM. To use this node, you need to create an 8x8 CRM connection (refer to the Connections section for more information).
2731

28-
The node will look up one ore more of the following case details:
32+
The node will look up the following case details:
2933
* First Name
3034
* Last name
3135
* Email
@@ -47,7 +51,7 @@ After the node configuration is completed, it will have two exit points:
4751

4852
This node allows you to collect customer information and match it with the native CRM case.
4953

50-
The node will look up one ore more of the following case details:
54+
The node will look up the following case details:
5155
- Case Number
5256
- Account Number
5357
- Last name of customer
@@ -71,7 +75,7 @@ After the node configuration is completed, it will have two exit points:
7175
This node allows you to check the condition of a queue before entering a queue. It provides a set of conditions
7276
which when met, will trigger specific actions. The node gives the flow much more routing flexibility by allowing testing queue status repeatedly.
7377

74-
1. 8x8 CRM Connection - Steps for creating a connection are located inside the Connections section
78+
1. 8x8 Simple Connection - Steps for creating a connection are located inside the Connections section
7579
2. Select the queue - The dropdown will display the available queues for which you can test the conditions
7680
3. There are NO agents - The following options are presented when you enable the condition:
7781
* Available
@@ -92,20 +96,54 @@ After the node configuration is completed, test Queue will have two exit points:
9296

9397
## Node: Schedule
9498

95-
This node allows you to check the state of the Contact Center schedule and route interactions accordingly.
99+
This node allows you to check the state of the Contact Center schedule and route interactions accordingly.
96100

97101
### Setup Steps:
98102

99-
1. 8x8 CRM Connection: The steps to create a connection can be found in the Connections section.
100-
2. Select the schedule: The dropdown will show the available schedules.
103+
1. 8x8 Simple Connection: The steps to create a connection can be found in the Connections section.
104+
2. Select the schedule: The dropdown will show the available schedules.
101105

102106
### Exit Points:
103107

104108
Once the node configuration is completed, it will have 8 exit points:
105-
1. Schedule open: Contact Center is Open.
106-
2. Schedule closed: Contact Center is Closed.
107-
3. Choice 1 to Choice 6 Schedule: Six additional options that provide more refined choices other than Open or Closed for the day.
109+
1. Schedule open: Contact Center is Open.
110+
2. Schedule closed: Contact Center is Closed.
111+
3. Choice 1 to Choice 6 Schedule: Six additional options that provide more refined choices other than Open or Closed for the day.
112+
113+
114+
## Node: Voice Handover
115+
116+
This node allows you to transfer a voice interaction from inside the flow to an 8x8 VCC queue. Once reached inside the flow the node will attempt the transfer to the queue and call Id configured.
117+
118+
### Important requirement:
119+
120+
The customer has the sole responsability to obtain and store to context for later usage the call Id beforehand and firstly during the flow execution. This will be available inside {{input.data.payload.sip.headers["X-8x8-CID"]}}.Other properties will be available on the headers object.
121+
122+
### Setup Steps:
123+
124+
1. 8x8 Simple Connection - Steps for creating a connection are located inside the Connections section
125+
2. Handover Initiated message input - a message that will be uttered during the call when voice handover node has began execution
126+
3. Queue Id - id of a desired queue existing on the tenant id configured inside the connection
127+
4. 8x8 JSON Properties - configure the payload for the request here. Default obligatory value set as default. Values can be changed as required whilst preserving the structure and new additionalProperties objects can be added as needed.
128+
129+
### Exit Points:
130+
No child nodes needed or configured for this. Failure will result in missed handover and the error message logged in Logs.
131+
132+
## Node: Data Augmentation
108133

134+
This node allows you to enrich/augment the additionalProperties sent and displayed to the agent upon voice interaction being served inside AW.
109135

136+
### Important requirement:
110137

138+
The customer has the sole responsability to obtain and store to context for later usage the call Id beforehand and firstly during the flow execution. This will be available inside {{input.data.payload.sip.headers["X-8x8-CID"]}}.Other properties will be available on the headers object.
111139

140+
### Setup Steps:
141+
142+
1. 8x8 Simple Connection - Steps for creating a connection are located inside the Connections section
143+
2. Queue Id - id of a desired queue existing on the tenant id configured inside the connection
144+
3. Use JSON Fields to configure payload - toggle that will switch between 5 sections with label/value input pairs for quick configuration or 8x8 Data Augmentation JSON properties JOSN input for complete control of the payload.
145+
4. 8x8 Data Augmentation JSON properties - configure the payload for the request here. Default model valid value set as default. Values can be changed as required whilst preserving the structure and new objects can be added as needed.
146+
More info on the enpoint [8x8 Contact Center Data Augmentation API](https://support.8x8.com/contact-center/8x8-contact-center/developers/8x8_Contact_Center_Data_Augmentation_API)
147+
148+
### Exit Points:
149+
No child nodes needed or configured for this. Failure will result in missed transmission and the error message logged in Logs.

extensions/8x8/package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/8x8/package.json

+11-15
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
11
{
2-
"name": "8x8",
3-
"version": "4.0.0",
2+
"name": "8x8-cognigy-extension",
3+
"version": "5.0.0",
44
"description": "Integrates with 8x8",
55
"main": "build/module.js",
66
"scripts": {
7-
"transpile": "tsc -p .",
8-
"lint": "eslint src/** --fix",
9-
"zip": "tar cfz 8x8.tar.gz build/* package.json package-lock.json README.md icon.png",
10-
"build": "npm run transpile && npm run lint && npm run zip"
11-
},
7+
"publish:local": "node --experimental-json-modules scripts/publish-local.mjs",
8+
"build": "tsc -p .",
9+
"clean": "rm -rf build",
10+
"lint": "eslint src/** --fix",
11+
"test": "jest --coverage",
12+
"test:dev": "jest --watchAll --coverage"
13+
},
1214
"keywords": [
13-
"8x8 Contact Center",
14-
"CRM",
15-
"Statistics",
16-
"Schedule"
15+
"8x8 Contact Center", "CRM", "Statistics", "Schedule"
1716
],
18-
"repository": {
19-
"type": "git",
20-
"url": "https://github.com/Cognigy/Extensions"
21-
},
17+
"repository": "https://github.com/8x8/vcc-cognigy-extension",
2218
"author": "8x8",
2319
"license": "MIT",
2420
"devDependencies": {

extensions/8x8/src/connections/8x8Connection.test.ts

-7
This file was deleted.

extensions/8x8/src/connections/8x8Connection.ts

-23
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { simpleConnection } from './8x8SimpleConnection';
2+
3+
describe('8x8SimpleConnection', () => {
4+
it('should match snapshot', () => {
5+
expect(simpleConnection).toMatchSnapshot();
6+
});
7+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import type { IConnectionSchema } from '@cognigy/extension-tools';
2+
3+
export const simpleConnection: IConnectionSchema = {
4+
type: 'eightbyeightsimple',
5+
label: '8x8',
6+
fields: [
7+
{ fieldName: 'apiKey' },
8+
{ fieldName: 'baseUrl' },
9+
{ fieldName: 'tenantId' }
10+
]
11+
};
12+
13+
export interface I8x8SimpleConnection {
14+
apiKey: string
15+
baseUrl: string
16+
tenantId: string
17+
}

extensions/8x8/src/connections/__snapshots__/8x8Connection.test.ts.snap

-28
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`8x8SimpleConnection should match snapshot 1`] = `
4+
{
5+
"fields": [
6+
{
7+
"fieldName": "apiKey",
8+
},
9+
{
10+
"fieldName": "baseUrl",
11+
},
12+
{
13+
"fieldName": "tenantId",
14+
},
15+
],
16+
"label": "8x8",
17+
"type": "eightbyeightsimple",
18+
}
19+
`;

extensions/8x8/src/module.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
import { createExtension } from '@cognigy/extension-tools';
2-
import { connection } from './connections/8x8Connection';
2+
import { simpleConnection } from './connections/8x8SimpleConnection';
33
import { getCustomerNodes } from './nodes/customer';
44
import { getScheduleNodes } from './nodes/schedule';
55
import { getTestConditionOfQueueNode } from './nodes/testConditionOfQueue';
66
import { getCaseNodes } from './nodes/case';
7+
import { getVoiceHandoverNode } from './nodes/voiceHandover';
8+
import { getDataAugmentationNode } from './nodes/dataAugmentation';
79

810
export default createExtension({
911
nodes: [
1012
...getCustomerNodes(),
1113
...getScheduleNodes(),
1214
...getTestConditionOfQueueNode(),
13-
...getCaseNodes()
15+
...getCaseNodes(),
16+
...getVoiceHandoverNode(),
17+
...getDataAugmentationNode()
1418
],
1519
connections: [
16-
connection
20+
simpleConnection
1721
],
1822
options: {
1923
label: '8x8'

extensions/8x8/src/nodes/case/__snapshots__/index.test.ts.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ exports[`customer > getCaseNodes should create the nodes for case logic 1`] = `
3838
"fields": [
3939
{
4040
"key": "connection",
41-
"label": "8x8 CRM Connection",
41+
"label": "8x8 Connection",
4242
"params": {
43-
"connectionType": "eightbyeight",
43+
"connectionType": "eightbyeightsimple",
4444
"required": true,
4545
},
4646
"type": "connection",

extensions/8x8/src/nodes/case/api/fetchCaseData.test.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ const mockAxios = axios as unknown as jest.Mock;
1010
describe('case > api > fetchCustomerData()', () => {
1111
const getMockParams = (): FetchCaseDataParams => ({
1212
filterXml: '<CASENUM>123123123</CASENUM>',
13-
crmApiPassword: 'test-pass',
13+
apiKey: 'hgs43v35y4h',
1414
tenantId: 'test-tenant',
15-
clusterBaseUrl: 'https://8x8.com',
16-
crmApiUsername: 'user'
15+
baseUrl: 'https://8x8.com'
1716
});
1817

1918
it('should fetch and convert xml to json', async() => {

extensions/8x8/src/nodes/case/api/fetchCaseData.ts

+9-14
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,23 @@ import type { CaseData } from '../types';
33
import mapCaseDataXMLToJson from './utils/mapCaseDataXMLToJson';
44

55
export interface FetchCaseDataParams {
6+
apiKey: string
67
tenantId: string
7-
crmApiUsername: string
8-
crmApiPassword: string
9-
clusterBaseUrl: string
8+
baseUrl: string
109
filterXml: string
1110
}
1211

13-
const fetchCaseData = async({ filterXml, crmApiPassword, tenantId, crmApiUsername, clusterBaseUrl }: FetchCaseDataParams): Promise<CaseData[]> => {
12+
const fetchCaseData = async({ filterXml, apiKey, tenantId, baseUrl }: FetchCaseDataParams): Promise<CaseData[]> => {
1413
const response = await axios({
1514
method: 'POST',
16-
url: `${clusterBaseUrl}/WAPI/wapi.php`,
17-
data: `xml_query=
18-
<WAPI>
19-
<TENANT>${tenantId}</TENANT>
20-
<USERNAME>${crmApiUsername}</USERNAME>
21-
<PASSWORD>${crmApiPassword}</PASSWORD>
22-
<COMMAND OBJECT="Case" ACTION="GET">
15+
url: `${baseUrl}/cc/v1/wapi`,
16+
data: ` <COMMAND OBJECT="Case" ACTION="GET">
2317
${filterXml}
24-
</COMMAND>
25-
</WAPI>`,
18+
</COMMAND>`,
2619
headers: {
27-
'Content-Type': 'application/x-www-form-urlencoded'
20+
'Content-Type': 'application/xml',
21+
'X-8x8-Tenant': tenantId,
22+
'x-api-key': apiKey
2823
}
2924
});
3025
return mapCaseDataXMLToJson(response.data);

extensions/8x8/src/nodes/case/getCase.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ export const getCaseNode = createNodeDescriptor({
6363
fields: [
6464
{
6565
key: 'connection',
66-
label: '8x8 CRM Connection',
66+
label: '8x8 Connection',
6767
type: 'connection',
6868
params: {
69-
connectionType: 'eightbyeight',
69+
connectionType: 'eightbyeightsimple',
7070
required: true
7171
}
7272
},

0 commit comments

Comments
 (0)