rcs-js 2.0.21 → 2.0.23-rc.1

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 (389) hide show
  1. package/dist/cjs/Client.d.ts +6 -0
  2. package/dist/cjs/Client.js +32 -22
  3. package/dist/cjs/api/errors/BadGatewayError.d.ts +6 -0
  4. package/dist/cjs/api/errors/BadGatewayError.js +50 -0
  5. package/dist/cjs/api/errors/ConflictError.d.ts +6 -0
  6. package/dist/cjs/api/errors/ConflictError.js +50 -0
  7. package/dist/cjs/api/errors/GoneError.d.ts +6 -0
  8. package/dist/cjs/api/errors/GoneError.js +50 -0
  9. package/dist/cjs/api/errors/ServiceUnavailableError.d.ts +6 -0
  10. package/dist/cjs/api/errors/ServiceUnavailableError.js +50 -0
  11. package/dist/cjs/api/errors/TooEarlyError.d.ts +6 -0
  12. package/dist/cjs/api/errors/TooEarlyError.js +50 -0
  13. package/dist/cjs/api/errors/UnprocessableEntityError.d.ts +6 -0
  14. package/dist/cjs/api/errors/UnprocessableEntityError.js +50 -0
  15. package/dist/cjs/api/errors/index.d.ts +6 -0
  16. package/dist/cjs/api/errors/index.js +6 -0
  17. package/dist/cjs/api/resources/calls/client/Client.d.ts +181 -0
  18. package/dist/cjs/api/resources/calls/client/Client.js +788 -0
  19. package/dist/cjs/api/resources/calls/client/index.d.ts +1 -0
  20. package/dist/cjs/api/resources/calls/client/index.js +17 -0
  21. package/dist/cjs/api/resources/calls/client/requests/CallsDownloadRecordingRequest.d.ts +8 -0
  22. package/dist/cjs/api/resources/calls/client/requests/CallsDownloadRecordingRequest.js +3 -0
  23. package/dist/cjs/api/resources/calls/client/requests/CallsListEventsRequest.d.ts +10 -0
  24. package/dist/cjs/api/resources/calls/client/requests/CallsListEventsRequest.js +3 -0
  25. package/dist/cjs/api/resources/calls/client/requests/CallsListRequest.d.ts +17 -0
  26. package/dist/cjs/api/resources/calls/client/requests/CallsListRequest.js +3 -0
  27. package/dist/cjs/api/resources/calls/client/requests/CreateCallParams.d.ts +17 -0
  28. package/dist/cjs/api/resources/calls/client/requests/CreateCallParams.js +3 -0
  29. package/dist/cjs/api/resources/calls/client/requests/CreateStreamTokenParams.d.ts +12 -0
  30. package/dist/cjs/api/resources/calls/client/requests/CreateStreamTokenParams.js +3 -0
  31. package/dist/cjs/api/resources/calls/client/requests/UpdateCallParams.d.ts +12 -0
  32. package/dist/cjs/api/resources/calls/client/requests/UpdateCallParams.js +3 -0
  33. package/dist/cjs/api/resources/calls/client/requests/index.d.ts +6 -0
  34. package/dist/cjs/api/resources/calls/client/requests/index.js +2 -0
  35. package/dist/cjs/api/resources/calls/index.d.ts +1 -0
  36. package/dist/cjs/api/resources/calls/index.js +17 -0
  37. package/dist/cjs/api/resources/forms/client/Client.d.ts +1 -1
  38. package/dist/cjs/api/resources/forms/client/Client.js +1 -1
  39. package/dist/cjs/api/resources/index.d.ts +3 -0
  40. package/dist/cjs/api/resources/index.js +4 -1
  41. package/dist/cjs/api/resources/network/client/Client.d.ts +21 -0
  42. package/dist/cjs/api/resources/network/client/Client.js +30 -0
  43. package/dist/cjs/api/resources/network/client/index.d.ts +1 -0
  44. package/dist/cjs/api/resources/network/client/index.js +2 -0
  45. package/dist/cjs/api/resources/network/index.d.ts +2 -0
  46. package/dist/cjs/api/resources/network/index.js +18 -0
  47. package/dist/cjs/api/resources/network/resources/index.d.ts +8 -0
  48. package/dist/cjs/api/resources/network/resources/index.js +47 -0
  49. package/dist/cjs/api/resources/network/resources/requests/client/Client.d.ts +61 -0
  50. package/dist/cjs/api/resources/network/resources/requests/client/Client.js +223 -0
  51. package/dist/cjs/api/resources/network/resources/requests/client/index.d.ts +1 -0
  52. package/dist/cjs/api/resources/network/resources/requests/client/index.js +17 -0
  53. package/dist/cjs/api/resources/network/resources/requests/client/requests/ListNetworkRequestsParams.d.ts +21 -0
  54. package/dist/cjs/api/resources/network/resources/requests/client/requests/ListNetworkRequestsParams.js +3 -0
  55. package/dist/cjs/api/resources/network/resources/requests/client/requests/index.d.ts +1 -0
  56. package/dist/cjs/api/resources/network/resources/requests/client/requests/index.js +2 -0
  57. package/dist/cjs/api/resources/network/resources/requests/index.d.ts +1 -0
  58. package/dist/cjs/api/resources/network/resources/requests/index.js +17 -0
  59. package/dist/cjs/api/resources/network/resources/silentAuth/client/Client.d.ts +71 -0
  60. package/dist/cjs/api/resources/network/resources/silentAuth/client/Client.js +234 -0
  61. package/dist/cjs/api/resources/network/resources/silentAuth/client/index.d.ts +1 -0
  62. package/dist/cjs/api/resources/network/resources/silentAuth/client/index.js +17 -0
  63. package/dist/cjs/api/resources/network/resources/silentAuth/client/requests/SilentAuthCheckRequest.d.ts +10 -0
  64. package/dist/cjs/api/resources/network/resources/silentAuth/client/requests/SilentAuthCheckRequest.js +3 -0
  65. package/dist/cjs/api/resources/network/resources/silentAuth/client/requests/SilentAuthRequest.d.ts +34 -0
  66. package/dist/cjs/api/resources/network/resources/silentAuth/client/requests/SilentAuthRequest.js +3 -0
  67. package/dist/cjs/api/resources/network/resources/silentAuth/client/requests/index.d.ts +2 -0
  68. package/dist/cjs/api/resources/network/resources/silentAuth/client/requests/index.js +2 -0
  69. package/dist/cjs/api/resources/network/resources/silentAuth/index.d.ts +1 -0
  70. package/dist/cjs/api/resources/network/resources/silentAuth/index.js +17 -0
  71. package/dist/cjs/api/resources/network/resources/simSwap/client/Client.d.ts +37 -0
  72. package/dist/cjs/api/resources/network/resources/simSwap/client/Client.js +143 -0
  73. package/dist/cjs/api/resources/network/resources/simSwap/client/index.d.ts +1 -0
  74. package/dist/cjs/api/resources/network/resources/simSwap/client/index.js +17 -0
  75. package/dist/cjs/api/resources/network/resources/simSwap/client/requests/SimSwapRequest.d.ts +13 -0
  76. package/dist/cjs/api/resources/network/resources/simSwap/client/requests/SimSwapRequest.js +3 -0
  77. package/dist/cjs/api/resources/network/resources/simSwap/client/requests/index.d.ts +1 -0
  78. package/dist/cjs/api/resources/network/resources/simSwap/client/requests/index.js +2 -0
  79. package/dist/cjs/api/resources/network/resources/simSwap/index.d.ts +1 -0
  80. package/dist/cjs/api/resources/network/resources/simSwap/index.js +17 -0
  81. package/dist/cjs/api/resources/network/resources/subscriberMatch/client/Client.d.ts +47 -0
  82. package/dist/cjs/api/resources/network/resources/subscriberMatch/client/Client.js +153 -0
  83. package/dist/cjs/api/resources/network/resources/subscriberMatch/client/index.d.ts +1 -0
  84. package/dist/cjs/api/resources/network/resources/subscriberMatch/client/index.js +17 -0
  85. package/dist/cjs/api/resources/network/resources/subscriberMatch/client/requests/SubscriberMatchRequest.d.ts +22 -0
  86. package/dist/cjs/api/resources/network/resources/subscriberMatch/client/requests/SubscriberMatchRequest.js +3 -0
  87. package/dist/cjs/api/resources/network/resources/subscriberMatch/client/requests/index.d.ts +1 -0
  88. package/dist/cjs/api/resources/network/resources/subscriberMatch/client/requests/index.js +2 -0
  89. package/dist/cjs/api/resources/network/resources/subscriberMatch/index.d.ts +1 -0
  90. package/dist/cjs/api/resources/network/resources/subscriberMatch/index.js +17 -0
  91. package/dist/cjs/api/resources/voiceStreams/index.d.ts +1 -0
  92. package/dist/cjs/api/resources/voiceStreams/index.js +17 -0
  93. package/dist/cjs/api/resources/voiceStreams/types/VoiceClientFrame.d.ts +10 -0
  94. package/dist/cjs/api/resources/voiceStreams/types/VoiceClientFrame.js +3 -0
  95. package/dist/cjs/api/resources/voiceStreams/types/VoiceClientMedia.d.ts +10 -0
  96. package/dist/cjs/api/resources/voiceStreams/types/VoiceClientMedia.js +3 -0
  97. package/dist/cjs/api/resources/voiceStreams/types/VoiceClientMediaFrame.d.ts +11 -0
  98. package/dist/cjs/api/resources/voiceStreams/types/VoiceClientMediaFrame.js +10 -0
  99. package/dist/cjs/api/resources/voiceStreams/types/VoiceCommandAckFrame.d.ts +22 -0
  100. package/dist/cjs/api/resources/voiceStreams/types/VoiceCommandAckFrame.js +14 -0
  101. package/dist/cjs/api/resources/voiceStreams/types/VoiceCommandAction.d.ts +15 -0
  102. package/dist/cjs/api/resources/voiceStreams/types/VoiceCommandAction.js +18 -0
  103. package/dist/cjs/api/resources/voiceStreams/types/VoiceCommandFrame.d.ts +15 -0
  104. package/dist/cjs/api/resources/voiceStreams/types/VoiceCommandFrame.js +10 -0
  105. package/dist/cjs/api/resources/voiceStreams/types/VoiceConnectedFrame.d.ts +11 -0
  106. package/dist/cjs/api/resources/voiceStreams/types/VoiceConnectedFrame.js +10 -0
  107. package/dist/cjs/api/resources/voiceStreams/types/VoiceEventFrame.d.ts +15 -0
  108. package/dist/cjs/api/resources/voiceStreams/types/VoiceEventFrame.js +10 -0
  109. package/dist/cjs/api/resources/voiceStreams/types/VoiceMediaTrack.d.ts +5 -0
  110. package/dist/cjs/api/resources/voiceStreams/types/VoiceMediaTrack.js +8 -0
  111. package/dist/cjs/api/resources/voiceStreams/types/VoiceServerFrame.d.ts +16 -0
  112. package/dist/cjs/api/resources/voiceStreams/types/VoiceServerFrame.js +3 -0
  113. package/dist/cjs/api/resources/voiceStreams/types/VoiceServerMedia.d.ts +10 -0
  114. package/dist/cjs/api/resources/voiceStreams/types/VoiceServerMedia.js +3 -0
  115. package/dist/cjs/api/resources/voiceStreams/types/VoiceServerMediaFrame.d.ts +13 -0
  116. package/dist/cjs/api/resources/voiceStreams/types/VoiceServerMediaFrame.js +10 -0
  117. package/dist/cjs/api/resources/voiceStreams/types/index.d.ts +12 -0
  118. package/dist/cjs/api/resources/voiceStreams/types/index.js +28 -0
  119. package/dist/cjs/api/types/AgentSummary.d.ts +2 -2
  120. package/dist/cjs/api/types/Call.d.ts +16 -0
  121. package/dist/cjs/api/types/Call.js +3 -0
  122. package/dist/cjs/api/types/CallDirection.d.ts +11 -0
  123. package/dist/cjs/api/types/CallDirection.js +14 -0
  124. package/dist/cjs/api/types/CallEvent.d.ts +15 -0
  125. package/dist/cjs/api/types/CallEvent.js +3 -0
  126. package/dist/cjs/api/types/CallEventSource.d.ts +8 -0
  127. package/dist/cjs/api/types/CallEventSource.js +11 -0
  128. package/dist/cjs/api/types/CallMetadata.d.ts +4 -0
  129. package/dist/cjs/api/types/CallMetadata.js +3 -0
  130. package/dist/cjs/api/types/CallState.d.ts +25 -0
  131. package/dist/cjs/api/types/CallState.js +28 -0
  132. package/dist/cjs/api/types/CallStatusEvent.d.ts +41 -0
  133. package/dist/cjs/api/types/CallStatusEvent.js +3 -0
  134. package/dist/cjs/api/types/CallStreamToken.d.ts +7 -0
  135. package/dist/cjs/api/types/CallStreamToken.js +3 -0
  136. package/dist/cjs/api/types/CreatedCall.d.ts +18 -0
  137. package/dist/cjs/api/types/CreatedCall.js +3 -0
  138. package/dist/cjs/api/types/E164PhoneNumber.d.ts +4 -0
  139. package/dist/cjs/api/types/E164PhoneNumber.js +3 -0
  140. package/dist/cjs/api/types/HostedSilentAuthResponse.d.ts +8 -0
  141. package/dist/cjs/api/types/HostedSilentAuthResponse.js +3 -0
  142. package/dist/cjs/api/types/JsonSilentAuthResponse.d.ts +8 -0
  143. package/dist/cjs/api/types/JsonSilentAuthResponse.js +3 -0
  144. package/dist/cjs/api/types/ListCallEventsResponse.d.ts +5 -0
  145. package/dist/cjs/api/types/ListCallEventsResponse.js +3 -0
  146. package/dist/cjs/api/types/ListCallsResponse.d.ts +5 -0
  147. package/dist/cjs/api/types/ListCallsResponse.js +3 -0
  148. package/dist/cjs/api/types/ListNetworkRequestsResponse.d.ts +8 -0
  149. package/dist/cjs/api/types/ListNetworkRequestsResponse.js +3 -0
  150. package/dist/cjs/api/types/NetworkInsightStatus.d.ts +8 -0
  151. package/dist/cjs/api/types/NetworkInsightStatus.js +11 -0
  152. package/dist/cjs/api/types/NetworkRequestId.d.ts +4 -0
  153. package/dist/cjs/api/types/NetworkRequestId.js +3 -0
  154. package/dist/cjs/api/types/NetworkRequestResult.d.ts +5 -0
  155. package/dist/cjs/api/types/NetworkRequestResult.js +3 -0
  156. package/dist/cjs/api/types/NetworkRequestStatus.d.ts +9 -0
  157. package/dist/cjs/api/types/NetworkRequestStatus.js +12 -0
  158. package/dist/cjs/api/types/NetworkRequestSummary.d.ts +19 -0
  159. package/dist/cjs/api/types/NetworkRequestSummary.js +3 -0
  160. package/dist/cjs/api/types/NetworkRequestType.d.ts +7 -0
  161. package/dist/cjs/api/types/NetworkRequestType.js +10 -0
  162. package/dist/cjs/api/types/RecordingDownload.d.ts +5 -0
  163. package/dist/cjs/api/types/RecordingDownload.js +3 -0
  164. package/dist/cjs/api/types/RecordingState.d.ts +15 -0
  165. package/dist/cjs/api/types/RecordingState.js +18 -0
  166. package/dist/cjs/api/types/SilentAuthCheckResponse.d.ts +14 -0
  167. package/dist/cjs/api/types/SilentAuthCheckResponse.js +12 -0
  168. package/dist/cjs/api/types/SilentAuthResponse.d.ts +10 -0
  169. package/dist/cjs/api/types/SilentAuthResponse.js +3 -0
  170. package/dist/cjs/api/types/SimSwapResponse.d.ts +9 -0
  171. package/dist/cjs/api/types/SimSwapResponse.js +3 -0
  172. package/dist/cjs/api/types/SubscriberMatchAttributes.d.ts +27 -0
  173. package/dist/cjs/api/types/SubscriberMatchAttributes.js +3 -0
  174. package/dist/cjs/api/types/SubscriberMatchResponse.d.ts +46 -0
  175. package/dist/cjs/api/types/SubscriberMatchResponse.js +3 -0
  176. package/dist/cjs/api/types/SubscriberMatchResult.d.ts +12 -0
  177. package/dist/cjs/api/types/SubscriberMatchResult.js +15 -0
  178. package/dist/cjs/api/types/WebhookEventEnum.d.ts +1 -0
  179. package/dist/cjs/api/types/WebhookEventEnum.js +1 -0
  180. package/dist/cjs/api/types/index.d.ts +29 -0
  181. package/dist/cjs/api/types/index.js +29 -0
  182. package/dist/cjs/index.d.ts +6 -1
  183. package/dist/cjs/index.js +12 -3
  184. package/dist/cjs/version.d.ts +1 -1
  185. package/dist/cjs/version.js +1 -1
  186. package/dist/cjs/wrapper/PinnacleClient.d.ts +4 -1
  187. package/dist/cjs/wrapper/PinnacleClient.js +17 -6
  188. package/dist/cjs/wrapper/messages/Client.d.ts +1 -1
  189. package/dist/cjs/wrapper/voice/Client.d.ts +34 -0
  190. package/dist/cjs/wrapper/voice/Client.js +147 -0
  191. package/dist/cjs/wrapper/voice/VoiceSocket.d.ts +98 -0
  192. package/dist/cjs/wrapper/voice/VoiceSocket.js +371 -0
  193. package/dist/cjs/wrapper/voice/types.d.ts +199 -0
  194. package/dist/cjs/wrapper/voice/types.js +35 -0
  195. package/dist/esm/Client.d.mts +6 -0
  196. package/dist/esm/Client.mjs +12 -2
  197. package/dist/esm/api/errors/BadGatewayError.d.mts +6 -0
  198. package/dist/esm/api/errors/BadGatewayError.mjs +13 -0
  199. package/dist/esm/api/errors/ConflictError.d.mts +6 -0
  200. package/dist/esm/api/errors/ConflictError.mjs +13 -0
  201. package/dist/esm/api/errors/GoneError.d.mts +6 -0
  202. package/dist/esm/api/errors/GoneError.mjs +13 -0
  203. package/dist/esm/api/errors/ServiceUnavailableError.d.mts +6 -0
  204. package/dist/esm/api/errors/ServiceUnavailableError.mjs +13 -0
  205. package/dist/esm/api/errors/TooEarlyError.d.mts +6 -0
  206. package/dist/esm/api/errors/TooEarlyError.mjs +13 -0
  207. package/dist/esm/api/errors/UnprocessableEntityError.d.mts +6 -0
  208. package/dist/esm/api/errors/UnprocessableEntityError.mjs +13 -0
  209. package/dist/esm/api/errors/index.d.mts +6 -0
  210. package/dist/esm/api/errors/index.mjs +6 -0
  211. package/dist/esm/api/resources/calls/client/Client.d.mts +181 -0
  212. package/dist/esm/api/resources/calls/client/Client.mjs +751 -0
  213. package/dist/esm/api/resources/calls/client/index.d.mts +1 -0
  214. package/dist/esm/api/resources/calls/client/index.mjs +1 -0
  215. package/dist/esm/api/resources/calls/client/requests/CallsDownloadRecordingRequest.d.mts +8 -0
  216. package/dist/esm/api/resources/calls/client/requests/CallsDownloadRecordingRequest.mjs +2 -0
  217. package/dist/esm/api/resources/calls/client/requests/CallsListEventsRequest.d.mts +10 -0
  218. package/dist/esm/api/resources/calls/client/requests/CallsListEventsRequest.mjs +2 -0
  219. package/dist/esm/api/resources/calls/client/requests/CallsListRequest.d.mts +17 -0
  220. package/dist/esm/api/resources/calls/client/requests/CallsListRequest.mjs +2 -0
  221. package/dist/esm/api/resources/calls/client/requests/CreateCallParams.d.mts +17 -0
  222. package/dist/esm/api/resources/calls/client/requests/CreateCallParams.mjs +2 -0
  223. package/dist/esm/api/resources/calls/client/requests/CreateStreamTokenParams.d.mts +12 -0
  224. package/dist/esm/api/resources/calls/client/requests/CreateStreamTokenParams.mjs +2 -0
  225. package/dist/esm/api/resources/calls/client/requests/UpdateCallParams.d.mts +12 -0
  226. package/dist/esm/api/resources/calls/client/requests/UpdateCallParams.mjs +2 -0
  227. package/dist/esm/api/resources/calls/client/requests/index.d.mts +6 -0
  228. package/dist/esm/api/resources/calls/client/requests/index.mjs +1 -0
  229. package/dist/esm/api/resources/calls/index.d.mts +1 -0
  230. package/dist/esm/api/resources/calls/index.mjs +1 -0
  231. package/dist/esm/api/resources/forms/client/Client.d.mts +1 -1
  232. package/dist/esm/api/resources/forms/client/Client.mjs +1 -1
  233. package/dist/esm/api/resources/index.d.mts +3 -0
  234. package/dist/esm/api/resources/index.mjs +3 -0
  235. package/dist/esm/api/resources/network/client/Client.d.mts +21 -0
  236. package/dist/esm/api/resources/network/client/Client.mjs +26 -0
  237. package/dist/esm/api/resources/network/client/index.d.mts +1 -0
  238. package/dist/esm/api/resources/network/client/index.mjs +1 -0
  239. package/dist/esm/api/resources/network/index.d.mts +2 -0
  240. package/dist/esm/api/resources/network/index.mjs +2 -0
  241. package/dist/esm/api/resources/network/resources/index.d.mts +8 -0
  242. package/dist/esm/api/resources/network/resources/index.mjs +8 -0
  243. package/dist/esm/api/resources/network/resources/requests/client/Client.d.mts +61 -0
  244. package/dist/esm/api/resources/network/resources/requests/client/Client.mjs +186 -0
  245. package/dist/esm/api/resources/network/resources/requests/client/index.d.mts +1 -0
  246. package/dist/esm/api/resources/network/resources/requests/client/index.mjs +1 -0
  247. package/dist/esm/api/resources/network/resources/requests/client/requests/ListNetworkRequestsParams.d.mts +21 -0
  248. package/dist/esm/api/resources/network/resources/requests/client/requests/ListNetworkRequestsParams.mjs +2 -0
  249. package/dist/esm/api/resources/network/resources/requests/client/requests/index.d.mts +1 -0
  250. package/dist/esm/api/resources/network/resources/requests/client/requests/index.mjs +1 -0
  251. package/dist/esm/api/resources/network/resources/requests/index.d.mts +1 -0
  252. package/dist/esm/api/resources/network/resources/requests/index.mjs +1 -0
  253. package/dist/esm/api/resources/network/resources/silentAuth/client/Client.d.mts +71 -0
  254. package/dist/esm/api/resources/network/resources/silentAuth/client/Client.mjs +197 -0
  255. package/dist/esm/api/resources/network/resources/silentAuth/client/index.d.mts +1 -0
  256. package/dist/esm/api/resources/network/resources/silentAuth/client/index.mjs +1 -0
  257. package/dist/esm/api/resources/network/resources/silentAuth/client/requests/SilentAuthCheckRequest.d.mts +10 -0
  258. package/dist/esm/api/resources/network/resources/silentAuth/client/requests/SilentAuthCheckRequest.mjs +2 -0
  259. package/dist/esm/api/resources/network/resources/silentAuth/client/requests/SilentAuthRequest.d.mts +34 -0
  260. package/dist/esm/api/resources/network/resources/silentAuth/client/requests/SilentAuthRequest.mjs +2 -0
  261. package/dist/esm/api/resources/network/resources/silentAuth/client/requests/index.d.mts +2 -0
  262. package/dist/esm/api/resources/network/resources/silentAuth/client/requests/index.mjs +1 -0
  263. package/dist/esm/api/resources/network/resources/silentAuth/index.d.mts +1 -0
  264. package/dist/esm/api/resources/network/resources/silentAuth/index.mjs +1 -0
  265. package/dist/esm/api/resources/network/resources/simSwap/client/Client.d.mts +37 -0
  266. package/dist/esm/api/resources/network/resources/simSwap/client/Client.mjs +106 -0
  267. package/dist/esm/api/resources/network/resources/simSwap/client/index.d.mts +1 -0
  268. package/dist/esm/api/resources/network/resources/simSwap/client/index.mjs +1 -0
  269. package/dist/esm/api/resources/network/resources/simSwap/client/requests/SimSwapRequest.d.mts +13 -0
  270. package/dist/esm/api/resources/network/resources/simSwap/client/requests/SimSwapRequest.mjs +2 -0
  271. package/dist/esm/api/resources/network/resources/simSwap/client/requests/index.d.mts +1 -0
  272. package/dist/esm/api/resources/network/resources/simSwap/client/requests/index.mjs +1 -0
  273. package/dist/esm/api/resources/network/resources/simSwap/index.d.mts +1 -0
  274. package/dist/esm/api/resources/network/resources/simSwap/index.mjs +1 -0
  275. package/dist/esm/api/resources/network/resources/subscriberMatch/client/Client.d.mts +47 -0
  276. package/dist/esm/api/resources/network/resources/subscriberMatch/client/Client.mjs +116 -0
  277. package/dist/esm/api/resources/network/resources/subscriberMatch/client/index.d.mts +1 -0
  278. package/dist/esm/api/resources/network/resources/subscriberMatch/client/index.mjs +1 -0
  279. package/dist/esm/api/resources/network/resources/subscriberMatch/client/requests/SubscriberMatchRequest.d.mts +22 -0
  280. package/dist/esm/api/resources/network/resources/subscriberMatch/client/requests/SubscriberMatchRequest.mjs +2 -0
  281. package/dist/esm/api/resources/network/resources/subscriberMatch/client/requests/index.d.mts +1 -0
  282. package/dist/esm/api/resources/network/resources/subscriberMatch/client/requests/index.mjs +1 -0
  283. package/dist/esm/api/resources/network/resources/subscriberMatch/index.d.mts +1 -0
  284. package/dist/esm/api/resources/network/resources/subscriberMatch/index.mjs +1 -0
  285. package/dist/esm/api/resources/voiceStreams/index.d.mts +1 -0
  286. package/dist/esm/api/resources/voiceStreams/index.mjs +1 -0
  287. package/dist/esm/api/resources/voiceStreams/types/VoiceClientFrame.d.mts +10 -0
  288. package/dist/esm/api/resources/voiceStreams/types/VoiceClientFrame.mjs +2 -0
  289. package/dist/esm/api/resources/voiceStreams/types/VoiceClientMedia.d.mts +10 -0
  290. package/dist/esm/api/resources/voiceStreams/types/VoiceClientMedia.mjs +2 -0
  291. package/dist/esm/api/resources/voiceStreams/types/VoiceClientMediaFrame.d.mts +11 -0
  292. package/dist/esm/api/resources/voiceStreams/types/VoiceClientMediaFrame.mjs +7 -0
  293. package/dist/esm/api/resources/voiceStreams/types/VoiceCommandAckFrame.d.mts +22 -0
  294. package/dist/esm/api/resources/voiceStreams/types/VoiceCommandAckFrame.mjs +11 -0
  295. package/dist/esm/api/resources/voiceStreams/types/VoiceCommandAction.d.mts +15 -0
  296. package/dist/esm/api/resources/voiceStreams/types/VoiceCommandAction.mjs +15 -0
  297. package/dist/esm/api/resources/voiceStreams/types/VoiceCommandFrame.d.mts +15 -0
  298. package/dist/esm/api/resources/voiceStreams/types/VoiceCommandFrame.mjs +7 -0
  299. package/dist/esm/api/resources/voiceStreams/types/VoiceConnectedFrame.d.mts +11 -0
  300. package/dist/esm/api/resources/voiceStreams/types/VoiceConnectedFrame.mjs +7 -0
  301. package/dist/esm/api/resources/voiceStreams/types/VoiceEventFrame.d.mts +15 -0
  302. package/dist/esm/api/resources/voiceStreams/types/VoiceEventFrame.mjs +7 -0
  303. package/dist/esm/api/resources/voiceStreams/types/VoiceMediaTrack.d.mts +5 -0
  304. package/dist/esm/api/resources/voiceStreams/types/VoiceMediaTrack.mjs +5 -0
  305. package/dist/esm/api/resources/voiceStreams/types/VoiceServerFrame.d.mts +16 -0
  306. package/dist/esm/api/resources/voiceStreams/types/VoiceServerFrame.mjs +2 -0
  307. package/dist/esm/api/resources/voiceStreams/types/VoiceServerMedia.d.mts +10 -0
  308. package/dist/esm/api/resources/voiceStreams/types/VoiceServerMedia.mjs +2 -0
  309. package/dist/esm/api/resources/voiceStreams/types/VoiceServerMediaFrame.d.mts +13 -0
  310. package/dist/esm/api/resources/voiceStreams/types/VoiceServerMediaFrame.mjs +7 -0
  311. package/dist/esm/api/resources/voiceStreams/types/index.d.mts +12 -0
  312. package/dist/esm/api/resources/voiceStreams/types/index.mjs +12 -0
  313. package/dist/esm/api/types/AgentSummary.d.mts +2 -2
  314. package/dist/esm/api/types/Call.d.mts +16 -0
  315. package/dist/esm/api/types/Call.mjs +2 -0
  316. package/dist/esm/api/types/CallDirection.d.mts +11 -0
  317. package/dist/esm/api/types/CallDirection.mjs +11 -0
  318. package/dist/esm/api/types/CallEvent.d.mts +15 -0
  319. package/dist/esm/api/types/CallEvent.mjs +2 -0
  320. package/dist/esm/api/types/CallEventSource.d.mts +8 -0
  321. package/dist/esm/api/types/CallEventSource.mjs +8 -0
  322. package/dist/esm/api/types/CallMetadata.d.mts +4 -0
  323. package/dist/esm/api/types/CallMetadata.mjs +2 -0
  324. package/dist/esm/api/types/CallState.d.mts +25 -0
  325. package/dist/esm/api/types/CallState.mjs +25 -0
  326. package/dist/esm/api/types/CallStatusEvent.d.mts +41 -0
  327. package/dist/esm/api/types/CallStatusEvent.mjs +2 -0
  328. package/dist/esm/api/types/CallStreamToken.d.mts +7 -0
  329. package/dist/esm/api/types/CallStreamToken.mjs +2 -0
  330. package/dist/esm/api/types/CreatedCall.d.mts +18 -0
  331. package/dist/esm/api/types/CreatedCall.mjs +2 -0
  332. package/dist/esm/api/types/E164PhoneNumber.d.mts +4 -0
  333. package/dist/esm/api/types/E164PhoneNumber.mjs +2 -0
  334. package/dist/esm/api/types/HostedSilentAuthResponse.d.mts +8 -0
  335. package/dist/esm/api/types/HostedSilentAuthResponse.mjs +2 -0
  336. package/dist/esm/api/types/JsonSilentAuthResponse.d.mts +8 -0
  337. package/dist/esm/api/types/JsonSilentAuthResponse.mjs +2 -0
  338. package/dist/esm/api/types/ListCallEventsResponse.d.mts +5 -0
  339. package/dist/esm/api/types/ListCallEventsResponse.mjs +2 -0
  340. package/dist/esm/api/types/ListCallsResponse.d.mts +5 -0
  341. package/dist/esm/api/types/ListCallsResponse.mjs +2 -0
  342. package/dist/esm/api/types/ListNetworkRequestsResponse.d.mts +8 -0
  343. package/dist/esm/api/types/ListNetworkRequestsResponse.mjs +2 -0
  344. package/dist/esm/api/types/NetworkInsightStatus.d.mts +8 -0
  345. package/dist/esm/api/types/NetworkInsightStatus.mjs +8 -0
  346. package/dist/esm/api/types/NetworkRequestId.d.mts +4 -0
  347. package/dist/esm/api/types/NetworkRequestId.mjs +2 -0
  348. package/dist/esm/api/types/NetworkRequestResult.d.mts +5 -0
  349. package/dist/esm/api/types/NetworkRequestResult.mjs +2 -0
  350. package/dist/esm/api/types/NetworkRequestStatus.d.mts +9 -0
  351. package/dist/esm/api/types/NetworkRequestStatus.mjs +9 -0
  352. package/dist/esm/api/types/NetworkRequestSummary.d.mts +19 -0
  353. package/dist/esm/api/types/NetworkRequestSummary.mjs +2 -0
  354. package/dist/esm/api/types/NetworkRequestType.d.mts +7 -0
  355. package/dist/esm/api/types/NetworkRequestType.mjs +7 -0
  356. package/dist/esm/api/types/RecordingDownload.d.mts +5 -0
  357. package/dist/esm/api/types/RecordingDownload.mjs +2 -0
  358. package/dist/esm/api/types/RecordingState.d.mts +15 -0
  359. package/dist/esm/api/types/RecordingState.mjs +15 -0
  360. package/dist/esm/api/types/SilentAuthCheckResponse.d.mts +14 -0
  361. package/dist/esm/api/types/SilentAuthCheckResponse.mjs +9 -0
  362. package/dist/esm/api/types/SilentAuthResponse.d.mts +10 -0
  363. package/dist/esm/api/types/SilentAuthResponse.mjs +2 -0
  364. package/dist/esm/api/types/SimSwapResponse.d.mts +9 -0
  365. package/dist/esm/api/types/SimSwapResponse.mjs +2 -0
  366. package/dist/esm/api/types/SubscriberMatchAttributes.d.mts +27 -0
  367. package/dist/esm/api/types/SubscriberMatchAttributes.mjs +2 -0
  368. package/dist/esm/api/types/SubscriberMatchResponse.d.mts +46 -0
  369. package/dist/esm/api/types/SubscriberMatchResponse.mjs +2 -0
  370. package/dist/esm/api/types/SubscriberMatchResult.d.mts +12 -0
  371. package/dist/esm/api/types/SubscriberMatchResult.mjs +12 -0
  372. package/dist/esm/api/types/WebhookEventEnum.d.mts +1 -0
  373. package/dist/esm/api/types/WebhookEventEnum.mjs +1 -0
  374. package/dist/esm/api/types/index.d.mts +29 -0
  375. package/dist/esm/api/types/index.mjs +29 -0
  376. package/dist/esm/index.d.mts +6 -1
  377. package/dist/esm/index.mjs +4 -1
  378. package/dist/esm/version.d.mts +1 -1
  379. package/dist/esm/version.mjs +1 -1
  380. package/dist/esm/wrapper/PinnacleClient.d.mts +4 -1
  381. package/dist/esm/wrapper/PinnacleClient.mjs +16 -5
  382. package/dist/esm/wrapper/messages/Client.d.mts +1 -1
  383. package/dist/esm/wrapper/voice/Client.d.mts +34 -0
  384. package/dist/esm/wrapper/voice/Client.mjs +143 -0
  385. package/dist/esm/wrapper/voice/VoiceSocket.d.mts +98 -0
  386. package/dist/esm/wrapper/voice/VoiceSocket.mjs +366 -0
  387. package/dist/esm/wrapper/voice/types.d.mts +199 -0
  388. package/dist/esm/wrapper/voice/types.mjs +32 -0
  389. package/package.json +9 -8
