Skip to content

Commit

Permalink
combine test sites
Browse files Browse the repository at this point in the history
Combines the browser-based test sites for the contained packages
into a single directory, with testing logic for both of the
libraries contained in it. The node-related tests will remain
in chat-core explicitly, as chat-core-aws-connect does not
support Node.
  • Loading branch information
popestr committed Aug 22, 2024
1 parent 84727c6 commit e515e9b
Show file tree
Hide file tree
Showing 20 changed files with 3,199 additions and 2,134 deletions.
319 changes: 102 additions & 217 deletions package-lock.json

Large diffs are not rendered by default.

25 changes: 13 additions & 12 deletions packages/chat-core-aws-connect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

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
- Currently only supports browser-based chat sessions

## Usage

```typescript
import { provideChatCoreAwsConnect } from "@yext/chat-core-aws-connect";
import { Message, MessageResponse } from "@yext/chat-core";
import { MessageResponse } from "@yext/chat-core";

// create a new instance of ChatCoreAwsConnect
const chatCoreAwsConnect = provideChatCoreAwsConnect();
Expand All @@ -21,17 +20,19 @@ 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",
},
];
// create a payload
const req = {
messages: [
{
timestamp: "2023-05-17T19:21:21.915Z",
source: "USER",
text: "Could I get some assistance?"
},
],
};

// send it to Connect!
await chatCoreAwsConnect.processMessage({ messages });
await chatCoreAwsConnect.processMessage(req);
```

## Documentation
Expand Down
3,065 changes: 2,869 additions & 196 deletions packages/chat-core-aws-connect/THIRD-PARTY-NOTICES

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/chat-core-aws-connect/src/models/connect.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ declare global {
export type ActiveCustomerChatSession = Extract<ActiveChatSession, { disconnectParticipant(): unknown }>;
export type Logger = typeof AwsChatSession.Logger;
}
const AWS: unknown;
}
18 changes: 0 additions & 18 deletions packages/chat-core-aws-connect/test-browser-esm/index.html

This file was deleted.

24 changes: 0 additions & 24 deletions packages/chat-core-aws-connect/test-browser-esm/package.json

This file was deleted.

64 changes: 0 additions & 64 deletions packages/chat-core-aws-connect/test-browser-esm/src/script.js

This file was deleted.

16 changes: 0 additions & 16 deletions packages/chat-core/test-browser-esm/README.md

This file was deleted.

14 changes: 0 additions & 14 deletions packages/chat-core/test-browser-esm/index.html

This file was deleted.

Loading

0 comments on commit e515e9b

Please sign in to comment.