@microsoft/omnichannel-chat-sdk 1.9.5 → 1.9.6

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 (206) hide show
  1. package/lib/OmnichannelChatSDK.d.ts +128 -114
  2. package/lib/OmnichannelChatSDK.js +2609 -2394
  3. package/lib/OmnichannelChatSDK.js.map +1 -1
  4. package/lib/api/createVoiceVideoCalling.d.ts +53 -53
  5. package/lib/api/createVoiceVideoCalling.js +462 -462
  6. package/lib/commands/throwUnsupportedLiveChatVersionFailureIfApplicable.d.ts +3 -0
  7. package/lib/commands/throwUnsupportedLiveChatVersionFailureIfApplicable.js +14 -0
  8. package/lib/commands/throwUnsupportedLiveChatVersionFailureIfApplicable.js.map +1 -0
  9. package/lib/config/ocSDKConfiguration.d.ts +7 -7
  10. package/lib/config/ocSDKConfiguration.js +9 -9
  11. package/lib/config/settings.d.ts +6 -6
  12. package/lib/config/settings.js +13 -13
  13. package/lib/core/AuthSettings.d.ts +5 -5
  14. package/lib/core/AuthSettings.js +2 -2
  15. package/lib/core/AxiosErrorCodes.d.ts +4 -4
  16. package/lib/core/AxiosErrorCodes.js +7 -7
  17. package/lib/core/CallingOptionsOptionSetNumber.d.ts +6 -6
  18. package/lib/core/CallingOptionsOptionSetNumber.js +9 -9
  19. package/lib/core/ChatConfig.d.ts +10 -10
  20. package/lib/core/ChatConfig.js +2 -2
  21. package/lib/core/ChatReconnectContext.d.ts +4 -4
  22. package/lib/core/ChatReconnectContext.js +2 -2
  23. package/lib/core/ChatReconnectOptionalParams.d.ts +3 -3
  24. package/lib/core/ChatReconnectOptionalParams.js +2 -2
  25. package/lib/core/ChatSDKConfig.d.ts +38 -38
  26. package/lib/core/ChatSDKConfig.js +2 -2
  27. package/lib/core/ChatSDKError.d.ts +64 -63
  28. package/lib/core/ChatSDKError.js +73 -72
  29. package/lib/core/ChatSDKError.js.map +1 -1
  30. package/lib/core/ChatSDKExceptionDetails.d.ts +13 -13
  31. package/lib/core/ChatSDKExceptionDetails.js +2 -2
  32. package/lib/core/ChatTranscriptBody.d.ts +5 -5
  33. package/lib/core/ChatTranscriptBody.js +2 -2
  34. package/lib/core/ConversationMode.d.ts +5 -5
  35. package/lib/core/ConversationMode.js +8 -8
  36. package/lib/core/EmailLiveChatTranscriptOptionalParams.d.ts +4 -4
  37. package/lib/core/EmailLiveChatTranscriptOptionalParams.js +2 -2
  38. package/lib/core/GetAgentAvailabilityOptionalParams.d.ts +13 -13
  39. package/lib/core/GetAgentAvailabilityOptionalParams.js +2 -2
  40. package/lib/core/GetChatTokenOptionalParams.d.ts +3 -3
  41. package/lib/core/GetChatTokenOptionalParams.js +2 -2
  42. package/lib/core/GetConversationDetailsOptionalParams.d.ts +4 -4
  43. package/lib/core/GetConversationDetailsOptionalParams.js +2 -2
  44. package/lib/core/GetLiveChatConfigOptionalParams.d.ts +5 -5
  45. package/lib/core/GetLiveChatConfigOptionalParams.js +2 -2
  46. package/lib/core/GetLiveChatTranscriptOptionalParams.d.ts +4 -4
  47. package/lib/core/GetLiveChatTranscriptOptionalParams.js +2 -2
  48. package/lib/core/InitializeOptionalParams.d.ts +6 -5
  49. package/lib/core/InitializeOptionalParams.js +2 -2
  50. package/lib/core/LiveChatContext.d.ts +14 -14
  51. package/lib/core/LiveChatContext.js +2 -2
  52. package/lib/core/LiveChatVersion.d.ts +5 -5
  53. package/lib/core/LiveChatVersion.js +8 -8
  54. package/lib/core/LiveWorkItemDetails.d.ts +8 -8
  55. package/lib/core/LiveWorkItemDetails.js +2 -2
  56. package/lib/core/LiveWorkItemState.d.ts +8 -8
  57. package/lib/core/LiveWorkItemState.js +11 -11
  58. package/lib/core/OmnichannelConfig.d.ts +5 -5
  59. package/lib/core/OmnichannelConfig.js +2 -2
  60. package/lib/core/OmnichannelErrorCodes.d.ts +4 -4
  61. package/lib/core/OmnichannelErrorCodes.js +7 -7
  62. package/lib/core/PostChatContext.d.ts +8 -8
  63. package/lib/core/PostChatContext.js +2 -2
  64. package/lib/core/SetAuthTokenProviderOptionalParams.d.ts +3 -3
  65. package/lib/core/SetAuthTokenProviderOptionalParams.js +2 -2
  66. package/lib/core/StartChatOptionalParams.d.ts +18 -18
  67. package/lib/core/StartChatOptionalParams.js +2 -2
  68. package/lib/core/messaging/ACSChatMessageType.d.ts +7 -7
  69. package/lib/core/messaging/ACSChatMessageType.js +10 -10
  70. package/lib/core/messaging/ACSClient.d.ts +45 -45
  71. package/lib/core/messaging/ACSClient.js +612 -612
  72. package/lib/core/messaging/ACSClientConfig.d.ts +5 -5
  73. package/lib/core/messaging/ACSClientConfig.js +2 -2
  74. package/lib/core/messaging/ACSParticipantDisplayName.d.ts +6 -6
  75. package/lib/core/messaging/ACSParticipantDisplayName.js +9 -9
  76. package/lib/core/messaging/ACSSessionInfo.d.ts +5 -5
  77. package/lib/core/messaging/ACSSessionInfo.js +2 -2
  78. package/lib/core/messaging/ChatAdapterConfig.d.ts +8 -8
  79. package/lib/core/messaging/ChatAdapterConfig.js +2 -2
  80. package/lib/core/messaging/ChatAdapterOptionalParams.d.ts +24 -24
  81. package/lib/core/messaging/ChatAdapterOptionalParams.js +2 -2
  82. package/lib/core/messaging/ChatAdapterProtocols.d.ts +6 -6
  83. package/lib/core/messaging/ChatAdapterProtocols.js +10 -10
  84. package/lib/core/messaging/ChatSDKMessage.d.ts +6 -6
  85. package/lib/core/messaging/ChatSDKMessage.js +2 -2
  86. package/lib/core/messaging/IC3Config.d.ts +4 -4
  87. package/lib/core/messaging/IC3Config.js +2 -2
  88. package/lib/core/messaging/MessageTags.d.ts +3 -3
  89. package/lib/core/messaging/MessageTags.js +6 -6
  90. package/lib/core/messaging/OmnichannelMessage.d.ts +64 -64
  91. package/lib/core/messaging/OmnichannelMessage.js +51 -51
  92. package/lib/core/messaging/OnNewMessageOptionalParams.d.ts +3 -3
  93. package/lib/core/messaging/OnNewMessageOptionalParams.js +2 -2
  94. package/lib/external/ACSAdapter/AMSFileManager.d.ts +76 -76
  95. package/lib/external/ACSAdapter/AMSFileManager.js +394 -394
  96. package/lib/external/ACSAdapter/AMSFileScanner.d.ts +36 -36
  97. package/lib/external/ACSAdapter/AMSFileScanner.js +275 -275
  98. package/lib/external/ACSAdapter/activityUtils.d.ts +9 -9
  99. package/lib/external/ACSAdapter/activityUtils.js +79 -79
  100. package/lib/external/ACSAdapter/createChannelDataEgressMiddleware.d.ts +5 -5
  101. package/lib/external/ACSAdapter/createChannelDataEgressMiddleware.js +33 -33
  102. package/lib/external/ACSAdapter/createFileScanIngressMiddleware.d.ts +2 -2
  103. package/lib/external/ACSAdapter/createFileScanIngressMiddleware.js +95 -95
  104. package/lib/external/ACSAdapter/createFormatEgressTagsMiddleware.d.ts +2 -2
  105. package/lib/external/ACSAdapter/createFormatEgressTagsMiddleware.js +30 -30
  106. package/lib/external/ACSAdapter/createFormatIngressTagsMiddleware.d.ts +2 -2
  107. package/lib/external/ACSAdapter/createFormatIngressTagsMiddleware.js +24 -24
  108. package/lib/external/CallingSDK/ICallingSDKLogData.d.ts +7 -7
  109. package/lib/external/CallingSDK/ICallingSDKLogData.js +2 -2
  110. package/lib/external/IC3Adapter/IChatToken.d.ts +11 -11
  111. package/lib/external/IC3Adapter/IChatToken.js +3 -3
  112. package/lib/external/IC3Adapter/IIC3AdapterOptions.d.ts +22 -22
  113. package/lib/external/IC3Adapter/IIC3AdapterOptions.js +2 -2
  114. package/lib/external/IC3Adapter/INotification.d.ts +6 -6
  115. package/lib/external/IC3Adapter/INotification.js +2 -2
  116. package/lib/external/IC3Adapter/Notification.d.ts +7 -7
  117. package/lib/external/IC3Adapter/Notification.js +14 -14
  118. package/lib/external/IC3Client/IIC3SDKLogData.d.ts +9 -9
  119. package/lib/external/IC3Client/IIC3SDKLogData.js +2 -2
  120. package/lib/external/OCSDK/IOCSDKLogData.d.ts +14 -14
  121. package/lib/external/OCSDK/IOCSDKLogData.js +2 -2
  122. package/lib/index.d.ts +25 -25
  123. package/lib/index.js +34 -34
  124. package/lib/telemetry/AriaTelemetry.d.ts +40 -40
  125. package/lib/telemetry/AriaTelemetry.js +539 -539
  126. package/lib/telemetry/EUDomainNames.d.ts +2 -2
  127. package/lib/telemetry/EUDomainNames.js +16 -16
  128. package/lib/telemetry/EventMarker.d.ts +3 -3
  129. package/lib/telemetry/EventMarker.js +12 -12
  130. package/lib/telemetry/GCCDomainPatterns.d.ts +2 -2
  131. package/lib/telemetry/GCCDomainPatterns.js +7 -7
  132. package/lib/telemetry/LogLevel.d.ts +8 -8
  133. package/lib/telemetry/LogLevel.js +11 -11
  134. package/lib/telemetry/ScenarioMarker.d.ts +21 -21
  135. package/lib/telemetry/ScenarioMarker.js +82 -82
  136. package/lib/telemetry/ScenarioType.d.ts +11 -11
  137. package/lib/telemetry/ScenarioType.js +14 -14
  138. package/lib/telemetry/StopWatch.d.ts +6 -6
  139. package/lib/telemetry/StopWatch.js +14 -14
  140. package/lib/telemetry/TelemetryEvent.d.ts +46 -42
  141. package/lib/telemetry/TelemetryEvent.js +49 -45
  142. package/lib/telemetry/TelemetryEvent.js.map +1 -1
  143. package/lib/telemetry/retrieveCollectorUri.d.ts +2 -2
  144. package/lib/telemetry/retrieveCollectorUri.js +25 -25
  145. package/lib/tsconfig.tsbuildinfo +1976 -1911
  146. package/lib/utils/AMSClientLoadStates.d.ts +6 -0
  147. package/lib/utils/AMSClientLoadStates.js +12 -0
  148. package/lib/utils/AMSClientLoadStates.js.map +1 -0
  149. package/lib/utils/CoreServicesUtils.d.ts +7 -7
  150. package/lib/utils/CoreServicesUtils.js +39 -39
  151. package/lib/utils/WebUtils.d.ts +10 -10
  152. package/lib/utils/WebUtils.js +128 -128
  153. package/lib/utils/chatAdapterCreators.d.ts +20 -20
  154. package/lib/utils/chatAdapterCreators.js +208 -208
  155. package/lib/utils/createOcSDKConfiguration.d.ts +4 -4
  156. package/lib/utils/createOcSDKConfiguration.js +22 -22
  157. package/lib/utils/createOmnichannelMessage.d.ts +11 -11
  158. package/lib/utils/createOmnichannelMessage.js +77 -77
  159. package/lib/utils/createTelemetry.d.ts +3 -3
  160. package/lib/utils/createTelemetry.js +9 -9
  161. package/lib/utils/exceptionSuppressors.d.ts +29 -29
  162. package/lib/utils/exceptionSuppressors.js +49 -49
  163. package/lib/utils/exceptionThrowers.d.ts +119 -119
  164. package/lib/utils/exceptionThrowers.js +137 -137
  165. package/lib/utils/fillMobilePlatformData.d.ts +2 -0
  166. package/lib/utils/fillMobilePlatformData.js +44 -0
  167. package/lib/utils/fillMobilePlatformData.js.map +1 -0
  168. package/lib/utils/fillPlatformData.browser.d.ts +2 -0
  169. package/lib/utils/fillPlatformData.browser.js +8 -0
  170. package/lib/utils/fillPlatformData.browser.js.map +1 -0
  171. package/lib/utils/fillPlatformData.d.ts +2 -0
  172. package/lib/utils/fillPlatformData.js +8 -0
  173. package/lib/utils/fillPlatformData.js.map +1 -0
  174. package/lib/utils/fillWebPlatformData.d.ts +2 -0
  175. package/lib/utils/fillWebPlatformData.js +21 -0
  176. package/lib/utils/fillWebPlatformData.js.map +1 -0
  177. package/lib/utils/internalUtils.d.ts +4 -4
  178. package/lib/utils/internalUtils.js +16 -16
  179. package/lib/utils/libraries.d.ts +12 -12
  180. package/lib/utils/libraries.js +34 -34
  181. package/lib/utils/locale.d.ts +4 -4
  182. package/lib/utils/locale.js +60 -60
  183. package/lib/utils/location.d.ts +7 -7
  184. package/lib/utils/location.js +95 -95
  185. package/lib/utils/loggerUtils.d.ts +15 -15
  186. package/lib/utils/loggerUtils.js +55 -55
  187. package/lib/utils/loggers.d.ts +111 -111
  188. package/lib/utils/loggers.js +501 -501
  189. package/lib/utils/parsers.d.ts +6 -6
  190. package/lib/utils/parsers.js +10 -10
  191. package/lib/utils/platform.d.ts +9 -9
  192. package/lib/utils/platform.js +11 -11
  193. package/lib/utils/setOcUserAgent.d.ts +2 -2
  194. package/lib/utils/setOcUserAgent.js +21 -21
  195. package/lib/utils/sleep.d.ts +2 -2
  196. package/lib/utils/sleep.js +4 -4
  197. package/lib/utils/urlResolvers.d.ts +10 -10
  198. package/lib/utils/urlResolvers.js +64 -64
  199. package/lib/utils/utilities.d.ts +5 -5
  200. package/lib/utils/utilities.js +36 -36
  201. package/lib/validators/OmnichannelConfigValidator.d.ts +3 -3
  202. package/lib/validators/OmnichannelConfigValidator.js +28 -28
  203. package/lib/validators/SDKConfigValidators.d.ts +5 -5
  204. package/lib/validators/SDKConfigValidators.js +48 -48
  205. package/package.json +1 -1
  206. package/CHANGELOG.md +0 -435
