@microsoft/omnichannel-chat-widget 1.7.3-main.112d01b → 1.7.3-main.3609616

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 (71) hide show
  1. package/lib/cjs/common/telemetry/TelemetryConstants.js +2 -0
  2. package/lib/cjs/components/livechatwidget/LiveChatWidget.js +6 -1
  3. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +15 -6
  4. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +77 -0
  5. package/lib/cjs/components/livechatwidget/common/createAdapter.js +15 -2
  6. package/lib/cjs/components/livechatwidget/common/endChat.js +20 -5
  7. package/lib/cjs/components/livechatwidget/common/getMockChatSDKIfApplicable.js +26 -0
  8. package/lib/cjs/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +41 -0
  9. package/lib/cjs/components/livechatwidget/common/startChat.js +37 -28
  10. package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +6 -6
  11. package/lib/cjs/components/livechatwidget/common/updateSessionDataForTelemetry.js +8 -3
  12. package/lib/cjs/components/livechatwidget/interfaces/IBotAuthActivitySubscriberOptionalParams.js +1 -0
  13. package/lib/cjs/components/livechatwidget/interfaces/IMockProps.js +7 -0
  14. package/lib/cjs/components/webchatcontainerstateful/common/DemoChatAdapter.js +87 -0
  15. package/lib/cjs/components/webchatcontainerstateful/common/DemoChatSDK.js +17 -0
  16. package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +41 -0
  17. package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatSDK.js +17 -0
  18. package/lib/cjs/components/webchatcontainerstateful/common/MockBotCardCommandType.js +14 -0
  19. package/lib/cjs/components/webchatcontainerstateful/common/MockBotCommand.js +19 -0
  20. package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +3 -0
  21. package/lib/cjs/components/webchatcontainerstateful/common/utils/attachmentActivityUtils.js +71 -0
  22. package/lib/cjs/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +90 -0
  23. package/lib/cjs/components/webchatcontainerstateful/interfaces/IBotAuthConfig.js +1 -0
  24. package/lib/cjs/plugins/newMessageEventHandler.js +4 -2
  25. package/lib/esm/common/telemetry/TelemetryConstants.js +2 -0
  26. package/lib/esm/components/livechatwidget/LiveChatWidget.js +6 -1
  27. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +15 -6
  28. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +70 -0
  29. package/lib/esm/components/livechatwidget/common/createAdapter.js +14 -2
  30. package/lib/esm/components/livechatwidget/common/endChat.js +20 -5
  31. package/lib/esm/components/livechatwidget/common/getMockChatSDKIfApplicable.js +20 -0
  32. package/lib/esm/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +34 -0
  33. package/lib/esm/components/livechatwidget/common/startChat.js +37 -28
  34. package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +7 -7
  35. package/lib/esm/components/livechatwidget/common/updateSessionDataForTelemetry.js +7 -2
  36. package/lib/esm/components/livechatwidget/interfaces/IBotAuthActivitySubscriberOptionalParams.js +1 -0
  37. package/lib/esm/components/livechatwidget/interfaces/IMockProps.js +6 -0
  38. package/lib/esm/components/webchatcontainerstateful/common/DemoChatAdapter.js +79 -0
  39. package/lib/esm/components/webchatcontainerstateful/common/DemoChatSDK.js +10 -0
  40. package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +33 -0
  41. package/lib/esm/components/webchatcontainerstateful/common/DesignerChatSDK.js +10 -0
  42. package/lib/esm/components/webchatcontainerstateful/common/MockBotCardCommandType.js +7 -0
  43. package/lib/esm/components/webchatcontainerstateful/common/MockBotCommand.js +12 -0
  44. package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +3 -0
  45. package/lib/esm/components/webchatcontainerstateful/common/utils/attachmentActivityUtils.js +61 -0
  46. package/lib/esm/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +77 -0
  47. package/lib/esm/components/webchatcontainerstateful/interfaces/IBotAuthConfig.js +1 -0
  48. package/lib/esm/plugins/newMessageEventHandler.js +4 -2
  49. package/lib/types/common/telemetry/TelemetryConstants.d.ts +3 -1
  50. package/lib/types/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.d.ts +4 -1
  51. package/lib/types/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.d.ts +7 -0
  52. package/lib/types/components/livechatwidget/common/createAdapter.d.ts +2 -1
  53. package/lib/types/components/livechatwidget/common/getMockChatSDKIfApplicable.d.ts +1 -0
  54. package/lib/types/components/livechatwidget/common/overridePropsOnMockIfApplicable.d.ts +3 -0
  55. package/lib/types/components/livechatwidget/common/updateSessionDataForTelemetry.d.ts +1 -1
  56. package/lib/types/components/livechatwidget/interfaces/IBotAuthActivitySubscriberOptionalParams.d.ts +4 -0
  57. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +2 -0
  58. package/lib/types/components/livechatwidget/interfaces/IMockProps.d.ts +8 -0
  59. package/lib/types/components/webchatcontainerstateful/common/DemoChatAdapter.d.ts +10 -0
  60. package/lib/types/components/webchatcontainerstateful/common/DemoChatSDK.d.ts +6 -0
  61. package/lib/types/components/webchatcontainerstateful/common/DesignerChatAdapter.d.ts +8 -0
  62. package/lib/types/components/webchatcontainerstateful/common/DesignerChatSDK.d.ts +6 -0
  63. package/lib/types/components/webchatcontainerstateful/common/MockBotCardCommandType.d.ts +6 -0
  64. package/lib/types/components/webchatcontainerstateful/common/MockBotCommand.d.ts +11 -0
  65. package/lib/types/components/webchatcontainerstateful/common/mockadapter.d.ts +2 -1
  66. package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +6 -0
  67. package/lib/types/components/webchatcontainerstateful/common/utils/attachmentActivityUtils.d.ts +9 -0
  68. package/lib/types/components/webchatcontainerstateful/common/utils/chatAdapterUtils.d.ts +9 -0
  69. package/lib/types/components/webchatcontainerstateful/interfaces/IBotAuthConfig.d.ts +4 -0
  70. package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps.d.ts +2 -0
  71. package/package.json +3 -3
