@azure/communication-call-automation 1.5.0-alpha.20250516.3 → 1.5.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 (407) hide show
  1. package/README.md +1 -51
  2. package/dist/browser/callAutomationClient.d.ts +2 -9
  3. package/dist/browser/callAutomationClient.d.ts.map +1 -1
  4. package/dist/browser/callAutomationClient.js +9 -106
  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 +0 -18
  8. package/dist/browser/callAutomationEventParser.js.map +1 -1
  9. package/dist/browser/callConnection.d.ts +4 -6
  10. package/dist/browser/callConnection.d.ts.map +1 -1
  11. package/dist/browser/callConnection.js +13 -112
  12. package/dist/browser/callConnection.js.map +1 -1
  13. package/dist/browser/callMedia.d.ts +10 -20
  14. package/dist/browser/callMedia.d.ts.map +1 -1
  15. package/dist/browser/callMedia.js +20 -188
  16. package/dist/browser/callMedia.js.map +1 -1
  17. package/dist/browser/callRecording.d.ts.map +1 -1
  18. package/dist/browser/callRecording.js +5 -2
  19. package/dist/browser/callRecording.js.map +1 -1
  20. package/dist/browser/generated/src/callAutomationApiClient.d.ts +1 -2
  21. package/dist/browser/generated/src/callAutomationApiClient.d.ts.map +1 -1
  22. package/dist/browser/generated/src/callAutomationApiClient.js +2 -3
  23. package/dist/browser/generated/src/callAutomationApiClient.js.map +1 -1
  24. package/dist/browser/generated/src/models/index.d.ts +205 -850
  25. package/dist/browser/generated/src/models/index.d.ts.map +1 -1
  26. package/dist/browser/generated/src/models/index.js +48 -126
  27. package/dist/browser/generated/src/models/index.js.map +1 -1
  28. package/dist/browser/generated/src/models/mappers.d.ts +11 -48
  29. package/dist/browser/generated/src/models/mappers.d.ts.map +1 -1
  30. package/dist/browser/generated/src/models/mappers.js +460 -1644
  31. package/dist/browser/generated/src/models/mappers.js.map +1 -1
  32. package/dist/browser/generated/src/models/parameters.d.ts +1 -7
  33. package/dist/browser/generated/src/models/parameters.d.ts.map +1 -1
  34. package/dist/browser/generated/src/models/parameters.js +6 -41
  35. package/dist/browser/generated/src/models/parameters.js.map +1 -1
  36. package/dist/browser/generated/src/operations/callConnection.d.ts +2 -9
  37. package/dist/browser/generated/src/operations/callConnection.d.ts.map +1 -1
  38. package/dist/browser/generated/src/operations/callConnection.js +1 -33
  39. package/dist/browser/generated/src/operations/callConnection.js.map +1 -1
  40. package/dist/browser/generated/src/operations/callMedia.d.ts +8 -15
  41. package/dist/browser/generated/src/operations/callMedia.d.ts.map +1 -1
  42. package/dist/browser/generated/src/operations/callMedia.js +25 -50
  43. package/dist/browser/generated/src/operations/callMedia.js.map +1 -1
  44. package/dist/browser/generated/src/operations/callRecording.d.ts +1 -7
  45. package/dist/browser/generated/src/operations/callRecording.d.ts.map +1 -1
  46. package/dist/browser/generated/src/operations/callRecording.js +0 -24
  47. package/dist/browser/generated/src/operations/callRecording.js.map +1 -1
  48. package/dist/browser/generated/src/operations/index.d.ts +0 -1
  49. package/dist/browser/generated/src/operations/index.d.ts.map +1 -1
  50. package/dist/browser/generated/src/operations/index.js +0 -1
  51. package/dist/browser/generated/src/operations/index.js.map +1 -1
  52. package/dist/browser/generated/src/operationsInterfaces/callConnection.d.ts +2 -9
  53. package/dist/browser/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
  54. package/dist/browser/generated/src/operationsInterfaces/callConnection.js.map +1 -1
  55. package/dist/browser/generated/src/operationsInterfaces/callMedia.d.ts +8 -15
  56. package/dist/browser/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
  57. package/dist/browser/generated/src/operationsInterfaces/callMedia.js.map +1 -1
  58. package/dist/browser/generated/src/operationsInterfaces/callRecording.d.ts +1 -7
  59. package/dist/browser/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
  60. package/dist/browser/generated/src/operationsInterfaces/callRecording.js.map +1 -1
  61. package/dist/browser/generated/src/operationsInterfaces/index.d.ts +0 -1
  62. package/dist/browser/generated/src/operationsInterfaces/index.d.ts.map +1 -1
  63. package/dist/browser/generated/src/operationsInterfaces/index.js +0 -1
  64. package/dist/browser/generated/src/operationsInterfaces/index.js.map +1 -1
  65. package/dist/browser/index.d.ts +0 -2
  66. package/dist/browser/index.d.ts.map +1 -1
  67. package/dist/browser/index.js +0 -2
  68. package/dist/browser/index.js.map +1 -1
  69. package/dist/browser/models/constants.js +1 -1
  70. package/dist/browser/models/constants.js.map +1 -1
  71. package/dist/browser/models/events.d.ts +67 -155
  72. package/dist/browser/models/events.d.ts.map +1 -1
  73. package/dist/browser/models/events.js.map +1 -1
  74. package/dist/browser/models/models.d.ts +5 -14
  75. package/dist/browser/models/models.d.ts.map +1 -1
  76. package/dist/browser/models/models.js +1 -3
  77. package/dist/browser/models/models.js.map +1 -1
  78. package/dist/browser/models/options.d.ts +2 -35
  79. package/dist/browser/models/options.d.ts.map +1 -1
  80. package/dist/browser/models/options.js.map +1 -1
  81. package/dist/browser/models/responses.d.ts +10 -51
  82. package/dist/browser/models/responses.d.ts.map +1 -1
  83. package/dist/browser/models/responses.js.map +1 -1
  84. package/dist/browser/utli/converters.d.ts.map +1 -1
  85. package/dist/browser/utli/converters.js +19 -1
  86. package/dist/browser/utli/converters.js.map +1 -1
  87. package/dist/commonjs/callAutomationClient.d.ts +2 -9
  88. package/dist/commonjs/callAutomationClient.d.ts.map +1 -1
  89. package/dist/commonjs/callAutomationClient.js +11 -108
  90. package/dist/commonjs/callAutomationClient.js.map +1 -1
  91. package/dist/commonjs/callAutomationEventParser.d.ts.map +1 -1
  92. package/dist/commonjs/callAutomationEventParser.js +0 -18
  93. package/dist/commonjs/callAutomationEventParser.js.map +1 -1
  94. package/dist/commonjs/callConnection.d.ts +4 -6
  95. package/dist/commonjs/callConnection.d.ts.map +1 -1
  96. package/dist/commonjs/callConnection.js +15 -114
  97. package/dist/commonjs/callConnection.js.map +1 -1
  98. package/dist/commonjs/callMedia.d.ts +10 -20
  99. package/dist/commonjs/callMedia.d.ts.map +1 -1
  100. package/dist/commonjs/callMedia.js +39 -207
  101. package/dist/commonjs/callMedia.js.map +1 -1
  102. package/dist/commonjs/callRecording.d.ts.map +1 -1
  103. package/dist/commonjs/callRecording.js +5 -2
  104. package/dist/commonjs/callRecording.js.map +1 -1
  105. package/dist/commonjs/generated/src/callAutomationApiClient.d.ts +1 -2
  106. package/dist/commonjs/generated/src/callAutomationApiClient.d.ts.map +1 -1
  107. package/dist/commonjs/generated/src/callAutomationApiClient.js +1 -2
  108. package/dist/commonjs/generated/src/callAutomationApiClient.js.map +1 -1
  109. package/dist/commonjs/generated/src/models/index.d.ts +205 -850
  110. package/dist/commonjs/generated/src/models/index.d.ts.map +1 -1
  111. package/dist/commonjs/generated/src/models/index.js +49 -127
  112. package/dist/commonjs/generated/src/models/index.js.map +1 -1
  113. package/dist/commonjs/generated/src/models/mappers.d.ts +11 -48
  114. package/dist/commonjs/generated/src/models/mappers.d.ts.map +1 -1
  115. package/dist/commonjs/generated/src/models/mappers.js +463 -1647
  116. package/dist/commonjs/generated/src/models/mappers.js.map +1 -1
  117. package/dist/commonjs/generated/src/models/parameters.d.ts +1 -7
  118. package/dist/commonjs/generated/src/models/parameters.d.ts.map +1 -1
  119. package/dist/commonjs/generated/src/models/parameters.js +6 -41
  120. package/dist/commonjs/generated/src/models/parameters.js.map +1 -1
  121. package/dist/commonjs/generated/src/operations/callConnection.d.ts +2 -9
  122. package/dist/commonjs/generated/src/operations/callConnection.d.ts.map +1 -1
  123. package/dist/commonjs/generated/src/operations/callConnection.js +1 -33
  124. package/dist/commonjs/generated/src/operations/callConnection.js.map +1 -1
  125. package/dist/commonjs/generated/src/operations/callMedia.d.ts +8 -15
  126. package/dist/commonjs/generated/src/operations/callMedia.d.ts.map +1 -1
  127. package/dist/commonjs/generated/src/operations/callMedia.js +25 -50
  128. package/dist/commonjs/generated/src/operations/callMedia.js.map +1 -1
  129. package/dist/commonjs/generated/src/operations/callRecording.d.ts +1 -7
  130. package/dist/commonjs/generated/src/operations/callRecording.d.ts.map +1 -1
  131. package/dist/commonjs/generated/src/operations/callRecording.js +0 -24
  132. package/dist/commonjs/generated/src/operations/callRecording.js.map +1 -1
  133. package/dist/commonjs/generated/src/operations/index.d.ts +0 -1
  134. package/dist/commonjs/generated/src/operations/index.d.ts.map +1 -1
  135. package/dist/commonjs/generated/src/operations/index.js +0 -1
  136. package/dist/commonjs/generated/src/operations/index.js.map +1 -1
  137. package/dist/commonjs/generated/src/operationsInterfaces/callConnection.d.ts +2 -9
  138. package/dist/commonjs/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
  139. package/dist/commonjs/generated/src/operationsInterfaces/callConnection.js.map +1 -1
  140. package/dist/commonjs/generated/src/operationsInterfaces/callMedia.d.ts +8 -15
  141. package/dist/commonjs/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
  142. package/dist/commonjs/generated/src/operationsInterfaces/callMedia.js.map +1 -1
  143. package/dist/commonjs/generated/src/operationsInterfaces/callRecording.d.ts +1 -7
  144. package/dist/commonjs/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
  145. package/dist/commonjs/generated/src/operationsInterfaces/callRecording.js.map +1 -1
  146. package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts +0 -1
  147. package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts.map +1 -1
  148. package/dist/commonjs/generated/src/operationsInterfaces/index.js +0 -1
  149. package/dist/commonjs/generated/src/operationsInterfaces/index.js.map +1 -1
  150. package/dist/commonjs/index.d.ts +0 -2
  151. package/dist/commonjs/index.d.ts.map +1 -1
  152. package/dist/commonjs/index.js +0 -2
  153. package/dist/commonjs/index.js.map +1 -1
  154. package/dist/commonjs/models/constants.js +1 -1
  155. package/dist/commonjs/models/constants.js.map +1 -1
  156. package/dist/commonjs/models/events.d.ts +67 -155
  157. package/dist/commonjs/models/events.d.ts.map +1 -1
  158. package/dist/commonjs/models/events.js.map +1 -1
  159. package/dist/commonjs/models/models.d.ts +5 -14
  160. package/dist/commonjs/models/models.d.ts.map +1 -1
  161. package/dist/commonjs/models/models.js +6 -10
  162. package/dist/commonjs/models/models.js.map +1 -1
  163. package/dist/commonjs/models/options.d.ts +2 -35
  164. package/dist/commonjs/models/options.d.ts.map +1 -1
  165. package/dist/commonjs/models/options.js.map +1 -1
  166. package/dist/commonjs/models/responses.d.ts +10 -51
  167. package/dist/commonjs/models/responses.d.ts.map +1 -1
  168. package/dist/commonjs/models/responses.js.map +1 -1
  169. package/dist/commonjs/tsdoc-metadata.json +1 -1
  170. package/dist/commonjs/utli/converters.d.ts.map +1 -1
  171. package/dist/commonjs/utli/converters.js +18 -0
  172. package/dist/commonjs/utli/converters.js.map +1 -1
  173. package/dist/esm/callAutomationClient.d.ts +2 -9
  174. package/dist/esm/callAutomationClient.d.ts.map +1 -1
  175. package/dist/esm/callAutomationClient.js +9 -106
  176. package/dist/esm/callAutomationClient.js.map +1 -1
  177. package/dist/esm/callAutomationEventParser.d.ts.map +1 -1
  178. package/dist/esm/callAutomationEventParser.js +0 -18
  179. package/dist/esm/callAutomationEventParser.js.map +1 -1
  180. package/dist/esm/callConnection.d.ts +4 -6
  181. package/dist/esm/callConnection.d.ts.map +1 -1
  182. package/dist/esm/callConnection.js +13 -112
  183. package/dist/esm/callConnection.js.map +1 -1
  184. package/dist/esm/callMedia.d.ts +10 -20
  185. package/dist/esm/callMedia.d.ts.map +1 -1
  186. package/dist/esm/callMedia.js +20 -188
  187. package/dist/esm/callMedia.js.map +1 -1
  188. package/dist/esm/callRecording.d.ts.map +1 -1
  189. package/dist/esm/callRecording.js +5 -2
  190. package/dist/esm/callRecording.js.map +1 -1
  191. package/dist/esm/generated/src/callAutomationApiClient.d.ts +1 -2
  192. package/dist/esm/generated/src/callAutomationApiClient.d.ts.map +1 -1
  193. package/dist/esm/generated/src/callAutomationApiClient.js +2 -3
  194. package/dist/esm/generated/src/callAutomationApiClient.js.map +1 -1
  195. package/dist/esm/generated/src/models/index.d.ts +205 -850
  196. package/dist/esm/generated/src/models/index.d.ts.map +1 -1
  197. package/dist/esm/generated/src/models/index.js +48 -126
  198. package/dist/esm/generated/src/models/index.js.map +1 -1
  199. package/dist/esm/generated/src/models/mappers.d.ts +11 -48
  200. package/dist/esm/generated/src/models/mappers.d.ts.map +1 -1
  201. package/dist/esm/generated/src/models/mappers.js +460 -1644
  202. package/dist/esm/generated/src/models/mappers.js.map +1 -1
  203. package/dist/esm/generated/src/models/parameters.d.ts +1 -7
  204. package/dist/esm/generated/src/models/parameters.d.ts.map +1 -1
  205. package/dist/esm/generated/src/models/parameters.js +6 -41
  206. package/dist/esm/generated/src/models/parameters.js.map +1 -1
  207. package/dist/esm/generated/src/operations/callConnection.d.ts +2 -9
  208. package/dist/esm/generated/src/operations/callConnection.d.ts.map +1 -1
  209. package/dist/esm/generated/src/operations/callConnection.js +1 -33
  210. package/dist/esm/generated/src/operations/callConnection.js.map +1 -1
  211. package/dist/esm/generated/src/operations/callMedia.d.ts +8 -15
  212. package/dist/esm/generated/src/operations/callMedia.d.ts.map +1 -1
  213. package/dist/esm/generated/src/operations/callMedia.js +25 -50
  214. package/dist/esm/generated/src/operations/callMedia.js.map +1 -1
  215. package/dist/esm/generated/src/operations/callRecording.d.ts +1 -7
  216. package/dist/esm/generated/src/operations/callRecording.d.ts.map +1 -1
  217. package/dist/esm/generated/src/operations/callRecording.js +0 -24
  218. package/dist/esm/generated/src/operations/callRecording.js.map +1 -1
  219. package/dist/esm/generated/src/operations/index.d.ts +0 -1
  220. package/dist/esm/generated/src/operations/index.d.ts.map +1 -1
  221. package/dist/esm/generated/src/operations/index.js +0 -1
  222. package/dist/esm/generated/src/operations/index.js.map +1 -1
  223. package/dist/esm/generated/src/operationsInterfaces/callConnection.d.ts +2 -9
  224. package/dist/esm/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
  225. package/dist/esm/generated/src/operationsInterfaces/callConnection.js.map +1 -1
  226. package/dist/esm/generated/src/operationsInterfaces/callMedia.d.ts +8 -15
  227. package/dist/esm/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
  228. package/dist/esm/generated/src/operationsInterfaces/callMedia.js.map +1 -1
  229. package/dist/esm/generated/src/operationsInterfaces/callRecording.d.ts +1 -7
  230. package/dist/esm/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
  231. package/dist/esm/generated/src/operationsInterfaces/callRecording.js.map +1 -1
  232. package/dist/esm/generated/src/operationsInterfaces/index.d.ts +0 -1
  233. package/dist/esm/generated/src/operationsInterfaces/index.d.ts.map +1 -1
  234. package/dist/esm/generated/src/operationsInterfaces/index.js +0 -1
  235. package/dist/esm/generated/src/operationsInterfaces/index.js.map +1 -1
  236. package/dist/esm/index.d.ts +0 -2
  237. package/dist/esm/index.d.ts.map +1 -1
  238. package/dist/esm/index.js +0 -2
  239. package/dist/esm/index.js.map +1 -1
  240. package/dist/esm/models/constants.js +1 -1
  241. package/dist/esm/models/constants.js.map +1 -1
  242. package/dist/esm/models/events.d.ts +67 -155
  243. package/dist/esm/models/events.d.ts.map +1 -1
  244. package/dist/esm/models/events.js.map +1 -1
  245. package/dist/esm/models/models.d.ts +5 -14
  246. package/dist/esm/models/models.d.ts.map +1 -1
  247. package/dist/esm/models/models.js +1 -3
  248. package/dist/esm/models/models.js.map +1 -1
  249. package/dist/esm/models/options.d.ts +2 -35
  250. package/dist/esm/models/options.d.ts.map +1 -1
  251. package/dist/esm/models/options.js.map +1 -1
  252. package/dist/esm/models/responses.d.ts +10 -51
  253. package/dist/esm/models/responses.d.ts.map +1 -1
  254. package/dist/esm/models/responses.js.map +1 -1
  255. package/dist/esm/utli/converters.d.ts.map +1 -1
  256. package/dist/esm/utli/converters.js +19 -1
  257. package/dist/esm/utli/converters.js.map +1 -1
  258. package/dist/react-native/callAutomationClient.d.ts +2 -9
  259. package/dist/react-native/callAutomationClient.d.ts.map +1 -1
  260. package/dist/react-native/callAutomationClient.js +9 -106
  261. package/dist/react-native/callAutomationClient.js.map +1 -1
  262. package/dist/react-native/callAutomationEventParser.d.ts.map +1 -1
  263. package/dist/react-native/callAutomationEventParser.js +0 -18
  264. package/dist/react-native/callAutomationEventParser.js.map +1 -1
  265. package/dist/react-native/callConnection.d.ts +4 -6
  266. package/dist/react-native/callConnection.d.ts.map +1 -1
  267. package/dist/react-native/callConnection.js +13 -112
  268. package/dist/react-native/callConnection.js.map +1 -1
  269. package/dist/react-native/callMedia.d.ts +10 -20
  270. package/dist/react-native/callMedia.d.ts.map +1 -1
  271. package/dist/react-native/callMedia.js +20 -188
  272. package/dist/react-native/callMedia.js.map +1 -1
  273. package/dist/react-native/callRecording.d.ts.map +1 -1
  274. package/dist/react-native/callRecording.js +5 -2
  275. package/dist/react-native/callRecording.js.map +1 -1
  276. package/dist/react-native/generated/src/callAutomationApiClient.d.ts +1 -2
  277. package/dist/react-native/generated/src/callAutomationApiClient.d.ts.map +1 -1
  278. package/dist/react-native/generated/src/callAutomationApiClient.js +2 -3
  279. package/dist/react-native/generated/src/callAutomationApiClient.js.map +1 -1
  280. package/dist/react-native/generated/src/models/index.d.ts +205 -850
  281. package/dist/react-native/generated/src/models/index.d.ts.map +1 -1
  282. package/dist/react-native/generated/src/models/index.js +48 -126
  283. package/dist/react-native/generated/src/models/index.js.map +1 -1
  284. package/dist/react-native/generated/src/models/mappers.d.ts +11 -48
  285. package/dist/react-native/generated/src/models/mappers.d.ts.map +1 -1
  286. package/dist/react-native/generated/src/models/mappers.js +460 -1644
  287. package/dist/react-native/generated/src/models/mappers.js.map +1 -1
  288. package/dist/react-native/generated/src/models/parameters.d.ts +1 -7
  289. package/dist/react-native/generated/src/models/parameters.d.ts.map +1 -1
  290. package/dist/react-native/generated/src/models/parameters.js +6 -41
  291. package/dist/react-native/generated/src/models/parameters.js.map +1 -1
  292. package/dist/react-native/generated/src/operations/callConnection.d.ts +2 -9
  293. package/dist/react-native/generated/src/operations/callConnection.d.ts.map +1 -1
  294. package/dist/react-native/generated/src/operations/callConnection.js +1 -33
  295. package/dist/react-native/generated/src/operations/callConnection.js.map +1 -1
  296. package/dist/react-native/generated/src/operations/callMedia.d.ts +8 -15
  297. package/dist/react-native/generated/src/operations/callMedia.d.ts.map +1 -1
  298. package/dist/react-native/generated/src/operations/callMedia.js +25 -50
  299. package/dist/react-native/generated/src/operations/callMedia.js.map +1 -1
  300. package/dist/react-native/generated/src/operations/callRecording.d.ts +1 -7
  301. package/dist/react-native/generated/src/operations/callRecording.d.ts.map +1 -1
  302. package/dist/react-native/generated/src/operations/callRecording.js +0 -24
  303. package/dist/react-native/generated/src/operations/callRecording.js.map +1 -1
  304. package/dist/react-native/generated/src/operations/index.d.ts +0 -1
  305. package/dist/react-native/generated/src/operations/index.d.ts.map +1 -1
  306. package/dist/react-native/generated/src/operations/index.js +0 -1
  307. package/dist/react-native/generated/src/operations/index.js.map +1 -1
  308. package/dist/react-native/generated/src/operationsInterfaces/callConnection.d.ts +2 -9
  309. package/dist/react-native/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
  310. package/dist/react-native/generated/src/operationsInterfaces/callConnection.js.map +1 -1
  311. package/dist/react-native/generated/src/operationsInterfaces/callMedia.d.ts +8 -15
  312. package/dist/react-native/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
  313. package/dist/react-native/generated/src/operationsInterfaces/callMedia.js.map +1 -1
  314. package/dist/react-native/generated/src/operationsInterfaces/callRecording.d.ts +1 -7
  315. package/dist/react-native/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
  316. package/dist/react-native/generated/src/operationsInterfaces/callRecording.js.map +1 -1
  317. package/dist/react-native/generated/src/operationsInterfaces/index.d.ts +0 -1
  318. package/dist/react-native/generated/src/operationsInterfaces/index.d.ts.map +1 -1
  319. package/dist/react-native/generated/src/operationsInterfaces/index.js +0 -1
  320. package/dist/react-native/generated/src/operationsInterfaces/index.js.map +1 -1
  321. package/dist/react-native/index.d.ts +0 -2
  322. package/dist/react-native/index.d.ts.map +1 -1
  323. package/dist/react-native/index.js +0 -2
  324. package/dist/react-native/index.js.map +1 -1
  325. package/dist/react-native/models/constants.js +1 -1
  326. package/dist/react-native/models/constants.js.map +1 -1
  327. package/dist/react-native/models/events.d.ts +67 -155
  328. package/dist/react-native/models/events.d.ts.map +1 -1
  329. package/dist/react-native/models/events.js.map +1 -1
  330. package/dist/react-native/models/models.d.ts +5 -14
  331. package/dist/react-native/models/models.d.ts.map +1 -1
  332. package/dist/react-native/models/models.js +1 -3
  333. package/dist/react-native/models/models.js.map +1 -1
  334. package/dist/react-native/models/options.d.ts +2 -35
  335. package/dist/react-native/models/options.d.ts.map +1 -1
  336. package/dist/react-native/models/options.js.map +1 -1
  337. package/dist/react-native/models/responses.d.ts +10 -51
  338. package/dist/react-native/models/responses.d.ts.map +1 -1
  339. package/dist/react-native/models/responses.js.map +1 -1
  340. package/dist/react-native/utli/converters.d.ts.map +1 -1
  341. package/dist/react-native/utli/converters.js +19 -1
  342. package/dist/react-native/utli/converters.js.map +1 -1
  343. package/package.json +17 -11
  344. package/dist/browser/eventprocessor/callAutomationEventProcessor.d.ts +0 -39
  345. package/dist/browser/eventprocessor/callAutomationEventProcessor.d.ts.map +0 -1
  346. package/dist/browser/eventprocessor/callAutomationEventProcessor.js +0 -137
  347. package/dist/browser/eventprocessor/callAutomationEventProcessor.js.map +0 -1
  348. package/dist/browser/eventprocessor/eventResponses.d.ts +0 -123
  349. package/dist/browser/eventprocessor/eventResponses.d.ts.map +0 -1
  350. package/dist/browser/eventprocessor/eventResponses.js +0 -4
  351. package/dist/browser/eventprocessor/eventResponses.js.map +0 -1
  352. package/dist/browser/generated/src/operations/callDialog.d.ts +0 -35
  353. package/dist/browser/generated/src/operations/callDialog.d.ts.map +0 -1
  354. package/dist/browser/generated/src/operations/callDialog.js +0 -111
  355. package/dist/browser/generated/src/operations/callDialog.js.map +0 -1
  356. package/dist/browser/generated/src/operationsInterfaces/callDialog.d.ts +0 -27
  357. package/dist/browser/generated/src/operationsInterfaces/callDialog.d.ts.map +0 -1
  358. package/dist/browser/generated/src/operationsInterfaces/callDialog.js +0 -9
  359. package/dist/browser/generated/src/operationsInterfaces/callDialog.js.map +0 -1
  360. package/dist/commonjs/eventprocessor/callAutomationEventProcessor.d.ts +0 -39
  361. package/dist/commonjs/eventprocessor/callAutomationEventProcessor.d.ts.map +0 -1
  362. package/dist/commonjs/eventprocessor/callAutomationEventProcessor.js +0 -141
  363. package/dist/commonjs/eventprocessor/callAutomationEventProcessor.js.map +0 -1
  364. package/dist/commonjs/eventprocessor/eventResponses.d.ts +0 -123
  365. package/dist/commonjs/eventprocessor/eventResponses.d.ts.map +0 -1
  366. package/dist/commonjs/eventprocessor/eventResponses.js +0 -5
  367. package/dist/commonjs/eventprocessor/eventResponses.js.map +0 -1
  368. package/dist/commonjs/generated/src/operations/callDialog.d.ts +0 -35
  369. package/dist/commonjs/generated/src/operations/callDialog.d.ts.map +0 -1
  370. package/dist/commonjs/generated/src/operations/callDialog.js +0 -116
  371. package/dist/commonjs/generated/src/operations/callDialog.js.map +0 -1
  372. package/dist/commonjs/generated/src/operationsInterfaces/callDialog.d.ts +0 -27
  373. package/dist/commonjs/generated/src/operationsInterfaces/callDialog.d.ts.map +0 -1
  374. package/dist/commonjs/generated/src/operationsInterfaces/callDialog.js +0 -10
  375. package/dist/commonjs/generated/src/operationsInterfaces/callDialog.js.map +0 -1
  376. package/dist/esm/eventprocessor/callAutomationEventProcessor.d.ts +0 -39
  377. package/dist/esm/eventprocessor/callAutomationEventProcessor.d.ts.map +0 -1
  378. package/dist/esm/eventprocessor/callAutomationEventProcessor.js +0 -137
  379. package/dist/esm/eventprocessor/callAutomationEventProcessor.js.map +0 -1
  380. package/dist/esm/eventprocessor/eventResponses.d.ts +0 -123
  381. package/dist/esm/eventprocessor/eventResponses.d.ts.map +0 -1
  382. package/dist/esm/eventprocessor/eventResponses.js +0 -4
  383. package/dist/esm/eventprocessor/eventResponses.js.map +0 -1
  384. package/dist/esm/generated/src/operations/callDialog.d.ts +0 -35
  385. package/dist/esm/generated/src/operations/callDialog.d.ts.map +0 -1
  386. package/dist/esm/generated/src/operations/callDialog.js +0 -111
  387. package/dist/esm/generated/src/operations/callDialog.js.map +0 -1
  388. package/dist/esm/generated/src/operationsInterfaces/callDialog.d.ts +0 -27
  389. package/dist/esm/generated/src/operationsInterfaces/callDialog.d.ts.map +0 -1
  390. package/dist/esm/generated/src/operationsInterfaces/callDialog.js +0 -9
  391. package/dist/esm/generated/src/operationsInterfaces/callDialog.js.map +0 -1
  392. package/dist/react-native/eventprocessor/callAutomationEventProcessor.d.ts +0 -39
  393. package/dist/react-native/eventprocessor/callAutomationEventProcessor.d.ts.map +0 -1
  394. package/dist/react-native/eventprocessor/callAutomationEventProcessor.js +0 -137
  395. package/dist/react-native/eventprocessor/callAutomationEventProcessor.js.map +0 -1
  396. package/dist/react-native/eventprocessor/eventResponses.d.ts +0 -123
  397. package/dist/react-native/eventprocessor/eventResponses.d.ts.map +0 -1
  398. package/dist/react-native/eventprocessor/eventResponses.js +0 -4
  399. package/dist/react-native/eventprocessor/eventResponses.js.map +0 -1
  400. package/dist/react-native/generated/src/operations/callDialog.d.ts +0 -35
  401. package/dist/react-native/generated/src/operations/callDialog.d.ts.map +0 -1
  402. package/dist/react-native/generated/src/operations/callDialog.js +0 -111
  403. package/dist/react-native/generated/src/operations/callDialog.js.map +0 -1
  404. package/dist/react-native/generated/src/operationsInterfaces/callDialog.d.ts +0 -27
  405. package/dist/react-native/generated/src/operationsInterfaces/callDialog.d.ts.map +0 -1
  406. package/dist/react-native/generated/src/operationsInterfaces/callDialog.js +0 -9
  407. package/dist/react-native/generated/src/operationsInterfaces/callDialog.js.map +0 -1
