@webex/calling 3.7.0-next.2 → 3.7.0-next.21

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 (35) hide show
  1. package/dist/CallingClient/CallingClient.js +49 -9
  2. package/dist/CallingClient/CallingClient.js.map +1 -1
  3. package/dist/CallingClient/calling/call.js +121 -57
  4. package/dist/CallingClient/calling/call.js.map +1 -1
  5. package/dist/CallingClient/calling/call.test.js +21 -8
  6. package/dist/CallingClient/calling/call.test.js.map +1 -1
  7. package/dist/Contacts/ContactsClient.js +37 -16
  8. package/dist/Contacts/ContactsClient.js.map +1 -1
  9. package/dist/Contacts/ContactsClient.test.js +34 -0
  10. package/dist/Contacts/ContactsClient.test.js.map +1 -1
  11. package/dist/Logger/index.js +22 -14
  12. package/dist/Logger/index.js.map +1 -1
  13. package/dist/Logger/index.test.js +30 -5
  14. package/dist/Logger/index.test.js.map +1 -1
  15. package/dist/SDKConnector/types.js.map +1 -1
  16. package/dist/common/Utils.js +96 -0
  17. package/dist/common/Utils.js.map +1 -1
  18. package/dist/common/Utils.test.js +98 -0
  19. package/dist/common/Utils.test.js.map +1 -1
  20. package/dist/module/CallingClient/CallingClient.js +8 -1
  21. package/dist/module/CallingClient/calling/call.js +64 -1
  22. package/dist/module/Contacts/ContactsClient.js +16 -5
  23. package/dist/module/Logger/index.js +20 -11
  24. package/dist/module/common/Utils.js +48 -0
  25. package/dist/types/CallingClient/CallingClient.d.ts +3 -0
  26. package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
  27. package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
  28. package/dist/types/Contacts/ContactsClient.d.ts.map +1 -1
  29. package/dist/types/Logger/index.d.ts +2 -0
  30. package/dist/types/Logger/index.d.ts.map +1 -1
  31. package/dist/types/SDKConnector/types.d.ts +12 -9
  32. package/dist/types/SDKConnector/types.d.ts.map +1 -1
  33. package/dist/types/common/Utils.d.ts +2 -0
  34. package/dist/types/common/Utils.d.ts.map +1 -1
  35. package/package.json +3 -3