@@ -0,0 +1,371 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.VoiceSocket = void 0;
13
+ exports.createVoiceCommandId = createVoiceCommandId;
14
+ const types_js_1 = require("./types.js");
15
+ class VoiceSocket {
16
+ constructor(socket, options = {}) {
17
+ this.listeners = new Map();
18
+ this.pendingAcks = new Map();
19
+ this.closedByUser = false;
20
+ this.reconnectAttempts = 0;
21
+ this.socket_ = socket;
22
+ this.createSocket = options.createSocket;
23
+ this.reconnect = normalizeReconnectOptions(options.reconnect);
24
+ this.bindSocket();
25
+ }
26
+ get socket() {
27
+ return this.socket_;
28
+ }
29
+ get readyState() {
30
+ return this.socket.readyState;
31
+ }
32
+ get isOpen() {
33
+ return this.socket.readyState === 1;
34
+ }
35
+ waitUntilOpen(timeoutMs = 10000) {
36
+ if (this.isOpen) {
37
+ return Promise.resolve();
38
+ }
39
+ return new Promise((resolve, reject) => {
40
+ const timeout = timeoutMs > 0
41
+ ? setTimeout(() => {
42
+ cleanup();
43
+ reject(new Error("Timed out waiting for voice socket to open."));
44
+ }, timeoutMs)
45
+ : undefined;
46
+ const cleanup = () => {
47
+ if (timeout !== undefined) {
48
+ clearTimeout(timeout);
49
+ }
50
+ offOpen();
51
+ offClose();
52
+ offError();
53
+ };
54
+ const offOpen = this.on("open", () => {
55
+ cleanup();
56
+ resolve();
57
+ });
58
+ const offClose = this.on("close", () => {
59
+ cleanup();
60
+ reject(new Error("Voice socket closed before opening."));
61
+ });
62
+ const offError = this.on("error", (error) => {
63
+ cleanup();
64
+ reject(toError(error));
65
+ });
66
+ });
67
+ }
68
+ connect() {
69
+ return __awaiter(this, void 0, void 0, function* () {
70
+ yield this.waitUntilOpen();
71
+ });
72
+ }
73
+ bindSocket() {
74
+ this.bind("open", (event) => this.emit("open", event));
75
+ this.bind("close", (event) => {
76
+ this.rejectPendingAcks(new Error("Voice socket closed before an ack was received."));
77
+ this.emit("close", event);
78
+ this.scheduleReconnect();
79
+ });
80
+ this.bind("error", (event) => this.emit("error", event));
81
+ this.bind("message", (event) => this.handleMessage(event.data));
82
+ }
83
+ on(event, listener) {
84
+ var _a;
85
+ const listeners = (_a = this.listeners.get(event)) !== null && _a !== void 0 ? _a : new Set();
86
+ listeners.add(listener);
87
+ this.listeners.set(event, listeners);
88
+ return () => {
89
+ listeners.delete(listener);
90
+ if (listeners.size === 0) {
91
+ this.listeners.delete(event);
92
+ }
93
+ };
94
+ }
95
+ send(frame) {
96
+ this.socket.send(JSON.stringify(frame));
97
+ }
98
+ command(frame) {
99
+ this.send(frame);
100
+ return frame.command_id;
101
+ }
102
+ commandAndWait(frame_1) {
103
+ return __awaiter(this, arguments, void 0, function* (frame, options = {}) {
104
+ const ack = this.waitForAck(frame.command_id, options);
105
+ this.command(frame);
106
+ return ack;
107
+ });
108
+ }
109
+ answer(params, commandId = createVoiceCommandId()) {
110
+ return this.command(withOptionalParams({ event: "command", command_id: commandId, action: "call.answer" }, params));
111
+ }
112
+ end(params, commandId = createVoiceCommandId()) {
113
+ return this.command(withOptionalParams({ event: "command", command_id: commandId, action: "call.end" }, params));
114
+ }
115
+ transfer(params, commandId = createVoiceCommandId()) {
116
+ return this.command({
117
+ event: "command",
118
+ command_id: commandId,
119
+ action: types_js_1.VoiceCommandAction.CallTransfer,
120
+ params,
121
+ });
122
+ }
123
+ startRecording(commandId = createVoiceCommandId()) {
124
+ return this.command({
125
+ event: "command",
126
+ command_id: commandId,
127
+ action: types_js_1.VoiceCommandAction.RecordingStart,
128
+ });
129
+ }
130
+ stopRecording(commandId = createVoiceCommandId()) {
131
+ return this.command({
132
+ event: "command",
133
+ command_id: commandId,
134
+ action: types_js_1.VoiceCommandAction.RecordingStop,
135
+ });
136
+ }
137
+ playAudio(params, commandId = createVoiceCommandId()) {
138
+ return this.command({
139
+ event: "command",
140
+ command_id: commandId,
141
+ action: types_js_1.VoiceCommandAction.AudioPlay,
142
+ params,
143
+ });
144
+ }
145
+ stopAudio(commandId = createVoiceCommandId()) {
146
+ return this.command({
147
+ event: "command",
148
+ command_id: commandId,
149
+ action: types_js_1.VoiceCommandAction.AudioStop,
150
+ });
151
+ }
152
+ reduceNoise(params, commandId = createVoiceCommandId()) {
153
+ return this.command({
154
+ event: "command",
155
+ command_id: commandId,
156
+ action: types_js_1.VoiceCommandAction.AudioReduceNoise,
157
+ params,
158
+ });
159
+ }
160
+ getInput(params, commandId = createVoiceCommandId()) {
161
+ return this.command(withOptionalParams({ event: "command", command_id: commandId, action: "input.get" }, params));
162
+ }
163
+ cancelInput(commandId = createVoiceCommandId()) {
164
+ return this.command({
165
+ event: "command",
166
+ command_id: commandId,
167
+ action: types_js_1.VoiceCommandAction.InputCancel,
168
+ });
169
+ }
170
+ sendDtmf(params, commandId = createVoiceCommandId()) {
171
+ return this.command({
172
+ event: "command",
173
+ command_id: commandId,
174
+ action: types_js_1.VoiceCommandAction.DtmfSend,
175
+ params,
176
+ });
177
+ }
178
+ updateState(params, commandId = createVoiceCommandId()) {
179
+ return this.command({
180
+ event: "command",
181
+ command_id: commandId,
182
+ action: types_js_1.VoiceCommandAction.CallUpdateState,
183
+ params,
184
+ });
185
+ }
186
+ sendMedia(media) {
187
+ this.send({ event: "media", media });
188
+ }
189
+ waitForAck(commandId, options = {}) {
190
+ const existing = this.pendingAcks.get(commandId);
191
+ if (existing !== undefined) {
192
+ throw new Error(`Already waiting for ack ${commandId}.`);
193
+ }
194
+ return new Promise((resolve, reject) => {
195
+ var _a;
196
+ const timeoutMs = (_a = options.timeoutMs) !== null && _a !== void 0 ? _a : 10000;
197
+ const pending = {
198
+ resolve,
199
+ reject,
200
+ timeout: timeoutMs > 0
201
+ ? setTimeout(() => {
202
+ this.pendingAcks.delete(commandId);
203
+ reject(new Error(`Timed out waiting for ack ${commandId}.`));
204
+ }, timeoutMs)
205
+ : undefined,
206
+ };
207
+ this.pendingAcks.set(commandId, pending);
208
+ });
209
+ }
210
+ close(code, reason) {
211
+ this.closedByUser = true;
212
+ if (this.reconnectTimer !== undefined) {
213
+ clearTimeout(this.reconnectTimer);
214
+ this.reconnectTimer = undefined;
215
+ }
216
+ this.socket.close(code, reason);
217
+ }
218
+ reconnectNow() {
219
+ return __awaiter(this, void 0, void 0, function* () {
220
+ if (this.createSocket === undefined) {
221
+ throw new Error("Voice socket was not configured with a reconnect factory.");
222
+ }
223
+ if (this.reconnectPromise !== undefined) {
224
+ return this.reconnectPromise;
225
+ }
226
+ this.reconnectPromise = Promise.resolve()
227
+ .then(() => { var _a; return (_a = this.createSocket) === null || _a === void 0 ? void 0 : _a.call(this); })
228
+ .then((socket) => {
229
+ if (socket === undefined) {
230
+ throw new Error("Voice socket reconnect factory did not return a socket.");
231
+ }
232
+ this.closedByUser = false;
233
+ this.socket_ = socket;
234
+ this.bindSocket();
235
+ this.reconnectAttempts = 0;
236
+ this.emit("reconnected", socket);
237
+ return this;
238
+ })
239
+ .finally(() => {
240
+ this.reconnectPromise = undefined;
241
+ });
242
+ return this.reconnectPromise;
243
+ });
244
+ }
245
+ bind(type, listener) {
246
+ if (this.socket.addEventListener !== undefined) {
247
+ this.socket.addEventListener(type, listener);
248
+ return;
249
+ }
250
+ if (type === "open") {
251
+ this.socket.onopen = listener;
252
+ }
253
+ else if (type === "message") {
254
+ this.socket.onmessage = listener;
255
+ }
256
+ else if (type === "error") {
257
+ this.socket.onerror = listener;
258
+ }
259
+ else if (type === "close") {
260
+ this.socket.onclose = listener;
261
+ }
262
+ }
263
+ handleMessage(data) {
264
+ try {
265
+ const frame = parseVoiceFrame(data);
266
+ this.emit("frame", frame);
267
+ if (frame.event === "ack") {
268
+ this.resolvePendingAck(frame);
269
+ this.emit("ack", frame);
270
+ }
271
+ else if (frame.event === "event") {
272
+ this.emit("event", frame);
273
+ }
274
+ else if (frame.event === "media") {
275
+ this.emit("media", frame);
276
+ }
277
+ else if (frame.event === "connected") {
278
+ return;
279
+ }
280
+ else {
281
+ throw new Error("Voice socket received an unknown frame event.");
282
+ }
283
+ }
284
+ catch (error) {
285
+ this.emit("error", error);
286
+ }
287
+ }
288
+ resolvePendingAck(ack) {
289
+ const pending = this.pendingAcks.get(ack.command_id);
290
+ if (pending === undefined) {
291
+ return;
292
+ }
293
+ this.pendingAcks.delete(ack.command_id);
294
+ if (pending.timeout !== undefined) {
295
+ clearTimeout(pending.timeout);
296
+ }
297
+ pending.resolve(ack);
298
+ }
299
+ rejectPendingAcks(error) {
300
+ for (const [commandId, pending] of this.pendingAcks.entries()) {
301
+ this.pendingAcks.delete(commandId);
302
+ if (pending.timeout !== undefined) {
303
+ clearTimeout(pending.timeout);
304
+ }
305
+ pending.reject(error);
306
+ }
307
+ }
308
+ emit(event, payload) {
309
+ var _a;
310
+ for (const listener of (_a = this.listeners.get(event)) !== null && _a !== void 0 ? _a : []) {
311
+ listener(payload);
312
+ }
313
+ }
314
+ scheduleReconnect() {
315
+ if (this.closedByUser || !this.reconnect.enabled || this.createSocket === undefined) {
316
+ return;
317
+ }
318
+ if (this.reconnectTimer !== undefined || this.reconnectPromise !== undefined) {
319
+ return;
320
+ }
321
+ if (this.reconnectAttempts >= this.reconnect.maxAttempts) {
322
+ this.emit("error", new Error("Voice socket reconnect attempts exhausted."));
323
+ return;
324
+ }
325
+ this.reconnectAttempts += 1;
326
+ const delayMs = getReconnectDelay(this.reconnect, this.reconnectAttempts);
327
+ this.emit("reconnecting", { attempt: this.reconnectAttempts, delayMs });
328
+ this.reconnectTimer = setTimeout(() => {
329
+ this.reconnectTimer = undefined;
330
+ void this.reconnectNow().catch((error) => {
331
+ this.emit("error", error);
332
+ this.scheduleReconnect();
333
+ });
334
+ }, delayMs);
335
+ }
336
+ }
337
+ exports.VoiceSocket = VoiceSocket;
338
+ function createVoiceCommandId() {
339
+ const random = typeof crypto !== "undefined" && "randomUUID" in crypto
340
+ ? crypto.randomUUID()
341
+ : `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
342
+ return `cmd_${random}`;
343
+ }
344
+ function parseVoiceFrame(data) {
345
+ if (typeof data !== "string") {
346
+ throw new Error("Voice socket received a non-string frame.");
347
+ }
348
+ return JSON.parse(data);
349
+ }
350
+ function withOptionalParams(frame, params) {
351
+ if (params === undefined) {
352
+ return frame;
353
+ }
354
+ return Object.assign(Object.assign({}, frame), { params });
355
+ }
356
+ function normalizeReconnectOptions(options = {}) {
357
+ var _a, _b, _c, _d, _e;
358
+ return {
359
+ enabled: (_a = options.enabled) !== null && _a !== void 0 ? _a : false,
360
+ maxAttempts: (_b = options.maxAttempts) !== null && _b !== void 0 ? _b : 5,
361
+ initialDelayMs: (_c = options.initialDelayMs) !== null && _c !== void 0 ? _c : 250,
362
+ maxDelayMs: (_d = options.maxDelayMs) !== null && _d !== void 0 ? _d : 5000,
363
+ backoffMultiplier: (_e = options.backoffMultiplier) !== null && _e !== void 0 ? _e : 2,
364
+ };
365
+ }
366
+ function getReconnectDelay(options, attempt) {
367
+ return Math.min(options.initialDelayMs * Math.pow(options.backoffMultiplier, Math.max(0, attempt - 1)), options.maxDelayMs);
368
+ }
369
+ function toError(error) {
370
+ return error instanceof Error ? error : new Error("Voice socket error.");
371
+ }
@@ -0,0 +1,199 @@
1
+ export declare const VoiceCommandAction: {
2
+ readonly CallAnswer: "call.answer";
3
+ readonly CallEnd: "call.end";
4
+ readonly CallTransfer: "call.transfer";
5
+ readonly RecordingStart: "recording.start";
6
+ readonly RecordingStop: "recording.stop";
7
+ readonly AudioPlay: "audio.play";
8
+ readonly AudioStop: "audio.stop";
9
+ readonly AudioReduceNoise: "audio.reduce_noise";
10
+ readonly InputGet: "input.get";
11
+ readonly InputCancel: "input.cancel";
12
+ readonly DtmfSend: "dtmf.send";
13
+ readonly CallUpdateState: "call.update_state";
14
+ };
15
+ export type VoiceCommandAction = (typeof VoiceCommandAction)[keyof typeof VoiceCommandAction];
16
+ export declare const VoiceCallEndCause: {
17
+ readonly UserBusy: "user_busy";
18
+ readonly CallRejected: "call_rejected";
19
+ };
20
+ export type VoiceCallEndCause = (typeof VoiceCallEndCause)[keyof typeof VoiceCallEndCause];
21
+ export declare const VoiceNoiseReductionEngine: {
22
+ readonly Default: "default";
23
+ readonly Krisp: "krisp";
24
+ readonly AiCoustics: "aicoustics";
25
+ };
26
+ export type VoiceNoiseReductionEngine = (typeof VoiceNoiseReductionEngine)[keyof typeof VoiceNoiseReductionEngine];
27
+ export declare const VoiceNoiseReductionDirection: {
28
+ readonly Inbound: "inbound";
29
+ readonly Outbound: "outbound";
30
+ readonly Both: "both";
31
+ };
32
+ export type VoiceNoiseReductionDirection = (typeof VoiceNoiseReductionDirection)[keyof typeof VoiceNoiseReductionDirection];
33
+ export declare const VoiceMediaTrack: {
34
+ readonly Inbound: "inbound";
35
+ readonly Outbound: "outbound";
36
+ };
37
+ export type VoiceMediaTrack = (typeof VoiceMediaTrack)[keyof typeof VoiceMediaTrack];
38
+ export type VoiceCallMetadata = Record<string, string>;
39
+ export interface VoiceCallAnswerCommandParams {
40
+ as?: string;
41
+ }
42
+ export interface VoiceCallEndCommandParams {
43
+ cause?: VoiceCallEndCause;
44
+ }
45
+ export interface VoiceCallTransferDialParams {
46
+ to: string;
47
+ from?: string;
48
+ as?: string;
49
+ custom_headers?: Record<string, string>;
50
+ }
51
+ export interface VoiceCallTransferBridgeParams {
52
+ /** Pinnacle call ID. Provider call-control IDs are not accepted. */
53
+ call_id: string;
54
+ as?: string;
55
+ }
56
+ export type VoiceCallTransferCommandParams = VoiceCallTransferDialParams | VoiceCallTransferBridgeParams;
57
+ export type VoiceAudioPlayCommandParams = {
58
+ url: string;
59
+ loop?: number;
60
+ overlay?: boolean;
61
+ } | {
62
+ text: string;
63
+ voice?: string;
64
+ language?: string;
65
+ };
66
+ export interface VoiceAudioReduceNoiseCommandParams {
67
+ enabled: boolean;
68
+ engine?: VoiceNoiseReductionEngine;
69
+ direction?: VoiceNoiseReductionDirection;
70
+ }
71
+ export type VoicePrompt = {
72
+ url: string;
73
+ } | {
74
+ text: string;
75
+ voice?: string;
76
+ language?: string;
77
+ };
78
+ export interface VoiceAiExtraction {
79
+ extract: Record<string, unknown>;
80
+ instructions?: string;
81
+ }
82
+ export interface VoiceInputGetCommandParams {
83
+ prompt?: VoicePrompt;
84
+ maxDigits?: number;
85
+ minDigits?: number;
86
+ terminatingDigit?: string;
87
+ validDigits?: string;
88
+ timeoutMs?: number;
89
+ interDigitTimeoutMs?: number;
90
+ ai?: VoiceAiExtraction;
91
+ }
92
+ export interface VoiceDtmfSendCommandParams {
93
+ digits: string;
94
+ duration_ms?: number;
95
+ }
96
+ export interface VoiceCallUpdateStateCommandParams {
97
+ metadata: VoiceCallMetadata;
98
+ }
99
+ export type VoiceCommandFrame = {
100
+ event: "command";
101
+ command_id: string;
102
+ action: "call.answer";
103
+ params?: VoiceCallAnswerCommandParams;
104
+ } | {
105
+ event: "command";
106
+ command_id: string;
107
+ action: "call.end";
108
+ params?: VoiceCallEndCommandParams;
109
+ } | {
110
+ event: "command";
111
+ command_id: string;
112
+ action: "call.transfer";
113
+ params: VoiceCallTransferCommandParams;
114
+ } | {
115
+ event: "command";
116
+ command_id: string;
117
+ action: "recording.start";
118
+ params?: undefined;
119
+ } | {
120
+ event: "command";
121
+ command_id: string;
122
+ action: "recording.stop";
123
+ params?: undefined;
124
+ } | {
125
+ event: "command";
126
+ command_id: string;
127
+ action: "audio.play";
128
+ params: VoiceAudioPlayCommandParams;
129
+ } | {
130
+ event: "command";
131
+ command_id: string;
132
+ action: "audio.stop";
133
+ params?: undefined;
134
+ } | {
135
+ event: "command";
136
+ command_id: string;
137
+ action: "audio.reduce_noise";
138
+ params: VoiceAudioReduceNoiseCommandParams;
139
+ } | {
140
+ event: "command";
141
+ command_id: string;
142
+ action: "input.get";
143
+ params?: VoiceInputGetCommandParams;
144
+ } | {
145
+ event: "command";
146
+ command_id: string;
147
+ action: "input.cancel";
148
+ params?: undefined;
149
+ } | {
150
+ event: "command";
151
+ command_id: string;
152
+ action: "dtmf.send";
153
+ params: VoiceDtmfSendCommandParams;
154
+ } | {
155
+ event: "command";
156
+ command_id: string;
157
+ action: "call.update_state";
158
+ params: VoiceCallUpdateStateCommandParams;
159
+ };
160
+ export interface VoiceClientMedia {
161
+ track?: VoiceMediaTrack;
162
+ payload: string;
163
+ chunk?: number;
164
+ timestamp?: string;
165
+ }
166
+ export interface VoiceClientMediaFrame {
167
+ event: "media";
168
+ media: VoiceClientMedia;
169
+ }
170
+ export type VoiceClientFrame = VoiceCommandFrame | VoiceClientMediaFrame;
171
+ export interface VoiceCommandAckFrame {
172
+ event: "ack";
173
+ command_id: string;
174
+ action: VoiceCommandAction;
175
+ status: "ok" | "error";
176
+ message?: string;
177
+ [key: string]: unknown;
178
+ }
179
+ export interface VoiceConnectedFrame {
180
+ event: "connected";
181
+ stream_sid: string;
182
+ sequence_number?: number;
183
+ }
184
+ export interface VoiceServerEventFrame {
185
+ event: "event";
186
+ type: string;
187
+ stream_sid: string;
188
+ call_session_id?: string;
189
+ sequence_number: number;
190
+ payload: Record<string, unknown>;
191
+ }
192
+ export interface VoiceServerMediaFrame {
193
+ event: "media";
194
+ stream_sid?: string;
195
+ call_session_id?: string;
196
+ sequence_number?: number;
197
+ media: VoiceClientMedia;
198
+ }
199
+ export type VoiceServerFrame = VoiceConnectedFrame | VoiceCommandAckFrame | VoiceServerEventFrame | VoiceServerMediaFrame;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VoiceMediaTrack = exports.VoiceNoiseReductionDirection = exports.VoiceNoiseReductionEngine = exports.VoiceCallEndCause = exports.VoiceCommandAction = void 0;
4
+ exports.VoiceCommandAction = {
5
+ CallAnswer: "call.answer",
6
+ CallEnd: "call.end",
7
+ CallTransfer: "call.transfer",
8
+ RecordingStart: "recording.start",
9
+ RecordingStop: "recording.stop",
10
+ AudioPlay: "audio.play",
11
+ AudioStop: "audio.stop",
12
+ AudioReduceNoise: "audio.reduce_noise",
13
+ InputGet: "input.get",
14
+ InputCancel: "input.cancel",
15
+ DtmfSend: "dtmf.send",
16
+ CallUpdateState: "call.update_state",
17
+ };
18
+ exports.VoiceCallEndCause = {
19
+ UserBusy: "user_busy",
20
+ CallRejected: "call_rejected",
21
+ };
22
+ exports.VoiceNoiseReductionEngine = {
23
+ Default: "default",
24
+ Krisp: "krisp",
25
+ AiCoustics: "aicoustics",
26
+ };
27
+ exports.VoiceNoiseReductionDirection = {
28
+ Inbound: "inbound",
29
+ Outbound: "outbound",
30
+ Both: "both",
31
+ };
32
+ exports.VoiceMediaTrack = {
33
+ Inbound: "inbound",
34
+ Outbound: "outbound",
35
+ };
@@ -1,10 +1,12 @@
1
1
  import { Audiences } from "./api/resources/audiences/client/Client.mjs";
2
2
  import { Brands } from "./api/resources/brands/client/Client.mjs";
3
+ import { Calls } from "./api/resources/calls/client/Client.mjs";
3
4
  import { Campaigns } from "./api/resources/campaigns/client/Client.mjs";
4
5
  import { Contacts } from "./api/resources/contacts/client/Client.mjs";
5
6
  import { Conversations } from "./api/resources/conversations/client/Client.mjs";
6
7
  import { Forms } from "./api/resources/forms/client/Client.mjs";
7
8
  import { Messages } from "./api/resources/messages/client/Client.mjs";
9
+ import { Network } from "./api/resources/network/client/Client.mjs";
8
10
  import { PhoneNumbers } from "./api/resources/phoneNumbers/client/Client.mjs";
9
11
  import { Rcs } from "./api/resources/rcs/client/Client.mjs";
10
12
  import { Status } from "./api/resources/status/client/Client.mjs";
@@ -27,8 +29,10 @@ export declare class PinnacleClient {
27
29
  protected _phoneNumbers: PhoneNumbers | undefined;
28
30
  protected _rcs: Rcs | undefined;
29
31
  protected _webhooks: Webhooks | undefined;
32
+ protected _calls: Calls | undefined;
30
33
  protected _forms: Forms | undefined;
31
34
  protected _campaigns: Campaigns | undefined;
35
+ protected _network: Network | undefined;
32
36
  protected _status: Status | undefined;
33
37
  protected _tools: Tools | undefined;
34
38
  constructor(_options: PinnacleClient.Options);
@@ -40,8 +44,10 @@ export declare class PinnacleClient {
40
44
  get phoneNumbers(): PhoneNumbers;
41
45
  get rcs(): Rcs;
42
46
  get webhooks(): Webhooks;
47
+ get calls(): Calls;
43
48
  get forms(): Forms;
44
49
  get campaigns(): Campaigns;
50
+ get network(): Network;
45
51
  get status(): Status;
46
52
  get tools(): Tools;
47
53
  }
@@ -1,11 +1,13 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
2
  import { Audiences } from "./api/resources/audiences/client/Client.mjs";
3
3
  import { Brands } from "./api/resources/brands/client/Client.mjs";
4
+ import { Calls } from "./api/resources/calls/client/Client.mjs";
4
5
  import { Campaigns } from "./api/resources/campaigns/client/Client.mjs";
5
6
  import { Contacts } from "./api/resources/contacts/client/Client.mjs";
6
7
  import { Conversations } from "./api/resources/conversations/client/Client.mjs";
7
8
  import { Forms } from "./api/resources/forms/client/Client.mjs";
8
9
  import { Messages } from "./api/resources/messages/client/Client.mjs";
10
+ import { Network } from "./api/resources/network/client/Client.mjs";
9
11
  import { PhoneNumbers } from "./api/resources/phoneNumbers/client/Client.mjs";
10
12
  import { Rcs } from "./api/resources/rcs/client/Client.mjs";
11
13
  import { Status } from "./api/resources/status/client/Client.mjs";
@@ -18,8 +20,8 @@ export class PinnacleClient {
18
20
  this._options = Object.assign(Object.assign({}, _options), { logging: core.logging.createLogger(_options === null || _options === void 0 ? void 0 : _options.logging), headers: mergeHeaders({
19
21
  "X-Fern-Language": "JavaScript",
20
22
  "X-Fern-SDK-Name": "rcs-js",
21
- "X-Fern-SDK-Version": "2.0.21",
22
- "User-Agent": "rcs-js/2.0.21",
23
+ "X-Fern-SDK-Version": "2.0.23-rc.1",
24
+ "User-Agent": "rcs-js/2.0.23-rc.1",
23
25
  "X-Fern-Runtime": core.RUNTIME.type,
24
26
  "X-Fern-Runtime-Version": core.RUNTIME.version,
25
27
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -56,6 +58,10 @@ export class PinnacleClient {
56
58
  var _a;
57
59
  return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Webhooks(this._options)));
58
60
  }
61
+ get calls() {
62
+ var _a;
63
+ return ((_a = this._calls) !== null && _a !== void 0 ? _a : (this._calls = new Calls(this._options)));
64
+ }
59
65
  get forms() {
60
66
  var _a;
61
67
  return ((_a = this._forms) !== null && _a !== void 0 ? _a : (this._forms = new Forms(this._options)));
@@ -64,6 +70,10 @@ export class PinnacleClient {
64
70
  var _a;
65
71
  return ((_a = this._campaigns) !== null && _a !== void 0 ? _a : (this._campaigns = new Campaigns(this._options)));
66
72
  }
73
+ get network() {
74
+ var _a;
75
+ return ((_a = this._network) !== null && _a !== void 0 ? _a : (this._network = new Network(this._options)));
76
+ }
67
77
  get status() {
68
78
  var _a;
69
79
  return ((_a = this._status) !== null && _a !== void 0 ? _a : (this._status = new Status(this._options)));
@@ -0,0 +1,6 @@
1
+ import type * as core from "../../core/index.mjs";
2
+ import * as errors from "../../errors/index.mjs";
3
+ import type * as Pinnacle from "../index.mjs";
4
+ export declare class BadGatewayError extends errors.PinnacleError {
5
+ constructor(body: Pinnacle.Error_, rawResponse?: core.RawResponse);
6
+ }