bandwidth-sdk 8.1.5 → 8.3.0

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 (236) hide show
  1. package/.github/workflows/deploy.yml +1 -1
  2. package/.openapi-generator/FILES +4 -0
  3. package/README.md +2 -0
  4. package/api/media-api.ts +12 -12
  5. package/bandwidth.yml +65 -4
  6. package/configuration.ts +8 -2
  7. package/coverage/clover.xml +121 -104
  8. package/coverage/coverage-final.json +17 -15
  9. package/coverage/lcov-report/index.html +24 -24
  10. package/coverage/lcov-report/node-sdk/api/calls-api.ts.html +1 -1
  11. package/coverage/lcov-report/node-sdk/api/conferences-api.ts.html +1 -1
  12. package/coverage/lcov-report/node-sdk/api/endpoints-api.ts.html +1 -1
  13. package/coverage/lcov-report/node-sdk/api/index.html +1 -1
  14. package/coverage/lcov-report/node-sdk/api/media-api.ts.html +13 -13
  15. package/coverage/lcov-report/node-sdk/api/messages-api.ts.html +1 -1
  16. package/coverage/lcov-report/node-sdk/api/mfaapi.ts.html +1 -1
  17. package/coverage/lcov-report/node-sdk/api/multi-channel-api.ts.html +1 -1
  18. package/coverage/lcov-report/node-sdk/api/phone-number-lookup-api.ts.html +1 -1
  19. package/coverage/lcov-report/node-sdk/api/recordings-api.ts.html +1 -1
  20. package/coverage/lcov-report/node-sdk/api/statistics-api.ts.html +1 -1
  21. package/coverage/lcov-report/node-sdk/api/toll-free-verification-api.ts.html +1 -1
  22. package/coverage/lcov-report/node-sdk/api/transcriptions-api.ts.html +1 -1
  23. package/coverage/lcov-report/node-sdk/api.ts.html +1 -1
  24. package/coverage/lcov-report/node-sdk/base.ts.html +1 -1
  25. package/coverage/lcov-report/node-sdk/common.ts.html +18 -18
  26. package/coverage/lcov-report/node-sdk/configuration.ts.html +31 -13
  27. package/coverage/lcov-report/node-sdk/index.html +19 -19
  28. package/coverage/lcov-report/node-sdk/models/business-entity-type-enum.ts.html +1 -1
  29. package/coverage/lcov-report/node-sdk/models/business-registration-type-enum.ts.html +1 -1
  30. package/coverage/lcov-report/node-sdk/models/bxml/Bxml.ts.html +1 -1
  31. package/coverage/lcov-report/node-sdk/models/bxml/NestableVerb.ts.html +14 -14
  32. package/coverage/lcov-report/node-sdk/models/bxml/Response.ts.html +1 -1
  33. package/coverage/lcov-report/node-sdk/models/bxml/Root.ts.html +1 -1
  34. package/coverage/lcov-report/node-sdk/models/bxml/Verb.ts.html +13 -13
  35. package/coverage/lcov-report/node-sdk/models/bxml/index.html +1 -1
  36. package/coverage/lcov-report/node-sdk/models/bxml/index.ts.html +1 -1
  37. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Bridge.ts.html +1 -1
  38. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Conference.ts.html +1 -1
  39. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Connect.ts.html +5 -2
  40. package/coverage/lcov-report/node-sdk/models/bxml/verbs/CustomParam.ts.html +1 -1
  41. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Endpoint.ts.html +1 -1
  42. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Forward.ts.html +8 -2
  43. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Gather.ts.html +26 -2
  44. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Hangup.ts.html +1 -1
  45. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Pause.ts.html +1 -1
  46. package/coverage/lcov-report/node-sdk/models/bxml/verbs/PauseRecording.ts.html +1 -1
  47. package/coverage/lcov-report/node-sdk/models/bxml/verbs/PhoneNumber.ts.html +1 -1
  48. package/coverage/lcov-report/node-sdk/models/bxml/verbs/PlayAudio.ts.html +1 -1
  49. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Record.ts.html +8 -2
  50. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Redirect.ts.html +1 -1
  51. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Refer.ts.html +190 -0
  52. package/coverage/lcov-report/node-sdk/models/bxml/verbs/ResumeRecording.ts.html +1 -1
  53. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Ring.ts.html +1 -1
  54. package/coverage/lcov-report/node-sdk/models/bxml/verbs/SendDtmf.ts.html +1 -1
  55. package/coverage/lcov-report/node-sdk/models/bxml/verbs/SipUri.ts.html +5 -5
  56. package/coverage/lcov-report/node-sdk/models/bxml/verbs/SpeakSentence.ts.html +1 -1
  57. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StartGather.ts.html +1 -1
  58. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StartRecording.ts.html +8 -2
  59. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StartStream.ts.html +1 -1
  60. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StartTranscription.ts.html +8 -2
  61. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StopGather.ts.html +1 -1
  62. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StopRecording.ts.html +1 -1
  63. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StopStream.ts.html +1 -1
  64. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StopTranscription.ts.html +1 -1
  65. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StreamParam.ts.html +1 -1
  66. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Tag.ts.html +1 -1
  67. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Transfer.ts.html +5 -2
  68. package/coverage/lcov-report/node-sdk/models/bxml/verbs/index.html +23 -8
  69. package/coverage/lcov-report/node-sdk/models/bxml/verbs/index.ts.html +7 -4
  70. package/coverage/lcov-report/node-sdk/models/call-direction-enum.ts.html +2 -2
  71. package/coverage/lcov-report/node-sdk/models/call-state-enum.ts.html +1 -1
  72. package/coverage/lcov-report/node-sdk/models/call-transcription-detected-language-enum.ts.html +1 -1
  73. package/coverage/lcov-report/node-sdk/models/call-transcription-track-enum.ts.html +1 -1
  74. package/coverage/lcov-report/node-sdk/models/callback-method-enum.ts.html +1 -1
  75. package/coverage/lcov-report/node-sdk/models/card-width-enum.ts.html +1 -1
  76. package/coverage/lcov-report/node-sdk/models/completed-lookup-status-enum.ts.html +1 -1
  77. package/coverage/lcov-report/node-sdk/models/conference-state-enum.ts.html +1 -1
  78. package/coverage/lcov-report/node-sdk/models/deactivation-event-enum.ts.html +1 -1
  79. package/coverage/lcov-report/node-sdk/models/device-status-enum.ts.html +1 -1
  80. package/coverage/lcov-report/node-sdk/models/endpoint-direction-enum.ts.html +1 -1
  81. package/coverage/lcov-report/node-sdk/models/endpoint-event-type-enum.ts.html +1 -1
  82. package/coverage/lcov-report/node-sdk/models/endpoint-status-enum.ts.html +1 -1
  83. package/coverage/lcov-report/node-sdk/models/endpoint-type-enum.ts.html +1 -1
  84. package/coverage/lcov-report/node-sdk/models/file-format-enum.ts.html +1 -1
  85. package/coverage/lcov-report/node-sdk/models/in-progress-lookup-status-enum.ts.html +1 -1
  86. package/coverage/lcov-report/node-sdk/models/inbound-callback-type-enum.ts.html +1 -1
  87. package/coverage/lcov-report/node-sdk/models/index.html +20 -5
  88. package/coverage/lcov-report/node-sdk/models/index.ts.html +10 -4
  89. package/coverage/lcov-report/node-sdk/models/latest-message-delivery-status-enum.ts.html +1 -1
  90. package/coverage/lcov-report/node-sdk/models/line-type-enum.ts.html +1 -1
  91. package/coverage/lcov-report/node-sdk/models/list-message-direction-enum.ts.html +1 -1
  92. package/coverage/lcov-report/node-sdk/models/machine-detection-mode-enum.ts.html +1 -1
  93. package/coverage/lcov-report/node-sdk/models/message-direction-enum.ts.html +1 -1
  94. package/coverage/lcov-report/node-sdk/models/message-status-enum.ts.html +1 -1
  95. package/coverage/lcov-report/node-sdk/models/message-type-enum.ts.html +1 -1
  96. package/coverage/lcov-report/node-sdk/models/multi-channel-message-channel-enum.ts.html +1 -1
  97. package/coverage/lcov-report/node-sdk/models/priority-enum.ts.html +1 -1
  98. package/coverage/lcov-report/node-sdk/models/product-type-enum.ts.html +1 -1
  99. package/coverage/lcov-report/node-sdk/models/rbm-action-type-enum.ts.html +1 -1
  100. package/coverage/lcov-report/node-sdk/models/rbm-media-height-enum.ts.html +1 -1
  101. package/coverage/lcov-report/node-sdk/models/rbm-open-url-enum.ts.html +1 -1
  102. package/coverage/lcov-report/node-sdk/models/rbm-web-view-enum.ts.html +1 -1
  103. package/coverage/lcov-report/node-sdk/models/recording-state-enum.ts.html +1 -1
  104. package/coverage/lcov-report/node-sdk/models/redirect-method-enum.ts.html +1 -1
  105. package/coverage/lcov-report/node-sdk/models/refer-call-status-enum.ts.html +172 -0
  106. package/coverage/lcov-report/node-sdk/models/standalone-card-orientation-enum.ts.html +1 -1
  107. package/coverage/lcov-report/node-sdk/models/status-callback-type-enum.ts.html +1 -1
  108. package/coverage/lcov-report/node-sdk/models/tfv-callback-status-enum.ts.html +1 -1
  109. package/coverage/lcov-report/node-sdk/models/tfv-status-enum.ts.html +1 -1
  110. package/coverage/lcov-report/node-sdk/models/thumbnail-alignment-enum.ts.html +1 -1
  111. package/coverage/lcov-report/node-sdk/models/webhook-subscription-type-enum.ts.html +1 -1
  112. package/coverage/lcov.info +232 -191
  113. package/custom_templates/configuration.mustache +7 -1
  114. package/dist/api/media-api.d.ts +12 -12
  115. package/dist/api/media-api.js +12 -12
  116. package/dist/configuration.d.ts +5 -0
  117. package/dist/configuration.js +5 -4
  118. package/dist/models/answer-callback.d.ts +1 -1
  119. package/dist/models/bridge-complete-callback.d.ts +1 -1
  120. package/dist/models/bridge-target-complete-callback.d.ts +1 -1
  121. package/dist/models/bxml/verbs/Connect.d.ts +1 -0
  122. package/dist/models/bxml/verbs/Forward.d.ts +2 -0
  123. package/dist/models/bxml/verbs/Gather.d.ts +8 -0
  124. package/dist/models/bxml/verbs/Record.d.ts +2 -0
  125. package/dist/models/bxml/verbs/Refer.d.ts +27 -0
  126. package/dist/models/bxml/verbs/Refer.js +45 -0
  127. package/dist/models/bxml/verbs/StartRecording.d.ts +2 -0
  128. package/dist/models/bxml/verbs/StartTranscription.d.ts +2 -0
  129. package/dist/models/bxml/verbs/Transfer.d.ts +1 -0
  130. package/dist/models/bxml/verbs/index.d.ts +1 -0
  131. package/dist/models/bxml/verbs/index.js +1 -0
  132. package/dist/models/conference-completed-callback.d.ts +1 -1
  133. package/dist/models/conference-created-callback.d.ts +1 -1
  134. package/dist/models/conference-member-exit-callback.d.ts +1 -1
  135. package/dist/models/conference-member-join-callback.d.ts +1 -1
  136. package/dist/models/conference-recording-available-callback.d.ts +1 -1
  137. package/dist/models/conference-redirect-callback.d.ts +1 -1
  138. package/dist/models/disconnect-callback.d.ts +1 -1
  139. package/dist/models/dtmf-callback.d.ts +1 -1
  140. package/dist/models/gather-callback.d.ts +1 -1
  141. package/dist/models/index.d.ts +2 -0
  142. package/dist/models/index.js +2 -0
  143. package/dist/models/initiate-callback.d.ts +1 -1
  144. package/dist/models/machine-detection-complete-callback.d.ts +1 -1
  145. package/dist/models/recording-available-callback.d.ts +1 -1
  146. package/dist/models/recording-complete-callback.d.ts +1 -1
  147. package/dist/models/redirect-callback.d.ts +1 -1
  148. package/dist/models/refer-call-status-enum.d.ts +19 -0
  149. package/dist/models/refer-call-status-enum.js +23 -0
  150. package/dist/models/refer-complete-callback.d.ts +72 -0
  151. package/dist/models/refer-complete-callback.js +15 -0
  152. package/dist/models/transcription-available-callback.d.ts +1 -1
  153. package/dist/models/transfer-answer-callback.d.ts +1 -1
  154. package/dist/models/transfer-complete-callback.d.ts +1 -1
  155. package/dist/models/transfer-disconnect-callback.d.ts +1 -1
  156. package/docs/AnswerCallback.md +1 -1
  157. package/docs/BridgeCompleteCallback.md +1 -1
  158. package/docs/BridgeTargetCompleteCallback.md +1 -1
  159. package/docs/ConferenceCompletedCallback.md +1 -1
  160. package/docs/ConferenceCreatedCallback.md +1 -1
  161. package/docs/ConferenceMemberExitCallback.md +1 -1
  162. package/docs/ConferenceMemberJoinCallback.md +1 -1
  163. package/docs/ConferenceRecordingAvailableCallback.md +1 -1
  164. package/docs/ConferenceRedirectCallback.md +1 -1
  165. package/docs/DisconnectCallback.md +1 -1
  166. package/docs/DtmfCallback.md +1 -1
  167. package/docs/GatherCallback.md +1 -1
  168. package/docs/InitiateCallback.md +1 -1
  169. package/docs/MachineDetectionCompleteCallback.md +1 -1
  170. package/docs/MediaApi.md +6 -6
  171. package/docs/RecordingAvailableCallback.md +1 -1
  172. package/docs/RecordingCompleteCallback.md +1 -1
  173. package/docs/RedirectCallback.md +1 -1
  174. package/docs/ReferCallStatusEnum.md +11 -0
  175. package/docs/ReferCompleteCallback.md +49 -0
  176. package/docs/TranscriptionAvailableCallback.md +1 -1
  177. package/docs/TransferAnswerCallback.md +1 -1
  178. package/docs/TransferCompleteCallback.md +1 -1
  179. package/docs/TransferDisconnectCallback.md +1 -1
  180. package/models/answer-callback.ts +1 -1
  181. package/models/bridge-complete-callback.ts +1 -1
  182. package/models/bridge-target-complete-callback.ts +1 -1
  183. package/models/bxml/verbs/Connect.ts +1 -0
  184. package/models/bxml/verbs/Forward.ts +2 -0
  185. package/models/bxml/verbs/Gather.ts +8 -0
  186. package/models/bxml/verbs/Record.ts +2 -0
  187. package/models/bxml/verbs/Refer.ts +35 -0
  188. package/models/bxml/verbs/StartRecording.ts +2 -0
  189. package/models/bxml/verbs/StartTranscription.ts +2 -0
  190. package/models/bxml/verbs/Transfer.ts +1 -0
  191. package/models/bxml/verbs/index.ts +1 -0
  192. package/models/conference-completed-callback.ts +1 -1
  193. package/models/conference-created-callback.ts +1 -1
  194. package/models/conference-member-exit-callback.ts +1 -1
  195. package/models/conference-member-join-callback.ts +1 -1
  196. package/models/conference-recording-available-callback.ts +1 -1
  197. package/models/conference-redirect-callback.ts +1 -1
  198. package/models/disconnect-callback.ts +1 -1
  199. package/models/dtmf-callback.ts +1 -1
  200. package/models/gather-callback.ts +1 -1
  201. package/models/index.ts +2 -0
  202. package/models/initiate-callback.ts +1 -1
  203. package/models/machine-detection-complete-callback.ts +1 -1
  204. package/models/recording-available-callback.ts +1 -1
  205. package/models/recording-complete-callback.ts +1 -1
  206. package/models/redirect-callback.ts +1 -1
  207. package/models/refer-call-status-enum.ts +29 -0
  208. package/models/refer-complete-callback.ts +84 -0
  209. package/models/transcription-available-callback.ts +1 -1
  210. package/models/transfer-answer-callback.ts +1 -1
  211. package/models/transfer-complete-callback.ts +1 -1
  212. package/models/transfer-disconnect-callback.ts +1 -1
  213. package/package.json +1 -1
  214. package/tests/smoke/bxml.test.ts +24 -7
  215. package/tests/unit/api/calls-api.test.ts +1 -2
  216. package/tests/unit/api/conferences-api.test.ts +1 -2
  217. package/tests/unit/api/endpoints-api.test.ts +1 -2
  218. package/tests/unit/api/media-api.test.ts +1 -2
  219. package/tests/unit/api/messages-api.test.ts +1 -2
  220. package/tests/unit/api/mfaapi.test.ts +1 -2
  221. package/tests/unit/api/multi-channel-api.test.ts +1 -2
  222. package/tests/unit/api/phone-number-lookup-api.test.ts +1 -2
  223. package/tests/unit/api/recordings-api.test.ts +1 -2
  224. package/tests/unit/api/statistics-api.test.ts +1 -2
  225. package/tests/unit/api/toll-free-verification-api.test.ts +1 -2
  226. package/tests/unit/api/transcriptions-api.test.ts +1 -2
  227. package/tests/unit/models/bxml/verbs/Connect.test.ts +6 -5
  228. package/tests/unit/models/bxml/verbs/Forward.test.ts +4 -2
  229. package/tests/unit/models/bxml/verbs/Gather.test.ts +14 -6
  230. package/tests/unit/models/bxml/verbs/Record.test.ts +4 -2
  231. package/tests/unit/models/bxml/verbs/Refer.test.ts +40 -0
  232. package/tests/unit/models/bxml/verbs/StartRecording.test.ts +4 -2
  233. package/tests/unit/models/bxml/verbs/StartTranscription.test.ts +8 -6
  234. package/tests/unit/models/bxml/verbs/Transfer.test.ts +7 -6
  235. package/tests/unit/models/refer-call-status-enum.test.ts +12 -0
  236. package/tests/unit/models/refer-complete-callback.test.ts +41 -0
