bandwidth-sdk 8.3.0 → 9.0.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 (258) hide show
  1. package/.github/CODEOWNERS +0 -3
  2. package/.github/workflows/deploy.yml +1 -30
  3. package/.github/workflows/test-pr.yml +0 -20
  4. package/.github/workflows/test-smoke.yml +0 -4
  5. package/.openapi-generator/FILES +2 -0
  6. package/README.md +1 -5
  7. package/api/calls-api.ts +0 -20
  8. package/api/conferences-api.ts +0 -36
  9. package/api/endpoints-api.ts +0 -20
  10. package/api/media-api.ts +8 -24
  11. package/api/messages-api.ts +0 -8
  12. package/api/mfaapi.ts +0 -12
  13. package/api/multi-channel-api.ts +0 -4
  14. package/api/phone-number-lookup-api.ts +0 -12
  15. package/api/recordings-api.ts +0 -40
  16. package/api/statistics-api.ts +0 -4
  17. package/api/toll-free-verification-api.ts +12 -48
  18. package/api/transcriptions-api.ts +0 -12
  19. package/bandwidth.yml +341 -122
  20. package/common.ts +2 -5
  21. package/configuration.ts +4 -13
  22. package/coverage/clover.xml +1249 -1293
  23. package/coverage/coverage-final.json +17 -16
  24. package/coverage/lcov-report/index.html +41 -26
  25. package/coverage/lcov-report/node-sdk/api/calls-api.ts.html +6 -66
  26. package/coverage/lcov-report/node-sdk/api/conferences-api.ts.html +6 -114
  27. package/coverage/lcov-report/node-sdk/api/endpoints-api.ts.html +6 -66
  28. package/coverage/lcov-report/node-sdk/api/index.html +69 -69
  29. package/coverage/lcov-report/node-sdk/api/media-api.ts.html +14 -62
  30. package/coverage/lcov-report/node-sdk/api/messages-api.ts.html +6 -30
  31. package/coverage/lcov-report/node-sdk/api/mfaapi.ts.html +6 -42
  32. package/coverage/lcov-report/node-sdk/api/multi-channel-api.ts.html +6 -18
  33. package/coverage/lcov-report/node-sdk/api/phone-number-lookup-api.ts.html +6 -42
  34. package/coverage/lcov-report/node-sdk/api/recordings-api.ts.html +6 -126
  35. package/coverage/lcov-report/node-sdk/api/statistics-api.ts.html +6 -18
  36. package/coverage/lcov-report/node-sdk/api/toll-free-verification-api.ts.html +18 -126
  37. package/coverage/lcov-report/node-sdk/api/transcriptions-api.ts.html +6 -42
  38. package/coverage/lcov-report/node-sdk/api.ts.html +1 -1
  39. package/coverage/lcov-report/node-sdk/base.ts.html +1 -1
  40. package/coverage/lcov-report/node-sdk/common.ts.html +13 -22
  41. package/coverage/lcov-report/node-sdk/configuration.ts.html +11 -38
  42. package/coverage/lcov-report/node-sdk/index.html +20 -20
  43. package/coverage/lcov-report/node-sdk/models/business-entity-type-enum.ts.html +2 -2
  44. package/coverage/lcov-report/node-sdk/models/business-registration-type-enum.ts.html +2 -2
  45. package/coverage/lcov-report/node-sdk/models/bxml/Bxml.ts.html +1 -1
  46. package/coverage/lcov-report/node-sdk/models/bxml/NestableVerb.ts.html +1 -1
  47. package/coverage/lcov-report/node-sdk/models/bxml/Response.ts.html +1 -1
  48. package/coverage/lcov-report/node-sdk/models/bxml/Root.ts.html +1 -1
  49. package/coverage/lcov-report/node-sdk/models/bxml/Verb.ts.html +1 -1
  50. package/coverage/lcov-report/node-sdk/models/bxml/index.html +1 -1
  51. package/coverage/lcov-report/node-sdk/models/bxml/index.ts.html +1 -1
  52. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Bridge.ts.html +1 -1
  53. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Conference.ts.html +1 -1
  54. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Connect.ts.html +1 -1
  55. package/coverage/lcov-report/node-sdk/models/bxml/verbs/CustomParam.ts.html +1 -1
  56. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Endpoint.ts.html +1 -1
  57. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Forward.ts.html +1 -1
  58. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Gather.ts.html +1 -1
  59. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Hangup.ts.html +1 -1
  60. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Pause.ts.html +1 -1
  61. package/coverage/lcov-report/node-sdk/models/bxml/verbs/PauseRecording.ts.html +1 -1
  62. package/coverage/lcov-report/node-sdk/models/bxml/verbs/PhoneNumber.ts.html +1 -1
  63. package/coverage/lcov-report/node-sdk/models/bxml/verbs/PlayAudio.ts.html +1 -1
  64. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Record.ts.html +1 -1
  65. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Redirect.ts.html +1 -1
  66. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Refer.ts.html +1 -1
  67. package/coverage/lcov-report/node-sdk/models/bxml/verbs/ResumeRecording.ts.html +1 -1
  68. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Ring.ts.html +1 -1
  69. package/coverage/lcov-report/node-sdk/models/bxml/verbs/SendDtmf.ts.html +1 -1
  70. package/coverage/lcov-report/node-sdk/models/bxml/verbs/SipUri.ts.html +1 -1
  71. package/coverage/lcov-report/node-sdk/models/bxml/verbs/SpeakSentence.ts.html +1 -1
  72. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StartGather.ts.html +1 -1
  73. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StartRecording.ts.html +1 -1
  74. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StartStream.ts.html +1 -1
  75. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StartTranscription.ts.html +1 -1
  76. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StopGather.ts.html +1 -1
  77. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StopRecording.ts.html +1 -1
  78. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StopStream.ts.html +1 -1
  79. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StopTranscription.ts.html +1 -1
  80. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StreamParam.ts.html +1 -1
  81. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Tag.ts.html +1 -1
  82. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Transfer.ts.html +1 -1
  83. package/coverage/lcov-report/node-sdk/models/bxml/verbs/index.html +1 -1
  84. package/coverage/lcov-report/node-sdk/models/bxml/verbs/index.ts.html +1 -1
  85. package/coverage/lcov-report/node-sdk/models/call-direction-enum.ts.html +1 -1
  86. package/coverage/lcov-report/node-sdk/models/call-state-enum.ts.html +1 -1
  87. package/coverage/lcov-report/node-sdk/models/call-transcription-detected-language-enum.ts.html +1 -1
  88. package/coverage/lcov-report/node-sdk/models/call-transcription-track-enum.ts.html +1 -1
  89. package/coverage/lcov-report/node-sdk/models/callback-method-enum.ts.html +1 -1
  90. package/coverage/lcov-report/node-sdk/models/card-width-enum.ts.html +1 -1
  91. package/coverage/lcov-report/node-sdk/models/completed-lookup-status-enum.ts.html +1 -1
  92. package/coverage/lcov-report/node-sdk/models/conference-state-enum.ts.html +1 -1
  93. package/coverage/lcov-report/node-sdk/models/deactivation-event-enum.ts.html +1 -1
  94. package/coverage/lcov-report/node-sdk/models/device-status-enum.ts.html +1 -1
  95. package/coverage/lcov-report/node-sdk/models/endpoint-direction-enum.ts.html +1 -1
  96. package/coverage/lcov-report/node-sdk/models/endpoint-event-type-enum.ts.html +1 -1
  97. package/coverage/lcov-report/node-sdk/models/endpoint-status-enum.ts.html +1 -1
  98. package/coverage/lcov-report/node-sdk/models/endpoint-type-enum.ts.html +1 -1
  99. package/coverage/lcov-report/node-sdk/models/file-format-enum.ts.html +1 -1
  100. package/coverage/lcov-report/node-sdk/models/in-progress-lookup-status-enum.ts.html +1 -1
  101. package/coverage/lcov-report/node-sdk/models/inbound-callback-type-enum.ts.html +1 -1
  102. package/coverage/lcov-report/node-sdk/models/index.html +5 -5
  103. package/coverage/lcov-report/node-sdk/models/index.ts.html +7 -4
  104. package/coverage/lcov-report/node-sdk/models/latest-message-delivery-status-enum.ts.html +1 -1
  105. package/coverage/lcov-report/node-sdk/models/line-type-enum.ts.html +1 -1
  106. package/coverage/lcov-report/node-sdk/models/list-message-direction-enum.ts.html +1 -1
  107. package/coverage/lcov-report/node-sdk/models/machine-detection-mode-enum.ts.html +1 -1
  108. package/coverage/lcov-report/node-sdk/models/message-direction-enum.ts.html +1 -1
  109. package/coverage/lcov-report/node-sdk/models/message-status-enum.ts.html +1 -1
  110. package/coverage/lcov-report/node-sdk/models/message-type-enum.ts.html +1 -1
  111. package/coverage/lcov-report/node-sdk/models/multi-channel-message-channel-enum.ts.html +1 -1
  112. package/coverage/lcov-report/node-sdk/models/priority-enum.ts.html +1 -1
  113. package/coverage/lcov-report/node-sdk/models/product-type-enum.ts.html +1 -1
  114. package/coverage/lcov-report/node-sdk/models/rbm-action-type-enum.ts.html +1 -1
  115. package/coverage/lcov-report/node-sdk/models/rbm-media-height-enum.ts.html +1 -1
  116. package/coverage/lcov-report/node-sdk/models/rbm-open-url-enum.ts.html +1 -1
  117. package/coverage/lcov-report/node-sdk/models/rbm-web-view-enum.ts.html +1 -1
  118. package/coverage/lcov-report/node-sdk/models/recording-state-enum.ts.html +1 -1
  119. package/coverage/lcov-report/node-sdk/models/redirect-method-enum.ts.html +1 -1
  120. package/coverage/lcov-report/node-sdk/models/refer-call-status-enum.ts.html +1 -1
  121. package/coverage/lcov-report/node-sdk/models/standalone-card-orientation-enum.ts.html +1 -1
  122. package/coverage/lcov-report/node-sdk/models/status-callback-type-enum.ts.html +6 -3
  123. package/coverage/lcov-report/node-sdk/models/tfv-callback-status-enum.ts.html +1 -1
  124. package/coverage/lcov-report/node-sdk/models/tfv-status-enum.ts.html +1 -1
  125. package/coverage/lcov-report/node-sdk/models/thumbnail-alignment-enum.ts.html +1 -1
  126. package/coverage/lcov-report/node-sdk/models/webhook-subscription-type-enum.ts.html +1 -1
  127. package/coverage/lcov-report/node-sdk/tests/unit/constants.ts.html +103 -0
  128. package/coverage/lcov-report/node-sdk/tests/unit/index.html +116 -0
  129. package/coverage/lcov.info +3073 -3115
  130. package/custom_templates/common.mustache +2 -5
  131. package/custom_templates/configuration.mustache +3 -12
  132. package/dist/api/calls-api.js +0 -15
  133. package/dist/api/conferences-api.js +0 -27
  134. package/dist/api/endpoints-api.js +0 -15
  135. package/dist/api/media-api.d.ts +8 -8
  136. package/dist/api/media-api.js +8 -20
  137. package/dist/api/messages-api.js +0 -6
  138. package/dist/api/mfaapi.js +0 -9
  139. package/dist/api/multi-channel-api.js +0 -3
  140. package/dist/api/phone-number-lookup-api.js +0 -9
  141. package/dist/api/recordings-api.js +0 -30
  142. package/dist/api/statistics-api.js +0 -3
  143. package/dist/api/toll-free-verification-api.d.ts +12 -12
  144. package/dist/api/toll-free-verification-api.js +12 -39
  145. package/dist/api/transcriptions-api.js +0 -9
  146. package/dist/common.js +2 -5
  147. package/dist/configuration.d.ts +0 -10
  148. package/dist/configuration.js +4 -3
  149. package/dist/models/business-entity-type-enum.d.ts +1 -1
  150. package/dist/models/business-entity-type-enum.js +1 -1
  151. package/dist/models/business-registration-type-enum.d.ts +1 -1
  152. package/dist/models/business-registration-type-enum.js +1 -1
  153. package/dist/models/callback.d.ts +2 -0
  154. package/dist/models/disconnect-callback.d.ts +11 -1
  155. package/dist/models/inbound-callback-message.d.ts +2 -0
  156. package/dist/models/index.d.ts +1 -0
  157. package/dist/models/index.js +1 -0
  158. package/dist/models/initiate-callback.d.ts +1 -1
  159. package/dist/models/list-message-item.d.ts +1 -1
  160. package/dist/models/multi-channel-action-calendar-event.d.ts +1 -1
  161. package/dist/models/multi-channel-action.d.ts +1 -1
  162. package/dist/models/rbm-action-base.d.ts +1 -1
  163. package/dist/models/rbm-action-dial.d.ts +1 -1
  164. package/dist/models/rbm-action-open-url.d.ts +1 -1
  165. package/dist/models/rbm-action-view-location.d.ts +1 -1
  166. package/dist/models/rbm-session.d.ts +36 -0
  167. package/dist/models/rbm-session.js +15 -0
  168. package/dist/models/rbm-suggestion-response.d.ts +2 -2
  169. package/dist/models/status-callback-message.d.ts +2 -0
  170. package/dist/models/status-callback-type-enum.d.ts +2 -1
  171. package/dist/models/status-callback-type-enum.js +2 -1
  172. package/dist/models/tfv-submission-info.d.ts +2 -2
  173. package/dist/models/transfer-disconnect-callback.d.ts +14 -0
  174. package/dist/models/verification-request.d.ts +2 -2
  175. package/dist/models/verification-update-request.d.ts +3 -3
  176. package/docs/BusinessEntityTypeEnum.md +1 -1
  177. package/docs/BusinessRegistrationTypeEnum.md +1 -1
  178. package/docs/CallsApi.md +5 -5
  179. package/docs/ConferencesApi.md +9 -9
  180. package/docs/DisconnectCallback.md +5 -1
  181. package/docs/EndpointsApi.md +5 -5
  182. package/docs/InboundCallbackMessage.md +2 -0
  183. package/docs/InitiateCallback.md +1 -1
  184. package/docs/MFAApi.md +3 -3
  185. package/docs/MediaApi.md +7 -7
  186. package/docs/MessagesApi.md +2 -2
  187. package/docs/MultiChannelAction.md +1 -1
  188. package/docs/MultiChannelActionCalendarEvent.md +1 -1
  189. package/docs/MultiChannelApi.md +1 -1
  190. package/docs/PhoneNumberLookupApi.md +3 -3
  191. package/docs/RbmActionBase.md +1 -1
  192. package/docs/RbmActionDial.md +1 -1
  193. package/docs/RbmActionOpenUrl.md +1 -1
  194. package/docs/RbmActionViewLocation.md +1 -1
  195. package/docs/RbmSession.md +29 -0
  196. package/docs/RbmSuggestionResponse.md +2 -2
  197. package/docs/RecordingsApi.md +10 -10
  198. package/docs/StatisticsApi.md +1 -1
  199. package/docs/StatusCallbackMessage.md +2 -0
  200. package/docs/StatusCallbackTypeEnum.md +3 -1
  201. package/docs/TfvSubmissionInfo.md +2 -2
  202. package/docs/TollFreeVerificationApi.md +15 -12
  203. package/docs/TranscriptionsApi.md +3 -3
  204. package/docs/TransferDisconnectCallback.md +6 -0
  205. package/docs/VerificationRequest.md +2 -2
  206. package/docs/VerificationUpdateRequest.md +3 -3
  207. package/generate.sh +6 -0
  208. package/jest.config.js +0 -6
  209. package/models/business-entity-type-enum.ts +1 -1
  210. package/models/business-registration-type-enum.ts +1 -1
  211. package/models/callback.ts +1 -1
  212. package/models/disconnect-callback.ts +9 -1
  213. package/models/inbound-callback-message.ts +4 -0
  214. package/models/index.ts +1 -0
  215. package/models/initiate-callback.ts +1 -1
  216. package/models/list-message-item.ts +1 -1
  217. package/models/multi-channel-action-calendar-event.ts +1 -1
  218. package/models/multi-channel-action.ts +1 -1
  219. package/models/rbm-action-base.ts +1 -1
  220. package/models/rbm-action-dial.ts +1 -1
  221. package/models/rbm-action-open-url.ts +1 -1
  222. package/models/rbm-action-view-location.ts +1 -1
  223. package/models/rbm-session.ts +42 -0
  224. package/models/rbm-suggestion-response.ts +2 -2
  225. package/models/status-callback-message.ts +4 -0
  226. package/models/status-callback-type-enum.ts +2 -1
  227. package/models/tfv-submission-info.ts +2 -2
  228. package/models/transfer-disconnect-callback.ts +12 -0
  229. package/models/verification-request.ts +2 -2
  230. package/models/verification-update-request.ts +3 -3
  231. package/package.json +1 -1
  232. package/tests/globals.d.ts +0 -6
  233. package/tests/smoke/calls-api.test.ts +1 -23
  234. package/tests/smoke/conferences-api.test.ts +2 -2
  235. package/tests/smoke/media-api.test.ts +4 -1
  236. package/tests/smoke/messages-api.test.ts +4 -19
  237. package/tests/smoke/mfaapi.test.ts +4 -20
  238. package/tests/smoke/multi-channel-api.test.ts +2 -2
  239. package/tests/smoke/statistics-api.test.ts +0 -24
  240. package/tests/unit/api/calls-api.test.ts +2 -1
  241. package/tests/unit/api/conferences-api.test.ts +3 -2
  242. package/tests/unit/api/media-api.test.ts +1 -0
  243. package/tests/unit/api/messages-api.test.ts +1 -0
  244. package/tests/unit/api/mfaapi.test.ts +1 -0
  245. package/tests/unit/api/multi-channel-api.test.ts +1 -0
  246. package/tests/unit/api/phone-number-lookup-api.test.ts +1 -0
  247. package/tests/unit/api/recordings-api.test.ts +2 -1
  248. package/tests/unit/api/statistics-api.test.ts +1 -0
  249. package/tests/unit/api/toll-free-verification-api.test.ts +1 -0
  250. package/tests/unit/api/transcriptions-api.test.ts +1 -0
  251. package/tests/unit/configuration.test.ts +19 -0
  252. package/tests/unit/constants.ts +6 -0
  253. package/tests/unit/models/disconnect-callback.test.ts +4 -0
  254. package/tests/unit/models/inbound-callback-message.test.ts +3 -0
  255. package/tests/unit/models/rbm-session.test.ts +19 -0
  256. package/tests/unit/models/status-callback-message.test.ts +3 -0
  257. package/tests/unit/models/status-callback-type-enum.test.ts +3 -1
  258. package/tests/unit/models/transfer-disconnect-callback.test.ts +6 -0
