bandwidth-sdk 2.0.0 → 2.1.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 (306) hide show
  1. package/.github/workflows/deploy.yml +3 -3
  2. package/.github/workflows/test-nightly.yml +49 -54
  3. package/.github/workflows/test-pr.yml +40 -40
  4. package/.openapi-generator/VERSION +1 -1
  5. package/api/calls-api.ts +37 -37
  6. package/api/conferences-api.ts +62 -62
  7. package/api/media-api.ts +28 -28
  8. package/api/messages-api.ts +22 -22
  9. package/api/mfaapi.ts +28 -28
  10. package/api/phone-number-lookup-api.ts +18 -18
  11. package/api/recordings-api.ts +67 -67
  12. package/api/statistics-api.ts +10 -10
  13. package/api/transcriptions-api.ts +23 -23
  14. package/bandwidth.yml +20 -11
  15. package/base.ts +2 -2
  16. package/coverage/clover.xml +190 -1582
  17. package/coverage/coverage-final.json +47 -64
  18. package/coverage/lcov-report/index.html +24 -69
  19. package/coverage/lcov-report/{node-sdk/models → models}/bxml/Bxml.ts.html +14 -14
  20. package/coverage/lcov-report/{node-sdk/models → models}/bxml/NestableVerb.ts.html +30 -30
  21. package/coverage/lcov-report/{node-sdk/models → models}/bxml/Response.ts.html +14 -14
  22. package/coverage/lcov-report/{node-sdk/models → models}/bxml/Root.ts.html +23 -23
  23. package/coverage/lcov-report/{node-sdk/models → models}/bxml/Verb.ts.html +20 -20
  24. package/coverage/lcov-report/{node-sdk/models → models}/bxml/index.html +24 -39
  25. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/Bridge.ts.html +15 -15
  26. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/Conference.ts.html +15 -15
  27. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/CustomParam.ts.html +15 -15
  28. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/Forward.ts.html +15 -15
  29. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/Gather.ts.html +19 -19
  30. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/Hangup.ts.html +14 -14
  31. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/Pause.ts.html +15 -15
  32. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/PauseRecording.ts.html +14 -14
  33. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/PhoneNumber.ts.html +15 -15
  34. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/PlayAudio.ts.html +15 -15
  35. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/Record.ts.html +15 -15
  36. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/Redirect.ts.html +15 -15
  37. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/ResumeRecording.ts.html +14 -14
  38. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/Ring.ts.html +15 -15
  39. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/SendDtmf.ts.html +15 -15
  40. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/SipUri.ts.html +15 -15
  41. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/SpeakSentence.ts.html +17 -17
  42. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/StartGather.ts.html +15 -15
  43. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/StartRecording.ts.html +15 -15
  44. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/StartStream.ts.html +16 -16
  45. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/StartTranscription.ts.html +16 -16
  46. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/StopGather.ts.html +14 -14
  47. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/StopRecording.ts.html +14 -14
  48. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/StopStream.ts.html +15 -15
  49. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/StopTranscription.ts.html +15 -15
  50. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/StreamParam.ts.html +15 -15
  51. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/Tag.ts.html +14 -14
  52. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/Transfer.ts.html +16 -16
  53. package/coverage/lcov-report/{node-sdk/models → models}/bxml/verbs/index.html +12 -27
  54. package/coverage/lcov-report/{node-sdk/models → models}/call-direction-enum.ts.html +11 -11
  55. package/coverage/lcov-report/{node-sdk/models → models}/call-state-enum.ts.html +11 -11
  56. package/coverage/lcov-report/{node-sdk/models → models}/callback-method-enum.ts.html +11 -11
  57. package/coverage/lcov-report/{node-sdk/models → models}/conference-state-enum.ts.html +11 -11
  58. package/coverage/lcov-report/{node-sdk/models → models}/file-format-enum.ts.html +11 -11
  59. package/coverage/lcov-report/{node-sdk/models → models}/index.html +12 -42
  60. package/coverage/lcov-report/{node-sdk/models → models}/list-message-direction-enum.ts.html +11 -11
  61. package/coverage/lcov-report/{node-sdk/models → models}/lookup-status-enum.ts.html +11 -11
  62. package/coverage/lcov-report/{node-sdk/models → models}/machine-detection-mode-enum.ts.html +11 -11
  63. package/coverage/lcov-report/{node-sdk/models → models}/message-direction-enum.ts.html +11 -11
  64. package/coverage/lcov-report/{node-sdk/models → models}/message-status-enum.ts.html +11 -11
  65. package/coverage/lcov-report/{node-sdk/models → models}/message-type-enum.ts.html +11 -11
  66. package/coverage/lcov-report/{node-sdk/models → models}/priority-enum.ts.html +11 -11
  67. package/coverage/lcov-report/{node-sdk/models → models}/recording-state-enum.ts.html +11 -11
  68. package/coverage/lcov-report/{node-sdk/models → models}/redirect-method-enum.ts.html +11 -11
  69. package/coverage/lcov.info +323 -3571
  70. package/custom_templates/package.mustache +5 -2
  71. package/dist/api/calls-api.d.ts +21 -21
  72. package/dist/api/calls-api.js +69 -40
  73. package/dist/api/conferences-api.d.ts +34 -34
  74. package/dist/api/conferences-api.js +117 -72
  75. package/dist/api/media-api.d.ts +15 -15
  76. package/dist/api/media-api.js +57 -32
  77. package/dist/api/messages-api.d.ts +14 -14
  78. package/dist/api/messages-api.js +33 -16
  79. package/dist/api/mfaapi.d.ts +16 -16
  80. package/dist/api/mfaapi.js +45 -24
  81. package/dist/api/phone-number-lookup-api.d.ts +11 -11
  82. package/dist/api/phone-number-lookup-api.js +33 -16
  83. package/dist/api/recordings-api.d.ts +36 -36
  84. package/dist/api/recordings-api.js +129 -80
  85. package/dist/api/statistics-api.d.ts +6 -6
  86. package/dist/api/statistics-api.js +21 -8
  87. package/dist/api/transcriptions-api.d.ts +13 -13
  88. package/dist/api/transcriptions-api.js +45 -24
  89. package/dist/base.d.ts +2 -2
  90. package/dist/models/answer-callback.d.ts +3 -3
  91. package/dist/models/bridge-complete-callback.d.ts +2 -2
  92. package/dist/models/bridge-target-complete-callback.d.ts +2 -2
  93. package/dist/models/bxml/verbs/Bridge.d.ts +1 -2
  94. package/dist/models/bxml/verbs/Conference.d.ts +1 -2
  95. package/dist/models/bxml/verbs/CustomParam.d.ts +1 -2
  96. package/dist/models/bxml/verbs/Forward.d.ts +1 -2
  97. package/dist/models/bxml/verbs/Gather.d.ts +2 -2
  98. package/dist/models/bxml/verbs/Pause.d.ts +1 -2
  99. package/dist/models/bxml/verbs/PhoneNumber.d.ts +1 -2
  100. package/dist/models/bxml/verbs/PlayAudio.d.ts +1 -2
  101. package/dist/models/bxml/verbs/Record.d.ts +1 -2
  102. package/dist/models/bxml/verbs/Redirect.d.ts +1 -2
  103. package/dist/models/bxml/verbs/Ring.d.ts +1 -2
  104. package/dist/models/bxml/verbs/SendDtmf.d.ts +1 -2
  105. package/dist/models/bxml/verbs/SipUri.d.ts +1 -2
  106. package/dist/models/bxml/verbs/SpeakSentence.d.ts +1 -2
  107. package/dist/models/bxml/verbs/StartGather.d.ts +1 -2
  108. package/dist/models/bxml/verbs/StartRecording.d.ts +1 -2
  109. package/dist/models/bxml/verbs/StartStream.d.ts +1 -2
  110. package/dist/models/bxml/verbs/StartTranscription.d.ts +1 -2
  111. package/dist/models/bxml/verbs/StopStream.d.ts +1 -2
  112. package/dist/models/bxml/verbs/StopTranscription.d.ts +1 -2
  113. package/dist/models/bxml/verbs/StreamParam.d.ts +1 -2
  114. package/dist/models/bxml/verbs/Transfer.d.ts +1 -1
  115. package/dist/models/call-recording-metadata.d.ts +5 -5
  116. package/dist/models/call-state.d.ts +1 -1
  117. package/dist/models/call-transcription-response.d.ts +1 -1
  118. package/dist/models/conference-member-exit-callback.d.ts +1 -1
  119. package/dist/models/conference-member-join-callback.d.ts +1 -1
  120. package/dist/models/conference-recording-available-callback.d.ts +1 -1
  121. package/dist/models/conference-recording-metadata.d.ts +1 -1
  122. package/dist/models/conference.d.ts +2 -2
  123. package/dist/models/create-call-response.d.ts +1 -1
  124. package/dist/models/create-call.d.ts +10 -4
  125. package/dist/models/create-lookup-response.d.ts +1 -1
  126. package/dist/models/create-message-request-error.d.ts +1 -1
  127. package/dist/models/disconnect-callback.d.ts +2 -2
  128. package/dist/models/dtmf-callback.d.ts +3 -3
  129. package/dist/models/gather-callback.d.ts +3 -3
  130. package/dist/models/inbound-message-callback-message.d.ts +2 -2
  131. package/dist/models/inbound-message-callback.d.ts +1 -1
  132. package/dist/models/initiate-callback.d.ts +4 -4
  133. package/dist/models/list-message-item.d.ts +3 -3
  134. package/dist/models/lookup-status.d.ts +2 -2
  135. package/dist/models/machine-detection-complete-callback.d.ts +3 -3
  136. package/dist/models/machine-detection-configuration.d.ts +3 -3
  137. package/dist/models/message-delivered-callback-message.d.ts +2 -2
  138. package/dist/models/message-delivered-callback.d.ts +1 -1
  139. package/dist/models/message-failed-callback-message.d.ts +2 -2
  140. package/dist/models/message-failed-callback.d.ts +1 -1
  141. package/dist/models/message-request.d.ts +1 -1
  142. package/dist/models/message-sending-callback-message.d.ts +2 -2
  143. package/dist/models/message-sending-callback.d.ts +1 -1
  144. package/dist/models/message.d.ts +2 -2
  145. package/dist/models/messages-list.d.ts +2 -2
  146. package/dist/models/recording-available-callback.d.ts +4 -4
  147. package/dist/models/recording-complete-callback.d.ts +4 -4
  148. package/dist/models/recording-transcriptions.d.ts +1 -1
  149. package/dist/models/redirect-callback.d.ts +3 -3
  150. package/dist/models/transcribe-recording.d.ts +1 -1
  151. package/dist/models/transcription-available-callback.d.ts +5 -5
  152. package/dist/models/transfer-answer-callback.d.ts +3 -3
  153. package/dist/models/transfer-complete-callback.d.ts +3 -3
  154. package/dist/models/transfer-disconnect-callback.d.ts +3 -3
  155. package/dist/models/update-call-recording.d.ts +1 -1
  156. package/dist/models/update-call.d.ts +2 -2
  157. package/dist/models/update-conference.d.ts +2 -2
  158. package/models/answer-callback.ts +3 -3
  159. package/models/bridge-complete-callback.ts +2 -2
  160. package/models/bridge-target-complete-callback.ts +2 -2
  161. package/models/bxml/verbs/Bridge.ts +1 -1
  162. package/models/bxml/verbs/Conference.ts +1 -1
  163. package/models/bxml/verbs/CustomParam.ts +1 -1
  164. package/models/bxml/verbs/Forward.ts +1 -1
  165. package/models/bxml/verbs/Gather.ts +2 -2
  166. package/models/bxml/verbs/Pause.ts +1 -1
  167. package/models/bxml/verbs/PhoneNumber.ts +1 -1
  168. package/models/bxml/verbs/PlayAudio.ts +1 -1
  169. package/models/bxml/verbs/Record.ts +1 -1
  170. package/models/bxml/verbs/Redirect.ts +1 -1
  171. package/models/bxml/verbs/Ring.ts +1 -1
  172. package/models/bxml/verbs/SendDtmf.ts +1 -1
  173. package/models/bxml/verbs/SipUri.ts +1 -1
  174. package/models/bxml/verbs/SpeakSentence.ts +1 -1
  175. package/models/bxml/verbs/StartGather.ts +1 -1
  176. package/models/bxml/verbs/StartRecording.ts +1 -1
  177. package/models/bxml/verbs/StartStream.ts +1 -1
  178. package/models/bxml/verbs/StartTranscription.ts +1 -1
  179. package/models/bxml/verbs/StopStream.ts +1 -1
  180. package/models/bxml/verbs/StopTranscription.ts +1 -1
  181. package/models/bxml/verbs/StreamParam.ts +1 -1
  182. package/models/bxml/verbs/Transfer.ts +1 -1
  183. package/models/call-recording-metadata.ts +5 -5
  184. package/models/call-state.ts +1 -1
  185. package/models/call-transcription-response.ts +1 -1
  186. package/models/conference-member-exit-callback.ts +1 -1
  187. package/models/conference-member-join-callback.ts +1 -1
  188. package/models/conference-recording-available-callback.ts +1 -1
  189. package/models/conference-recording-metadata.ts +1 -1
  190. package/models/conference.ts +2 -2
  191. package/models/create-call-response.ts +1 -1
  192. package/models/create-call.ts +10 -4
  193. package/models/create-lookup-response.ts +1 -1
  194. package/models/create-message-request-error.ts +1 -1
  195. package/models/disconnect-callback.ts +2 -2
  196. package/models/dtmf-callback.ts +3 -3
  197. package/models/gather-callback.ts +3 -3
  198. package/models/inbound-message-callback-message.ts +2 -2
  199. package/models/inbound-message-callback.ts +1 -1
  200. package/models/initiate-callback.ts +4 -4
  201. package/models/list-message-item.ts +3 -3
  202. package/models/lookup-status.ts +2 -2
  203. package/models/machine-detection-complete-callback.ts +3 -3
  204. package/models/machine-detection-configuration.ts +3 -3
  205. package/models/message-delivered-callback-message.ts +2 -2
  206. package/models/message-delivered-callback.ts +1 -1
  207. package/models/message-failed-callback-message.ts +2 -2
  208. package/models/message-failed-callback.ts +1 -1
  209. package/models/message-request.ts +1 -1
  210. package/models/message-sending-callback-message.ts +2 -2
  211. package/models/message-sending-callback.ts +1 -1
  212. package/models/message.ts +2 -2
  213. package/models/messages-list.ts +2 -2
  214. package/models/recording-available-callback.ts +4 -4
  215. package/models/recording-complete-callback.ts +4 -4
  216. package/models/recording-transcriptions.ts +1 -1
  217. package/models/redirect-callback.ts +3 -3
  218. package/models/transcribe-recording.ts +1 -1
  219. package/models/transcription-available-callback.ts +5 -5
  220. package/models/transfer-answer-callback.ts +3 -3
  221. package/models/transfer-complete-callback.ts +3 -3
  222. package/models/transfer-disconnect-callback.ts +3 -3
  223. package/models/update-call-recording.ts +1 -1
  224. package/models/update-call.ts +2 -2
  225. package/models/update-conference.ts +2 -2
  226. package/openapitools.json +1 -1
  227. package/package.json +6 -3
  228. package/tests/callUtils.ts +84 -0
  229. package/tests/{integration/bxml.test.js → smoke/bxml.test.ts} +59 -40
  230. package/tests/{integration/calls-api.test.js → smoke/calls-api.test.ts} +56 -48
  231. package/tests/{integration/conferences-api.test.js → smoke/conferences-api.test.ts} +28 -29
  232. package/tests/{integration/media-api.test.js → smoke/media-api.test.ts} +18 -17
  233. package/tests/smoke/messages-api.test.ts +115 -0
  234. package/tests/{integration/mfaapi.test.js → smoke/mfaapi.test.ts} +27 -25
  235. package/tests/{integration/phone-number-lookup-api.test.js → smoke/phone-number-lookup-api.test.ts} +9 -7
  236. package/tests/{integration/recordings-api.test.js → smoke/recordings-api.test.ts} +37 -37
  237. package/tests/{integration/statistics-api.test.js → smoke/statistics-api.test.ts} +9 -8
  238. package/tests/{integration/transcriptions-api.test.js → smoke/transcriptions-api.test.ts} +25 -25
  239. package/tests/unit/{bxml/Bxml.test.js → models/bxml/Bxml.test.ts} +3 -3
  240. package/tests/unit/{bxml/NestableVerb.test.js → models/bxml/NestableVerb.test.ts} +2 -2
  241. package/tests/unit/{bxml/Response.test.js → models/bxml/Response.test.ts} +3 -3
  242. package/tests/unit/{bxml/Verb.test.js → models/bxml/Verb.test.ts} +1 -1
  243. package/tests/unit/{bxml/verbs/Bridge.test.js → models/bxml/verbs/Bridge.test.ts} +3 -3
  244. package/tests/unit/{bxml/verbs/Conference.test.js → models/bxml/verbs/Conference.test.ts} +3 -3
  245. package/tests/unit/{bxml/verbs/CustomParam.test.js → models/bxml/verbs/CustomParam.test.ts} +3 -3
  246. package/tests/unit/{bxml/verbs/Forward.test.js → models/bxml/verbs/Forward.test.ts} +3 -3
  247. package/tests/unit/{bxml/verbs/Gather.test.js → models/bxml/verbs/Gather.test.ts} +5 -5
  248. package/tests/unit/{bxml/verbs/Hangup.test.js → models/bxml/verbs/Hangup.test.ts} +2 -2
  249. package/tests/unit/{bxml/verbs/Pause.test.js → models/bxml/verbs/Pause.test.ts} +3 -3
  250. package/tests/unit/{bxml/verbs/PauseRecording.test.js → models/bxml/verbs/PauseRecording.test.ts} +2 -2
  251. package/tests/unit/{bxml/verbs/PhoneNumber.test.js → models/bxml/verbs/PhoneNumber.test.ts} +3 -3
  252. package/tests/unit/{bxml/verbs/PlayAudio.test.js → models/bxml/verbs/PlayAudio.test.ts} +3 -3
  253. package/tests/unit/{bxml/verbs/Record.test.js → models/bxml/verbs/Record.test.ts} +3 -3
  254. package/tests/unit/{bxml/verbs/Redirect.test.js → models/bxml/verbs/Redirect.test.ts} +3 -3
  255. package/tests/unit/{bxml/verbs/ResumeRecording.test.js → models/bxml/verbs/ResumeRecording.test.ts} +2 -2
  256. package/tests/unit/{bxml/verbs/Ring.test.js → models/bxml/verbs/Ring.test.ts} +3 -3
  257. package/tests/unit/{bxml/verbs/SendDtmf.test.js → models/bxml/verbs/SendDtmf.test.ts} +3 -3
  258. package/tests/unit/{bxml/verbs/SipUri.test.js → models/bxml/verbs/SipUri.test.ts} +3 -3
  259. package/tests/unit/{bxml/verbs/SpeakSentence.test.js → models/bxml/verbs/SpeakSentence.test.ts} +3 -3
  260. package/tests/unit/{bxml/verbs/StartGather.test.js → models/bxml/verbs/StartGather.test.ts} +3 -3
  261. package/tests/unit/{bxml/verbs/StartRecording.test.js → models/bxml/verbs/StartRecording.test.ts} +3 -3
  262. package/tests/unit/{bxml/verbs/StartStream.test.js → models/bxml/verbs/StartStream.test.ts} +4 -4
  263. package/tests/unit/{bxml/verbs/StartTranscription.test.js → models/bxml/verbs/StartTranscription.test.ts} +4 -4
  264. package/tests/unit/{bxml/verbs/StopGather.test.js → models/bxml/verbs/StopGather.test.ts} +2 -2
  265. package/tests/unit/{bxml/verbs/StopRecording.test.js → models/bxml/verbs/StopRecording.test.ts} +2 -2
  266. package/tests/unit/{bxml/verbs/StopStream.test.js → models/bxml/verbs/StopStream.test.ts} +3 -3
  267. package/tests/unit/{bxml/verbs/StopTranscription.test.js → models/bxml/verbs/StopTranscription.test.ts} +3 -3
  268. package/tests/unit/{bxml/verbs/StreamParam.test.js → models/bxml/verbs/StreamParam.test.ts} +3 -3
  269. package/tests/unit/{bxml/verbs/Tag.test.js → models/bxml/verbs/Tag.test.ts} +2 -2
  270. package/tests/unit/{bxml/verbs/Transfer.test.js → models/bxml/verbs/Transfer.test.ts} +5 -5
  271. package/tests/unit/{call-direction-enum.test.js → models/call-direction-enum.test.ts} +1 -1
  272. package/tests/unit/{call-state-enum.test.js → models/call-state-enum.test.ts} +1 -1
  273. package/tests/unit/{callback-method-enum.test.js → models/callback-method-enum.test.ts} +1 -1
  274. package/tests/unit/{conference-state-enum.test.js → models/conference-state-enum.test.ts} +1 -1
  275. package/tests/unit/{file-format-enum.test.js → models/file-format-enum.test.ts} +1 -1
  276. package/tests/unit/{list-message-direction-enum.test.js → models/list-message-direction-enum.test.ts} +1 -1
  277. package/tests/unit/{lookup-status-enum.test.js → models/lookup-status-enum.test.ts} +1 -1
  278. package/tests/unit/{machine-detection-mode-enum.test.js → models/machine-detection-mode-enum.test.ts} +1 -1
  279. package/tests/unit/{message-direction-enum.test.js → models/message-direction-enum.test.ts} +1 -1
  280. package/tests/unit/{message-status-enum.test.js → models/message-status-enum.test.ts} +1 -1
  281. package/tests/unit/{message-type-enum.test.js → models/message-type-enum.test.ts} +1 -1
  282. package/tests/unit/{priority-enum.test.js → models/priority-enum.test.ts} +1 -1
  283. package/tests/unit/{recording-state-enum.test.js → models/recording-state-enum.test.ts} +1 -1
  284. package/tests/unit/{redirect-method-enum.test.js → models/redirect-method-enum.test.ts} +1 -1
  285. package/coverage/lcov-report/node-sdk/api/calls-api.ts.html +0 -1702
  286. package/coverage/lcov-report/node-sdk/api/conferences-api.ts.html +0 -2725
  287. package/coverage/lcov-report/node-sdk/api/index.html +0 -236
  288. package/coverage/lcov-report/node-sdk/api/media-api.ts.html +0 -1315
  289. package/coverage/lcov-report/node-sdk/api/messages-api.ts.html +0 -1138
  290. package/coverage/lcov-report/node-sdk/api/mfaapi.ts.html +0 -1051
  291. package/coverage/lcov-report/node-sdk/api/phone-number-lookup-api.ts.html +0 -775
  292. package/coverage/lcov-report/node-sdk/api/recordings-api.ts.html +0 -2971
  293. package/coverage/lcov-report/node-sdk/api/statistics-api.ts.html +0 -496
  294. package/coverage/lcov-report/node-sdk/api/transcriptions-api.ts.html +0 -1045
  295. package/coverage/lcov-report/node-sdk/base.ts.html +0 -1045
  296. package/coverage/lcov-report/node-sdk/common.ts.html +0 -535
  297. package/coverage/lcov-report/node-sdk/configuration.ts.html +0 -415
  298. package/coverage/lcov-report/node-sdk/index.html +0 -146
  299. package/coverage/lcov-report/node-sdk/models/bxml/index.ts.html +0 -94
  300. package/coverage/lcov-report/node-sdk/models/bxml/verbs/index.ts.html +0 -175
  301. package/coverage/lcov-report/node-sdk/models/call-transcription.ts.html +0 -274
  302. package/coverage/lcov-report/node-sdk/models/index.ts.html +0 -361
  303. package/coverage/lcov-report/node-sdk/tests/callUtils.js.html +0 -334
  304. package/coverage/lcov-report/node-sdk/tests/index.html +0 -116
  305. package/tests/callUtils.js +0 -83
  306. package/tests/integration/messages-api.test.js +0 -114
