@azure/communication-call-automation 1.6.0-alpha.20250711.2 → 1.6.0-beta.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 (477) hide show
  1. package/README.md +0 -48
  2. package/dist/browser/callAutomationClient.d.ts +0 -8
  3. package/dist/browser/callAutomationClient.d.ts.map +1 -1
  4. package/dist/browser/callAutomationClient.js +87 -141
  5. package/dist/browser/callAutomationClient.js.map +1 -1
  6. package/dist/browser/callAutomationEventParser.d.ts.map +1 -1
  7. package/dist/browser/callAutomationEventParser.js +22 -54
  8. package/dist/browser/callAutomationEventParser.js.map +1 -1
  9. package/dist/browser/callConnection.d.ts +12 -14
  10. package/dist/browser/callConnection.d.ts.map +1 -1
  11. package/dist/browser/callConnection.js +111 -183
  12. package/dist/browser/callConnection.js.map +1 -1
  13. package/dist/browser/callMedia.d.ts +15 -20
  14. package/dist/browser/callMedia.d.ts.map +1 -1
  15. package/dist/browser/callMedia.js +58 -177
  16. package/dist/browser/callMedia.js.map +1 -1
  17. package/dist/browser/callRecording.d.ts +2 -8
  18. package/dist/browser/callRecording.d.ts.map +1 -1
  19. package/dist/browser/callRecording.js +16 -26
  20. package/dist/browser/callRecording.js.map +1 -1
  21. package/dist/browser/contentDownloader.js +11 -12
  22. package/dist/browser/contentDownloader.js.map +1 -1
  23. package/dist/browser/credential/callAutomationAccessKeyCredentialPolicy.js +1 -2
  24. package/dist/browser/credential/callAutomationAccessKeyCredentialPolicy.js.map +1 -1
  25. package/dist/browser/credential/callAutomationAuthPolicy.js +1 -1
  26. package/dist/browser/credential/callAutomationAuthPolicy.js.map +1 -1
  27. package/dist/browser/credential/cryptoUtils-browser.mjs.map +1 -1
  28. package/dist/browser/credential/cryptoUtils.js +1 -2
  29. package/dist/browser/generated/src/callAutomationApiClient.d.ts +1 -2
  30. package/dist/browser/generated/src/callAutomationApiClient.d.ts.map +1 -1
  31. package/dist/browser/generated/src/callAutomationApiClient.js +14 -6
  32. package/dist/browser/generated/src/callAutomationApiClient.js.map +1 -1
  33. package/dist/browser/generated/src/models/index.d.ts +534 -1064
  34. package/dist/browser/generated/src/models/index.d.ts.map +1 -1
  35. package/dist/browser/generated/src/models/index.js +87 -159
  36. package/dist/browser/generated/src/models/index.js.map +1 -1
  37. package/dist/browser/generated/src/models/mappers.d.ts +58 -86
  38. package/dist/browser/generated/src/models/mappers.d.ts.map +1 -1
  39. package/dist/browser/generated/src/models/mappers.js +1173 -2159
  40. package/dist/browser/generated/src/models/mappers.js.map +1 -1
  41. package/dist/browser/generated/src/models/parameters.d.ts +2 -7
  42. package/dist/browser/generated/src/models/parameters.d.ts.map +1 -1
  43. package/dist/browser/generated/src/models/parameters.js +10 -41
  44. package/dist/browser/generated/src/models/parameters.js.map +1 -1
  45. package/dist/browser/generated/src/operations/callConnection.d.ts +2 -9
  46. package/dist/browser/generated/src/operations/callConnection.d.ts.map +1 -1
  47. package/dist/browser/generated/src/operations/callConnection.js +24 -73
  48. package/dist/browser/generated/src/operations/callConnection.js.map +1 -1
  49. package/dist/browser/generated/src/operations/callMedia.d.ts +15 -15
  50. package/dist/browser/generated/src/operations/callMedia.d.ts.map +1 -1
  51. package/dist/browser/generated/src/operations/callMedia.js +51 -50
  52. package/dist/browser/generated/src/operations/callMedia.js.map +1 -1
  53. package/dist/browser/generated/src/operations/callRecording.d.ts +1 -7
  54. package/dist/browser/generated/src/operations/callRecording.d.ts.map +1 -1
  55. package/dist/browser/generated/src/operations/callRecording.js +1 -24
  56. package/dist/browser/generated/src/operations/callRecording.js.map +1 -1
  57. package/dist/browser/generated/src/operations/index.d.ts +0 -1
  58. package/dist/browser/generated/src/operations/index.d.ts.map +1 -1
  59. package/dist/browser/generated/src/operations/index.js +0 -1
  60. package/dist/browser/generated/src/operations/index.js.map +1 -1
  61. package/dist/browser/generated/src/operationsInterfaces/callConnection.d.ts +2 -9
  62. package/dist/browser/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
  63. package/dist/browser/generated/src/operationsInterfaces/callConnection.js.map +1 -1
  64. package/dist/browser/generated/src/operationsInterfaces/callMedia.d.ts +15 -15
  65. package/dist/browser/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
  66. package/dist/browser/generated/src/operationsInterfaces/callMedia.js.map +1 -1
  67. package/dist/browser/generated/src/operationsInterfaces/callRecording.d.ts +1 -7
  68. package/dist/browser/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
  69. package/dist/browser/generated/src/operationsInterfaces/callRecording.js.map +1 -1
  70. package/dist/browser/generated/src/operationsInterfaces/index.d.ts +0 -1
  71. package/dist/browser/generated/src/operationsInterfaces/index.d.ts.map +1 -1
  72. package/dist/browser/generated/src/operationsInterfaces/index.js +0 -1
  73. package/dist/browser/generated/src/operationsInterfaces/index.js.map +1 -1
  74. package/dist/browser/generated/src/pagingHelper.js +2 -4
  75. package/dist/browser/generated/src/pagingHelper.js.map +1 -1
  76. package/dist/browser/index.d.ts +0 -2
  77. package/dist/browser/index.d.ts.map +1 -1
  78. package/dist/browser/index.js +0 -2
  79. package/dist/browser/index.js.map +1 -1
  80. package/dist/browser/models/constants.js +1 -1
  81. package/dist/browser/models/constants.js.map +1 -1
  82. package/dist/browser/models/events.d.ts +136 -195
  83. package/dist/browser/models/events.d.ts.map +1 -1
  84. package/dist/browser/models/events.js.map +1 -1
  85. package/dist/browser/models/models.d.ts +76 -39
  86. package/dist/browser/models/models.d.ts.map +1 -1
  87. package/dist/browser/models/models.js +1 -3
  88. package/dist/browser/models/models.js.map +1 -1
  89. package/dist/browser/models/options.d.ts +64 -30
  90. package/dist/browser/models/options.d.ts.map +1 -1
  91. package/dist/browser/models/options.js.map +1 -1
  92. package/dist/browser/models/responses.d.ts +19 -82
  93. package/dist/browser/models/responses.d.ts.map +1 -1
  94. package/dist/browser/models/responses.js.map +1 -1
  95. package/dist/browser/models/streaming.d.ts +38 -28
  96. package/dist/browser/models/streaming.d.ts.map +1 -1
  97. package/dist/browser/models/streaming.js +28 -57
  98. package/dist/browser/models/streaming.js.map +1 -1
  99. package/dist/browser/streamingData.d.ts.map +1 -1
  100. package/dist/browser/streamingData.js +15 -1
  101. package/dist/browser/streamingData.js.map +1 -1
  102. package/dist/browser/utli/converters.d.ts +1 -1
  103. package/dist/browser/utli/converters.d.ts.map +1 -1
  104. package/dist/browser/utli/converters.js +48 -9
  105. package/dist/browser/utli/converters.js.map +1 -1
  106. package/dist/commonjs/callAutomationClient.d.ts +0 -8
  107. package/dist/commonjs/callAutomationClient.d.ts.map +1 -1
  108. package/dist/commonjs/callAutomationClient.js +85 -139
  109. package/dist/commonjs/callAutomationClient.js.map +1 -1
  110. package/dist/commonjs/callAutomationEventParser.d.ts.map +1 -1
  111. package/dist/commonjs/callAutomationEventParser.js +21 -53
  112. package/dist/commonjs/callAutomationEventParser.js.map +1 -1
  113. package/dist/commonjs/callConnection.d.ts +12 -14
  114. package/dist/commonjs/callConnection.d.ts.map +1 -1
  115. package/dist/commonjs/callConnection.js +113 -185
  116. package/dist/commonjs/callConnection.js.map +1 -1
  117. package/dist/commonjs/callMedia.d.ts +15 -20
  118. package/dist/commonjs/callMedia.d.ts.map +1 -1
  119. package/dist/commonjs/callMedia.js +66 -185
  120. package/dist/commonjs/callMedia.js.map +1 -1
  121. package/dist/commonjs/callRecording.d.ts +2 -8
  122. package/dist/commonjs/callRecording.d.ts.map +1 -1
  123. package/dist/commonjs/callRecording.js +17 -27
  124. package/dist/commonjs/callRecording.js.map +1 -1
  125. package/dist/commonjs/contentDownloader.js +11 -12
  126. package/dist/commonjs/contentDownloader.js.map +1 -1
  127. package/dist/commonjs/credential/callAutomationAccessKeyCredentialPolicy.js +1 -2
  128. package/dist/commonjs/credential/callAutomationAccessKeyCredentialPolicy.js.map +1 -1
  129. package/dist/commonjs/credential/callAutomationAuthPolicy.js +1 -1
  130. package/dist/commonjs/credential/callAutomationAuthPolicy.js.map +1 -1
  131. package/dist/commonjs/generated/src/callAutomationApiClient.d.ts +1 -2
  132. package/dist/commonjs/generated/src/callAutomationApiClient.d.ts.map +1 -1
  133. package/dist/commonjs/generated/src/callAutomationApiClient.js +13 -5
  134. package/dist/commonjs/generated/src/callAutomationApiClient.js.map +1 -1
  135. package/dist/commonjs/generated/src/models/index.d.ts +534 -1064
  136. package/dist/commonjs/generated/src/models/index.d.ts.map +1 -1
  137. package/dist/commonjs/generated/src/models/index.js +88 -160
  138. package/dist/commonjs/generated/src/models/index.js.map +1 -1
  139. package/dist/commonjs/generated/src/models/mappers.d.ts +58 -86
  140. package/dist/commonjs/generated/src/models/mappers.d.ts.map +1 -1
  141. package/dist/commonjs/generated/src/models/mappers.js +1176 -2162
  142. package/dist/commonjs/generated/src/models/mappers.js.map +1 -1
  143. package/dist/commonjs/generated/src/models/parameters.d.ts +2 -7
  144. package/dist/commonjs/generated/src/models/parameters.d.ts.map +1 -1
  145. package/dist/commonjs/generated/src/models/parameters.js +10 -41
  146. package/dist/commonjs/generated/src/models/parameters.js.map +1 -1
  147. package/dist/commonjs/generated/src/operations/callConnection.d.ts +2 -9
  148. package/dist/commonjs/generated/src/operations/callConnection.d.ts.map +1 -1
  149. package/dist/commonjs/generated/src/operations/callConnection.js +24 -72
  150. package/dist/commonjs/generated/src/operations/callConnection.js.map +1 -1
  151. package/dist/commonjs/generated/src/operations/callMedia.d.ts +15 -15
  152. package/dist/commonjs/generated/src/operations/callMedia.d.ts.map +1 -1
  153. package/dist/commonjs/generated/src/operations/callMedia.js +51 -50
  154. package/dist/commonjs/generated/src/operations/callMedia.js.map +1 -1
  155. package/dist/commonjs/generated/src/operations/callRecording.d.ts +1 -7
  156. package/dist/commonjs/generated/src/operations/callRecording.d.ts.map +1 -1
  157. package/dist/commonjs/generated/src/operations/callRecording.js +1 -24
  158. package/dist/commonjs/generated/src/operations/callRecording.js.map +1 -1
  159. package/dist/commonjs/generated/src/operations/index.d.ts +0 -1
  160. package/dist/commonjs/generated/src/operations/index.d.ts.map +1 -1
  161. package/dist/commonjs/generated/src/operations/index.js +0 -1
  162. package/dist/commonjs/generated/src/operations/index.js.map +1 -1
  163. package/dist/commonjs/generated/src/operationsInterfaces/callConnection.d.ts +2 -9
  164. package/dist/commonjs/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
  165. package/dist/commonjs/generated/src/operationsInterfaces/callConnection.js.map +1 -1
  166. package/dist/commonjs/generated/src/operationsInterfaces/callMedia.d.ts +15 -15
  167. package/dist/commonjs/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
  168. package/dist/commonjs/generated/src/operationsInterfaces/callMedia.js.map +1 -1
  169. package/dist/commonjs/generated/src/operationsInterfaces/callRecording.d.ts +1 -7
  170. package/dist/commonjs/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
  171. package/dist/commonjs/generated/src/operationsInterfaces/callRecording.js.map +1 -1
  172. package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts +0 -1
  173. package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts.map +1 -1
  174. package/dist/commonjs/generated/src/operationsInterfaces/index.js +0 -1
  175. package/dist/commonjs/generated/src/operationsInterfaces/index.js.map +1 -1
  176. package/dist/commonjs/generated/src/pagingHelper.js +2 -4
  177. package/dist/commonjs/generated/src/pagingHelper.js.map +1 -1
  178. package/dist/commonjs/index.d.ts +0 -2
  179. package/dist/commonjs/index.d.ts.map +1 -1
  180. package/dist/commonjs/index.js +0 -2
  181. package/dist/commonjs/index.js.map +1 -1
  182. package/dist/commonjs/models/constants.js +1 -1
  183. package/dist/commonjs/models/constants.js.map +1 -1
  184. package/dist/commonjs/models/events.d.ts +136 -195
  185. package/dist/commonjs/models/events.d.ts.map +1 -1
  186. package/dist/commonjs/models/events.js.map +1 -1
  187. package/dist/commonjs/models/models.d.ts +76 -39
  188. package/dist/commonjs/models/models.d.ts.map +1 -1
  189. package/dist/commonjs/models/models.js +2 -21
  190. package/dist/commonjs/models/models.js.map +1 -1
  191. package/dist/commonjs/models/options.d.ts +64 -30
  192. package/dist/commonjs/models/options.d.ts.map +1 -1
  193. package/dist/commonjs/models/options.js.map +1 -1
  194. package/dist/commonjs/models/responses.d.ts +19 -82
  195. package/dist/commonjs/models/responses.d.ts.map +1 -1
  196. package/dist/commonjs/models/responses.js.map +1 -1
  197. package/dist/commonjs/models/streaming.d.ts +38 -28
  198. package/dist/commonjs/models/streaming.d.ts.map +1 -1
  199. package/dist/commonjs/models/streaming.js +31 -59
  200. package/dist/commonjs/models/streaming.js.map +1 -1
  201. package/dist/commonjs/streamingData.d.ts.map +1 -1
  202. package/dist/commonjs/streamingData.js +15 -1
  203. package/dist/commonjs/streamingData.js.map +1 -1
  204. package/dist/commonjs/tsdoc-metadata.json +11 -11
  205. package/dist/commonjs/utli/converters.d.ts +1 -1
  206. package/dist/commonjs/utli/converters.d.ts.map +1 -1
  207. package/dist/commonjs/utli/converters.js +47 -8
  208. package/dist/commonjs/utli/converters.js.map +1 -1
  209. package/dist/esm/callAutomationClient.d.ts +0 -8
  210. package/dist/esm/callAutomationClient.d.ts.map +1 -1
  211. package/dist/esm/callAutomationClient.js +87 -141
  212. package/dist/esm/callAutomationClient.js.map +1 -1
  213. package/dist/esm/callAutomationEventParser.d.ts.map +1 -1
  214. package/dist/esm/callAutomationEventParser.js +22 -54
  215. package/dist/esm/callAutomationEventParser.js.map +1 -1
  216. package/dist/esm/callConnection.d.ts +12 -14
  217. package/dist/esm/callConnection.d.ts.map +1 -1
  218. package/dist/esm/callConnection.js +111 -183
  219. package/dist/esm/callConnection.js.map +1 -1
  220. package/dist/esm/callMedia.d.ts +15 -20
  221. package/dist/esm/callMedia.d.ts.map +1 -1
  222. package/dist/esm/callMedia.js +58 -177
  223. package/dist/esm/callMedia.js.map +1 -1
  224. package/dist/esm/callRecording.d.ts +2 -8
  225. package/dist/esm/callRecording.d.ts.map +1 -1
  226. package/dist/esm/callRecording.js +16 -26
  227. package/dist/esm/callRecording.js.map +1 -1
  228. package/dist/esm/contentDownloader.js +11 -12
  229. package/dist/esm/contentDownloader.js.map +1 -1
  230. package/dist/esm/credential/callAutomationAccessKeyCredentialPolicy.js +1 -2
  231. package/dist/esm/credential/callAutomationAccessKeyCredentialPolicy.js.map +1 -1
  232. package/dist/esm/credential/callAutomationAuthPolicy.js +1 -1
  233. package/dist/esm/credential/callAutomationAuthPolicy.js.map +1 -1
  234. package/dist/esm/generated/src/callAutomationApiClient.d.ts +1 -2
  235. package/dist/esm/generated/src/callAutomationApiClient.d.ts.map +1 -1
  236. package/dist/esm/generated/src/callAutomationApiClient.js +14 -6
  237. package/dist/esm/generated/src/callAutomationApiClient.js.map +1 -1
  238. package/dist/esm/generated/src/models/index.d.ts +534 -1064
  239. package/dist/esm/generated/src/models/index.d.ts.map +1 -1
  240. package/dist/esm/generated/src/models/index.js +87 -159
  241. package/dist/esm/generated/src/models/index.js.map +1 -1
  242. package/dist/esm/generated/src/models/mappers.d.ts +58 -86
  243. package/dist/esm/generated/src/models/mappers.d.ts.map +1 -1
  244. package/dist/esm/generated/src/models/mappers.js +1173 -2159
  245. package/dist/esm/generated/src/models/mappers.js.map +1 -1
  246. package/dist/esm/generated/src/models/parameters.d.ts +2 -7
  247. package/dist/esm/generated/src/models/parameters.d.ts.map +1 -1
  248. package/dist/esm/generated/src/models/parameters.js +10 -41
  249. package/dist/esm/generated/src/models/parameters.js.map +1 -1
  250. package/dist/esm/generated/src/operations/callConnection.d.ts +2 -9
  251. package/dist/esm/generated/src/operations/callConnection.d.ts.map +1 -1
  252. package/dist/esm/generated/src/operations/callConnection.js +24 -73
  253. package/dist/esm/generated/src/operations/callConnection.js.map +1 -1
  254. package/dist/esm/generated/src/operations/callMedia.d.ts +15 -15
  255. package/dist/esm/generated/src/operations/callMedia.d.ts.map +1 -1
  256. package/dist/esm/generated/src/operations/callMedia.js +51 -50
  257. package/dist/esm/generated/src/operations/callMedia.js.map +1 -1
  258. package/dist/esm/generated/src/operations/callRecording.d.ts +1 -7
  259. package/dist/esm/generated/src/operations/callRecording.d.ts.map +1 -1
  260. package/dist/esm/generated/src/operations/callRecording.js +1 -24
  261. package/dist/esm/generated/src/operations/callRecording.js.map +1 -1
  262. package/dist/esm/generated/src/operations/index.d.ts +0 -1
  263. package/dist/esm/generated/src/operations/index.d.ts.map +1 -1
  264. package/dist/esm/generated/src/operations/index.js +0 -1
  265. package/dist/esm/generated/src/operations/index.js.map +1 -1
  266. package/dist/esm/generated/src/operationsInterfaces/callConnection.d.ts +2 -9
  267. package/dist/esm/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
  268. package/dist/esm/generated/src/operationsInterfaces/callConnection.js.map +1 -1
  269. package/dist/esm/generated/src/operationsInterfaces/callMedia.d.ts +15 -15
  270. package/dist/esm/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
  271. package/dist/esm/generated/src/operationsInterfaces/callMedia.js.map +1 -1
  272. package/dist/esm/generated/src/operationsInterfaces/callRecording.d.ts +1 -7
  273. package/dist/esm/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
  274. package/dist/esm/generated/src/operationsInterfaces/callRecording.js.map +1 -1
  275. package/dist/esm/generated/src/operationsInterfaces/index.d.ts +0 -1
  276. package/dist/esm/generated/src/operationsInterfaces/index.d.ts.map +1 -1
  277. package/dist/esm/generated/src/operationsInterfaces/index.js +0 -1
  278. package/dist/esm/generated/src/operationsInterfaces/index.js.map +1 -1
  279. package/dist/esm/generated/src/pagingHelper.js +2 -4
  280. package/dist/esm/generated/src/pagingHelper.js.map +1 -1
  281. package/dist/esm/index.d.ts +0 -2
  282. package/dist/esm/index.d.ts.map +1 -1
  283. package/dist/esm/index.js +0 -2
  284. package/dist/esm/index.js.map +1 -1
  285. package/dist/esm/models/constants.js +1 -1
  286. package/dist/esm/models/constants.js.map +1 -1
  287. package/dist/esm/models/events.d.ts +136 -195
  288. package/dist/esm/models/events.d.ts.map +1 -1
  289. package/dist/esm/models/events.js.map +1 -1
  290. package/dist/esm/models/models.d.ts +76 -39
  291. package/dist/esm/models/models.d.ts.map +1 -1
  292. package/dist/esm/models/models.js +1 -3
  293. package/dist/esm/models/models.js.map +1 -1
  294. package/dist/esm/models/options.d.ts +64 -30
  295. package/dist/esm/models/options.d.ts.map +1 -1
  296. package/dist/esm/models/options.js.map +1 -1
  297. package/dist/esm/models/responses.d.ts +19 -82
  298. package/dist/esm/models/responses.d.ts.map +1 -1
  299. package/dist/esm/models/responses.js.map +1 -1
  300. package/dist/esm/models/streaming.d.ts +38 -28
  301. package/dist/esm/models/streaming.d.ts.map +1 -1
  302. package/dist/esm/models/streaming.js +28 -57
  303. package/dist/esm/models/streaming.js.map +1 -1
  304. package/dist/esm/streamingData.d.ts.map +1 -1
  305. package/dist/esm/streamingData.js +15 -1
  306. package/dist/esm/streamingData.js.map +1 -1
  307. package/dist/esm/utli/converters.d.ts +1 -1
  308. package/dist/esm/utli/converters.d.ts.map +1 -1
  309. package/dist/esm/utli/converters.js +48 -9
  310. package/dist/esm/utli/converters.js.map +1 -1
  311. package/dist/react-native/callAutomationClient.d.ts +0 -8
  312. package/dist/react-native/callAutomationClient.d.ts.map +1 -1
  313. package/dist/react-native/callAutomationClient.js +87 -141
  314. package/dist/react-native/callAutomationClient.js.map +1 -1
  315. package/dist/react-native/callAutomationEventParser.d.ts.map +1 -1
  316. package/dist/react-native/callAutomationEventParser.js +22 -54
  317. package/dist/react-native/callAutomationEventParser.js.map +1 -1
  318. package/dist/react-native/callConnection.d.ts +12 -14
  319. package/dist/react-native/callConnection.d.ts.map +1 -1
  320. package/dist/react-native/callConnection.js +111 -183
  321. package/dist/react-native/callConnection.js.map +1 -1
  322. package/dist/react-native/callMedia.d.ts +15 -20
  323. package/dist/react-native/callMedia.d.ts.map +1 -1
  324. package/dist/react-native/callMedia.js +58 -177
  325. package/dist/react-native/callMedia.js.map +1 -1
  326. package/dist/react-native/callRecording.d.ts +2 -8
  327. package/dist/react-native/callRecording.d.ts.map +1 -1
  328. package/dist/react-native/callRecording.js +16 -26
  329. package/dist/react-native/callRecording.js.map +1 -1
  330. package/dist/react-native/contentDownloader.js +11 -12
  331. package/dist/react-native/contentDownloader.js.map +1 -1
  332. package/dist/react-native/credential/callAutomationAccessKeyCredentialPolicy.js +1 -2
  333. package/dist/react-native/credential/callAutomationAccessKeyCredentialPolicy.js.map +1 -1
  334. package/dist/react-native/credential/callAutomationAuthPolicy.js +1 -1
  335. package/dist/react-native/credential/callAutomationAuthPolicy.js.map +1 -1
  336. package/dist/react-native/generated/src/callAutomationApiClient.d.ts +1 -2
  337. package/dist/react-native/generated/src/callAutomationApiClient.d.ts.map +1 -1
  338. package/dist/react-native/generated/src/callAutomationApiClient.js +14 -6
  339. package/dist/react-native/generated/src/callAutomationApiClient.js.map +1 -1
  340. package/dist/react-native/generated/src/models/index.d.ts +534 -1064
  341. package/dist/react-native/generated/src/models/index.d.ts.map +1 -1
  342. package/dist/react-native/generated/src/models/index.js +87 -159
  343. package/dist/react-native/generated/src/models/index.js.map +1 -1
  344. package/dist/react-native/generated/src/models/mappers.d.ts +58 -86
  345. package/dist/react-native/generated/src/models/mappers.d.ts.map +1 -1
  346. package/dist/react-native/generated/src/models/mappers.js +1173 -2159
  347. package/dist/react-native/generated/src/models/mappers.js.map +1 -1
  348. package/dist/react-native/generated/src/models/parameters.d.ts +2 -7
  349. package/dist/react-native/generated/src/models/parameters.d.ts.map +1 -1
  350. package/dist/react-native/generated/src/models/parameters.js +10 -41
  351. package/dist/react-native/generated/src/models/parameters.js.map +1 -1
  352. package/dist/react-native/generated/src/operations/callConnection.d.ts +2 -9
  353. package/dist/react-native/generated/src/operations/callConnection.d.ts.map +1 -1
  354. package/dist/react-native/generated/src/operations/callConnection.js +24 -73
  355. package/dist/react-native/generated/src/operations/callConnection.js.map +1 -1
  356. package/dist/react-native/generated/src/operations/callMedia.d.ts +15 -15
  357. package/dist/react-native/generated/src/operations/callMedia.d.ts.map +1 -1
  358. package/dist/react-native/generated/src/operations/callMedia.js +51 -50
  359. package/dist/react-native/generated/src/operations/callMedia.js.map +1 -1
  360. package/dist/react-native/generated/src/operations/callRecording.d.ts +1 -7
  361. package/dist/react-native/generated/src/operations/callRecording.d.ts.map +1 -1
  362. package/dist/react-native/generated/src/operations/callRecording.js +1 -24
  363. package/dist/react-native/generated/src/operations/callRecording.js.map +1 -1
  364. package/dist/react-native/generated/src/operations/index.d.ts +0 -1
  365. package/dist/react-native/generated/src/operations/index.d.ts.map +1 -1
  366. package/dist/react-native/generated/src/operations/index.js +0 -1
  367. package/dist/react-native/generated/src/operations/index.js.map +1 -1
  368. package/dist/react-native/generated/src/operationsInterfaces/callConnection.d.ts +2 -9
  369. package/dist/react-native/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
  370. package/dist/react-native/generated/src/operationsInterfaces/callConnection.js.map +1 -1
  371. package/dist/react-native/generated/src/operationsInterfaces/callMedia.d.ts +15 -15
  372. package/dist/react-native/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
  373. package/dist/react-native/generated/src/operationsInterfaces/callMedia.js.map +1 -1
  374. package/dist/react-native/generated/src/operationsInterfaces/callRecording.d.ts +1 -7
  375. package/dist/react-native/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
  376. package/dist/react-native/generated/src/operationsInterfaces/callRecording.js.map +1 -1
  377. package/dist/react-native/generated/src/operationsInterfaces/index.d.ts +0 -1
  378. package/dist/react-native/generated/src/operationsInterfaces/index.d.ts.map +1 -1
  379. package/dist/react-native/generated/src/operationsInterfaces/index.js +0 -1
  380. package/dist/react-native/generated/src/operationsInterfaces/index.js.map +1 -1
  381. package/dist/react-native/generated/src/pagingHelper.js +2 -4
  382. package/dist/react-native/generated/src/pagingHelper.js.map +1 -1
  383. package/dist/react-native/index.d.ts +0 -2
  384. package/dist/react-native/index.d.ts.map +1 -1
  385. package/dist/react-native/index.js +0 -2
  386. package/dist/react-native/index.js.map +1 -1
  387. package/dist/react-native/models/constants.js +1 -1
  388. package/dist/react-native/models/constants.js.map +1 -1
  389. package/dist/react-native/models/events.d.ts +136 -195
  390. package/dist/react-native/models/events.d.ts.map +1 -1
  391. package/dist/react-native/models/events.js.map +1 -1
  392. package/dist/react-native/models/models.d.ts +76 -39
  393. package/dist/react-native/models/models.d.ts.map +1 -1
  394. package/dist/react-native/models/models.js +1 -3
  395. package/dist/react-native/models/models.js.map +1 -1
  396. package/dist/react-native/models/options.d.ts +64 -30
  397. package/dist/react-native/models/options.d.ts.map +1 -1
  398. package/dist/react-native/models/options.js.map +1 -1
  399. package/dist/react-native/models/responses.d.ts +19 -82
  400. package/dist/react-native/models/responses.d.ts.map +1 -1
  401. package/dist/react-native/models/responses.js.map +1 -1
  402. package/dist/react-native/models/streaming.d.ts +38 -28
  403. package/dist/react-native/models/streaming.d.ts.map +1 -1
  404. package/dist/react-native/models/streaming.js +28 -57
  405. package/dist/react-native/models/streaming.js.map +1 -1
  406. package/dist/react-native/streamingData.d.ts.map +1 -1
  407. package/dist/react-native/streamingData.js +15 -1
  408. package/dist/react-native/streamingData.js.map +1 -1
  409. package/dist/react-native/utli/converters.d.ts +1 -1
  410. package/dist/react-native/utli/converters.d.ts.map +1 -1
  411. package/dist/react-native/utli/converters.js +48 -9
  412. package/dist/react-native/utli/converters.js.map +1 -1
  413. package/package.json +35 -36
  414. package/dist/browser/eventprocessor/callAutomationEventProcessor.d.ts +0 -39
  415. package/dist/browser/eventprocessor/callAutomationEventProcessor.d.ts.map +0 -1
  416. package/dist/browser/eventprocessor/callAutomationEventProcessor.js +0 -137
  417. package/dist/browser/eventprocessor/callAutomationEventProcessor.js.map +0 -1
  418. package/dist/browser/eventprocessor/eventResponses.d.ts +0 -134
  419. package/dist/browser/eventprocessor/eventResponses.d.ts.map +0 -1
  420. package/dist/browser/eventprocessor/eventResponses.js +0 -4
  421. package/dist/browser/eventprocessor/eventResponses.js.map +0 -1
  422. package/dist/browser/generated/src/operations/callDialog.d.ts +0 -35
  423. package/dist/browser/generated/src/operations/callDialog.d.ts.map +0 -1
  424. package/dist/browser/generated/src/operations/callDialog.js +0 -111
  425. package/dist/browser/generated/src/operations/callDialog.js.map +0 -1
  426. package/dist/browser/generated/src/operationsInterfaces/callDialog.d.ts +0 -27
  427. package/dist/browser/generated/src/operationsInterfaces/callDialog.d.ts.map +0 -1
  428. package/dist/browser/generated/src/operationsInterfaces/callDialog.js +0 -9
  429. package/dist/browser/generated/src/operationsInterfaces/callDialog.js.map +0 -1
  430. package/dist/commonjs/eventprocessor/callAutomationEventProcessor.d.ts +0 -39
  431. package/dist/commonjs/eventprocessor/callAutomationEventProcessor.d.ts.map +0 -1
  432. package/dist/commonjs/eventprocessor/callAutomationEventProcessor.js +0 -141
  433. package/dist/commonjs/eventprocessor/callAutomationEventProcessor.js.map +0 -1
  434. package/dist/commonjs/eventprocessor/eventResponses.d.ts +0 -134
  435. package/dist/commonjs/eventprocessor/eventResponses.d.ts.map +0 -1
  436. package/dist/commonjs/eventprocessor/eventResponses.js +0 -5
  437. package/dist/commonjs/eventprocessor/eventResponses.js.map +0 -1
  438. package/dist/commonjs/generated/src/operations/callDialog.d.ts +0 -35
  439. package/dist/commonjs/generated/src/operations/callDialog.d.ts.map +0 -1
  440. package/dist/commonjs/generated/src/operations/callDialog.js +0 -116
  441. package/dist/commonjs/generated/src/operations/callDialog.js.map +0 -1
  442. package/dist/commonjs/generated/src/operationsInterfaces/callDialog.d.ts +0 -27
  443. package/dist/commonjs/generated/src/operationsInterfaces/callDialog.d.ts.map +0 -1
  444. package/dist/commonjs/generated/src/operationsInterfaces/callDialog.js +0 -10
  445. package/dist/commonjs/generated/src/operationsInterfaces/callDialog.js.map +0 -1
  446. package/dist/esm/eventprocessor/callAutomationEventProcessor.d.ts +0 -39
  447. package/dist/esm/eventprocessor/callAutomationEventProcessor.d.ts.map +0 -1
  448. package/dist/esm/eventprocessor/callAutomationEventProcessor.js +0 -137
  449. package/dist/esm/eventprocessor/callAutomationEventProcessor.js.map +0 -1
  450. package/dist/esm/eventprocessor/eventResponses.d.ts +0 -134
  451. package/dist/esm/eventprocessor/eventResponses.d.ts.map +0 -1
  452. package/dist/esm/eventprocessor/eventResponses.js +0 -4
  453. package/dist/esm/eventprocessor/eventResponses.js.map +0 -1
  454. package/dist/esm/generated/src/operations/callDialog.d.ts +0 -35
  455. package/dist/esm/generated/src/operations/callDialog.d.ts.map +0 -1
  456. package/dist/esm/generated/src/operations/callDialog.js +0 -111
  457. package/dist/esm/generated/src/operations/callDialog.js.map +0 -1
  458. package/dist/esm/generated/src/operationsInterfaces/callDialog.d.ts +0 -27
  459. package/dist/esm/generated/src/operationsInterfaces/callDialog.d.ts.map +0 -1
  460. package/dist/esm/generated/src/operationsInterfaces/callDialog.js +0 -9
  461. package/dist/esm/generated/src/operationsInterfaces/callDialog.js.map +0 -1
  462. package/dist/react-native/eventprocessor/callAutomationEventProcessor.d.ts +0 -39
  463. package/dist/react-native/eventprocessor/callAutomationEventProcessor.d.ts.map +0 -1
  464. package/dist/react-native/eventprocessor/callAutomationEventProcessor.js +0 -137
  465. package/dist/react-native/eventprocessor/callAutomationEventProcessor.js.map +0 -1
  466. package/dist/react-native/eventprocessor/eventResponses.d.ts +0 -134
  467. package/dist/react-native/eventprocessor/eventResponses.d.ts.map +0 -1
  468. package/dist/react-native/eventprocessor/eventResponses.js +0 -4
  469. package/dist/react-native/eventprocessor/eventResponses.js.map +0 -1
  470. package/dist/react-native/generated/src/operations/callDialog.d.ts +0 -35
  471. package/dist/react-native/generated/src/operations/callDialog.d.ts.map +0 -1
  472. package/dist/react-native/generated/src/operations/callDialog.js +0 -111
  473. package/dist/react-native/generated/src/operations/callDialog.js.map +0 -1
  474. package/dist/react-native/generated/src/operationsInterfaces/callDialog.d.ts +0 -27
  475. package/dist/react-native/generated/src/operationsInterfaces/callDialog.d.ts.map +0 -1
  476. package/dist/react-native/generated/src/operationsInterfaces/callDialog.js +0 -9
  477. package/dist/react-native/generated/src/operationsInterfaces/callDialog.js.map +0 -1
