@microsoft/omnichannel-chat-sdk 1.2.1-main.2a7572c → 1.2.1-main.30dca50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +21 -4
- package/lib/OmnichannelChatSDK.d.ts +5 -1
- package/lib/OmnichannelChatSDK.js +302 -292
- package/lib/OmnichannelChatSDK.js.map +1 -1
- package/lib/config/settings.d.ts +3 -2
- package/lib/config/settings.js +4 -2
- package/lib/config/settings.js.map +1 -1
- package/lib/core/ChatSDKErrors.d.ts +6 -0
- package/lib/core/ChatSDKErrors.js +10 -0
- package/lib/core/ChatSDKErrors.js.map +1 -0
- package/lib/core/ChatSDKExceptionDetails.d.ts +1 -0
- package/lib/core/GetAgentAvailabilityOptionalParams.d.ts +13 -0
- package/lib/core/GetAgentAvailabilityOptionalParams.js +3 -0
- package/lib/core/GetAgentAvailabilityOptionalParams.js.map +1 -0
- package/lib/core/PostChatContext.d.ts +2 -0
- package/lib/core/StartChatOptionalParams.d.ts +4 -0
- package/lib/core/messaging/ACSClient.js +5 -0
- package/lib/core/messaging/ACSClient.js.map +1 -1
- package/lib/core/messaging/ChatAdapterConfig.d.ts +2 -0
- package/lib/core/messaging/ChatAdapterOptionalParams.d.ts +5 -0
- package/lib/external/ACSAdapter/AMSFileManager.js +2 -1
- package/lib/external/ACSAdapter/AMSFileManager.js.map +1 -1
- package/lib/telemetry/AriaTelemetry.d.ts +2 -0
- package/lib/telemetry/AriaTelemetry.js +49 -0
- package/lib/telemetry/AriaTelemetry.js.map +1 -1
- package/lib/telemetry/ScenarioType.d.ts +1 -0
- package/lib/telemetry/ScenarioType.js +1 -0
- package/lib/telemetry/ScenarioType.js.map +1 -1
- package/lib/telemetry/TelemetryEvent.d.ts +4 -1
- package/lib/telemetry/TelemetryEvent.js +3 -0
- package/lib/telemetry/TelemetryEvent.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +318 -171
- package/lib/utils/WebUtils.d.ts +2 -2
- package/lib/utils/WebUtils.js +30 -4
- package/lib/utils/WebUtils.js.map +1 -1
- package/lib/utils/chatAdapterCreators.d.ts +20 -0
- package/lib/utils/chatAdapterCreators.js +230 -0
- package/lib/utils/chatAdapterCreators.js.map +1 -0
- package/lib/utils/libraries.d.ts +3 -1
- package/lib/utils/libraries.js +9 -2
- package/lib/utils/libraries.js.map +1 -1
- package/lib/utils/location.d.ts +7 -0
- package/lib/utils/location.js +96 -0
- package/lib/utils/location.js.map +1 -0
- package/lib/utils/loggers.d.ts +16 -0
- package/lib/utils/loggers.js +69 -1
- package/lib/utils/loggers.js.map +1 -1
- package/lib/utils/sleep.d.ts +2 -0
- package/lib/utils/sleep.js +5 -0
- package/lib/utils/sleep.js.map +1 -0
- package/lib/utils/urlResolvers.d.ts +10 -0
- package/lib/utils/urlResolvers.js +65 -0
- package/lib/utils/urlResolvers.js.map +1 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,26 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
4
|
## [Unreleased]
|
5
|
+
### Added
|
6
|
+
- Add ability to use `ChatSDK.createChatAdapter()` for `DirectLine` protocol
|
7
|
+
- Add `CreateACSAdapter` telemetry event
|
8
|
+
- Improve `ChatSDK.createChatAdapter()` with retries using exponential backoff & additional details on failures
|
9
|
+
- Add `GetAgentAvailability` SDK method for auth chat
|
10
|
+
- Pass `logger` to AMSClient
|
11
|
+
- Add `portalContactId` in `StartChatOptionalParams` and `GetAgentAvailabilityOptionalParams`
|
12
|
+
- Added exception on initialization failure
|
13
|
+
- Upgraded ACSAdapter to version beta.17
|
14
|
+
- Added `botSurveyInviteLink` and `botFormsProLocale` the `getPostChatSurveyContext()` response
|
15
|
+
|
16
|
+
### Fixed
|
17
|
+
- Fix `ChatAdapterOptionalParams.ACSAdapter.options.egressMiddleware` being used as `ingressMiddleware`
|
18
|
+
- Fix `ChatSDK.onTypingEvent()` being triggered on current user typing
|
19
|
+
- Update `ChatSDK.liveChatVersion` to be `V2` by default
|
20
|
+
|
21
|
+
### Changed
|
22
|
+
- Uptake [@microsoft/omnichannel-amsclient@0.1.4](https://www.npmjs.com/package/@microsoft/omnichannel-amsclient/v/0.1.4)
|
23
|
+
- Uptake [acs_webchat-chat-adapter@0.0.35-beta.17](https://unpkg.com/acs_webchat-chat-adapter@0.0.35-beta.17/dist/chat-adapter.js)
|
24
|
+
- Uptake [@microsoft/ocsdk@0.3.4](https://www.npmjs.com/package/@microsoft/ocsdk/v/0.3.4)
|
5
25
|
|
6
26
|
## [1.2.0] - 2022-11-11
|
7
27
|
### Added
|
package/README.md
CHANGED
@@ -90,6 +90,7 @@ Omnichannel offers an live chat widget (LCW) by default. You can use the Chat SD
|
|
90
90
|
| Persistent Chat | ✔ | ✔ |
|
91
91
|
| Chat Reconnect | ✔ | ✔ |
|
92
92
|
| Operating Hours | ✔ | ✔ |
|
93
|
+
| Get Agent Availability | ✔ | ✔ |
|
93
94
|
| Queue Position | ✔ | ✔ | No SDK method. Handled as *system message* |
|
94
95
|
| Average Wait Time | ✔ | ✔ | No SDK method. Handled as *system message* |
|
95
96
|
|
@@ -125,6 +126,11 @@ The following steps will be required to run Omnichannel Chat SDK on React Native
|
|
125
126
|
npm install react-native-url-polyfill --save-dev
|
126
127
|
```
|
127
128
|
|
129
|
+
1. Install `@azure/core-asynciterator-polyfill`
|
130
|
+
```
|
131
|
+
npm install @azure/core-asynciterator-polyfill --save-dev
|
132
|
+
```
|
133
|
+
|
128
134
|
1. Update *metro.config.js* to use React Native compatible Node Core modules
|
129
135
|
```ts
|
130
136
|
module.exports = {
|
@@ -143,7 +149,8 @@ The following steps will be required to run Omnichannel Chat SDK on React Native
|
|
143
149
|
```ts
|
144
150
|
import 'node-libs-react-native/globals';
|
145
151
|
import 'react-native-get-random-values';
|
146
|
-
import 'react-native-url-polyfill';
|
152
|
+
import 'react-native-url-polyfill/auto';
|
153
|
+
import '@azure/core-asynciterator-polyfill';
|
147
154
|
```
|
148
155
|
|
149
156
|
## SDK Methods
|
@@ -438,10 +445,18 @@ try {
|
|
438
445
|
```
|
439
446
|
### Get Post Chat Survey Context
|
440
447
|
|
441
|
-
It gets
|
448
|
+
It gets the participant type that should be used for the survey and both the default and bot survey details.
|
449
|
+
|
450
|
+
```ts
|
451
|
+
const postChatSurveyContext = await chatSDK.getPostChatSurveyContext();
|
452
|
+
```
|
453
|
+
|
454
|
+
### Get Agent Availability
|
455
|
+
|
456
|
+
It gets information on whether a queue is available, and whether there are agents available in that queue, as well as queue position and average wait time. This call only supports authenticated chat.
|
442
457
|
|
443
458
|
```ts
|
444
|
-
const
|
459
|
+
const agentAvailability = await chatSDK.getAgentAvailability();
|
445
460
|
```
|
446
461
|
|
447
462
|
## Common Scenarios
|
@@ -497,7 +512,9 @@ try {
|
|
497
512
|
if (context.participantJoined) { // participantJoined will be true if an agent has joined the conversation, or a bot has joined the conversation and the bot survey flag has been turned on on the admin side.
|
498
513
|
// formsProLocale is the default language you have set on the CustomerVoice portal. You can override this url parameter with any locale that CustomerVoice supports.
|
499
514
|
// If "&lang=" is not set on the url, the locale will be English.
|
500
|
-
const
|
515
|
+
const link = context.participantType === "Bot" ? context.botSurveyInviteLink : context.surveyInviteLink;
|
516
|
+
const locale = context.participantType === "Bot" ? context.botFormsProLocale : context.formsProLocale;
|
517
|
+
const linkToSend = link + "&lang=" + locale;
|
501
518
|
// This link is accessible and will redirect to the survey page. Use it as you see fit.
|
502
519
|
}
|
503
520
|
} catch (ex) {
|
@@ -10,14 +10,15 @@ import ChatTranscriptBody from "./core/ChatTranscriptBody";
|
|
10
10
|
import FileMetadata from "@microsoft/omnichannel-amsclient/lib/FileMetadata";
|
11
11
|
import FramedClient from "@microsoft/omnichannel-amsclient/lib/FramedClient";
|
12
12
|
import FramedlessClient from "@microsoft/omnichannel-amsclient/lib/FramedlessClient";
|
13
|
+
import GetAgentAvailabilityOptionalParams from "./core/GetAgentAvailabilityOptionalParams";
|
13
14
|
import GetLiveChatConfigOptionalParams from "./core/GetLiveChatConfigOptionalParams";
|
14
15
|
import IChatToken from "./external/IC3Adapter/IChatToken";
|
15
16
|
import IFileInfo from "@microsoft/omnichannel-ic3core/lib/interfaces/IFileInfo";
|
16
17
|
import IFileMetadata from "@microsoft/omnichannel-ic3core/lib/model/IFileMetadata";
|
17
18
|
import IMessage from "@microsoft/omnichannel-ic3core/lib/model/IMessage";
|
18
|
-
import InitializeOptionalParams from "./core/InitializeOptionalParams";
|
19
19
|
import IRawMessage from "@microsoft/omnichannel-ic3core/lib/model/IRawMessage";
|
20
20
|
import IRawThread from "@microsoft/omnichannel-ic3core/lib/interfaces/IRawThread";
|
21
|
+
import InitializeOptionalParams from "./core/InitializeOptionalParams";
|
21
22
|
import LiveChatContext from "./core/LiveChatContext";
|
22
23
|
import LiveWorkItemDetails from "./core/LiveWorkItemDetails";
|
23
24
|
import OmnichannelConfig from "./core/OmnichannelConfig";
|
@@ -54,6 +55,7 @@ declare class OmnichannelChatSDK {
|
|
54
55
|
private acsClientLogger;
|
55
56
|
private acsAdapterLogger;
|
56
57
|
private callingSdkLogger;
|
58
|
+
private amsClientLogger;
|
57
59
|
private isPersistentChat;
|
58
60
|
private isChatReconnect;
|
59
61
|
private reconnectId;
|
@@ -88,6 +90,8 @@ declare class OmnichannelChatSDK {
|
|
88
90
|
createChatAdapter(optionalParams?: ChatAdapterOptionalParams): Promise<unknown>;
|
89
91
|
getVoiceVideoCalling(params?: any): Promise<any>;
|
90
92
|
getPostChatSurveyContext(): Promise<any>;
|
93
|
+
getAgentAvailability(optionalParams?: GetAgentAvailabilityOptionalParams): Promise<any>;
|
94
|
+
private populateInitChatOptionalParam;
|
91
95
|
private getIC3Client;
|
92
96
|
private getChatConfig;
|
93
97
|
private resolveIC3ClientUrl;
|