@microsoft/omnichannel-chat-sdk 1.1.1-main.edc2f49 → 1.2.1-main.2590ee2

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 (56) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +17 -1
  3. package/lib/OmnichannelChatSDK.d.ts +5 -1
  4. package/lib/OmnichannelChatSDK.js +231 -247
  5. package/lib/OmnichannelChatSDK.js.map +1 -1
  6. package/lib/config/settings.d.ts +2 -1
  7. package/lib/config/settings.js +3 -1
  8. package/lib/config/settings.js.map +1 -1
  9. package/lib/core/ChatSDKErrors.d.ts +6 -0
  10. package/lib/core/ChatSDKErrors.js +10 -0
  11. package/lib/core/ChatSDKErrors.js.map +1 -0
  12. package/lib/core/ChatSDKExceptionDetails.d.ts +1 -0
  13. package/lib/core/GetAgentAvailabilityOptionalParams.d.ts +13 -0
  14. package/lib/core/GetAgentAvailabilityOptionalParams.js +3 -0
  15. package/lib/core/GetAgentAvailabilityOptionalParams.js.map +1 -0
  16. package/lib/core/StartChatOptionalParams.d.ts +4 -0
  17. package/lib/core/messaging/ACSClient.js +5 -0
  18. package/lib/core/messaging/ACSClient.js.map +1 -1
  19. package/lib/core/messaging/ChatAdapterConfig.d.ts +2 -0
  20. package/lib/core/messaging/ChatAdapterOptionalParams.d.ts +5 -0
  21. package/lib/external/ACSAdapter/AMSFileManager.js +1 -1
  22. package/lib/external/ACSAdapter/AMSFileManager.js.map +1 -1
  23. package/lib/telemetry/AriaTelemetry.d.ts +2 -0
  24. package/lib/telemetry/AriaTelemetry.js +49 -0
  25. package/lib/telemetry/AriaTelemetry.js.map +1 -1
  26. package/lib/telemetry/ScenarioType.d.ts +1 -0
  27. package/lib/telemetry/ScenarioType.js +1 -0
  28. package/lib/telemetry/ScenarioType.js.map +1 -1
  29. package/lib/telemetry/TelemetryEvent.d.ts +4 -1
  30. package/lib/telemetry/TelemetryEvent.js +3 -0
  31. package/lib/telemetry/TelemetryEvent.js.map +1 -1
  32. package/lib/tsconfig.tsbuildinfo +317 -170
  33. package/lib/utils/WebUtils.d.ts +2 -2
  34. package/lib/utils/WebUtils.js +30 -4
  35. package/lib/utils/WebUtils.js.map +1 -1
  36. package/lib/utils/chatAdapterCreators.d.ts +20 -0
  37. package/lib/utils/chatAdapterCreators.js +230 -0
  38. package/lib/utils/chatAdapterCreators.js.map +1 -0
  39. package/lib/utils/createOmnichannelMessage.js +10 -17
  40. package/lib/utils/createOmnichannelMessage.js.map +1 -1
  41. package/lib/utils/libraries.d.ts +3 -1
  42. package/lib/utils/libraries.js +9 -2
  43. package/lib/utils/libraries.js.map +1 -1
  44. package/lib/utils/location.d.ts +7 -0
  45. package/lib/utils/location.js +96 -0
  46. package/lib/utils/location.js.map +1 -0
  47. package/lib/utils/loggers.d.ts +16 -0
  48. package/lib/utils/loggers.js +69 -1
  49. package/lib/utils/loggers.js.map +1 -1
  50. package/lib/utils/sleep.d.ts +2 -0
  51. package/lib/utils/sleep.js +5 -0
  52. package/lib/utils/sleep.js.map +1 -0
  53. package/lib/utils/urlResolvers.d.ts +10 -0
  54. package/lib/utils/urlResolvers.js +65 -0
  55. package/lib/utils/urlResolvers.js.map +1 -0
  56. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -3,6 +3,19 @@ All notable changes to this project will be documented in this file.
3
3
 
4
4
  ## [Unreleased]
5
5
  ### Added
