@azure/communication-call-automation 1.5.0-beta.2 → 1.6.0-alpha.20250711.2

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 (415) hide show
  1. package/README.md +51 -1
  2. package/dist/browser/callAutomationClient.d.ts +9 -2
  3. package/dist/browser/callAutomationClient.d.ts.map +1 -1
  4. package/dist/browser/callAutomationClient.js +115 -10
  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 +47 -1
  8. package/dist/browser/callAutomationEventParser.js.map +1 -1
  9. package/dist/browser/callConnection.d.ts +16 -6
  10. package/dist/browser/callConnection.d.ts.map +1 -1
  11. package/dist/browser/callConnection.js +166 -15
  12. package/dist/browser/callConnection.js.map +1 -1
  13. package/dist/browser/callMedia.d.ts +20 -10
  14. package/dist/browser/callMedia.d.ts.map +1 -1
  15. package/dist/browser/callMedia.js +190 -22
  16. package/dist/browser/callMedia.js.map +1 -1
  17. package/dist/browser/callRecording.d.ts +8 -2
  18. package/dist/browser/callRecording.d.ts.map +1 -1
  19. package/dist/browser/callRecording.js +20 -5
  20. package/dist/browser/callRecording.js.map +1 -1
  21. package/dist/browser/eventprocessor/callAutomationEventProcessor.d.ts +39 -0
  22. package/dist/browser/eventprocessor/callAutomationEventProcessor.d.ts.map +1 -0
  23. package/dist/browser/eventprocessor/callAutomationEventProcessor.js +137 -0
  24. package/dist/browser/eventprocessor/callAutomationEventProcessor.js.map +1 -0
  25. package/dist/browser/eventprocessor/eventResponses.d.ts +134 -0
  26. package/dist/browser/eventprocessor/eventResponses.d.ts.map +1 -0
  27. package/dist/browser/eventprocessor/eventResponses.js +4 -0
  28. package/dist/browser/eventprocessor/eventResponses.js.map +1 -0
  29. package/dist/browser/generated/src/callAutomationApiClient.d.ts +2 -1
  30. package/dist/browser/generated/src/callAutomationApiClient.d.ts.map +1 -1
  31. package/dist/browser/generated/src/callAutomationApiClient.js +4 -3
  32. package/dist/browser/generated/src/callAutomationApiClient.js.map +1 -1
  33. package/dist/browser/generated/src/models/index.d.ts +971 -206
  34. package/dist/browser/generated/src/models/index.d.ts.map +1 -1
  35. package/dist/browser/generated/src/models/index.js +124 -46
  36. package/dist/browser/generated/src/models/index.js.map +1 -1
  37. package/dist/browser/generated/src/models/mappers.d.ts +59 -11
  38. package/dist/browser/generated/src/models/mappers.d.ts.map +1 -1
  39. package/dist/browser/generated/src/models/mappers.js +2122 -466
  40. package/dist/browser/generated/src/models/mappers.js.map +1 -1
  41. package/dist/browser/generated/src/models/parameters.d.ts +8 -1
  42. package/dist/browser/generated/src/models/parameters.d.ts.map +1 -1
  43. package/dist/browser/generated/src/models/parameters.js +45 -6
  44. package/dist/browser/generated/src/models/parameters.js.map +1 -1
  45. package/dist/browser/generated/src/operations/callConnection.d.ts +16 -2
  46. package/dist/browser/generated/src/operations/callConnection.d.ts.map +1 -1
  47. package/dist/browser/generated/src/operations/callConnection.js +65 -1
  48. package/dist/browser/generated/src/operations/callConnection.js.map +1 -1
  49. package/dist/browser/generated/src/operations/callDialog.d.ts +35 -0
  50. package/dist/browser/generated/src/operations/callDialog.d.ts.map +1 -0
  51. package/dist/browser/generated/src/operations/callDialog.js +111 -0
  52. package/dist/browser/generated/src/operations/callDialog.js.map +1 -0
  53. package/dist/browser/generated/src/operations/callMedia.d.ts +15 -8
  54. package/dist/browser/generated/src/operations/callMedia.d.ts.map +1 -1
  55. package/dist/browser/generated/src/operations/callMedia.js +50 -25
  56. package/dist/browser/generated/src/operations/callMedia.js.map +1 -1
  57. package/dist/browser/generated/src/operations/callRecording.d.ts +7 -1
  58. package/dist/browser/generated/src/operations/callRecording.d.ts.map +1 -1
  59. package/dist/browser/generated/src/operations/callRecording.js +24 -0
  60. package/dist/browser/generated/src/operations/callRecording.js.map +1 -1
  61. package/dist/browser/generated/src/operations/index.d.ts +1 -0
  62. package/dist/browser/generated/src/operations/index.d.ts.map +1 -1
  63. package/dist/browser/generated/src/operations/index.js +1 -0
  64. package/dist/browser/generated/src/operations/index.js.map +1 -1
  65. package/dist/browser/generated/src/operationsInterfaces/callConnection.d.ts +16 -2
  66. package/dist/browser/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
  67. package/dist/browser/generated/src/operationsInterfaces/callConnection.js.map +1 -1
  68. package/dist/browser/generated/src/operationsInterfaces/callDialog.d.ts +27 -0
  69. package/dist/browser/generated/src/operationsInterfaces/callDialog.d.ts.map +1 -0
  70. package/dist/browser/generated/src/operationsInterfaces/callDialog.js +9 -0
  71. package/dist/browser/generated/src/operationsInterfaces/callDialog.js.map +1 -0
  72. package/dist/browser/generated/src/operationsInterfaces/callMedia.d.ts +15 -8
  73. package/dist/browser/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
  74. package/dist/browser/generated/src/operationsInterfaces/callMedia.js.map +1 -1
  75. package/dist/browser/generated/src/operationsInterfaces/callRecording.d.ts +7 -1
  76. package/dist/browser/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
  77. package/dist/browser/generated/src/operationsInterfaces/callRecording.js.map +1 -1
  78. package/dist/browser/generated/src/operationsInterfaces/index.d.ts +1 -0
  79. package/dist/browser/generated/src/operationsInterfaces/index.d.ts.map +1 -1
  80. package/dist/browser/generated/src/operationsInterfaces/index.js +1 -0
  81. package/dist/browser/generated/src/operationsInterfaces/index.js.map +1 -1
  82. package/dist/browser/index.d.ts +2 -0
  83. package/dist/browser/index.d.ts.map +1 -1
  84. package/dist/browser/index.js +2 -0
  85. package/dist/browser/index.js.map +1 -1
  86. package/dist/browser/models/constants.js +1 -1
  87. package/dist/browser/models/constants.js.map +1 -1
  88. package/dist/browser/models/events.d.ts +188 -62
  89. package/dist/browser/models/events.d.ts.map +1 -1
  90. package/dist/browser/models/events.js.map +1 -1
  91. package/dist/browser/models/models.d.ts +85 -7
  92. package/dist/browser/models/models.d.ts.map +1 -1
  93. package/dist/browser/models/models.js +3 -1
  94. package/dist/browser/models/models.js.map +1 -1
  95. package/dist/browser/models/options.d.ts +49 -2
  96. package/dist/browser/models/options.d.ts.map +1 -1
  97. package/dist/browser/models/options.js.map +1 -1
  98. package/dist/browser/models/responses.d.ts +82 -10
  99. package/dist/browser/models/responses.d.ts.map +1 -1
  100. package/dist/browser/models/responses.js.map +1 -1
  101. package/dist/browser/utli/converters.d.ts +26 -2
  102. package/dist/browser/utli/converters.d.ts.map +1 -1
  103. package/dist/browser/utli/converters.js +114 -19
  104. package/dist/browser/utli/converters.js.map +1 -1
  105. package/dist/commonjs/callAutomationClient.d.ts +9 -2
  106. package/dist/commonjs/callAutomationClient.d.ts.map +1 -1
  107. package/dist/commonjs/callAutomationClient.js +116 -11
  108. package/dist/commonjs/callAutomationClient.js.map +1 -1
  109. package/dist/commonjs/callAutomationEventParser.d.ts.map +1 -1
  110. package/dist/commonjs/callAutomationEventParser.js +46 -0
  111. package/dist/commonjs/callAutomationEventParser.js.map +1 -1
  112. package/dist/commonjs/callConnection.d.ts +16 -6
  113. package/dist/commonjs/callConnection.d.ts.map +1 -1
  114. package/dist/commonjs/callConnection.js +167 -16
  115. package/dist/commonjs/callConnection.js.map +1 -1
  116. package/dist/commonjs/callMedia.d.ts +20 -10
  117. package/dist/commonjs/callMedia.d.ts.map +1 -1
  118. package/dist/commonjs/callMedia.js +209 -41
  119. package/dist/commonjs/callMedia.js.map +1 -1
  120. package/dist/commonjs/callRecording.d.ts +8 -2
  121. package/dist/commonjs/callRecording.d.ts.map +1 -1
  122. package/dist/commonjs/callRecording.js +20 -5
  123. package/dist/commonjs/callRecording.js.map +1 -1
  124. package/dist/commonjs/eventprocessor/callAutomationEventProcessor.d.ts +39 -0
  125. package/dist/commonjs/eventprocessor/callAutomationEventProcessor.d.ts.map +1 -0
  126. package/dist/commonjs/eventprocessor/callAutomationEventProcessor.js +141 -0
  127. package/dist/commonjs/eventprocessor/callAutomationEventProcessor.js.map +1 -0
  128. package/dist/commonjs/eventprocessor/eventResponses.d.ts +134 -0
  129. package/dist/commonjs/eventprocessor/eventResponses.d.ts.map +1 -0
  130. package/dist/commonjs/eventprocessor/eventResponses.js +5 -0
  131. package/dist/commonjs/eventprocessor/eventResponses.js.map +1 -0
  132. package/dist/commonjs/generated/src/callAutomationApiClient.d.ts +2 -1
  133. package/dist/commonjs/generated/src/callAutomationApiClient.d.ts.map +1 -1
  134. package/dist/commonjs/generated/src/callAutomationApiClient.js +3 -2
  135. package/dist/commonjs/generated/src/callAutomationApiClient.js.map +1 -1
  136. package/dist/commonjs/generated/src/models/index.d.ts +971 -206
  137. package/dist/commonjs/generated/src/models/index.d.ts.map +1 -1
  138. package/dist/commonjs/generated/src/models/index.js +125 -47
  139. package/dist/commonjs/generated/src/models/index.js.map +1 -1
  140. package/dist/commonjs/generated/src/models/mappers.d.ts +59 -11
  141. package/dist/commonjs/generated/src/models/mappers.d.ts.map +1 -1
  142. package/dist/commonjs/generated/src/models/mappers.js +2125 -469
  143. package/dist/commonjs/generated/src/models/mappers.js.map +1 -1
  144. package/dist/commonjs/generated/src/models/parameters.d.ts +8 -1
  145. package/dist/commonjs/generated/src/models/parameters.d.ts.map +1 -1
  146. package/dist/commonjs/generated/src/models/parameters.js +45 -6
  147. package/dist/commonjs/generated/src/models/parameters.js.map +1 -1
  148. package/dist/commonjs/generated/src/operations/callConnection.d.ts +16 -2
  149. package/dist/commonjs/generated/src/operations/callConnection.d.ts.map +1 -1
  150. package/dist/commonjs/generated/src/operations/callConnection.js +65 -1
  151. package/dist/commonjs/generated/src/operations/callConnection.js.map +1 -1
  152. package/dist/commonjs/generated/src/operations/callDialog.d.ts +35 -0
  153. package/dist/commonjs/generated/src/operations/callDialog.d.ts.map +1 -0
  154. package/dist/commonjs/generated/src/operations/callDialog.js +116 -0
  155. package/dist/commonjs/generated/src/operations/callDialog.js.map +1 -0
  156. package/dist/commonjs/generated/src/operations/callMedia.d.ts +15 -8
  157. package/dist/commonjs/generated/src/operations/callMedia.d.ts.map +1 -1
  158. package/dist/commonjs/generated/src/operations/callMedia.js +50 -25
  159. package/dist/commonjs/generated/src/operations/callMedia.js.map +1 -1
  160. package/dist/commonjs/generated/src/operations/callRecording.d.ts +7 -1
  161. package/dist/commonjs/generated/src/operations/callRecording.d.ts.map +1 -1
  162. package/dist/commonjs/generated/src/operations/callRecording.js +24 -0
  163. package/dist/commonjs/generated/src/operations/callRecording.js.map +1 -1
  164. package/dist/commonjs/generated/src/operations/index.d.ts +1 -0
  165. package/dist/commonjs/generated/src/operations/index.d.ts.map +1 -1
  166. package/dist/commonjs/generated/src/operations/index.js +1 -0
  167. package/dist/commonjs/generated/src/operations/index.js.map +1 -1
  168. package/dist/commonjs/generated/src/operationsInterfaces/callConnection.d.ts +16 -2
  169. package/dist/commonjs/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
  170. package/dist/commonjs/generated/src/operationsInterfaces/callConnection.js.map +1 -1
  171. package/dist/commonjs/generated/src/operationsInterfaces/callDialog.d.ts +27 -0
  172. package/dist/commonjs/generated/src/operationsInterfaces/callDialog.d.ts.map +1 -0
  173. package/dist/commonjs/generated/src/operationsInterfaces/callDialog.js +10 -0
  174. package/dist/commonjs/generated/src/operationsInterfaces/callDialog.js.map +1 -0
  175. package/dist/commonjs/generated/src/operationsInterfaces/callMedia.d.ts +15 -8
  176. package/dist/commonjs/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
  177. package/dist/commonjs/generated/src/operationsInterfaces/callMedia.js.map +1 -1
  178. package/dist/commonjs/generated/src/operationsInterfaces/callRecording.d.ts +7 -1
  179. package/dist/commonjs/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
  180. package/dist/commonjs/generated/src/operationsInterfaces/callRecording.js.map +1 -1
  181. package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts +1 -0
  182. package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts.map +1 -1
  183. package/dist/commonjs/generated/src/operationsInterfaces/index.js +1 -0
  184. package/dist/commonjs/generated/src/operationsInterfaces/index.js.map +1 -1
  185. package/dist/commonjs/index.d.ts +2 -0
  186. package/dist/commonjs/index.d.ts.map +1 -1
  187. package/dist/commonjs/index.js +2 -0
  188. package/dist/commonjs/index.js.map +1 -1
  189. package/dist/commonjs/models/constants.js +1 -1
  190. package/dist/commonjs/models/constants.js.map +1 -1
  191. package/dist/commonjs/models/events.d.ts +188 -62
  192. package/dist/commonjs/models/events.d.ts.map +1 -1
  193. package/dist/commonjs/models/events.js.map +1 -1
  194. package/dist/commonjs/models/models.d.ts +85 -7
  195. package/dist/commonjs/models/models.d.ts.map +1 -1
  196. package/dist/commonjs/models/models.js +11 -6
  197. package/dist/commonjs/models/models.js.map +1 -1
  198. package/dist/commonjs/models/options.d.ts +49 -2
  199. package/dist/commonjs/models/options.d.ts.map +1 -1
  200. package/dist/commonjs/models/options.js.map +1 -1
  201. package/dist/commonjs/models/responses.d.ts +82 -10
  202. package/dist/commonjs/models/responses.d.ts.map +1 -1
  203. package/dist/commonjs/models/responses.js.map +1 -1
  204. package/dist/commonjs/tsdoc-metadata.json +1 -1
  205. package/dist/commonjs/utli/converters.d.ts +26 -2
  206. package/dist/commonjs/utli/converters.d.ts.map +1 -1
  207. package/dist/commonjs/utli/converters.js +119 -18
  208. package/dist/commonjs/utli/converters.js.map +1 -1
  209. package/dist/esm/callAutomationClient.d.ts +9 -2
  210. package/dist/esm/callAutomationClient.d.ts.map +1 -1
  211. package/dist/esm/callAutomationClient.js +115 -10
  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 +47 -1
  215. package/dist/esm/callAutomationEventParser.js.map +1 -1
  216. package/dist/esm/callConnection.d.ts +16 -6
  217. package/dist/esm/callConnection.d.ts.map +1 -1
  218. package/dist/esm/callConnection.js +166 -15
  219. package/dist/esm/callConnection.js.map +1 -1
  220. package/dist/esm/callMedia.d.ts +20 -10
  221. package/dist/esm/callMedia.d.ts.map +1 -1
  222. package/dist/esm/callMedia.js +190 -22
  223. package/dist/esm/callMedia.js.map +1 -1
  224. package/dist/esm/callRecording.d.ts +8 -2
  225. package/dist/esm/callRecording.d.ts.map +1 -1
  226. package/dist/esm/callRecording.js +20 -5
  227. package/dist/esm/callRecording.js.map +1 -1
  228. package/dist/esm/eventprocessor/callAutomationEventProcessor.d.ts +39 -0
  229. package/dist/esm/eventprocessor/callAutomationEventProcessor.d.ts.map +1 -0
  230. package/dist/esm/eventprocessor/callAutomationEventProcessor.js +137 -0
  231. package/dist/esm/eventprocessor/callAutomationEventProcessor.js.map +1 -0
  232. package/dist/esm/eventprocessor/eventResponses.d.ts +134 -0
  233. package/dist/esm/eventprocessor/eventResponses.d.ts.map +1 -0
  234. package/dist/esm/eventprocessor/eventResponses.js +4 -0
  235. package/dist/esm/eventprocessor/eventResponses.js.map +1 -0
  236. package/dist/esm/generated/src/callAutomationApiClient.d.ts +2 -1
  237. package/dist/esm/generated/src/callAutomationApiClient.d.ts.map +1 -1
  238. package/dist/esm/generated/src/callAutomationApiClient.js +4 -3
  239. package/dist/esm/generated/src/callAutomationApiClient.js.map +1 -1
  240. package/dist/esm/generated/src/models/index.d.ts +971 -206
  241. package/dist/esm/generated/src/models/index.d.ts.map +1 -1
  242. package/dist/esm/generated/src/models/index.js +124 -46
  243. package/dist/esm/generated/src/models/index.js.map +1 -1
  244. package/dist/esm/generated/src/models/mappers.d.ts +59 -11
  245. package/dist/esm/generated/src/models/mappers.d.ts.map +1 -1
  246. package/dist/esm/generated/src/models/mappers.js +2122 -466
  247. package/dist/esm/generated/src/models/mappers.js.map +1 -1
  248. package/dist/esm/generated/src/models/parameters.d.ts +8 -1
  249. package/dist/esm/generated/src/models/parameters.d.ts.map +1 -1
  250. package/dist/esm/generated/src/models/parameters.js +45 -6
  251. package/dist/esm/generated/src/models/parameters.js.map +1 -1
  252. package/dist/esm/generated/src/operations/callConnection.d.ts +16 -2
  253. package/dist/esm/generated/src/operations/callConnection.d.ts.map +1 -1
  254. package/dist/esm/generated/src/operations/callConnection.js +65 -1
  255. package/dist/esm/generated/src/operations/callConnection.js.map +1 -1
  256. package/dist/esm/generated/src/operations/callDialog.d.ts +35 -0
  257. package/dist/esm/generated/src/operations/callDialog.d.ts.map +1 -0
  258. package/dist/esm/generated/src/operations/callDialog.js +111 -0
  259. package/dist/esm/generated/src/operations/callDialog.js.map +1 -0
  260. package/dist/esm/generated/src/operations/callMedia.d.ts +15 -8
  261. package/dist/esm/generated/src/operations/callMedia.d.ts.map +1 -1
  262. package/dist/esm/generated/src/operations/callMedia.js +50 -25
  263. package/dist/esm/generated/src/operations/callMedia.js.map +1 -1
  264. package/dist/esm/generated/src/operations/callRecording.d.ts +7 -1
  265. package/dist/esm/generated/src/operations/callRecording.d.ts.map +1 -1
  266. package/dist/esm/generated/src/operations/callRecording.js +24 -0
  267. package/dist/esm/generated/src/operations/callRecording.js.map +1 -1
  268. package/dist/esm/generated/src/operations/index.d.ts +1 -0
  269. package/dist/esm/generated/src/operations/index.d.ts.map +1 -1
  270. package/dist/esm/generated/src/operations/index.js +1 -0
  271. package/dist/esm/generated/src/operations/index.js.map +1 -1
  272. package/dist/esm/generated/src/operationsInterfaces/callConnection.d.ts +16 -2
  273. package/dist/esm/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
  274. package/dist/esm/generated/src/operationsInterfaces/callConnection.js.map +1 -1
  275. package/dist/esm/generated/src/operationsInterfaces/callDialog.d.ts +27 -0
  276. package/dist/esm/generated/src/operationsInterfaces/callDialog.d.ts.map +1 -0
  277. package/dist/esm/generated/src/operationsInterfaces/callDialog.js +9 -0
  278. package/dist/esm/generated/src/operationsInterfaces/callDialog.js.map +1 -0
  279. package/dist/esm/generated/src/operationsInterfaces/callMedia.d.ts +15 -8
  280. package/dist/esm/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
  281. package/dist/esm/generated/src/operationsInterfaces/callMedia.js.map +1 -1
  282. package/dist/esm/generated/src/operationsInterfaces/callRecording.d.ts +7 -1
  283. package/dist/esm/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
  284. package/dist/esm/generated/src/operationsInterfaces/callRecording.js.map +1 -1
  285. package/dist/esm/generated/src/operationsInterfaces/index.d.ts +1 -0
  286. package/dist/esm/generated/src/operationsInterfaces/index.d.ts.map +1 -1
  287. package/dist/esm/generated/src/operationsInterfaces/index.js +1 -0
  288. package/dist/esm/generated/src/operationsInterfaces/index.js.map +1 -1
  289. package/dist/esm/index.d.ts +2 -0
  290. package/dist/esm/index.d.ts.map +1 -1
  291. package/dist/esm/index.js +2 -0
  292. package/dist/esm/index.js.map +1 -1
  293. package/dist/esm/models/constants.js +1 -1
  294. package/dist/esm/models/constants.js.map +1 -1
  295. package/dist/esm/models/events.d.ts +188 -62
  296. package/dist/esm/models/events.d.ts.map +1 -1
  297. package/dist/esm/models/events.js.map +1 -1
  298. package/dist/esm/models/models.d.ts +85 -7
  299. package/dist/esm/models/models.d.ts.map +1 -1
  300. package/dist/esm/models/models.js +3 -1
  301. package/dist/esm/models/models.js.map +1 -1
  302. package/dist/esm/models/options.d.ts +49 -2
  303. package/dist/esm/models/options.d.ts.map +1 -1
  304. package/dist/esm/models/options.js.map +1 -1
  305. package/dist/esm/models/responses.d.ts +82 -10
  306. package/dist/esm/models/responses.d.ts.map +1 -1
  307. package/dist/esm/models/responses.js.map +1 -1
  308. package/dist/esm/utli/converters.d.ts +26 -2
  309. package/dist/esm/utli/converters.d.ts.map +1 -1
  310. package/dist/esm/utli/converters.js +114 -19
  311. package/dist/esm/utli/converters.js.map +1 -1
  312. package/dist/react-native/callAutomationClient.d.ts +9 -2
  313. package/dist/react-native/callAutomationClient.d.ts.map +1 -1
  314. package/dist/react-native/callAutomationClient.js +115 -10
  315. package/dist/react-native/callAutomationClient.js.map +1 -1
  316. package/dist/react-native/callAutomationEventParser.d.ts.map +1 -1
  317. package/dist/react-native/callAutomationEventParser.js +47 -1
  318. package/dist/react-native/callAutomationEventParser.js.map +1 -1
  319. package/dist/react-native/callConnection.d.ts +16 -6
  320. package/dist/react-native/callConnection.d.ts.map +1 -1
  321. package/dist/react-native/callConnection.js +166 -15
  322. package/dist/react-native/callConnection.js.map +1 -1
  323. package/dist/react-native/callMedia.d.ts +20 -10
  324. package/dist/react-native/callMedia.d.ts.map +1 -1
  325. package/dist/react-native/callMedia.js +190 -22
  326. package/dist/react-native/callMedia.js.map +1 -1
  327. package/dist/react-native/callRecording.d.ts +8 -2
  328. package/dist/react-native/callRecording.d.ts.map +1 -1
  329. package/dist/react-native/callRecording.js +20 -5
  330. package/dist/react-native/callRecording.js.map +1 -1
  331. package/dist/react-native/eventprocessor/callAutomationEventProcessor.d.ts +39 -0
  332. package/dist/react-native/eventprocessor/callAutomationEventProcessor.d.ts.map +1 -0
  333. package/dist/react-native/eventprocessor/callAutomationEventProcessor.js +137 -0
  334. package/dist/react-native/eventprocessor/callAutomationEventProcessor.js.map +1 -0
  335. package/dist/react-native/eventprocessor/eventResponses.d.ts +134 -0
  336. package/dist/react-native/eventprocessor/eventResponses.d.ts.map +1 -0
  337. package/dist/react-native/eventprocessor/eventResponses.js +4 -0
  338. package/dist/react-native/eventprocessor/eventResponses.js.map +1 -0
  339. package/dist/react-native/generated/src/callAutomationApiClient.d.ts +2 -1
  340. package/dist/react-native/generated/src/callAutomationApiClient.d.ts.map +1 -1
  341. package/dist/react-native/generated/src/callAutomationApiClient.js +4 -3
  342. package/dist/react-native/generated/src/callAutomationApiClient.js.map +1 -1
  343. package/dist/react-native/generated/src/models/index.d.ts +971 -206
  344. package/dist/react-native/generated/src/models/index.d.ts.map +1 -1
  345. package/dist/react-native/generated/src/models/index.js +124 -46
  346. package/dist/react-native/generated/src/models/index.js.map +1 -1
  347. package/dist/react-native/generated/src/models/mappers.d.ts +59 -11
  348. package/dist/react-native/generated/src/models/mappers.d.ts.map +1 -1
  349. package/dist/react-native/generated/src/models/mappers.js +2122 -466
  350. package/dist/react-native/generated/src/models/mappers.js.map +1 -1
  351. package/dist/react-native/generated/src/models/parameters.d.ts +8 -1
  352. package/dist/react-native/generated/src/models/parameters.d.ts.map +1 -1
  353. package/dist/react-native/generated/src/models/parameters.js +45 -6
  354. package/dist/react-native/generated/src/models/parameters.js.map +1 -1
  355. package/dist/react-native/generated/src/operations/callConnection.d.ts +16 -2
  356. package/dist/react-native/generated/src/operations/callConnection.d.ts.map +1 -1
  357. package/dist/react-native/generated/src/operations/callConnection.js +65 -1
  358. package/dist/react-native/generated/src/operations/callConnection.js.map +1 -1
  359. package/dist/react-native/generated/src/operations/callDialog.d.ts +35 -0
  360. package/dist/react-native/generated/src/operations/callDialog.d.ts.map +1 -0
  361. package/dist/react-native/generated/src/operations/callDialog.js +111 -0
  362. package/dist/react-native/generated/src/operations/callDialog.js.map +1 -0
  363. package/dist/react-native/generated/src/operations/callMedia.d.ts +15 -8
  364. package/dist/react-native/generated/src/operations/callMedia.d.ts.map +1 -1
  365. package/dist/react-native/generated/src/operations/callMedia.js +50 -25
  366. package/dist/react-native/generated/src/operations/callMedia.js.map +1 -1
  367. package/dist/react-native/generated/src/operations/callRecording.d.ts +7 -1
  368. package/dist/react-native/generated/src/operations/callRecording.d.ts.map +1 -1
  369. package/dist/react-native/generated/src/operations/callRecording.js +24 -0
  370. package/dist/react-native/generated/src/operations/callRecording.js.map +1 -1
  371. package/dist/react-native/generated/src/operations/index.d.ts +1 -0
  372. package/dist/react-native/generated/src/operations/index.d.ts.map +1 -1
  373. package/dist/react-native/generated/src/operations/index.js +1 -0
  374. package/dist/react-native/generated/src/operations/index.js.map +1 -1
  375. package/dist/react-native/generated/src/operationsInterfaces/callConnection.d.ts +16 -2
  376. package/dist/react-native/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
  377. package/dist/react-native/generated/src/operationsInterfaces/callConnection.js.map +1 -1
  378. package/dist/react-native/generated/src/operationsInterfaces/callDialog.d.ts +27 -0
  379. package/dist/react-native/generated/src/operationsInterfaces/callDialog.d.ts.map +1 -0
  380. package/dist/react-native/generated/src/operationsInterfaces/callDialog.js +9 -0
  381. package/dist/react-native/generated/src/operationsInterfaces/callDialog.js.map +1 -0
  382. package/dist/react-native/generated/src/operationsInterfaces/callMedia.d.ts +15 -8
  383. package/dist/react-native/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
  384. package/dist/react-native/generated/src/operationsInterfaces/callMedia.js.map +1 -1
  385. package/dist/react-native/generated/src/operationsInterfaces/callRecording.d.ts +7 -1
  386. package/dist/react-native/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
  387. package/dist/react-native/generated/src/operationsInterfaces/callRecording.js.map +1 -1
  388. package/dist/react-native/generated/src/operationsInterfaces/index.d.ts +1 -0
  389. package/dist/react-native/generated/src/operationsInterfaces/index.d.ts.map +1 -1
  390. package/dist/react-native/generated/src/operationsInterfaces/index.js +1 -0
  391. package/dist/react-native/generated/src/operationsInterfaces/index.js.map +1 -1
  392. package/dist/react-native/index.d.ts +2 -0
  393. package/dist/react-native/index.d.ts.map +1 -1
  394. package/dist/react-native/index.js +2 -0
  395. package/dist/react-native/index.js.map +1 -1
  396. package/dist/react-native/models/constants.js +1 -1
  397. package/dist/react-native/models/constants.js.map +1 -1
  398. package/dist/react-native/models/events.d.ts +188 -62
  399. package/dist/react-native/models/events.d.ts.map +1 -1
  400. package/dist/react-native/models/events.js.map +1 -1
  401. package/dist/react-native/models/models.d.ts +85 -7
  402. package/dist/react-native/models/models.d.ts.map +1 -1
  403. package/dist/react-native/models/models.js +3 -1
  404. package/dist/react-native/models/models.js.map +1 -1
  405. package/dist/react-native/models/options.d.ts +49 -2
  406. package/dist/react-native/models/options.d.ts.map +1 -1
  407. package/dist/react-native/models/options.js.map +1 -1
  408. package/dist/react-native/models/responses.d.ts +82 -10
  409. package/dist/react-native/models/responses.d.ts.map +1 -1
  410. package/dist/react-native/models/responses.js.map +1 -1
  411. package/dist/react-native/utli/converters.d.ts +26 -2
  412. package/dist/react-native/utli/converters.d.ts.map +1 -1
  413. package/dist/react-native/utli/converters.js +114 -19
  414. package/dist/react-native/utli/converters.js.map +1 -1
  415. package/package.json +16 -22
