@microsoft/omnichannel-chat-widget 0.1.0-main.a7ac5de → 0.1.0-main.a7b2241
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/README.md +7 -34
- package/lib/cjs/assets/Icons.js +4 -2
- package/lib/cjs/common/Constants.js +7 -3
- package/lib/cjs/common/KeyCodes.js +3 -1
- package/lib/cjs/common/contextDataStore/DataStoreManager.js +3 -1
- package/lib/cjs/common/storage/default/defaultCacheManager.js +5 -3
- package/lib/cjs/common/storage/default/defaultClientDataStoreProvider.js +15 -6
- package/lib/cjs/common/telemetry/TelemetryConstants.js +13 -0
- package/lib/cjs/common/telemetry/TelemetryHelper.js +5 -2
- package/lib/cjs/common/telemetry/TelemetryManager.js +3 -1
- package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +1 -1
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +1 -1
- package/lib/cjs/components/headerstateful/HeaderStateful.js +6 -4
- package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +3 -1
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +139 -0
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +3 -1
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +3 -1
- package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +3 -1
- package/lib/cjs/components/livechatwidget/common/Deferred.js +3 -1
- package/lib/cjs/components/livechatwidget/common/createAdapter.js +2 -0
- package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +66 -14
- package/lib/cjs/components/livechatwidget/common/endChat.js +23 -17
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +25 -13
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +6 -9
- package/lib/cjs/components/livechatwidget/common/startChat.js +76 -53
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +44 -38
- package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +22 -2
- package/lib/cjs/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.js +57 -0
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +1 -1
- package/lib/cjs/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/common/mockadapter.js +3 -1
- package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +3 -1
- package/lib/cjs/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +2 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +3 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +3 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +1 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +2 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +5 -6
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +2 -14
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +2 -11
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +29 -28
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +5 -2
- package/lib/cjs/contexts/createReducer.js +8 -0
- package/lib/cjs/hooks/useDebounce.js +28 -0
- package/lib/cjs/hooks/useWindowDimensions.js +30 -0
- package/lib/cjs/plugins/newMessageEventHandler.js +14 -0
- package/lib/esm/assets/Icons.js +2 -1
- package/lib/esm/common/Constants.js +7 -3
- package/lib/esm/common/KeyCodes.js +3 -1
- package/lib/esm/common/contextDataStore/DataStoreManager.js +3 -1
- package/lib/esm/common/storage/default/defaultCacheManager.js +5 -3
- package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +15 -6
- package/lib/esm/common/telemetry/TelemetryConstants.js +13 -0
- package/lib/esm/common/telemetry/TelemetryHelper.js +5 -2
- package/lib/esm/common/telemetry/TelemetryManager.js +3 -1
- package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +1 -1
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +1 -1
- package/lib/esm/components/headerstateful/HeaderStateful.js +6 -4
- package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +3 -1
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +134 -0
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +3 -1
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +3 -1
- package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +3 -1
- package/lib/esm/components/livechatwidget/common/Deferred.js +3 -1
- package/lib/esm/components/livechatwidget/common/createAdapter.js +2 -0
- package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +66 -14
- package/lib/esm/components/livechatwidget/common/endChat.js +23 -17
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +25 -13
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +7 -9
- package/lib/esm/components/livechatwidget/common/startChat.js +76 -53
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +45 -39
- package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +22 -2
- package/lib/esm/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.js +50 -0
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +1 -1
- package/lib/esm/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/common/mockadapter.js +3 -1
- package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +3 -1
- package/lib/esm/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +2 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +3 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +3 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +1 -3
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +2 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +5 -6
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +2 -14
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +2 -11
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +29 -28
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +5 -2
- package/lib/esm/contexts/createReducer.js +8 -0
- package/lib/esm/hooks/useDebounce.js +22 -0
- package/lib/esm/hooks/useWindowDimensions.js +23 -0
- package/lib/esm/plugins/newMessageEventHandler.js +14 -0
- package/lib/types/assets/Icons.d.ts +1 -0
- package/lib/types/common/Constants.d.ts +2 -0
- package/lib/types/common/storage/default/defaultCacheManager.d.ts +1 -1
- package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +1 -1
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +14 -1
- package/lib/types/common/telemetry/definitions/Contracts.d.ts +2 -0
- package/lib/types/common/telemetry/definitions/Payload.d.ts +1 -0
- package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +4 -0
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.d.ts +9 -0
- package/lib/types/components/livechatwidget/common/startChat.d.ts +3 -3
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetControlProps.d.ts +2 -0
- package/lib/types/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.d.ts +1 -1
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -0
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +29 -28
- package/lib/types/hooks/useDebounce.d.ts +3 -0
- package/lib/types/hooks/useWindowDimensions.d.ts +4 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -11,8 +11,6 @@
|
|
|
11
11
|
1. [Installation](#installation)
|
|
12
12
|
1. [Example Usage](#example-usage)
|
|
13
13
|
1. [Components](#components)
|
|
14
|
-
1. [Common Scenarios](#common-scenarios)
|
|
15
|
-
- [Disable Bot Magic Code](#disable-bot-magic-code)
|
|
16
14
|
1. [See Also](#see-also)
|
|
17
15
|
|
|
18
16
|
## Introduction
|
|
@@ -97,7 +95,9 @@ const render = async () => {
|
|
|
97
95
|
render();
|
|
98
96
|
```
|
|
99
97
|
|
|
100
|
-
A sample widget can be found in this repo [here](https://github.com/microsoft/omnichannel-chat-widget/tree/main/chat-widget/sample). To build it, do ```yarn build-sample``` or ```yarn build-sample:dev``` from project root.
|
|
98
|
+
A javascript sample widget can be found in this repo [here](https://github.com/microsoft/omnichannel-chat-widget/tree/main/chat-widget/samples/javascript-sample). To build it, do ```yarn build-sample``` or ```yarn build-sample:dev``` from project root.
|
|
99
|
+
|
|
100
|
+
A typescript sample widget can be found [here](https://github.com/microsoft/omnichannel-chat-widget/tree/main/chat-widget/samples/typescript-sample)
|
|
101
101
|
|
|
102
102
|
## Components
|
|
103
103
|
|
|
@@ -129,6 +129,7 @@ These are components that are included in the ```@microsoft/omnichannel-chat-com
|
|
|
129
129
|
| ----- | -------- | ----- |
|
|
130
130
|
| WebChatContainer | The default wrapper around BotFramework's [WebChat](https://github.com/microsoft/BotFramework-WebChat), which is the message container we are using | [IWebChatContainerStatefulProps](https://github.com/microsoft/omnichannel-chat-widget/blob/main/chat-widget/src/components/webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps.ts) |
|
|
131
131
|
| LiveChatWidget | The default widget that stitches the UI components with Chat SDK | [ILiveChatWidgetProps](https://github.com/microsoft/omnichannel-chat-widget/blob/main/chat-widget/src/components/livechatwidget/interfaces/ILiveChatWidgetProps.ts) |
|
|
132
|
+
| PostChatLoadingPane | The default loading pane used after the chat is ended and before the post chat pane loads completely | [ILoadingPaneProps](https://github.com/microsoft/omnichannel-chat-widget/blob/main/chat-components/src/components/loadingpane/interfaces/ILoadingPaneProps.ts) |
|
|
132
133
|
|
|
133
134
|
Some of the interfaces listed in the Stateless table have Stateful counterparts defined in the ```@microsoft/omnichannel-chat-widget``` package. For example, [IConfirmationPaneStatefulProps](https://github.com/microsoft/omnichannel-chat-widget/blob/main/chat-widget/src/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulProps.ts) extends [IConfirmationPaneProps](https://github.com/microsoft/omnichannel-chat-widget/blob/main/chat-components/src/components/confirmationpane/interfaces/IConfirmationPaneProps.ts) with additional attributes that only makes sense in the stateful context.
|
|
134
135
|
|
|
@@ -220,40 +221,12 @@ const customizedFooterProp: IFooterProps = {
|
|
|
220
221
|
|
|
221
222
|
> :pushpin: Note that [WebChat hooks](https://github.com/microsoft/BotFramework-WebChat/blob/main/docs/HOOKS.md) can also be used in any custom components.
|
|
222
223
|
|
|
223
|
-
## Common Scenarios
|
|
224
|
-
|
|
225
|
-
### Disable Bot Magic Code
|
|
226
|
-
|
|
227
|
-
Configuration to disable the default behaviour of having to type the magic code in the conversation to complete the sign-in proccess with a bot. Instead, the magic code will be sent to the bot behind the scenes.
|
|
228
|
-
|
|
229
|
-
1. Add [MagicCodeForwarder.html](sample/MagicCodeForwarder.html) in the same location as the chat widget
|
|
230
|
-
|
|
231
|
-
2. Add `botMagicCode` configuration to disable default magic code feature
|
|
232
|
-
|
|
233
|
-
> :exclamation: `fwdUrl` **MUST** have the same `origin` as the chat widget URL
|
|
234
|
-
|
|
235
|
-
```js
|
|
236
|
-
const liveChatWidgetProps = {
|
|
237
|
-
chatSDK: chatSDK, // mandatory
|
|
238
|
-
chatConfig: chatConfig, // mandatory
|
|
239
|
-
webChatContainerProps: {
|
|
240
|
-
botMagicCode: {
|
|
241
|
-
disabled: true,
|
|
242
|
-
fwdUrl: 'http://localhost:8000/sample/MagicCodeForwarder.html'
|
|
243
|
-
}
|
|
244
|
-
},
|
|
245
|
-
};
|
|
246
|
-
|
|
247
|
-
ReactDOM.render(
|
|
248
|
-
<LiveChatWidget {...liveChatWidgetProps}/>,
|
|
249
|
-
document.getElementById("my-container")
|
|
250
|
-
);
|
|
251
|
-
```
|
|
252
|
-
|
|
253
224
|
## See Also
|
|
254
225
|
|
|
255
226
|
[Telemetry](https://github.com/microsoft/omnichannel-chat-widget/blob/main/docs/Telemetry.md)\
|
|
256
227
|
[Create LCW widget with Webpack5 and TypeScript](https://github.com/microsoft/omnichannel-chat-widget/blob/main/docs/BuildingUsingWebpack5.md)\
|
|
257
228
|
[Omnichannel Features](https://github.com/microsoft/omnichannel-chat-widget/blob/main/docs/Features.md)\
|
|
258
229
|
[How to Add Visual Regression Tests](https://github.com/microsoft/omnichannel-chat-widget/blob/main/docs/VisualRegressionTestingGuide.md)\
|
|
259
|
-
[Security](https://github.com/microsoft/omnichannel-chat-widget/blob/main/SECURITY.md)
|
|
230
|
+
[Security](https://github.com/microsoft/omnichannel-chat-widget/blob/main/SECURITY.md)\
|
|
231
|
+
[Third Party Cookie Support](https://github.com/microsoft/omnichannel-chat-widget/blob/main/docs/Tpc.md)\
|
|
232
|
+
[Storybook](https://microsoft.github.io/omnichannel-chat-widget/docs/storybook/)
|
package/lib/cjs/assets/Icons.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.WordIcon = exports.VisioIcon = exports.VideoIcon = exports.PowerpointIcon = exports.PDFIcon = exports.OneNoteIcon = exports.ImageIcon = exports.ExcelIcon = exports.BlankIcon = exports.AudioIcon = exports.ArchiveIcon = void 0;
|
|
6
|
+
exports.WordIcon = exports.VisioIcon = exports.VideoIcon = exports.PowerpointIcon = exports.PDFIcon = exports.OneNoteIcon = exports.ImageIcon = exports.ExcelIcon = exports.BlankIcon = exports.AudioIcon = exports.ArchiveIcon = exports.AlertIcon = void 0;
|
|
7
7
|
const ArchiveIcon = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMDQ4IDIwNDgiIHdpZHRoPSIxMnB4IiBoZWlnaHQ9IjEycHgiPg0KPHBhdGggZD0iTTE3OTIgMHEyNyAwIDUwIDEwdDQwIDI3IDI4IDQxIDEwIDUwdjQ4MHEwIDQ1LTkgNzd0LTI0IDU4LTMxIDQ2LTMxIDQwLTIzIDQ0LTEwIDU1djk5MnEwIDI3LTEwIDUwdC0yNyA0MC00MSAyOC01MCAxMEgyNTZWMGgxNTM2ek02NDAgMTI4djM4NGgyNTZWMTI4SDY0MHptMTAyNCA4MDBxMC0zMS05LTU0dC0yNC00NC0zMS00MS0zMS00NS0yMy01OC0xMC03OFYxMjhoLTUxMnY1MTJINzY4djEyOEg2NDBWNjQwSDUxMlYxMjhIMzg0djE3OTJoMzg0di0xMjhoMTI4djEyOGg3NjhWOTI4em0xMjgtODAwaC0xMjh2NDgwcTAgMjQgNCA0MnQxMyAzMyAyMCAyOSAyNyAzMnExNS0xNyAyNi0zMXQyMC0zMCAxMy0zMyA1LTQyVjEyOHpNNjQwIDg5NmgxMjh2MTI4SDY0MFY4OTZ6bTAgMjU2aDEyOHYxMjhINjQwdi0xMjh6bTAgMjU2aDEyOHYxMjhINjQwdi0xMjh6bTEyOCAyNTZ2MTI4SDY0MHYtMTI4aDEyOHptMC03NjhWNzY4aDEyOHYxMjhINzY4em0wIDI1NnYtMTI4aDEyOHYxMjhINzY4em0wIDI1NnYtMTI4aDEyOHYxMjhINzY4em0wIDI1NnYtMTI4aDEyOHYxMjhINzY4eiIgLz4NCjwvc3ZnPg==";
|
|
8
8
|
exports.ArchiveIcon = ArchiveIcon;
|
|
9
9
|
const AudioIcon = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciDQogICAgdmlld0JveD0iMCAwIDIwNDggMjA0OCINCiAgICB3aWR0aD0iMTJweCINCiAgICBoZWlnaHQ9IjEycHgiPg0KICAgIDxwYXRoIGQ9Ik0xNzkyIDE0MDhxMCA2Mi0yOSAxMDl0LTc2IDgwLTEwNCA1MC0xMTEgMTdxLTU0IDAtMTExLTE3dC0xMDMtNDktNzYtODAtMzAtMTEwcTAtNjEgMjktMTA5dDc2LTgwIDEwNC01MCAxMTEtMTdxNTEgMCAxMDAgMTJ0OTIgMzlWMjI2TDc2OCA0NTB2MTIxNHEwIDYyLTI5IDEwOXQtNzYgODAtMTA0IDUwLTExMSAxN3EtNTQgMC0xMTEtMTd0LTEwMy00OS03Ni04MC0zMC0xMTBxMC02MSAyOS0xMDl0NzYtODAgMTA0LTUwIDExMS0xN3E1MSAwIDEwMCAxMnQ5MiAzOVYzNTBMMTc5MiA2MnYxMzQ2eiIgLz4NCjwvc3ZnPg==";
|
|
@@ -25,4 +25,6 @@ exports.VideoIcon = VideoIcon;
|
|
|
25
25
|
const VisioIcon = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciDQogICAgdmlld0JveD0iMCAwIDIwNDggMjA0OCINCiAgICB3aWR0aD0iMTJweCINCiAgICBoZWlnaHQ9IjEycHgiPg0KICAgIDxwYXRoIGQ9Ik0yMDQ4IDQ3NXYxNDQ1cTAgMjctMTAgNTB0LTI3IDQwLTQxIDI4LTUwIDEwSDY0MHEtMjcgMC01MC0xMHQtNDAtMjctMjgtNDEtMTAtNTB2LTI1NkgxMTVxLTI0IDAtNDQtOXQtMzctMjUtMjUtMzYtOS00NVY2MjdxMC0yNCA5LTQ0dDI1LTM3IDM2LTI1IDQ1LTloMzk3VjEyOHEwLTI3IDEwLTUwdDI3LTQwIDQxLTI4IDUwLTEwaDkzM3EyNiAwIDQ5IDl0NDIgMjhsMzQ3IDM0N3ExOCAxOCAyNyA0MXQxMCA1MHptLTM4NC0yNTZ2MTY1aDE2NWwtMTY1LTE2NXpNNDkzIDE0MjRoMTYzbDI1NS02NzJINzQ1bC0xNDcgNDI3cS01IDE2LTEwIDMxdC0xMSAzMXEtNDEtMTIzLTgyLTI0NHQtODQtMjQ1SDI0MWwyNDggNjYyIDQgMTB6bTE0NyA0OTZoMTI4MFY1MTJoLTI1NnEtMjcgMC01MC0xMHQtNDAtMjctMjgtNDEtMTAtNTBWMTI4SDY0MHYzODRoMzk3cTI0IDAgNDQgOXQzNyAyNSAyNSAzNiA5IDQ1djkyMnEwIDI0LTkgNDR0LTI1IDM3LTM2IDI1LTQ1IDlINjQwdjI1NnptOTYwLTEyODBsMTkyIDE5Mi0xMjggMTI4djQ0OGgtMjU2djEyOGgtMTI4di0zODRoMTI4djEyOGgxMjhWOTYwbC0xMjgtMTI4IDE5Mi0xOTJ6IiAvPg0KPC9zdmc+";
|
|
26
26
|
exports.VisioIcon = VisioIcon;
|
|
27
27
|
const WordIcon = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciDQogICAgdmlld0JveD0iMCAwIDIwNDggMjA0OCINCiAgICB3aWR0aD0iMTJweCINCiAgICBoZWlnaHQ9IjEycHgiPg0KICAgIDxwYXRoIGQ9Ik0yMDQ4IDQ3NXYxNDQ1cTAgMjctMTAgNTB0LTI3IDQwLTQxIDI4LTUwIDEwSDY0MHEtMjcgMC01MC0xMHQtNDAtMjctMjgtNDEtMTAtNTB2LTI1NkgxMTVxLTI0IDAtNDQtOXQtMzctMjUtMjUtMzYtOS00NVY2MjdxMC0yNCA5LTQ0dDI1LTM3IDM2LTI1IDQ1LTloMzk3VjEyOHEwLTI3IDEwLTUwdDI3LTQwIDQxLTI4IDUwLTEwaDkzM3EyNiAwIDQ5IDl0NDIgMjhsMzQ3IDM0N3ExOCAxOCAyNyA0MXQxMCA1MHptLTM4NC0yNTZ2MTY1aDE2NWwtMTY1LTE2NXpNMzIwIDE0MjRoMTYxcTItOCA5LTQzdDE4LTgzIDIxLTEwMyAyMi0xMDEgMTYtNzYgOC0zMWw3IDMwcTcgMzAgMTcgNzd0MjMgMTAwIDIzIDEwMyAxOSA4NCAxMCA0M2gxNjBsMTQ4LTY3Mkg4MzRsLTgwIDQzOC0xMDAtNDM4SDUwMmwtOTYgNDQwLTg2LTQ0MEgxNzBsMTUwIDY3MnptMzIwIDQ5NmgxMjgwVjUxMmgtMjU2cS0yNyAwLTUwLTEwdC00MC0yNy0yOC00MS0xMC01MFYxMjhINjQwdjM4NGgzOTdxMjQgMCA0NCA5dDM3IDI1IDI1IDM2IDkgNDV2OTIycTAgMjQtOSA0NHQtMjUgMzctMzYgMjUtNDUgOUg2NDB2MjU2em02NDAtMTAyNFY3NjhoNTEydjEyOGgtNTEyem0wIDI1NnYtMTI4aDUxMnYxMjhoLTUxMnptMCAyNTZ2LTEyOGg1MTJ2MTI4aC01MTJ6IiAvPg0KPC9zdmc+";
|
|
28
|
-
exports.WordIcon = WordIcon;
|
|
28
|
+
exports.WordIcon = WordIcon;
|
|
29
|
+
const AlertIcon = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMC8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvVFIvMjAwMS9SRUMtU1ZHLTIwMDEwOTA0L0RURC9zdmcxMC5kdGQnPjxzdmcgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjQgMjQiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjAiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PHBhdGggZD0iTTEzLDE3aC0ydi0yaDJWMTd6IE0xMywxM2gtMlY3aDJWMTN6Ii8+PGc+PHBhdGggZD0iTTEyLDRjNC40LDAsOCwzLjYsOCw4cy0zLjYsOC04LDhzLTgtMy42LTgtOFM3LjYsNCwxMiw0IE0xMiwyQzYuNSwyLDIsNi41LDIsMTJjMCw1LjUsNC41LDEwLDEwLDEwczEwLTQuNSwxMC0xMCAgIEMyMiw2LjUsMTcuNSwyLDEyLDJMMTIsMnoiLz48L2c+PC9zdmc+";
|
|
30
|
+
exports.AlertIcon = AlertIcon;
|
|
@@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.WebChatMiddlewareConstants = exports.TranscriptConstants = exports.Regex = exports.MimeTypes = exports.LocaleConstants = exports.LiveWorkItemState = exports.HtmlIdNames = exports.HtmlElementSelectors = exports.HtmlClassNames = exports.HtmlAttributeNames = exports.EnvironmentVersion = exports.ElementType = exports.E2VVOptions = exports.Constants = exports.ChatSDKError = exports.AriaTelemetryConstants = void 0;
|
|
7
7
|
var _class;
|
|
8
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
10
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
9
11
|
class Constants {}
|
|
10
12
|
exports.Constants = Constants;
|
|
11
13
|
_defineProperty(Constants, "magicCodeBroadcastChannel", "MagicCodeChannel");
|
|
@@ -49,8 +51,8 @@ _defineProperty(Constants, "acsChannel", "ACS_CHANNEL");
|
|
|
49
51
|
_defineProperty(Constants, "publicMessageTag", "public");
|
|
50
52
|
_defineProperty(Constants, "supportedAdaptiveCardContentTypes", ["application/vnd.microsoft.card.adaptive", "application/vnd.microsoft.card.audio", "application/vnd.microsoft.card.hero", "application/vnd.microsoft.card.receipt", "application/vnd.microsoft.card.thumbnail", "application/vnd.microsoft.card.signin", "application/vnd.microsoft.card.oauth"]);
|
|
51
53
|
_defineProperty(Constants, "maxUploadFileSize", "500000");
|
|
52
|
-
_defineProperty(Constants, "imageRegex", /(\.)(jpeg|jpg|jiff|png|gif|bmp)$/i);
|
|
53
|
-
_defineProperty(Constants, "audioMediaRegex", /(\.)(aac|aiff|alac|flac|mp2|mp3|pcm|wav|wma)$/i);
|
|
54
|
+
_defineProperty(Constants, "imageRegex", /(\.)(jpeg|jpg|jiff|png|gif|bmp|webp)$/i);
|
|
55
|
+
_defineProperty(Constants, "audioMediaRegex", /(\.)(aac|aiff|alac|amr|flac|mp2|mp3|pcm|wav|wma)$/i);
|
|
54
56
|
_defineProperty(Constants, "videoMediaRegex", /(\.)(avchd|avi|flv|mpe|mpeg|mpg|mpv|mp4|m4p|m4v|mov|qt|swf|webm|wmv)$/i);
|
|
55
57
|
_defineProperty(Constants, "chromeSupportedInlineMediaRegex", /(\.)(aac|mp3|wav|mp4)$/i);
|
|
56
58
|
_defineProperty(Constants, "firefoxSupportedInlineMediaRegex", /(\.)(aac|flac|mp3|wav|mp4|mov)$/i);
|
|
@@ -87,6 +89,7 @@ _defineProperty(Constants, "internetConnectionTestUrlText", "Omnichannel Connect
|
|
|
87
89
|
_defineProperty(Constants, "ChatWidgetStateChangedPrefix", "ChatWidgetStateChanged");
|
|
88
90
|
_defineProperty(Constants, "PostChatLoadingDurationInMs", 2000);
|
|
89
91
|
_defineProperty(Constants, "BrowserUnloadConfirmationMessage", "Do you want to leave chat?");
|
|
92
|
+
_defineProperty(Constants, "CacheTtlInMinutes", 15);
|
|
90
93
|
const Regex = (_class = class Regex {}, _defineProperty(_class, "EmailRegex", "(?:[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])"), _class);
|
|
91
94
|
exports.Regex = Regex;
|
|
92
95
|
class HtmlIdNames {}
|
|
@@ -132,6 +135,7 @@ _defineProperty(HtmlAttributeNames, "noreferrerTag", "noreferrer");
|
|
|
132
135
|
_defineProperty(HtmlAttributeNames, "adaptiveCardClassName", "ac-adaptiveCard");
|
|
133
136
|
_defineProperty(HtmlAttributeNames, "adaptiveCardTextBlockClassName", "ac-textBlock");
|
|
134
137
|
_defineProperty(HtmlAttributeNames, "adaptiveCardToggleInputClassName", "ac-toggleInput");
|
|
138
|
+
_defineProperty(HtmlAttributeNames, "adaptiveCardActionSetClassName", "ac-actionSet");
|
|
135
139
|
class WebChatMiddlewareConstants {}
|
|
136
140
|
exports.WebChatMiddlewareConstants = WebChatMiddlewareConstants;
|
|
137
141
|
_defineProperty(WebChatMiddlewareConstants, "nextVisibleActivity", "nextVisibleActivity");
|
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.KeyCodes = void 0;
|
|
7
7
|
var _class;
|
|
8
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
10
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
9
11
|
const KeyCodes = (_class = class KeyCodes {}, _defineProperty(_class, "ENTER", "Enter"), _defineProperty(_class, "TAB", "Tab"), _class);
|
|
10
12
|
exports.KeyCodes = KeyCodes;
|
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.DataStoreManager = void 0;
|
|
7
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
9
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
10
|
class DataStoreManager {}
|
|
9
11
|
exports.DataStoreManager = DataStoreManager;
|
|
10
12
|
_defineProperty(DataStoreManager, "clientDataStore", void 0);
|
|
@@ -7,15 +7,17 @@ exports.registerBroadcastServiceForLocalStorage = exports.defaultCacheManager =
|
|
|
7
7
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
8
8
|
var _utils = require("../../utils");
|
|
9
9
|
var _defaultClientDataStoreProvider = require("./defaultClientDataStoreProvider");
|
|
10
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
12
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
13
|
class defaultCacheManager {}
|
|
12
14
|
exports.defaultCacheManager = defaultCacheManager;
|
|
13
15
|
_defineProperty(defaultCacheManager, "InternalCache", {});
|
|
14
|
-
const registerBroadcastServiceForLocalStorage = (orgid, widgetId, widgetInstanceId) => {
|
|
16
|
+
const registerBroadcastServiceForLocalStorage = (orgid, widgetId, widgetInstanceId, ttlInMins) => {
|
|
15
17
|
const widgetCacheId = (0, _utils.getWidgetCacheId)(orgid, widgetId, widgetInstanceId);
|
|
16
18
|
_omnichannelChatComponents.BroadcastService.getMessageByEventName(widgetCacheId).subscribe(msg => {
|
|
17
19
|
try {
|
|
18
|
-
(0, _defaultClientDataStoreProvider.defaultClientDataStoreProvider)().setData(widgetCacheId, JSON.stringify(msg.payload), "localStorage");
|
|
20
|
+
(0, _defaultClientDataStoreProvider.defaultClientDataStoreProvider)(ttlInMins).setData(widgetCacheId, JSON.stringify(msg.payload), "localStorage");
|
|
19
21
|
} catch (error) {
|
|
20
22
|
console.error("Error in setting data to localstorage", error);
|
|
21
23
|
}
|
|
@@ -4,21 +4,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.defaultClientDataStoreProvider = void 0;
|
|
7
|
-
var _defaultInMemoryDataStore = require("./defaultInMemoryDataStore");
|
|
8
|
-
var _TelemetryHelper = require("../../telemetry/TelemetryHelper");
|
|
9
7
|
var _TelemetryConstants = require("../../telemetry/TelemetryConstants");
|
|
10
|
-
|
|
8
|
+
var _TelemetryHelper = require("../../telemetry/TelemetryHelper");
|
|
9
|
+
var _defaultInMemoryDataStore = require("./defaultInMemoryDataStore");
|
|
10
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
11
|
+
|
|
12
|
+
const defaultClientDataStoreProvider = function () {
|
|
13
|
+
let cacheTtlinMins = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
14
|
+
let ttlInMs = 0;
|
|
11
15
|
const isCookieAllowed = () => {
|
|
12
16
|
try {
|
|
13
17
|
localStorage;
|
|
14
18
|
sessionStorage;
|
|
15
19
|
return true;
|
|
16
20
|
} catch (error) {
|
|
17
|
-
|
|
21
|
+
if (!window.TPCWarningShown) {
|
|
22
|
+
console.warn("Third party cookies blocked.");
|
|
23
|
+
window.TPCWarningShown = true;
|
|
24
|
+
}
|
|
18
25
|
return false;
|
|
19
26
|
}
|
|
20
27
|
};
|
|
21
|
-
|
|
28
|
+
if (ttlInMs == 0) {
|
|
29
|
+
ttlInMs = cacheTtlinMins * 60 * 1000;
|
|
30
|
+
}
|
|
22
31
|
const dataStoreProvider = {
|
|
23
32
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
33
|
setData: (key, data, type) => {
|
|
@@ -28,7 +37,7 @@ const defaultClientDataStoreProvider = () => {
|
|
|
28
37
|
const now = new Date();
|
|
29
38
|
const item = {
|
|
30
39
|
data: data,
|
|
31
|
-
expiry: now.getTime() +
|
|
40
|
+
expiry: now.getTime() + ttlInMs
|
|
32
41
|
};
|
|
33
42
|
const strItem = JSON.stringify(item);
|
|
34
43
|
if (type === "localStorage") {
|
|
@@ -54,6 +54,11 @@ exports.BroadcastEvent = BroadcastEvent;
|
|
|
54
54
|
BroadcastEvent["InitiateEndChatOnBrowserUnload"] = "InitiateEndChatOnBrowserUnload";
|
|
55
55
|
BroadcastEvent["ClosePopoutWindow"] = "ClosePopoutWindow";
|
|
56
56
|
BroadcastEvent["RaiseErrorEvent"] = "RaiseErrorEvent";
|
|
57
|
+
BroadcastEvent["NetworkDisconnected"] = "NetworkDisconnected";
|
|
58
|
+
BroadcastEvent["NetworkReconnected"] = "NetworkReconnected";
|
|
59
|
+
BroadcastEvent["SigninCardReceived"] = "SignInCardReceived";
|
|
60
|
+
BroadcastEvent["BotAuthConfigRequest"] = "BotAuthConfigRequest";
|
|
61
|
+
BroadcastEvent["BotAuthConfigResponse"] = "BotAuthConfigResponse";
|
|
57
62
|
})(BroadcastEvent || (exports.BroadcastEvent = BroadcastEvent = {}));
|
|
58
63
|
let TelemetryEvent;
|
|
59
64
|
exports.TelemetryEvent = TelemetryEvent;
|
|
@@ -115,6 +120,7 @@ exports.TelemetryEvent = TelemetryEvent;
|
|
|
115
120
|
TelemetryEvent["DownloadTranscriptResponseNullOrUndefined"] = "DownloadTranscriptResponseNullOrUndefined";
|
|
116
121
|
TelemetryEvent["EmailTranscriptSent"] = "EmailTranscriptSent";
|
|
117
122
|
TelemetryEvent["EmailTranscriptFailed"] = "EmailTranscriptFailed";
|
|
123
|
+
TelemetryEvent["ErrorUIPaneLoaded"] = "ErrorUIPaneLoaded";
|
|
118
124
|
TelemetryEvent["DownloadTranscriptFailed"] = "DownloadTranscriptFailed";
|
|
119
125
|
TelemetryEvent["StartChatFailed"] = "StartChatFailed";
|
|
120
126
|
TelemetryEvent["IC3ThreadUpdateEventReceived"] = "IC3ThreadUpdateEventReceived";
|
|
@@ -144,6 +150,11 @@ exports.TelemetryEvent = TelemetryEvent;
|
|
|
144
150
|
TelemetryEvent["CustomerVoiceResponsePageLoaded"] = "CustomerVoiceResponsePageLoaded";
|
|
145
151
|
TelemetryEvent["CustomerVoiceFormResponseSubmitted"] = "CustomerVoiceFormResponseSubmitted";
|
|
146
152
|
TelemetryEvent["CustomerVoiceFormResponseError"] = "CustomerVoiceFormResponseError";
|
|
153
|
+
TelemetryEvent["BotAuthActivityEmptySasUrl"] = "BotAuthActivityEmptySasUrl";
|
|
154
|
+
TelemetryEvent["SetBotAuthProviderFetchConfig"] = "SetBotAuthProviderFetchConfig";
|
|
155
|
+
TelemetryEvent["SetBotAuthProviderHideCard"] = "SetBotAuthProviderHideCard";
|
|
156
|
+
TelemetryEvent["SetBotAuthProviderDisplayCard"] = "SetBotAuthProviderDisplayCard";
|
|
157
|
+
TelemetryEvent["SetBotAuthProviderNotFound"] = "SetBotAuthProviderNotFound";
|
|
147
158
|
TelemetryEvent["ProcessingHTMLTextMiddlewareFailed"] = "ProcessingHTMLTextMiddlewareFailed";
|
|
148
159
|
TelemetryEvent["ProcessingSanitizationMiddlewareFailed"] = "ProcessingSanitizationMiddlewareFailed";
|
|
149
160
|
TelemetryEvent["FormatTagsMiddlewareJSONStringifyFailed"] = "FormatTagsMiddlewareJSONStringifyFailed";
|
|
@@ -170,6 +181,8 @@ exports.TelemetryEvent = TelemetryEvent;
|
|
|
170
181
|
TelemetryEvent["ReconnectChatMinimize"] = "ReconnectChatMinimize";
|
|
171
182
|
TelemetryEvent["MessageSent"] = "MessageSent";
|
|
172
183
|
TelemetryEvent["MessageReceived"] = "MessageReceived";
|
|
184
|
+
TelemetryEvent["SystemMessageReceived"] = "SystemMessageReceived";
|
|
185
|
+
TelemetryEvent["HistoryMessageReceived"] = "HistoryMessageReceived";
|
|
173
186
|
TelemetryEvent["CustomContextReceived"] = "CustomContextReceived";
|
|
174
187
|
TelemetryEvent["NetworkDisconnected"] = "NetworkDisconnected";
|
|
175
188
|
TelemetryEvent["NetworkReconnected"] = "NetworkReconnected";
|
|
@@ -8,7 +8,9 @@ var _TelemetryConstants = require("./TelemetryConstants");
|
|
|
8
8
|
var _utils = require("../utils");
|
|
9
9
|
var _TelemetryManager = require("./TelemetryManager");
|
|
10
10
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
11
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
13
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
12
14
|
class TelemetryHelper {
|
|
13
15
|
static buildTelemetryEvent(level, input) {
|
|
14
16
|
switch (input.scenarioType) {
|
|
@@ -60,6 +62,7 @@ class TelemetryHelper {
|
|
|
60
62
|
event.ElapsedTimeInMilliseconds = payload.ElapsedTimeInMilliseconds;
|
|
61
63
|
event.ExceptionDetails = JSON.stringify(payload.ExceptionDetails);
|
|
62
64
|
event.Description = payload.Description;
|
|
65
|
+
event.CustomProperties = JSON.stringify(payload.CustomProperties);
|
|
63
66
|
});
|
|
64
67
|
}
|
|
65
68
|
static conformToWebChatContract(level, input) {
|
|
@@ -165,7 +168,7 @@ class TelemetryHelper {
|
|
|
165
168
|
telemetryDataLocal.widgetId = telemetryConfig === null || telemetryConfig === void 0 ? void 0 : telemetryConfig.appId;
|
|
166
169
|
telemetryDataLocal.orgId = telemetryConfig === null || telemetryConfig === void 0 ? void 0 : telemetryConfig.orgId;
|
|
167
170
|
telemetryDataLocal.orgUrl = telemetryConfig === null || telemetryConfig === void 0 ? void 0 : telemetryConfig.orgUrl;
|
|
168
|
-
telemetryDataLocal.lcwRuntimeId = (0, _utils.newGuid)();
|
|
171
|
+
telemetryDataLocal.lcwRuntimeId = telemetryConfig.LCWRuntimeId ?? (0, _utils.newGuid)();
|
|
169
172
|
return telemetryDataLocal;
|
|
170
173
|
}
|
|
171
174
|
static addSessionDataToTelemetry(chatSession, telemetryInternalData) {
|
|
@@ -10,7 +10,9 @@ var _ariaTelemetryLogger = require("./loggers/ariaTelemetryLogger");
|
|
|
10
10
|
var _consoleLogger = require("./loggers/consoleLogger");
|
|
11
11
|
var _defaultAriaConfig = require("./defaultConfigs/defaultAriaConfig");
|
|
12
12
|
var _TelemetryHelper = require("./TelemetryHelper");
|
|
13
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
15
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
14
16
|
class TelemetryTimers {}
|
|
15
17
|
exports.TelemetryTimers = TelemetryTimers;
|
|
16
18
|
_defineProperty(TelemetryTimers, "LcwLoadToChatButtonTimer", void 0);
|
|
@@ -90,7 +90,7 @@ const ConfirmationPaneStateful = props => {
|
|
|
90
90
|
Event: _TelemetryConstants.TelemetryEvent.ConfirmationPaneLoaded
|
|
91
91
|
});
|
|
92
92
|
}, []);
|
|
93
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null,
|
|
93
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_DimLayer.DimLayer, {
|
|
94
94
|
brightness: (controlProps === null || controlProps === void 0 ? void 0 : controlProps.brightnessValueOnDim) ?? "0.2"
|
|
95
95
|
}), /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.ConfirmationPane, {
|
|
96
96
|
componentOverrides: props === null || props === void 0 ? void 0 : props.componentOverrides,
|
|
@@ -97,7 +97,7 @@ const EmailTranscriptPaneStateful = props => {
|
|
|
97
97
|
Event: _TelemetryConstants.TelemetryEvent.EmailTranscriptLoaded
|
|
98
98
|
});
|
|
99
99
|
}, [initialEmail]);
|
|
100
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null,
|
|
100
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_DimLayer.DimLayer, {
|
|
101
101
|
brightness: (controlProps === null || controlProps === void 0 ? void 0 : controlProps.brightnessValueOnDim) ?? "0.2"
|
|
102
102
|
}), /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.InputValidationPane, {
|
|
103
103
|
componentOverrides: props.componentOverrides,
|
|
@@ -30,6 +30,7 @@ const HeaderStateful = props => {
|
|
|
30
30
|
const [outOfOperatingHours, setOutOfOperatingHours] = (0, _react.useState)(((_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : (_state$domainStates$l2 = _state$domainStates$l.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.OutOfOperatingHours) === "True");
|
|
31
31
|
const outOfOfficeStyleProps = Object.assign({}, _defaultOutOfOfficeHeaderStyleProps.defaultOutOfOfficeHeaderStyleProps, outOfOfficeHeaderProps === null || outOfOfficeHeaderProps === void 0 ? void 0 : outOfOfficeHeaderProps.styleProps);
|
|
32
32
|
const conversationState = (0, _react.useRef)(state.appStates.conversationState);
|
|
33
|
+
const conversationEndedByAgent = (0, _react.useRef)(state.appStates.conversationEndedByAgent);
|
|
33
34
|
const controlProps = {
|
|
34
35
|
id: "oc-lcw-header",
|
|
35
36
|
dir: state.domainStates.globalDir,
|
|
@@ -49,7 +50,7 @@ const HeaderStateful = props => {
|
|
|
49
50
|
Event: _TelemetryConstants.TelemetryEvent.HeaderCloseButtonClicked,
|
|
50
51
|
Description: "Header Close button clicked."
|
|
51
52
|
});
|
|
52
|
-
if (conversationState.current === _ConversationState.ConversationState.Active) {
|
|
53
|
+
if (conversationState.current === _ConversationState.ConversationState.Active || conversationEndedByAgent.current) {
|
|
53
54
|
dispatch({
|
|
54
55
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_SHOW_CONFIRMATION,
|
|
55
56
|
payload: true
|
|
@@ -69,9 +70,9 @@ const HeaderStateful = props => {
|
|
|
69
70
|
}
|
|
70
71
|
},
|
|
71
72
|
...(headerProps === null || headerProps === void 0 ? void 0 : headerProps.controlProps),
|
|
72
|
-
hideTitle: state.appStates.conversationState === _ConversationState.ConversationState.Loading || state.appStates.conversationState === _ConversationState.ConversationState.PostchatLoading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP = headerProps.controlProps) === null || _headerProps$controlP === void 0 ? void 0 : _headerProps$controlP.hideTitle),
|
|
73
|
-
hideIcon: state.appStates.conversationState === _ConversationState.ConversationState.Loading || state.appStates.conversationState === _ConversationState.ConversationState.PostchatLoading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP2 = headerProps.controlProps) === null || _headerProps$controlP2 === void 0 ? void 0 : _headerProps$controlP2.hideIcon),
|
|
74
|
-
hideCloseButton: state.appStates.conversationState === _ConversationState.ConversationState.Loading || state.appStates.conversationState === _ConversationState.ConversationState.Prechat || state.appStates.conversationState === _ConversationState.ConversationState.ReconnectChat || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP3 = headerProps.controlProps) === null || _headerProps$controlP3 === void 0 ? void 0 : _headerProps$controlP3.hideCloseButton)
|
|
73
|
+
hideTitle: state.appStates.conversationState === _ConversationState.ConversationState.Loading && !state.appStates.isStartChatFailing || state.appStates.conversationState === _ConversationState.ConversationState.PostchatLoading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP = headerProps.controlProps) === null || _headerProps$controlP === void 0 ? void 0 : _headerProps$controlP.hideTitle),
|
|
74
|
+
hideIcon: state.appStates.conversationState === _ConversationState.ConversationState.Loading && !state.appStates.isStartChatFailing || state.appStates.conversationState === _ConversationState.ConversationState.PostchatLoading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP2 = headerProps.controlProps) === null || _headerProps$controlP2 === void 0 ? void 0 : _headerProps$controlP2.hideIcon),
|
|
75
|
+
hideCloseButton: state.appStates.conversationState === _ConversationState.ConversationState.Loading && !state.appStates.isStartChatFailing || state.appStates.conversationState === _ConversationState.ConversationState.PostchatLoading || state.appStates.conversationState === _ConversationState.ConversationState.Prechat || state.appStates.conversationState === _ConversationState.ConversationState.ReconnectChat || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP3 = headerProps.controlProps) === null || _headerProps$controlP3 === void 0 ? void 0 : _headerProps$controlP3.hideCloseButton)
|
|
75
76
|
};
|
|
76
77
|
const outOfOfficeControlProps = {
|
|
77
78
|
id: "oc-lcw-header",
|
|
@@ -95,6 +96,7 @@ const HeaderStateful = props => {
|
|
|
95
96
|
if (state.appStates.conversationState) {
|
|
96
97
|
conversationState.current = state.appStates.conversationState;
|
|
97
98
|
}
|
|
99
|
+
conversationEndedByAgent.current = state.appStates.conversationEndedByAgent;
|
|
98
100
|
}, [state.appStates]);
|
|
99
101
|
return /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.Header, {
|
|
100
102
|
componentOverrides: headerProps === null || headerProps === void 0 ? void 0 : headerProps.componentOverrides,
|
|
@@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.ActivityStreamHandler = void 0;
|
|
7
7
|
var _Deferred = require("./Deferred");
|
|
8
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
10
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
9
11
|
class ActivityStreamHandler {
|
|
10
12
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
13
|
|
package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BotAuthActivitySubscriber = void 0;
|
|
7
|
+
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
8
|
+
var _TelemetryConstants = require("../../../../common/telemetry/TelemetryConstants");
|
|
9
|
+
var _TelemetryHelper = require("../../../../common/telemetry/TelemetryHelper");
|
|
10
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
12
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
|
+
const supportedSignInCardContentTypes = ["application/vnd.microsoft.card.signin", "application/vnd.microsoft.card.oauth"];
|
|
14
|
+
const botOauthUrlRegex = /[\S]+.botframework.com\/api\/oauth\/signin\?signin=([\S]+)/;
|
|
15
|
+
const delay = t => new Promise(resolve => setTimeout(resolve, t));
|
|
16
|
+
const fetchBotAuthConfigRetries = 3;
|
|
17
|
+
const fetchBotAuthConfigRetryInterval = 1000;
|
|
18
|
+
let response;
|
|
19
|
+
const extractSignInId = signInUrl => {
|
|
20
|
+
const result = botOauthUrlRegex.exec(signInUrl);
|
|
21
|
+
if (result && result[1]) {
|
|
22
|
+
return result[1];
|
|
23
|
+
}
|
|
24
|
+
return "";
|
|
25
|
+
};
|
|
26
|
+
const extractSasUrl = async attachment => {
|
|
27
|
+
let sasUrl = undefined;
|
|
28
|
+
if (attachment && attachment.content && attachment.content.tokenPostResource && attachment.content.tokenPostResource.sasUrl) {
|
|
29
|
+
sasUrl = attachment.content.tokenPostResource.sasUrl;
|
|
30
|
+
}
|
|
31
|
+
if (!sasUrl) {
|
|
32
|
+
const signInId = extractSignInId(attachment.content.buttons[0].value);
|
|
33
|
+
const getTestUrlEndpoint = `https://token.botframework.com/api/sas/gettesturl?signInId=${signInId}`;
|
|
34
|
+
try {
|
|
35
|
+
const response = await window.fetch(getTestUrlEndpoint);
|
|
36
|
+
if (response.status === 200) {
|
|
37
|
+
const responseJson = await response.json();
|
|
38
|
+
sasUrl = responseJson.sasUrl;
|
|
39
|
+
}
|
|
40
|
+
} catch {
|
|
41
|
+
sasUrl = undefined;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return sasUrl;
|
|
45
|
+
};
|
|
46
|
+
const fetchBotAuthConfig = async retries => {
|
|
47
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
48
|
+
Event: _TelemetryConstants.TelemetryEvent.SetBotAuthProviderFetchConfig
|
|
49
|
+
});
|
|
50
|
+
const botAuthConfigRequestEvent = {
|
|
51
|
+
eventName: _TelemetryConstants.BroadcastEvent.BotAuthConfigRequest
|
|
52
|
+
};
|
|
53
|
+
_omnichannelChatComponents.BroadcastService.postMessage(botAuthConfigRequestEvent);
|
|
54
|
+
const listener = _omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.BroadcastEvent.BotAuthConfigResponse).subscribe(data => {
|
|
55
|
+
var _data$payload, _data$payload2;
|
|
56
|
+
response = ((_data$payload = data.payload) === null || _data$payload === void 0 ? void 0 : _data$payload.response) !== undefined ? (_data$payload2 = data.payload) === null || _data$payload2 === void 0 ? void 0 : _data$payload2.response : response;
|
|
57
|
+
listener.unsubscribe();
|
|
58
|
+
});
|
|
59
|
+
if (response !== undefined) {
|
|
60
|
+
//return response;
|
|
61
|
+
return response;
|
|
62
|
+
}
|
|
63
|
+
if (retries === 1) {
|
|
64
|
+
// Base Case
|
|
65
|
+
throw new Error();
|
|
66
|
+
}
|
|
67
|
+
await delay(fetchBotAuthConfigRetryInterval);
|
|
68
|
+
return await fetchBotAuthConfig(--retries);
|
|
69
|
+
};
|
|
70
|
+
class BotAuthActivitySubscriber {
|
|
71
|
+
constructor() {
|
|
72
|
+
_defineProperty(this, "observer", void 0);
|
|
73
|
+
_defineProperty(this, "signInCardSeen", void 0);
|
|
74
|
+
this.signInCardSeen = new Set();
|
|
75
|
+
}
|
|
76
|
+
applicable(activity) {
|
|
77
|
+
var _activity$attachments;
|
|
78
|
+
return (activity === null || activity === void 0 ? void 0 : (_activity$attachments = activity.attachments) === null || _activity$attachments === void 0 ? void 0 : _activity$attachments.length) > 0 && activity.attachments[0] && supportedSignInCardContentTypes.indexOf(activity.attachments[0].contentType) >= 0;
|
|
79
|
+
}
|
|
80
|
+
async apply(activity) {
|
|
81
|
+
this.observer.next(false); // Hides card
|
|
82
|
+
const attachment = activity.attachments[0];
|
|
83
|
+
const signInUrl = attachment.content.buttons[0].value;
|
|
84
|
+
const signInId = extractSignInId(signInUrl);
|
|
85
|
+
if (!signInId) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (this.signInCardSeen.has(signInId)) {
|
|
89
|
+
// Prevents duplicate auth
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
this.signInCardSeen.add(signInId);
|
|
93
|
+
const sasUrl = await extractSasUrl(attachment);
|
|
94
|
+
const event = {
|
|
95
|
+
eventName: _TelemetryConstants.BroadcastEvent.SigninCardReceived,
|
|
96
|
+
payload: {
|
|
97
|
+
sasUrl
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
if (!sasUrl) {
|
|
101
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
102
|
+
Event: _TelemetryConstants.TelemetryEvent.BotAuthActivityEmptySasUrl,
|
|
103
|
+
Description: "SaS Url is empty"
|
|
104
|
+
});
|
|
105
|
+
return activity;
|
|
106
|
+
} else {
|
|
107
|
+
_omnichannelChatComponents.BroadcastService.postMessage(event);
|
|
108
|
+
}
|
|
109
|
+
try {
|
|
110
|
+
const response = await fetchBotAuthConfig(fetchBotAuthConfigRetries);
|
|
111
|
+
if (response === false) {
|
|
112
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
113
|
+
Event: _TelemetryConstants.TelemetryEvent.SetBotAuthProviderHideCard
|
|
114
|
+
});
|
|
115
|
+
} else {
|
|
116
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
117
|
+
Event: _TelemetryConstants.TelemetryEvent.SetBotAuthProviderDisplayCard
|
|
118
|
+
});
|
|
119
|
+
return activity;
|
|
120
|
+
}
|
|
121
|
+
} catch {
|
|
122
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
123
|
+
Event: _TelemetryConstants.TelemetryEvent.SetBotAuthProviderNotFound
|
|
124
|
+
});
|
|
125
|
+
//this is to ensure listener continues waiting for response
|
|
126
|
+
if (this.signInCardSeen.has(signInId)) {
|
|
127
|
+
this.signInCardSeen.delete(signInId);
|
|
128
|
+
}
|
|
129
|
+
return activity;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
async next(activity) {
|
|
133
|
+
if (this.applicable(activity)) {
|
|
134
|
+
return await this.apply(activity);
|
|
135
|
+
}
|
|
136
|
+
return activity;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
exports.BotAuthActivitySubscriber = BotAuthActivitySubscriber;
|
package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js
CHANGED
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.DefaultActivitySubscriber = void 0;
|
|
7
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
9
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
10
|
class DefaultActivitySubscriber {
|
|
9
11
|
constructor() {
|
|
10
12
|
_defineProperty(this, "observer", void 0);
|
package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js
CHANGED
|
@@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.PauseActivitySubscriber = void 0;
|
|
7
7
|
var _ActivityStreamHandler = require("../ActivityStreamHandler");
|
|
8
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
10
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
9
11
|
class PauseActivitySubscriber {
|
|
10
12
|
constructor() {
|
|
11
13
|
_defineProperty(this, "observer", void 0);
|
|
@@ -6,7 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.ChatAdapterShim = void 0;
|
|
7
7
|
var _DefaultActivitySubscriber = require("./ActivitySubscriber/DefaultActivitySubscriber");
|
|
8
8
|
var _shareObservable = require("./shareObservable");
|
|
9
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
11
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
10
12
|
class ChatAdapterShim {
|
|
11
13
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
14
|
|
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Deferred = void 0;
|
|
7
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
9
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
10
|
class Deferred {
|
|
9
11
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
12
|
|
|
@@ -10,6 +10,7 @@ var _NotificationScenarios = require("../../webchatcontainerstateful/webchatcont
|
|
|
10
10
|
var _defaultMiddlewareLocalizedTexts = require("../../webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts");
|
|
11
11
|
var _ChatAdapterShim = require("./ChatAdapterShim");
|
|
12
12
|
var _PauseActivitySubscriber = require("./ActivitySubscriber/PauseActivitySubscriber");
|
|
13
|
+
var _BotAuthActivitySubscriber = require("./ActivitySubscriber/BotAuthActivitySubscriber");
|
|
13
14
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
15
|
const createAdapter = async chatSDK => {
|
|
15
16
|
const chatAdapterOptionalParams = {
|
|
@@ -34,6 +35,7 @@ const createAdapter = async chatSDK => {
|
|
|
34
35
|
if (chatSDK.isMockModeOn !== true) {
|
|
35
36
|
adapter = new _ChatAdapterShim.ChatAdapterShim(adapter);
|
|
36
37
|
adapter.addSubscriber(new _PauseActivitySubscriber.PauseActivitySubscriber());
|
|
38
|
+
adapter.addSubscriber(new _BotAuthActivitySubscriber.BotAuthActivitySubscriber());
|
|
37
39
|
return adapter.chatAdapter;
|
|
38
40
|
}
|
|
39
41
|
return adapter;
|