@@ -0,0 +1,6 @@
1
+ import { DemoChatAdapter } from "./DemoChatAdapter";
2
+ import { MockChatSDK } from "./mockchatsdk";
3
+ export declare class DemoChatSDK extends MockChatSDK {
4
+ constructor();
5
+ createChatAdapter(): DemoChatAdapter;
6
+ }
@@ -0,0 +1,8 @@
1
+ import { Message } from "botframework-directlinejs";
2
+ import { Observable } from "rxjs/Observable";
3
+ import MockAdapter from "./mockadapter";
4
+ export declare class DesignerChatAdapter extends MockAdapter {
5
+ constructor();
6
+ private postUserActivity;
7
+ postActivity(activity: Message): Observable<string>;
8
+ }
@@ -0,0 +1,6 @@
1
+ import { DesignerChatAdapter } from "./DesignerChatAdapter";
2
+ import { MockChatSDK } from "./mockchatsdk";
3
+ export declare class DesignerChatSDK extends MockChatSDK {
4
+ constructor();
5
+ createChatAdapter(): DesignerChatAdapter;
6
+ }
@@ -0,0 +1,6 @@
1
+ declare enum MockBotCardCommandType {
2
+ Hero = "hero",
3
+ Signin = "signin",
4
+ Thumbnail = "thumbnail"
5
+ }
6
+ export default MockBotCardCommandType;
@@ -0,0 +1,11 @@
1
+ declare enum MockBotCommand {
2
+ Bot = "/bot",
3
+ Card = "/card",
4
+ Help = "/help",
5
+ SendAttachment = "send attachment",
6
+ SendBotMessage = "send bot message",
7
+ SendSystemMessage = "send system message",
8
+ SendTyping = "send typing",
9
+ System = "/system"
10
+ }
11
+ export default MockBotCommand;
@@ -3,8 +3,9 @@ import "rxjs/add/observable/of";
3
3
  import { Activity, ConnectionStatus, Message } from "botframework-directlinejs";
4
4
  import { BehaviorSubject } from "rxjs";
5
5
  import { Observable } from "rxjs/Observable";
