@microsoft/omnichannel-chat-sdk 1.0.1-main.90a4f94 → 1.0.1-main.91ec7fb
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 +14 -0
- package/README.md +69 -59
- package/lib/OmnichannelChatSDK.d.ts +6 -1
- package/lib/OmnichannelChatSDK.js +301 -206
- package/lib/OmnichannelChatSDK.js.map +1 -1
- package/lib/api/createVoiceVideoCalling.js +6 -2
- package/lib/api/createVoiceVideoCalling.js.map +1 -1
- package/lib/core/ChatConfig.d.ts +1 -0
- package/lib/core/ChatSDKExceptionDetails.d.ts +5 -0
- package/lib/core/ChatSDKExceptionDetails.js +3 -0
- package/lib/core/ChatSDKExceptionDetails.js.map +1 -0
- package/lib/core/ChatTranscriptBody.d.ts +1 -1
- package/lib/core/LiveWorkItemDetails.d.ts +2 -0
- package/lib/core/OmnichannelErrorCodes.d.ts +4 -0
- package/lib/core/OmnichannelErrorCodes.js +8 -0
- package/lib/core/OmnichannelErrorCodes.js.map +1 -0
- package/lib/core/PostChatContext.d.ts +1 -0
- package/lib/core/messaging/ChatAdapterOptionalParams.d.ts +14 -0
- package/lib/core/messaging/ChatAdapterOptionalParams.js +3 -0
- package/lib/core/messaging/ChatAdapterOptionalParams.js.map +1 -0
- package/lib/core/messaging/MessageTags.d.ts +2 -0
- package/lib/core/messaging/MessageTags.js +4 -2
- package/lib/core/messaging/MessageTags.js.map +1 -1
- package/lib/external/ACSAdapter/createChannelDataEgressMiddleware.d.ts +5 -0
- package/lib/external/ACSAdapter/createChannelDataEgressMiddleware.js +34 -0
- package/lib/external/ACSAdapter/createChannelDataEgressMiddleware.js.map +1 -0
- package/lib/external/CallingSDK/ICallingSDKLogData.d.ts +7 -0
- package/lib/external/CallingSDK/ICallingSDKLogData.js +3 -0
- package/lib/external/CallingSDK/ICallingSDKLogData.js.map +1 -0
- package/lib/external/IC3Adapter/IIC3AdapterOptions.d.ts +12 -0
- package/lib/telemetry/AriaTelemetry.d.ts +1 -0
- package/lib/telemetry/AriaTelemetry.js +55 -0
- package/lib/telemetry/AriaTelemetry.js.map +1 -1
- package/lib/telemetry/ScenarioMarker.d.ts +2 -0
- package/lib/telemetry/ScenarioMarker.js +7 -3
- package/lib/telemetry/ScenarioMarker.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/tsconfig.tsbuildinfo +149 -55
- package/lib/utils/WebUtils.d.ts +3 -1
- package/lib/utils/WebUtils.js +8 -2
- package/lib/utils/WebUtils.js.map +1 -1
- package/lib/utils/locale.d.ts +1 -0
- package/lib/utils/locale.js +2 -1
- package/lib/utils/locale.js.map +1 -1
- package/lib/utils/loggers.d.ts +25 -0
- package/lib/utils/loggers.js +93 -1
- package/lib/utils/loggers.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -8,15 +8,29 @@ All notable changes to this project will be documented in this file.
|
|
8
8
|
- Add `GetPostChatSurveyContext` telemetry event
|
9
9
|
- Add `widgetId` & `clientMessageId` as metadata on sending message
|
10
10
|
- Update `ChatConfig` interface with `LiveChatVersion`, `allowedFileExtensions` & `maxUploadFileSize` properties
|
11
|
+
- Add ability to automatically detect locale from chat config
|
12
|
+
- Add `runtimeId` attribute in `OmnichannelChatSDK` & `ChatSDKRuntimeId` field in telemetry
|
13
|
+
- Add ability to automatically pass locale from chat config on calling `ChatSDK.emailLiveChatTranscript()`
|
14
|
+
- Bubble up `WidgetUseOutsideOperatingHour` exception
|
15
|
+
- Add `acs_webchat-chat-adapter` middleware to add default `channelData.tags` & `channelData.metadata`
|
16
|
+
- Update `ChatConfig` interface with `msdyn_enablemarkdown` property
|
17
|
+
- Throw exception on `ChatSDK.getVoiceVideoCalling()` if feature is disabled or platform is not supported
|
18
|
+
- Add `participantType` & `canRenderPostChat` as response of getConversationDetails() API
|
19
|
+
- Add support for separate bot post chat survey feature
|
11
20
|
|
12
21
|
### Fix
|
13
22
|
- Add `acs_webchat-chat-adapter` middlewares to format `channelData.tags`
|
14
23
|
- Skip `session init` call on existing conversation
|
24
|
+
- Fix `chat reconnect` not ending the conversation on calling `ChatSDK.endChat()`
|
25
|
+
- Fix on messaging client not sending heartbeat on new conversations subsequent to the first conversation
|
26
|
+
- Fix `ChatSDK.getConversationDetails()` not passing `authenticatedUserToken`
|
27
|
+
- Fix `IC3Client.dispose()` called when `IC3Client` is `undefined`
|
15
28
|
|
16
29
|
### Changed
|
17
30
|
- README: added examples on usages of the post chat APIs.
|
18
31
|
- Uptake [@azure/communication-chat@1.1.1](https://www.npmjs.com/package/@azure/communication-chat/v/1.1.1)
|
19
32
|
- Uptake [acs_webchat-chat-adapter@0.0.35-beta.2](https://unpkg.com/acs_webchat-chat-adapter@0.0.35-beta.2/dist/chat-adapter.js)
|
33
|
+
- Update `locale` property in `ChatTranscriptBody` interface to be optional
|
20
34
|
|
21
35
|
## [1.0.0] - 2021-10-08
|
22
36
|
### Added
|
package/README.md
CHANGED
@@ -131,7 +131,7 @@ The following steps will be required to run Omnichannel Chat SDK on React Native
|
|
131
131
|
| OmnichannelChatSDK.getLiveChatTranscript() | Get transcript data (JSON) | |
|
132
132
|
| OmnichannelChatSDK.uploadFileAttachment() | Send file attachment | |
|
133
133
|
| OmnichannelChatSDK.downloadFileAttachment() | Download file attachment | |
|
134
|
-
| OmnichannelChatSDK.createChatAdapter() | Get
|
134
|
+
| OmnichannelChatSDK.createChatAdapter() | Get Chat Adapter | **Web only** |
|
135
135
|
| OmnichannelChatSDK.getVoiceVideoCalling() | Get VoiceVideoCall SDK for Escalation to Voice & Video | **Web only** |
|
136
136
|
| OmnichannelChatSDK.getPostChatSurveyContext() | Get post chat survey link, survey locale, and whether an agent has joined the survey | |
|
137
137
|
|
@@ -218,7 +218,7 @@ The following steps will be required to run Omnichannel Chat SDK on React Native
|
|
218
218
|
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.
|
219
219
|
// formsProLocale is the default language you have set on the CustomerVoice portal. You can override this url parameter with any locale that CustomerVoice supports.
|
220
220
|
// If "&lang=" is not set on the url, the locale will be English.
|
221
|
-
const linkToSend = context.surveyInviteLink + "&lang=" + context.formsProLocale;
|
221
|
+
const linkToSend = context.surveyInviteLink + "&lang=" + context.formsProLocale;
|
222
222
|
// This link is accessible and will redirect to the survey page. Use it as you see fit.
|
223
223
|
}
|
224
224
|
} catch (ex) {
|
@@ -335,8 +335,7 @@ The following steps will be required to run Omnichannel Chat SDK on React Native
|
|
335
335
|
```ts
|
336
336
|
const body = {
|
337
337
|
emailAddress: 'contoso@microsoft.com',
|
338
|
-
attachmentMessage: 'Attachment Message'
|
339
|
-
locale: 'en-us'
|
338
|
+
attachmentMessage: 'Attachment Message'
|
340
339
|
};
|
341
340
|
await chatSDK.emailLiveChatTranscript(body);
|
342
341
|
```
|
@@ -597,82 +596,93 @@ The following steps will be required to run Omnichannel Chat SDK on React Native
|
|
597
596
|
console.log("VoiceVideoCalling loaded");
|
598
597
|
} catch (e) {
|
599
598
|
console.log(`Failed to load VoiceVideoCalling: ${e}`);
|
599
|
+
|
600
|
+
if (e.message === 'UnsupportedPlatform') {
|
601
|
+
// Voice Video Calling feature is not supported on this platform
|
602
|
+
}
|
603
|
+
|
604
|
+
if (e.message === 'FeatureDisabled') {
|
605
|
+
// Voice Video Calling feature is disabled on admin side
|
606
|
+
}
|
600
607
|
}
|
601
608
|
|
602
609
|
await chatSDK.startChat();
|
603
610
|
|
604
611
|
const chatToken: any = await chatSDK.getChatToken();
|
605
612
|
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
613
|
+
// Initialize only if VoiceVideoCallingSDK is defined
|
614
|
+
if (VoiceVideoCallingSDK) {
|
615
|
+
try {
|
616
|
+
await VoiceVideoCallingSDK.initialize({
|
617
|
+
chatToken,
|
618
|
+
selfVideoHTMLElementId: 'selfVideo', // HTML element id where video stream of the agent will be rendered
|
619
|
+
remoteVideoHTMLElementId: 'remoteVideo', // HTML element id where video stream of the customer will be rendered
|
620
|
+
OCClient: chatSDK.OCClient
|
621
|
+
});
|
622
|
+
} catch (e) {
|
623
|
+
console.error("Failed to initialize VoiceVideoCalling!");
|
624
|
+
}
|
616
625
|
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
626
|
+
// Triggered when there's an incoming call
|
627
|
+
VoiceVideoCallingSDK.onCallAdded(() => {
|
628
|
+
...
|
629
|
+
});
|
621
630
|
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
631
|
+
// Triggered when local video stream is available (e.g.: Local video added succesfully in selfVideoHTMLElement)
|
632
|
+
VoiceVideoCallingSDK.onLocalVideoStreamAdded(() => {
|
633
|
+
...
|
634
|
+
});
|
626
635
|
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
636
|
+
// Triggered when local video stream is unavailable (e.g.: Customer turning off local video)
|
637
|
+
VoiceVideoCallingSDK.onLocalVideoStreamRemoved(() => {
|
638
|
+
...
|
639
|
+
});
|
631
640
|
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
641
|
+
// Triggered when remote video stream is available (e.g.: Remote video added succesfully in remoteVideoHTMLElement)
|
642
|
+
VoiceVideoCallingSDK.onRemoteVideoStreamAdded(() => {
|
643
|
+
...
|
644
|
+
});
|
636
645
|
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
646
|
+
// Triggered when remote video stream is unavailable (e.g.: Agent turning off remote video)
|
647
|
+
VoiceVideoCallingSDK.onRemoteVideoStreamRemoved(() => {
|
648
|
+
...
|
649
|
+
});
|
641
650
|
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
651
|
+
// Triggered when current call has ended or disconnected regardless the party
|
652
|
+
VoiceVideoCalling.onCallDisconnected(() => {
|
653
|
+
...
|
654
|
+
});
|
646
655
|
|
647
|
-
|
648
|
-
|
656
|
+
// Check if microphone is muted
|
657
|
+
const isMicrophoneMuted = VoiceVideoCallingSDK.isMicrophoneMuted();
|
649
658
|
|
650
|
-
|
651
|
-
|
659
|
+
// Check if remote video is available
|
660
|
+
const isRemoteVideoEnabled = VoiceVideoCallingSDK.isRemoteVideoEnabled();
|
652
661
|
|
653
|
-
|
654
|
-
|
662
|
+
// Check if local video is available
|
663
|
+
const isLocalVideoEnabled = VoiceVideoCallingSDK.isLocalVideoEnabled();
|
655
664
|
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
665
|
+
// Accepts incoming call
|
666
|
+
const acceptCallConfig = {
|
667
|
+
withVideo: true // Accept call with/without video stream
|
668
|
+
};
|
669
|
+
await VoiceVideoCallingSDK.acceptCall(acceptCallConfig);
|
661
670
|
|
662
|
-
|
663
|
-
|
671
|
+
// Rejects incoming call
|
672
|
+
await VoiceVideoCallingSDK.rejectCall();
|
664
673
|
|
665
|
-
|
666
|
-
|
674
|
+
// Ends/Stops current call
|
675
|
+
await VoiceVideoCallingSDK.stopCall();
|
667
676
|
|
668
|
-
|
669
|
-
|
677
|
+
// Mute/Unmute current call
|
678
|
+
await VoiceVideoCallingSDK.toggleMute()
|
670
679
|
|
671
|
-
|
672
|
-
|
680
|
+
// Display/Hide local video of current call
|
681
|
+
await VoiceVideoCallingSDK.toggleLocalVideo()
|
673
682
|
|
674
|
-
|
675
|
-
|
683
|
+
// Clean up VoiceVideoCallingSDK (e.g.: Usually called when customer ends chat session)
|
684
|
+
VoiceVideoCallingSDK.close();
|
685
|
+
}
|
676
686
|
```
|
677
687
|
|
678
688
|
## Feature Comparisons
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import ACSClient from "./core/messaging/ACSClient";
|
2
2
|
import { ParticipantsRemovedEvent } from '@azure/communication-signaling';
|
3
|
+
import ChatAdapterOptionalParams from "./core/messaging/ChatAdapterOptionalParams";
|
3
4
|
import ChatConfig from "./core/ChatConfig";
|
4
5
|
import ChatReconnectContext from "./core/ChatReconnectContext";
|
5
6
|
import ChatReconnectOptionalParams from "./core/ChatReconnectOptionalParams";
|
@@ -23,6 +24,7 @@ import OnNewMessageOptionalParams from "./core/messaging/OnNewMessageOptionalPar
|
|
23
24
|
import StartChatOptionalParams from "./core/StartChatOptionalParams";
|
24
25
|
declare class OmnichannelChatSDK {
|
25
26
|
private debug;
|
27
|
+
runtimeId: string;
|
26
28
|
OCSDKProvider: unknown;
|
27
29
|
IC3SDKProvider: unknown;
|
28
30
|
OCClient: any;
|
@@ -32,6 +34,7 @@ declare class OmnichannelChatSDK {
|
|
32
34
|
omnichannelConfig: OmnichannelConfig;
|
33
35
|
chatSDKConfig: ChatSDKConfig;
|
34
36
|
isInitialized: boolean;
|
37
|
+
localeId: string;
|
35
38
|
requestId: string;
|
36
39
|
private chatToken;
|
37
40
|
private liveChatConfig;
|
@@ -48,6 +51,7 @@ declare class OmnichannelChatSDK {
|
|
48
51
|
private ocSdkLogger;
|
49
52
|
private acsClientLogger;
|
50
53
|
private acsAdapterLogger;
|
54
|
+
private callingSdkLogger;
|
51
55
|
private isPersistentChat;
|
52
56
|
private isChatReconnect;
|
53
57
|
private reconnectId;
|
@@ -79,7 +83,7 @@ declare class OmnichannelChatSDK {
|
|
79
83
|
downloadFileAttachment(fileMetadata: FileMetadata | IFileMetadata): Promise<Blob>;
|
80
84
|
emailLiveChatTranscript(body: ChatTranscriptBody): Promise<any>;
|
81
85
|
getLiveChatTranscript(): Promise<any>;
|
82
|
-
createChatAdapter(
|
86
|
+
createChatAdapter(optionalParams?: ChatAdapterOptionalParams): Promise<unknown>;
|
83
87
|
getVoiceVideoCalling(params?: any): Promise<any>;
|
84
88
|
getPostChatSurveyContext(): Promise<any>;
|
85
89
|
private getIC3Client;
|
@@ -87,5 +91,6 @@ declare class OmnichannelChatSDK {
|
|
87
91
|
private resolveIC3ClientUrl;
|
88
92
|
private resolveChatAdapterUrl;
|
89
93
|
private updateChatToken;
|
94
|
+
private setAuthTokenProvider;
|
90
95
|
}
|
91
96
|
export default OmnichannelChatSDK;
|