Update adapter (#127)
* Update adapter version * Pass logger to adapter * Update adapter version * Update CHANGELOG.md * Fix tests
This commit is contained in:
Родитель
935a7e19a7
Коммит
6567000a5c
|
@ -17,6 +17,7 @@ All notable changes to this project will be documented in this file.
|
|||
- Throw exception on `ChatSDK.getVoiceVideoCalling()` if feature is disabled or platform is not supported
|
||||
- Add `participantType` & `canRenderPostChat` as response of getConversationDetails() API
|
||||
- Add support for separate bot post chat survey feature
|
||||
- Pass `logger` to `acs_webchat-chat-adapter`
|
||||
|
||||
### Fix
|
||||
- Add `acs_webchat-chat-adapter` middlewares to format `channelData.tags`
|
||||
|
@ -31,6 +32,7 @@ All notable changes to this project will be documented in this file.
|
|||
- Uptake [@azure/communication-chat@1.1.1](https://www.npmjs.com/package/@azure/communication-chat/v/1.1.1)
|
||||
- Uptake [acs_webchat-chat-adapter@0.0.35-beta.2](https://unpkg.com/acs_webchat-chat-adapter@0.0.35-beta.2/dist/chat-adapter.js)
|
||||
- Update `locale` property in `ChatTranscriptBody` interface to be optional
|
||||
- Uptake [acs_webchat-chat-adapter@0.0.35-beta.4](https://unpkg.com/acs_webchat-chat-adapter@0.0.35-beta.4/dist/chat-adapter.js)
|
||||
|
||||
## [1.0.0] - 2021-10-08
|
||||
### Added
|
||||
|
|
|
@ -254,7 +254,7 @@ describe('loggers', () => {
|
|||
info: jest.fn()
|
||||
}
|
||||
|
||||
it('ACSAdapterLogger.logClientSdkTelemetryEvent() with LogLevel DEBUG should call telemetry.debug()', () => {
|
||||
it('ACSAdapterLogger.logEvent() with LogLevel DEBUG should call telemetry.debug()', () => {
|
||||
const logger = new ACSAdapterLogger(omnichannelConfig);
|
||||
|
||||
const eventData = {
|
||||
|
@ -262,12 +262,12 @@ describe('loggers', () => {
|
|||
};
|
||||
|
||||
logger.useTelemetry(telemetry as any);
|
||||
logger.logClientSdkTelemetryEvent(LogLevel.DEBUG, eventData as any);
|
||||
logger.logEvent(LogLevel.DEBUG, eventData as any);
|
||||
|
||||
expect(telemetry.debug).toBeCalledTimes(1);
|
||||
});
|
||||
|
||||
it('ACSAdapterLogger.logClientSdkTelemetryEvent() with LogLevel WARN should call telemetry.warn()', () => {
|
||||
it('ACSAdapterLogger.logEvent() with LogLevel WARN should call telemetry.warn()', () => {
|
||||
const logger = new ACSAdapterLogger(omnichannelConfig);
|
||||
|
||||
const eventData = {
|
||||
|
@ -275,12 +275,12 @@ describe('loggers', () => {
|
|||
};
|
||||
|
||||
logger.useTelemetry(telemetry as any);
|
||||
logger.logClientSdkTelemetryEvent(LogLevel.WARN, eventData as any);
|
||||
logger.logEvent(LogLevel.WARN, eventData as any);
|
||||
|
||||
expect(telemetry.warn).toBeCalledTimes(1);
|
||||
});
|
||||
|
||||
it('ACSAdapterLogger.logClientSdkTelemetryEvent() with LogLevel ERROR should call telemetry.error()', () => {
|
||||
it('ACSAdapterLogger.logEvent() with LogLevel ERROR should call telemetry.error()', () => {
|
||||
const logger = new ACSAdapterLogger(omnichannelConfig);
|
||||
|
||||
const eventData = {
|
||||
|
@ -288,12 +288,12 @@ describe('loggers', () => {
|
|||
};
|
||||
|
||||
logger.useTelemetry(telemetry as any);
|
||||
logger.logClientSdkTelemetryEvent(LogLevel.ERROR, eventData as any);
|
||||
logger.logEvent(LogLevel.ERROR, eventData as any);
|
||||
|
||||
expect(telemetry.error).toBeCalledTimes(1);
|
||||
});
|
||||
|
||||
it('ACSAdapterLogger.logClientSdkTelemetryEvent() with LogLevel INFO should call telemetry.info()', () => {
|
||||
it('ACSAdapterLogger.logEvent() with LogLevel INFO should call telemetry.info()', () => {
|
||||
const logger = new ACSAdapterLogger(omnichannelConfig);
|
||||
|
||||
const eventData = {
|
||||
|
@ -301,7 +301,7 @@ describe('loggers', () => {
|
|||
};
|
||||
|
||||
logger.useTelemetry(telemetry as any);
|
||||
logger.logClientSdkTelemetryEvent(LogLevel.INFO, eventData as any);
|
||||
logger.logEvent(LogLevel.INFO, eventData as any);
|
||||
|
||||
expect(telemetry.info).toBeCalledTimes(1);
|
||||
});
|
||||
|
|
|
@ -8,7 +8,6 @@ import { defaultLocaleId, getLocaleStringFromId } from "./utils/locale";
|
|||
import { loadScript, removeElementById } from "./utils/WebUtils";
|
||||
import platform, { isBrowser } from "./utils/platform";
|
||||
import validateSDKConfig, {defaultChatSDKConfig} from "./validators/SDKConfigValidators";
|
||||
|
||||
import ACSParticipantDisplayName from "./core/messaging/ACSParticipantDisplayName";
|
||||
import AMSFileManager from "./external/ACSAdapter/AMSFileManager";
|
||||
import AriaTelemetry from "./telemetry/AriaTelemetry";
|
||||
|
@ -1497,10 +1496,9 @@ class OmnichannelChatSDK {
|
|||
this.chatToken.chatId as string,
|
||||
this.chatToken.acsEndpoint as string,
|
||||
fileManager,
|
||||
1000,
|
||||
ACSParticipantDisplayName.Customer,
|
||||
undefined, // chatClient
|
||||
undefined, // logger
|
||||
this.acsAdapterLogger, // logger
|
||||
featuresOption,
|
||||
);
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const ic3ClientVersion = '2021.08.14.1';
|
||||
const webChatIC3AdapterVersion = '0.1.0-master.2dba07b';
|
||||
const webChatACSAdapterVersion = '0.0.35-beta.2';
|
||||
const webChatACSAdapterVersion = '0.0.35-beta.4';
|
||||
const ariaTelemetryKey = 'c7655518acf1403f93ff6b9f77942f0a-d01a02fd-6b50-4de3-a566-62eda11f93bc-7083';
|
||||
|
||||
export {
|
||||
|
|
|
@ -333,7 +333,7 @@ export class ACSAdapterLogger {
|
|||
this.scenarioMarker?.useTelemetry(this.telemetry);
|
||||
}
|
||||
|
||||
public logClientSdkTelemetryEvent(logLevel: LogLevel, event: any): void { // eslint-disable-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
||||
public logEvent(logLevel: LogLevel, event: any): void { // eslint-disable-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
||||
/* istanbul ignore next */
|
||||
this.debug && console.log(`[ACSAdapterLogger][logClientSdkTelemetryEvent][${logLevel}]`);
|
||||
/* istanbul ignore next */
|
||||
|
|
Загрузка…
Ссылка в новой задаче