@microsoft/omnichannel-chat-sdk
Advanced tools
Comparing version 0.1.1-main.34c5a39 to 0.1.1-main.3b3e3ff
@@ -9,3 +9,10 @@ # Changelog | ||
- React sample app using Omnichannel Chat SDK with [BotFramework-WebChat](https://github.com/microsoft/BotFramework-WebChat) | ||
- Expose `sessiontInit`'s `initContext` on `startChat`'s optional paramaters | ||
### Changed | ||
- Uptake [@microsoft/ocsdk@0.1.1](https://www.npmjs.com/package/@microsoft/ocsdk/v/0.1.1) | ||
- Uptake [@microsoft/omnichannel-ic3core@0.1.1](https://www.npmjs.com/package/@microsoft/omnichannel-ic3core/v/0.1.1) | ||
- Uptake [jest@26.6.3](https://www.npmjs.com/package/jest/v/26.6.3) | ||
- Uptake [ts-jest@26.5.1](https://www.npmjs.com/package/ts-jest/v/26.5.1) | ||
### Fixed | ||
@@ -12,0 +19,0 @@ - onAgentEndSession triggered on accept voice & video call |
@@ -0,1 +1,2 @@ | ||
import InitContext from "@microsoft/ocsdk/lib/Model/InitContext"; | ||
import ILiveChatContext from "./ILiveChatContext"; | ||
@@ -5,2 +6,8 @@ export default interface IStartChatOptionalParams { | ||
preChatResponse?: object; | ||
customContext?: object; | ||
browser?: string; | ||
os?: string; | ||
locale?: string; | ||
device?: string; | ||
initContext?: InitContext; | ||
} |
@@ -121,5 +121,24 @@ "use strict"; | ||
}; | ||
if (optionalParams.customContext) { | ||
sessionInitOptionalParams.initContext.customContextData = optionalParams.customContext; // eslint-disable-line @typescript-eslint/no-explicit-any | ||
} | ||
if (optionalParams.browser) { | ||
sessionInitOptionalParams.initContext.browser = optionalParams.browser; | ||
} | ||
if (optionalParams.os) { | ||
sessionInitOptionalParams.initContext.os = optionalParams.os; | ||
} | ||
if (optionalParams.locale) { | ||
sessionInitOptionalParams.initContext.locale = optionalParams.locale; | ||
} | ||
if (optionalParams.device) { | ||
sessionInitOptionalParams.initContext.device = optionalParams.device; | ||
} | ||
if (optionalParams.preChatResponse) { | ||
sessionInitOptionalParams.initContext.preChatResponse = optionalParams.preChatResponse; | ||
} | ||
// Override initContext completely | ||
if (optionalParams.initContext) { | ||
sessionInitOptionalParams.initContext = optionalParams.initContext; | ||
} | ||
if (this.authenticatedUserToken) { | ||
@@ -126,0 +145,0 @@ sessionInitOptionalParams.authenticatedUserToken = this.authenticatedUserToken; |
{ | ||
"name": "@microsoft/omnichannel-chat-sdk", | ||
"version": "0.1.1-main.34c5a39", | ||
"version": "0.1.1-main.3b3e3ff", | ||
"description": "Microsoft Omnichannel Chat SDK", | ||
"files": [ | ||
"lib/**/*" | ||
], | ||
"main": "lib/index.js", | ||
@@ -33,10 +36,10 @@ "types": "lib/index.d.ts", | ||
"eslint": "^7.15.0", | ||
"jest": "^26.4.2", | ||
"ts-jest": "^26.3.0", | ||
"jest": "^26.6.3", | ||
"ts-jest": "^26.5.1", | ||
"typescript": "^3.9.5" | ||
}, | ||
"dependencies": { | ||
"@microsoft/ocsdk": "^0.1.0", | ||
"@microsoft/omnichannel-ic3core": "^0.1.0" | ||
"@microsoft/ocsdk": "^0.1.1", | ||
"@microsoft/omnichannel-ic3core": "^0.1.1" | ||
} | ||
} |
@@ -8,2 +8,9 @@ # Omnichannel Chat SDK | ||
## Table of Contents | ||
- [API Reference](#api-reference) | ||
- [API Examples](#api-examples) | ||
- [Sample Apps](samples/) | ||
- [Common Scenarios](#common-scenarios) | ||
- [Feature Comparisons](#feature-comparisons) | ||
## Installation | ||
@@ -15,6 +22,4 @@ | ||
## API | ||
## API Reference | ||
### High Level Overview | ||
| Method | Description | Notes | | ||
@@ -43,2 +48,4 @@ | ------ | ----------- | ----- | | ||
## API examples | ||
### Import | ||
@@ -101,5 +108,12 @@ ```ts | ||
```ts | ||
const customContext = { | ||
'contextKey1': {'value': 'contextValue1', 'isDisplayable': true}, | ||
'contextKey2': {'value': 12.34, 'isDisplayable': false}, | ||
'contextKey3': {'value': true} | ||
}; | ||
const optionalParams = { | ||
preChatResponse: '', // PreChatSurvey response | ||
liveChatContext: {} // EXISTING chat context data | ||
liveChatContext: {}, // EXISTING chat context data | ||
customContext // Custom Context | ||
}; | ||
@@ -204,3 +218,3 @@ await chatSDK.startChat(optionalParams); | ||
## Samples | ||
## Common Scenarios | ||
@@ -207,0 +221,0 @@ ### PreChatSurvey |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
0
475
1
314173
80
1588
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedmime-db@1.52.0(transitive)
Updated@microsoft/ocsdk@^0.1.1