@@ -6,7 +6,6 @@ import { CallRecording } from "./callRecording.js";
6
6
  import type { AnswerCallOptions, ConnectCallOptions, CreateCallOptions, RedirectCallOptions, RejectCallOptions } from "./models/options.js";
7
7
  import type { AnswerCallResult, ConnectCallResult, CreateCallResult } from "./models/responses.js";
8
8
  import { type CallInvite, type CallLocator } from "./models/models.js";
9
- import { CallAutomationEventProcessor } from "./eventprocessor/callAutomationEventProcessor.js";
10
9
  /**
11
10
  * Client options used to configure CallAutomation Client API requests.
12
11
  */
@@ -24,8 +23,6 @@ export declare class CallAutomationClient {
24
23
  private readonly sourceIdentity?;
25
24
  private readonly credential;
26
25
  private readonly internalPipelineOptions;
27
- private readonly callAutomationEventProcessor;
28
- private readonly endpoint;
29
26
  /**
30
27
  * Initializes a new instance of the CallAutomationClient class.
31
28
  * @param connectionString - Connection string to connect to an Azure Communication Service resource.
@@ -53,10 +50,6 @@ export declare class CallAutomationClient {
53
50
  * Get Source Identity that is used for create and answer call
54
51
  */
55
52
  getSourceIdentity(): CommunicationUserIdentifier | undefined;
56
- /**
57
- * Get event processor to work with call automation events
58
- */
59
- getEventProcessor(): CallAutomationEventProcessor;
60
53
  private createCallInternal;
61
54
  /**
62
55
  * Create an outgoing call from source to a target identity.
@@ -94,7 +87,6 @@ export declare class CallAutomationClient {
94
87
  * @param options - Additional request options contains rejectCall api options.
95
88
  */
96
89
  rejectCall(incomingCallContext: string, options?: RejectCallOptions): Promise<void>;
97
- private createCustomCallingContextInternal;
98
90
  /**
99
91
  * Create connection to room call.
100
92
  * @param callLocator - Call locator to create connection.
@@ -1 +1 @@
1
- {"version":3,"file":"callAutomationClient.d.ts","sourceRoot":"","sources":["../../src/callAutomationClient.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,KAAK,EACV,uBAAuB,EACvB,2BAA2B,EAC5B,MAAM,6BAA6B,CAAC;AAarC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAA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,OAAO,CAAC,gBAAgB,CAAC;IAkB5B;;;;;OAKG;IACU,UAAU,CACrB,mBAAmB,EAAE,MAAM,EAC3B,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,gBAAgB,CAAC;IA4D5B;;;;;;OAMG;IACU,YAAY,CACvB,mBAAmB,EAAE,MAAM,EAC3B,iBAAiB,EAAE,UAAU,EAC7B,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,IAAI,CAAC;IAchB;;;;;OAKG;IACU,UAAU,CACrB,mBAAmB,EAAE,MAAM,EAC3B,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,IAAI,CAAC;IAchB;;;;;OAKG;IACU,WAAW,CACtB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,iBAAiB,CAAC;CA+D9B"}
@@ -1,16 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CallAutomationClient = void 0;
4
- const tslib_1 = require("tslib");
5
4
  const core_auth_1 = require("@azure/core-auth");
6
5
  const communication_common_1 = require("@azure/communication-common");
7
6
  const logger_js_1 = require("./models/logger.js");
7
+ const index_js_1 = require("./generated/src/index.js");
8
8
  const callConnection_js_1 = require("./callConnection.js");
9
9
  const callRecording_js_1 = require("./callRecording.js");
10
10
  const converters_js_1 = require("./utli/converters.js");
11
11
  const core_util_1 = require("@azure/core-util");
12
- const callAutomationAuthPolicy_js_1 = require("./credential/callAutomationAuthPolicy.js");
13
- const callAutomationEventProcessor_js_1 = require("./eventprocessor/callAutomationEventProcessor.js");
14
12
  /**
15
13
  * Checks whether the type of a value is CallAutomationClientOptions or not.
16
14
  *
@@ -21,25 +19,30 @@ const isCallAutomationClientOptions = (options) => !!options && !(0, core_auth_1
21
19
  * A CallAutomationClient represents a Client to the Azure Communication CallAutomation service.
22
20
  */
23
21
  class CallAutomationClient {
22
+ callAutomationApiClient;
23
+ sourceIdentity;
24
+ credential;
25
+ internalPipelineOptions;
24
26
  constructor(connectionStringOrUrl, credentialOrOptions, maybeOptions = {}) {
25
27
  const options = isCallAutomationClientOptions(credentialOrOptions)
26
28
  ? credentialOrOptions
27
29
  : maybeOptions;
28
- if (!(options === null || options === void 0 ? void 0 : options.userAgentOptions)) {
30
+ if (!options?.userAgentOptions) {
29
31
  options.userAgentOptions = {};
30
32
  }
31
- this.internalPipelineOptions = Object.assign(Object.assign({}, options), {
32
- loggingOptions: {
33
- logger: logger_js_1.logger.info,
33
+ this.internalPipelineOptions = {
34
+ ...options,
35
+ ...{
36
+ loggingOptions: {
37
+ logger: logger_js_1.logger.info,
38
+ },
34
39
  },
35
- });
40
+ };
36
41
  const { url, credential } = (0, communication_common_1.parseClientArguments)(connectionStringOrUrl, credentialOrOptions);
37
- this.endpoint = url;
42
+ const authPolicy = (0, communication_common_1.createCommunicationAuthPolicy)(credential);
38
43
  this.credential = credential;
39
- // create event processor
40
- this.callAutomationEventProcessor = new callAutomationEventProcessor_js_1.CallAutomationEventProcessor();
41
- // create api client (using custom api endpoint if available)
42
- this.callAutomationApiClient = (0, callAutomationAuthPolicy_js_1.createCustomCallAutomationApiClient)(credential, this.internalPipelineOptions, this.endpoint);
44
+ this.callAutomationApiClient = new index_js_1.CallAutomationApiClient(url, this.internalPipelineOptions);
45
+ this.callAutomationApiClient.pipeline.addPolicy(authPolicy);
43
46
  this.sourceIdentity = (0, converters_js_1.communicationUserIdentifierModelConverter)(options.sourceIdentity);
44
47
  }
45
48
  /**
@@ -47,13 +50,13 @@ class CallAutomationClient {
47
50
  * @param callConnectionId - The CallConnection id for the CallConnection instance. (ex: 421CONTOSO-cRD6-4RDc-a078-99dRANDOMf).
48
51
  */
49
52
  getCallConnection(callConnectionId) {
50
- return new callConnection_js_1.CallConnection(callConnectionId, this.endpoint, this.credential, this.callAutomationEventProcessor, this.internalPipelineOptions);
53
+ return new callConnection_js_1.CallConnection(callConnectionId, this.callAutomationApiClient.endpoint, this.credential, this.internalPipelineOptions);
51
54
  }
52
55
  /**
53
56
  * Initializes a new instance of CallRecording.
54
57
  */
55
58
  getCallRecording() {
56
- return new callRecording_js_1.CallRecording(this.endpoint, this.credential, this.internalPipelineOptions);
59
+ return new callRecording_js_1.CallRecording(this.callAutomationApiClient.endpoint, this.credential, this.internalPipelineOptions);
57
60
  }
58
61
  /**
59
62
  * Get Source Identity that is used for create and answer call
@@ -61,45 +64,29 @@ class CallAutomationClient {
61
64
  getSourceIdentity() {
62
65
  return (0, converters_js_1.communicationUserIdentifierConverter)(this.sourceIdentity);
63
66
  }
64
- /**
65
- * Get event processor to work with call automation events
66
- */
67
- getEventProcessor() {
68
- return this.callAutomationEventProcessor;
69
- }
70
67
  async createCallInternal(request, options) {
71
- const optionsInternal = Object.assign(Object.assign({}, options), { repeatabilityFirstSent: new Date(), repeatabilityRequestID: (0, core_util_1.randomUUID)() });
72
- const _a = await this.callAutomationApiClient.createCall(request, optionsInternal), { callConnectionId, answeredBy, targets, sourceCallerIdNumber, source, answeredFor } = _a, result = tslib_1.__rest(_a, ["callConnectionId", "answeredBy", "targets", "sourceCallerIdNumber", "source", "answeredFor"]);
68
+ const optionsInternal = {
69
+ ...options,
70
+ repeatabilityFirstSent: new Date(),
71
+ repeatabilityRequestID: (0, core_util_1.randomUUID)(),
72
+ };
73
+ const { callConnectionId, answeredBy, targets, sourceCallerIdNumber, source, answeredFor, ...result } = await this.callAutomationApiClient.createCall(request, optionsInternal);
73
74
  if (callConnectionId) {
74
- const callConnectionPropertiesDto = Object.assign(Object.assign({}, result), { callConnectionId: callConnectionId, source: source ? (0, converters_js_1.communicationIdentifierConverter)(source) : undefined, answeredby: (0, converters_js_1.communicationUserIdentifierConverter)(answeredBy), answeredFor: answeredFor ? (0, converters_js_1.phoneNumberIdentifierConverter)(answeredFor) : undefined, targetParticipants: targets === null || targets === void 0 ? void 0 : targets.map((returnedTarget) => (0, converters_js_1.communicationIdentifierConverter)(returnedTarget)), sourceCallerIdNumber: sourceCallerIdNumber
75
+ const callConnectionPropertiesDto = {
76
+ ...result,
77
+ callConnectionId: callConnectionId,
78
+ source: source ? (0, converters_js_1.communicationIdentifierConverter)(source) : undefined,
79
+ answeredby: (0, converters_js_1.communicationUserIdentifierConverter)(answeredBy),
80
+ answeredFor: answeredFor ? (0, converters_js_1.phoneNumberIdentifierConverter)(answeredFor) : undefined,
81
+ targetParticipants: targets?.map((returnedTarget) => (0, converters_js_1.communicationIdentifierConverter)(returnedTarget)),
82
+ sourceCallerIdNumber: sourceCallerIdNumber
75
83
  ? (0, converters_js_1.phoneNumberIdentifierConverter)(sourceCallerIdNumber)
76
- : undefined });
77
- const callConnection = new callConnection_js_1.CallConnection(callConnectionId, this.endpoint, this.credential, this.callAutomationEventProcessor, this.internalPipelineOptions);
84
+ : undefined,
85
+ };
86
+ const callConnection = new callConnection_js_1.CallConnection(callConnectionId, this.callAutomationApiClient.endpoint, this.credential, this.internalPipelineOptions);
78
87
  const createCallResult = {
79
88
  callConnectionProperties: callConnectionPropertiesDto,
80
89
  callConnection: callConnection,
81
- waitForEventProcessor: async (abortSignal, timeoutInMs) => {
82
- const createCallEventResult = {
83
- isSuccess: false,
84
- };
85
- await this.callAutomationEventProcessor.waitForEventProcessor((event) => {
86
- if (event.callConnectionId === callConnectionId && event.kind === "CallConnected") {
87
- createCallEventResult.isSuccess = true;
88
- createCallEventResult.successResult = event;
89
- return true;
90
- }
91
- else if (event.callConnectionId === callConnectionId &&
92
- event.kind === "CreateCallFailed") {
93
- createCallEventResult.isSuccess = false;
94
- createCallEventResult.failureResult = event;
95
- return true;
96
- }
97
- else {
98
- return false;
99
- }
100
- }, abortSignal, timeoutInMs);
101
- return createCallEventResult;
102
- },
103
90
  };
104
91
  return createCallResult;
105
92
  }
@@ -114,16 +101,16 @@ class CallAutomationClient {
114
101
  async createCall(targetParticipant, callbackUrl, options = {}) {
115
102
  const request = {
116
103
  source: this.sourceIdentity,
117
- teamsAppSource: (0, converters_js_1.microsoftTeamsAppIdentifierModelConverter)(options.teamsAppSource),
118
104
  targets: [(0, converters_js_1.communicationIdentifierModelConverter)(targetParticipant.targetParticipant)],
119
105
  callbackUri: callbackUrl,
120
106
  operationContext: options.operationContext,
121
107
  callIntelligenceOptions: options.callIntelligenceOptions,
122
108
  mediaStreamingOptions: options.mediaStreamingOptions,
123
109
  transcriptionOptions: options.transcriptionOptions,
124
- customCallingContext: this.createCustomCallingContextInternal(targetParticipant.customCallingContext),
125
110
  sourceCallerIdNumber: (0, converters_js_1.PhoneNumberIdentifierModelConverter)(targetParticipant.sourceCallIdNumber),
126
111
  sourceDisplayName: targetParticipant.sourceDisplayName,
112
+ teamsAppSource: (0, converters_js_1.microsoftTeamsAppIdentifierModelConverter)(options.teamsAppSource),
113
+ enableLoopbackAudio: options.enableLoopbackAudio,
127
114
  };
128
115
  return this.createCallInternal(request, options);
129
116
  }
@@ -138,7 +125,6 @@ class CallAutomationClient {
138
125
  options = {}) {
139
126
  const request = {
140
127
  source: this.sourceIdentity,
141
- teamsAppSource: (0, converters_js_1.microsoftTeamsAppIdentifierModelConverter)(options.teamsAppSource),
142
128
  targets: targetParticipants.map((target) => (0, converters_js_1.communicationIdentifierModelConverter)(target)),
143
129
  callbackUri: callbackUrl,
144
130
  operationContext: options.operationContext,
@@ -147,6 +133,8 @@ class CallAutomationClient {
147
133
  transcriptionOptions: options.transcriptionOptions,
148
134
  sourceCallerIdNumber: (0, converters_js_1.PhoneNumberIdentifierModelConverter)(options.sourceCallIdNumber),
149
135
  sourceDisplayName: options.sourceDisplayName,
136
+ teamsAppSource: (0, converters_js_1.microsoftTeamsAppIdentifierModelConverter)(options.teamsAppSource),
137
+ enableLoopbackAudio: options.enableLoopbackAudio,
150
138
  };
151
139
  return this.createCallInternal(request, options);
152
140
  }
@@ -157,48 +145,39 @@ class CallAutomationClient {
157
145
  * @param options - Additional request options contains answerCall api options.
158
146
  */
159
147
  async answerCall(incomingCallContext, callbackUrl, options = {}) {
160
- const { callIntelligenceOptions, mediaStreamingOptions, transcriptionOptions, operationContext } = options, operationOptions = tslib_1.__rest(options, ["callIntelligenceOptions", "mediaStreamingOptions", "transcriptionOptions", "operationContext"]);
148
+ const { callIntelligenceOptions, mediaStreamingOptions, transcriptionOptions, operationContext, ...operationOptions } = options;
161
149
  const request = {
162
150
  incomingCallContext: incomingCallContext,
163
151
  mediaStreamingOptions: mediaStreamingOptions,
164
152
  transcriptionOptions: transcriptionOptions,
165
153
  callIntelligenceOptions: callIntelligenceOptions,
166
- customCallingContext: this.createCustomCallingContextInternal(options.customCallingContext),
167
154
  operationContext: operationContext,
168
155
  callbackUri: callbackUrl,
169
156
  answeredBy: this.sourceIdentity,
157
+ enableLoopbackAudio: options.enableLoopbackAudio,
170
158
  };
171
- const optionsInternal = Object.assign(Object.assign({}, operationOptions), { repeatabilityFirstSent: new Date(), repeatabilityRequestID: (0, core_util_1.randomUUID)() });
172
- const _a = await this.callAutomationApiClient.answerCall(request, optionsInternal), { callConnectionId, targets, sourceCallerIdNumber, answeredBy, source, answeredFor } = _a, result = tslib_1.__rest(_a, ["callConnectionId", "targets", "sourceCallerIdNumber", "answeredBy", "source", "answeredFor"]);
159
+ const optionsInternal = {
160
+ ...operationOptions,
161
+ repeatabilityFirstSent: new Date(),
162
+ repeatabilityRequestID: (0, core_util_1.randomUUID)(),
163
+ };
164
+ const { callConnectionId, targets, sourceCallerIdNumber, answeredBy, source, answeredFor, ...result } = await this.callAutomationApiClient.answerCall(request, optionsInternal);
173
165
  if (callConnectionId) {
174
- const callConnectionProperties = Object.assign(Object.assign({}, result), { callConnectionId: callConnectionId, source: source ? (0, converters_js_1.communicationIdentifierConverter)(source) : undefined, answeredby: (0, converters_js_1.communicationUserIdentifierConverter)(answeredBy), answeredFor: answeredFor ? (0, converters_js_1.phoneNumberIdentifierConverter)(answeredFor) : undefined, targetParticipants: targets === null || targets === void 0 ? void 0 : targets.map((target) => (0, converters_js_1.communicationIdentifierConverter)(target)), sourceCallerIdNumber: sourceCallerIdNumber
166
+ const callConnectionProperties = {
167
+ ...result,
168
+ callConnectionId: callConnectionId,
169
+ source: source ? (0, converters_js_1.communicationIdentifierConverter)(source) : undefined,
170
+ answeredby: (0, converters_js_1.communicationUserIdentifierConverter)(answeredBy),
171
+ answeredFor: answeredFor ? (0, converters_js_1.phoneNumberIdentifierConverter)(answeredFor) : undefined,
172
+ targetParticipants: targets?.map((target) => (0, converters_js_1.communicationIdentifierConverter)(target)),
173
+ sourceCallerIdNumber: sourceCallerIdNumber
175
174
  ? (0, converters_js_1.phoneNumberIdentifierConverter)(sourceCallerIdNumber)
176
- : undefined });
177
- const callConnection = new callConnection_js_1.CallConnection(callConnectionId, this.endpoint, this.credential, this.callAutomationEventProcessor, this.internalPipelineOptions);
175
+ : undefined,
176
+ };
177
+ const callConnection = new callConnection_js_1.CallConnection(callConnectionId, this.callAutomationApiClient.endpoint, this.credential, this.internalPipelineOptions);
178
178
  const answerCallResult = {
179
179
  callConnectionProperties: callConnectionProperties,
180
180
  callConnection: callConnection,
181
- waitForEventProcessor: async (abortSignal, timeoutInMs) => {
182
- const answerCallEventResult = {
183
- isSuccess: false,
184
- };
185
- await this.callAutomationEventProcessor.waitForEventProcessor((event) => {
186
- if (event.callConnectionId === callConnectionId && event.kind === "CallConnected") {
187
- answerCallEventResult.isSuccess = true;
188
- answerCallEventResult.successResult = event;
189
- return true;
190
- }
191
- if (event.callConnectionId === callConnectionId && event.kind === "AnswerFailed") {
192
- answerCallEventResult.isSuccess = false;
193
- answerCallEventResult.failureResult = event;
194
- return true;
195
- }
196
- else {
197
- return false;
198
- }
199
- }, abortSignal, timeoutInMs);
200
- return answerCallEventResult;
201
- },
202
181
  };
203
182
  return answerCallResult;
204
183
  }
@@ -215,9 +194,12 @@ class CallAutomationClient {
215
194
  const request = {
216
195
  incomingCallContext: incomingCallContext,
217
196
  target: (0, converters_js_1.communicationIdentifierModelConverter)(targetParticipant.targetParticipant),
218
- customCallingContext: this.createCustomCallingContextInternal(targetParticipant.customCallingContext),
219
197
  };
220
- const optionsInternal = Object.assign(Object.assign({}, options), { repeatabilityFirstSent: new Date(), repeatabilityRequestID: (0, core_util_1.randomUUID)() });
198
+ const optionsInternal = {
199
+ ...options,
200
+ repeatabilityFirstSent: new Date(),
201
+ repeatabilityRequestID: (0, core_util_1.randomUUID)(),
202
+ };
221
203
  return this.callAutomationApiClient.redirectCall(request, optionsInternal);
222
204
  }
223
205
  /**
@@ -231,39 +213,12 @@ class CallAutomationClient {
231
213
  incomingCallContext: incomingCallContext,
232
214
  callRejectReason: options.callRejectReason,
233
215
  };
234
- const optionsInternal = Object.assign(Object.assign({}, options), { repeatabilityFirstSent: new Date(), repeatabilityRequestID: (0, core_util_1.randomUUID)() });
235
- return this.callAutomationApiClient.rejectCall(request, optionsInternal);
236
- }
237
- createCustomCallingContextInternal(customCallingContext) {
238
- const sipHeaders = {};
239
- const voipHeaders = {};
240
- let teamsPhoneCallDetails = undefined;
241
- if (customCallingContext) {
242
- for (const header of customCallingContext) {
243
- if (header.kind === "sipuui") {
244
- sipHeaders[`User-To-User`] = header.value;
245
- }
246
- else if (header.kind === "sipx") {
247
- if (header.sipHeaderPrefix === "X-") {
248
- sipHeaders[`X-${header.key}`] = header.value;
249
- }
250
- else {
251
- sipHeaders[`X-MS-Custom-${header.key}`] = header.value;
252
- }
253
- }
254
- else if (header.kind === "voip") {
255
- voipHeaders[`${header.key}`] = header.value;
256
- }
257
- else if (header.kind === "teamsPhoneCallDetails") {
258
- teamsPhoneCallDetails = (0, converters_js_1.teamsPhoneCallDetailsModelConverter)(header);
259
- }
260
- }
261
- }
262
- return {
263
- sipHeaders: sipHeaders,
264
- voipHeaders: voipHeaders,
265
- teamsPhoneCallDetails: teamsPhoneCallDetails,
216
+ const optionsInternal = {
217
+ ...options,
218
+ repeatabilityFirstSent: new Date(),
219
+ repeatabilityRequestID: (0, core_util_1.randomUUID)(),
266
220
  };
221
+ return this.callAutomationApiClient.rejectCall(request, optionsInternal);
267
222
  }
268
223
  /**
269
224
  * Create connection to room call.
@@ -292,37 +247,28 @@ class CallAutomationClient {
292
247
  connectRequest.callLocator.kind = "serverCallLocator";
293
248
  connectRequest.callLocator.serverCallId = callLocator.id;
294
249
  }
295
- const optionsInternal = Object.assign(Object.assign({}, options), { repeatabilityFirstSent: new Date(), repeatabilityRequestID: (0, core_util_1.randomUUID)() });
296
- const _a = await this.callAutomationApiClient.connect(connectRequest, optionsInternal), { callConnectionId, targets, sourceCallerIdNumber, answeredBy, source, answeredFor } = _a, result = tslib_1.__rest(_a, ["callConnectionId", "targets", "sourceCallerIdNumber", "answeredBy", "source", "answeredFor"]);
250
+ const optionsInternal = {
251
+ ...options,
252
+ repeatabilityFirstSent: new Date(),
253
+ repeatabilityRequestID: (0, core_util_1.randomUUID)(),
254
+ };
255
+ const { callConnectionId, targets, sourceCallerIdNumber, answeredBy, source, answeredFor, ...result } = await this.callAutomationApiClient.connect(connectRequest, optionsInternal);
297
256
  if (callConnectionId) {
298
- const callConnectionProperties = Object.assign(Object.assign({}, result), { callConnectionId: callConnectionId, source: source ? (0, converters_js_1.communicationIdentifierConverter)(source) : undefined, answeredby: answeredBy ? (0, converters_js_1.communicationUserIdentifierConverter)(answeredBy) : undefined, targetParticipants: targets === null || targets === void 0 ? void 0 : targets.map((target) => (0, converters_js_1.communicationIdentifierConverter)(target)), answeredFor: answeredFor ? (0, converters_js_1.phoneNumberIdentifierConverter)(answeredFor) : undefined, sourceCallerIdNumber: sourceCallerIdNumber
257
+ const callConnectionProperties = {
258
+ ...result,
259
+ callConnectionId: callConnectionId,
260
+ source: source ? (0, converters_js_1.communicationIdentifierConverter)(source) : undefined,
261
+ answeredby: answeredBy ? (0, converters_js_1.communicationUserIdentifierConverter)(answeredBy) : undefined,
262
+ targetParticipants: targets?.map((target) => (0, converters_js_1.communicationIdentifierConverter)(target)),
263
+ answeredFor: answeredFor ? (0, converters_js_1.phoneNumberIdentifierConverter)(answeredFor) : undefined,
264
+ sourceCallerIdNumber: sourceCallerIdNumber
299
265
  ? (0, converters_js_1.phoneNumberIdentifierConverter)(sourceCallerIdNumber)
300
- : undefined });
301
- const callConnection = new callConnection_js_1.CallConnection(callConnectionId, this.callAutomationApiClient.endpoint, this.credential, this.callAutomationEventProcessor, this.internalPipelineOptions);
266
+ : undefined,
267
+ };
268
+ const callConnection = new callConnection_js_1.CallConnection(callConnectionId, this.callAutomationApiClient.endpoint, this.credential, this.internalPipelineOptions);
302
269
  const connectResult = {
303
270
  callConnectionProperties: callConnectionProperties,
304
271
  callConnection: callConnection,
305
- waitForEventProcessor: async (abortSignal, timeoutInMs) => {
306
- const connectCallEventResult = {
307
- isSuccess: false,
308
- };
309
- await this.callAutomationEventProcessor.waitForEventProcessor((event) => {
310
- if (event.callConnectionId === callConnectionId && event.kind === "CallConnected") {
311
- connectCallEventResult.isSuccess = true;
312
- connectCallEventResult.successResult = event;
313
- return true;
314
- }
315
- if (event.callConnectionId === callConnectionId && event.kind === "ConnectFailed") {
316
- connectCallEventResult.isSuccess = false;
317
- connectCallEventResult.failureResult = event;
318
- return true;
319
- }
320
- else {
321
- return false;
322
- }
323
- }, abortSignal, timeoutInMs);
324
- return connectCallEventResult;
325
- },
326
272
  };
327
273
  return connectResult;
328
274
  }
@@ -1 +1 @@
1
- {"version":3,"file":"callAutomationClient.js","sourceRoot":"","sources":["../../src/callAutomationClient.ts"],"names":[],"mappings":";;;;AAGA,gDAAqD;AAOrD,sEAAoF;AACpF,kDAA4C;AAW5C,2DAAqD;AACrD,yDAAmD;AAenD,wDAS8B;AAC9B,gDAA8C;AAC9C,0FAA+F;AAC/F,sGAAgG;AAgBhG;;;;GAIG;AACH,MAAM,6BAA6B,GAAG,CAAC,OAAY,EAA0C,EAAE,CAC7F,CAAC,CAAC,OAAO,IAAI,CAAC,IAAA,6BAAiB,EAAC,OAAO,CAAC,IAAI,CAAC,IAAA,sCAAe,EAAC,OAAO,CAAC,CAAC;AAExE;;GAEG;AACH,MAAa,oBAA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CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;4BAClF,sBAAsB,CAAC,SAAS,GAAG,KAAK,CAAC;4BACzC,sBAAsB,CAAC,aAAa,GAAG,KAAK,CAAC;4BAC7C,OAAO,IAAI,CAAC;wBACd,CAAC;6BAAM,CAAC;4BACN,OAAO,KAAK,CAAC;wBACf,CAAC;oBACH,CAAC,EACD,WAAW,EACX,WAAW,CACZ,CAAC;oBACF,OAAO,sBAAsB,CAAC;gBAChC,CAAC;aACF,CAAC;YACF,OAAO,aAAa,CAAC;QACvB,CAAC;QACD,MAAM,0EAA0E,CAAC;IACnF,CAAC;CACF;AAjgBD,oDAigBC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport type { CommonClientOptions } from \"@azure/core-client\";\nimport type { InternalPipelineOptions } from \"@azure/core-rest-pipeline\";\nimport type {\n CommunicationIdentifier,\n CommunicationUserIdentifier,\n} from \"@azure/communication-common\";\nimport { parseClientArguments, isKeyCredential } from \"@azure/communication-common\";\nimport { logger } from \"./models/logger.js\";\nimport type {\n AnswerCallRequest,\n CallAutomationApiClient,\n CommunicationUserIdentifierModel,\n CreateCallRequest,\n RedirectCallRequest,\n RejectCallRequest,\n CustomCallingContextInternal,\n ConnectRequest,\n} from \"./generated/src/index.js\";\nimport { CallConnection } from \"./callConnection.js\";\nimport { CallRecording } from \"./callRecording.js\";\nimport type {\n AnswerCallOptions,\n ConnectCallOptions,\n CreateCallOptions,\n RedirectCallOptions,\n RejectCallOptions,\n} from \"./models/options.js\";\nimport type { AnswerCallResult, ConnectCallResult, CreateCallResult } from \"./models/responses.js\";\nimport {\n type CallConnectionProperties,\n type CallInvite,\n type CallLocator,\n type CustomCallingContext,\n} from \"./models/models.js\";\nimport {\n communicationIdentifierConverter,\n communicationIdentifierModelConverter,\n communicationUserIdentifierConverter,\n communicationUserIdentifierModelConverter,\n microsoftTeamsAppIdentifierModelConverter,\n phoneNumberIdentifierConverter,\n PhoneNumberIdentifierModelConverter,\n teamsPhoneCallDetailsModelConverter,\n} from \"./utli/converters.js\";\nimport { randomUUID } from \"@azure/core-util\";\nimport { createCustomCallAutomationApiClient } from \"./credential/callAutomationAuthPolicy.js\";\nimport { CallAutomationEventProcessor } from \"./eventprocessor/callAutomationEventProcessor.js\";\nimport type {\n AnswerCallEventResult,\n ConnectCallEventResult,\n CreateCallEventResult,\n} from \"./eventprocessor/eventResponses.js\";\n/**\n * Client options used to configure CallAutomation Client API requests.\n */\nexport interface CallAutomationClientOptions extends CommonClientOptions {\n /**\n * The identifier of the source of the call for call creating/answering/inviting operation.\n */\n sourceIdentity?: CommunicationUserIdentifier;\n}\n\n/**\n * Checks whether the type of a value is CallAutomationClientOptions or not.\n *\n * @param options - The value being checked.\n */\nconst isCallAutomationClientOptions = (options: any): options is CallAutomationClientOptions =>\n !!options && !isTokenCredential(options) && !isKeyCredential(options);\n\n/**\n * A CallAutomationClient represents a Client to the Azure Communication CallAutomation service.\n */\nexport class CallAutomationClient {\n private readonly callAutomationApiClient: CallAutomationApiClient;\n private readonly sourceIdentity?: CommunicationUserIdentifierModel;\n private readonly credential: TokenCredential | KeyCredential;\n private readonly internalPipelineOptions: InternalPipelineOptions;\n private readonly callAutomationEventProcessor: CallAutomationEventProcessor;\n private readonly endpoint: string;\n /**\n * Initializes a new instance of the CallAutomationClient class.\n * @param connectionString - Connection string to connect to an Azure Communication Service resource.\n * Example: \"endpoint=https://contoso.eastus.communications.azure.net/;accesskey=secret\";\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n constructor(connectionString: string, options?: CallAutomationClientOptions);\n\n /**\n * Initializes a new instance of the CallAutomationClient class using a TokenCredential or KeyCredential.\n * @param endpoint - The endpoint of the service (ex: https://contoso.eastus.communications.azure.net).\n * @param credential - TokenCredential or KeyCredential that is used to authenticate requests to the service.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n constructor(\n endpoint: string,\n credential: TokenCredential | KeyCredential,\n options?: CallAutomationClientOptions,\n );\n\n constructor(\n connectionStringOrUrl: string,\n credentialOrOptions?: KeyCredential | TokenCredential | CallAutomationClientOptions,\n maybeOptions: CallAutomationClientOptions = {},\n ) {\n const options = isCallAutomationClientOptions(credentialOrOptions)\n ? credentialOrOptions\n : maybeOptions;\n\n if (!options?.userAgentOptions) {\n options.userAgentOptions = {};\n }\n\n this.internalPipelineOptions = {\n ...options,\n ...{\n loggingOptions: {\n logger: logger.info,\n },\n },\n };\n\n const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);\n this.endpoint = url;\n\n this.credential = credential;\n\n // create event processor\n this.callAutomationEventProcessor = new CallAutomationEventProcessor();\n\n // create api client (using custom api endpoint if available)\n this.callAutomationApiClient = createCustomCallAutomationApiClient(\n credential,\n this.internalPipelineOptions,\n this.endpoint,\n );\n\n this.sourceIdentity = communicationUserIdentifierModelConverter(options.sourceIdentity);\n }\n\n /**\n * Initializes a new instance of CallConnection.\n * @param callConnectionId - The CallConnection id for the CallConnection instance. (ex: 421CONTOSO-cRD6-4RDc-a078-99dRANDOMf).\n */\n public getCallConnection(callConnectionId: string): CallConnection {\n return new CallConnection(\n callConnectionId,\n this.endpoint,\n this.credential,\n this.callAutomationEventProcessor,\n this.internalPipelineOptions,\n );\n }\n\n /**\n * Initializes a new instance of CallRecording.\n */\n public getCallRecording(): CallRecording {\n return new CallRecording(this.endpoint, this.credential, this.internalPipelineOptions);\n }\n\n /**\n * Get Source Identity that is used for create and answer call\n */\n public getSourceIdentity(): CommunicationUserIdentifier | undefined {\n return communicationUserIdentifierConverter(this.sourceIdentity);\n }\n\n /**\n * Get event processor to work with call automation events\n */\n public getEventProcessor(): CallAutomationEventProcessor {\n return this.callAutomationEventProcessor;\n }\n\n private async createCallInternal(\n request: CreateCallRequest,\n options?: CreateCallOptions,\n ): Promise<CreateCallResult> {\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const {\n callConnectionId,\n answeredBy,\n targets,\n sourceCallerIdNumber,\n source,\n answeredFor,\n ...result\n } = await this.callAutomationApiClient.createCall(request, optionsInternal);\n\n if (callConnectionId) {\n const callConnectionPropertiesDto: CallConnectionProperties = {\n ...result,\n callConnectionId: callConnectionId,\n source: source ? communicationIdentifierConverter(source) : undefined,\n answeredby: communicationUserIdentifierConverter(answeredBy),\n answeredFor: answeredFor ? phoneNumberIdentifierConverter(answeredFor) : undefined,\n targetParticipants: targets?.map((returnedTarget) =>\n communicationIdentifierConverter(returnedTarget),\n ),\n sourceCallerIdNumber: sourceCallerIdNumber\n ? phoneNumberIdentifierConverter(sourceCallerIdNumber)\n : undefined,\n };\n const callConnection = new CallConnection(\n callConnectionId,\n this.endpoint,\n this.credential,\n this.callAutomationEventProcessor,\n this.internalPipelineOptions,\n );\n const createCallResult: CreateCallResult = {\n callConnectionProperties: callConnectionPropertiesDto,\n callConnection: callConnection,\n waitForEventProcessor: async (abortSignal, timeoutInMs) => {\n const createCallEventResult: CreateCallEventResult = {\n isSuccess: false,\n };\n await this.callAutomationEventProcessor.waitForEventProcessor(\n (event) => {\n if (event.callConnectionId === callConnectionId && event.kind === \"CallConnected\") {\n createCallEventResult.isSuccess = true;\n createCallEventResult.successResult = event;\n return true;\n } else if (\n event.callConnectionId === callConnectionId &&\n event.kind === \"CreateCallFailed\"\n ) {\n createCallEventResult.isSuccess = false;\n createCallEventResult.failureResult = event;\n return true;\n } else {\n return false;\n }\n },\n abortSignal,\n timeoutInMs,\n );\n\n return createCallEventResult;\n },\n };\n return createCallResult;\n }\n throw \"callConnectionProperties / callConnectionId is missing in createCall result\";\n }\n\n /**\n * Create an outgoing call from source to a target identity.\n * @param targetParticipant - A single target.\n * @param callbackUrl - The callback url.\n * @param options - Additional request options contains createCallConnection api options.\n */\n public async createCall(\n targetParticipant: CallInvite,\n callbackUrl: string,\n options: CreateCallOptions = {},\n ): Promise<CreateCallResult> {\n const request: CreateCallRequest = {\n source: this.sourceIdentity,\n teamsAppSource: microsoftTeamsAppIdentifierModelConverter(options.teamsAppSource),\n targets: [communicationIdentifierModelConverter(targetParticipant.targetParticipant)],\n callbackUri: callbackUrl,\n operationContext: options.operationContext,\n callIntelligenceOptions: options.callIntelligenceOptions,\n mediaStreamingOptions: options.mediaStreamingOptions,\n transcriptionOptions: options.transcriptionOptions,\n customCallingContext: this.createCustomCallingContextInternal(\n targetParticipant.customCallingContext!,\n ),\n sourceCallerIdNumber: PhoneNumberIdentifierModelConverter(\n targetParticipant.sourceCallIdNumber,\n ),\n sourceDisplayName: targetParticipant.sourceDisplayName,\n };\n\n return this.createCallInternal(request, options);\n }\n\n /**\n * Create an outgoing call from source to a group of targets identities.\n * @param targetParticipants - A group of targets identities.\n * @param callbackUrl - The callback url.\n * @param options - Additional request options contains createCallConnection api options.\n */\n public async createGroupCall(\n targetParticipants: CommunicationIdentifier[],\n callbackUrl: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: CreateCallOptions = {},\n ): Promise<CreateCallResult> {\n const request: CreateCallRequest = {\n source: this.sourceIdentity,\n teamsAppSource: microsoftTeamsAppIdentifierModelConverter(options.teamsAppSource),\n targets: targetParticipants.map((target) => communicationIdentifierModelConverter(target)),\n callbackUri: callbackUrl,\n operationContext: options.operationContext,\n callIntelligenceOptions: options.callIntelligenceOptions,\n mediaStreamingOptions: options.mediaStreamingOptions,\n transcriptionOptions: options.transcriptionOptions,\n sourceCallerIdNumber: PhoneNumberIdentifierModelConverter(options.sourceCallIdNumber),\n sourceDisplayName: options.sourceDisplayName,\n };\n\n return this.createCallInternal(request, options);\n }\n\n /**\n * Answer the call.\n * @param incomingCallContext - The context associated with the call.\n * @param callbackUrl - The callback url.\n * @param options - Additional request options contains answerCall api options.\n */\n public async answerCall(\n incomingCallContext: string,\n callbackUrl: string,\n options: AnswerCallOptions = {},\n ): Promise<AnswerCallResult> {\n const {\n callIntelligenceOptions,\n mediaStreamingOptions,\n transcriptionOptions,\n operationContext,\n ...operationOptions\n } = options;\n const request: AnswerCallRequest = {\n incomingCallContext: incomingCallContext,\n mediaStreamingOptions: mediaStreamingOptions,\n transcriptionOptions: transcriptionOptions,\n callIntelligenceOptions: callIntelligenceOptions,\n customCallingContext: this.createCustomCallingContextInternal(options.customCallingContext!),\n operationContext: operationContext,\n callbackUri: callbackUrl,\n answeredBy: this.sourceIdentity,\n };\n const optionsInternal = {\n ...operationOptions,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const {\n callConnectionId,\n targets,\n sourceCallerIdNumber,\n answeredBy,\n source,\n answeredFor,\n ...result\n } = await this.callAutomationApiClient.answerCall(request, optionsInternal);\n\n if (callConnectionId) {\n const callConnectionProperties: CallConnectionProperties = {\n ...result,\n callConnectionId: callConnectionId,\n source: source ? communicationIdentifierConverter(source) : undefined,\n answeredby: communicationUserIdentifierConverter(answeredBy),\n answeredFor: answeredFor ? phoneNumberIdentifierConverter(answeredFor) : undefined,\n targetParticipants: targets?.map((target) => communicationIdentifierConverter(target)),\n sourceCallerIdNumber: sourceCallerIdNumber\n ? phoneNumberIdentifierConverter(sourceCallerIdNumber)\n : undefined,\n };\n const callConnection = new CallConnection(\n callConnectionId,\n this.endpoint,\n this.credential,\n this.callAutomationEventProcessor,\n this.internalPipelineOptions,\n );\n const answerCallResult: AnswerCallResult = {\n callConnectionProperties: callConnectionProperties,\n callConnection: callConnection,\n waitForEventProcessor: async (abortSignal, timeoutInMs) => {\n const answerCallEventResult: AnswerCallEventResult = {\n isSuccess: false,\n };\n await this.callAutomationEventProcessor.waitForEventProcessor(\n (event) => {\n if (event.callConnectionId === callConnectionId && event.kind === \"CallConnected\") {\n answerCallEventResult.isSuccess = true;\n answerCallEventResult.successResult = event;\n return true;\n }\n if (event.callConnectionId === callConnectionId && event.kind === \"AnswerFailed\") {\n answerCallEventResult.isSuccess = false;\n answerCallEventResult.failureResult = event;\n return true;\n } else {\n return false;\n }\n },\n abortSignal,\n timeoutInMs,\n );\n return answerCallEventResult;\n },\n };\n return answerCallResult;\n }\n throw \"callConnectionProperties / callConnectionId is missing in createCall result\";\n }\n\n /**\n * Redirect the call.\n *\n * @param incomingCallContext - The context associated with the call.\n * @param targetParticipant - The target identity to redirect the call to.\n * @param options - Additional request options contains redirectCall api options.\n */\n public async redirectCall(\n incomingCallContext: string,\n targetParticipant: CallInvite,\n options: RedirectCallOptions = {},\n ): Promise<void> {\n const request: RedirectCallRequest = {\n incomingCallContext: incomingCallContext,\n target: communicationIdentifierModelConverter(targetParticipant.targetParticipant),\n customCallingContext: this.createCustomCallingContextInternal(\n targetParticipant.customCallingContext!,\n ),\n };\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n\n return this.callAutomationApiClient.redirectCall(request, optionsInternal);\n }\n\n /**\n * Reject the call.\n *\n * @param incomingCallContext - The context associated with the call.\n * @param options - Additional request options contains rejectCall api options.\n */\n public async rejectCall(\n incomingCallContext: string,\n options: RejectCallOptions = {},\n ): Promise<void> {\n const request: RejectCallRequest = {\n incomingCallContext: incomingCallContext,\n callRejectReason: options.callRejectReason,\n };\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n\n return this.callAutomationApiClient.rejectCall(request, optionsInternal);\n }\n\n private createCustomCallingContextInternal(\n customCallingContext: CustomCallingContext,\n ): CustomCallingContextInternal {\n const sipHeaders: { [key: string]: string } = {};\n const voipHeaders: { [key: string]: string } = {};\n let teamsPhoneCallDetails: any = undefined;\n\n if (customCallingContext) {\n for (const header of customCallingContext) {\n if (header.kind === \"sipuui\") {\n sipHeaders[`User-To-User`] = header.value;\n } else if (header.kind === \"sipx\") {\n if (header.sipHeaderPrefix === \"X-\") {\n sipHeaders[`X-${header.key}`] = header.value;\n } else {\n sipHeaders[`X-MS-Custom-${header.key}`] = header.value;\n }\n } else if (header.kind === \"voip\") {\n voipHeaders[`${header.key}`] = header.value;\n } else if (header.kind === \"teamsPhoneCallDetails\") {\n teamsPhoneCallDetails = teamsPhoneCallDetailsModelConverter(header);\n }\n }\n }\n return {\n sipHeaders: sipHeaders,\n voipHeaders: voipHeaders,\n teamsPhoneCallDetails: teamsPhoneCallDetails,\n };\n }\n\n /**\n * Create connection to room call.\n * @param callLocator - Call locator to create connection.\n * @param callbackUrl - The callback url\n * @param options - Additional request options contains connect api options.\n */\n public async connectCall(\n callLocator: CallLocator,\n callbackUrl: string,\n options: ConnectCallOptions = {},\n ): Promise<ConnectCallResult> {\n const connectRequest: ConnectRequest = {\n callLocator: callLocator,\n callbackUri: callbackUrl,\n operationContext: options.operationContext,\n callIntelligenceOptions: options.callIntelligenceOptions,\n mediaStreamingOptions: options.mediaStreamingOptions,\n transcriptionOptions: options.transcriptionOptions,\n };\n\n if (callLocator.kind === \"groupCallLocator\") {\n connectRequest.callLocator.kind = \"groupCallLocator\";\n connectRequest.callLocator.groupCallId = callLocator.id;\n } else if (callLocator.kind === \"roomCallLocator\") {\n connectRequest.callLocator.kind = \"roomCallLocator\";\n connectRequest.callLocator.roomId = callLocator.id;\n } else {\n connectRequest.callLocator.kind = \"serverCallLocator\";\n connectRequest.callLocator.serverCallId = callLocator.id;\n }\n\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n\n const {\n callConnectionId,\n targets,\n sourceCallerIdNumber,\n answeredBy,\n source,\n answeredFor,\n ...result\n } = await this.callAutomationApiClient.connect(connectRequest, optionsInternal);\n\n if (callConnectionId) {\n const callConnectionProperties: CallConnectionProperties = {\n ...result,\n callConnectionId: callConnectionId,\n source: source ? communicationIdentifierConverter(source) : undefined,\n answeredby: answeredBy ? communicationUserIdentifierConverter(answeredBy) : undefined,\n targetParticipants: targets?.map((target) => communicationIdentifierConverter(target)),\n answeredFor: answeredFor ? phoneNumberIdentifierConverter(answeredFor) : undefined,\n sourceCallerIdNumber: sourceCallerIdNumber\n ? phoneNumberIdentifierConverter(sourceCallerIdNumber)\n : undefined,\n };\n const callConnection = new CallConnection(\n callConnectionId,\n this.callAutomationApiClient.endpoint,\n this.credential,\n this.callAutomationEventProcessor,\n this.internalPipelineOptions,\n );\n const connectResult: ConnectCallResult = {\n callConnectionProperties: callConnectionProperties,\n callConnection: callConnection,\n waitForEventProcessor: async (abortSignal, timeoutInMs) => {\n const connectCallEventResult: ConnectCallEventResult = {\n isSuccess: false,\n };\n await this.callAutomationEventProcessor.waitForEventProcessor(\n (event) => {\n if (event.callConnectionId === callConnectionId && event.kind === \"CallConnected\") {\n connectCallEventResult.isSuccess = true;\n connectCallEventResult.successResult = event;\n return true;\n }\n if (event.callConnectionId === callConnectionId && event.kind === \"ConnectFailed\") {\n connectCallEventResult.isSuccess = false;\n connectCallEventResult.failureResult = event;\n return true;\n } else {\n return false;\n }\n },\n abortSignal,\n timeoutInMs,\n );\n return connectCallEventResult;\n },\n };\n return connectResult;\n }\n throw \"callConnectionProperties / callConnectionId is missing in connect result\";\n }\n}\n"]}
1
+ {"version":3,"file":"callAutomationClient.js","sourceRoot":"","sources":["../../src/callAutomationClient.ts"],"names":[],"mappings":";;;AAGA,gDAAqD;AAOrD,sEAIqC;AACrC,kDAA4C;AAC5C,uDAQkC;AAClC,2DAAqD;AACrD,yDAAmD;AAcnD,wDAQ8B;AAC9B,gDAA8C;AAW9C;;;;GAIG;AACH,MAAM,6BAA6B,GAAG,CAAC,OAAY,EAA0C,EAAE,CAC7F,CAAC,CAAC,OAAO,IAAI,CAAC,IAAA,6BAAiB,EAAC,OAAO,CAAC,IAAI,CAAC,IAAA,sCAAe,EAAC,OAAO,CAAC,CAAC;AAExE;;GAEG;AACH,MAAa,oBAAoB;IACd,uBAAuB,CAA0B;IACjD,cAAc,CAAoC;IAClD,UAAU,CAAkC;IAC5C,uBAAuB,CAA0B;IAsBlE,YACE,qBAA6B,EAC7B,mBAAmF,EACnF,eAA4C,EAAE;QAE9C,MAAM,OAA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C,uBAAuB,CAC7B,CAAC;YACF,MAAM,aAAa,GAAsB;gBACvC,wBAAwB,EAAE,wBAAwB;gBAClD,cAAc,EAAE,cAAc;aAC/B,CAAC;YACF,OAAO,aAAa,CAAC;QACvB,CAAC;QACD,MAAM,0EAA0E,CAAC;IACnF,CAAC;CACF;AAnYD,oDAmYC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport type { CommonClientOptions } from \"@azure/core-client\";\nimport type { InternalPipelineOptions } from \"@azure/core-rest-pipeline\";\nimport type {\n CommunicationIdentifier,\n CommunicationUserIdentifier,\n} from \"@azure/communication-common\";\nimport {\n parseClientArguments,\n isKeyCredential,\n createCommunicationAuthPolicy,\n} from \"@azure/communication-common\";\nimport { logger } from \"./models/logger.js\";\nimport {\n AnswerCallRequest,\n CallAutomationApiClient,\n CommunicationUserIdentifierModel,\n CreateCallRequest,\n RedirectCallRequest,\n RejectCallRequest,\n ConnectRequest,\n} from \"./generated/src/index.js\";\nimport { CallConnection } from \"./callConnection.js\";\nimport { CallRecording } from \"./callRecording.js\";\nimport type {\n AnswerCallOptions,\n ConnectCallOptions,\n CreateCallOptions,\n RedirectCallOptions,\n RejectCallOptions,\n} from \"./models/options.js\";\nimport type { AnswerCallResult, ConnectCallResult, CreateCallResult } from \"./models/responses.js\";\nimport {\n type CallConnectionProperties,\n type CallInvite,\n type CallLocator,\n} from \"./models/models.js\";\nimport {\n communicationIdentifierConverter,\n communicationIdentifierModelConverter,\n communicationUserIdentifierConverter,\n communicationUserIdentifierModelConverter,\n phoneNumberIdentifierConverter,\n microsoftTeamsAppIdentifierModelConverter,\n PhoneNumberIdentifierModelConverter,\n} from \"./utli/converters.js\";\nimport { randomUUID } from \"@azure/core-util\";\n/**\n * Client options used to configure CallAutomation Client API requests.\n */\nexport interface CallAutomationClientOptions extends CommonClientOptions {\n /**\n * The identifier of the source of the call for call creating/answering/inviting operation.\n */\n sourceIdentity?: CommunicationUserIdentifier;\n}\n\n/**\n * Checks whether the type of a value is CallAutomationClientOptions or not.\n *\n * @param options - The value being checked.\n */\nconst isCallAutomationClientOptions = (options: any): options is CallAutomationClientOptions =>\n !!options && !isTokenCredential(options) && !isKeyCredential(options);\n\n/**\n * A CallAutomationClient represents a Client to the Azure Communication CallAutomation service.\n */\nexport class CallAutomationClient {\n private readonly callAutomationApiClient: CallAutomationApiClient;\n private readonly sourceIdentity?: CommunicationUserIdentifierModel;\n private readonly credential: TokenCredential | KeyCredential;\n private readonly internalPipelineOptions: InternalPipelineOptions;\n\n /**\n * Initializes a new instance of the CallAutomationClient class.\n * @param connectionString - Connection string to connect to an Azure Communication Service resource.\n * Example: \"endpoint=https://contoso.eastus.communications.azure.net/;accesskey=secret\";\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n constructor(connectionString: string, options?: CallAutomationClientOptions);\n\n /**\n * Initializes a new instance of the CallAutomationClient class using a TokenCredential or KeyCredential.\n * @param endpoint - The endpoint of the service (ex: https://contoso.eastus.communications.azure.net).\n * @param credential - TokenCredential or KeyCredential that is used to authenticate requests to the service.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n constructor(\n endpoint: string,\n credential: TokenCredential | KeyCredential,\n options?: CallAutomationClientOptions,\n );\n\n constructor(\n connectionStringOrUrl: string,\n credentialOrOptions?: KeyCredential | TokenCredential | CallAutomationClientOptions,\n maybeOptions: CallAutomationClientOptions = {},\n ) {\n const options = isCallAutomationClientOptions(credentialOrOptions)\n ? credentialOrOptions\n : maybeOptions;\n\n if (!options?.userAgentOptions) {\n options.userAgentOptions = {};\n }\n\n this.internalPipelineOptions = {\n ...options,\n ...{\n loggingOptions: {\n logger: logger.info,\n },\n },\n };\n\n const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);\n const authPolicy = createCommunicationAuthPolicy(credential);\n\n this.credential = credential;\n this.callAutomationApiClient = new CallAutomationApiClient(url, this.internalPipelineOptions);\n this.callAutomationApiClient.pipeline.addPolicy(authPolicy);\n\n this.sourceIdentity = communicationUserIdentifierModelConverter(options.sourceIdentity);\n }\n\n /**\n * Initializes a new instance of CallConnection.\n * @param callConnectionId - The CallConnection id for the CallConnection instance. (ex: 421CONTOSO-cRD6-4RDc-a078-99dRANDOMf).\n */\n public getCallConnection(callConnectionId: string): CallConnection {\n return new CallConnection(\n callConnectionId,\n this.callAutomationApiClient.endpoint,\n this.credential,\n this.internalPipelineOptions,\n );\n }\n\n /**\n * Initializes a new instance of CallRecording.\n */\n public getCallRecording(): CallRecording {\n return new CallRecording(\n this.callAutomationApiClient.endpoint,\n this.credential,\n this.internalPipelineOptions,\n );\n }\n\n /**\n * Get Source Identity that is used for create and answer call\n */\n public getSourceIdentity(): CommunicationUserIdentifier | undefined {\n return communicationUserIdentifierConverter(this.sourceIdentity);\n }\n\n private async createCallInternal(\n request: CreateCallRequest,\n options?: CreateCallOptions,\n ): Promise<CreateCallResult> {\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const {\n callConnectionId,\n answeredBy,\n targets,\n sourceCallerIdNumber,\n source,\n answeredFor,\n ...result\n } = await this.callAutomationApiClient.createCall(request, optionsInternal);\n\n if (callConnectionId) {\n const callConnectionPropertiesDto: CallConnectionProperties = {\n ...result,\n callConnectionId: callConnectionId,\n source: source ? communicationIdentifierConverter(source) : undefined,\n answeredby: communicationUserIdentifierConverter(answeredBy),\n answeredFor: answeredFor ? phoneNumberIdentifierConverter(answeredFor) : undefined,\n targetParticipants: targets?.map((returnedTarget) =>\n communicationIdentifierConverter(returnedTarget),\n ),\n sourceCallerIdNumber: sourceCallerIdNumber\n ? phoneNumberIdentifierConverter(sourceCallerIdNumber)\n : undefined,\n };\n const callConnection = new CallConnection(\n callConnectionId,\n this.callAutomationApiClient.endpoint,\n this.credential,\n this.internalPipelineOptions,\n );\n const createCallResult: CreateCallResult = {\n callConnectionProperties: callConnectionPropertiesDto,\n callConnection: callConnection,\n };\n return createCallResult;\n }\n throw \"callConnectionProperties / callConnectionId is missing in createCall result\";\n }\n\n /**\n * Create an outgoing call from source to a target identity.\n * @param targetParticipant - A single target.\n * @param callbackUrl - The callback url.\n * @param options - Additional request options contains createCallConnection api options.\n */\n public async createCall(\n targetParticipant: CallInvite,\n callbackUrl: string,\n options: CreateCallOptions = {},\n ): Promise<CreateCallResult> {\n const request: CreateCallRequest = {\n source: this.sourceIdentity,\n targets: [communicationIdentifierModelConverter(targetParticipant.targetParticipant)],\n callbackUri: callbackUrl,\n operationContext: options.operationContext,\n callIntelligenceOptions: options.callIntelligenceOptions,\n mediaStreamingOptions: options.mediaStreamingOptions,\n transcriptionOptions: options.transcriptionOptions,\n sourceCallerIdNumber: PhoneNumberIdentifierModelConverter(\n targetParticipant.sourceCallIdNumber,\n ),\n sourceDisplayName: targetParticipant.sourceDisplayName,\n teamsAppSource: microsoftTeamsAppIdentifierModelConverter(options.teamsAppSource),\n enableLoopbackAudio: options.enableLoopbackAudio,\n };\n\n return this.createCallInternal(request, options);\n }\n\n /**\n * Create an outgoing call from source to a group of targets identities.\n * @param targetParticipants - A group of targets identities.\n * @param callbackUrl - The callback url.\n * @param options - Additional request options contains createCallConnection api options.\n */\n public async createGroupCall(\n targetParticipants: CommunicationIdentifier[],\n callbackUrl: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: CreateCallOptions = {},\n ): Promise<CreateCallResult> {\n const request: CreateCallRequest = {\n source: this.sourceIdentity,\n targets: targetParticipants.map((target) => communicationIdentifierModelConverter(target)),\n callbackUri: callbackUrl,\n operationContext: options.operationContext,\n callIntelligenceOptions: options.callIntelligenceOptions,\n mediaStreamingOptions: options.mediaStreamingOptions,\n transcriptionOptions: options.transcriptionOptions,\n sourceCallerIdNumber: PhoneNumberIdentifierModelConverter(options.sourceCallIdNumber),\n sourceDisplayName: options.sourceDisplayName,\n teamsAppSource: microsoftTeamsAppIdentifierModelConverter(options.teamsAppSource),\n enableLoopbackAudio: options.enableLoopbackAudio,\n };\n\n return this.createCallInternal(request, options);\n }\n\n /**\n * Answer the call.\n * @param incomingCallContext - The context associated with the call.\n * @param callbackUrl - The callback url.\n * @param options - Additional request options contains answerCall api options.\n */\n public async answerCall(\n incomingCallContext: string,\n callbackUrl: string,\n options: AnswerCallOptions = {},\n ): Promise<AnswerCallResult> {\n const {\n callIntelligenceOptions,\n mediaStreamingOptions,\n transcriptionOptions,\n operationContext,\n ...operationOptions\n } = options;\n const request: AnswerCallRequest = {\n incomingCallContext: incomingCallContext,\n mediaStreamingOptions: mediaStreamingOptions,\n transcriptionOptions: transcriptionOptions,\n callIntelligenceOptions: callIntelligenceOptions,\n operationContext: operationContext,\n callbackUri: callbackUrl,\n answeredBy: this.sourceIdentity,\n enableLoopbackAudio: options.enableLoopbackAudio,\n };\n const optionsInternal = {\n ...operationOptions,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const {\n callConnectionId,\n targets,\n sourceCallerIdNumber,\n answeredBy,\n source,\n answeredFor,\n ...result\n } = await this.callAutomationApiClient.answerCall(request, optionsInternal);\n\n if (callConnectionId) {\n const callConnectionProperties: CallConnectionProperties = {\n ...result,\n callConnectionId: callConnectionId,\n source: source ? communicationIdentifierConverter(source) : undefined,\n answeredby: communicationUserIdentifierConverter(answeredBy),\n answeredFor: answeredFor ? phoneNumberIdentifierConverter(answeredFor) : undefined,\n targetParticipants: targets?.map((target) => communicationIdentifierConverter(target)),\n sourceCallerIdNumber: sourceCallerIdNumber\n ? phoneNumberIdentifierConverter(sourceCallerIdNumber)\n : undefined,\n };\n const callConnection = new CallConnection(\n callConnectionId,\n this.callAutomationApiClient.endpoint,\n this.credential,\n this.internalPipelineOptions,\n );\n const answerCallResult: AnswerCallResult = {\n callConnectionProperties: callConnectionProperties,\n callConnection: callConnection,\n };\n return answerCallResult;\n }\n throw \"callConnectionProperties / callConnectionId is missing in createCall result\";\n }\n\n /**\n * Redirect the call.\n *\n * @param incomingCallContext - The context associated with the call.\n * @param targetParticipant - The target identity to redirect the call to.\n * @param options - Additional request options contains redirectCall api options.\n */\n public async redirectCall(\n incomingCallContext: string,\n targetParticipant: CallInvite,\n options: RedirectCallOptions = {},\n ): Promise<void> {\n const request: RedirectCallRequest = {\n incomingCallContext: incomingCallContext,\n target: communicationIdentifierModelConverter(targetParticipant.targetParticipant),\n };\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n\n return this.callAutomationApiClient.redirectCall(request, optionsInternal);\n }\n\n /**\n * Reject the call.\n *\n * @param incomingCallContext - The context associated with the call.\n * @param options - Additional request options contains rejectCall api options.\n */\n public async rejectCall(\n incomingCallContext: string,\n options: RejectCallOptions = {},\n ): Promise<void> {\n const request: RejectCallRequest = {\n incomingCallContext: incomingCallContext,\n callRejectReason: options.callRejectReason,\n };\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n\n return this.callAutomationApiClient.rejectCall(request, optionsInternal);\n }\n\n /**\n * Create connection to room call.\n * @param callLocator - Call locator to create connection.\n * @param callbackUrl - The callback url\n * @param options - Additional request options contains connect api options.\n */\n public async connectCall(\n callLocator: CallLocator,\n callbackUrl: string,\n options: ConnectCallOptions = {},\n ): Promise<ConnectCallResult> {\n const connectRequest: ConnectRequest = {\n callLocator: callLocator,\n callbackUri: callbackUrl,\n operationContext: options.operationContext,\n callIntelligenceOptions: options.callIntelligenceOptions,\n mediaStreamingOptions: options.mediaStreamingOptions,\n transcriptionOptions: options.transcriptionOptions,\n };\n\n if (callLocator.kind === \"groupCallLocator\") {\n connectRequest.callLocator.kind = \"groupCallLocator\";\n connectRequest.callLocator.groupCallId = callLocator.id;\n } else if (callLocator.kind === \"roomCallLocator\") {\n connectRequest.callLocator.kind = \"roomCallLocator\";\n connectRequest.callLocator.roomId = callLocator.id;\n } else {\n connectRequest.callLocator.kind = \"serverCallLocator\";\n connectRequest.callLocator.serverCallId = callLocator.id;\n }\n\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n\n const {\n callConnectionId,\n targets,\n sourceCallerIdNumber,\n answeredBy,\n source,\n answeredFor,\n ...result\n } = await this.callAutomationApiClient.connect(connectRequest, optionsInternal);\n\n if (callConnectionId) {\n const callConnectionProperties: CallConnectionProperties = {\n ...result,\n callConnectionId: callConnectionId,\n source: source ? communicationIdentifierConverter(source) : undefined,\n answeredby: answeredBy ? communicationUserIdentifierConverter(answeredBy) : undefined,\n targetParticipants: targets?.map((target) => communicationIdentifierConverter(target)),\n answeredFor: answeredFor ? phoneNumberIdentifierConverter(answeredFor) : undefined,\n sourceCallerIdNumber: sourceCallerIdNumber\n ? phoneNumberIdentifierConverter(sourceCallerIdNumber)\n : undefined,\n };\n const callConnection = new CallConnection(\n callConnectionId,\n this.callAutomationApiClient.endpoint,\n this.credential,\n this.internalPipelineOptions,\n );\n const connectResult: ConnectCallResult = {\n callConnectionProperties: callConnectionProperties,\n callConnection: callConnection,\n };\n return connectResult;\n }\n throw \"callConnectionProperties / callConnectionId is missing in connect result\";\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"callAutomationEventParser.d.ts","sourceRoot":"","sources":["../../src/callAutomationEventParser.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,mBAAmB,EA8CpB,MAAM,oBAAoB,CAAC;AAO5B;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9C,mBAAmB,CA4LrB"}
1
+ {"version":3,"file":"callAutomationEventParser.d.ts","sourceRoot":"","sources":["../../src/callAutomationEventParser.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,mBAAmB,EAwCpB,MAAM,oBAAoB,CAAC;AAO5B;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9C,mBAAmB,CAuJrB"}