@@ -1,80 +1,80 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.getAttachmentSizes = exports.getAttachments = exports.getDataURL = void 0;
40
- exports.getDataURL = function (file) { return __awaiter(void 0, void 0, void 0, function () {
41
- return __generator(this, function (_a) {
42
- return [2 /*return*/, new Promise(function (resolve) {
43
- var fileReader = new FileReader();
44
- fileReader.onloadend = function () {
45
- resolve(fileReader.result); // eslint-disable-line @typescript-eslint/no-explicit-any
46
- };
47
- fileReader.readAsDataURL(file);
48
- })];
49
- });
50
- }); };
51
- exports.getAttachments = function (files) { return __awaiter(void 0, void 0, void 0, function () {
52
- return __generator(this, function (_a) {
53
- return [2 /*return*/, Promise.all(files.map(function (file) { return __awaiter(void 0, void 0, void 0, function () {
54
- var url;
55
- return __generator(this, function (_a) {
56
- switch (_a.label) {
57
- case 0:
58
- if (!file) return [3 /*break*/, 2];
59
- return [4 /*yield*/, exports.getDataURL(file)];
60
- case 1:
61
- url = _a.sent();
62
- return [2 /*return*/, {
63
- contentType: file.type,
64
- contentUrl: url,
65
- name: file.name,
66
- thumbnailUrl: file.type.match("(image|video|audio).*") ? url : undefined
67
- }];
68
- case 2: return [2 /*return*/];
69
- }
70
- });
71
- }); }))];
72
- });
73
- }); };
74
- exports.getAttachmentSizes = function (files) {
75
- return files.map(function (file) {
76
- return file.size;
77
- });
78
- };
79
- exports.default = { getDataURL: exports.getDataURL, getAttachments: exports.getAttachments, getAttachmentSizes: exports.getAttachmentSizes };
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.getAttachmentSizes = exports.getAttachments = exports.getDataURL = void 0;
40
+ exports.getDataURL = function (file) { return __awaiter(void 0, void 0, void 0, function () {
41
+ return __generator(this, function (_a) {
42
+ return [2 /*return*/, new Promise(function (resolve) {
43
+ var fileReader = new FileReader();
44
+ fileReader.onloadend = function () {
45
+ resolve(fileReader.result); // eslint-disable-line @typescript-eslint/no-explicit-any
46
+ };
47
+ fileReader.readAsDataURL(file);
48
+ })];
49
+ });
50
+ }); };
51
+ exports.getAttachments = function (files) { return __awaiter(void 0, void 0, void 0, function () {
52
+ return __generator(this, function (_a) {
53
+ return [2 /*return*/, Promise.all(files.map(function (file) { return __awaiter(void 0, void 0, void 0, function () {
54
+ var url;
55
+ return __generator(this, function (_a) {
56
+ switch (_a.label) {
57
+ case 0:
58
+ if (!file) return [3 /*break*/, 2];
59
+ return [4 /*yield*/, exports.getDataURL(file)];
60
+ case 1:
61
+ url = _a.sent();
62
+ return [2 /*return*/, {
63
+ contentType: file.type,
64
+ contentUrl: url,
65
+ name: file.name,
66
+ thumbnailUrl: file.type.match("(image|video|audio).*") ? url : undefined
67
+ }];
68
+ case 2: return [2 /*return*/];
69
+ }
70
+ });
71
+ }); }))];
72
+ });
73
+ }); };
74
+ exports.getAttachmentSizes = function (files) {
75
+ return files.map(function (file) {
76
+ return file.size;
77
+ });
78
+ };
79
+ exports.default = { getDataURL: exports.getDataURL, getAttachments: exports.getAttachments, getAttachmentSizes: exports.getAttachmentSizes };
80
80
  //# sourceMappingURL=activityUtils.js.map
