-
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.
chat-core-aws-connect: implement library (#36)
Implements chat-core-aws-connect, to be used by chat-headless when an agent handoff session is initiated. TEST=manual Added browser tests, ensured all functionality works as expected. Added comprehensive Jest tests, saw them pass.
- Loading branch information
Showing
60 changed files
with
4,187 additions
and
0 deletions.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,33 @@ | ||
Contains information from the language-subtag-registry JSON Database (https://github.com/mattcg/language-subtag-registry/tree/master/data/json) which is made available under the ODC Attribution License (https://github.com/mattcg/language-subtag-registry/blob/master/LICENSE.md). | ||
|
||
The files listed in this repository are licensed under the below license. All other features and products are subject to separate agreements and certain functionality requires paid subscriptions to Yext products. | ||
|
||
BSD 3-Clause License | ||
|
||
Copyright (c) 2023, Yext | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
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,39 @@ | ||
# chat-core-aws-connect | ||
|
||
a library used for integrating Yext Chat with the Amazon Connect agent platform. | ||
|
||
- Works in both the **browser** and **Node.js** | ||
- 100% **TypeScript**, with detailed request and response models | ||
- Compatible with both **CommonJS** and **ES6** imports | ||
|
||
## Usage | ||
|
||
```typescript | ||
import { provideChatCoreAwsConnect } from "@yext/chat-core-aws-connect"; | ||
import { Message, MessageResponse } from "@yext/chat-core"; | ||
|
||
// create a new instance of ChatCoreAwsConnect | ||
const chatCoreAwsConnect = provideChatCoreAwsConnect(); | ||
|
||
// with some response from the Chat API containing handoff credentials... | ||
const chatApiResponse: MessageResponse; | ||
|
||
// initiate a connection to Amazon Connect using the credentials | ||
await chatCoreAwsConnect.init(chatApiResponse); | ||
|
||
// create a message payload | ||
const messages: Message[] = [ | ||
{ | ||
source: "USER", | ||
text: "Could I get some assistance?", | ||
timestamp: "2023-05-15T17:33:38.373Z", | ||
}, | ||
]; | ||
|
||
// send it to Connect! | ||
await chatCoreAwsConnect.processMessage({ messages }); | ||
``` | ||
|
||
## Documentation | ||
|
||
See **[our documentation](./docs/chat-core-aws-connect.md)** for a more details on supported API calls and interfaces. |
Oops, something went wrong.