@microsoft/omnichannel-chat-sdk 1.0.1-main.eec1463 → 1.1.1-main.131f36d

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +67 -56
  3. package/lib/OmnichannelChatSDK.d.ts +1 -0
  4. package/lib/OmnichannelChatSDK.js +159 -101
  5. package/lib/OmnichannelChatSDK.js.map +1 -1
  6. package/lib/api/createVoiceVideoCalling.js +6 -2
  7. package/lib/api/createVoiceVideoCalling.js.map +1 -1
  8. package/lib/config/settings.d.ts +1 -1
  9. package/lib/config/settings.js +1 -1
  10. package/lib/core/ChatConfig.d.ts +1 -0
  11. package/lib/core/ChatSDKExceptionDetails.d.ts +5 -0
  12. package/lib/core/ChatSDKExceptionDetails.js +3 -0
  13. package/lib/core/ChatSDKExceptionDetails.js.map +1 -0
  14. package/lib/core/ChatTranscriptBody.d.ts +1 -1
  15. package/lib/core/LiveWorkItemDetails.d.ts +2 -0
  16. package/lib/core/OmnichannelErrorCodes.d.ts +4 -0
  17. package/lib/core/OmnichannelErrorCodes.js +8 -0
  18. package/lib/core/OmnichannelErrorCodes.js.map +1 -0
  19. package/lib/core/PostChatContext.d.ts +1 -0
  20. package/lib/core/messaging/MessageTags.d.ts +2 -0
  21. package/lib/core/messaging/MessageTags.js +4 -2
  22. package/lib/core/messaging/MessageTags.js.map +1 -1
  23. package/lib/external/ACSAdapter/createChannelDataEgressMiddleware.d.ts +5 -0
  24. package/lib/external/ACSAdapter/createChannelDataEgressMiddleware.js +34 -0
  25. package/lib/external/ACSAdapter/createChannelDataEgressMiddleware.js.map +1 -0
  26. package/lib/external/CallingSDK/ICallingSDKLogData.d.ts +7 -0
  27. package/lib/external/CallingSDK/ICallingSDKLogData.js +3 -0
  28. package/lib/external/CallingSDK/ICallingSDKLogData.js.map +1 -0
  29. package/lib/index.d.ts +7 -6
  30. package/lib/index.js +13 -8
  31. package/lib/index.js.map +1 -1
  32. package/lib/telemetry/AriaTelemetry.d.ts +1 -0
  33. package/lib/telemetry/AriaTelemetry.js +50 -0
  34. package/lib/telemetry/AriaTelemetry.js.map +1 -1
  35. package/lib/telemetry/ScenarioType.d.ts +1 -0
  36. package/lib/telemetry/ScenarioType.js +1 -0
  37. package/lib/telemetry/ScenarioType.js.map +1 -1
  38. package/lib/tsconfig.tsbuildinfo +119 -43
  39. package/lib/utils/locale.d.ts +2 -1
  40. package/lib/utils/locale.js +5 -4
  41. package/lib/utils/locale.js.map +1 -1
  42. package/lib/utils/loggers.d.ts +18 -1
  43. package/lib/utils/loggers.js +70 -2
  44. package/lib/utils/loggers.js.map +1 -1
  45. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.
3
3
 
4
4
  ## [Unreleased]
5
5
 
6
+ ## [1.1.0] - 2022-04-15
6
7
  ### Added
7
8
  - Add `getPostChatSurveyContext` API method
8
9
  - Add `GetPostChatSurveyContext` telemetry event
@@ -11,17 +12,28 @@ All notable changes to this project will be documented in this file.
11
12
  - Add ability to automatically detect locale from chat config
12
13
  - Add `runtimeId` attribute in `OmnichannelChatSDK` & `ChatSDKRuntimeId` field in telemetry
13
14
  - Add ability to automatically pass locale from chat config on calling `ChatSDK.emailLiveChatTranscript()`