@@ -1,5 +1,5 @@
1
- interface ChannelData {
2
- widgetId: string;
3
- }
4
- declare const createChannelDataEgressMiddleware: (channelData: ChannelData) => CallableFunction;
5
- export default createChannelDataEgressMiddleware;
1
+ interface ChannelData {
2
+ widgetId: string;
3
+ }
4
+ declare const createChannelDataEgressMiddleware: (channelData: ChannelData) => CallableFunction;
5
+ export default createChannelDataEgressMiddleware;
@@ -1,34 +1,34 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var MessageTags_1 = require("../../core/messaging/MessageTags");
4
- var OmnichannelMessage_1 = require("../../core/messaging/OmnichannelMessage");
5
- var createChannelDataEgressMiddleware = function (channelData) {
6
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
- var channelDataMiddleware = function () { return function (next) { return function (activity) {
8
- var applicable = activity && activity.channelData;
9
- if (applicable) {
10
- if (!activity.channelData.tags) {
11
- activity.channelData.tags = [];
12
- }
13
- if (!activity.channelData.tags.includes(MessageTags_1.channelIdTag)) {
14
- activity.channelData.tags.push(MessageTags_1.channelIdTag);
15
- }
16
- if (!activity.channelData.tags.includes(MessageTags_1.customerMessageTag)) {
17
- activity.channelData.tags.push(MessageTags_1.customerMessageTag);
18
- }
19
- if (!activity.channelData.metadata) {
20
- activity.channelData.metadata = {};
21
- }
22
- if (!activity.channelData.metadata.deliveryMode) {
23
- activity.channelData.metadata.deliveryMode = OmnichannelMessage_1.DeliveryMode.Bridged;
24
- }
25
- if (channelData.widgetId) {
26
- activity.channelData.metadata.widgetId = channelData.widgetId;
27
- }
28
- }
29
- return next(activity);
30
- }; }; };
31
- return channelDataMiddleware;
32
- };
33
- exports.default = createChannelDataEgressMiddleware;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var MessageTags_1 = require("../../core/messaging/MessageTags");
4
+ var OmnichannelMessage_1 = require("../../core/messaging/OmnichannelMessage");
5
+ var createChannelDataEgressMiddleware = function (channelData) {
6
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
+ var channelDataMiddleware = function () { return function (next) { return function (activity) {
8
+ var applicable = activity && activity.channelData;
9
+ if (applicable) {
10
+ if (!activity.channelData.tags) {
11
+ activity.channelData.tags = [];
12
+ }
13
+ if (!activity.channelData.tags.includes(MessageTags_1.channelIdTag)) {
14
+ activity.channelData.tags.push(MessageTags_1.channelIdTag);
15
+ }
16
+ if (!activity.channelData.tags.includes(MessageTags_1.customerMessageTag)) {
17
+ activity.channelData.tags.push(MessageTags_1.customerMessageTag);
18
+ }
19
+ if (!activity.channelData.metadata) {
20
+ activity.channelData.metadata = {};
21
+ }
22
+ if (!activity.channelData.metadata.deliveryMode) {
23
+ activity.channelData.metadata.deliveryMode = OmnichannelMessage_1.DeliveryMode.Bridged;
24
+ }
25
+ if (channelData.widgetId) {
26
+ activity.channelData.metadata.widgetId = channelData.widgetId;
27
+ }
28
+ }
29
+ return next(activity);
30
+ }; }; };
31
+ return channelDataMiddleware;
32
+ };
33
+ exports.default = createChannelDataEgressMiddleware;
34
34
  //# sourceMappingURL=createChannelDataEgressMiddleware.js.map