@@ -0,0 +1,42 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Bandwidth
5
+ * Bandwidth\'s Communication APIs
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: letstalk@bandwidth.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+
17
+ /**
18
+ * RCS interactive session information for the message. An interactive session is a 24-hour window covering all Rich and Rich Media messages exchanged between an RCS agent and a specific end user mobile number. It is triggered when at least 4 messages are exchanged within 24 hours, at least 2 of them mobile-originated and at least 1 mobile-terminated. Only present on `message-delivered`, `message-received` and `session-started` callbacks for RBM messages of US agents with the Conversational billing category. Omitted for all other messages.
19
+ */
20
+ export interface RbmSession {
21
+ /**
22
+ * Whether the message can start an interactive session. `false` if the message is already part of an active session, or if the agent is not eligible for interactive session billing.
23
+ */
24
+ 'canInitiate': boolean;
25
+ /**
26
+ * The unique identifier of the interactive session the message is part of. This is not a message ID. Omitted if the message is not part of a session.
27
+ */
28
+ 'id'?: string | null;
29
+ /**
30
+ * The type of the interactive session. Only present on `session-started` callbacks.
31
+ */
32
+ 'type'?: string | null;
33
+ /**
34
+ * The time the 24-hour session window opened. Only present on `session-started` callbacks.
35
+ */
36
+ 'startTime'?: string | null;
37
+ /**
38
+ * The time the 24-hour session window closes. Only present on `session-started` callbacks.
39
+ */
40
+ 'endTime'?: string | null;
41
+ }
42
+
@@ -16,11 +16,11 @@
16
16
 