@@ -5,8 +5,7 @@ import { CodeRequest, VerifyCodeRequest } from '../../../models';
5
5
 
6
6
  describe('MFAApi', () => {
7
7
  const config = new Configuration({
8
- username: BW_USERNAME,
9
- password: BW_PASSWORD,
8
+ accessToken: 'abcd1234',
10
9
  basePath: 'http://127.0.0.1:4010'
11
10
  });
12
11
  const mfaApi = new MFAApi(config);
@@ -13,8 +13,7 @@ import {
13
13
 
14
14
  describe('MultiChannelApi', () => {
15
15
  const config = new Configuration({
16
- username: BW_USERNAME,
17
- password: BW_PASSWORD,
16
+ accessToken: 'abcd1234',
18
17
  basePath: 'http://127.0.0.1:4010'
19
18
  });
20
19
  const multiChannelApi = new MultiChannelApi(config);
@@ -11,8 +11,7 @@ import {
11
11
 
12
12
  describe('PhoneNumberLookupApi', () => {
13
13
  const config = new Configuration({
14
- username: BW_USERNAME,
15
- password: BW_PASSWORD,
14
+ accessToken: 'abcd1234',
16
15
  basePath: 'http://127.0.0.1:4010'
17
16
  });
18
17
  const phoneNumberLookupApi = new PhoneNumberLookupApi(config);
@@ -10,8 +10,7 @@ import {
10
10
 
11
11
  describe('RecordingsApi', () => {
12
12
  const config = new Configuration({
13
- username: BW_USERNAME,
14
- password: BW_PASSWORD,
13
+ accessToken: 'abcd1234',
15
14
  basePath: 'http://127.0.0.1:4010'
16
15
  });
17
16
  const recordingsApi = new RecordingsApi(config);
@@ -4,8 +4,7 @@ import { Configuration } from '../../../configuration';
4
4
 
5
5
  describe('StatisticsApi', () => {
6
6
  const config = new Configuration({
7
- username: BW_USERNAME,
8
- password: BW_PASSWORD,
7
+ accessToken: 'abcd1234',
9
8
  basePath: 'http://127.0.0.1:4010'
10
9
  });
11
10
  const statisticsApi = new StatisticsApi(config);
@@ -13,8 +13,7 @@ import {
13
13
 
14
14
  describe('TollFreeVerificationApi', () => {
15
15
  const config = new Configuration({
16
- username: BW_USERNAME,
17
- password: BW_PASSWORD,
16
+ accessToken: 'abcd1234',
18
17
  basePath: 'http://127.0.0.1:4010'
19
18
  });
20
19
  const tfvApi = new TollFreeVerificationApi(config);
@@ -4,8 +4,7 @@ import { CallTranscriptionDetectedLanguageEnum, CallTranscriptionTrackEnum } fro
4
4
 
5
5
  describe('TranscriptionsApi', () => {
6
6
  const config = new Configuration({
7
- username: BW_USERNAME,
8
- password: BW_PASSWORD,
7
+ accessToken: 'abcd1234',
9
8
  basePath: 'http://127.0.0.1:4010'
10
9
  });
11
10
  const transcriptionsApi = new TranscriptionsApi(config);
@@ -4,14 +4,15 @@ import { Endpoint } from '../../../../../models/bxml/verbs/Endpoint';
4
4
 
5
5
  describe('Connect', () => {
6
6
  const attributes: ConnectAttributes = {
7
- eventCallbackUrl: 'https://example.com/events'
7
+ eventCallbackUrl: 'https://example.com/events',
8
+ eventFallbackUrl: 'https://example.com/fallback'
8
9
  };
9
10
 
10
11
  const endpoint = new Endpoint('ep-123456');
11
12
 
12
13
  test('should create a Connect Verb', () => {
13
14
  const connect = new Connect(attributes);
14
- const expected = '<Connect eventCallbackUrl="https://example.com/events"/>';
15
+ const expected = '<Connect eventCallbackUrl="https://example.com/events" eventFallbackUrl="https://example.com/fallback"/>';
15
16
 
16
17
  expect(connect).toBeInstanceOf(Connect);
17
18
  expect(connect).toBeInstanceOf(Verb);
@@ -20,7 +21,7 @@ describe('Connect', () => {
20
21
 
21
22
  test('should create a Connect Verb with nested Endpoint', () => {
22
23
  const connect = new Connect(attributes, endpoint);
23
- const expected = '<Connect eventCallbackUrl="https://example.com/events"><Endpoint>ep-123456</Endpoint></Connect>';
24
+ const expected = '<Connect eventCallbackUrl="https://example.com/events" eventFallbackUrl="https://example.com/fallback"><Endpoint>ep-123456</Endpoint></Connect>';
24
25
 
25
26
  expect(connect).toBeInstanceOf(Connect);
26
27
  expect(connect).toBeInstanceOf(Verb);
@@ -30,7 +31,7 @@ describe('Connect', () => {
30
31
  test('should create a Connect Verb with multiple nested Endpoints', () => {
31
32
  const endpoint2 = new Endpoint('ep-789012');
32
33
  const connect = new Connect(attributes, [endpoint, endpoint2]);
33
- const expected = '<Connect eventCallbackUrl="https://example.com/events"><Endpoint>ep-123456</Endpoint><Endpoint>ep-789012</Endpoint></Connect>';
34
+ const expected = '<Connect eventCallbackUrl="https://example.com/events" eventFallbackUrl="https://example.com/fallback"><Endpoint>ep-123456</Endpoint><Endpoint>ep-789012</Endpoint></Connect>';
34
35
 
35
36
  expect(connect).toBeInstanceOf(Connect);
36
37
  expect(connect).toBeInstanceOf(Verb);
@@ -39,7 +40,7 @@ describe('Connect', () => {
39
40
 
40
41
  test('should test the addEndpoints method when no verbs are initially nested', () => {
41
42
  const connect = new Connect(attributes);
42
- const expected = '<Connect eventCallbackUrl="https://example.com/events"><Endpoint>ep-123456</Endpoint></Connect>';
43
+ const expected = '<Connect eventCallbackUrl="https://example.com/events" eventFallbackUrl="https://example.com/fallback"><Endpoint>ep-123456</Endpoint></Connect>';
43
44
 
44
45
  connect.addEndpoints(endpoint);
45
46
  expect(connect.toBxml()).toBe(expected);
@@ -8,10 +8,12 @@ describe('Forward', () => {
8
8
  callTimeout: 5,
9
9
  diversionTreatment: 'propagate',
10
10
  diversionReason: 'user-busy',
11
- uui: '93d6f3c0be5845960b744fa28015d8ede84bd1a4;encoding=base64,asdf;encoding=jwt'
11
+ uui: '93d6f3c0be5845960b744fa28015d8ede84bd1a4;encoding=base64,asdf;encoding=jwt',
12
+ privacy: true,
13
+ callerDisplayName: 'Anonymous'
12
14
  };
13
15
 
14
- const expected = '<Forward to="+19195551234" from="+19195554321" callTimeout="5" diversionTreatment="propagate" diversionReason="user-busy" uui="93d6f3c0be5845960b744fa28015d8ede84bd1a4;encoding=base64,asdf;encoding=jwt"/>';
16
+ const expected = '<Forward to="+19195551234" from="+19195554321" callTimeout="5" diversionTreatment="propagate" diversionReason="user-busy" uui="93d6f3c0be5845960b744fa28015d8ede84bd1a4;encoding=base64,asdf;encoding=jwt" privacy="true" callerDisplayName="Anonymous"/>';
15
17
 
16
18
  test('should create a Forward Verb', () => {
17
19
  const forward = new Forward(attributes);
@@ -18,7 +18,15 @@ describe('Gather', () => {
18
18
  maxDigits: 5,
19
19
  interDigitTimeout: 5,
20
20
  firstDigitTimeout: 5,
21
- repeatCount: 5
21
+ repeatCount: 5,
22
+ input: 'dtmf_speech',
23
+ hints: 'yes,no',
24
+ language: 'en-US',
25
+ partialResultCallback: 'https://initial.com',
26
+ partialResultCallbackMethod: 'POST',
27
+ profanityFilter: true,
28
+ speechModel: 'default',
29
+ speechTimeout: 5
22
30
  };
23
31
 
24
32
  const playAudio = new PlayAudio('https://audio.url/audio1.wav');
@@ -26,7 +34,7 @@ describe('Gather', () => {
26
34
 
27
35
  test('should create a Gather Verb', () => {
28
36
  const gather = new Gather(attributes);
29
- const expected = '<Gather gatherUrl="https://initial.com" gatherMethod="POST" gatherFallbackUrl="https://initial.com" gatherFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" terminatingDigits="5" maxDigits="5" interDigitTimeout="5" firstDigitTimeout="5" repeatCount="5"/>';
37
+ const expected = '<Gather gatherUrl="https://initial.com" gatherMethod="POST" gatherFallbackUrl="https://initial.com" gatherFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" terminatingDigits="5" maxDigits="5" interDigitTimeout="5" firstDigitTimeout="5" repeatCount="5" input="dtmf_speech" hints="yes,no" language="en-US" partialResultCallback="https://initial.com" partialResultCallbackMethod="POST" profanityFilter="true" speechModel="default" speechTimeout="5"/>';
30
38
 
31
39
  expect(gather).toBeInstanceOf(Gather);
32
40
  expect(gather).toBeInstanceOf(Verb);
@@ -35,9 +43,9 @@ describe('Gather', () => {
35
43
 
36
44
  test('should create a Gather Verb with nested PlayAudio and SpeakSentence', () => {
37
45
  let gather = new Gather(attributes, playAudio);
38
- const expected = '<Gather gatherUrl="https://initial.com" gatherMethod="POST" gatherFallbackUrl="https://initial.com" gatherFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" terminatingDigits="5" maxDigits="5" interDigitTimeout="5" firstDigitTimeout="5" repeatCount="5"><PlayAudio>https://audio.url/audio1.wav</PlayAudio></Gather>';
39
- const expectedSingle = '<Gather gatherUrl="https://initial.com" gatherMethod="POST" gatherFallbackUrl="https://initial.com" gatherFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" terminatingDigits="5" maxDigits="5" interDigitTimeout="5" firstDigitTimeout="5" repeatCount="5"><PlayAudio>https://audio.url/audio1.wav</PlayAudio><SpeakSentence><lang xml:lang="es-MX">Hola</lang>nodejs speak sentence <emphasis>SSML test</emphasis></SpeakSentence></Gather>';
40
- const expectedMultiple = '<Gather gatherUrl="https://initial.com" gatherMethod="POST" gatherFallbackUrl="https://initial.com" gatherFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" terminatingDigits="5" maxDigits="5" interDigitTimeout="5" firstDigitTimeout="5" repeatCount="5"><PlayAudio>https://audio.url/audio1.wav</PlayAudio><SpeakSentence><lang xml:lang="es-MX">Hola</lang>nodejs speak sentence <emphasis>SSML test</emphasis></SpeakSentence><SpeakSentence><lang xml:lang="es-MX">Hola</lang>nodejs speak sentence <emphasis>SSML test</emphasis></SpeakSentence><PlayAudio>https://audio.url/audio1.wav</PlayAudio></Gather>';
46
+ const expected = '<Gather gatherUrl="https://initial.com" gatherMethod="POST" gatherFallbackUrl="https://initial.com" gatherFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" terminatingDigits="5" maxDigits="5" interDigitTimeout="5" firstDigitTimeout="5" repeatCount="5" input="dtmf_speech" hints="yes,no" language="en-US" partialResultCallback="https://initial.com" partialResultCallbackMethod="POST" profanityFilter="true" speechModel="default" speechTimeout="5"><PlayAudio>https://audio.url/audio1.wav</PlayAudio></Gather>';
47
+ const expectedSingle = '<Gather gatherUrl="https://initial.com" gatherMethod="POST" gatherFallbackUrl="https://initial.com" gatherFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" terminatingDigits="5" maxDigits="5" interDigitTimeout="5" firstDigitTimeout="5" repeatCount="5" input="dtmf_speech" hints="yes,no" language="en-US" partialResultCallback="https://initial.com" partialResultCallbackMethod="POST" profanityFilter="true" speechModel="default" speechTimeout="5"><PlayAudio>https://audio.url/audio1.wav</PlayAudio><SpeakSentence><lang xml:lang="es-MX">Hola</lang>nodejs speak sentence <emphasis>SSML test</emphasis></SpeakSentence></Gather>';
48
+ const expectedMultiple = '<Gather gatherUrl="https://initial.com" gatherMethod="POST" gatherFallbackUrl="https://initial.com" gatherFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" terminatingDigits="5" maxDigits="5" interDigitTimeout="5" firstDigitTimeout="5" repeatCount="5" input="dtmf_speech" hints="yes,no" language="en-US" partialResultCallback="https://initial.com" partialResultCallbackMethod="POST" profanityFilter="true" speechModel="default" speechTimeout="5"><PlayAudio>https://audio.url/audio1.wav</PlayAudio><SpeakSentence><lang xml:lang="es-MX">Hola</lang>nodejs speak sentence <emphasis>SSML test</emphasis></SpeakSentence><SpeakSentence><lang xml:lang="es-MX">Hola</lang>nodejs speak sentence <emphasis>SSML test</emphasis></SpeakSentence><PlayAudio>https://audio.url/audio1.wav</PlayAudio></Gather>';
41
49
 
42
50
  expect(gather).toBeInstanceOf(Gather);
43
51
  expect(gather).toBeInstanceOf(Verb);
@@ -52,7 +60,7 @@ describe('Gather', () => {
52
60
 
53
61
  test('should test the addAudioVerbs method when no verbs are initially nested', () => {
54
62
  const gather = new Gather(attributes);
55
- const expected = '<Gather gatherUrl="https://initial.com" gatherMethod="POST" gatherFallbackUrl="https://initial.com" gatherFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" terminatingDigits="5" maxDigits="5" interDigitTimeout="5" firstDigitTimeout="5" repeatCount="5"><PlayAudio>https://audio.url/audio1.wav</PlayAudio></Gather>';
63
+ const expected = '<Gather gatherUrl="https://initial.com" gatherMethod="POST" gatherFallbackUrl="https://initial.com" gatherFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" terminatingDigits="5" maxDigits="5" interDigitTimeout="5" firstDigitTimeout="5" repeatCount="5" input="dtmf_speech" hints="yes,no" language="en-US" partialResultCallback="https://initial.com" partialResultCallbackMethod="POST" profanityFilter="true" speechModel="default" speechTimeout="5"><PlayAudio>https://audio.url/audio1.wav</PlayAudio></Gather>';
56
64
 
57
65
  gather.addAudioVerbs(playAudio);
58
66
  expect(gather.toBxml()).toBe(expected);
@@ -20,10 +20,12 @@ describe('Record', () => {
20
20
  terminatingDigits: '5',
21
21
  maxDuration: 5,
22
22
  silenceTimeout: 5,
23
- fileFormat: 'wav'
23
+ fileFormat: 'wav',
24
+ detectLanguage: true,
25
+ recordingName: 'initialRecordingName'
24
26
  };
25
27
 
26
- const expected = '<Record recordCompleteUrl="https://initial.com" recordCompleteMethod="POST" recordCompleteFallbackUrl="https://initial.com" recordCompleteFallbackMethod="POST" recordingAvailableUrl="https://initial.com" recordingAvailableMethod="POST" transcribe="true" transcriptionAvailableUrl="https://initial.com" transcriptionAvailableMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" terminatingDigits="5" maxDuration="5" silenceTimeout="5" fileFormat="wav"/>';
28
+ const expected = '<Record recordCompleteUrl="https://initial.com" recordCompleteMethod="POST" recordCompleteFallbackUrl="https://initial.com" recordCompleteFallbackMethod="POST" recordingAvailableUrl="https://initial.com" recordingAvailableMethod="POST" transcribe="true" transcriptionAvailableUrl="https://initial.com" transcriptionAvailableMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" terminatingDigits="5" maxDuration="5" silenceTimeout="5" fileFormat="wav" detectLanguage="true" recordingName="initialRecordingName"/>';
27
29
 
28
30
  test('should create a Record Verb', () => {
29
31
  const record = new Record(attributes);
@@ -0,0 +1,40 @@
1
+ import { Verb } from '../../../../../models/bxml/Verb';
2
+ import { SipUri } from '../../../../../models/bxml/verbs/SipUri';
3
+ import { Refer, ReferAttributes } from '../../../../../models/bxml/verbs/Refer';
4
+
5
+ describe('Refer', () => {
6
+ const attributes: ReferAttributes = {
7
+ referCompleteUrl: 'https://initial.com',
8
+ referCompleteMethod: 'POST',
9
+ tag: 'initialTag'
10
+ };
11
+
12
+ const sipUri = new SipUri('sip:alice@atlanta.example.com');
13
+ const newSipUri = new SipUri('sip:bob@biloxi.example.com');
14
+
15
+ test('should create a Refer Verb', () => {
16
+ const refer = new Refer(attributes);
17
+ const expected = '<Refer referCompleteUrl="https://initial.com" referCompleteMethod="POST" tag="initialTag"/>';
18
+
19
+ expect(refer).toBeInstanceOf(Refer);
20
+ expect(refer).toBeInstanceOf(Verb);
21
+ expect(refer.toBxml()).toBe(expected);
22
+ });
23
+
24
+ test('should create a Refer Verb with a nested SipUri', () => {
25
+ const refer = new Refer(attributes, sipUri);
26
+ const expected = '<Refer referCompleteUrl="https://initial.com" referCompleteMethod="POST" tag="initialTag"><SipUri>sip:alice@atlanta.example.com</SipUri></Refer>';
27
+
28
+ expect(refer).toBeInstanceOf(Refer);
29
+ expect(refer).toBeInstanceOf(Verb);
30
+ expect(refer.toBxml()).toBe(expected);
31
+ });
32
+
33
+ test('should test the setSipUri method', () => {
34
+ const refer = new Refer(attributes, sipUri);
35
+ const expected = '<Refer referCompleteUrl="https://initial.com" referCompleteMethod="POST" tag="initialTag"><SipUri>sip:bob@biloxi.example.com</SipUri></Refer>';
36
+
37
+ refer.setSipUri(newSipUri);
38
+ expect(refer.toBxml()).toBe(expected);
39
+ });
40
+ });
@@ -12,10 +12,12 @@ describe('StartRecording', () => {
12
12
  password: 'initialPassword',
13
13
  tag: 'initialTag',
14
14
  fileFormat: 'wav',
15
- multiChannel: true
15
+ multiChannel: true,
16
+ detectLanguage: true,
17
+ recordingName: 'initialRecordingName'
16
18
  };
17
19
 
18
- const expected = '<StartRecording recordingAvailableUrl="https://initial.com" recordingAvailableMethod="POST" transcribe="true" transcriptionAvailableUrl="https://initial.com" transcriptionAvailableMethod="POST" username="initialUsername" password="initialPassword" tag="initialTag" fileFormat="wav" multiChannel="true"/>';
20
+ const expected = '<StartRecording recordingAvailableUrl="https://initial.com" recordingAvailableMethod="POST" transcribe="true" transcriptionAvailableUrl="https://initial.com" transcriptionAvailableMethod="POST" username="initialUsername" password="initialPassword" tag="initialTag" fileFormat="wav" multiChannel="true" detectLanguage="true" recordingName="initialRecordingName"/>';
19
21
 
20
22
  test('should create a StartRecording Verb', () => {
21
23
  const startRecording = new StartRecording(attributes);
@@ -11,7 +11,9 @@ describe('StartTranscription', () => {
11
11
  username: 'initialUsername',
12
12
  password: 'initialPassword',
13
13
  destination: 'https://initial.com',
14
- stabilized: true
14
+ stabilized: true,
15
+ detectLanguage: true,
16
+ preferredLanguages: 'en-US,es-US'
15
17
  };
16
18
 
17
19
  const customParam1 = new CustomParam({ name: 'customParamName1', value: 'customParamValue1' });
@@ -19,7 +21,7 @@ describe('StartTranscription', () => {
19
21
 
20
22
  test('should create a StartTranscription Verb', () => {
21
23
  const startTranscription = new StartTranscription(attributes);
22
- const expected = '<StartTranscription name="initialName" tracks="inbound" transcriptionEventUrl="https://initial.com" transcriptionEventMethod="POST" username="initialUsername" password="initialPassword" destination="https://initial.com" stabilized="true"/>';
24
+ const expected = '<StartTranscription name="initialName" tracks="inbound" transcriptionEventUrl="https://initial.com" transcriptionEventMethod="POST" username="initialUsername" password="initialPassword" destination="https://initial.com" stabilized="true" detectLanguage="true" preferredLanguages="en-US,es-US"/>';
23
25
 
24
26
  expect(startTranscription).toBeInstanceOf(StartTranscription);
25
27
  expect(startTranscription).toBeInstanceOf(Verb);
@@ -28,9 +30,9 @@ describe('StartTranscription', () => {
28
30
 
29
31
  test('should create a StartTranscription Verb with nested CustomParam', () => {
30
32
  let startTranscription = new StartTranscription(attributes, customParam1);
31
- const expected = '<StartTranscription name="initialName" tracks="inbound" transcriptionEventUrl="https://initial.com" transcriptionEventMethod="POST" username="initialUsername" password="initialPassword" destination="https://initial.com" stabilized="true"><CustomParam name="customParamName1" value="customParamValue1"/></StartTranscription>';
32
- const expectedSingle = '<StartTranscription name="initialName" tracks="inbound" transcriptionEventUrl="https://initial.com" transcriptionEventMethod="POST" username="initialUsername" password="initialPassword" destination="https://initial.com" stabilized="true"><CustomParam name="customParamName1" value="customParamValue1"/><CustomParam name="customParamName2" value="customParamValue2"/></StartTranscription>';
33
- const expectedMultiple = '<StartTranscription name="initialName" tracks="inbound" transcriptionEventUrl="https://initial.com" transcriptionEventMethod="POST" username="initialUsername" password="initialPassword" destination="https://initial.com" stabilized="true"><CustomParam name="customParamName1" value="customParamValue1"/><CustomParam name="customParamName2" value="customParamValue2"/><CustomParam name="customParamName1" value="customParamValue1"/><CustomParam name="customParamName2" value="customParamValue2"/></StartTranscription>';
33
+ const expected = '<StartTranscription name="initialName" tracks="inbound" transcriptionEventUrl="https://initial.com" transcriptionEventMethod="POST" username="initialUsername" password="initialPassword" destination="https://initial.com" stabilized="true" detectLanguage="true" preferredLanguages="en-US,es-US"><CustomParam name="customParamName1" value="customParamValue1"/></StartTranscription>';
34
+ const expectedSingle = '<StartTranscription name="initialName" tracks="inbound" transcriptionEventUrl="https://initial.com" transcriptionEventMethod="POST" username="initialUsername" password="initialPassword" destination="https://initial.com" stabilized="true" detectLanguage="true" preferredLanguages="en-US,es-US"><CustomParam name="customParamName1" value="customParamValue1"/><CustomParam name="customParamName2" value="customParamValue2"/></StartTranscription>';
35
+ const expectedMultiple = '<StartTranscription name="initialName" tracks="inbound" transcriptionEventUrl="https://initial.com" transcriptionEventMethod="POST" username="initialUsername" password="initialPassword" destination="https://initial.com" stabilized="true" detectLanguage="true" preferredLanguages="en-US,es-US"><CustomParam name="customParamName1" value="customParamValue1"/><CustomParam name="customParamName2" value="customParamValue2"/><CustomParam name="customParamName1" value="customParamValue1"/><CustomParam name="customParamName2" value="customParamValue2"/></StartTranscription>';
34
36
 
35
37
  expect(startTranscription).toBeInstanceOf(StartTranscription);
36
38
  expect(startTranscription).toBeInstanceOf(Verb);
@@ -45,7 +47,7 @@ describe('StartTranscription', () => {
45
47
 
46
48
  test('should test the addCustomParams method method when no verbs are initially nested', () => {
47
49
  const startTranscription = new StartTranscription(attributes);
48
- const expected = '<StartTranscription name="initialName" tracks="inbound" transcriptionEventUrl="https://initial.com" transcriptionEventMethod="POST" username="initialUsername" password="initialPassword" destination="https://initial.com" stabilized="true"><CustomParam name="customParamName1" value="customParamValue1"/></StartTranscription>';
50
+ const expected = '<StartTranscription name="initialName" tracks="inbound" transcriptionEventUrl="https://initial.com" transcriptionEventMethod="POST" username="initialUsername" password="initialPassword" destination="https://initial.com" stabilized="true" detectLanguage="true" preferredLanguages="en-US,es-US"><CustomParam name="customParamName1" value="customParamValue1"/></StartTranscription>';
49
51
 
50
52
  startTranscription.addCustomParams(customParam1);
51
53
  expect(startTranscription.toBxml()).toBe(expected);
@@ -18,7 +18,8 @@ describe('Transfer', () => {
18
18
  fallbackPassword: 'initialFallbackPassword',
19
19
  tag: 'initialTag',
20
20
  diversionTreatment: 'propagate',
21
- diversionReason: 'user-busy'
21
+ diversionReason: 'user-busy',
22
+ privacy: true
22
23
  };
23
24
 
24
25
  const phoneNumber = new PhoneNumber('+19195551234');
@@ -26,7 +27,7 @@ describe('Transfer', () => {
26
27
 
27
28
  test('should create a Transfer Verb', () => {
28
29
  const transfer = new Transfer(attributes);
29
- const expected = '<Transfer transferCallerId="+19195551234" transferCallerDisplayName="initialDisplayName" callTimeout="5" transferCompleteUrl="https://initial.com" transferCompleteMethod="POST" transferCompleteFallbackUrl="https://initial.com" transferCompleteFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" diversionTreatment="propagate" diversionReason="user-busy"/>';
30
+ const expected = '<Transfer transferCallerId="+19195551234" transferCallerDisplayName="initialDisplayName" callTimeout="5" transferCompleteUrl="https://initial.com" transferCompleteMethod="POST" transferCompleteFallbackUrl="https://initial.com" transferCompleteFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" diversionTreatment="propagate" diversionReason="user-busy" privacy="true"/>';
30
31
 
31
32
  expect(transfer).toBeInstanceOf(Transfer);
32
33
  expect(transfer).toBeInstanceOf(Verb);
@@ -35,9 +36,9 @@ describe('Transfer', () => {
35
36
 
36
37
  test('should create a Transfer Verb with nested PhoneNumber and SipUri', () => {
37
38
  let transfer = new Transfer(attributes, phoneNumber);
38
- const expected = '<Transfer transferCallerId="+19195551234" transferCallerDisplayName="initialDisplayName" callTimeout="5" transferCompleteUrl="https://initial.com" transferCompleteMethod="POST" transferCompleteFallbackUrl="https://initial.com" transferCompleteFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" diversionTreatment="propagate" diversionReason="user-busy"><PhoneNumber>+19195551234</PhoneNumber></Transfer>';
39
- const expectedSingle = '<Transfer transferCallerId="+19195551234" transferCallerDisplayName="initialDisplayName" callTimeout="5" transferCompleteUrl="https://initial.com" transferCompleteMethod="POST" transferCompleteFallbackUrl="https://initial.com" transferCompleteFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" diversionTreatment="propagate" diversionReason="user-busy"><PhoneNumber>+19195551234</PhoneNumber><SipUri>sip:1-999-123-4567@voip-provider.example.net</SipUri></Transfer>';
40
- const expectedMultiple = '<Transfer transferCallerId="+19195551234" transferCallerDisplayName="initialDisplayName" callTimeout="5" transferCompleteUrl="https://initial.com" transferCompleteMethod="POST" transferCompleteFallbackUrl="https://initial.com" transferCompleteFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" diversionTreatment="propagate" diversionReason="user-busy"><PhoneNumber>+19195551234</PhoneNumber><SipUri>sip:1-999-123-4567@voip-provider.example.net</SipUri><SipUri>sip:1-999-123-4567@voip-provider.example.net</SipUri><PhoneNumber>+19195551234</PhoneNumber></Transfer>';
39
+ const expected = '<Transfer transferCallerId="+19195551234" transferCallerDisplayName="initialDisplayName" callTimeout="5" transferCompleteUrl="https://initial.com" transferCompleteMethod="POST" transferCompleteFallbackUrl="https://initial.com" transferCompleteFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" diversionTreatment="propagate" diversionReason="user-busy" privacy="true"><PhoneNumber>+19195551234</PhoneNumber></Transfer>';
40
+ const expectedSingle = '<Transfer transferCallerId="+19195551234" transferCallerDisplayName="initialDisplayName" callTimeout="5" transferCompleteUrl="https://initial.com" transferCompleteMethod="POST" transferCompleteFallbackUrl="https://initial.com" transferCompleteFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" diversionTreatment="propagate" diversionReason="user-busy" privacy="true"><PhoneNumber>+19195551234</PhoneNumber><SipUri>sip:1-999-123-4567@voip-provider.example.net</SipUri></Transfer>';
41
+ const expectedMultiple = '<Transfer transferCallerId="+19195551234" transferCallerDisplayName="initialDisplayName" callTimeout="5" transferCompleteUrl="https://initial.com" transferCompleteMethod="POST" transferCompleteFallbackUrl="https://initial.com" transferCompleteFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" diversionTreatment="propagate" diversionReason="user-busy" privacy="true"><PhoneNumber>+19195551234</PhoneNumber><SipUri>sip:1-999-123-4567@voip-provider.example.net</SipUri><SipUri>sip:1-999-123-4567@voip-provider.example.net</SipUri><PhoneNumber>+19195551234</PhoneNumber></Transfer>';
41
42
 
42
43
  expect(transfer).toBeInstanceOf(Transfer);
43
44
  expect(transfer).toBeInstanceOf(Verb);
@@ -52,7 +53,7 @@ describe('Transfer', () => {
52
53
 
53
54
  test('should test the addTransferRecipients method method when no verbs are initially nested', () => {
54
55
  const transfer = new Transfer(attributes);
55
- const expected = '<Transfer transferCallerId="+19195551234" transferCallerDisplayName="initialDisplayName" callTimeout="5" transferCompleteUrl="https://initial.com" transferCompleteMethod="POST" transferCompleteFallbackUrl="https://initial.com" transferCompleteFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" diversionTreatment="propagate" diversionReason="user-busy"><PhoneNumber>+19195551234</PhoneNumber></Transfer>';
56
+ const expected = '<Transfer transferCallerId="+19195551234" transferCallerDisplayName="initialDisplayName" callTimeout="5" transferCompleteUrl="https://initial.com" transferCompleteMethod="POST" transferCompleteFallbackUrl="https://initial.com" transferCompleteFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" diversionTreatment="propagate" diversionReason="user-busy" privacy="true"><PhoneNumber>+19195551234</PhoneNumber></Transfer>';
56
57
 
57
58
  transfer.addTransferRecipients(phoneNumber);
58
59
  expect(transfer.toBxml()).toBe(expected);
@@ -0,0 +1,12 @@
1
+ import { ReferCallStatusEnum } from '../../../models/refer-call-status-enum';
2
+
3
+ describe('ReferCallStatusEnum', () => {
4
+ test('should define the expected values', () => {
5
+ expect(ReferCallStatusEnum.Success).toBe('success');
6
+ expect(ReferCallStatusEnum.Failure).toBe('failure');
7
+ expect(Object.values(ReferCallStatusEnum)).toEqual([
8
+ 'success',
9
+ 'failure'
10
+ ]);
11
+ });
12
+ });
@@ -0,0 +1,41 @@
1
+ import { ReferCompleteCallback } from '../../../models/refer-complete-callback';
2
+ import { CallDirectionEnum } from '../../../models/call-direction-enum';
3
+ import { ReferCallStatusEnum } from '../../../models/refer-call-status-enum';
4
+
5
+ describe('ReferCompleteCallback', () => {
6
+ test('should accept the expected shape', () => {
7
+ const fixture: ReferCompleteCallback = {
8
+ eventType: 'test-eventType',
9
+ eventTime: 'test-eventTime',
10
+ accountId: 'test-accountId',
11
+ applicationId: 'test-applicationId',
12
+ from: 'test-from',
13
+ to: 'test-to',
14
+ direction: CallDirectionEnum.Inbound,
15
+ callId: 'test-callId',
16
+ callUrl: 'test-callUrl',
17
+ startTime: 'test-startTime',
18
+ answerTime: 'test-answerTime',
19
+ tag: 'test-tag',
20
+ referCallStatus: ReferCallStatusEnum.Success,
21
+ referSipResponseCode: 1,
22
+ notifySipResponseCode: 1,
23
+ };
24
+
25
+ expect(fixture.eventType).toBe('test-eventType');
26
+ expect(fixture.eventTime).toBe('test-eventTime');
27
+ expect(fixture.accountId).toBe('test-accountId');
28
+ expect(fixture.applicationId).toBe('test-applicationId');
29
+ expect(fixture.from).toBe('test-from');
30
+ expect(fixture.to).toBe('test-to');
31
+ expect(fixture.direction).toBe(CallDirectionEnum.Inbound);
32
+ expect(fixture.callId).toBe('test-callId');
33
+ expect(fixture.callUrl).toBe('test-callUrl');
34
+ expect(fixture.startTime).toBe('test-startTime');
35
+ expect(fixture.answerTime).toBe('test-answerTime');
36
+ expect(fixture.tag).toBe('test-tag');
37
+ expect(fixture.referCallStatus).toBe(ReferCallStatusEnum.Success);
38
+ expect(fixture.referSipResponseCode).toBe(1);
39
+ expect(fixture.notifySipResponseCode).toBe(1);
40
+ });
41
+ });