6
+ import { Subscriber } from "rxjs/Subscriber";
6
7
  export default class MockAdapter {
7
- private activityObserver?;
8
+ activityObserver?: Subscriber<Activity>;
8
9
  activity$: Observable<Activity>;
9
10
  connectionStatus$: BehaviorSubject<ConnectionStatus>;
10
11
  constructor();
@@ -8,6 +8,12 @@ export declare class MockChatSDK {
8
8
  orgId: string;
9
9
  orgUrl: string;
10
10
  };
11
+ initialize(): Promise<{
12
+ LiveWSAndLiveChatEngJoin: {
13
+ msdyn_postconversationsurveyenable: string;
14
+ msdyn_conversationmode: string;
15
+ };
16
+ }>;
11
17
  startChat(): Promise<void>;
12
18
  endChat(): null;
13
19
  getChatToken(): null;
@@ -0,0 +1,9 @@
1
+ import { HeroCard, Signin, Thumbnail } from "botframework-directlinejs";
2
+ export declare const createJpgFileAttachment: () => {
3
+ contentType: string;
4
+ name: string;
5
+ contentUrl: string;
6
+ };
7
+ export declare const createHeroCardAttachment: () => HeroCard;
8
+ export declare const createThumbnailCardAttachment: () => Thumbnail;
9
+ export declare const createSigninCardAttachment: () => Signin;
@@ -0,0 +1,9 @@
1
+ import { Activity, Attachment, Message, User } from "botframework-directlinejs";
2
+ import { Subscriber } from "rxjs/Subscriber";
3
+ export declare const customerUser: User;
4
+ export declare const botUser: User;
5
+ export declare const postEchoActivity: (activityObserver: Subscriber<Activity> | undefined, activity: Message, user: User, delay?: number) => void;
6
+ export declare const postBotMessageActivity: (activityObserver: Subscriber<Activity> | undefined, text: string, tags?: string, delay?: number) => void;
7
+ export declare const postSystemMessageActivity: (activityObserver: Subscriber<Activity> | undefined, text: string, delay?: number) => void;
8
+ export declare const postBotTypingActivity: (activityObserver: Subscriber<Activity> | undefined, delay?: number) => void;
9
+ export declare const postBotAttachmentActivity: (activityObserver: Subscriber<Activity> | undefined, attachments?: Attachment[], delay?: number) => void;
@@ -0,0 +1,4 @@
1
+ export interface IBotAuthConfig {
2
+ fetchBotAuthConfigRetries?: number;
3
+ fetchBotAuthConfigRetryInterval?: number;
4
+ }
@@ -5,6 +5,7 @@ import { IStyle } from "@fluentui/react";
5
5
  import { IWebChatProps } from "./IWebChatProps";
6
6
  import { StyleOptions } from "botframework-webchat-api";
7
7
  import { IAdaptiveCardStyles } from "./IAdaptiveCardStyles";
8
+ import { IBotAuthConfig } from "./IBotAuthConfig";
8
9
  export interface IWebChatContainerStatefulProps {
9
10
  containerStyles?: IStyle;
10
11
  disableNewLineMarkdownSupport?: boolean;
@@ -16,6 +17,7 @@ export interface IWebChatContainerStatefulProps {
16
17
  renderingMiddlewareProps?: IRenderingMiddlewareProps;
17
18
  localizedTexts?: ILiveChatWidgetLocalizedTexts;
18
19
  botMagicCode?: IBotMagicCodeConfig;
20
+ botAuthConfig?: IBotAuthConfig;
19
21
  hyperlinkTextOverride?: boolean;
20
22
  adaptiveCardStyles?: IAdaptiveCardStyles;
21
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-widget",
3
- "version": "1.7.3-main.112d01b",
3
+ "version": "1.7.3-main.3609616",
4
4
  "description": "Microsoft Omnichannel Chat Widget",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",
@@ -75,9 +75,9 @@
75
75
  },
76
76
  "dependencies": {
77
77
  "@microsoft/omnichannel-chat-components": "1.1.5",
78
- "@microsoft/omnichannel-chat-sdk": "^1.9.5",
78
+ "@microsoft/omnichannel-chat-sdk": "^1.9.6",
79
79
  "abort-controller-es5": "^2.0.1",
80
- "dompurify": "^2.3.4",
80
+ "dompurify": "^2.5.4",
81
81
  "markdown-it": "^12.3.2",
82
82
  "markdown-it-attrs": "^4.1.6",
83
83
  "markdown-it-attrs-es5": "^2.0.2",