@@ -1,31 +1,32 @@
1
- const { MediaApi } = require('../../api/media-api');
2
- const { Configuration } = require('../../configuration');
3
- const crypto = require('crypto');
4
- const fs = require('fs');
1
+ //@ts-nocheck
2
+ import { MediaApi } from '../../api';
3
+ import { Configuration } from '../../configuration';
4
+ import { BinaryLike, createHash, randomUUID } from 'crypto';
5
+ import * as fs from 'fs';
5
6
 
6
7
  describe('MediaApi', () => {
7
- const config = new Configuration({ username: BW_USERNAME, password: BW_PASSWORD });
8
+ const config = new Configuration({ username: globalThis.BW_USERNAME, password: globalThis.BW_PASSWORD });
8
9
  const mediaApi = new MediaApi(config);
9
10
 
10
11
  const binaryMediaData = '123456';
11
12
  const mediaFileData = fs.readFileSync('./tests/fixtures/nodejs_cat.jpeg');
12
- const binaryMediaName = `nodejs_binary_media${crypto.randomUUID()}`;
13
- const mediaFileName = `nodejs_media_file${crypto.randomUUID()}`;
13
+ const binaryMediaName = `nodejs_binary_media${randomUUID()}`;
14
+ const mediaFileName = `nodejs_media_file${randomUUID()}`;
14
15
 
15
- const getHash = (data) => {
16
- return crypto.createHash('md5').update(data).digest('hex');
16
+ const getHash = (data: BinaryLike) => {
17
+ return createHash('md5').update(data).digest('hex');
17
18
  };
18
19
  const mediaFileMD5 = getHash(mediaFileData);
19
20
 
20
21
  describe('uploadMedia', () => {
21
22
  test('should upload binary media', async () => {
22
- const { status } = await mediaApi.uploadMedia(BW_ACCOUNT_ID, binaryMediaName, binaryMediaData);
23
+ const { status } = await mediaApi.uploadMedia(globalThis.BW_ACCOUNT_ID, binaryMediaName, binaryMediaData);
23
24
 
24
25
  expect(status).toEqual(204);
25
26
  });
26
27
 
27
28
  test('should upload media file', async () => {
28
- const { status } = await mediaApi.uploadMedia(BW_ACCOUNT_ID, mediaFileName, mediaFileData);
29
+ const { status } = await mediaApi.uploadMedia(globalThis.BW_ACCOUNT_ID, mediaFileName, mediaFileData);
29
30
 
30
31
  expect(status).toEqual(204);
31
32
  });
@@ -33,7 +34,7 @@ describe('MediaApi', () => {
33
34
 
34
35
  describe('listMedia', () => {
35
36
  test('should list media', async () => {
36
- const { status, data } = await mediaApi.listMedia(BW_ACCOUNT_ID);
37
+ const { status, data } = await mediaApi.listMedia(globalThis.BW_ACCOUNT_ID);
37
38
 
38
39
  expect(status).toEqual(200);
39
40
  expect(data).toBeInstanceOf(Array);
@@ -44,14 +45,14 @@ describe('MediaApi', () => {
44
45
 
45
46
  describe('getMedia', () => {
46
47
  test('should get binary media', async () => {
47
- const { status, data } = await mediaApi.getMedia(BW_ACCOUNT_ID, binaryMediaName);
48
+ const { status, data } = await mediaApi.getMedia(globalThis.BW_ACCOUNT_ID, binaryMediaName);
48
49
 
49
50
  expect(status).toEqual(200);
50
51
  expect(data.toString()).toEqual(binaryMediaData);
51
52
  });
52
53
 
53
54
  test('should get media file', async () => {
54
- const { status, data } = await mediaApi.getMedia(BW_ACCOUNT_ID, mediaFileName);
55
+ const { status, data } = await mediaApi.getMedia(globalThis.BW_ACCOUNT_ID, mediaFileName);
55
56
  // fs.writeFile('./tests/fixtures/test.jpeg', Buffer.from(data), (err) => {
56
57
  // if (err) throw err;
57
58
  // });
@@ -64,13 +65,13 @@ describe('MediaApi', () => {
64
65
 
65
66
  describe('deleteMedia', () => {
66
67
  test('should delete binary media', async () => {
67
- const { status } = await mediaApi.deleteMedia(BW_ACCOUNT_ID, binaryMediaName);
68
+ const { status } = await mediaApi.deleteMedia(globalThis.BW_ACCOUNT_ID, binaryMediaName);
68
69
 
69
70
  expect(status).toEqual(204);
70
71
  });
71
72
 
72
73
  test('should delete media file', async () => {
73
- const { status } = await mediaApi.deleteMedia(BW_ACCOUNT_ID, mediaFileName);
74
+ const { status } = await mediaApi.deleteMedia(globalThis.BW_ACCOUNT_ID, mediaFileName);
74
75
 
75
76
  expect(status).toEqual(204);
76
77
  });
@@ -79,7 +80,7 @@ describe('MediaApi', () => {
79
80
  describe('HTTP Errors', () => {
80
81
  test('404', async () => {
81
82
  try{
82
- await mediaApi.getMedia(BW_ACCOUNT_ID, 'does_not_exist');
83
+ await mediaApi.getMedia(globalThis.BW_ACCOUNT_ID, 'does-not-exist');
83
84
  } catch (e) {
84
85
  expect(e.response.status).toEqual(404);
85
86
  }
@@ -0,0 +1,115 @@
1
+ //@ts-nocheck
2
+ import { MessagesApi } from '../../api';
3
+ import { Configuration } from '../../configuration';
4
+ import { ListMessageDirectionEnum, MessageRequest, PriorityEnum } from '../../models';
5
+
6
+ describe('MessagesApi', () => {
7
+ const config = new Configuration({username: globalThis.BW_USERNAME, password: globalThis.BW_PASSWORD});
8
+ const messagesApi = new MessagesApi(config);
9
+
10
+ const mmsText = 'nodejs sdk test MMS';
11
+ const smsText = 'nodejs sdk test SMS';
12
+ const mmsTag = 'nodejs sdk test MMS tag';
13
+ const smsTag = 'nodejs sdk test SMS tag';
14
+ const mediaUrl = 'https://cdn2.thecatapi.com/images/MTY3ODk4Mg.jpg';
15
+ const priority = PriorityEnum.High;
16
+ const listMessageDirection = ListMessageDirectionEnum.Outbound;
17
+ const expirationTime = Date.now() + 1000 * 60 * 60 * 24 + 60;
18
+ const expiration = new Date(expirationTime).toISOString();
19
+
20
+ describe('createMessage', () => {
21
+ test('should create SMS message', async () => {
22
+ const messageRequest: MessageRequest = {
23
+ to: new Set([globalThis.USER_NUMBER]),
24
+ from: globalThis.BW_NUMBER,
25
+ text: smsText,
26
+ applicationId: globalThis.BW_MESSAGING_APPLICATION_ID,
27
+ tag: smsTag,
28
+ priority: priority,
29
+ expiration: expiration
30
+ };
31
+
32
+ const { status, data } = await messagesApi.createMessage(globalThis.BW_ACCOUNT_ID, messageRequest);
33
+
34
+ expect(status).toEqual(202);
35
+ expect(data.id).toHaveLength(29);
36
+ expect(data.owner).toEqual(globalThis.BW_NUMBER);
37
+ expect(data.to).toEqual([globalThis.USER_NUMBER]);
38
+ expect(data.from).toEqual(globalThis.BW_NUMBER);
39
+ expect(data.text).toEqual(smsText);
40
+ expect(data.tag).toEqual(smsTag);
41
+ expect(data.priority).toEqual(priority);
42
+ });
43
+
44
+ test('should create MMS message', async () => {
45
+ const messageRequest: MessageRequest = {
46
+ to: new Set([globalThis.USER_NUMBER]),
47
+ from: globalThis.BW_NUMBER,
48
+ text: mmsText,
49
+ applicationId: globalThis.BW_MESSAGING_APPLICATION_ID,
50
+ tag: mmsTag,
51
+ media: [mediaUrl]
52
+ };
53
+
54
+ const { status, data } = await messagesApi.createMessage(globalThis.BW_ACCOUNT_ID, messageRequest);
55
+
56
+ expect(status).toEqual(202);
57
+ expect(data.id).toHaveLength(29);
58
+ expect(data.owner).toEqual(globalThis.BW_NUMBER);
59
+ expect(data.to).toEqual([globalThis.USER_NUMBER]);
60
+ expect(data.from).toEqual(globalThis.BW_NUMBER);
61
+ expect(data.text).toEqual(mmsText);
62
+ expect(data.tag).toEqual(mmsTag);
63
+ expect(data.media).toEqual([mediaUrl]);
64
+ });
65
+ });
66
+
67
+ describe('listMessages', () => {
68
+ test('should list messages', async () => {
69
+ const { status, data } =
70
+ await messagesApi.listMessages(globalThis.BW_ACCOUNT_ID, undefined, globalThis.BW_NUMBER, undefined, undefined, listMessageDirection);
71
+
72
+ expect(status).toEqual(200);
73
+ expect(data.messages).toBeInstanceOf(Array);
74
+ expect(data.messages![0].accountId).toEqual(globalThis.BW_ACCOUNT_ID);
75
+ expect(data.messages![0].messageId).toHaveLength(29);
76
+ expect(data.messages![0].sourceTn).toEqual(globalThis.BW_NUMBER);
77
+ expect(data.messages![0].messageDirection).toEqual(listMessageDirection);
78
+ });
79
+ });
80
+
81
+ describe('HTTP Errors', () => {
82
+ test('400', async () => {
83
+ const messageRequest: MessageRequest = {
84
+ applicationId: globalThis.BW_MESSAGING_APPLICATION_ID,
85
+ to: new Set(['+1invalid']),
86
+ from: globalThis.BW_NUMBER,
87
+ text: smsText
88
+ };
89
+
90
+ try {
91
+ await messagesApi.createMessage(globalThis.BW_ACCOUNT_ID, messageRequest);
92
+ } catch (e) {
93
+ expect(e.response.status).toEqual(400);
94
+ }
95
+ });
96
+
97
+ test('401', async () => {
98
+ const configBad = new Configuration({username: globalThis.UNAUTHORIZED_USERNAME, password: globalThis.UNAUTHORIZED_PASSWORD});
99
+ const messagesApiBad = new MessagesApi(configBad);
100
+
101
+ const messageRequest: MessageRequest = {
102
+ applicationId: globalThis.BW_MESSAGING_APPLICATION_ID,
103
+ to: new Set([globalThis.USER_NUMBER]),
104
+ from: globalThis.BW_NUMBER,
105
+ text: smsText
106
+ };
107
+
108
+ try {
109
+ await messagesApiBad.createMessage(globalThis.BW_ACCOUNT_ID, messageRequest);
110
+ } catch (e) {
111
+ expect(e.response.status).toEqual(401);
112
+ }
113
+ });
114
+ });
115
+ });
@@ -1,8 +1,10 @@
1
- const { MFAApi } = require('../../api/mfaapi');
2
- const { Configuration } = require('../../configuration');
1
+ //@ts-nocheck
2
+ import { MFAApi } from '../../api';
3
+ import { Configuration } from '../../configuration';
4
+ import { CodeRequest, VerifyCodeRequest } from '../../models';
3
5
 
4
6
  describe('MFAApi', () => {
5
- const config = new Configuration({username: BW_USERNAME, password: BW_PASSWORD});
7
+ const config = new Configuration({username: globalThis.BW_USERNAME, password: globalThis.BW_PASSWORD});
6
8
  const mfaApi = new MFAApi(config);
7
9
 
8
10
  const message = 'Your temporary {NAME} {SCOPE} code is {CODE}';
@@ -10,15 +12,15 @@ describe('MFAApi', () => {
10
12
 
11
13
  describe('generateMessagingCode', () => {
12
14
  test('should generate messaging code', async () => {
13
- const codeRequest = {
14
- to: USER_NUMBER,
15
- from: BW_NUMBER,
16
- applicationId: BW_MESSAGING_APPLICATION_ID,
15
+ const codeRequest: CodeRequest = {
16
+ to: globalThis.USER_NUMBER,
17
+ from: globalThis.BW_NUMBER,
18
+ applicationId: globalThis.BW_MESSAGING_APPLICATION_ID,
17
19
  message: message,
18
20
  digits: digits
19
21
  };
20
22
 
21
- const { status, data } = await mfaApi.generateMessagingCode(BW_ACCOUNT_ID, codeRequest);
23
+ const { status, data } = await mfaApi.generateMessagingCode(globalThis.BW_ACCOUNT_ID, codeRequest);
22
24
 
23
25
  expect(status).toEqual(200);
24
26
  expect(data.messageId).toHaveLength(29);
@@ -27,15 +29,15 @@ describe('MFAApi', () => {
27
29
 
28
30
  describe('generateVoiceCode', () => {
29
31
  test('should generate voice code', async () => {
30
- const codeRequest = {
31
- to: USER_NUMBER,
32
- from: BW_NUMBER,
33
- applicationId: BW_VOICE_APPLICATION_ID,
32
+ const codeRequest: CodeRequest = {
33
+ to: globalThis.USER_NUMBER,
34
+ from: globalThis.BW_NUMBER,
35
+ applicationId: globalThis.BW_VOICE_APPLICATION_ID,
34
36
  message: message,
35
37
  digits: digits
36
38
  };
37
39
 
38
- const { status, data } = await mfaApi.generateVoiceCode(BW_ACCOUNT_ID, codeRequest);
40
+ const { status, data } = await mfaApi.generateVoiceCode(globalThis.BW_ACCOUNT_ID, codeRequest);
39
41
 
40
42
  expect(status).toEqual(200);
41
43
  expect(data.callId).toHaveLength(47);
@@ -44,14 +46,14 @@ describe('MFAApi', () => {
44
46
 
45
47
  describe('verifyCode', () => {
46
48
  test('should verify code', async () => {
47
- const verifyRequest = {
49
+ const verifyRequest: VerifyCodeRequest = {
48
50
  to: `+1000${Math.floor(Math.random() * 10000000)}`,
49
51
  scope: '2FA',
50
52
  expirationTimeInMinutes: 3,
51
53
  code: '12345'
52
54
  };
53
55
 
54
- const { status, data } = await mfaApi.verifyCode(BW_ACCOUNT_ID, verifyRequest);
56
+ const { status, data } = await mfaApi.verifyCode(globalThis.BW_ACCOUNT_ID, verifyRequest);
55
57
 
56
58
  expect(status).toEqual(200);
57
59
  expect(data.valid).toEqual(false);
@@ -60,35 +62,35 @@ describe('MFAApi', () => {
60
62
 
61
63
  describe('HTTP Errors', () => {
62
64
  test('400', async () => {
63
- const codeRequest = {
64
- to: USER_NUMBER,
65
- from: BW_NUMBER,
65
+ const codeRequest: CodeRequest = {
66
+ to: globalThis.USER_NUMBER,
67
+ from: globalThis.BW_NUMBER,
66
68
  applicationId: 'not-an-app-id',
67
69
  message: message,
68
70
  digits: digits
69
71
  };
70
72
 
71
73
  try {
72
- await mfaApi.generateMessagingCode(BW_ACCOUNT_ID, codeRequest);
74
+ await mfaApi.generateMessagingCode(globalThis.BW_ACCOUNT_ID, codeRequest);
73
75
  } catch (e) {
74
76
  expect(e.response.status).toEqual(400);
75
77
  }
76
78
  });
77
79
 
78
80
  test('403', async () => {
79
- const configBad = new Configuration({username: UNAUTHORIZED_USERNAME, password: UNAUTHORIZED_PASSWORD});
81
+ const configBad = new Configuration({username: globalThis.UNAUTHORIZED_USERNAME, password: globalThis.UNAUTHORIZED_PASSWORD});
80
82
  const mfaApiBad = new MFAApi(configBad);
81
83
 
82
- const codeRequest = {
83
- to: USER_NUMBER,
84
- from: BW_NUMBER,
85
- applicationId: BW_MESSAGING_APPLICATION_ID,
84
+ const codeRequest: CodeRequest = {
85
+ to: globalThis.USER_NUMBER,
86
+ from: globalThis.BW_NUMBER,
87
+ applicationId: globalThis.BW_MESSAGING_APPLICATION_ID,
86
88
  message: message,
87
89
  digits: digits
88
90
  };
89
91
 
90
92
  try {
91
- await mfaApiBad.generateMessagingCode(BW_ACCOUNT_ID, codeRequest);
93
+ await mfaApiBad.generateMessagingCode(globalThis.BW_ACCOUNT_ID, codeRequest);
92
94
  } catch (e) {
93
95
  expect(e.response.status).toEqual(403);
94
96
  }
@@ -1,17 +1,19 @@
1
- const { PhoneNumberLookupApi } = require('../../api/phone-number-lookup-api');
2
- const { Configuration } = require('../../configuration');
3
- const { sleep } = require('../callUtils');
1
+ //@ts-nocheck
2
+ import { PhoneNumberLookupApi } from "../../api";
3
+ import { Configuration } from "../../configuration";
4
+ import { LookupRequest } from "../../models";
5
+ import { sleep } from "../callUtils";
4
6
 
5
7
  describe('PhoneNumberLookupApi', () => {
6
8
  jest.setTimeout(10000);
7
9
  const config = new Configuration({username: BW_USERNAME, password: BW_PASSWORD});
8
10
  const phoneNumberLookupApi = new PhoneNumberLookupApi(config);
9
11
 
10
- let lookupRequestId;
12
+ let lookupRequestId: string;
11
13
 
12
14
  describe('createLookup', () => {
13
15
  test('should lookup phone number', async () => {
14
- const lookupRequest = {
16
+ const lookupRequest: LookupRequest = {
15
17
  tns: [BW_NUMBER]
16
18
  };
17
19
 
@@ -41,7 +43,7 @@ describe('PhoneNumberLookupApi', () => {
41
43
 
42
44
  describe('HTTP Errors', () => {
43
45
  test('400', async () => {
44
- const lookupRequest = {
46
+ const lookupRequest: LookupRequest = {
45
47
  tns: ['+1invalid']
46
48
  };
47
49
 
@@ -56,7 +58,7 @@ describe('PhoneNumberLookupApi', () => {
56
58
  const configBad = new Configuration({username: UNAUTHORIZED_USERNAME, password: UNAUTHORIZED_PASSWORD});
57
59
  const phoneNumberLookupApiBad = new PhoneNumberLookupApi(configBad);
58
60
 
59
- const lookupRequest = {
61
+ const lookupRequest: LookupRequest = {
60
62
  tns: [BW_NUMBER]
61
63
  };
62
64
 
@@ -1,17 +1,17 @@
1
- const { CallsApi } = require('../../api/calls-api');
2
- const { RecordingsApi } = require('../../api/recordings-api');
3
- const { Configuration } = require('../../configuration');
4
- const { RecordingStateEnum, CallStateEnum } = require('../../models');
5
- const { setupManteca, createMantecaCall, cleanupCalls, getMantecaTestStatus, sleep } = require('../callUtils');
1
+ //@ts-nocheck
2
+ import { CallsApi, RecordingsApi } from "../../api";
3
+ import { Configuration } from "../../configuration";
4
+ import { CallStateEnum, RecordingStateEnum } from "../../models";
5
+ import { getMantecaTestStatus, setupManteca, createMantecaCall, cleanupCalls, sleep } from '../callUtils';
6
6
 
7
7
  describe('RecordingsApi', () => {
8
8
  jest.setTimeout(240000);
9
- const config = new Configuration({username: BW_USERNAME, password: BW_PASSWORD});
9
+ const config = new Configuration({username: globalThis.BW_USERNAME, password: globalThis.BW_PASSWORD});
10
10
  const callsApi = new CallsApi(config);
11
11
  const recordingsApi = new RecordingsApi(config);
12
12
 
13
- let recordingId, mantecaTestId, mantecaCallId;
14
- let activeCalls = [];
13
+ let recordingId: string, mantecaTestId: string, mantecaCallId: string;
14
+ let activeCalls: string[] = [];
15
15
 
16
16
  beforeAll(async () => {
17
17
  mantecaTestId = await setupManteca('CALL');
@@ -28,29 +28,29 @@ describe('RecordingsApi', () => {
28
28
  const pauseRecording = { state: RecordingStateEnum.Paused };
29
29
  const startRecording = { state: RecordingStateEnum.Recording };
30
30
 
31
- await sleep(SLEEP_TIME_S * 2);
31
+ await sleep(globalThis.SLEEP_TIME_S * 2);
32
32
  const { status: pauseStatus } =
33
- await recordingsApi.updateCallRecordingState(BW_ACCOUNT_ID, mantecaCallId, pauseRecording);
33
+ await recordingsApi.updateCallRecordingState(globalThis.BW_ACCOUNT_ID, mantecaCallId, pauseRecording);
34
34
  expect(pauseStatus).toEqual(200);
35
35
 
36
- await sleep(SLEEP_TIME_S * 2);
36
+ await sleep(globalThis.SLEEP_TIME_S * 2);
37
37
  const { status: startStatus } =
38
- await recordingsApi.updateCallRecordingState(BW_ACCOUNT_ID, mantecaCallId, startRecording);
38
+ await recordingsApi.updateCallRecordingState(globalThis.BW_ACCOUNT_ID, mantecaCallId, startRecording);
39
39
  expect(startStatus).toEqual(200);
40
40
 
41
- await sleep(SLEEP_TIME_S * 2);
41
+ await sleep(globalThis.SLEEP_TIME_S * 2);
42
42
  const { status: completeStatus } =
43
- await callsApi.updateCall(BW_ACCOUNT_ID, mantecaCallId, { state: CallStateEnum.Completed });
43
+ await callsApi.updateCall(globalThis.BW_ACCOUNT_ID, mantecaCallId, { state: CallStateEnum.Completed });
44
44
  expect(completeStatus).toEqual(200);
45
45
 
46
46
  let retries = 0;
47
47
  let recordingComplete = false;
48
48
  try {
49
- while (!recordingComplete && retries < MAX_RETRIES) {
49
+ while (!recordingComplete && retries < globalThis.MAX_RETRIES) {
50
50
  const { callRecorded } = await getMantecaTestStatus(mantecaTestId);
51
51
  recordingComplete = callRecorded;
52
52
  retries++;
53
- await sleep(SLEEP_TIME_S);
53
+ await sleep(globalThis.SLEEP_TIME_S);
54
54
  }
55
55
  } catch (e) {
56
56
  console.log(e);
@@ -62,37 +62,37 @@ describe('RecordingsApi', () => {
62
62
 
63
63
  describe('listAccountCallRecordings', () => {
64
64
  test('should list account call recordings', async () => {
65
- const { status, data } = await recordingsApi.listAccountCallRecordings(BW_ACCOUNT_ID);
65
+ const { status, data } = await recordingsApi.listAccountCallRecordings(globalThis.BW_ACCOUNT_ID);
66
66
 
67
67
  expect(status).toEqual(200);
68
68
  expect(data).toBeInstanceOf(Array);
69
- expect(data[0].accountId).toEqual(BW_ACCOUNT_ID);
69
+ expect(data[0].accountId).toEqual(globalThis.BW_ACCOUNT_ID);
70
70
  });
71
71
  });
72
72
 
73
73
  describe('listCallRecordings', () => {
74
74
  test('should list call recordings', async () => {
75
- const { status, data } = await recordingsApi.listCallRecordings(BW_ACCOUNT_ID, mantecaCallId);
75
+ const { status, data } = await recordingsApi.listCallRecordings(globalThis.BW_ACCOUNT_ID, mantecaCallId);
76
76
 
77
77
  expect(status).toEqual(200);
78
78
  expect(data).toBeInstanceOf(Array);
79
- expect(data[0].applicationId).toEqual(MANTECA_APPLICATION_ID);
80
- expect(data[0].accountId).toEqual(BW_ACCOUNT_ID);
79
+ expect(data[0].applicationId).toEqual(globalThis.MANTECA_APPLICATION_ID);
80
+ expect(data[0].accountId).toEqual(globalThis.BW_ACCOUNT_ID);
81
81
  expect(data[0].callId).toEqual(mantecaCallId);
82
82
  expect(data[0].recordingId).toHaveLength(47);
83
83
  expect(['partial', 'complete']).toContain(data[0].status);
84
84
 
85
- recordingId = data[0].recordingId;
85
+ recordingId = data[0].recordingId!;
86
86
  });
87
87
  });
88
88
 
89
89
  describe('getCallRecording', () => {
90
90
  test('should get call recording', async () => {
91
- const { status, data } = await recordingsApi.getCallRecording(BW_ACCOUNT_ID, mantecaCallId, recordingId);
91
+ const { status, data } = await recordingsApi.getCallRecording(globalThis.BW_ACCOUNT_ID, mantecaCallId, recordingId);
92
92
 
93
93
  expect(status).toEqual(200);
94
- expect(data.applicationId).toEqual(MANTECA_APPLICATION_ID);
95
- expect(data.accountId).toEqual(BW_ACCOUNT_ID);
94
+ expect(data.applicationId).toEqual(globalThis.MANTECA_APPLICATION_ID);
95
+ expect(data.accountId).toEqual(globalThis.BW_ACCOUNT_ID);
96
96
  expect(data.callId).toEqual(mantecaCallId);
97
97
  expect(data.recordingId).toEqual(recordingId);
98
98
  expect(['partial', 'complete']).toContain(data.status);
@@ -101,7 +101,7 @@ describe('RecordingsApi', () => {
101
101
 
102
102
  describe('downloadCallRecording', () => {
103
103
  test('should download call recording', async () => {
104
- const { status, data } = await recordingsApi.downloadCallRecording(BW_ACCOUNT_ID, mantecaCallId, recordingId);
104
+ const { status, data } = await recordingsApi.downloadCallRecording(globalThis.BW_ACCOUNT_ID, mantecaCallId, recordingId);
105
105
 
106
106
  expect(status).toEqual(200);
107
107
  expect(data).toBeDefined();
@@ -111,23 +111,23 @@ describe('RecordingsApi', () => {
111
111
  describe('transcribeCallRecording', () => {
112
112
  test('should create a transcription request', async () => {
113
113
  const transcribeRecording = {
114
- callbackUrl: `${MANTECA_BASE_URL}/transcriptions`,
114
+ callbackUrl: `${globalThis.MANTECA_BASE_URL}/transcriptions`,
115
115
  tag: mantecaTestId
116
116
  };
117
117
  const { status } =
118
- await recordingsApi.transcribeCallRecording(BW_ACCOUNT_ID, mantecaCallId, recordingId, transcribeRecording);
118
+ await recordingsApi.transcribeCallRecording(globalThis.BW_ACCOUNT_ID, mantecaCallId, recordingId, transcribeRecording);
119
119
 
120
120
  expect(status).toEqual(204);
121
121
 
122
122
  let retries = 0;
123
123
  let transcriptionComplete = false;
124
- await sleep(SLEEP_TIME_S * 10);
124
+ await sleep(globalThis.SLEEP_TIME_S * 10);
125
125
  try {
126
- while (!transcriptionComplete && retries < MAX_RETRIES) {
126
+ while (!transcriptionComplete && retries < globalThis.MAX_RETRIES) {
127
127
  const { callTranscribed } = await getMantecaTestStatus(mantecaTestId);
128
128
  transcriptionComplete = callTranscribed;
129
129
  retries++;
130
- await sleep(SLEEP_TIME_S);
130
+ await sleep(globalThis.SLEEP_TIME_S);
131
131
  }
132
132
  } catch (e) {
133
133
  console.log(e);
@@ -139,18 +139,18 @@ describe('RecordingsApi', () => {
139
139
 
140
140
  describe('getRecordingTranscription', () => {
141
141
  test('should get recording transcription', async () => {
142
- const { status, data } = await recordingsApi.getRecordingTranscription(BW_ACCOUNT_ID, mantecaCallId, recordingId);
142
+ const { status, data } = await recordingsApi.getRecordingTranscription(globalThis.BW_ACCOUNT_ID, mantecaCallId, recordingId);
143
143
 
144
144
  expect(status).toEqual(200);
145
145
  expect(data.transcripts).toBeInstanceOf(Array);
146
- expect(data.transcripts[0].text).toBeDefined();
147
- expect(data.transcripts[0].confidence).toBeDefined();
146
+ expect(data.transcripts![0].text).toBeDefined();
147
+ expect(data.transcripts![0].confidence).toBeDefined();
148
148
  });
149
149
  });
150
150
 
151
151
  describe('deleteRecordingTranscription', () => {
152
152
  test('should delete recording transcription', async () => {
153
- const { status } = await recordingsApi.deleteRecordingTranscription(BW_ACCOUNT_ID, mantecaCallId, recordingId);
153
+ const { status } = await recordingsApi.deleteRecordingTranscription(globalThis.BW_ACCOUNT_ID, mantecaCallId, recordingId);
154
154
 
155
155
  expect(status).toEqual(204);
156
156
  });
@@ -158,7 +158,7 @@ describe('RecordingsApi', () => {
158
158
 
159
159
  describe('deleteRecordingMedia', () => {
160
160
  test('should delete recording media', async () => {
161
- const { status } = await recordingsApi.deleteRecordingMedia(BW_ACCOUNT_ID, mantecaCallId, recordingId);
161
+ const { status } = await recordingsApi.deleteRecordingMedia(globalThis.BW_ACCOUNT_ID, mantecaCallId, recordingId);
162
162
 
163
163
  expect(status).toEqual(204);
164
164
  });
@@ -166,7 +166,7 @@ describe('RecordingsApi', () => {
166
166
 
167
167
  describe('deleteRecording', () => {
168
168
  test('should delete recording', async () => {
169
- const { status } = await recordingsApi.deleteRecording(BW_ACCOUNT_ID, mantecaCallId, recordingId);
169
+ const { status } = await recordingsApi.deleteRecording(globalThis.BW_ACCOUNT_ID, mantecaCallId, recordingId);
170
170
 
171
171
  expect(status).toEqual(204);
172
172
  });
@@ -1,13 +1,14 @@
1
- const { StatisticsApi } = require('../../api/statistics-api');
2
- const { Configuration } = require("../../configuration");
1
+ //@ts-nocheck
2
+ import { StatisticsApi } from '../../api';
3
+ import { Configuration } from '../../configuration';
3
4
 
4
5
  describe('StatisticsApi', () => {
5
- const config = new Configuration({username: BW_USERNAME, password: BW_PASSWORD});
6
+ const config = new Configuration({username: globalThis.BW_USERNAME, password: globalThis.BW_PASSWORD});
6
7
  const statisticsApi = new StatisticsApi(config);
7
8
 
8
9
  describe('getStatistics', () => {
9
10
  test('should get statistics', async () => {
10
- const { status, data } = await statisticsApi.getStatistics(BW_ACCOUNT_ID);
11
+ const { status, data } = await statisticsApi.getStatistics(globalThis.BW_ACCOUNT_ID);
11
12
 
12
13
  expect(status).toEqual(200);
13
14
  expect(data.currentCallQueueSize).toBeDefined();
@@ -17,22 +18,22 @@ describe('StatisticsApi', () => {
17
18
 
18
19
  describe('HTTP Errors', () => {
19
20
  test('401', async () => {
20
- const configBad = new Configuration({username: UNAUTHORIZED_USERNAME, password: UNAUTHORIZED_PASSWORD});
21
+ const configBad = new Configuration({username: globalThis.UNAUTHORIZED_USERNAME, password: globalThis.UNAUTHORIZED_PASSWORD});
21
22
  const statisticsApiBad = new StatisticsApi(configBad);
22
23
 
23
24
  try {
24
- await statisticsApiBad.getStatistics(BW_ACCOUNT_ID);
25
+ await statisticsApiBad.getStatistics(globalThis.BW_ACCOUNT_ID);
25
26
  } catch (e) {
26
27
  expect(e.response.status).toEqual(401);
27
28
  }
28
29
  });
29
30
 
30
31
  test('403', async () => {
31
- const configBad = new Configuration({username: FORBIDDEN_USERNAME, password: FORBIDDEN_PASSWORD});
32
+ const configBad = new Configuration({username: globalThis.FORBIDDEN_USERNAME, password: globalThis.FORBIDDEN_PASSWORD});
32
33
  const statisticsApiBad = new StatisticsApi(configBad);
33
34
 
34
35
  try {
35
- await statisticsApiBad.getStatistics(BW_ACCOUNT_ID);
36
+ await statisticsApiBad.getStatistics(globalThis.BW_ACCOUNT_ID);
36
37
  } catch (e) {
37
38
  expect(e.response.status).toEqual(403);
38
39
  }