@@ -1,41 +1,25 @@
1
1
  import type { CallConnection } from "../callConnection.js";
2
2
  import type { CallConnectionProperties, CallParticipant } from "./models.js";
3
- import type { RecordingState } from "../generated/src/index.js";
4
- import type { AddParticipantEventResult, AnswerCallEventResult, CancelAllMediaOperationsEventResult, CreateCallEventResult, PlayEventResult, RemoveParticipantEventResult, SendDtmfEventResult, StartRecognizingEventResult, TransferCallToParticipantEventResult, CancelAddParticipantEventResult, ConnectCallEventResult } from "../eventprocessor/eventResponses.js";
5
- import type { AbortSignalLike } from "@azure/abort-controller";
3
+ import { RecordingState, RecordingKind } from "../generated/src/index.js";
6
4
  /**
7
- * CreateCall result
5
+ * The interface used as parent of [action]CallResult
8
6
  */
9
- export interface CreateCallResult {
10
- /** The callConnectionProperties */
7
+ export interface CallResult {
11
8
  callConnectionProperties: CallConnectionProperties;
12
- /** The callConnection */
13
9
  callConnection: CallConnection;
14
- /** Waiting for event processor to process the event */
15
- waitForEventProcessor(abortSignal?: AbortSignalLike, timeoutInMs?: number): Promise<CreateCallEventResult>;
16
10
  }
11
+ /**
12
+ * CreateCall result
13
+ */
14
+ export type CreateCallResult = CallResult;
17
15
  /**
18
16
  * AnswerCall result
19
17
  */
20
- export interface AnswerCallResult {
21
- /** The callConnectionProperties */
22
- callConnectionProperties: CallConnectionProperties;
23
- /** The callConnection */
24
- callConnection: CallConnection;
25
- /** Waiting for event processor to process the event */
26
- waitForEventProcessor(abortSignal?: AbortSignalLike, timeoutInMs?: number): Promise<AnswerCallEventResult>;
27
- }
18
+ export type AnswerCallResult = CallResult;
28
19
  /**
29
20
  * ConnectCall result
30
21
  */
31
- export interface ConnectCallResult {
32
- /** The callConnectionProperties */
33
- callConnectionProperties: CallConnectionProperties;
34
- /** The callConnection */
35
- callConnection: CallConnection;
36
- /** Waiting for event processor to process the event */
37
- waitForEventProcessor(abortSignal?: AbortSignalLike, timeoutInMs?: number): Promise<ConnectCallEventResult>;
38
- }
22
+ export type ConnectCallResult = CallResult;
39
23
  /** The response payload for getting participants of the call. */
40
24
  export interface ListParticipantsResult {
41
25
  /** List of the current participants in the call. */
@@ -51,22 +35,16 @@ export interface AddParticipantResult {
51
35
  participant?: CallParticipant;
52
36
  /** The operation context provided by client. */
53
37
  operationContext?: string;
54
- /** Waiting for event processor to process the event */
55
- waitForEventProcessor(abortSignal?: AbortSignalLike, timeoutInMs?: number): Promise<AddParticipantEventResult>;
56
38
  }
57
39
  /** The response payload for transferring the call. */
58
40
  export interface TransferCallResult {
59
41
  /** The operation context provided by client. */
60
42
  operationContext?: string;
61
- /** Waiting for event processor to process the event */
62
- waitForEventProcessor(abortSignal?: AbortSignalLike, timeoutInMs?: number): Promise<TransferCallToParticipantEventResult>;
63
43
  }
64
44
  /** The response payload for removing participants from the call. */
65
45
  export interface RemoveParticipantResult {
66
46
  /** The operation context provided by client. */
67
47
  operationContext?: string;
68
- /** Waiting for event processor to process the event */
69
- waitForEventProcessor(abortSignal?: AbortSignalLike, timeoutInMs?: number): Promise<RemoveParticipantEventResult>;
70
48
  }
71
49
  /** The response payload for muting participant from the call. */
72
50
  export interface MuteParticipantResult {
@@ -76,30 +54,13 @@ export interface MuteParticipantResult {
76
54
  /** The response payload for starting a call recording or getting call recording state. */
77
55
  export interface RecordingStateResult {
78
56
  recordingId: string;
79
- recordingKind: string;
57
+ recordingKind: RecordingKind;
80
58
  recordingState: RecordingState;
81
59
  }
82
- /** The response payload for starting a call recording or getting call recording state. */
83
- export interface CancelAllMediaOperationsResult {
84
- /** Waiting for event processor to process the event */
85
- waitForEventProcessor(abortSignal?: AbortSignalLike, timeoutInMs?: number): Promise<CancelAllMediaOperationsEventResult>;
86
- }
87
- /** The response from play. */
88
- export interface PlayResult {
89
- /** Waiting for event processor to process the event */
90
- waitForEventProcessor(abortSignal?: AbortSignalLike, timeoutInMs?: number): Promise<PlayEventResult>;
91
- }
92
60
  /** The response payload for sending DTMF tones. */
93
61
  export interface SendDtmfTonesResult {
94
62
  /** The operation context provided by client. */
95
63
  operationContext?: string;
96
- /** Waiting for event processor to process the event */
97
- waitForEventProcessor(abortSignal?: AbortSignalLike, timeoutInMs?: number): Promise<SendDtmfEventResult>;
98
- }
99
- /** The response from recognizing. */
100
- export interface StartRecognizingResult {
101
- /** Waiting for event processor to process the event */
102
- waitForEventProcessor(abortSignal?: AbortSignalLike, timeoutInMs?: number): Promise<StartRecognizingEventResult>;
103
64
  }
104
65
  /** The response payload for cancelling add participant request. */
105
66
  export interface CancelAddParticipantOperationResult {
@@ -107,7 +68,5 @@ export interface CancelAddParticipantOperationResult {
107
68
  invitationId?: string;
108
69
  /** The operation context provided by client. */
109
70
  operationContext?: string;
110
- /** Waiting for event processor to process the event */
111
- waitForEventProcessor(abortSignal?: AbortSignalLike, timeoutInMs?: number): Promise<CancelAddParticipantEventResult>;
112
71
  }
113
72
  //# sourceMappingURL=responses.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../../src/models/responses.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EACV,yBAAyB,EACzB,qBAAqB,EACrB,mCAAmC,EACnC,qBAAqB,EACrB,eAAe,EACf,4BAA4B,EAC5B,mBAAmB,EACnB,2BAA2B,EAC3B,oCAAoC,EACpC,+BAA+B,EAC/B,sBAAsB,EACvB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,mCAAmC;IACnC,wBAAwB,EAAE,wBAAwB,CAAC;IAEnD,yBAAyB;IACzB,cAAc,EAAE,cAAc,CAAC;IAE/B,uDAAuD;IACvD,qBAAqB,CACnB,WAAW,CAAC,EAAE,eAAe,EAC7B,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,mCAAmC;IACnC,wBAAwB,EAAE,wBAAwB,CAAC;IAEnD,yBAAyB;IACzB,cAAc,EAAE,cAAc,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AgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,iEAAiE;AACjE,MAAM,WAAW,qBAAqB;IACpC,gDAAgD;IAChD,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,0FAA0F;AAC1F,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,EAAE,cAAc,CAAC;CAChC;AAED,mDAAmD;AACnD,MAAM,WAAW,mBAAmB;IAClC,gDAAgD;IAChD,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,mEAAmE;AACnE,MAAM,WAAW,mCAAmC;IAClD,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"responses.js","sourceRoot":"","sources":["../../../src/models/responses.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { CallConnection } from \"../callConnection.js\";\nimport type { CallConnectionProperties, CallParticipant } from \"./models.js\";\nimport type { RecordingState } from \"../generated/src/index.js\";\nimport type {\n AddParticipantEventResult,\n AnswerCallEventResult,\n CancelAllMediaOperationsEventResult,\n CreateCallEventResult,\n PlayEventResult,\n RemoveParticipantEventResult,\n SendDtmfEventResult,\n StartRecognizingEventResult,\n TransferCallToParticipantEventResult,\n CancelAddParticipantEventResult,\n ConnectCallEventResult,\n} from \"../eventprocessor/eventResponses.js\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\n\n/**\n * CreateCall result\n */\nexport interface CreateCallResult {\n /** The callConnectionProperties */\n callConnectionProperties: CallConnectionProperties;\n\n /** The callConnection */\n callConnection: CallConnection;\n\n /** Waiting for event processor to process the event */\n waitForEventProcessor(\n abortSignal?: AbortSignalLike,\n timeoutInMs?: number,\n ): Promise<CreateCallEventResult>;\n}\n\n/**\n * AnswerCall result\n */\nexport interface AnswerCallResult {\n /** The callConnectionProperties */\n callConnectionProperties: CallConnectionProperties;\n\n /** The callConnection */\n callConnection: CallConnection;\n\n /** Waiting for event processor to process the event */\n waitForEventProcessor(\n abortSignal?: AbortSignalLike,\n timeoutInMs?: number,\n ): Promise<AnswerCallEventResult>;\n}\n\n/**\n * ConnectCall result\n */\nexport interface ConnectCallResult {\n /** The callConnectionProperties */\n callConnectionProperties: CallConnectionProperties;\n\n /** The callConnection */\n callConnection: CallConnection;\n\n /** Waiting for event processor to process the event */\n waitForEventProcessor(\n abortSignal?: AbortSignalLike,\n timeoutInMs?: number,\n ): Promise<ConnectCallEventResult>;\n}\n\n/** The response payload for getting participants of the call. */\nexport interface ListParticipantsResult {\n /** List of the current participants in the call. */\n values?: CallParticipant[];\n /** Continue of the list of participants */\n nextLink?: string;\n}\n\n/** The response payload for adding participants to the call. */\nexport interface AddParticipantResult {\n /** invitation ID used to add the participant. */\n invitationId?: string;\n /** List of current participants in the call. */\n participant?: CallParticipant;\n /** The operation context provided by client. */\n operationContext?: string;\n /** Waiting for event processor to process the event */\n waitForEventProcessor(\n abortSignal?: AbortSignalLike,\n timeoutInMs?: number,\n ): Promise<AddParticipantEventResult>;\n}\n\n/** The response payload for transferring the call. */\nexport interface TransferCallResult {\n /** The operation context provided by client. */\n operationContext?: string;\n /** Waiting for event processor to process the event */\n waitForEventProcessor(\n abortSignal?: AbortSignalLike,\n timeoutInMs?: number,\n ): Promise<TransferCallToParticipantEventResult>;\n}\n\n/** The response payload for removing participants from the call. */\nexport interface RemoveParticipantResult {\n /** The operation context provided by client. */\n operationContext?: string;\n /** Waiting for event processor to process the event */\n waitForEventProcessor(\n abortSignal?: AbortSignalLike,\n timeoutInMs?: number,\n ): Promise<RemoveParticipantEventResult>;\n}\n\n/** The response payload for muting participant from the call. */\nexport interface MuteParticipantResult {\n /** The operation context provided by client. */\n operationContext?: string;\n}\n\n/** The response payload for starting a call recording or getting call recording state. */\nexport interface RecordingStateResult {\n recordingId: string;\n recordingKind: string;\n recordingState: RecordingState;\n}\n\n/** The response payload for starting a call recording or getting call recording state. */\nexport interface CancelAllMediaOperationsResult {\n /** Waiting for event processor to process the event */\n waitForEventProcessor(\n abortSignal?: AbortSignalLike,\n timeoutInMs?: number,\n ): Promise<CancelAllMediaOperationsEventResult>;\n}\n\n/** The response from play. */\nexport interface PlayResult {\n /** Waiting for event processor to process the event */\n waitForEventProcessor(\n abortSignal?: AbortSignalLike,\n timeoutInMs?: number,\n ): Promise<PlayEventResult>;\n}\n\n/** The response payload for sending DTMF tones. */\nexport interface SendDtmfTonesResult {\n /** The operation context provided by client. */\n operationContext?: string;\n /** Waiting for event processor to process the event */\n waitForEventProcessor(\n abortSignal?: AbortSignalLike,\n timeoutInMs?: number,\n ): Promise<SendDtmfEventResult>;\n}\n\n/** The response from recognizing. */\nexport interface StartRecognizingResult {\n /** Waiting for event processor to process the event */\n waitForEventProcessor(\n abortSignal?: AbortSignalLike,\n timeoutInMs?: number,\n ): Promise<StartRecognizingEventResult>;\n}\n\n/** The response payload for cancelling add participant request. */\nexport interface CancelAddParticipantOperationResult {\n /** the invitation ID used to cancel the add participant request. */\n invitationId?: string;\n /** The operation context provided by client. */\n operationContext?: string;\n /** Waiting for event processor to process the event */\n waitForEventProcessor(\n abortSignal?: AbortSignalLike,\n timeoutInMs?: number,\n ): Promise<CancelAddParticipantEventResult>;\n}\n"]}
1
+ {"version":3,"file":"responses.js","sourceRoot":"","sources":["../../../src/models/responses.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { CallConnection } from \"../callConnection.js\";\nimport type { CallConnectionProperties, CallParticipant } from \"./models.js\";\nimport { RecordingState, RecordingKind } from \"../generated/src/index.js\";\n\n/**\n * The interface used as parent of [action]CallResult\n */\nexport interface CallResult {\n /*\n * The callConnectionProperties\n */\n callConnectionProperties: CallConnectionProperties;\n\n /*\n * The callConnection\n */\n callConnection: CallConnection;\n}\n\n/**\n * CreateCall result\n */\nexport type CreateCallResult = CallResult;\n\n/**\n * AnswerCall result\n */\nexport type AnswerCallResult = CallResult;\n\n/**\n * ConnectCall result\n */\nexport type ConnectCallResult = CallResult;\n\n/** The response payload for getting participants of the call. */\nexport interface ListParticipantsResult {\n /** List of the current participants in the call. */\n values?: CallParticipant[];\n /** Continue of the list of participants */\n nextLink?: string;\n}\n\n/** The response payload for adding participants to the call. */\nexport interface AddParticipantResult {\n /** invitation ID used to add the participant. */\n invitationId?: string;\n /** List of current participants in the call. */\n participant?: CallParticipant;\n /** The operation context provided by client. */\n operationContext?: string;\n}\n\n/** The response payload for transferring the call. */\nexport interface TransferCallResult {\n /** The operation context provided by client. */\n operationContext?: string;\n}\n\n/** The response payload for removing participants from the call. */\nexport interface RemoveParticipantResult {\n /** The operation context provided by client. */\n operationContext?: string;\n}\n\n/** The response payload for muting participant from the call. */\nexport interface MuteParticipantResult {\n /** The operation context provided by client. */\n operationContext?: string;\n}\n\n/** The response payload for starting a call recording or getting call recording state. */\nexport interface RecordingStateResult {\n recordingId: string;\n recordingKind: RecordingKind;\n recordingState: RecordingState;\n}\n\n/** The response payload for sending DTMF tones. */\nexport interface SendDtmfTonesResult {\n /** The operation context provided by client. */\n operationContext?: string;\n}\n\n/** The response payload for cancelling add participant request. */\nexport interface CancelAddParticipantOperationResult {\n /** the invitation ID used to cancel the add participant request. */\n invitationId?: string;\n /** The operation context provided by client. */\n operationContext?: string;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"converters.d.ts","sourceRoot":"","sources":["../../../src/utli/converters.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,qBAAqB,EACrB,2BAA2B,EAE3B,+BAA+B,EAC/B,uBAAuB,EAGvB,2BAA2B,EAC5B,MAAM,6BAA6B,CAAC;AASrC,OAAO,KAAK,EACV,uBAAuB,EACvB,4BAA4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AAM,6BAA6B,CAAC;AAUrC,OAAO,KAAK,EACV,uBAAuB,EACvB,4BAA4B,EAG5B,0BAA0B,EAC1B,gCAAgC,EAChC,gCAAgC,EACjC,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAuB3D,wFAAwF;AACxF,wBAAgB,mCAAmC,CACjD,qBAAqB,EAAE,qBAAqB,GAAG,SAAS,GACvD,0BAA0B,GAAG,SAAS,CAQxC;AAED,2FAA2F;AAC3F,wBAAgB,8BAA8B,CAC5C,+BAA+B,EAAE,+BAA+B,GAAG,SAAS,GAC3E,qBAAqB,GAAG,SAAS,CAYnC;AAED,0FAA0F;AAC1F,wBAAgB,gCAAgC,CAC9C,eAAe,EAAE,4BAA4B,GAC5C,uBAAuB,CAoEzB;AAED,4FAA4F;AAC5F,wBAAgB,qCAAqC,CACnD,UAAU,EAAE,uBAAuB,GAClC,4BAA4B,CAkD9B;AAED,yDAAyD;AACzD,wBAAgB,wBAAwB,CACtC,kBAAkB,EAAE,uBAAuB,GAC1C,eAAe,CAQjB;AAED,qGAAqG;AACrG,wBAAgB,yCAAyC,CACvD,UAAU,EAAE,2BAA2B,GAAG,SAAS,GAClD,gCAAgC,GAAG,SAAS,CAM9C;AAED,mGAAmG;AACnG,wBAAgB,oCAAoC,CAClD,UAAU,EAAE,gCAAgC,GAAG,SAAS,GACvD,2BAA2B,GAAG,SAAS,CAMzC;AAED,qGAAqG;AACrG,wBAAgB,yCAAyC,CACvD,UAAU,EAAE,2BAA2B,GAAG,SAAS,GAClD,gCAAgC,GAAG,SAAS,CAM9C;AAED,mGAAmG;AACnG,wBAAgB,oCAAoC,CAClD,UAAU,EAAE,gCAAgC,GAAG,SAAS,GACvD,2BAA2B,GAAG,SAAS,CAMzC"}
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { serializeCommunicationIdentifier, isCommunicationUserIdentifier, isPhoneNumberIdentifier, isUnknownIdentifier, isMicrosoftTeamsUserIdentifier, isMicrosoftTeamsAppIdentifier, } from "@azure/communication-common";
3
+ import { serializeCommunicationIdentifier, isCommunicationUserIdentifier, isPhoneNumberIdentifier, isUnknownIdentifier, isMicrosoftTeamsUserIdentifier, isMicrosoftTeamsAppIdentifier, isTeamsExtensionUserIdentifier, } from "@azure/communication-common";
4
4
  import { KnownCommunicationIdentifierModelKind } from "../generated/src/index.js";
5
5
  function extractKind(identifierModel) {
6
6
  if (identifierModel.communicationUser !== undefined) {
@@ -15,6 +15,9 @@ function extractKind(identifierModel) {
15
15
  if (identifierModel.microsoftTeamsApp !== undefined) {
16
16
  return KnownCommunicationIdentifierModelKind.MicrosoftTeamsApp;
17
17
  }
18
+ if (identifierModel.teamsExtensionUser !== undefined) {
19
+ return KnownCommunicationIdentifierModelKind.TeamsExtensionUser;
20
+ }
18
21
  return KnownCommunicationIdentifierModelKind.Unknown;
19
22
  }
20
23
  /** Convert PhoneNumberIdentifier to PhoneNumberIdentifierModel(Internal usage class) */
@@ -74,6 +77,17 @@ export function communicationIdentifierConverter(identifierModel) {
74
77
  };
75
78
  return microsoftTeamsAppIdentifier;
76
79
  }
80
+ if (kind === KnownCommunicationIdentifierModelKind.TeamsExtensionUser &&
81
+ identifierModel.teamsExtensionUser !== undefined) {
82
+ const teamsExtensionUserIdentifier = {
83
+ rawId: rawId,
84
+ userId: identifierModel.teamsExtensionUser.userId,
85
+ resourceId: identifierModel.teamsExtensionUser.resourceId,
86
+ tenantId: identifierModel.teamsExtensionUser.tenantId,
87
+ cloud: identifierModel.teamsExtensionUser.cloud,
88
+ };
89
+ return teamsExtensionUserIdentifier;
90
+ }
77
91
  const unknownIdentifier = {
78
92
  id: rawId ? rawId : "",
79
93
  };
@@ -98,6 +112,10 @@ export function communicationIdentifierModelConverter(identifier) {
98
112
  const microsoftTeamsAppIdentifierModel = Object.assign({ kind: KnownCommunicationIdentifierModelKind.MicrosoftTeamsApp }, serializedIdentifier);
99
113
  return microsoftTeamsAppIdentifierModel;
100
114
  }
115
+ if (isTeamsExtensionUserIdentifier(identifier)) {
116
+ const teamsExtensionUserIdentifierModel = Object.assign({ kind: KnownCommunicationIdentifierModelKind.TeamsExtensionUser }, serializedIdentifier);
117
+ return teamsExtensionUserIdentifierModel;
118
+ }
101
119
  if (isUnknownIdentifier(identifier)) {
102
120
  const unknownIdentifierModel = Object.assign({ kind: KnownCommunicationIdentifierModelKind.Unknown }, serializedIdentifier);
103
121
  return unknownIdentifierModel;
@@ -1 +1 @@
1
- {"version":3,"file":"converters.js","sourceRoot":"","sources":["../../../src/utli/converters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAYlC,OAAO,EACL,gCAAgC,EAChC,6BAA6B,EAC7B,uBAAuB,EACvB,mBAAmB,EACnB,8BAA8B,EAC9B,6BAA6B,GAC9B,MAAM,6BAA6B,CAAC;AAUrC,OAAO,EAAE,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;AAGlF,SAAS,WAAW,CAClB,eAA6C;IAE7C,IAAI,eAAe,CAAC,iBAAiB,KAAK,SAAS,EAAE,CAAC;QACpD,OAAO,qCAAqC,CAAC,iBAAiB,CAAC;IACjE,CAAC;IACD,IAAI,eAAe,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;QAC9C,OAAO,qCAAqC,CAAC,WAAW,CAAC;IAC3D,CAAC;IACD,IAAI,eAAe,CAAC,kBAAkB,KAAK,SAAS,EAAE,CAAC;QACrD,OAAO,qCAAqC,CAAC,kBAAkB,CAAC;IAClE,CAAC;IACD,IAAI,eAAe,CAAC,iBAAiB,KAAK,SAAS,EAAE,CAAC;QACpD,OAAO,qCAAqC,CAAC,iBAAiB,CAAC;IACjE,CAAC;IACD,OAAO,qCAAqC,CAAC,OAAO,CAAC;AACvD,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,mCAAmC,CACjD,qBAAwD;IAExD,IAAI,qBAAqB,KAAK,SAAS,IAAI,q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C;QAClC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,EAAE,mBAAmB,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC;AAChD,CAAC;AAED,qGAAqG;AACrG,MAAM,UAAU,yCAAyC,CACvD,UAAmD;IAEnD,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC;QAC1C,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,EAAE,CAAC;AAC1C,CAAC;AAED,mGAAmG;AACnG,MAAM,UAAU,oCAAoC,CAClD,UAAwD;IAExD,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;QACrC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,EAAE,UAAU,EAAE,UAAU,CAAC,KAAK,EAAE,CAAC;AAC1C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n PhoneNumberIdentifier,\n CommunicationUserIdentifier,\n UnknownIdentifier,\n SerializedPhoneNumberIdentifier,\n CommunicationIdentifier,\n SerializedCommunicationIdentifier,\n MicrosoftTeamsUserIdentifier,\n MicrosoftTeamsAppIdentifier,\n} from \"@azure/communication-common\";\nimport {\n serializeCommunicationIdentifier,\n isCommunicationUserIdentifier,\n isPhoneNumberIdentifier,\n isUnknownIdentifier,\n isMicrosoftTeamsUserIdentifier,\n isMicrosoftTeamsAppIdentifier,\n} from \"@azure/communication-common\";\nimport type {\n CallParticipantInternal,\n CommunicationIdentifierModel,\n CommunicationIdentifierModelKind,\n KnownCommunicationCloudEnvironmentModel,\n PhoneNumberIdentifierModel,\n CommunicationUserIdentifierModel,\n MicrosoftTeamsAppIdentifierModel,\n} from \"../generated/src/index.js\";\nimport { KnownCommunicationIdentifierModelKind } from \"../generated/src/index.js\";\nimport type { CallParticipant } from \"../models/models.js\";\n\nfunction extractKind(\n identifierModel: CommunicationIdentifierModel,\n): CommunicationIdentifierModelKind {\n if (identifierModel.communicationUser !== undefined) {\n return KnownCommunicationIdentifierModelKind.CommunicationUser;\n }\n if (identifierModel.phoneNumber !== undefined) {\n return KnownCommunicationIdentifierModelKind.PhoneNumber;\n }\n if (identifierModel.microsoftTeamsUser !== undefined) {\n return KnownCommunicationIdentifierModelKind.MicrosoftTeamsUser;\n }\n if (identifierModel.microsoftTeamsApp !== undefined) {\n return KnownCommunicationIdentifierModelKind.MicrosoftTeamsApp;\n }\n return KnownCommunicationIdentifierModelKind.Unknown;\n}\n\n/** Convert PhoneNumberIdentifier to PhoneNumberIdentifierModel(Internal usage class) */\nexport function PhoneNumberIdentifierModelConverter(\n phoneNumberIdentifier: PhoneNumberIdentifier | undefined,\n): PhoneNumberIdentifierModel | undefined {\n if (phoneNumberIdentifier === undefined || phoneNumberIdentifier.phoneNumber === undefined) {\n return undefined;\n }\n\n const phoneNumberIdentifierModel =\n serializeCommunicationIdentifier(phoneNumberIdentifier).phoneNumber;\n return phoneNumberIdentifierModel;\n}\n\n/** Convert SerializedPhoneNumberIdentifier to PhoneNumberIdentifier(Public usage class) */\nexport function phoneNumberIdentifierConverter(\n serializedPhoneNumberIdentifier: SerializedPhoneNumberIdentifier | undefined,\n): PhoneNumberIdentifier | undefined {\n if (\n serializedPhoneNumberIdentifier === undefined ||\n serializedPhoneNumberIdentifier?.value === null\n ) {\n return undefined;\n }\n\n const phoneNumberIdentifier: PhoneNumberIdentifier = {\n phoneNumber: serializedPhoneNumberIdentifier.value,\n };\n return phoneNumberIdentifier;\n}\n\n/** Convert CommunicationIdentifierModel to CommunicationIdentifier(Public usage class) */\nexport function communicationIdentifierConverter(\n identifierModel: CommunicationIdentifierModel,\n): CommunicationIdentifier {\n const rawId = identifierModel.rawId;\n const kind =\n identifierModel.kind !== undefined ? identifierModel.kind : extractKind(identifierModel);\n\n if (\n kind === KnownCommunicationIdentifierModelKind.CommunicationUser &&\n identifierModel.communicationUser !== undefined\n ) {\n const communicationUserIdentifier: CommunicationUserIdentifier = {\n communicationUserId: identifierModel.communicationUser.id,\n };\n return communicationUserIdentifier;\n }\n\n if (\n kind === KnownCommunicationIdentifierModelKind.PhoneNumber &&\n identifierModel.phoneNumber !== undefined\n ) {\n const phoneNumberIdentifier: PhoneNumberIdentifier = {\n phoneNumber: identifierModel.phoneNumber.value,\n rawId: rawId,\n };\n return phoneNumberIdentifier;\n }\n\n if (\n kind === KnownCommunicationIdentifierModelKind.MicrosoftTeamsUser &&\n identifierModel.microsoftTeamsUser !== undefined\n ) {\n const microsoftTeamsUserIdentifier: MicrosoftTeamsUserIdentifier = {\n rawId: rawId,\n microsoftTeamsUserId: identifierModel.microsoftTeamsUser.userId,\n isAnonymous: identifierModel.microsoftTeamsUser.isAnonymous,\n cloud: identifierModel.microsoftTeamsUser.cloud as KnownCommunicationCloudEnvironmentModel,\n };\n return microsoftTeamsUserIdentifier;\n }\n\n if (\n kind === KnownCommunicationIdentifierModelKind.MicrosoftTeamsApp &&\n identifierModel.microsoftTeamsApp !== undefined\n ) {\n const microsoftTeamsAppIdentifier: MicrosoftTeamsAppIdentifier = {\n rawId: rawId,\n teamsAppId: identifierModel.microsoftTeamsApp.appId,\n cloud: identifierModel.microsoftTeamsApp.cloud as KnownCommunicationCloudEnvironmentModel,\n };\n return microsoftTeamsAppIdentifier;\n }\n\n const unknownIdentifier: UnknownIdentifier = {\n id: rawId ? rawId : \"\",\n };\n return unknownIdentifier;\n}\n\n/** Convert CommunicationIdentifier to CommunicationIdentifierModel(Internal usage class) */\nexport function communicationIdentifierModelConverter(\n identifier: CommunicationIdentifier,\n): CommunicationIdentifierModel {\n const serializedIdentifier: SerializedCommunicationIdentifier =\n serializeCommunicationIdentifier(identifier);\n if (isCommunicationUserIdentifier(identifier)) {\n const communicationUserIdentifierModel: CommunicationIdentifierModel = {\n kind: KnownCommunicationIdentifierModelKind.CommunicationUser,\n ...serializedIdentifier,\n };\n return communicationUserIdentifierModel;\n }\n\n if (isPhoneNumberIdentifier(identifier)) {\n const phoneNumberIdentifierModel: CommunicationIdentifierModel = {\n kind: KnownCommunicationIdentifierModelKind.PhoneNumber,\n ...serializedIdentifier,\n };\n return phoneNumberIdentifierModel;\n }\n\n if (isMicrosoftTeamsUserIdentifier(identifier)) {\n const microsoftTeamsUserIdentifierModel: CommunicationIdentifierModel = {\n kind: KnownCommunicationIdentifierModelKind.MicrosoftTeamsUser,\n ...serializedIdentifier,\n };\n return microsoftTeamsUserIdentifierModel;\n }\n\n if (isMicrosoftTeamsAppIdentifier(identifier)) {\n const microsoftTeamsAppIdentifierModel: CommunicationIdentifierModel = {\n kind: KnownCommunicationIdentifierModelKind.MicrosoftTeamsApp,\n ...serializedIdentifier,\n };\n return microsoftTeamsAppIdentifierModel;\n }\n\n if (isUnknownIdentifier(identifier)) {\n const unknownIdentifierModel: CommunicationIdentifierModel = {\n kind: KnownCommunicationIdentifierModelKind.Unknown,\n ...serializedIdentifier,\n };\n return unknownIdentifierModel;\n }\n\n throw new Error();\n}\n\n/** Convert CallParticipantInternal to CallParticipant */\nexport function callParticipantConverter(\n acsCallParticipant: CallParticipantInternal,\n): CallParticipant {\n const callParticipant: CallParticipant = {\n ...acsCallParticipant,\n identifier: acsCallParticipant.identifier\n ? communicationIdentifierConverter(acsCallParticipant.identifier)\n : undefined,\n };\n return callParticipant;\n}\n\n/** Convert CommunicationUserIdentifier to CommunicationUserIdentifierModel (Internal usage class) */\nexport function communicationUserIdentifierModelConverter(\n identifier: CommunicationUserIdentifier | undefined,\n): CommunicationUserIdentifierModel | undefined {\n if (!identifier || !identifier.communicationUserId) {\n return undefined;\n }\n\n return { id: identifier.communicationUserId };\n}\n\n/** Convert CommunicationUserIdentifierModel to CommunicationUserIdentifier (Public usage class) */\nexport function communicationUserIdentifierConverter(\n identifier: CommunicationUserIdentifierModel | undefined,\n): CommunicationUserIdentifier | undefined {\n if (!identifier || !identifier.id) {\n return undefined;\n }\n\n return { communicationUserId: identifier.id };\n}\n\n/** Convert MicrosoftTeamsAppIdentifier to MicrosoftTeamsAppIdentifierModel (Internal usage class) */\nexport function microsoftTeamsAppIdentifierModelConverter(\n identifier: MicrosoftTeamsAppIdentifier | undefined,\n): MicrosoftTeamsAppIdentifierModel | undefined {\n if (!identifier || !identifier.teamsAppId) {\n return undefined;\n }\n\n return { appId: identifier.teamsAppId };\n}\n\n/** Convert MicrosoftTeamsAppIdentifierModel to MicrosoftTeamsAppIdentifier (Public usage class) */\nexport function microsoftTeamsAppIdentifierConverter(\n identifier: MicrosoftTeamsAppIdentifierModel | undefined,\n): MicrosoftTeamsAppIdentifier | undefined {\n if (!identifier || !identifier.appId) {\n return undefined;\n }\n\n return { teamsAppId: identifier.appId };\n}\n"]}
1
+ {"version":3,"file":"converters.js","sourceRoot":"","sources":["../../../src/utli/converters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAalC,OAAO,EACL,gCAAgC,EAChC,6BAA6B,EAC7B,uBAAuB,EACvB,mBAAmB,EACnB,8BAA8B,EAC9B,6BAA6B,EAC7B,8BAA8B,GAC/B,MAAM,6BAA6B,CAAC;AAUrC,OAAO,EAAE,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;AAGlF,SAAS,WAAW,CAClB,eAA6C;IAE7C,IAAI,eAAe,CAAC,iBAAiB,KAAK,SAAS,EAAE,CAAC;QACpD,OAAO,qCAAqC,CAAC,iBAAiB,CAAC;IACjE,CAAC;IACD,IAAI,eAAe,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;QAC9C,OAAO,qCAAqC,CAAC,WAAW,CAAC;IAC3D,CAAC;IACD,IAAI,eAAe,CAAC,kBAAkB,KAAK,SAAS,EAAE,CAAC;QACrD,OAAO,qCAAqC,CAAC,kBAAkB,CAAC;IAClE,CAAC;IACD,IAAI,eAAe,CAAC,iBAAiB,KAAK,SAAS,EAAE,CAAC;QACpD,OAAO,qCAAqC,CAAC,iBAAiB,CAAC;IACjE,CAAC;IACD,IAAI,eAAe,CAAC,kB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CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;QACrC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,EAAE,UAAU,EAAE,UAAU,CAAC,KAAK,EAAE,CAAC;AAC1C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n PhoneNumberIdentifier,\n CommunicationUserIdentifier,\n UnknownIdentifier,\n SerializedPhoneNumberIdentifier,\n CommunicationIdentifier,\n SerializedCommunicationIdentifier,\n MicrosoftTeamsUserIdentifier,\n MicrosoftTeamsAppIdentifier,\n TeamsExtensionUserIdentifier,\n} from \"@azure/communication-common\";\nimport {\n serializeCommunicationIdentifier,\n isCommunicationUserIdentifier,\n isPhoneNumberIdentifier,\n isUnknownIdentifier,\n isMicrosoftTeamsUserIdentifier,\n isMicrosoftTeamsAppIdentifier,\n isTeamsExtensionUserIdentifier,\n} from \"@azure/communication-common\";\nimport type {\n CallParticipantInternal,\n CommunicationIdentifierModel,\n CommunicationIdentifierModelKind,\n KnownCommunicationCloudEnvironmentModel,\n PhoneNumberIdentifierModel,\n CommunicationUserIdentifierModel,\n MicrosoftTeamsAppIdentifierModel,\n} from \"../generated/src/index.js\";\nimport { KnownCommunicationIdentifierModelKind } from \"../generated/src/index.js\";\nimport type { CallParticipant } from \"../models/models.js\";\n\nfunction extractKind(\n identifierModel: CommunicationIdentifierModel,\n): CommunicationIdentifierModelKind {\n if (identifierModel.communicationUser !== undefined) {\n return KnownCommunicationIdentifierModelKind.CommunicationUser;\n }\n if (identifierModel.phoneNumber !== undefined) {\n return KnownCommunicationIdentifierModelKind.PhoneNumber;\n }\n if (identifierModel.microsoftTeamsUser !== undefined) {\n return KnownCommunicationIdentifierModelKind.MicrosoftTeamsUser;\n }\n if (identifierModel.microsoftTeamsApp !== undefined) {\n return KnownCommunicationIdentifierModelKind.MicrosoftTeamsApp;\n }\n if (identifierModel.teamsExtensionUser !== undefined) {\n return KnownCommunicationIdentifierModelKind.TeamsExtensionUser;\n }\n return KnownCommunicationIdentifierModelKind.Unknown;\n}\n\n/** Convert PhoneNumberIdentifier to PhoneNumberIdentifierModel(Internal usage class) */\nexport function PhoneNumberIdentifierModelConverter(\n phoneNumberIdentifier: PhoneNumberIdentifier | undefined,\n): PhoneNumberIdentifierModel | undefined {\n if (phoneNumberIdentifier === undefined || phoneNumberIdentifier.phoneNumber === undefined) {\n return undefined;\n }\n\n const phoneNumberIdentifierModel =\n serializeCommunicationIdentifier(phoneNumberIdentifier).phoneNumber;\n return phoneNumberIdentifierModel;\n}\n\n/** Convert SerializedPhoneNumberIdentifier to PhoneNumberIdentifier(Public usage class) */\nexport function phoneNumberIdentifierConverter(\n serializedPhoneNumberIdentifier: SerializedPhoneNumberIdentifier | undefined,\n): PhoneNumberIdentifier | undefined {\n if (\n serializedPhoneNumberIdentifier === undefined ||\n serializedPhoneNumberIdentifier?.value === null\n ) {\n return undefined;\n }\n\n const phoneNumberIdentifier: PhoneNumberIdentifier = {\n phoneNumber: serializedPhoneNumberIdentifier.value,\n };\n return phoneNumberIdentifier;\n}\n\n/** Convert CommunicationIdentifierModel to CommunicationIdentifier(Public usage class) */\nexport function communicationIdentifierConverter(\n identifierModel: CommunicationIdentifierModel,\n): CommunicationIdentifier {\n const rawId = identifierModel.rawId;\n const kind =\n identifierModel.kind !== undefined ? identifierModel.kind : extractKind(identifierModel);\n\n if (\n kind === KnownCommunicationIdentifierModelKind.CommunicationUser &&\n identifierModel.communicationUser !== undefined\n ) {\n const communicationUserIdentifier: CommunicationUserIdentifier = {\n communicationUserId: identifierModel.communicationUser.id,\n };\n return communicationUserIdentifier;\n }\n\n if (\n kind === KnownCommunicationIdentifierModelKind.PhoneNumber &&\n identifierModel.phoneNumber !== undefined\n ) {\n const phoneNumberIdentifier: PhoneNumberIdentifier = {\n phoneNumber: identifierModel.phoneNumber.value,\n rawId: rawId,\n };\n return phoneNumberIdentifier;\n }\n\n if (\n kind === KnownCommunicationIdentifierModelKind.MicrosoftTeamsUser &&\n identifierModel.microsoftTeamsUser !== undefined\n ) {\n const microsoftTeamsUserIdentifier: MicrosoftTeamsUserIdentifier = {\n rawId: rawId,\n microsoftTeamsUserId: identifierModel.microsoftTeamsUser.userId,\n isAnonymous: identifierModel.microsoftTeamsUser.isAnonymous,\n cloud: identifierModel.microsoftTeamsUser.cloud as KnownCommunicationCloudEnvironmentModel,\n };\n return microsoftTeamsUserIdentifier;\n }\n\n if (\n kind === KnownCommunicationIdentifierModelKind.MicrosoftTeamsApp &&\n identifierModel.microsoftTeamsApp !== undefined\n ) {\n const microsoftTeamsAppIdentifier: MicrosoftTeamsAppIdentifier = {\n rawId: rawId,\n teamsAppId: identifierModel.microsoftTeamsApp.appId,\n cloud: identifierModel.microsoftTeamsApp.cloud as KnownCommunicationCloudEnvironmentModel,\n };\n return microsoftTeamsAppIdentifier;\n }\n if (\n kind === KnownCommunicationIdentifierModelKind.TeamsExtensionUser &&\n identifierModel.teamsExtensionUser !== undefined\n ) {\n const teamsExtensionUserIdentifier: TeamsExtensionUserIdentifier = {\n rawId: rawId,\n userId: identifierModel.teamsExtensionUser.userId,\n resourceId: identifierModel.teamsExtensionUser.resourceId,\n tenantId: identifierModel.teamsExtensionUser.tenantId,\n cloud: identifierModel.teamsExtensionUser.cloud as KnownCommunicationCloudEnvironmentModel,\n };\n return teamsExtensionUserIdentifier;\n }\n\n const unknownIdentifier: UnknownIdentifier = {\n id: rawId ? rawId : \"\",\n };\n return unknownIdentifier;\n}\n\n/** Convert CommunicationIdentifier to CommunicationIdentifierModel(Internal usage class) */\nexport function communicationIdentifierModelConverter(\n identifier: CommunicationIdentifier,\n): CommunicationIdentifierModel {\n const serializedIdentifier: SerializedCommunicationIdentifier =\n serializeCommunicationIdentifier(identifier);\n if (isCommunicationUserIdentifier(identifier)) {\n const communicationUserIdentifierModel: CommunicationIdentifierModel = {\n kind: KnownCommunicationIdentifierModelKind.CommunicationUser,\n ...serializedIdentifier,\n };\n return communicationUserIdentifierModel;\n }\n\n if (isPhoneNumberIdentifier(identifier)) {\n const phoneNumberIdentifierModel: CommunicationIdentifierModel = {\n kind: KnownCommunicationIdentifierModelKind.PhoneNumber,\n ...serializedIdentifier,\n };\n return phoneNumberIdentifierModel;\n }\n\n if (isMicrosoftTeamsUserIdentifier(identifier)) {\n const microsoftTeamsUserIdentifierModel: CommunicationIdentifierModel = {\n kind: KnownCommunicationIdentifierModelKind.MicrosoftTeamsUser,\n ...serializedIdentifier,\n };\n return microsoftTeamsUserIdentifierModel;\n }\n\n if (isMicrosoftTeamsAppIdentifier(identifier)) {\n const microsoftTeamsAppIdentifierModel: CommunicationIdentifierModel = {\n kind: KnownCommunicationIdentifierModelKind.MicrosoftTeamsApp,\n ...serializedIdentifier,\n };\n return microsoftTeamsAppIdentifierModel;\n }\n if (isTeamsExtensionUserIdentifier(identifier)) {\n const teamsExtensionUserIdentifierModel: CommunicationIdentifierModel = {\n kind: KnownCommunicationIdentifierModelKind.TeamsExtensionUser,\n ...serializedIdentifier,\n };\n return teamsExtensionUserIdentifierModel;\n }\n if (isUnknownIdentifier(identifier)) {\n const unknownIdentifierModel: CommunicationIdentifierModel = {\n kind: KnownCommunicationIdentifierModelKind.Unknown,\n ...serializedIdentifier,\n };\n return unknownIdentifierModel;\n }\n\n throw new Error();\n}\n\n/** Convert CallParticipantInternal to CallParticipant */\nexport function callParticipantConverter(\n acsCallParticipant: CallParticipantInternal,\n): CallParticipant {\n const callParticipant: CallParticipant = {\n ...acsCallParticipant,\n identifier: acsCallParticipant.identifier\n ? communicationIdentifierConverter(acsCallParticipant.identifier)\n : undefined,\n };\n return callParticipant;\n}\n\n/** Convert CommunicationUserIdentifier to CommunicationUserIdentifierModel (Internal usage class) */\nexport function communicationUserIdentifierModelConverter(\n identifier: CommunicationUserIdentifier | undefined,\n): CommunicationUserIdentifierModel | undefined {\n if (!identifier || !identifier.communicationUserId) {\n return undefined;\n }\n\n return { id: identifier.communicationUserId };\n}\n\n/** Convert CommunicationUserIdentifierModel to CommunicationUserIdentifier (Public usage class) */\nexport function communicationUserIdentifierConverter(\n identifier: CommunicationUserIdentifierModel | undefined,\n): CommunicationUserIdentifier | undefined {\n if (!identifier || !identifier.id) {\n return undefined;\n }\n\n return { communicationUserId: identifier.id };\n}\n\n/** Convert MicrosoftTeamsAppIdentifier to MicrosoftTeamsAppIdentifierModel (Internal usage class) */\nexport function microsoftTeamsAppIdentifierModelConverter(\n identifier: MicrosoftTeamsAppIdentifier | undefined,\n): MicrosoftTeamsAppIdentifierModel | undefined {\n if (!identifier || !identifier.teamsAppId) {\n return undefined;\n }\n\n return { appId: identifier.teamsAppId };\n}\n\n/** Convert MicrosoftTeamsAppIdentifierModel to MicrosoftTeamsAppIdentifier (Public usage class) */\nexport function microsoftTeamsAppIdentifierConverter(\n identifier: MicrosoftTeamsAppIdentifierModel | undefined,\n): MicrosoftTeamsAppIdentifier | undefined {\n if (!identifier || !identifier.appId) {\n return undefined;\n }\n\n return { teamsAppId: identifier.appId };\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure/communication-call-automation",
3
- "version": "1.5.0-alpha.20250516.3",
3
+ "version": "1.5.0-beta.1",
4
4
  "description": "Azure client library for Azure Communication Call Automation services",
5
5
  "sdk-type": "client",
6
6
  "main": "./dist/commonjs/index.js",
@@ -11,19 +11,25 @@
11
11
  "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api",
12
12
  "build:autorest": "autorest ./swagger/README.md",
13
13
  "build:samples": "dev-tool samples publish --force",
14
+ "build:test": "echo skipped.",
14
15
  "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
15
16
  "clean": "dev-tool run vendored rimraf --glob dist dist-* temp types *.tgz *.log",
16
17
  "execute:samples": "dev-tool samples run samples-dev",
17
18
  "extract-api": "dev-tool run build-package && dev-tool run extract-api",
18
19
  "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
19
20
  "generate:client": "autorest --typescript ./swagger/README.md",
21
+ "integration-test": "npm run integration-test:node && npm run integration-test:browser",
22
+ "integration-test:browser": "echo skipped",
23
+ "integration-test:node": "dev-tool run test:vitest --esm",
20
24
  "lint": "eslint package.json api-extractor.json README.md src test",
21
25
  "lint:fix": "eslint package.json api-extractor.json README.md src test --fix --fix-type [problem,suggestion]",
22
26
  "pack": "npm pack 2>&1",
23
- "test": "npm run test:node && npm run test:browser",
24
- "test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
25
- "test:node": "dev-tool run test:vitest",
26
- "test:node:esm": "dev-tool run test:vitest --esm",
27
+ "test": "npm run build:test && npm run unit-test && npm run integration-test",
28
+ "test:browser": "npm run build:test && npm run unit-test:browser",
29
+ "test:node": "npm run build:test && npm run unit-test:node",
30
+ "unit-test": "npm run unit-test:node && npm run unit-test:browser",
31
+ "unit-test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
32
+ "unit-test:node": "dev-tool run test:vitest",
27
33
  "update-snippets": "dev-tool run update-snippets"
28
34
  },
29
35
  "files": [
@@ -63,7 +69,7 @@
63
69
  },
64
70
  "dependencies": {
65
71
  "@azure/abort-controller": "^2.1.2",
66
- "@azure/communication-common": "^2.3.1",
72
+ "@azure/communication-common": "^2.3.2-beta.1",
67
73
  "@azure/core-auth": "^1.9.0",
68
74
  "@azure/core-client": "^1.9.2",
69
75
  "@azure/core-paging": "^1.6.2",
@@ -76,13 +82,13 @@
76
82
  },
77
83
  "devDependencies": {
78
84
  "@azure-tools/test-credential": "^2.0.0",
79
- "@azure-tools/test-recorder": ">=4.1.0-alpha <4.1.0-alphb",
80
- "@azure-tools/test-utils-vitest": ">=1.0.0-alpha <1.0.0-alphb",
81
- "@azure-tools/vite-plugin-browser-test-map": ">=1.0.0-alpha <1.0.0-alphb",
85
+ "@azure-tools/test-recorder": "^4.1.0",
86
+ "@azure-tools/test-utils-vitest": "^1.0.0",
87
+ "@azure-tools/vite-plugin-browser-test-map": "^1.0.0",
82
88
  "@azure/communication-identity": "^1.2.0",
83
89
  "@azure/communication-phone-numbers": "^1.2.0",
84
- "@azure/dev-tool": ">=1.0.0-alpha <1.0.0-alphb",
85
- "@azure/eslint-plugin-azure-sdk": ">=3.0.0-alpha <3.0.0-alphb",
90
+ "@azure/dev-tool": "^1.0.0",
91
+ "@azure/eslint-plugin-azure-sdk": "^3.0.0",
86
92
  "@azure/identity": "^4.5.0",
87
93
  "@azure/service-bus": "^7.9.5",
88
94
  "@types/node": "^18.0.0",
@@ -1,39 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,137 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- import { EventEmitter } from "events";
4
- import { parseCallAutomationEvent } from "../callAutomationEventParser.js";
5
- /**
6
- * Call Automation's EventProcessor for incoming events for ease of use.
7
- */
8
- export class CallAutomationEventProcessor {
9
- constructor() {
10
- this.defaultTimeout = 240000; // 240 seconds in milliseconds
11
- this.defaultEventBacklogTimeout = 5000; // 5 seconds in milliseconds
12
- this.emitter = new EventEmitter();
13
- this.eventsBacklog = [];
14
- this.ongoingEvents = new Map();
15
- }
16
- /**
17
- * Process incoming events. Pass incoming events to get it processed to have other method like WaitForEventProcessor to function.
18
- * @param event - Incoming CloudEvent object.
19
- */
20
- processEvents(event) {
21
- if (event) {
22
- let callAutomationEvent;
23
- // parse the event if not parsed already
24
- if (typeof event === "string" || Array.isArray(event)) {
25
- callAutomationEvent = parseCallAutomationEvent(event || event);
26
- }
27
- else {
28
- callAutomationEvent = event;
29
- }
30
- // add to eventbacklog
31
- this.eventsBacklog.push(callAutomationEvent);
32
- setTimeout(() => {
33
- const index = this.eventsBacklog.indexOf(callAutomationEvent);
34
- if (index !== -1) {
35
- this.eventsBacklog.splice(index, 1);
36
- }
37
- }, this.defaultEventBacklogTimeout);
38
- // parse event if needed
39
- this.emitter.emit("event", callAutomationEvent);
40
- // check if event is disconnect, remove all related items in memory
41
- if (callAutomationEvent.kind === "CallDisconnected") {
42
- // remove from ongoingevent list
43
- for (const [key, evProcessor] of this.ongoingEvents.entries()) {
44
- if (key.includes(callAutomationEvent.callConnectionId)) {
45
- // Deregister the event listener
46
- this.ongoingEvents.delete(key);
47
- this.emitter.off("event", evProcessor);
48
- }
49
- }
50
- }
51
- }
52
- }
53
- /**
54
- * Wait for matching incoming event. This is blocking Call. Returns the CallAutomationEvent once it arrives in ProcessEvent method.
55
- * @param predicate - Conditional Predicate for waiting on event.
56
- * @param abortSignal - Abort signal to abort the operation.
57
- * @param timeoutInMs - maximum timeout in milliseconds for the operation.
58
- */
59
- async waitForEventProcessor(predicate, abortSignal, timeoutInMs) {
60
- const controller = new AbortController();
61
- if (!timeoutInMs) {
62
- timeoutInMs = this.defaultTimeout;
63
- }
64
- const filteredEvents = this.eventsBacklog.filter((event) => predicate(event));
65
- if (filteredEvents.length > 0) {
66
- // item found - delete from the list and return the event
67
- this.eventsBacklog.splice(0, this.eventsBacklog.length, ...filteredEvents);
68
- return filteredEvents[0];
69
- }
70
- // await for this event to comeback
71
- let eventAwaiter;
72
- const eventPromise = new Promise((resolve, reject) => {
73
- // set abort signal
74
- if (abortSignal) {
75
- // If an external abortSignal is provided, link it with the controller.
76
- abortSignal.addEventListener("abort", () => {
77
- controller.abort();
78
- this.emitter.off("event", eventAwaiter);
79
- reject(new Error("Abort: Operation was aborted."));
80
- });
81
- }
82
- // set timeout for this event
83
- const timer = setTimeout(() => {
84
- this.emitter.off("event", eventAwaiter);
85
- reject(new Error("Timeout: Matching event did not arrive within timeout."));
86
- }, timeoutInMs);
87
- eventAwaiter = (event) => {
88
- if (predicate(event)) {
89
- // Deregister timer and the event listener
90
- clearTimeout(timer);
91
- this.emitter.off("event", eventAwaiter);
92
- // Resolve with the matching event
93
- resolve(event);
94
- }
95
- };
96
- // Register the event awaiter
97
- this.emitter.on("event", eventAwaiter);
98
- });
99
- return eventPromise;
100
- }
101
- /**
102
- * Attach Ongoing EventProcessor for specific event for a call.
103
- * @param eventTypeKind - Matching event.
104
- * @param callConnectionId - CallConnectionId of the call.
105
- * @param eventProcessor - Method that will execute once the matching event arrives.
106
- */
107
- async attachOngoingEventProcessor(callConnectionId, eventTypeKind, eventProcessor) {
108
- const eventAwaiter = (event) => {
109
- if (event.callConnectionId === callConnectionId && event.kind === eventTypeKind) {
110
- eventProcessor(event);
111
- }
112
- };
113
- // Register the event awaiter
114
- this.emitter.on("event", eventAwaiter);
115
- // attach the ongoing event processor to the map
116
- const uniqueId = this.generateIdTypeKey(callConnectionId, eventTypeKind);
117
- this.ongoingEvents.set(uniqueId, eventAwaiter);
118
- }
119
- /**
120
- * Detach Ongoing EventProcessor for specific event.
121
- * @param eventTypeKind - Matching event.
122
- * @param callConnectionId - CallConnectionId of the call.
123
- */
124
- async detachOngoingEventProcessor(callConnectionId, eventTypeKind) {
125
- const uniqueId = this.generateIdTypeKey(callConnectionId, eventTypeKind);
126
- const value = this.ongoingEvents.get(uniqueId);
127
- if (value) {
128
- // Deregister the event listener
129
- this.ongoingEvents.delete(uniqueId);
130
- this.emitter.off("event", value);
131
- }
132
- }
133
- generateIdTypeKey(callConnectionId, eventType) {
134
- return `${callConnectionId}:${eventType}`;
135
- }
136
- }
137
- //# sourceMappingURL=callAutomationEventProcessor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"callAutomationEventProcessor.js","sourceRoot":"","sources":["../../../src/eventprocessor/callAutomationEventProcessor.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAG3E;;GAEG;AACH,MAAM,OAAO,4BAA4B;IAAzC;QACmB,mBAAc,GAAG,MAAM,CAAC,CAAC,8BAA8B;QACvD,+BAA0B,GAAG,IAAI,CAAC,CAAC,4BAA4B;QAC/D,YAAO,GAAG,IAAI,YAAY,EAAE,CAAC;QAC7B,kBAAa,GAA+B,EAAE,CAAC;QAC/C,kBAAa,GAAqB,IAAI,GAAG,EAAE,CAAC;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AAI,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;QACzE,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAE/C,IAAI,KAAK,EAAE,CAAC;YACV,gCAAgC;YAChC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;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","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"]}