@@ -2924,6 +2924,7 @@ describe('Supplementary Services tests', function () {
2924
2924
 
2925
2925
  /* A spy on handleCallErrors to check whether it is being invoked or not depending on tests */
2926
2926
  var handleErrorSpy = jest.spyOn(Utils, 'handleCallErrors');
2927
+ var uploadLogsSpy = jest.spyOn(Utils, 'uploadLogs');
2927
2928
  var transferLoggingContext = {
2928
2929
  file: 'call',
2929
2930
  method: 'completeTransfer'
@@ -2948,7 +2949,7 @@ describe('Supplementary Services tests', function () {
2948
2949
  return _regenerator.default.wrap(function _callee63$(_context63) {
2949
2950
  while (1) switch (_context63.prev = _context63.next) {
2950
2951
  case 0:
2951
- expect.assertions(9);
2952
+ expect.assertions(10);
2952
2953
  responsePayload = {
2953
2954
  statusCode: 200,
2954
2955
  body: mockResponseBody
@@ -3008,9 +3009,10 @@ describe('Supplementary Services tests', function () {
3008
3009
  expect(call['callStateMachine'].state.value).toStrictEqual('S_RECV_CALL_DISCONNECT');
3009
3010
  expect(secondCall['callStateMachine'].state.value).toStrictEqual('S_RECV_CALL_DISCONNECT');
3010
3011
  expect(handleErrorSpy).not.toBeCalled();
3012
+ expect(uploadLogsSpy).not.toBeCalled();
3011
3013
  expect(infoSpy).toHaveBeenCalledWith("Initiating Consult transfer between : ".concat(call.getCallId(), " and ").concat(secondCall.getCallId()), transferLoggingContext);
3012
3014
  expect(warnSpy).not.toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
3013
- case 21:
3015
+ case 22:
3014
3016
  case "end":
3015
3017
  return _context63.stop();
3016
3018
  }
@@ -3021,7 +3023,7 @@ describe('Supplementary Services tests', function () {
3021
3023
  return _regenerator.default.wrap(function _callee65$(_context65) {
3022
3024
  while (1) switch (_context65.prev = _context65.next) {
3023
3025
  case 0:
3024
- expect.assertions(7);
3026
+ expect.assertions(8);
3025
3027
  responsePayload = {
3026
3028
  statusCode: 200,
3027
3029
  body: mockResponseBody
@@ -3061,9 +3063,10 @@ describe('Supplementary Services tests', function () {
3061
3063
  /* We should return back to S_RECV_CALL_DISCONNECT state */
3062
3064
  expect(call['callStateMachine'].state.value).toStrictEqual('S_RECV_CALL_DISCONNECT');
3063
3065
  expect(handleErrorSpy).not.toBeCalled();
3066
+ expect(uploadLogsSpy).not.toBeCalled();
3064
3067
  expect(infoSpy).toHaveBeenCalledWith("Initiating Blind transfer with : ".concat(transfereeNumber), transferLoggingContext);
3065
3068
  expect(warnSpy).not.toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
3066
- case 18:
3069
+ case 19:
3067
3070
  case "end":
3068
3071
  return _context65.stop();
3069
3072
  }
@@ -3095,11 +3098,15 @@ describe('Supplementary Services tests', function () {
3095
3098
  expect(handleErrorSpy).toHaveBeenCalledWith(expect.anything(), _types.ERROR_LAYER.CALL_CONTROL,
3096
3099
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
3097
3100
  expect.anything(), call.getCorrelationId(), responsePayload, 'completeTransfer', 'call');
3101
+ expect(uploadLogsSpy).toHaveBeenCalledWith(webex, {
3102
+ correlationId: call.getCorrelationId(),
3103
+ callId: call.getCallId()
3104
+ });
3098
3105
  /* check whether error event is being emitted by sdk */
3099
3106
  expect(emitSpy).toBeCalledOnceWith(_types2.CALL_EVENT_KEYS.TRANSFER_ERROR, expect.any(_Errors.CallError));
3100
3107
  expect(warnSpy).toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
3101
3108
  expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.BLIND, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
3102
- case 16:
3109
+ case 17:
3103
3110
  case "end":
3104
3111
  return _context66.stop();
3105
3112
  }
@@ -3132,11 +3139,15 @@ describe('Supplementary Services tests', function () {
3132
3139
  expect(handleErrorSpy).toHaveBeenCalledWith(expect.anything(), _types.ERROR_LAYER.CALL_CONTROL,
3133
3140
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
3134
3141
  expect.anything(), call.getCorrelationId(), responsePayload, 'completeTransfer', 'call');
3142
+ expect(uploadLogsSpy).toHaveBeenCalledWith(webex, {
3143
+ correlationId: call.getCorrelationId(),
3144
+ callId: call.getCallId()
3145
+ });
3135
3146
  /* check whether error event is being emitted by sdk */
3136
3147
  expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.TRANSFER_ERROR, expect.any(_Errors.CallError));
3137
3148
  expect(warnSpy).toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
3138
3149
  expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.CONSULT, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
3139
- case 17:
3150
+ case 18:
3140
3151
  case "end":
3141
3152
  return _context67.stop();
3142
3153
  }
@@ -3156,9 +3167,10 @@ describe('Supplementary Services tests', function () {
3156
3167
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
3157
3168
  expect(secondCall['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
3158
3169
  expect(handleErrorSpy).not.toBeCalled();
3170
+ expect(uploadLogsSpy).not.toBeCalled();
3159
3171
  expect(requestSpy).not.toBeCalled();
3160
3172
  expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
3161
- case 9:
3173
+ case 10:
3162
3174
  case "end":
3163
3175
  return _context68.stop();
3164
3176
  }
@@ -3178,9 +3190,10 @@ describe('Supplementary Services tests', function () {
3178
3190
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
3179
3191
  expect(secondCall['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
3180
3192
  expect(handleErrorSpy).not.toBeCalled();
3193
+ expect(uploadLogsSpy).not.toBeCalled();
3181
3194
  expect(requestSpy).not.toBeCalled();
3182
3195
  expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
3183
- case 9:
3196
+ case 10:
3184
3197
  case "end":
3185
3198
  return _context69.stop();
3186
3199
  }