@@ -1,6 +1,6 @@
1
1
  import type { CallAutomationApiClientOptionalParams } from "./generated/src/models/index.js";
2
- import type { RecordingStateResult } from "./models/responses.js";
3
- import type { StartRecordingOptions, StopRecordingOptions, PauseRecordingOptions, GetRecordingPropertiesOptions, ResumeRecordingOptions, DeleteRecordingOptions, DownloadRecordingOptions } from "./models/options.js";
2
+ import type { RecordingResult, RecordingStateResult } from "./models/responses.js";
3
+ import type { StartRecordingOptions, StopRecordingOptions, PauseRecordingOptions, GetRecordingPropertiesOptions, GetRecordingResultOptions, ResumeRecordingOptions, DeleteRecordingOptions, DownloadRecordingOptions } from "./models/options.js";
4
4
  import type { KeyCredential, TokenCredential } from "@azure/core-auth";
5
5
  /**
6
6
  * CallRecording class represents call recording related APIs.
@@ -40,6 +40,12 @@ export declare class CallRecording {
40
40
  * @param options - Additional request options contains resumeRecording api options.
41
41
  */
42
42
  resume(recordingId: string, options?: ResumeRecordingOptions): Promise<void>;
43
+ /**
44
+ * Returns call recording result.
45
+ * @param recordingId - The recordingId associated with the recording.
46
+ * @param options - Additional request options contains getRecordingProperties api options.
47
+ */
48
+ getRecordingResult(recordingId: string, options?: GetRecordingResultOptions): Promise<RecordingResult>;
43
49
  /**
44
50
  * Deletes a recording.
45
51
  * @param recordingLocationUrl - The recording location url. Required.
@@ -1 +1 @@
1
- {"version":3,"file":"callRecording.d.ts","sourceRoot":"","sources":["../../src/callRecording.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,qCAAqC,EAEtC,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EACV,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,6BAA6B,EAC7B,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,qBAAqB,CAAC;AAK7B,OAAO,KAAK,EAAE,aAAa,EAAE,eAA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O,CAAC,IAAI,CAAC;IAI3F;;;;OAIG;IACU,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,GAAE,sBAA2B,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7F;;;;OAIG;IACU,kBAAkB,CAC7B,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,eAAe,CAAC;IAgB3B;;;;OAIG;IACU,MAAM,CACjB,oBAAoB,EAAE,MAAM,EAC5B,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,IAAI,CAAC;IAIhB;;;;OAIG;IACU,iBAAiB,CAC5B,iBAAiB,EAAE,MAAM,EACzB,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC;IAUjC;;;;;OAKG;IACU,gBAAgB,CAC3B,iBAAiB,EAAE,MAAM,EACzB,iBAAiB,EAAE,MAAM,CAAC,cAAc,EACxC,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,IAAI,CAAC;IAehB;;;;;OAKG;IACU,cAAc,CACzB,iBAAiB,EAAE,MAAM,EACzB,eAAe,EAAE,MAAM,EACvB,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,IAAI,CAAC;CAejB"}
@@ -9,16 +9,13 @@ const converters_js_1 = require("./utli/converters.js");
9
9
  const contentDownloader_js_1 = require("./contentDownloader.js");
10
10
  const fs = tslib_1.__importStar(require("node:fs"));
11
11
  const core_util_1 = require("@azure/core-util");
12
- const index_js_2 = require("./generated/src/index.js");
13
- const communication_common_1 = require("@azure/communication-common");
12
+ const callAutomationAuthPolicy_js_1 = require("./credential/callAutomationAuthPolicy.js");
14
13
  /**
15
14
  * CallRecording class represents call recording related APIs.
16
15
  */