15
+ - Bubble up `WidgetUseOutsideOperatingHour` exception
16
+ - Add `acs_webchat-chat-adapter` middleware to add default `channelData.tags` & `channelData.metadata`
17
+ - Update `ChatConfig` interface with `msdyn_enablemarkdown` property
18
+ - Throw exception on `ChatSDK.getVoiceVideoCalling()` if feature is disabled or platform is not supported
19
+ - Add `participantType` & `canRenderPostChat` as response of getConversationDetails() API
20
+ - Add support for separate bot post chat survey feature
21
+ - Pass `logger` to `acs_webchat-chat-adapter`
14
22
 
15
23
  ### Fix
16
24
  - Add `acs_webchat-chat-adapter` middlewares to format `channelData.tags`
17
25
  - Skip `session init` call on existing conversation
18
26
  - Fix `chat reconnect` not ending the conversation on calling `ChatSDK.endChat()`
19
27
  - Fix on messaging client not sending heartbeat on new conversations subsequent to the first conversation
28
+ - Fix `ChatSDK.getConversationDetails()` not passing `authenticatedUserToken`
29
+ - Fix `IC3Client.dispose()` called when `IC3Client` is `undefined`
20
30
 
21
31
  ### Changed
22
32
  - README: added examples on usages of the post chat APIs.
23
33
  - Uptake [@azure/communication-chat@1.1.1](https://www.npmjs.com/package/@azure/communication-chat/v/1.1.1)
24
34
  - 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)
35
+ - Update `locale` property in `ChatTranscriptBody` interface to be optional
36
+ - Uptake [acs_webchat-chat-adapter@0.0.35-beta.4](https://unpkg.com/acs_webchat-chat-adapter@0.0.35-beta.4/dist/chat-adapter.js)
25
37
 
26
38
  ## [1.0.0] - 2021-10-08
27
39
  ### Added
package/README.md CHANGED
@@ -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) {
@@ -596,82 +596,93 @@ The following steps will be required to run Omnichannel Chat SDK on React Native
596
596
  console.log("VoiceVideoCalling loaded");
597
597
  } catch (e) {
598
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
+ }
599
607
  }
600
608
 
601
609
  await chatSDK.startChat();
602
610
 
603
611
  const chatToken: any = await chatSDK.getChatToken();
604
612
 
605
- try {
606
- await VoiceVideoCallingSDK.initialize({
607
- chatToken,
608
- selfVideoHTMLElementId: 'selfVideo', // HTML element id where video stream of the agent will be rendered
609
- remoteVideoHTMLElementId: 'remoteVideo', // HTML element id where video stream of the customer will be rendered
610
- OCClient: chatSDK.OCClient
611
- });
612
- } catch (e) {
613
- console.error("Failed to initialize VoiceVideoCalling!");
614
- }
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
+ }
615
625
 
616
- // Triggered when there's an incoming call
617
- VoiceVideoCallingSDK.onCallAdded(() => {
618
- ...
619
- });
626
+ // Triggered when there's an incoming call
627
+ VoiceVideoCallingSDK.onCallAdded(() => {
628
+ ...
629
+ });
620
630
 
621
- // Triggered when local video stream is available (e.g.: Local video added succesfully in selfVideoHTMLElement)
622
- VoiceVideoCallingSDK.onLocalVideoStreamAdded(() => {
623
- ...
624
- });
631
+ // Triggered when local video stream is available (e.g.: Local video added succesfully in selfVideoHTMLElement)
632
+ VoiceVideoCallingSDK.onLocalVideoStreamAdded(() => {
633
+ ...
634
+ });
625
635
 
626
- // Triggered when local video stream is unavailable (e.g.: Customer turning off local video)
627
- VoiceVideoCallingSDK.onLocalVideoStreamRemoved(() => {
628
- ...
629
- });
636
+ // Triggered when local video stream is unavailable (e.g.: Customer turning off local video)
637
+ VoiceVideoCallingSDK.onLocalVideoStreamRemoved(() => {
638
+ ...
639
+ });
630
640
 
