Skip to content

Commit

Permalink
add docs, lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Yen Truong committed Sep 10, 2024
1 parent e5f8ac5 commit 08552f9
Show file tree
Hide file tree
Showing 16 changed files with 266 additions and 157 deletions.
10 changes: 7 additions & 3 deletions packages/chat-core-aws-connect/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
## Testing Process

### Unit Testing

We use Jest as our framework for unit tests. Execute the unit tests with the following command:

```
npm run test
```

### Test Environments

The `chat-core-aws-connect` library is designed to be compatible with both CommonJS and ES6 import styles. Additionally, it should function properly in browser environments. To ensure this, we have set up a shared testing environment:

- **Browser ESM Test Site:** For more information, refer to the README.md file located in the `test-sites/test-browser-esm` directory.

## Build Process

Before initiating the build, run the linting process to identify and address any errors or warnings. Use the following command:

```
npm run lint
```

To build the library, execute:

```
npm run build
```
This will create the bundle in the `/dist` directory. This command will also generate documentation files and the `THIRD-PARTY-NOTICES` file.


This will create the bundle in the `/dist` directory. This command will also generate documentation files and the `THIRD-PARTY-NOTICES` file.

For guidelines on pull request and version publish process, visit Chat SDK wiki page.
For guidelines on pull request and version publish process, visit Chat SDK wiki page.
34 changes: 33 additions & 1 deletion packages/chat-core-zendesk/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1 +1,33 @@
TODO
## Testing Process

### Unit Testing

We use Jest as our framework for unit tests. Execute the unit tests with the following command:

```
npm run test
```

### Test Environments

The `chat-core-aws-connect` library is designed to be compatible with both CommonJS and ES6 import styles. Additionally, it should function properly in browser environments. To ensure this, we have set up a shared testing environment:

- **Browser ESM Test Site:** For more information, refer to the README.md file located in the `test-sites/test-browser-esm` directory.

## Build Process

Before initiating the build, run the linting process to identify and address any errors or warnings. Use the following command:

```
npm run lint
```

To build the library, execute:

```
npm run build
```

This will create the bundle in the `/dist` directory. This command will also generate documentation files and the `THIRD-PARTY-NOTICES` file.

For guidelines on pull request and version publish process, visit Chat SDK wiki page.
41 changes: 40 additions & 1 deletion packages/chat-core-zendesk/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,40 @@
TODO
# chat-core-zendesk

a library used for integrating Yext Chat with the Zendesk agent platform.

- 100% **TypeScript**, with detailed request and response models
- Currently only supports browser-based chat sessions

## Usage

```typescript
import { provideChatCoreZendesk } from "@yext/chat-core-zendesk";
import { MessageResponse } from "@yext/chat-core";

// create a new instance of ChatCoreZendesk
const chatCoreZendesk = provideChatCoreZendesk();

// with some response from the Chat API containing handoff credentials...
const chatApiResponse: MessageResponse;

// initiate a connection to Zendesk agent platform with the conversation summary as the initial message
await chatCoreZendesk.init(chatApiResponse);

// create a payload
const req = {
messages: [
{
timestamp: "2023-05-17T19:21:21.915Z",
source: "USER",
text: "Could I get some assistance?",
},
],
};

// send message to agent!
await chatCoreZendesk.processMessage(req);
```

## Documentation