6
+ - Add ability to use `ChatSDK.createChatAdapter()` for `DirectLine` protocol
7
+ - Add `CreateACSAdapter` telemetry event
8
+ - Improve `ChatSDK.createChatAdapter()` with retries using exponential backoff & additional details on failures
9
+ - Add `GetAgentAvailability` SDK method for auth chat
10
+ - Pass `logger` to AMSClient
11
+ - Add `portalContactId` in `StartChatOptionalParams` and `GetAgentAvailabilityOptionalParams`
12
+
13
+ ### Fixed
14
+ - Fix `ChatAdapterOptionalParams.ACSAdapter.options.egressMiddleware` being used as `ingressMiddleware`
15
+ - Fix `ChatSDK.onTypingEvent()` being triggered on current user typing
16
+
17
+ ## [1.2.0] - 2022-11-11
18
+ ### Added
6
19
  - Add `sendDefaultInitContext` optional parameter to `ChatSDK.startChat()` to automatically populate `browser`, `device`, `originurl` & `os` as default init context on web
7
20
  - Add `sendCacheHeaders` as optional paramater to `ChatSDK.initialize()` and `ChatSDK.getLiveChatConfig()`
8
21
  - Add `validateAuthChatRecord` call on `ChatSDK.startChat()` with `liveChatContext` for all authenticated chat scenarios
@@ -13,12 +26,16 @@ All notable changes to this project will be documented in this file.
13
26
  - Prevent `AMSFileManager.getFileIds()` & `AMSFileManager.getFileMetadata()` to be triggered on all activities with null checks
14
27
  - Add `LiveChatVersion` check on `ChatSDK.updateChatToken()`
15
28
  - Use `amsreferences` property instead of `amsReferences` by default
29
+ - Fix attachment download to use MIME types instead of file extensions
30
+ - Remove `fileMetadata` property on messages not containing any attachment
16
31
 
17
32
  ### Changed