17
17
  export interface RbmSuggestionResponse {
18
18
  /**
19
- * The text associated with the suggestion response.
19
+ * The text of the suggestion the user tapped.
20
20
  */
21
21
  'text'?: string;
22
22
  /**
23
- * Base64 payload the customer receives when the reply is clicked.
23
+ * Payload the customer receives when the reply is clicked.
24
24
  */
25
25
  'postbackData'?: string;
26
26
  /**
@@ -22,6 +22,9 @@ import type { MultiChannelMessageChannelEnum } from './multi-channel-message-cha
22
22
  // May contain unused imports in some cases
23
23
  // @ts-ignore
24
24
  import type { PriorityEnum } from './priority-enum';
25
+ // May contain unused imports in some cases
26
+ // @ts-ignore
27
+ import type { RbmSession } from './rbm-session';
25
28
 
26
29
  /**
27
30
  * Message payload schema within a callback
@@ -64,6 +67,7 @@ export interface StatusCallbackMessage {
64
67
  'media'?: Array<string>;
65
68
  'priority'?: PriorityEnum;
66
69
  'channel'?: MultiChannelMessageChannelEnum;
70
+ 'session'?: RbmSession;
67
71
  }
68
72
 
69
73
 
@@ -15,7 +15,7 @@
15
15
 
16
16
 
17
17
  /**
18
- * The possible status callbacks when sending an MT SMS or MMS or RBM message: - `message-sending` indicates that Bandwidth is sending the message to the upstream provider. - `message-sent` indicates that the message has left the Bandwidth network and is in transit to the provider. - `message-delivered` indicates that the message was successfully delivered to handset. - `message-failed` indicates that the message could not be sent to the intended recipient. - `message-read` indicates that the RBM message was read by the recipient.
18
+ * The possible status callbacks when sending an MT SMS or MMS or RBM message: - `message-sending` indicates that Bandwidth is sending the message to the upstream provider. - `message-sent` indicates that the message has left the Bandwidth network and is in transit to the provider. - `message-delivered` indicates that the message was successfully delivered to handset. - `message-failed` indicates that the message could not be sent to the intended recipient. - `message-read` indicates that the RBM message was read by the recipient. - `session-started` indicates that a previously exchanged RBM message is now part of an RCS interactive session and is no longer billed individually.
19
19
  */
20
20
 
21
21
  export const StatusCallbackTypeEnum = {
@@ -24,6 +24,7 @@ export const StatusCallbackTypeEnum = {
24
24
  MessageDelivered: 'message-delivered',
25
25
  MessageFailed: 'message-failed',
26
26
  MessageRead: 'message-read',
27
+ SessionStarted: 'session-started',
27
28
  } as const;
28
29
 
29
30
  export type StatusCallbackTypeEnum = typeof StatusCallbackTypeEnum[keyof typeof StatusCallbackTypeEnum];
@@ -70,12 +70,12 @@ export interface TfvSubmissionInfo {
70
70
  */
71
71
  'businessDba'?: string;
72
72
  /**
73
- * Government-issued business identifying number. **Note: As of October 19th, 2026 this field will be required when `businessEntityType` is _not_ `SOLE_PROPRIETOR`. If this field is provided, `businessRegistrationType` and `businessRegistrationIssuingCountry` are also required.**
73
+ * Government-issued business identifying number. **As of October 19th, 2026 this field is required when `businessEntityType` is _not_ `SOLE_PROPRIETOR`. If this field is provided, `businessRegistrationType` and `businessRegistrationIssuingCountry` are also required.**
74
74
  */
75
75
  'businessRegistrationNumber'?: string | null;
76
76
  'businessRegistrationType'?: BusinessRegistrationTypeEnum | null;
77
77
  /**
78
- * The country issuing the business registration in ISO-3166-1 alpha-3 format. Alpha-2 format is accepted by the API, but alpha-3 is highly encouraged. **Note: As of October 19th, 2026 this field will be required when `businessRegistrationNumber` is provided.** | Registration Type | Supported Countries | |----------------------|------------------------------------| | EIN | USA | | CBN | CAN | | NEQ | CAN | | PROVINCIAL_NUMBER | CAN | | CRN | GBR, HKG | | VAT | GBR, IRL, BRA, NLD | | ACN | AUS | | ABN | AUS | | BRN | HKG | | SIREN | FRA | | SIRET | FRA | | NZBN | NZL | | UST_IDNR | DEU | | CIF | ESP | | NIF | ESP | | CNPJ | BRA | | UID | CHE | | OTHER | Must Provide Country Code |
78
+ * The country issuing the business registration in ISO-3166-1 alpha-3 format. Alpha-2 format is accepted by the API, but alpha-3 is highly encouraged. **As of October 19th, 2026 this field is required when `businessRegistrationNumber` is provided.** | Registration Type | Supported Countries | |----------------------|------------------------------------| | EIN | USA | | CBN | CAN | | NEQ | CAN | | PROVINCIAL_NUMBER | CAN | | CRN | GBR, HKG | | VAT | GBR, IRL, BRA, NLD | | ACN | AUS | | ABN | AUS | | BRN | HKG | | SIREN | FRA | | SIRET | FRA | | NZBN | NZL | | UST_IDNR | DEU | | CIF | ESP | | NIF | ESP | | CNPJ | BRA | | UID | CHE | | OTHER | Must Provide Country Code |
79
79
  */
80
80
  'businessRegistrationIssuingCountry'?: string | null;
81
81
  'businessEntityType'?: BusinessEntityTypeEnum;
@@ -98,6 +98,18 @@ export interface TransferDisconnectCallback {
98
98
  * Bandwidth\'s internal id that references the error event.
99
99
  */
100
100
  'errorId'?: string | null;
101
+ /**
102
+ * (optional) The SIP status code of the final response that rejected an outbound call\'s (or transferred leg\'s) INVITE (e.g. 486 for busy, 603 for decline). Present only when the call was rejected with a SIP response.
103
+ */
104
+ 'sipResponseCode'?: number;
105
+ /**
106
+ * (optional) The full SIP status line, exactly as received, of the final response that rejected an outbound call\'s INVITE. The reason phrase can help distinguish outcomes that share a status code, such as `603 Network Blocked` and `603 Decline`. Present only when an outbound call was rejected with a SIP response.
107
+ */
108
+ 'sipStatusLine'?: string;
109
+ /**
110
+ * (optional) Map of SIP headers, with lowercase keys (SIP headers are case-insensitive). On the Initiate callback, contains the customer-supplied X-* headers from the original INVITE; present only for inbound SIP URI calls with custom headers. On the Disconnect and Transfer Disconnect callbacks, contains a single `reason` key holding the raw, unmodified `Reason` header value from the final SIP response that rejected an outbound call (or transferred leg); present only when that response included a `Reason` header (for example, `v=analytics1` call-analytics block information from a terminating carrier). If the response carries more than one `Reason` header, all values are returned in the order received, separated by `, `. Note - on the Initiate callback, keys preserve the original SIP header name in lowercase rather than Bandwidth\'s usual camelCase JSON convention, since these are passthrough values from the caller\'s SIP INVITE, not Bandwidth-defined fields. If the same header name is sent more than once in the INVITE, only the last value is kept. The example shown is for the Initiate callback; on the Disconnect and Transfer Disconnect callbacks the only key is `reason`.
111
+ */
112
+ 'sipHeaders'?: { [key: string]: string; };
101
113
  }
102
114
 
103
115
 
@@ -71,12 +71,12 @@ export interface VerificationRequest {
71
71
  */
72
72
  'businessDba'?: string;
73
73
  /**
74
- * Government-issued business identifying number. **Note: As of October 19th, 2026 this field will be required when `businessEntityType` is _not_ `SOLE_PROPRIETOR`. If this field is provided, `businessRegistrationType` and `businessRegistrationIssuingCountry` are also required.**
74
+ * Government-issued business identifying number. **As of October 19th, 2026 this field is required when `businessEntityType` is _not_ `SOLE_PROPRIETOR`. If this field is provided, `businessRegistrationType` and `businessRegistrationIssuingCountry` are also required.**
75
75
  */
76
76
  'businessRegistrationNumber'?: string | null;
77
77
  'businessRegistrationType'?: BusinessRegistrationTypeEnum | null;
78
78
  /**
79
- * The country issuing the business registration in ISO-3166-1 alpha-3 format. Alpha-2 format is accepted by the API, but alpha-3 is highly encouraged. **Note: As of October 19th, 2026 this field will be required when `businessRegistrationNumber` is provided.** | Registration Type | Supported Countries | |----------------------|------------------------------------| | EIN | USA | | CBN | CAN | | NEQ | CAN | | PROVINCIAL_NUMBER | CAN | | CRN | GBR, HKG | | VAT | GBR, IRL, BRA, NLD | | ACN | AUS | | ABN | AUS | | BRN | HKG | | SIREN | FRA | | SIRET | FRA | | NZBN | NZL | | UST_IDNR | DEU | | CIF | ESP | | NIF | ESP | | CNPJ | BRA | | UID | CHE | | OTHER | Must Provide Country Code |
79
+ * The country issuing the business registration in ISO-3166-1 alpha-3 format. Alpha-2 format is accepted by the API, but alpha-3 is highly encouraged. **As of October 19th, 2026 this field is required when `businessRegistrationNumber` is provided.** | Registration Type | Supported Countries | |----------------------|------------------------------------| | EIN | USA | | CBN | CAN | | NEQ | CAN | | PROVINCIAL_NUMBER | CAN | | CRN | GBR, HKG | | VAT | GBR, IRL, BRA, NLD | | ACN | AUS | | ABN | AUS | | BRN | HKG | | SIREN | FRA | | SIRET | FRA | | NZBN | NZL | | UST_IDNR | DEU | | CIF | ESP | | NIF | ESP | | CNPJ | BRA | | UID | CHE | | OTHER | Must Provide Country Code |
80
80
  */
81
81
  'businessRegistrationIssuingCountry'?: string | null;
82
82
  'businessEntityType': BusinessEntityTypeEnum;
@@ -70,13 +70,13 @@ export interface VerificationUpdateRequest {
70
70
  */
71
71
  'businessDba'?: string;
72
72
  /**
73
- * Government-issued business identifying number. **Note: As of October 19th, 2026 this field will be required when `businessEntityType` is _not_ `SOLE_PROPRIETOR`. If this field is provided, `businessRegistrationType` and `businessRegistrationIssuingCountry` are also required.**
73
+ * Government-issued business identifying number. **As of October 19th, 2026 this field is required when `businessEntityType` is _not_ `SOLE_PROPRIETOR`. If this field is provided, `businessRegistrationType` and `businessRegistrationIssuingCountry` are also required.**
74
74
  */
75
75
  'businessRegistrationNumber'?: string | null;
76
76
  'businessRegistrationType'?: BusinessRegistrationTypeEnum | null;
77
- 'businessEntityType'?: BusinessEntityTypeEnum;
77
+ 'businessEntityType': BusinessEntityTypeEnum;
78
78
  /**
79
- * The country issuing the business registration in ISO-3166-1 alpha-3 format. Alpha-2 format is accepted by the API, but alpha-3 is highly encouraged. **Note: As of October 19th, 2026 this field will be required when `businessRegistrationNumber` is provided.** | Registration Type | Supported Countries | |----------------------|------------------------------------| | EIN | USA | | CBN | CAN | | NEQ | CAN | | PROVINCIAL_NUMBER | CAN | | CRN | GBR, HKG | | VAT | GBR, IRL, BRA, NLD | | ACN | AUS | | ABN | AUS | | BRN | HKG | | SIREN | FRA | | SIRET | FRA | | NZBN | NZL | | UST_IDNR | DEU | | CIF | ESP | | NIF | ESP | | CNPJ | BRA | | UID | CHE | | OTHER | Must Provide Country Code |
79
+ * The country issuing the business registration in ISO-3166-1 alpha-3 format. Alpha-2 format is accepted by the API, but alpha-3 is highly encouraged. **As of October 19th, 2026 this field is required when `businessRegistrationNumber` is provided.** | Registration Type | Supported Countries | |----------------------|------------------------------------| | EIN | USA | | CBN | CAN | | NEQ | CAN | | PROVINCIAL_NUMBER | CAN | | CRN | GBR, HKG | | VAT | GBR, IRL, BRA, NLD | | ACN | AUS | | ABN | AUS | | BRN | HKG | | SIREN | FRA | | SIRET | FRA | | NZBN | NZL | | UST_IDNR | DEU | | CIF | ESP | | NIF | ESP | | CNPJ | BRA | | UID | CHE | | OTHER | Must Provide Country Code |
80
80
  */
81
81
  'businessRegistrationIssuingCountry'?: string | null;
82
82
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bandwidth-sdk",
3
- "version": "8.3.0",
3
+ "version": "9.0.0",
4
4
  "description": "OpenAPI client for bandwidth-sdk",
5
5
  "author": "OpenAPI-Generator Contributors",
6
6
  "repository": {
@@ -1,7 +1,5 @@
1
1
  /// <reference types="jest-extended" />
2
2
 
3
- declare const BW_USERNAME: string;
4
- declare const BW_PASSWORD: string;
5
3
  declare const BW_CLIENT_ID: string;
6
4
  declare const BW_CLIENT_SECRET: string;
7
5
  declare const BW_ACCOUNT_ID: string;
@@ -15,9 +13,5 @@ declare const MANTECA_APPLICATION_ID: string;
15
13
  declare const MANTECA_IDLE_NUMBER: string;
16
14
  declare const MANTECA_ACTIVE_NUMBER: string;
17
15
  declare const MANTECA_BASE_URL: string;
18
- declare const FORBIDDEN_USERNAME: string;
19
- declare const FORBIDDEN_PASSWORD: string;
20
- declare const UNAUTHORIZED_USERNAME: string;
21
- declare const UNAUTHORIZED_PASSWORD: string;
22
16
  declare const MAX_RETRIES: number;
23
17
  declare const SLEEP_TIME_S: number;
@@ -104,7 +104,7 @@ describe('CallsApi', () => {
104
104
 
105
105
  describe('listCalls', () => {
106
106
  test('should return an array of calls', async () => {
107
- const { status, data } = await callsApi.listCalls(BW_ACCOUNT_ID);
107
+ const { status, data } = await callsApi.listCalls(BW_ACCOUNT_ID, USER_NUMBER, BW_NUMBER);
108
108
 
109
109
  expect(status).toEqual(200);
110
110
  expect(data).toBeInstanceOf(Array);
@@ -171,28 +171,6 @@ describe('CallsApi', () => {
171
171
  }
172
172
  });
173
173
 
174
- test('401', async () => {
175
- const configBad = new Configuration({username: UNAUTHORIZED_USERNAME, password: UNAUTHORIZED_PASSWORD});
176
- const callsApiBad = new CallsApi(configBad);
177
-
178
- try {
179
- await callsApiBad.getCallState(BW_ACCOUNT_ID, callId);
180
- } catch (e) {
181
- expect(e.response.status).toEqual(401);
182
- }
183
- });
184
-
185
- test('403', async () => {
186
- const configBad = new Configuration({username: FORBIDDEN_USERNAME, password: FORBIDDEN_PASSWORD});
187
- const callsApiBad = new CallsApi(configBad);
188
-
189
- try {
190
- await callsApiBad.getCallState(BW_ACCOUNT_ID, callId);
191
- } catch (e) {
192
- expect(e.response.status).toEqual(403);
193
- }
194
- });
195
-
196
174
  test('404', async () => {
197
175
  try {
198
176
  await callsApi.getCallState(BW_ACCOUNT_ID, 'does-not-exist');
@@ -7,8 +7,8 @@ import { setupManteca, createMantecaCall, cleanupCalls, getMantecaTestStatus, sl
7
7
  describe('ConferencesApi', () => {
8
8
  jest.setTimeout(125000);
9
9
  const config = new Configuration({
10
- username: BW_USERNAME,
11
- password: BW_PASSWORD
10
+ clientId: BW_CLIENT_ID,
11
+ clientSecret: BW_CLIENT_SECRET
12
12
  });
13
13
  const callsApi = new CallsApi(config);
14
14
  const conferencesApi = new ConferencesApi(config);
@@ -5,7 +5,10 @@ import { BinaryLike, createHash, randomUUID } from 'crypto';
5
5
  import * as fs from 'fs';
6
6
 
7
7
  describe('MediaApi', () => {
8
- const config = new Configuration({ username: BW_USERNAME, password: BW_PASSWORD });
8
+ const config = new Configuration({
9
+ clientId: BW_CLIENT_ID,
10
+ clientSecret: BW_CLIENT_SECRET
11
+ });
9
12
  const mediaApi = new MediaApi(config);
10
13
 
11
14
  const binaryMediaData = '123456';
@@ -4,7 +4,10 @@ import { Configuration } from '../../configuration';
4
4
  import { ListMessageDirectionEnum, MessageRequest, PriorityEnum } from '../../models';
5
5
 
6
6
  describe('MessagesApi', () => {
7
- const config = new Configuration({username: BW_USERNAME, password: BW_PASSWORD});
7
+ const config = new Configuration({
8
+ clientId: BW_CLIENT_ID,
9
+ clientSecret: BW_CLIENT_SECRET
10
+ });
8
11
  const messagesApi = new MessagesApi(config);
9
12
 
10
13
  const mmsText = 'nodejs sdk test MMS';
@@ -98,23 +101,5 @@ describe('MessagesApi', () => {
98
101
  expect(e.response.status).toEqual(400);
99
102
  }
100
103
  });
101
-
102
- test('401', async () => {
103
- const configBad = new Configuration({username: UNAUTHORIZED_USERNAME, password: UNAUTHORIZED_PASSWORD});
104
- const messagesApiBad = new MessagesApi(configBad);
105
-
106
- const messageRequest: MessageRequest = {
107
- applicationId: BW_MESSAGING_APPLICATION_ID,
108
- to: new Set([USER_NUMBER]),
109
- from: BW_NUMBER,
110
- text: smsText
111
- };
112
-
113
- try {
114
- await messagesApiBad.createMessage(BW_ACCOUNT_ID, messageRequest);
115
- } catch (e) {
116
- expect(e.response.status).toEqual(401);
117
- }
118
- });
119
104
  });
120
105
  });
@@ -4,7 +4,10 @@ import { Configuration } from '../../configuration';
4
4
  import { CodeRequest, VerifyCodeRequest } from '../../models';
5
5
 
6
6
  describe('MFAApi', () => {
7
- const config = new Configuration({username: BW_USERNAME, password: BW_PASSWORD});
7
+ const config = new Configuration({
8
+ clientId: BW_CLIENT_ID,
9
+ clientSecret: BW_CLIENT_SECRET
10
+ });
8
11
  const mfaApi = new MFAApi(config);
9
12
 
10
13
  const message = 'Your temporary {NAME} {SCOPE} code is {CODE}';
@@ -76,24 +79,5 @@ describe('MFAApi', () => {
76
79
  expect(e.response.status).toEqual(400);
77
80
  }
78
81
  });
79
-
80
- test('403', async () => {
81
- const configBad = new Configuration({username: UNAUTHORIZED_USERNAME, password: UNAUTHORIZED_PASSWORD});
82
- const mfaApiBad = new MFAApi(configBad);
83
-
84
- const codeRequest: CodeRequest = {
85
- to: USER_NUMBER,
86
- from: BW_NUMBER,
87
- applicationId: BW_MESSAGING_APPLICATION_ID,
88
- message: message,
89
- digits: digits
90
- };
91
-
92
- try {
93
- await mfaApiBad.generateMessagingCode(BW_ACCOUNT_ID, codeRequest);
94
- } catch (e) {
95
- expect(e.response.status).toEqual(403);
96
- }
97
- });
98
82
  });
99
83
  });
@@ -29,8 +29,8 @@ import {
29
29
 
30
30
  describe('MultiChannelApi', () => {
31
31
  const config = new Configuration({
32
- username: BW_USERNAME,
33
- password: BW_PASSWORD
32
+ clientId: BW_CLIENT_ID,
33
+ clientSecret: BW_CLIENT_SECRET
34
34
  });
35
35
  const multiChannelApi = new MultiChannelApi(config);
36
36
 
@@ -18,28 +18,4 @@ describe('StatisticsApi', () => {
18
18
  expect(data.maxCallQueueSize).toEqual(7500);
19
19
  });
20
20
  });
21
-
22
- describe('HTTP Errors', () => {
23
- test('401', async () => {
24
- const configBad = new Configuration({username: UNAUTHORIZED_USERNAME, password: UNAUTHORIZED_PASSWORD});
25
- const statisticsApiBad = new StatisticsApi(configBad);
26
-
27
- try {
28
- await statisticsApiBad.getStatistics(BW_ACCOUNT_ID);
29
- } catch (e) {
30
- expect(e.response.status).toEqual(401);
31
- }
32
- });
33
-
34
- test('403', async () => {
35
- const configBad = new Configuration({username: FORBIDDEN_USERNAME, password: FORBIDDEN_PASSWORD});
36
- const statisticsApiBad = new StatisticsApi(configBad);
37
-
38
- try {
39
- await statisticsApiBad.getStatistics(BW_ACCOUNT_ID);
40
- } catch (e) {
41
- expect(e.response.status).toEqual(403);
42
- }
43
- });
44
- });
45
21
  });
@@ -1,6 +1,7 @@
1
1
  import axios from 'axios';
2
2
  import { CallsApi } from '../../../api';
3
3
  import { Configuration } from '../../../configuration';
4
+ import { BW_ACCOUNT_ID, BW_NUMBER, USER_NUMBER, BW_VOICE_APPLICATION_ID, BASE_CALLBACK_URL } from '../constants';
4
5
  import {
5
6
  CallbackMethodEnum,
6
7
  CallDirectionEnum,
@@ -138,7 +139,7 @@ describe('CallsApi', () => {
138
139
  test('should update a call', async () => {
139
140
  const updateCallBody: UpdateCall = {
140
141
  state: CallStateEnum.Active,
141
- redirectUrl: `${MANTECA_BASE_URL}/bxml/pause`
142
+ redirectUrl: `${BASE_CALLBACK_URL}/bxml/pause`
142
143
  };
143
144
 
144
145
  const { status } = await callsApi.updateCall(BW_ACCOUNT_ID, callId, updateCallBody);
@@ -1,5 +1,6 @@
1
1
  import { ConferencesApi } from '../../../api';
2
2
  import { Configuration } from '../../../configuration';
3
+ import { BW_ACCOUNT_ID, BASE_CALLBACK_URL } from '../constants';
3
4
  import {
4
5
  ConferenceStateEnum,
5
6
  RedirectMethodEnum,
@@ -79,11 +80,11 @@ describe('ConferencesApi', () => {
79
80
  test('should update conference', async () => {
80
81
  const updateConferenceBody: UpdateConference = {
81
82
  status: ConferenceStateEnum.Active,
82
- redirectUrl: `${MANTECA_BASE_URL}/bxml/pause`,
83
+ redirectUrl: `${BASE_CALLBACK_URL}/bxml/pause`,
83
84
  redirectMethod: RedirectMethodEnum.Post,
84
85
  username: 'username',
85
86
  password: 'password',
86
- redirectFallbackUrl: `${MANTECA_BASE_URL}/bxml/pause`,
87
+ redirectFallbackUrl: `${BASE_CALLBACK_URL}/bxml/pause`,
87
88
  redirectFallbackMethod: RedirectMethodEnum.Post,
88
89
  fallbackUsername: 'username',
89
90
  fallbackPassword: 'password'
@@ -1,5 +1,6 @@
1
1
  import { MediaApi } from '../../../api';
2
2
  import { Configuration } from '../../../configuration';
3
+ import { BW_ACCOUNT_ID } from '../constants';
3
4
 
4
5
  describe('MediaApi', () => {
5
6
  const config = new Configuration({
@@ -1,6 +1,7 @@
1
1
  import axios from 'axios';
2
2
  import { MessagesApi } from '../../../api';
3
3
  import { Configuration } from '../../../configuration';
4
+ import { BW_ACCOUNT_ID, BW_NUMBER, USER_NUMBER, BW_MESSAGING_APPLICATION_ID } from '../constants';
4
5
  import {
5
6
  ListMessageDirectionEnum,
6
7
  MessageDirectionEnum,
@@ -1,6 +1,7 @@
1
1
  import axios from 'axios';
2
2
  import { MFAApi } from '../../../api';
3
3
  import { Configuration } from '../../../configuration';
4
+ import { BW_ACCOUNT_ID, BW_NUMBER, USER_NUMBER, BW_VOICE_APPLICATION_ID, BW_MESSAGING_APPLICATION_ID } from '../constants';
4
5
  import { CodeRequest, VerifyCodeRequest } from '../../../models';
5
6
 
6
7
  describe('MFAApi', () => {
@@ -1,6 +1,7 @@
1
1
  //@ts-nocheck
2
2
  import { MultiChannelApi } from '../../../api';
3
3
  import { Configuration } from '../../../configuration';
4
+ import { BW_ACCOUNT_ID, BW_NUMBER, USER_NUMBER, BW_MESSAGING_APPLICATION_ID } from '../constants';
4
5
  import {
5
6
  MultiChannelChannelListRBMObject,
6
7
  MultiChannelMessageChannelEnum,
@@ -1,5 +1,6 @@
1
1
  import { PhoneNumberLookupApi } from "../../../api";
2
2
  import { Configuration } from "../../../configuration";
3
+ import { BW_ACCOUNT_ID, BW_NUMBER, USER_NUMBER } from "../constants";
3
4
  import {
4
5
  AsyncLookupRequest,
5
6
  CompletedLookupStatusEnum,
@@ -1,5 +1,6 @@
1
1
  import { RecordingsApi } from "../../../api";
2
2
  import { Configuration } from "../../../configuration";
3
+ import { BW_ACCOUNT_ID, BASE_CALLBACK_URL } from "../constants";
3
4
  import {
4
5
  CallDirectionEnum,
5
6
  FileFormatEnum,
@@ -135,7 +136,7 @@ describe('RecordingsApi', () => {
135
136
  describe('transcribeCallRecording', () => {
136
137
  test('should create a transcription request', async () => {
137
138
  const transcribeRecording: TranscribeRecording = {
138
- callbackUrl: `${MANTECA_BASE_URL}/transcriptions`,
139
+ callbackUrl: `${BASE_CALLBACK_URL}/transcriptions`,
139
140
  tag: callId
140
141
  };
141
142
  const { status } =
@@ -1,6 +1,7 @@
1
1
  import axios from 'axios';
2
2
  import { StatisticsApi } from '../../../api';
3
3
  import { Configuration } from '../../../configuration';
4
+ import { BW_ACCOUNT_ID } from '../constants';
4
5
 
5
6
  describe('StatisticsApi', () => {
6
7
  const config = new Configuration({
@@ -1,5 +1,6 @@
1
1
  import { TollFreeVerificationApi } from '../../../api';
2
2
  import { Configuration } from '../../../configuration';
3
+ import { BW_ACCOUNT_ID } from '../constants';
3
4
  import {
4
5
  BusinessEntityTypeEnum,
5
6
  BusinessRegistrationTypeEnum,
@@ -1,5 +1,6 @@
1
1
  import { TranscriptionsApi } from "../../../api";
2
2
  import { Configuration } from "../../../configuration";
3
+ import { BW_ACCOUNT_ID } from "../constants";
3
4
  import { CallTranscriptionDetectedLanguageEnum, CallTranscriptionTrackEnum } from "../../../models";
4
5
 
5
6
  describe('TranscriptionsApi', () => {
@@ -82,3 +82,22 @@ describe('Configuration OAuth', () => {
82
82
  expect(mockedAxios.request).not.toHaveBeenCalled();
83
83
  });
84
84
  });
85
+
86
+ describe('Configuration Basic auth', () => {
87
+ const expectedError = 'Basic authentication is no longer supported. Use `clientId` and `clientSecret` instead.';
88
+
89
+ test('throws when username and password are provided', () => {
90
+ // @ts-expect-error username and password are no longer valid parameters
91
+ expect(() => new Configuration({ username: 'user', password: 'pass' })).toThrow(expectedError);
92
+ });
93
+
94
+ test('throws when only username is provided', () => {
95
+ // @ts-expect-error username is no longer a valid parameter
96
+ expect(() => new Configuration({ username: 'user' })).toThrow(expectedError);
97
+ });
98
+
99
+ test('throws when only password is provided', () => {
100
+ // @ts-expect-error password is no longer a valid parameter
101
+ expect(() => new Configuration({ password: 'pass' })).toThrow(expectedError);
102
+ });
103
+ });
@@ -0,0 +1,6 @@
1
+ export const BW_ACCOUNT_ID = '9900000';
2
+ export const BW_NUMBER = '+19195551234';
3
+ export const USER_NUMBER = '+19195554321';
4
+ export const BW_VOICE_APPLICATION_ID = 'abc12345-6def-abc1-2345-6defabc12345';
5
+ export const BW_MESSAGING_APPLICATION_ID = 'abc12345-6def-abc1-2345-6defabc12345';
6
+ export const BASE_CALLBACK_URL = 'https://example.com';
@@ -23,6 +23,8 @@ describe('DisconnectCallback', () => {
23
23
  tag: 'test-tag',
24
24
  sipCallId: 'test-sipCallId',
25
25
  sipResponseCode: 200,
26
+ sipStatusLine: 'test-sipStatusLine',
27
+ sipHeaders: { reason: 'test-reason' },
26
28
  };
27
29
 
28
30
  expect(fixture.eventType).toBe('test-eventType');
@@ -44,5 +46,7 @@ describe('DisconnectCallback', () => {
44
46
  expect(fixture.tag).toBe('test-tag');
45
47
  expect(fixture.sipCallId).toBe('test-sipCallId');
46
48
  expect(fixture.sipResponseCode).toBe(200);
49
+ expect(fixture.sipStatusLine).toBe('test-sipStatusLine');
50
+ expect(fixture.sipHeaders).toEqual({ reason: 'test-reason' });
47
51
  });
48
52
  });
@@ -2,6 +2,7 @@ import { InboundCallbackMessage } from '../../../models/inbound-callback-message
2
2
  import { MessageDirectionEnum } from '../../../models/message-direction-enum';
3
3
  import { PriorityEnum } from '../../../models/priority-enum';
4
4
  import { MultiChannelMessageChannelEnum } from '../../../models/multi-channel-message-channel-enum';
5
+ import { RbmSession } from '../../../models/rbm-session';
5
6
  import { MultiChannelMessageContent } from '../../../models/multi-channel-message-content';
6
7
  import { RbmSuggestionResponse } from '../../../models/rbm-suggestion-response';
7
8
  import { RbmLocationResponse } from '../../../models/rbm-location-response';
@@ -23,6 +24,7 @@ describe('InboundCallbackMessage', () => {
23
24
  media: [],
24
25
  priority: PriorityEnum.Default,
25
26
  channel: MultiChannelMessageChannelEnum.Rbm,
27
+ session: {} as unknown as RbmSession,
26
28
  content: {} as unknown as MultiChannelMessageContent,
27
29
  suggestionResponse: {} as unknown as RbmSuggestionResponse,
28
30
  locationResponse: {} as unknown as RbmLocationResponse,
@@ -41,6 +43,7 @@ describe('InboundCallbackMessage', () => {
41
43
  expect(fixture.media).toEqual([]);
42
44
  expect(fixture.priority).toBe(PriorityEnum.Default);
43
45
  expect(fixture.channel).toBe(MultiChannelMessageChannelEnum.Rbm);
46
+ expect(fixture.session).toBeDefined();
44
47
  expect(fixture.content).toBeDefined();
45
48
  expect(fixture.suggestionResponse).toBeDefined();
46
49
  expect(fixture.locationResponse).toBeDefined();
@@ -0,0 +1,19 @@
1
+ import { RbmSession } from '../../../models/rbm-session';
2
+
3
+ describe('RbmSession', () => {
4
+ test('should accept the expected shape', () => {
5
+ const fixture: RbmSession = {
6
+ canInitiate: true,
7
+ id: 'test-id',
8
+ type: 'test-type',
9
+ startTime: 'test-startTime',
10
+ endTime: 'test-endTime',
11
+ };
12
+
13
+ expect(fixture.canInitiate).toBe(true);
14
+ expect(fixture.id).toBe('test-id');
15
+ expect(fixture.type).toBe('test-type');
16
+ expect(fixture.startTime).toBe('test-startTime');
17
+ expect(fixture.endTime).toBe('test-endTime');
18
+ });
19
+ });
@@ -2,6 +2,7 @@ import { StatusCallbackMessage } from '../../../models/status-callback-message';
2
2
  import { MessageDirectionEnum } from '../../../models/message-direction-enum';
3
3
  import { PriorityEnum } from '../../../models/priority-enum';
4
4
  import { MultiChannelMessageChannelEnum } from '../../../models/multi-channel-message-channel-enum';
5
+ import { RbmSession } from '../../../models/rbm-session';
5
6
 
6
7
  describe('StatusCallbackMessage', () => {
7
8
  test('should accept the expected shape', () => {
@@ -20,6 +21,7 @@ describe('StatusCallbackMessage', () => {
20
21
  media: [],
21
22
  priority: PriorityEnum.Default,
22
23
  channel: MultiChannelMessageChannelEnum.Rbm,
24
+ session: {} as unknown as RbmSession,
23
25
  };
24
26
 
25
27
  expect(fixture.id).toBe('test-id');
@@ -35,5 +37,6 @@ describe('StatusCallbackMessage', () => {
35
37
  expect(fixture.media).toEqual([]);
36
38
  expect(fixture.priority).toBe(PriorityEnum.Default);
37
39
  expect(fixture.channel).toBe(MultiChannelMessageChannelEnum.Rbm);
40
+ expect(fixture.session).toBeDefined();
38
41
  });
39
42
  });