-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Roger Urscheler
committed
Dec 7, 2017
1 parent
ef3a6b9
commit 717502a
Showing
1,049 changed files
with
301,294 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
// Use IntelliSense to learn about possible Node.js debug attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Launch Program", | ||
"program": "${workspaceRoot}/server.js", | ||
"protocol": "inspector" | ||
}, | ||
{ | ||
"type": "node", | ||
"request": "attach", | ||
"name": "Attach to Process", | ||
"address": "localhost", | ||
"port": 5858 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,12 @@ | ||
# customer-support2 | ||
# customer-support | ||
|
||
## Future enhancements | ||
* Add topic dropdown in form with predefined topics in config | ||
* Allow customer to upload files/images and post them to conversation | ||
* Set conversation avatar (missing in SDK) | ||
* Set a 'complaints' label on conversation | ||
|
||
## Run | ||
```bash | ||
npm start | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
Copyright (c) 2017 Unify Inc. | ||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the "Software"), | ||
to deal in the Software without restriction, including without limitation | ||
the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
and/or sell copies of the Software, and to permit persons to whom the Software | ||
is furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE | ||
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
/* jslint node: true */ | ||
'use strict'; | ||
|
||
const Circuit = require('circuit-sdk'); | ||
const config = require('./config.json'); | ||
|
||
let client; | ||
let emitter; | ||
|
||
//Circuit.setLogger(console); | ||
//Circuit.logger.setLevel(Circuit.Enums.LogLevel.Debug); | ||
|
||
/** | ||
* Initialize | ||
* @param {Object} events Event emitter | ||
*/ | ||
function init (events) { | ||
return Promise.resolve(); | ||
|
||
emitter = events; | ||
client = new Circuit.Client(config.bot); | ||
return client.logon() | ||
.then(setupListeners); | ||
} | ||
|
||
/** | ||
* Create a conversation | ||
* @param {Object} | ||
*/ | ||
function createConversation() { | ||
return Promise.resolve({convId: '3452354235'}) | ||
} | ||
|
||
function getUsersByEmail(emails) { | ||
return Promise.resolve(['213421342134']); | ||
return client.getUsersByEmail(emails) | ||
} | ||
|
||
function sendMessage(obj) { | ||
return Promise.resolve({}); | ||
return client.addTextItem(obj) | ||
} | ||
|
||
/** | ||
* Setup the listeners | ||
*/ | ||
function setupListeners() { | ||
client.addEventListener('itemAdded', evt => { | ||
console.log(evt); | ||
}); | ||
} | ||
|
||
module.exports = { | ||
init, | ||
createConversation, | ||
sendMessage, | ||
getUsersByEmail | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[ | ||
{ | ||
"convId": "0b978e53-cf46-43d6-b2a1-3789d057e49e", | ||
"complaintId": 100, | ||
"customer": { | ||
"name": "Peter", | ||
"email": "[email protected]", | ||
"topic": "Fridge" | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"bot": { | ||
"domain": "circuitsandbox.net", | ||
"client_id": "851763b2fe7a4aaaa33a2de397d92170", | ||
"client_secret": "97cedbbf3954434d99ef0acf54bf6df9" | ||
}, | ||
"supportUsers": [ | ||
"[email protected]", | ||
"[email protected]" | ||
], | ||
"topics": [ | ||
"Washer", | ||
"Dryer", | ||
"Fridge", | ||
"Dishwasher" | ||
], | ||
"complaintIdStart": 100 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"bot": { | ||
"domain": "circuitsandbox.net", | ||
"client_id": "<client_id>", | ||
"client_secret": "<client_secret>" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.