631
- // Triggered when remote video stream is available (e.g.: Remote video added succesfully in remoteVideoHTMLElement)
632
- VoiceVideoCallingSDK.onRemoteVideoStreamAdded(() => {
633
- ...
634
- });
641
+ // Triggered when remote video stream is available (e.g.: Remote video added succesfully in remoteVideoHTMLElement)
642
+ VoiceVideoCallingSDK.onRemoteVideoStreamAdded(() => {
643
+ ...
644
+ });
635
645
 
636
- // Triggered when remote video stream is unavailable (e.g.: Agent turning off remote video)
637
- VoiceVideoCallingSDK.onRemoteVideoStreamRemoved(() => {
638
- ...
639
- });
646
+ // Triggered when remote video stream is unavailable (e.g.: Agent turning off remote video)
647
+ VoiceVideoCallingSDK.onRemoteVideoStreamRemoved(() => {
648
+ ...
649
+ });
640
650
 
641
- // Triggered when current call has ended or disconnected regardless the party
642
- VoiceVideoCalling.onCallDisconnected(() => {
643
- ...
644
- });
651
+ // Triggered when current call has ended or disconnected regardless the party
652
+ VoiceVideoCalling.onCallDisconnected(() => {
653
+ ...
654
+ });
645
655
 
646
- // Check if microphone is muted
647
- const isMicrophoneMuted = VoiceVideoCallingSDK.isMicrophoneMuted();
656
+ // Check if microphone is muted
657
+ const isMicrophoneMuted = VoiceVideoCallingSDK.isMicrophoneMuted();
648
658
 
649
- // Check if remote video is available
650
- const isRemoteVideoEnabled = VoiceVideoCallingSDK.isRemoteVideoEnabled();
659
+ // Check if remote video is available
660
+ const isRemoteVideoEnabled = VoiceVideoCallingSDK.isRemoteVideoEnabled();
651
661
 
652
- // Check if local video is available
653
- const isLocalVideoEnabled = VoiceVideoCallingSDK.isLocalVideoEnabled();
662
+ // Check if local video is available
663
+ const isLocalVideoEnabled = VoiceVideoCallingSDK.isLocalVideoEnabled();
654
664
 
655
- // Accepts incoming call
656
- const acceptCallConfig = {
657
- withVideo: true // Accept call with/without video stream
658
- };
659
- await VoiceVideoCallingSDK.acceptCall(acceptCallConfig);
665
+ // Accepts incoming call
666
+ const acceptCallConfig = {
667
+ withVideo: true // Accept call with/without video stream
668
+ };
669
+ await VoiceVideoCallingSDK.acceptCall(acceptCallConfig);
660
670
 
661
- // Rejects incoming call
662
- await VoiceVideoCallingSDK.rejectCall();
671
+ // Rejects incoming call
672
+ await VoiceVideoCallingSDK.rejectCall();
663
673
 
664
- // Ends/Stops current call
665
- await VoiceVideoCallingSDK.stopCall();
674
+ // Ends/Stops current call
675
+ await VoiceVideoCallingSDK.stopCall();
666
676
 
667
- // Mute/Unmute current call
668
- await VoiceVideoCallingSDK.toggleMute()
677
+ // Mute/Unmute current call
678
+ await VoiceVideoCallingSDK.toggleMute()
669
679
 
670
- // Display/Hide local video of current call
671
- await VoiceVideoCallingSDK.toggleLocalVideo()
680
+ // Display/Hide local video of current call
681
+ await VoiceVideoCallingSDK.toggleLocalVideo()
672
682
 
673
- // Clean up VoiceVideoCallingSDK (e.g.: Usually called when customer ends chat session)
674
- VoiceVideoCallingSDK.close();
683
+ // Clean up VoiceVideoCallingSDK (e.g.: Usually called when customer ends chat session)
684
+ VoiceVideoCallingSDK.close();
685
+ }
675
686
  ```
676
687
 
677
688
  ## Feature Comparisons
@@ -51,6 +51,7 @@ declare class OmnichannelChatSDK {
51
51
  private ocSdkLogger;
52
52
  private acsClientLogger;
53
53
  private acsAdapterLogger;
54
+ private callingSdkLogger;
54
55
  private isPersistentChat;
55
56
  private isChatReconnect;
56
57
  private reconnectId;