18
33
  - Uptake [@microsoft/ocsdk@0.3.1](https://www.npmjs.com/package/@microsoft/ocsdk/v/0.3.1)
19
34
  - Uptake [acs_webchat-chat-adapter@0.0.35-beta.8](https://unpkg.com/acs_webchat-chat-adapter@0.0.35-beta.8/dist/chat-adapter.js)
20
35
  - Uptake [acs_webchat-chat-adapter@0.0.35-beta.9](https://unpkg.com/acs_webchat-chat-adapter@0.0.35-beta.9/dist/chat-adapter.js)
21
36
  - Uptake [acs_webchat-chat-adapter@0.0.35-beta.12](https://unpkg.com/acs_webchat-chat-adapter@0.0.35-beta.12/dist/chat-adapter.js)
37
+ - Uptake [@microsoft/omnichannel-amsclient@0.1.2](https://www.npmjs.com/package/@microsoft/omnichannel-amsclient/v/0.1.2)
38
+ - Uptake [@microsoft/ocsdk@0.3.2](https://www.npmjs.com/package/@microsoft/ocsdk/v/0.3.2)
22
39
 
23
40
  ## [1.1.0] - 2022-04-15
24
41
  ### Added
package/README.md CHANGED
@@ -53,6 +53,7 @@ Please make sure you have a chat widget configured before using this package or
53
53
  - [Chat Reconnect with Authenticated User](#chat-reconnect-with-authenticated-user)
54
54
  - [Chat Reconnect with Unauthenticated User](#chat-reconnect-with-unauthenticated-user)
55
55
  - [Operating Hours](#operating-hours)
56
+ - [Single Sign-on for Bots](/docs/scenarios/SINGLE_SIGN_ON_FOR_BOTS.md)
56
57
  - [Sample Apps](https://github.com/microsoft/omnichannel-chat-sdk-samples)
57
58
  - [Feature Comparisons](#feature-comparisons)
58
59
  - [Telemetry](#telemetry)
@@ -89,6 +90,7 @@ Omnichannel offers an live chat widget (LCW) by default. You can use the Chat SD
89
90
  | Persistent Chat | ✔ | ✔ |
90
91
  | Chat Reconnect | ✔ | ✔ |
91
92
  | Operating Hours | ✔ | ✔ |
93
+ | Get Agent Availability | ✔ | ✔ |
92
94
  | Queue Position | ✔ | ✔ | No SDK method. Handled as *system message* |
93
95
  | Average Wait Time | ✔ | ✔ | No SDK method. Handled as *system message* |
94
96
 
@@ -124,6 +126,11 @@ The following steps will be required to run Omnichannel Chat SDK on React Native
124
126
  npm install react-native-url-polyfill --save-dev
125
127
  ```
126
128
 
129
+ 1. Install `@azure/core-asynciterator-polyfill`
130
+ ```
131
+ npm install @azure/core-asynciterator-polyfill --save-dev
132
+ ```
133
+
127
134
  1. Update *metro.config.js* to use React Native compatible Node Core modules
128
135
  ```ts
129
136
  module.exports = {
@@ -142,7 +149,8 @@ The following steps will be required to run Omnichannel Chat SDK on React Native
142
149
  ```ts
143
150
  import 'node-libs-react-native/globals';
144
151
  import 'react-native-get-random-values';
145
- import 'react-native-url-polyfill';
152
+ import 'react-native-url-polyfill/auto';
153
+ import '@azure/core-asynciterator-polyfill';
146
154
  ```
147
155
 
148
156
  ## SDK Methods
@@ -443,6 +451,14 @@ It gets post chat survey link, survey locale, and whether an agent has joined th
443
451
  const context = await chatSDK.getPostChatSurveyContext();
444
452
  ```
445
453
 
454
+ ### Get Agent Availability
455
+
456
+ It gets information on whether a queue is available, and whether there are agents available in that queue, as well as queue position and average wait time. This call only supports authenticated chat.
457
+
458
+ ```ts
459
+ const agentAvailability = await chatSDK.getAgentAvailability();
460
+ ```
461
+
446
462
  ## Common Scenarios
447
463
 
448
464
  ### Pre-Chat Survey
@@ -10,14 +10,15 @@ import ChatTranscriptBody from "./core/ChatTranscriptBody";
10
10
  import FileMetadata from "@microsoft/omnichannel-amsclient/lib/FileMetadata";
11
11
  import FramedClient from "@microsoft/omnichannel-amsclient/lib/FramedClient";
12
12
  import FramedlessClient from "@microsoft/omnichannel-amsclient/lib/FramedlessClient";
13
+ import GetAgentAvailabilityOptionalParams from "./core/GetAgentAvailabilityOptionalParams";
13
14
  import GetLiveChatConfigOptionalParams from "./core/GetLiveChatConfigOptionalParams";
14
15
  import IChatToken from "./external/IC3Adapter/IChatToken";
15
16
  import IFileInfo from "@microsoft/omnichannel-ic3core/lib/interfaces/IFileInfo";
16
17
  import IFileMetadata from "@microsoft/omnichannel-ic3core/lib/model/IFileMetadata";
17
18
  import IMessage from "@microsoft/omnichannel-ic3core/lib/model/IMessage";
18
- import InitializeOptionalParams from "./core/InitializeOptionalParams";
19
19
  import IRawMessage from "@microsoft/omnichannel-ic3core/lib/model/IRawMessage";
20
20
  import IRawThread from "@microsoft/omnichannel-ic3core/lib/interfaces/IRawThread";
21
+ import InitializeOptionalParams from "./core/InitializeOptionalParams";
21
22
  import LiveChatContext from "./core/LiveChatContext";
22
23
  import LiveWorkItemDetails from "./core/LiveWorkItemDetails";
23
24
  import OmnichannelConfig from "./core/OmnichannelConfig";
@@ -54,6 +55,7 @@ declare class OmnichannelChatSDK {
54
55
  private acsClientLogger;
55
56
  private acsAdapterLogger;
56
57
  private callingSdkLogger;
58
+ private amsClientLogger;
57
59
  private isPersistentChat;
58
60
  private isChatReconnect;
59
61
  private reconnectId;
@@ -88,6 +90,8 @@ declare class OmnichannelChatSDK {
88
90
  createChatAdapter(optionalParams?: ChatAdapterOptionalParams): Promise<unknown>;
89
91
  getVoiceVideoCalling(params?: any): Promise<any>;
90
92
  getPostChatSurveyContext(): Promise<any>;
93
+ getAgentAvailability(optionalParams?: GetAgentAvailabilityOptionalParams): Promise<any>;
94
+ private populateInitChatOptionalParam;
91
95
  private getIC3Client;
92
96
  private getChatConfig;
93
97
  private resolveIC3ClientUrl;