See **[our documentation](./docs/chat-core-zendesk.md)** for a more details on supported API calls and interfaces.
138 changes: 69 additions & 69 deletions packages/chat-core-zendesk/package.json
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
{
"name": "@yext/chat-core-zendesk",
"version": "0.1.0",
"description": "Typescript Networking Library for the Yext Chat API Integration with Zendesk",
"main": "./dist/commonjs/index.js",
"module": "./dist/esm/index.mjs",
"types": "./dist/esm/index.d.ts",
"sideEffects": false,
"keywords": [
"networking",
"chat api",
"chat",
"browser",
"nodejs",
"typescript",
"commonjs",
"es6",
"yext"
],
"files": [
"dist",
"src",
"THIRD-PARTY-NOTICES",
"LICENSE"
],
"scripts": {
"test": "jest --config=jest.config.json",
"lint": "prettier --write . && eslint --fix --max-warnings=0 .",
"tsc": "tsc -p tsconfig.json",
"dev": "npm run tsc -- --watch",
"generate-notices": "../../generate-notices.sh",
"generate-docs": "api-extractor run --local --verbose && api-documenter markdown --input-folder temp --output-folder docs && rm -rf temp",
"build:js": "rollup --config ../../rollup.config.mjs",
"build": "rm -rf dist/** && npm run build:js && npm run generate-docs && npm run generate-notices"
},
"repository": {
"type": "git",
"url": "https://github.com/yext/chat-core.git"
},
"author": "clippy@yext.com",
"license": "BSD-3-Clause",
"bugs": {
"url": "https://github.com/yext/chat-core/issues"
},
"homepage": "https://github.com/yext/chat-core#readme",
"dependencies": {
"smooch": "5.6.0"
},
"devDependencies": {
"@babel/preset-env": "^7.21.5",
"@babel/preset-typescript": "^7.21.5",
"@microsoft/api-documenter": "^7.22.4",
"@microsoft/api-extractor": "^7.34.8",
"@types/jest": "^29.5.1",
"@types/smooch": "^5.3.7",
"@yext/chat-core": "^0.8.2",
"@yext/eslint-config": "^1.0.0",
"babel-jest": "^29.5.0",
"eslint": "^8.39.0",
"generate-license-file": "^1.0.0",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"prettier": "^2.8.8",
"rollup": "^3.29.0",
"rollup-plugin-typescript2": "^0.35.0",
"typescript": "^5.0.4"
},
"peerDependencies": {
"@yext/chat-core": "^0.8.2"
}
"name": "@yext/chat-core-zendesk",
"version": "0.1.0",
"description": "Typescript Networking Library for the Yext Chat API Integration with Zendesk",
"main": "./dist/commonjs/index.js",
"module": "./dist/esm/index.mjs",
"types": "./dist/esm/index.d.ts",
"sideEffects": false,
"keywords": [
"networking",
"chat api",
"chat",
"browser",
"nodejs",
"typescript",
"commonjs",
"es6",
"yext"
],
"files": [
"dist",
"src",
"THIRD-PARTY-NOTICES",
"LICENSE"
],
"scripts": {
"test": "jest --config=jest.config.json",
"lint": "prettier --write . && eslint --fix --max-warnings=0 .",
"tsc": "tsc -p tsconfig.json",
"dev": "npm run tsc -- --watch",
"generate-notices": "../../generate-notices.sh",
"generate-docs": "api-extractor run --local --verbose && api-documenter markdown --input-folder temp --output-folder docs && rm -rf temp",
"build:js": "rollup --config ../../rollup.config.mjs",
"build": "rm -rf dist/** && npm run build:js && npm run generate-docs && npm run generate-notices"
},
"repository": {
"type": "git",
"url": "https://github.com/yext/chat-core.git"
},
"author": "clippy@yext.com",
"license": "BSD-3-Clause",
"bugs": {
"url": "https://github.com/yext/chat-core/issues"
},
"homepage": "https://github.com/yext/chat-core#readme",
"dependencies": {
"smooch": "5.6.0"
},
"devDependencies": {
"@babel/preset-env": "^7.21.5",
"@babel/preset-typescript": "^7.21.5",
"@microsoft/api-documenter": "^7.22.4",
"@microsoft/api-extractor": "^7.34.8",
"@types/jest": "^29.5.1",
"@types/smooch": "^5.3.7",
"@yext/chat-core": "^0.8.2",
"@yext/eslint-config": "^1.0.0",
"babel-jest": "^29.5.0",
"eslint": "^8.39.0",
"generate-license-file": "^1.0.0",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"prettier": "^2.8.8",
"rollup": "^3.29.0",
"rollup-plugin-typescript2": "^0.35.0",
"typescript": "^5.0.4"
},
"peerDependencies": {
"@yext/chat-core": "^0.8.2"
}
}
2 changes: 1 addition & 1 deletion packages/chat-core-zendesk/src/CoreZendeskProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ import { ChatCoreZendeskConfig } from "./models";
*/
export function provideChatCoreZendesk(config: ChatCoreZendeskConfig) {
return new ChatCoreZendeskImpl(config);
}
}
4 changes: 2 additions & 2 deletions packages/chat-core-zendesk/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { provideChatCoreZendesk } from './CoreZendeskProvider';
export * from "./models";
export { provideChatCoreZendesk } from "./CoreZendeskProvider";
export * from "./models";
Loading

0 comments on commit 08552f9

Please sign in to comment.