@webex/contact-center 3.12.0-next.40 → 3.12.0-next.42

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/dist/cc.js CHANGED
@@ -421,7 +421,7 @@ class ContactCenter extends _webexCore.WebexPlugin {
421
421
  * ```
422
422
  */
423
423
  async register() {
424
- _loggerProxy.default.info('Starting CC SDK registration', {
424
+ _loggerProxy.default.log('Starting CC SDK registration', {
425
425
  module: _constants.CC_FILE,
426
426
  method: _constants.METHODS.REGISTER
427
427
  });
@@ -616,7 +616,7 @@ class ContactCenter extends _webexCore.WebexPlugin {
616
616
  * @private
617
617
  */
618
618
  async connectWebsocket() {
619
- _loggerProxy.default.info('Connecting to websocket', {
619
+ _loggerProxy.default.log('Connecting to websocket', {
620
620
  module: _constants.CC_FILE,
621
621
  method: _constants.METHODS.CONNECT_WEBSOCKET
622
622
  });
@@ -639,7 +639,7 @@ class ContactCenter extends _webexCore.WebexPlugin {
639
639
  this.taskManager.setWebRtcEnabled(this.agentConfig.webRtcEnabled);
640
640
  this.apiAIAssistant.setAIFeatureFlags(this.agentConfig.aiFeature);
641
641
  if (this.agentConfig.aiFeature?.realtimeTranscripts?.enable) {
642
- _loggerProxy.default.info('Connecting to RTD websocket', {
642
+ _loggerProxy.default.log('Connecting to RTD websocket', {
643
643
  module: _constants.CC_FILE,
644
644
  method: _constants.METHODS.CONNECT_WEBSOCKET
645
645
  });
@@ -675,6 +675,11 @@ class ContactCenter extends _webexCore.WebexPlugin {
675
675
  }
676
676
  if (this.$config && this.$config.allowAutomatedRelogin) {
677
677
  await this.silentRelogin();
678
+ } else {
679
+ _loggerProxy.default.log('Skipping silent relogin: allowAutomatedRelogin is disabled', {
680
+ module: _constants.CC_FILE,
681
+ method: _constants.METHODS.CONNECT_WEBSOCKET
682
+ });
678
683
  }
679
684
  return this.agentConfig;
680
685
  } catch (error) {
@@ -715,22 +720,27 @@ class ContactCenter extends _webexCore.WebexPlugin {
715
720
  * ```
716
721
  */
717
722
  async stationLogin(data) {
718
- _loggerProxy.default.info('Starting agent station login', {
723
+ const loggerContext = {
719
724
  module: _constants.CC_FILE,
720
725
  method: _constants.METHODS.STATION_LOGIN
721
- });
726
+ };
722
727
  try {
728
+ _loggerProxy.default.log(`Starting agent station login | loginOption: ${data?.loginOption} teamId: ${data?.teamId}`, loggerContext);
723
729
  this.metricsManager.timeEvent([_constants4.METRIC_EVENT_NAMES.STATION_LOGIN_SUCCESS, _constants4.METRIC_EVENT_NAMES.STATION_LOGIN_FAILED]);
724
730
  const dialPlanEntries = this.agentConfig?.dialPlan?.dialPlanEntity ?? [];
725
- if (data.loginOption === _types.LoginOption.AGENT_DN && !(0, _Utils.isValidDialNumber)(data.dialNumber, dialPlanEntries)) {
726
- const error = new Error('INVALID_DIAL_NUMBER');
727
- // @ts-ignore - adding custom key to the error object
728
- error.details = {
729
- data: {
730
- reason: 'INVALID_DIAL_NUMBER'
731
- }
732
- };
733
- throw error;
731
+ if (data.loginOption === _types.LoginOption.AGENT_DN) {
732
+ _loggerProxy.default.log(`Validating dial number | dialPlanEnabled: ${!!this.agentConfig?.dialPlan} | dialPlanEntryCount: ${dialPlanEntries.length}`, loggerContext);
733
+ if (!(0, _Utils.isValidDialNumber)(data.dialNumber, dialPlanEntries)) {
734
+ _loggerProxy.default.log(`Dial number validation failed | dialNumber: ${data.dialNumber} | dialPlanEntryCount: ${dialPlanEntries.length}`, loggerContext);
735
+ const error = new Error('INVALID_DIAL_NUMBER');
736
+ // @ts-ignore - adding custom key to the error object
737
+ error.details = {
738
+ data: {
739
+ reason: 'INVALID_DIAL_NUMBER'
740
+ }
741
+ };
742
+ throw error;
743
+ }
734
744
  }
735
745
  const loginResponse = await this.services.agent.stationLogin({
736
746
  data: {
@@ -1102,13 +1112,13 @@ class ContactCenter extends _webexCore.WebexPlugin {
1102
1112
  async handleConnectionLost(msg) {
1103
1113
  if (msg.isConnectionLost) {
1104
1114
  // TODO: Emit an event saying connection is lost
1105
- _loggerProxy.default.info('event=handleConnectionLost | Connection lost', {
1115
+ _loggerProxy.default.log('event=handleConnectionLost | Connection lost', {
1106
1116
  module: _constants.CC_FILE,
1107
1117
  method: _constants.METHODS.HANDLE_CONNECTION_LOST
1108
1118
  });
1109
1119
  } else if (msg.isSocketReconnected) {
1110
1120
  // TODO: Emit an event saying connection is re-estabilished
1111
- _loggerProxy.default.info('event=handleConnectionReconnect | Connection reconnected attempting to request silent relogin', {
1121
+ _loggerProxy.default.log('event=handleConnectionReconnect | Connection reconnected attempting to request silent relogin', {
1112
1122
  module: _constants.CC_FILE,
1113
1123
  method: _constants.METHODS.HANDLE_CONNECTION_LOST
1114
1124
  });
@@ -1123,7 +1133,7 @@ class ContactCenter extends _webexCore.WebexPlugin {
1123
1133
  * @private
1124
1134
  */
1125
1135
  async silentRelogin() {
1126
- _loggerProxy.default.info('Starting silent relogin process', {
1136
+ _loggerProxy.default.log('Starting silent relogin process', {
1127
1137
  module: _constants.CC_FILE,
1128
1138
  method: _constants.METHODS.SILENT_RELOGIN
1129
1139
  });
@@ -1145,7 +1155,7 @@ class ContactCenter extends _webexCore.WebexPlugin {
1145
1155
  this.agentConfig.currentTeamId = reLoginResponse.data.teamId;
1146
1156
  await this.handleDeviceType(deviceType, dn);
1147
1157
  if (lastStateChangeReason === 'agent-wss-disconnect') {
1148
- _loggerProxy.default.info('event=requestAutoStateChange | Requesting state change to available on socket reconnect', {
1158
+ _loggerProxy.default.log('event=requestAutoStateChange | Requesting state change to available on socket reconnect', {
1149
1159
  module: _constants.CC_FILE,
1150
1160
  method: _constants.METHODS.SILENT_RELOGIN
1151
1161
  });