@@ -1,2 +1,2 @@
1
- declare const createFileScanIngressMiddleware: () => CallableFunction;
2
- export default createFileScanIngressMiddleware;
1
+ declare const createFileScanIngressMiddleware: () => CallableFunction;
2
+ export default createFileScanIngressMiddleware;
@@ -1,96 +1,96 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
29
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
- Object.defineProperty(exports, "__esModule", { value: true });
50
- var createFileScanIngressMiddleware = function () {
51
- var fileScanIngressMiddleware = function () { return function (next) { return function (activity) { return __awaiter(void 0, void 0, void 0, function () {
52
- var attachments, channelData, amsreferences, scanFile_1, fileIds;
53
- var _a, _b;
54
- return __generator(this, function (_c) {
55
- attachments = activity.attachments, channelData = activity.channelData;
56
- if (!attachments) {
57
- return [2 /*return*/, next(activity)];
58
- }
59
- // Patch references
60
- if (!((_a = channelData === null || channelData === void 0 ? void 0 : channelData.metadata) === null || _a === void 0 ? void 0 : _a.amsreferences) && ((_b = channelData === null || channelData === void 0 ? void 0 : channelData.metadata) === null || _b === void 0 ? void 0 : _b.amsReferences)) {
61
- activity.channelData.metadata.amsreferences = channelData.metadata.amsReferences;
62
- }
63
- amsreferences = channelData.metadata.amsreferences;
64
- if (amsreferences) {
65
- try {
66
- scanFile_1 = function (fileId) {
67
- var fileScanner = window.chatAdapter.fileManager.fileScanner; // eslint-disable-line @typescript-eslint/no-explicit-any
68
- if (!fileScanner) {
69
- return next(activity);
70
- }
71
- var scanResult = fileScanner.retrieveFileScanResult(fileId);
72
- if (scanResult) {
73
- var scan = scanResult.scan, fileMetadata_1 = scanResult.fileMetadata;
74
- var index = activity.attachments.findIndex(function (attachment) { return (attachment.name === fileMetadata_1.name); }); // eslint-disable-line @typescript-eslint/no-explicit-any
75
- if (!activity.channelData.fileScan) {
76
- activity.channelData.fileScan = [];
77
- }
78
- activity.channelData.fileScan[index] = scan;
79
- }
80
- fileScanner.addNext(fileId, next);
81
- fileScanner.addActivity(fileId, __assign({}, activity));
82
- };
83
- fileIds = JSON.parse(amsreferences);
84
- fileIds.forEach(function (fileId) { return scanFile_1(fileId); });
85
- }
86
- catch (e) {
87
- console.error(e);
88
- }
89
- }
90
- return [2 /*return*/, next(activity)];
91
- });
92
- }); }; }; };
93
- return fileScanIngressMiddleware;
94
- };
95
- exports.default = createFileScanIngressMiddleware;
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
+ return new (P || (P = Promise))(function (resolve, reject) {
16
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
20
+ });
21
+ };
22
+ var __generator = (this && this.__generator) || function (thisArg, body) {
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
+ function verb(n) { return function (v) { return step([n, v]); }; }
26
+ function step(op) {
27
+ if (f) throw new TypeError("Generator is already executing.");
28
+ while (_) try {
29
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
+ if (y = 0, t) op = [op[0] & 2, t.value];
31
+ switch (op[0]) {
32
+ case 0: case 1: t = op; break;
33
+ case 4: _.label++; return { value: op[1], done: false };
34
+ case 5: _.label++; y = op[1]; op = [0]; continue;
35
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
+ default:
37
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
+ if (t[2]) _.ops.pop();
42
+ _.trys.pop(); continue;
43
+ }
44
+ op = body.call(thisArg, _);
45
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
+ }
48
+ };
49
+ Object.defineProperty(exports, "__esModule", { value: true });
50
+ var createFileScanIngressMiddleware = function () {
51
+ var fileScanIngressMiddleware = function () { return function (next) { return function (activity) { return __awaiter(void 0, void 0, void 0, function () {
52
+ var attachments, channelData, amsreferences, scanFile_1, fileIds;
53
+ var _a, _b;
54
+ return __generator(this, function (_c) {
55
+ attachments = activity.attachments, channelData = activity.channelData;
56
+ if (!attachments) {
57
+ return [2 /*return*/, next(activity)];
58
+ }
59
+ // Patch references
60
+ if (!((_a = channelData === null || channelData === void 0 ? void 0 : channelData.metadata) === null || _a === void 0 ? void 0 : _a.amsreferences) && ((_b = channelData === null || channelData === void 0 ? void 0 : channelData.metadata) === null || _b === void 0 ? void 0 : _b.amsReferences)) {
61
+ activity.channelData.metadata.amsreferences = channelData.metadata.amsReferences;
62
+ }
63
+ amsreferences = channelData.metadata.amsreferences;
64
+ if (amsreferences) {
65
+ try {
66
+ scanFile_1 = function (fileId) {
67
+ var fileScanner = window.chatAdapter.fileManager.fileScanner; // eslint-disable-line @typescript-eslint/no-explicit-any
68
+ if (!fileScanner) {
69
+ return next(activity);
70
+ }
71
+ var scanResult = fileScanner.retrieveFileScanResult(fileId);
72
+ if (scanResult) {
73
+ var scan = scanResult.scan, fileMetadata_1 = scanResult.fileMetadata;
74
+ var index = activity.attachments.findIndex(function (attachment) { return (attachment.name === fileMetadata_1.name); }); // eslint-disable-line @typescript-eslint/no-explicit-any
75
+ if (!activity.channelData.fileScan) {
76
+ activity.channelData.fileScan = [];
77
+ }
78
+ activity.channelData.fileScan[index] = scan;
79
+ }
80
+ fileScanner.addNext(fileId, next);
81
+ fileScanner.addActivity(fileId, __assign({}, activity));
82
+ };
83
+ fileIds = JSON.parse(amsreferences);
84
+ fileIds.forEach(function (fileId) { return scanFile_1(fileId); });
85
+ }
86
+ catch (e) {
87
+ console.error(e);
88
+ }
89
+ }
90
+ return [2 /*return*/, next(activity)];
91
+ });
92
+ }); }; }; };
93
+ return fileScanIngressMiddleware;
94
+ };
95
+ exports.default = createFileScanIngressMiddleware;
96
96
  //# sourceMappingURL=createFileScanIngressMiddleware.js.map
@@ -1,2 +1,2 @@
1
- declare const createFormatEgressTagsMiddleware: () => CallableFunction;
2
- export default createFormatEgressTagsMiddleware;
1
+ declare const createFormatEgressTagsMiddleware: () => CallableFunction;
2
+ export default createFormatEgressTagsMiddleware;
@@ -1,31 +1,31 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var createFormatEgressTagsMiddleware = function () {
4
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
- var formatEgressTagsMiddleware = function () { return function (next) { return function (activity) {
6
- var patchedActivity = JSON.parse(JSON.stringify(activity));
7
- if (patchedActivity) {
8
- if (patchedActivity.channelData && patchedActivity.channelData.tags) {
9
- var tags = patchedActivity.channelData.tags;
10
- if (typeof tags === 'string') {
11
- return next(activity);
12
- }
13
- else if (tags instanceof Array) {
14
- patchedActivity.channelData.tags = tags.toString();
15
- }
16
- else if (typeof patchedActivity.channelData.tags === 'object') {
17
- try {
18
- patchedActivity.channelData.tags = JSON.stringify(tags);
19
- }
20
- catch (error) {
21
- console.error(error);
22
- }
23
- }
24
- }
25
- }
26
- return next(patchedActivity);
27
- }; }; };
28
- return formatEgressTagsMiddleware;
29
- };
30
- exports.default = createFormatEgressTagsMiddleware;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var createFormatEgressTagsMiddleware = function () {
4
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
+ var formatEgressTagsMiddleware = function () { return function (next) { return function (activity) {
6
+ var patchedActivity = JSON.parse(JSON.stringify(activity));
7
+ if (patchedActivity) {
8
+ if (patchedActivity.channelData && patchedActivity.channelData.tags) {
9
+ var tags = patchedActivity.channelData.tags;
10
+ if (typeof tags === 'string') {
11
+ return next(activity);
12
+ }
13
+ else if (tags instanceof Array) {
14
+ patchedActivity.channelData.tags = tags.toString();
15
+ }
16
+ else if (typeof patchedActivity.channelData.tags === 'object') {
17
+ try {
18
+ patchedActivity.channelData.tags = JSON.stringify(tags);
19
+ }
20
+ catch (error) {
21
+ console.error(error);
22
+ }
23
+ }
24
+ }
25
+ }
26
+ return next(patchedActivity);
27
+ }; }; };
28
+ return formatEgressTagsMiddleware;
29
+ };
30
+ exports.default = createFormatEgressTagsMiddleware;
31
31
  //# sourceMappingURL=createFormatEgressTagsMiddleware.js.map
@@ -1,2 +1,2 @@
1
- declare const createFormatIngressTagsMiddleware: () => CallableFunction;
2
- export default createFormatIngressTagsMiddleware;
1
+ declare const createFormatIngressTagsMiddleware: () => CallableFunction;
2
+ export default createFormatIngressTagsMiddleware;
@@ -1,25 +1,25 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var createFormatIngressTagsMiddleware = function () {
4
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
- var formatIngressTagsMiddleware = function () { return function (next) { return function (activity) {
6
- var patchedActivity = JSON.parse(JSON.stringify(activity));
7
- if (patchedActivity) {
8
- if (patchedActivity.channelData && patchedActivity.channelData.tags) {
9
- var tags = patchedActivity.channelData.tags;
10
- if (typeof tags === 'string') {
11
- try {
12
- patchedActivity.channelData.tags = JSON.parse(tags); // Attempt to parse tags in JSON format
13
- }
14
- catch (_a) {
15
- patchedActivity.channelData.tags = tags.split(','); // Convert string to array
16
- }
17
- }
18
- }
19
- }
20
- return next(patchedActivity);
21
- }; }; };
22
- return formatIngressTagsMiddleware;
23
- };
24
- exports.default = createFormatIngressTagsMiddleware;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var createFormatIngressTagsMiddleware = function () {
4
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
+ var formatIngressTagsMiddleware = function () { return function (next) { return function (activity) {
6
+ var patchedActivity = JSON.parse(JSON.stringify(activity));
7
+ if (patchedActivity) {
8
+ if (patchedActivity.channelData && patchedActivity.channelData.tags) {
9
+ var tags = patchedActivity.channelData.tags;
10
+ if (typeof tags === 'string') {
11
+ try {
12
+ patchedActivity.channelData.tags = JSON.parse(tags); // Attempt to parse tags in JSON format
13
+ }
14
+ catch (_a) {
15
+ patchedActivity.channelData.tags = tags.split(','); // Convert string to array
16
+ }
17
+ }
18
+ }
19
+ }
20
+ return next(patchedActivity);
21
+ }; }; };
22
+ return formatIngressTagsMiddleware;
23
+ };
24
+ exports.default = createFormatIngressTagsMiddleware;
25
25
  //# sourceMappingURL=createFormatIngressTagsMiddleware.js.map
@@ -1,7 +1,7 @@
1
- export default interface ICallingSDKLogData {
2
- CallId: string;
3
- Event: string;
4
- ElapsedTimeInMilliseconds: number;
5
- ExceptionDetails: object;
6
- Description: string;
7
- }
1
+ export default interface ICallingSDKLogData {
2
+ CallId: string;
3
+ Event: string;
4
+ ElapsedTimeInMilliseconds: number;
5
+ ExceptionDetails: object;
6
+ Description: string;
7
+ }
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=ICallingSDKLogData.js.map
@@ -1,11 +1,11 @@
1
- export default interface IChatToken {
2
- chatId?: string;
3
- regionGTMS?: any;
4
- requestId?: string;
5
- token?: string;
6
- expiresIn?: string;
7
- visitorId?: string;
8
- voiceVideoCallToken?: any;
9
- acsEndpoint?: string;
10
- amsEndpoint?: string;
11
- }
1
+ export default interface IChatToken {
2
+ chatId?: string;
3
+ regionGTMS?: any;
4
+ requestId?: string;
5
+ token?: string;
6
+ expiresIn?: string;
7
+ visitorId?: string;
8
+ voiceVideoCallToken?: any;
9
+ acsEndpoint?: string;
10
+ amsEndpoint?: string;
11
+ }
@@ -1,4 +1,4 @@
1
- "use strict";
2
- /* eslint-disable @typescript-eslint/no-explicit-any */
3
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  //# sourceMappingURL=IChatToken.js.map