17
16
  class CallRecording {
18
17
  constructor(endpoint, credential, options) {
19
- this.callAutomationApiClient = new index_js_2.CallAutomationApiClient(endpoint, options);
20
- const authPolicy = (0, communication_common_1.createCommunicationAuthPolicy)(credential);
21
- this.callAutomationApiClient.pipeline.addPolicy(authPolicy);
18
+ this.callAutomationApiClient = (0, callAutomationAuthPolicy_js_1.createCustomCallAutomationApiClient)(credential, options, endpoint);
22
19
  this.callRecordingImpl = new index_js_1.CallRecordingImpl(this.callAutomationApiClient);
23
20
  this.contentDownloader = new contentDownloader_js_1.ContentDownloaderImpl(this.callAutomationApiClient);
24
21
  }
@@ -124,6 +121,24 @@ class CallRecording {
124
121
  async resume(recordingId, options = {}) {
125
122
  return this.callRecordingImpl.resumeRecording(recordingId, options);
126
123
  }
124
+ /**
125
+ * Returns call recording result.
126
+ * @param recordingId - The recordingId associated with the recording.
127
+ * @param options - Additional request options contains getRecordingProperties api options.
128
+ */
129
+ async getRecordingResult(recordingId, options = {}) {
130
+ const response = await this.callRecordingImpl.getRecordingResult(recordingId, options);
131
+ const result = {
132
+ recordingId: response.recordingId,
133
+ errors: response.errors,
134
+ recordingDurationMs: response.recordingDurationMs,
135
+ recordingExpirationTime: response.recordingExpirationTime,
136
+ recordingStartTime: response.recordingStartTime,
137
+ recordingStorageInfo: response.recordingStorageInfo,
138
+ sessionEndReason: response.sessionEndReason,
139
+ };
140
+ return result;
141
+ }
127
142
  /**
128
143
  * Deletes a recording.
129
144
  * @param recordingLocationUrl - The recording location url. Required.
@@ -1 +1 @@
1
- {"version":3,"file":"callRecording.js","sourceRoot":"","sources":["../../src/callRecording.ts"],"names":[],"mappings":";;;;AAAA,uCAAuC;AACvC,kCAAkC;AAClC,kEAAwE;AAexE,wDAA6E;AAC7E,iEAA+D;AAC/D,oDAA8B;AAC9B,gDAA8C;AAE9C,uDAAmE;AACnE,sEAA4E;AAE5E;;GAEG;AACH,MAAa,aAAa;IAKxB,YACE,QAAgB,EAChB,UAA2C,EAC3C,OAA+C;QAE/C,IAAI,CAAC,uBAAuB,GAAG,IAAI,kCAAuB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC9E,MAAM,UAAU,GAAG,IAAA,oDAA6B,EAAC,UAAU,CAAC,CAAC;QAC7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MAAM,MAAM,CAAC,CAAC,kBAAkB,CAAC;QAC1D,IAAI,eAAe,EAAE,CAAC;YACpB,MAAM,eAAe,GAAG,EAAE,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC;YAC9D,eAAe,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACtC,MAAM,MAAM,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBACnD,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;gBACtC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YACtC,CAAC,CAAC,CAAC;YACH,MAAM,MAAM,CAAC;QACf,CAAC;aAAM,CAAC;YACN,MAAM,KAAK,CAAC,sBAAsB,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;CACF;AA7ND,sCA6NC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { CallRecordingImpl } from \"./generated/src/operations/index.js\";\nimport type {\n CallAutomationApiClientOptionalParams,\n StartCallRecordingRequest,\n} from \"./generated/src/models/index.js\";\nimport type { RecordingStateResult } from \"./models/responses.js\";\nimport type {\n StartRecordingOptions,\n StopRecordingOptions,\n PauseRecordingOptions,\n GetRecordingPropertiesOptions,\n ResumeRecordingOptions,\n DeleteRecordingOptions,\n DownloadRecordingOptions,\n} from \"./models/options.js\";\nimport { communicationIdentifierModelConverter } from \"./utli/converters.js\";\nimport { ContentDownloaderImpl } from \"./contentDownloader.js\";\nimport * as fs from \"node:fs\";\nimport { randomUUID } from \"@azure/core-util\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { CallAutomationApiClient } from \"./generated/src/index.js\";\nimport { createCommunicationAuthPolicy } from \"@azure/communication-common\";\n\n/**\n * CallRecording class represents call recording related APIs.\n */\nexport class CallRecording {\n private readonly callRecordingImpl: CallRecordingImpl;\n private readonly contentDownloader: ContentDownloaderImpl;\n private readonly callAutomationApiClient: CallAutomationApiClient;\n\n constructor(\n endpoint: string,\n credential: KeyCredential | TokenCredential,\n options?: CallAutomationApiClientOptionalParams,\n ) {\n this.callAutomationApiClient = new CallAutomationApiClient(endpoint, options);\n const authPolicy = createCommunicationAuthPolicy(credential);\n this.callAutomationApiClient.pipeline.addPolicy(authPolicy);\n\n this.callRecordingImpl = new CallRecordingImpl(this.callAutomationApiClient);\n this.contentDownloader = new ContentDownloaderImpl(this.callAutomationApiClient);\n }\n\n /**\n * Starts a call recording with the specified options.\n * @param startCallRecordingRequest - options to start the call recording\n * @param options - Operation options.\n */\n public async start(options: StartRecordingOptions): Promise<RecordingStateResult> {\n const startCallRecordingRequest: StartCallRecordingRequest = {\n callLocator: options.callLocator ? options.callLocator : undefined,\n };\n\n startCallRecordingRequest.recordingChannelType = options.recordingChannel;\n startCallRecordingRequest.recordingContentType = options.recordingContent;\n startCallRecordingRequest.recordingFormatType = options.recordingFormat;\n startCallRecordingRequest.recordingStateCallbackUri = options.recordingStateCallbackEndpointUrl;\n startCallRecordingRequest.pauseOnStart = options.pauseOnStart;\n startCallRecordingRequest.recordingStorage = options.recordingStorage;\n startCallRecordingRequest.callConnectionId = options.callConnectionId\n ? options.callConnectionId\n : undefined;\n\n if (options.channelAffinity) {\n startCallRecordingRequest.channelAffinity = [];\n options.channelAffinity.forEach((identifier) => {\n startCallRecordingRequest.channelAffinity?.push({\n participant: communicationIdentifierModelConverter(identifier.targetParticipant),\n channel: identifier.channel,\n });\n });\n }\n\n if (options.audioChannelParticipantOrdering) {\n startCallRecordingRequest.audioChannelParticipantOrdering = [];\n options.audioChannelParticipantOrdering.forEach((identifier) => {\n startCallRecordingRequest.audioChannelParticipantOrdering?.push(\n communicationIdentifierModelConverter(identifier),\n );\n });\n }\n if (options.callLocator) {\n if (options.callLocator.kind === \"groupCallLocator\") {\n startCallRecordingRequest.callLocator = {\n groupCallId: options.callLocator.id,\n kind: \"groupCallLocator\",\n };\n } else if (options.callLocator.kind === \"roomCallLocator\") {\n startCallRecordingRequest.callLocator = {\n roomId: options.callLocator.id,\n kind: \"roomCallLocator\",\n };\n } else {\n startCallRecordingRequest.callLocator = {\n serverCallId: options.callLocator.id,\n kind: \"serverCallLocator\",\n };\n }\n }\n\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const response = await this.callRecordingImpl.startRecording(\n startCallRecordingRequest,\n optionsInternal,\n );\n\n const result: RecordingStateResult = {\n recordingId: response.recordingId!,\n recordingKind: response.recordingKind!,\n recordingState: response.recordingState!,\n };\n\n return result;\n }\n\n /**\n * Returns call recording properties.\n * @param recordingId - The recordingId associated with the recording.\n * @param options - Additional request options contains getRecordingProperties api options.\n */\n public async getState(\n recordingId: string,\n options: GetRecordingPropertiesOptions = {},\n ): Promise<RecordingStateResult> {\n const response = await this.callRecordingImpl.getRecordingProperties(recordingId, options);\n\n const result: RecordingStateResult = {\n recordingId: response.recordingId!,\n recordingKind: response.recordingKind!,\n recordingState: response.recordingState!,\n };\n\n return result;\n }\n\n /**\n * Stops a call recording.\n * @param recordingId - The recordingId associated with the recording.\n * @param options - Additional request options contains stopRecording api options.\n */\n public async stop(recordingId: string, options: StopRecordingOptions = {}): Promise<void> {\n return this.callRecordingImpl.stopRecording(recordingId, options);\n }\n\n /**\n * Pauses a call recording.\n * @param recordingId - The recordingId associated with the recording.\n * @param options - Additional request options contains pauseRecording api options.\n */\n public async pause(recordingId: string, options: PauseRecordingOptions = {}): Promise<void> {\n return this.callRecordingImpl.pauseRecording(recordingId, options);\n }\n\n /**\n * Resumes a call recording.\n * @param recordingId - The recordingId associated with the recording.\n * @param options - Additional request options contains resumeRecording api options.\n */\n public async resume(recordingId: string, options: ResumeRecordingOptions = {}): Promise<void> {\n return this.callRecordingImpl.resumeRecording(recordingId, options);\n }\n\n /**\n * Deletes a recording.\n * @param recordingLocationUrl - The recording location url. Required.\n * @param options - Additional request options contains deleteRecording api options.\n */\n public async delete(\n recordingLocationUrl: string,\n options: DeleteRecordingOptions = {},\n ): Promise<void> {\n await this.contentDownloader.deleteRecording(recordingLocationUrl, options);\n }\n\n /**\n * Returns a stream with a call recording.\n * @param sourceLocationUrl - The source location url. Required.\n * @param options - Additional request options contains downloadRecording api options.\n */\n public async downloadStreaming(\n sourceLocationUrl: string,\n options: DownloadRecordingOptions = {},\n ): Promise<NodeJS.ReadableStream> {\n const result = this.contentDownloader.download(sourceLocationUrl, options);\n const recordingStream = (await result).readableStreamBody;\n if (recordingStream) {\n return recordingStream;\n } else {\n throw Error(\"failed to get stream\");\n }\n }\n\n /**\n * Downloads a call recording file to the specified stream.\n * @param sourceLocationUrl - The source location url. Required.\n * @param destinationStream - The destination stream. Required.\n * @param options - Additional request options contains downloadRecording api options.\n */\n public async downloadToStream(\n sourceLocationUrl: string,\n destinationStream: NodeJS.WritableStream,\n options: DownloadRecordingOptions = {},\n ): Promise<void> {\n const result = this.contentDownloader.download(sourceLocationUrl, options);\n const recordingStream = (await result).readableStreamBody;\n if (recordingStream) {\n recordingStream.pipe(destinationStream);\n const finish = new Promise<void>((resolve, reject) => {\n destinationStream.on(\"finish\", resolve);\n destinationStream.on(\"error\", reject);\n });\n await finish;\n } else {\n throw Error(\"failed to get stream\");\n }\n }\n\n /**\n * Downloads a call recording file to the specified path.\n * @param sourceLocationUrl - The source location url. Required.\n * @param destinationPath - The destination path. Required.\n * @param options - Additional request options contains downloadRecording api options.\n */\n public async downloadToPath(\n sourceLocationUrl: string,\n destinationPath: string,\n options: DownloadRecordingOptions = {},\n ): Promise<void> {\n const result = this.contentDownloader.download(sourceLocationUrl, options);\n const recordingStream = (await result).readableStreamBody;\n if (recordingStream) {\n const writeFileStream = fs.createWriteStream(destinationPath);\n recordingStream.pipe(writeFileStream);\n const finish = new Promise<void>((resolve, reject) => {\n writeFileStream.on(\"finish\", resolve);\n writeFileStream.on(\"error\", reject);\n });\n await finish;\n } else {\n throw Error(\"failed to get stream\");\n }\n }\n}\n"]}
1
+ {"version":3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CAAC;YACH,MAAM,MAAM,CAAC;QACf,CAAC;aAAM,CAAC;YACN,MAAM,KAAK,CAAC,sBAAsB,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;CACF;AAvPD,sCAuPC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { CallRecordingImpl } from \"./generated/src/operations/index.js\";\nimport type {\n CallAutomationApiClientOptionalParams,\n StartCallRecordingRequest,\n} from \"./generated/src/models/index.js\";\nimport type { RecordingResult, RecordingStateResult } from \"./models/responses.js\";\nimport type {\n StartRecordingOptions,\n StopRecordingOptions,\n PauseRecordingOptions,\n GetRecordingPropertiesOptions,\n GetRecordingResultOptions,\n ResumeRecordingOptions,\n DeleteRecordingOptions,\n DownloadRecordingOptions,\n} from \"./models/options.js\";\nimport { communicationIdentifierModelConverter } from \"./utli/converters.js\";\nimport { ContentDownloaderImpl } from \"./contentDownloader.js\";\nimport * as fs from \"node:fs\";\nimport { randomUUID } from \"@azure/core-util\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport type { CallAutomationApiClient } from \"./generated/src/index.js\";\nimport { createCustomCallAutomationApiClient } from \"./credential/callAutomationAuthPolicy.js\";\n\n/**\n * CallRecording class represents call recording related APIs.\n */\nexport class CallRecording {\n private readonly callRecordingImpl: CallRecordingImpl;\n private readonly contentDownloader: ContentDownloaderImpl;\n private readonly callAutomationApiClient: CallAutomationApiClient;\n\n constructor(\n endpoint: string,\n credential: KeyCredential | TokenCredential,\n options?: CallAutomationApiClientOptionalParams,\n ) {\n this.callAutomationApiClient = createCustomCallAutomationApiClient(\n credential,\n options,\n endpoint,\n );\n\n this.callRecordingImpl = new CallRecordingImpl(this.callAutomationApiClient);\n this.contentDownloader = new ContentDownloaderImpl(this.callAutomationApiClient);\n }\n\n /**\n * Starts a call recording with the specified options.\n * @param startCallRecordingRequest - options to start the call recording\n * @param options - Operation options.\n */\n public async start(options: StartRecordingOptions): Promise<RecordingStateResult> {\n const startCallRecordingRequest: StartCallRecordingRequest = {\n callLocator: options.callLocator ? options.callLocator : undefined,\n };\n\n startCallRecordingRequest.recordingChannelType = options.recordingChannel;\n startCallRecordingRequest.recordingContentType = options.recordingContent;\n startCallRecordingRequest.recordingFormatType = options.recordingFormat;\n startCallRecordingRequest.recordingStateCallbackUri = options.recordingStateCallbackEndpointUrl;\n startCallRecordingRequest.pauseOnStart = options.pauseOnStart;\n startCallRecordingRequest.recordingStorage = options.recordingStorage;\n startCallRecordingRequest.callConnectionId = options.callConnectionId\n ? options.callConnectionId\n : undefined;\n\n if (options.channelAffinity) {\n startCallRecordingRequest.channelAffinity = [];\n options.channelAffinity.forEach((identifier) => {\n startCallRecordingRequest.channelAffinity?.push({\n participant: communicationIdentifierModelConverter(identifier.targetParticipant),\n channel: identifier.channel,\n });\n });\n }\n\n if (options.audioChannelParticipantOrdering) {\n startCallRecordingRequest.audioChannelParticipantOrdering = [];\n options.audioChannelParticipantOrdering.forEach((identifier) => {\n startCallRecordingRequest.audioChannelParticipantOrdering?.push(\n communicationIdentifierModelConverter(identifier),\n );\n });\n }\n if (options.callLocator) {\n if (options.callLocator.kind === \"groupCallLocator\") {\n startCallRecordingRequest.callLocator = {\n groupCallId: options.callLocator.id,\n kind: \"groupCallLocator\",\n };\n } else if (options.callLocator.kind === \"roomCallLocator\") {\n startCallRecordingRequest.callLocator = {\n roomId: options.callLocator.id,\n kind: \"roomCallLocator\",\n };\n } else {\n startCallRecordingRequest.callLocator = {\n serverCallId: options.callLocator.id,\n kind: \"serverCallLocator\",\n };\n }\n }\n\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const response = await this.callRecordingImpl.startRecording(\n startCallRecordingRequest,\n optionsInternal,\n );\n\n const result: RecordingStateResult = {\n recordingId: response.recordingId!,\n recordingKind: response.recordingKind!,\n recordingState: response.recordingState!,\n };\n\n return result;\n }\n\n /**\n * Returns call recording properties.\n * @param recordingId - The recordingId associated with the recording.\n * @param options - Additional request options contains getRecordingProperties api options.\n */\n public async getState(\n recordingId: string,\n options: GetRecordingPropertiesOptions = {},\n ): Promise<RecordingStateResult> {\n const response = await this.callRecordingImpl.getRecordingProperties(recordingId, options);\n\n const result: RecordingStateResult = {\n recordingId: response.recordingId!,\n recordingKind: response.recordingKind!,\n recordingState: response.recordingState!,\n };\n\n return result;\n }\n\n /**\n * Stops a call recording.\n * @param recordingId - The recordingId associated with the recording.\n * @param options - Additional request options contains stopRecording api options.\n */\n public async stop(recordingId: string, options: StopRecordingOptions = {}): Promise<void> {\n return this.callRecordingImpl.stopRecording(recordingId, options);\n }\n\n /**\n * Pauses a call recording.\n * @param recordingId - The recordingId associated with the recording.\n * @param options - Additional request options contains pauseRecording api options.\n */\n public async pause(recordingId: string, options: PauseRecordingOptions = {}): Promise<void> {\n return this.callRecordingImpl.pauseRecording(recordingId, options);\n }\n\n /**\n * Resumes a call recording.\n * @param recordingId - The recordingId associated with the recording.\n * @param options - Additional request options contains resumeRecording api options.\n */\n public async resume(recordingId: string, options: ResumeRecordingOptions = {}): Promise<void> {\n return this.callRecordingImpl.resumeRecording(recordingId, options);\n }\n\n /**\n * Returns call recording result.\n * @param recordingId - The recordingId associated with the recording.\n * @param options - Additional request options contains getRecordingProperties api options.\n */\n public async getRecordingResult(\n recordingId: string,\n options: GetRecordingResultOptions = {},\n ): Promise<RecordingResult> {\n const response = await this.callRecordingImpl.getRecordingResult(recordingId, options);\n\n const result: RecordingResult = {\n recordingId: response.recordingId!,\n errors: response.errors,\n recordingDurationMs: response.recordingDurationMs,\n recordingExpirationTime: response.recordingExpirationTime,\n recordingStartTime: response.recordingStartTime,\n recordingStorageInfo: response.recordingStorageInfo,\n sessionEndReason: response.sessionEndReason,\n };\n\n return result;\n }\n\n /**\n * Deletes a recording.\n * @param recordingLocationUrl - The recording location url. Required.\n * @param options - Additional request options contains deleteRecording api options.\n */\n public async delete(\n recordingLocationUrl: string,\n options: DeleteRecordingOptions = {},\n ): Promise<void> {\n await this.contentDownloader.deleteRecording(recordingLocationUrl, options);\n }\n\n /**\n * Returns a stream with a call recording.\n * @param sourceLocationUrl - The source location url. Required.\n * @param options - Additional request options contains downloadRecording api options.\n */\n public async downloadStreaming(\n sourceLocationUrl: string,\n options: DownloadRecordingOptions = {},\n ): Promise<NodeJS.ReadableStream> {\n const result = this.contentDownloader.download(sourceLocationUrl, options);\n const recordingStream = (await result).readableStreamBody;\n if (recordingStream) {\n return recordingStream;\n } else {\n throw Error(\"failed to get stream\");\n }\n }\n\n /**\n * Downloads a call recording file to the specified stream.\n * @param sourceLocationUrl - The source location url. Required.\n * @param destinationStream - The destination stream. Required.\n * @param options - Additional request options contains downloadRecording api options.\n */\n public async downloadToStream(\n sourceLocationUrl: string,\n destinationStream: NodeJS.WritableStream,\n options: DownloadRecordingOptions = {},\n ): Promise<void> {\n const result = this.contentDownloader.download(sourceLocationUrl, options);\n const recordingStream = (await result).readableStreamBody;\n if (recordingStream) {\n recordingStream.pipe(destinationStream);\n const finish = new Promise<void>((resolve, reject) => {\n destinationStream.on(\"finish\", resolve);\n destinationStream.on(\"error\", reject);\n });\n await finish;\n } else {\n throw Error(\"failed to get stream\");\n }\n }\n\n /**\n * Downloads a call recording file to the specified path.\n * @param sourceLocationUrl - The source location url. Required.\n * @param destinationPath - The destination path. Required.\n * @param options - Additional request options contains downloadRecording api options.\n */\n public async downloadToPath(\n sourceLocationUrl: string,\n destinationPath: string,\n options: DownloadRecordingOptions = {},\n ): Promise<void> {\n const result = this.contentDownloader.download(sourceLocationUrl, options);\n const recordingStream = (await result).readableStreamBody;\n if (recordingStream) {\n const writeFileStream = fs.createWriteStream(destinationPath);\n recordingStream.pipe(writeFileStream);\n const finish = new Promise<void>((resolve, reject) => {\n writeFileStream.on(\"finish\", resolve);\n writeFileStream.on(\"error\", reject);\n });\n await finish;\n } else {\n throw Error(\"failed to get stream\");\n }\n }\n}\n"]}
@@ -0,0 +1,39 @@
1
+ import type { CallAutomationEvent } from "../models/events.js";
2
+ import type { AbortSignalLike } from "@azure/abort-controller";
3
+ /**
4
+ * Call Automation's EventProcessor for incoming events for ease of use.
5
+ */
6
+ export declare class CallAutomationEventProcessor {
7
+ private readonly defaultTimeout;
8
+ private readonly defaultEventBacklogTimeout;
9
+ private readonly emitter;
10
+ private readonly eventsBacklog;
11
+ private readonly ongoingEvents;
12
+ /**
13
+ * Process incoming events. Pass incoming events to get it processed to have other method like WaitForEventProcessor to function.
14
+ * @param event - Incoming CloudEvent object.
15
+ */
16
+ processEvents(event: string | Record<string, unknown> | CallAutomationEvent): void;
17
+ /**
18
+ * Wait for matching incoming event. This is blocking Call. Returns the CallAutomationEvent once it arrives in ProcessEvent method.
19
+ * @param predicate - Conditional Predicate for waiting on event.
20
+ * @param abortSignal - Abort signal to abort the operation.
21
+ * @param timeoutInMs - maximum timeout in milliseconds for the operation.
22
+ */
23
+ waitForEventProcessor(predicate: (event: CallAutomationEvent) => boolean, abortSignal?: AbortSignalLike, timeoutInMs?: number): Promise<CallAutomationEvent>;
24
+ /**
25
+ * Attach Ongoing EventProcessor for specific event for a call.
26
+ * @param eventTypeKind - Matching event.
27
+ * @param callConnectionId - CallConnectionId of the call.
28
+ * @param eventProcessor - Method that will execute once the matching event arrives.
29
+ */
30
+ attachOngoingEventProcessor(callConnectionId: string, eventTypeKind: CallAutomationEvent["kind"], eventProcessor: (event: CallAutomationEvent) => Promise<void>): Promise<void>;
31
+ /**
32
+ * Detach Ongoing EventProcessor for specific event.
33
+ * @param eventTypeKind - Matching event.
34
+ * @param callConnectionId - CallConnectionId of the call.
35
+ */
36
+ detachOngoingEventProcessor(callConnectionId: string, eventTypeKind: CallAutomationEvent["kind"]): Promise<void>;
37
+ private generateIdTypeKey;
38
+ }
39
+ //# sourceMappingURL=callAutomationEventProcessor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"callAutomationEventProcessor.d.ts","sourceRoot":"","sources":["../../../src/eventprocessor/callAutomationEventProcessor.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D;;GAEG;AACH,qBAAa,4BAA4B;IACvC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAU;IACzC,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAAQ;IACnD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsB;IAC9C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAkC;IAChE,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA+B;IAE7D;;;OAGG;IACI,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,mBAAmB,GAAG,IAAI;IAsCzF;;;;;OAKG;IACU,qBAAqB,CAChC,SAAS,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,OAAO,EAClD,WAAW,CAAC,EAAE,eAAe,EAC7B,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,mBAAmB,CAAC;IAmD/B;;;;;OAKG;IACU,2BAA2B,CACtC,gBAAgB,EAAE,MAAM,EACxB,aAAa,EAAE,mBAAmB,CAAC,MAAM,CAAC,EAC1C,cAAc,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,OAAO,CAAC,IAAI,CAAC,GAC5D,OAAO,CAAC,IAAI,CAAC;IAchB;;;;OAIG;IACU,2BAA2B,CACtC,gBAAgB,EAAE,MAAM,EACxB,aAAa,EAAE,mBAAmB,CAAC,MAAM,CAAC,GACzC,OAAO,CAAC,IAAI,CAAC;IAWhB,OAAO,CAAC,iBAAiB;CAG1B"}
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.CallAutomationEventProcessor = void 0;
6
+ const events_1 = require("events");
7
+ const callAutomationEventParser_js_1 = require("../callAutomationEventParser.js");
8
+ /**
9
+ * Call Automation's EventProcessor for incoming events for ease of use.
10
+ */
11
+ class CallAutomationEventProcessor {
12
+ constructor() {
13
+ this.defaultTimeout = 240000; // 240 seconds in milliseconds
14
+ this.defaultEventBacklogTimeout = 5000; // 5 seconds in milliseconds
15
+ this.emitter = new events_1.EventEmitter();
16
+ this.eventsBacklog = [];
17
+ this.ongoingEvents = new Map();
18
+ }
19
+ /**
20
+ * Process incoming events. Pass incoming events to get it processed to have other method like WaitForEventProcessor to function.
21
+ * @param event - Incoming CloudEvent object.
22
+ */
23
+ processEvents(event) {
24
+ if (event) {
25
+ let callAutomationEvent;
26
+ // parse the event if not parsed already
27
+ if (typeof event === "string" || Array.isArray(event)) {
28
+ callAutomationEvent = (0, callAutomationEventParser_js_1.parseCallAutomationEvent)(event || event);
29
+ }
30
+ else {
31
+ callAutomationEvent = event;
32
+ }
33
+ // add to eventbacklog
34
+ this.eventsBacklog.push(callAutomationEvent);
35
+ setTimeout(() => {
36
+ const index = this.eventsBacklog.indexOf(callAutomationEvent);
37
+ if (index !== -1) {
38
+ this.eventsBacklog.splice(index, 1);
39
+ }
40
+ }, this.defaultEventBacklogTimeout);
41
+ // parse event if needed
42
+ this.emitter.emit("event", callAutomationEvent);
43
+ // check if event is disconnect, remove all related items in memory
44
+ if (callAutomationEvent.kind === "CallDisconnected") {
45
+ // remove from ongoingevent list
46
+ for (const [key, evProcessor] of this.ongoingEvents.entries()) {
47
+ if (key.includes(callAutomationEvent.callConnectionId)) {
48
+ // Deregister the event listener
49
+ this.ongoingEvents.delete(key);
50
+ this.emitter.off("event", evProcessor);
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
56
+ /**
57
+ * Wait for matching incoming event. This is blocking Call. Returns the CallAutomationEvent once it arrives in ProcessEvent method.
58
+ * @param predicate - Conditional Predicate for waiting on event.
59
+ * @param abortSignal - Abort signal to abort the operation.
60
+ * @param timeoutInMs - maximum timeout in milliseconds for the operation.
61
+ */
62
+ async waitForEventProcessor(predicate, abortSignal, timeoutInMs) {
63
+ const controller = new AbortController();
64
+ if (!timeoutInMs) {
65
+ timeoutInMs = this.defaultTimeout;
66
+ }
67
+ const filteredEvents = this.eventsBacklog.filter((event) => predicate(event));
68
+ if (filteredEvents.length > 0) {
69
+ // item found - delete from the list and return the event
70
+ this.eventsBacklog.splice(0, this.eventsBacklog.length, ...filteredEvents);
71
+ return filteredEvents[0];
72
+ }
73
+ // await for this event to comeback
74
+ let eventAwaiter;
75
+ const eventPromise = new Promise((resolve, reject) => {
76
+ // set abort signal
77
+ if (abortSignal) {
78
+ // If an external abortSignal is provided, link it with the controller.
79
+ abortSignal.addEventListener("abort", () => {
80
+ controller.abort();
81
+ this.emitter.off("event", eventAwaiter);
82
+ reject(new Error("Abort: Operation was aborted."));
83
+ });
84
+ }
85
+ // set timeout for this event
86
+ const timer = setTimeout(() => {
87
+ this.emitter.off("event", eventAwaiter);
88
+ reject(new Error("Timeout: Matching event did not arrive within timeout."));
89
+ }, timeoutInMs);
90
+ eventAwaiter = (event) => {
91
+ if (predicate(event)) {
92
+ // Deregister timer and the event listener
93
+ clearTimeout(timer);
94
+ this.emitter.off("event", eventAwaiter);
95
+ // Resolve with the matching event
96
+ resolve(event);
97
+ }
98
+ };
99
+ // Register the event awaiter
100
+ this.emitter.on("event", eventAwaiter);
101
+ });
102
+ return eventPromise;
103
+ }
104
+ /**
105
+ * Attach Ongoing EventProcessor for specific event for a call.
106
+ * @param eventTypeKind - Matching event.
107
+ * @param callConnectionId - CallConnectionId of the call.
108
+ * @param eventProcessor - Method that will execute once the matching event arrives.
109
+ */
110
+ async attachOngoingEventProcessor(callConnectionId, eventTypeKind, eventProcessor) {
111
+ const eventAwaiter = (event) => {
112
+ if (event.callConnectionId === callConnectionId && event.kind === eventTypeKind) {
113
+ eventProcessor(event);
114
+ }
115
+ };
116
+ // Register the event awaiter
117
+ this.emitter.on("event", eventAwaiter);
118
+ // attach the ongoing event processor to the map
119
+ const uniqueId = this.generateIdTypeKey(callConnectionId, eventTypeKind);
120
+ this.ongoingEvents.set(uniqueId, eventAwaiter);
121
+ }
122
+ /**
123
+ * Detach Ongoing EventProcessor for specific event.
124
+ * @param eventTypeKind - Matching event.
125
+ * @param callConnectionId - CallConnectionId of the call.
126
+ */
127
+ async detachOngoingEventProcessor(callConnectionId, eventTypeKind) {
128
+ const uniqueId = this.generateIdTypeKey(callConnectionId, eventTypeKind);
129
+ const value = this.ongoingEvents.get(uniqueId);
130
+ if (value) {
131
+ // Deregister the event listener
132
+ this.ongoingEvents.delete(uniqueId);
133
+ this.emitter.off("event", value);
134
+ }
135
+ }
136
+ generateIdTypeKey(callConnectionId, eventType) {
137
+ return `${callConnectionId}:${eventType}`;
138
+ }
139
+ }
140
+ exports.CallAutomationEventProcessor = CallAutomationEventProcessor;
141
+ //# sourceMappingURL=callAutomationEventProcessor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"callAutomationEventProcessor.js","sourceRoot":"","sources":["../../../src/eventprocessor/callAutomationEventProcessor.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,mCAAsC;AAEtC,kFAA2E;AAG3E;;GAEG;AACH,MAAa,4BAA4B;IAAzC;QACmB,mBAAc,GAAG,MAAM,CAAC,CAAC,8BAA8B;QACvD,+BAA0B,GAAG,IAAI,CAAC,CAAC,4BAA4B;QAC/D,YAAO,GAAG,IAAI,qBAAY,EAAE,CAAC;QAC7B,kBAAa,GAA+B,EAAE,CAAC;QAC/C,kBAAa,GAAqB,IAAI,GAAG,EAAE,CAAC;IAuJ/D,CAAC;IArJC;;;OAGG;IACI,aAAa,CAAC,KAA6D;QAChF,IAAI,KAAK,EAAE,CAAC;YACV,IAAI,mBAAwC,CAAC;YAC7C,wCAAwC;YACxC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;gBACtD,mBAAmB,GAAG,IAAA,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AAC;YACpC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IAEO,iBAAiB,CAAC,gBAAwB,EAAE,SAAiB;QACnE,OAAO,GAAG,gBAAgB,IAAI,SAAS,EAAE,CAAC;IAC5C,CAAC;CACF;AA5JD,oEA4JC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { EventEmitter } from \"events\";\nimport type { CallAutomationEvent } from \"../models/events.js\";\nimport { parseCallAutomationEvent } from \"../callAutomationEventParser.js\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\n\n/**\n * Call Automation's EventProcessor for incoming events for ease of use.\n */\nexport class CallAutomationEventProcessor {\n private readonly defaultTimeout = 240000; // 240 seconds in milliseconds\n private readonly defaultEventBacklogTimeout = 5000; // 5 seconds in milliseconds\n private readonly emitter = new EventEmitter();\n private readonly eventsBacklog: Array<CallAutomationEvent> = [];\n private readonly ongoingEvents: Map<string, any> = new Map();\n\n /**\n * Process incoming events. Pass incoming events to get it processed to have other method like WaitForEventProcessor to function.\n * @param event - Incoming CloudEvent object.\n */\n public processEvents(event: string | Record<string, unknown> | CallAutomationEvent): void {\n if (event) {\n let callAutomationEvent: CallAutomationEvent;\n // parse the event if not parsed already\n if (typeof event === \"string\" || Array.isArray(event)) {\n callAutomationEvent = parseCallAutomationEvent(\n (event as string) || (event as Record<string, unknown>),\n );\n } else {\n callAutomationEvent = event as CallAutomationEvent;\n }\n\n // add to eventbacklog\n this.eventsBacklog.push(callAutomationEvent);\n setTimeout(() => {\n const index = this.eventsBacklog.indexOf(callAutomationEvent);\n if (index !== -1) {\n this.eventsBacklog.splice(index, 1);\n }\n }, this.defaultEventBacklogTimeout);\n\n // parse event if needed\n this.emitter.emit(\"event\", callAutomationEvent);\n\n // check if event is disconnect, remove all related items in memory\n if (callAutomationEvent.kind === \"CallDisconnected\") {\n // remove from ongoingevent list\n for (const [key, evProcessor] of this.ongoingEvents.entries()) {\n if (key.includes(callAutomationEvent.callConnectionId)) {\n // Deregister the event listener\n this.ongoingEvents.delete(key);\n this.emitter.off(\"event\", evProcessor);\n }\n }\n }\n }\n }\n\n /**\n * Wait for matching incoming event. This is blocking Call. Returns the CallAutomationEvent once it arrives in ProcessEvent method.\n * @param predicate - Conditional Predicate for waiting on event.\n * @param abortSignal - Abort signal to abort the operation.\n * @param timeoutInMs - maximum timeout in milliseconds for the operation.\n */\n public async waitForEventProcessor(\n predicate: (event: CallAutomationEvent) => boolean,\n abortSignal?: AbortSignalLike,\n timeoutInMs?: number,\n ): Promise<CallAutomationEvent> {\n const controller = new AbortController();\n if (!timeoutInMs) {\n timeoutInMs = this.defaultTimeout;\n }\n\n const filteredEvents = this.eventsBacklog.filter((event) => predicate(event));\n if (filteredEvents.length > 0) {\n // item found - delete from the list and return the event\n this.eventsBacklog.splice(0, this.eventsBacklog.length, ...filteredEvents);\n return filteredEvents[0];\n }\n\n // await for this event to comeback\n let eventAwaiter: (event: CallAutomationEvent) => void;\n\n const eventPromise = new Promise<CallAutomationEvent>((resolve, reject) => {\n // set abort signal\n if (abortSignal) {\n // If an external abortSignal is provided, link it with the controller.\n abortSignal.addEventListener(\"abort\", () => {\n controller.abort();\n this.emitter.off(\"event\", eventAwaiter);\n reject(new Error(\"Abort: Operation was aborted.\"));\n });\n }\n\n // set timeout for this event\n const timer = setTimeout(() => {\n this.emitter.off(\"event\", eventAwaiter);\n reject(new Error(\"Timeout: Matching event did not arrive within timeout.\"));\n }, timeoutInMs);\n\n eventAwaiter = (event: CallAutomationEvent) => {\n if (predicate(event)) {\n // Deregister timer and the event listener\n clearTimeout(timer);\n this.emitter.off(\"event\", eventAwaiter);\n\n // Resolve with the matching event\n resolve(event);\n }\n };\n\n // Register the event awaiter\n this.emitter.on(\"event\", eventAwaiter);\n });\n\n return eventPromise;\n }\n\n /**\n * Attach Ongoing EventProcessor for specific event for a call.\n * @param eventTypeKind - Matching event.\n * @param callConnectionId - CallConnectionId of the call.\n * @param eventProcessor - Method that will execute once the matching event arrives.\n */\n public async attachOngoingEventProcessor(\n callConnectionId: string,\n eventTypeKind: CallAutomationEvent[\"kind\"],\n eventProcessor: (event: CallAutomationEvent) => Promise<void>,\n ): Promise<void> {\n const eventAwaiter = (event: CallAutomationEvent): void => {\n if (event.callConnectionId === callConnectionId && event.kind === eventTypeKind) {\n eventProcessor(event);\n }\n };\n // Register the event awaiter\n this.emitter.on(\"event\", eventAwaiter);\n\n // attach the ongoing event processor to the map\n const uniqueId = this.generateIdTypeKey(callConnectionId, eventTypeKind);\n this.ongoingEvents.set(uniqueId, eventAwaiter);\n }\n\n /**\n * Detach Ongoing EventProcessor for specific event.\n * @param eventTypeKind - Matching event.\n * @param callConnectionId - CallConnectionId of the call.\n */\n public async detachOngoingEventProcessor(\n callConnectionId: string,\n eventTypeKind: CallAutomationEvent[\"kind\"],\n ): Promise<void> {\n const uniqueId = this.generateIdTypeKey(callConnectionId, eventTypeKind);\n const value = this.ongoingEvents.get(uniqueId);\n\n if (value) {\n // Deregister the event listener\n this.ongoingEvents.delete(uniqueId);\n this.emitter.off(\"event\", value);\n }\n }\n\n private generateIdTypeKey(callConnectionId: string, eventType: string): string {\n return `${callConnectionId}:${eventType}`;\n }\n}\n"]}
@@ -0,0 +1,134 @@
1
+ import type { AddParticipantSucceeded, AddParticipantFailed, CallConnected, PlayCanceled, RecognizeCanceled, PlayCompleted, PlayFailed, RemoveParticipantSucceeded, RemoveParticipantFailed, MoveParticipantSucceeded, MoveParticipantFailed, SendDtmfTonesCompleted, SendDtmfTonesFailed, RecognizeCompleted, RecognizeFailed, CallTransferAccepted, CallTransferFailed, CancelAddParticipantSucceeded, CancelAddParticipantFailed, CreateCallFailed, AnswerFailed, ConnectFailed } from "../models/events.js";
2
+ /**
3
+ * AddParticipant event result
4
+ */
5
+ export interface AddParticipantEventResult {
6
+ /** returns true if add participant was successful */
7
+ isSuccess: boolean;
8
+ /** contains success event if the result was successful */
9
+ successResult?: AddParticipantSucceeded;
10
+ /** contains failure event if the result was failure */
11
+ failureResult?: AddParticipantFailed;
12
+ }
13
+ /**
14
+ * AnswerCall event result
15
+ */
16
+ export interface AnswerCallEventResult {
17
+ /** returns true if answer call was successful */
18
+ isSuccess: boolean;
19
+ /** contains success event if the result was successful */
20
+ successResult?: CallConnected;
21
+ /** contains failure event if the result was failure */
22
+ failureResult?: AnswerFailed;
23
+ }
24
+ /**
25
+ * CancelAllMediaOperations event result
26
+ */
27
+ export interface CancelAllMediaOperationsEventResult {
28
+ /** returns true if cancel all media was successful */
29
+ isSuccess: boolean;
30
+ /** contains play cancel event if play media was canceled */
31
+ playCanceledSuccessResult?: PlayCanceled;
32
+ /** contains recognize cancel event if recognize media was canceled */
33
+ recognizeCanceledSuccessResult?: RecognizeCanceled;
34
+ }
35
+ /**
36
+ * CreateCall event result
37
+ */
38
+ export interface CreateCallEventResult {
39
+ /** returns true if create call was successful */
40
+ isSuccess: boolean;
41
+ /** contains success event if the result was successful */
42
+ successResult?: CallConnected;
43
+ /** contains failure event if the result was failure */
44
+ failureResult?: CreateCallFailed;
45
+ }
46
+ /**
47
+ * ConnectCall event result
48
+ */
49
+ export interface ConnectCallEventResult {
50
+ /** returns true if create call was successful */
51
+ isSuccess: boolean;
52
+ /** contains success event if the result was successful */
53
+ successResult?: CallConnected;
54
+ /** contains failure event if the result was failure */
55
+ failureResult?: ConnectFailed;
56
+ }
57
+ /**
58
+ * Play event result
59
+ */
60
+ export interface PlayEventResult {
61
+ /** returns true if play was successful */
62
+ isSuccess: boolean;
63
+ /** contains success event if the result was successful */
64
+ successResult?: PlayCompleted;
65
+ /** contains failure event if the result was failure */
66
+ failureResult?: PlayFailed;
67
+ }
68
+ /**
69
+ * RemoveParticipant event result
70
+ */
71
+ export interface RemoveParticipantEventResult {
72
+ /** returns true if remove participant was successful */
73
+ isSuccess: boolean;
74
+ /** contains success event if the result was successful */
75
+ successResult?: RemoveParticipantSucceeded;
76
+ /** contains failure event if the result was failure */
77
+ failureResult?: RemoveParticipantFailed;
78
+ }
79
+ /**
80
+ * MoveParticipant event result
81
+ */
82
+ export interface MoveParticipantEventResult {
83
+ /** returns true if move participant was successful */
84
+ isSuccess: boolean;
85
+ /** contains success event if the result was successful */
86
+ successResult?: MoveParticipantSucceeded;
87
+ /** contains failure event if the result was failure */
88
+ failureResult?: MoveParticipantFailed;
89
+ }
90
+ /**
91
+ * SendDtmf event result
92
+ */
93
+ export interface SendDtmfEventResult {
94
+ /** returns true if send dtmf was successful */
95
+ isSuccess: boolean;
96
+ /** contains success event if the result was successful */
97
+ successResult?: SendDtmfTonesCompleted;
98
+ /** contains failure event if the result was failure */
99
+ failureResult?: SendDtmfTonesFailed;
100
+ }
101
+ /**
102
+ * StartRecognizing event result
103
+ */
104
+ export interface StartRecognizingEventResult {
105
+ /** returns true if recognize was successful */
106
+ isSuccess: boolean;
107
+ /** contains success event if the result was successful */
108
+ successResult?: RecognizeCompleted;
109
+ /** contains failure event if the result was failure */
110
+ failureResult?: RecognizeFailed;
111
+ }
112
+ /**
113
+ * TransferCallToParticipant event result
114
+ */
115
+ export interface TransferCallToParticipantEventResult {
116
+ /** returns true if transfer call to participant was successful */
117
+ isSuccess: boolean;
118
+ /** contains success event if the result was successful */
119
+ successResult?: CallTransferAccepted;
120
+ /** contains failure event if the result was failure */
121
+ failureResult?: CallTransferFailed;
122
+ }
123
+ /**
124
+ * TransferCallToParticipant event result
125
+ */
126
+ export interface CancelAddParticipantEventResult {
127
+ /** returns true if cancel add participant was successful */
128
+ isSuccess: boolean;
129
+ /** contains success event if the result was successful */
130
+ successResult?: CancelAddParticipantSucceeded;
131
+ /** contains failure event if the result was failure */
132
+ failureResult?: CancelAddParticipantFailed;
133
+ }
134
+ //# sourceMappingURL=eventResponses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eventResponses.d.ts","sourceRoot":"","sources":["../../../src/eventprocessor/eventResponses.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,E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pC;AAED;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC9C,4DAA4D;IAC5D,SAAS,EAAE,OAAO,CAAC;IACnB,0DAA0D;IAC1D,aAAa,CAAC,EAAE,6BAA6B,CAAC;IAC9C,uDAAuD;IACvD,aAAa,CAAC,EAAE,0BAA0B,CAAC;CAC5C"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ //# sourceMappingURL=eventResponses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eventResponses.js","sourceRoot":"","sources":["../../../src/eventprocessor/eventResponses.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n AddParticipantSucceeded,\n AddParticipantFailed,\n CallConnected,\n PlayCanceled,\n RecognizeCanceled,\n PlayCompleted,\n PlayFailed,\n RemoveParticipantSucceeded,\n RemoveParticipantFailed,\n MoveParticipantSucceeded,\n MoveParticipantFailed,\n SendDtmfTonesCompleted,\n SendDtmfTonesFailed,\n RecognizeCompleted,\n RecognizeFailed,\n CallTransferAccepted,\n CallTransferFailed,\n CancelAddParticipantSucceeded,\n CancelAddParticipantFailed,\n CreateCallFailed,\n AnswerFailed,\n ConnectFailed,\n} from \"../models/events.js\";\n\n/**\n * AddParticipant event result\n */\nexport interface AddParticipantEventResult {\n /** returns true if add participant was successful */\n isSuccess: boolean;\n\n /** contains success event if the result was successful */\n successResult?: AddParticipantSucceeded;\n\n /** contains failure event if the result was failure */\n failureResult?: AddParticipantFailed;\n}\n\n/**\n * AnswerCall event result\n */\nexport interface AnswerCallEventResult {\n /** returns true if answer call was successful */\n isSuccess: boolean;\n /** contains success event if the result was successful */\n successResult?: CallConnected;\n /** contains failure event if the result was failure */\n failureResult?: AnswerFailed;\n}\n\n/**\n * CancelAllMediaOperations event result\n */\nexport interface CancelAllMediaOperationsEventResult {\n /** returns true if cancel all media was successful */\n isSuccess: boolean;\n /** contains play cancel event if play media was canceled */\n playCanceledSuccessResult?: PlayCanceled;\n /** contains recognize cancel event if recognize media was canceled */\n recognizeCanceledSuccessResult?: RecognizeCanceled;\n}\n\n/**\n * CreateCall event result\n */\nexport interface CreateCallEventResult {\n /** returns true if create call was successful */\n isSuccess: boolean;\n /** contains success event if the result was successful */\n successResult?: CallConnected;\n /** contains failure event if the result was failure */\n failureResult?: CreateCallFailed;\n}\n\n/**\n * ConnectCall event result\n */\nexport interface ConnectCallEventResult {\n /** returns true if create call was successful */\n isSuccess: boolean;\n /** contains success event if the result was successful */\n successResult?: CallConnected;\n /** contains failure event if the result was failure */\n failureResult?: ConnectFailed;\n}\n\n/**\n * Play event result\n */\nexport interface PlayEventResult {\n /** returns true if play was successful */\n isSuccess: boolean;\n /** contains success event if the result was successful */\n successResult?: PlayCompleted;\n /** contains failure event if the result was failure */\n failureResult?: PlayFailed;\n}\n\n/**\n * RemoveParticipant event result\n */\nexport interface RemoveParticipantEventResult {\n /** returns true if remove participant was successful */\n isSuccess: boolean;\n /** contains success event if the result was successful */\n successResult?: RemoveParticipantSucceeded;\n /** contains failure event if the result was failure */\n failureResult?: RemoveParticipantFailed;\n}\n\n/**\n * MoveParticipant event result\n */\nexport interface MoveParticipantEventResult {\n /** returns true if move participant was successful */\n isSuccess: boolean;\n /** contains success event if the result was successful */\n successResult?: MoveParticipantSucceeded;\n /** contains failure event if the result was failure */\n failureResult?: MoveParticipantFailed;\n}\n\n/**\n * SendDtmf event result\n */\nexport interface SendDtmfEventResult {\n /** returns true if send dtmf was successful */\n isSuccess: boolean;\n /** contains success event if the result was successful */\n successResult?: SendDtmfTonesCompleted;\n /** contains failure event if the result was failure */\n failureResult?: SendDtmfTonesFailed;\n}\n\n/**\n * StartRecognizing event result\n */\nexport interface StartRecognizingEventResult {\n /** returns true if recognize was successful */\n isSuccess: boolean;\n /** contains success event if the result was successful */\n successResult?: RecognizeCompleted;\n /** contains failure event if the result was failure */\n failureResult?: RecognizeFailed;\n}\n\n/**\n * TransferCallToParticipant event result\n */\nexport interface TransferCallToParticipantEventResult {\n /** returns true if transfer call to participant was successful */\n isSuccess: boolean;\n /** contains success event if the result was successful */\n successResult?: CallTransferAccepted;\n /** contains failure event if the result was failure */\n failureResult?: CallTransferFailed;\n}\n\n/**\n * TransferCallToParticipant event result\n */\nexport interface CancelAddParticipantEventResult {\n /** returns true if cancel add participant was successful */\n isSuccess: boolean;\n /** contains success event if the result was successful */\n successResult?: CancelAddParticipantSucceeded;\n /** contains failure event if the result was failure */\n failureResult?: CancelAddParticipantFailed;\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import * as coreClient from "@azure/core-client";
2
- import { CallConnection, CallMedia, CallRecording } from "./operationsInterfaces/index.js";
2
+ import { CallConnection, CallMedia, CallDialog, CallRecording } from "./operationsInterfaces/index.js";
3
3
  import { CallAutomationApiClientOptionalParams, CreateCallRequest, CreateCallOptionalParams, CreateCallResponse, AnswerCallRequest, AnswerCallOptionalParams, AnswerCallResponse, RedirectCallRequest, RedirectCallOptionalParams, RejectCallRequest, RejectCallOptionalParams, ConnectRequest, ConnectOptionalParams, ConnectResponse } from "./models/index.js";
4
4
  export declare class CallAutomationApiClient extends coreClient.ServiceClient {
5
5
  endpoint: string;
@@ -44,6 +44,7 @@ export declare class CallAutomationApiClient extends coreClient.ServiceClient {
44
44
  connect(connectRequest: ConnectRequest, options?: ConnectOptionalParams): Promise<ConnectResponse>;
45
45
  callConnection: CallConnection;
46
46
  callMedia: CallMedia;
47
+ callDialog: CallDialog;
47
48
  callRecording: CallRecording;
48
49
  }
49
50
  //# sourceMappingURL=callAutomationApiClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"callAutomationApiClient.d.ts","sourceRoot":"","sources":["../../../../src/generated/src/callAutomationApiClient.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAW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{"version":3,"file":"callAutomationApiClient.d.ts","sourceRoot":"","sources":["../../../../src/generated/src/callAutomationApiClient.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAYjD,OAAO,EACL,cAAc,EACd,SAAS,EACT,UAAU,EACV,aAAa,EACd,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EACL,qCAAqC,EACrC,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,EAClB,mBAAmB,EACnB,0BAA0B,EAC1B,iBAAiB,EACjB,wBAAwB,EACxB,cAAc,EACd,qBAAqB,EACrB,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAE3B,qBAAa,uBAAwB,SAAQ,UAAU,CAAC,aAAa;IACnE,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;gBAED,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,qCAAqC;IAyCjD,8GAA8G;IAC9G,OAAO,CAAC,yBAAyB;IA2BjC;;;;OAIG;IACH,UAAU,CACR,iBAAiB,EAAE,iBAAiB,EACpC,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,kBAAkB,CAAC;IAO9B;;;;OAIG;IACH,UAAU,CACR,iBAAiB,EAAE,iBAAiB,EACpC,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,kBAAkB,CAAC;IAO9B;;;;OAIG;IACH,YAAY,CACV,mBAAmB,EAAE,mBAAmB,EACxC,OAAO,CAAC,EAAE,0BAA0B,GACnC,OAAO,CAAC,IAAI,CAAC;IAOhB;;;;OAIG;IACH,UAAU,CACR,iBAAiB,EAAE,iBAAiB,EACpC,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,IAAI,CAAC;IAOhB;;;;OAIG;IACH,OAAO,CACL,cAAc,EAAE,cAAc,EAC9B,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,eAAe,CAAC;IAO3B,cAAc,EAAE,cAAc,CAAC;IAC/B,SAAS,EAAE,SAAS,CAAC;IACrB,UAAU,EAAE,UAAU,CAAC;IACvB,aAAa,EAAE,aAAa,CAAC;CAC9B"}
@@ -31,7 +31,7 @@ class CallAutomationApiClient extends coreClient.ServiceClient {
31
31
  const defaults = {
32
32
  requestContentType: "application/json; charset=utf-8",
33
33
  };
34
- const packageDetails = `azsdk-js-communication-call-automation/1.5.0-beta.2`;
34
+ const packageDetails = `azsdk-js-communication-call-automation/1.6.0-beta.1`;
35
35
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
36
36
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
37
37
  : `${packageDetails}`;
@@ -42,9 +42,10 @@ class CallAutomationApiClient extends coreClient.ServiceClient {
42
42
  // Parameter assignments
43
43
  this.endpoint = endpoint;
44
44
  // Assigning values to Constant parameters
45
- this.apiVersion = options.apiVersion || "2025-03-30-preview";
45
+ this.apiVersion = options.apiVersion || "2024-09-01-preview";
46
46
  this.callConnection = new index_js_1.CallConnectionImpl(this);
47
47
  this.callMedia = new index_js_1.CallMediaImpl(this);
48
+ this.callDialog = new index_js_1.CallDialogImpl(this);
48
49
  this.callRecording = new index_js_1.CallRecordingImpl(this);
49
50
  this.addCustomApiVersionPolicy(options.apiVersion);
50
51
  }