@azure/communication-call-automation 1.3.0 → 1.3.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 (562) hide show
  1. package/README.md +66 -57
  2. package/dist/browser/callAutomationClient.d.ts +98 -0
  3. package/dist/browser/callAutomationClient.d.ts.map +1 -0
  4. package/{dist-esm/src → dist/browser}/callAutomationClient.js +5 -5
  5. package/dist/browser/callAutomationClient.js.map +1 -0
  6. package/dist/browser/callAutomationEventParser.d.ts +6 -0
  7. package/dist/browser/callAutomationEventParser.d.ts.map +1 -0
  8. package/{dist-esm/src → dist/browser}/callAutomationEventParser.js +2 -2
  9. package/dist/browser/callAutomationEventParser.js.map +1 -0
  10. package/dist/browser/callConnection.d.ts +76 -0
  11. package/dist/browser/callConnection.d.ts.map +1 -0
  12. package/{dist-esm/src → dist/browser}/callConnection.js +4 -4
  13. package/dist/browser/callConnection.js.map +1 -0
  14. package/dist/browser/callMedia.d.ts +84 -0
  15. package/dist/browser/callMedia.d.ts.map +1 -0
  16. package/{dist-esm/src → dist/browser}/callMedia.js +2 -2
  17. package/dist/browser/callMedia.js.map +1 -0
  18. package/dist/browser/callRecording.d.ts +70 -0
  19. package/dist/browser/callRecording.d.ts.map +1 -0
  20. package/{dist-esm/src → dist/browser}/callRecording.js +5 -5
  21. package/dist/browser/callRecording.js.map +1 -0
  22. package/dist/browser/contentDownloader.d.ts +25 -0
  23. package/dist/browser/contentDownloader.d.ts.map +1 -0
  24. package/dist/browser/contentDownloader.js.map +1 -0
  25. package/dist/browser/credential/callAutomationAccessKeyCredentialPolicy.d.ts +10 -0
  26. package/dist/browser/credential/callAutomationAccessKeyCredentialPolicy.d.ts.map +1 -0
  27. package/{dist-esm/src → dist/browser}/credential/callAutomationAccessKeyCredentialPolicy.js +1 -1
  28. package/dist/browser/credential/callAutomationAccessKeyCredentialPolicy.js.map +1 -0
  29. package/dist/browser/credential/callAutomationAuthPolicy.d.ts +22 -0
  30. package/dist/browser/credential/callAutomationAuthPolicy.d.ts.map +1 -0
  31. package/{dist-esm/src → dist/browser}/credential/callAutomationAuthPolicy.js +2 -2
  32. package/dist/browser/credential/callAutomationAuthPolicy.js.map +1 -0
  33. package/dist/browser/credential/cryptoUtils-browser.d.mts.map +1 -0
  34. package/dist/browser/credential/cryptoUtils-browser.mjs.map +1 -0
  35. package/dist/browser/credential/cryptoUtils.d.ts +3 -0
  36. package/{dist-esm/src/credential/cryptoUtils.browser.js → dist/browser/credential/cryptoUtils.js} +2 -2
  37. package/dist/browser/credential/encodeUtils.browser.d.ts +4 -0
  38. package/dist/browser/credential/encodeUtils.browser.d.ts.map +1 -0
  39. package/dist/browser/generated/src/callAutomationApiClient.d.ts +49 -0
  40. package/dist/browser/generated/src/callAutomationApiClient.d.ts.map +1 -0
  41. package/{dist-esm/src → dist/browser}/generated/src/callAutomationApiClient.js +3 -3
  42. package/dist/browser/generated/src/callAutomationApiClient.js.map +1 -0
  43. package/dist/browser/generated/src/index.d.ts +5 -0
  44. package/dist/browser/generated/src/index.d.ts.map +1 -0
  45. package/{dist-esm/src → dist/browser}/generated/src/index.js +4 -4
  46. package/dist/browser/generated/src/index.js.map +1 -0
  47. package/dist/browser/generated/src/models/index.d.ts +1494 -0
  48. package/dist/browser/generated/src/models/index.d.ts.map +1 -0
  49. package/dist/browser/generated/src/models/mappers.d.ts +82 -0
  50. package/dist/browser/generated/src/models/mappers.d.ts.map +1 -0
  51. package/dist/browser/generated/src/models/parameters.d.ts +29 -0
  52. package/dist/browser/generated/src/models/parameters.d.ts.map +1 -0
  53. package/{dist-esm/src → dist/browser}/generated/src/models/parameters.js +1 -1
  54. package/{dist-esm/src → dist/browser}/generated/src/models/parameters.js.map +1 -1
  55. package/dist/browser/generated/src/operations/callConnection.d.ts +96 -0
  56. package/dist/browser/generated/src/operations/callConnection.d.ts.map +1 -0
  57. package/{dist-esm/src → dist/browser}/generated/src/operations/callConnection.js +3 -3
  58. package/dist/browser/generated/src/operations/callConnection.js.map +1 -0
  59. package/dist/browser/generated/src/operations/callMedia.d.ts +68 -0
  60. package/dist/browser/generated/src/operations/callMedia.d.ts.map +1 -0
  61. package/{dist-esm/src → dist/browser}/generated/src/operations/callMedia.js +2 -2
  62. package/dist/browser/generated/src/operations/callMedia.js.map +1 -0
  63. package/dist/browser/generated/src/operations/callRecording.d.ts +43 -0
  64. package/dist/browser/generated/src/operations/callRecording.d.ts.map +1 -0
  65. package/{dist-esm/src → dist/browser}/generated/src/operations/callRecording.js +2 -2
  66. package/dist/browser/generated/src/operations/callRecording.js.map +1 -0
  67. package/dist/browser/generated/src/operations/index.d.ts +4 -0
  68. package/dist/browser/generated/src/operations/index.d.ts.map +1 -0
  69. package/{dist-esm/src/generated/src/operationsInterfaces → dist/browser/generated/src/operations}/index.js +3 -3
  70. package/dist/browser/generated/src/operations/index.js.map +1 -0
  71. package/dist/browser/generated/src/operationsInterfaces/callConnection.d.ts +73 -0
  72. package/dist/browser/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -0
  73. package/dist/browser/generated/src/operationsInterfaces/callConnection.js.map +1 -0
  74. package/dist/browser/generated/src/operationsInterfaces/callMedia.d.ts +60 -0
  75. package/dist/browser/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -0
  76. package/dist/browser/generated/src/operationsInterfaces/callMedia.js.map +1 -0
  77. package/dist/browser/generated/src/operationsInterfaces/callRecording.d.ts +35 -0
  78. package/dist/browser/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -0
  79. package/dist/browser/generated/src/operationsInterfaces/callRecording.js.map +1 -0
  80. package/dist/browser/generated/src/operationsInterfaces/index.d.ts +4 -0
  81. package/dist/browser/generated/src/operationsInterfaces/index.d.ts.map +1 -0
  82. package/dist/browser/generated/src/operationsInterfaces/index.js +11 -0
  83. package/dist/browser/generated/src/operationsInterfaces/index.js.map +1 -0
  84. package/dist/browser/generated/src/pagingHelper.d.ts +13 -0
  85. package/dist/browser/generated/src/pagingHelper.d.ts.map +1 -0
  86. package/dist/browser/index.d.ts +10 -0
  87. package/dist/browser/index.d.ts.map +1 -0
  88. package/dist/browser/index.js +12 -0
  89. package/dist/browser/index.js.map +1 -0
  90. package/dist/browser/models/constants.d.ts +2 -0
  91. package/dist/browser/models/constants.d.ts.map +1 -0
  92. package/dist/browser/models/events.d.ts +395 -0
  93. package/dist/browser/models/events.d.ts.map +1 -0
  94. package/dist/browser/models/events.js.map +1 -0
  95. package/dist/browser/models/logger.d.ts +5 -0
  96. package/dist/browser/models/logger.d.ts.map +1 -0
  97. package/dist/browser/models/mapper.d.ts +3 -0
  98. package/dist/browser/models/mapper.d.ts.map +1 -0
  99. package/dist/browser/models/models.d.ts +188 -0
  100. package/dist/browser/models/models.d.ts.map +1 -0
  101. package/{dist-esm/src → dist/browser}/models/models.js +1 -1
  102. package/dist/browser/models/models.js.map +1 -0
  103. package/dist/browser/models/options.d.ts +315 -0
  104. package/dist/browser/models/options.d.ts.map +1 -0
  105. package/dist/browser/models/options.js.map +1 -0
  106. package/dist/browser/models/responses.d.ts +73 -0
  107. package/dist/browser/models/responses.d.ts.map +1 -0
  108. package/dist/browser/models/responses.js.map +1 -0
  109. package/dist/browser/package.json +3 -0
  110. package/dist/browser/utli/converters.d.ts +22 -0
  111. package/dist/browser/utli/converters.d.ts.map +1 -0
  112. package/{dist-esm/src → dist/browser}/utli/converters.js +15 -1
  113. package/dist/browser/utli/converters.js.map +1 -0
  114. package/dist/commonjs/callAutomationClient.d.ts +98 -0
  115. package/dist/commonjs/callAutomationClient.d.ts.map +1 -0
  116. package/dist/commonjs/callAutomationClient.js +218 -0
  117. package/{dist-esm/src → dist/commonjs}/callAutomationClient.js.map +1 -1
  118. package/dist/commonjs/callAutomationEventParser.d.ts +6 -0
  119. package/dist/commonjs/callAutomationEventParser.d.ts.map +1 -0
  120. package/dist/commonjs/callAutomationEventParser.js +151 -0
  121. package/dist/commonjs/callAutomationEventParser.js.map +1 -0
  122. package/dist/commonjs/callConnection.d.ts +76 -0
  123. package/dist/commonjs/callConnection.d.ts.map +1 -0
  124. package/dist/commonjs/callConnection.js +215 -0
  125. package/dist/commonjs/callConnection.js.map +1 -0
  126. package/dist/commonjs/callMedia.d.ts +84 -0
  127. package/dist/commonjs/callMedia.d.ts.map +1 -0
  128. package/dist/commonjs/callMedia.js +326 -0
  129. package/{dist-esm/src → dist/commonjs}/callMedia.js.map +1 -1
  130. package/dist/commonjs/callRecording.d.ts +70 -0
  131. package/dist/commonjs/callRecording.d.ts.map +1 -0
  132. package/dist/commonjs/callRecording.js +184 -0
  133. package/dist/commonjs/callRecording.js.map +1 -0
  134. package/dist/commonjs/contentDownloader.d.ts +25 -0
  135. package/dist/commonjs/contentDownloader.d.ts.map +1 -0
  136. package/dist/commonjs/contentDownloader.js +108 -0
  137. package/dist/commonjs/contentDownloader.js.map +1 -0
  138. package/dist/commonjs/credential/callAutomationAccessKeyCredentialPolicy.d.ts +10 -0
  139. package/dist/commonjs/credential/callAutomationAccessKeyCredentialPolicy.d.ts.map +1 -0
  140. package/dist/commonjs/credential/callAutomationAccessKeyCredentialPolicy.js +42 -0
  141. package/dist/commonjs/credential/callAutomationAccessKeyCredentialPolicy.js.map +1 -0
  142. package/dist/commonjs/credential/callAutomationAuthPolicy.d.ts +22 -0
  143. package/dist/commonjs/credential/callAutomationAuthPolicy.d.ts.map +1 -0
  144. package/dist/commonjs/credential/callAutomationAuthPolicy.js +57 -0
  145. package/dist/commonjs/credential/callAutomationAuthPolicy.js.map +1 -0
  146. package/dist/commonjs/credential/cryptoUtils.d.ts +3 -0
  147. package/dist/commonjs/credential/cryptoUtils.d.ts.map +1 -0
  148. package/dist/commonjs/credential/cryptoUtils.js +14 -0
  149. package/dist/commonjs/credential/cryptoUtils.js.map +1 -0
  150. package/dist/commonjs/credential/encodeUtils.browser.d.ts +4 -0
  151. package/dist/commonjs/credential/encodeUtils.browser.d.ts.map +1 -0
  152. package/dist/commonjs/credential/encodeUtils.browser.js +32 -0
  153. package/dist/commonjs/credential/encodeUtils.browser.js.map +1 -0
  154. package/dist/commonjs/generated/src/callAutomationApiClient.d.ts +49 -0
  155. package/dist/commonjs/generated/src/callAutomationApiClient.d.ts.map +1 -0
  156. package/dist/commonjs/generated/src/callAutomationApiClient.js +231 -0
  157. package/dist/commonjs/generated/src/callAutomationApiClient.js.map +1 -0
  158. package/dist/commonjs/generated/src/index.d.ts +5 -0
  159. package/dist/commonjs/generated/src/index.d.ts.map +1 -0
  160. package/dist/commonjs/generated/src/index.js +19 -0
  161. package/dist/commonjs/generated/src/index.js.map +1 -0
  162. package/dist/commonjs/generated/src/models/index.d.ts +1494 -0
  163. package/dist/commonjs/generated/src/models/index.d.ts.map +1 -0
  164. package/dist/commonjs/generated/src/models/index.js +203 -0
  165. package/dist/commonjs/generated/src/models/index.js.map +1 -0
  166. package/dist/commonjs/generated/src/models/mappers.d.ts +82 -0
  167. package/dist/commonjs/generated/src/models/mappers.d.ts.map +1 -0
  168. package/dist/commonjs/generated/src/models/mappers.js +2857 -0
  169. package/dist/commonjs/generated/src/models/mappers.js.map +1 -0
  170. package/dist/commonjs/generated/src/models/parameters.d.ts +29 -0
  171. package/dist/commonjs/generated/src/models/parameters.d.ts.map +1 -0
  172. package/dist/commonjs/generated/src/models/parameters.js +183 -0
  173. package/dist/commonjs/generated/src/models/parameters.js.map +1 -0
  174. package/dist/commonjs/generated/src/operations/callConnection.d.ts +96 -0
  175. package/dist/commonjs/generated/src/operations/callConnection.d.ts.map +1 -0
  176. package/dist/commonjs/generated/src/operations/callConnection.js +406 -0
  177. package/dist/commonjs/generated/src/operations/callConnection.js.map +1 -0
  178. package/dist/commonjs/generated/src/operations/callMedia.d.ts +68 -0
  179. package/dist/commonjs/generated/src/operations/callMedia.d.ts.map +1 -0
  180. package/dist/commonjs/generated/src/operations/callMedia.js +232 -0
  181. package/dist/commonjs/generated/src/operations/callMedia.js.map +1 -0
  182. package/dist/commonjs/generated/src/operations/callRecording.d.ts +43 -0
  183. package/dist/commonjs/generated/src/operations/callRecording.d.ts.map +1 -0
  184. package/dist/commonjs/generated/src/operations/callRecording.js +149 -0
  185. package/dist/commonjs/generated/src/operations/callRecording.js.map +1 -0
  186. package/dist/commonjs/generated/src/operations/index.d.ts +4 -0
  187. package/dist/commonjs/generated/src/operations/index.d.ts.map +1 -0
  188. package/dist/commonjs/generated/src/operations/index.js +14 -0
  189. package/dist/commonjs/generated/src/operations/index.js.map +1 -0
  190. package/dist/commonjs/generated/src/operationsInterfaces/callConnection.d.ts +73 -0
  191. package/dist/commonjs/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -0
  192. package/{dist-esm/src/generated/src/operations/index.js → dist/commonjs/generated/src/operationsInterfaces/callConnection.js} +3 -4
  193. package/dist/commonjs/generated/src/operationsInterfaces/callConnection.js.map +1 -0
  194. package/dist/commonjs/generated/src/operationsInterfaces/callMedia.d.ts +60 -0
  195. package/dist/commonjs/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -0
  196. package/dist/commonjs/generated/src/operationsInterfaces/callMedia.js +10 -0
  197. package/dist/commonjs/generated/src/operationsInterfaces/callMedia.js.map +1 -0
  198. package/dist/commonjs/generated/src/operationsInterfaces/callRecording.d.ts +35 -0
  199. package/dist/commonjs/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -0
  200. package/dist/commonjs/generated/src/operationsInterfaces/callRecording.js +10 -0
  201. package/dist/commonjs/generated/src/operationsInterfaces/callRecording.js.map +1 -0
  202. package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts +4 -0
  203. package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts.map +1 -0
  204. package/dist/commonjs/generated/src/operationsInterfaces/index.js +14 -0
  205. package/dist/commonjs/generated/src/operationsInterfaces/index.js.map +1 -0
  206. package/dist/commonjs/generated/src/pagingHelper.d.ts +13 -0
  207. package/dist/commonjs/generated/src/pagingHelper.d.ts.map +1 -0
  208. package/dist/commonjs/generated/src/pagingHelper.js +36 -0
  209. package/dist/commonjs/generated/src/pagingHelper.js.map +1 -0
  210. package/dist/commonjs/index.d.ts +10 -0
  211. package/dist/commonjs/index.d.ts.map +1 -0
  212. package/dist/commonjs/index.js +15 -0
  213. package/dist/commonjs/index.js.map +1 -0
  214. package/dist/commonjs/models/constants.d.ts +2 -0
  215. package/dist/commonjs/models/constants.d.ts.map +1 -0
  216. package/dist/commonjs/models/constants.js +7 -0
  217. package/dist/commonjs/models/constants.js.map +1 -0
  218. package/dist/commonjs/models/events.d.ts +395 -0
  219. package/dist/commonjs/models/events.d.ts.map +1 -0
  220. package/dist/commonjs/models/events.js +5 -0
  221. package/dist/commonjs/models/events.js.map +1 -0
  222. package/dist/commonjs/models/logger.d.ts +5 -0
  223. package/dist/commonjs/models/logger.d.ts.map +1 -0
  224. package/dist/commonjs/models/logger.js +11 -0
  225. package/dist/commonjs/models/logger.js.map +1 -0
  226. package/dist/commonjs/models/mapper.d.ts +3 -0
  227. package/dist/commonjs/models/mapper.d.ts.map +1 -0
  228. package/dist/commonjs/models/mapper.js +79 -0
  229. package/dist/commonjs/models/mapper.js.map +1 -0
  230. package/dist/commonjs/models/models.d.ts +188 -0
  231. package/dist/commonjs/models/models.d.ts.map +1 -0
  232. package/dist/commonjs/models/models.js +58 -0
  233. package/dist/commonjs/models/models.js.map +1 -0
  234. package/dist/commonjs/models/options.d.ts +315 -0
  235. package/dist/commonjs/models/options.d.ts.map +1 -0
  236. package/dist/commonjs/models/options.js +5 -0
  237. package/dist/commonjs/models/options.js.map +1 -0
  238. package/dist/commonjs/models/responses.d.ts +73 -0
  239. package/dist/commonjs/models/responses.d.ts.map +1 -0
  240. package/dist/commonjs/models/responses.js +5 -0
  241. package/dist/commonjs/models/responses.js.map +1 -0
  242. package/dist/commonjs/package.json +3 -0
  243. package/dist/commonjs/tsdoc-metadata.json +11 -0
  244. package/dist/commonjs/utli/converters.d.ts +22 -0
  245. package/dist/commonjs/utli/converters.d.ts.map +1 -0
  246. package/dist/commonjs/utli/converters.js +153 -0
  247. package/dist/commonjs/utli/converters.js.map +1 -0
  248. package/dist/esm/callAutomationClient.d.ts +98 -0
  249. package/dist/esm/callAutomationClient.d.ts.map +1 -0
  250. package/dist/esm/callAutomationClient.js +214 -0
  251. package/dist/esm/callAutomationClient.js.map +1 -0
  252. package/dist/esm/callAutomationEventParser.d.ts +6 -0
  253. package/dist/esm/callAutomationEventParser.d.ts.map +1 -0
  254. package/dist/esm/callAutomationEventParser.js +148 -0
  255. package/dist/esm/callAutomationEventParser.js.map +1 -0
  256. package/dist/esm/callConnection.d.ts +76 -0
  257. package/dist/esm/callConnection.d.ts.map +1 -0
  258. package/dist/esm/callConnection.js +211 -0
  259. package/dist/esm/callConnection.js.map +1 -0
  260. package/dist/esm/callMedia.d.ts +84 -0
  261. package/dist/esm/callMedia.d.ts.map +1 -0
  262. package/dist/esm/callMedia.js +322 -0
  263. package/dist/esm/callMedia.js.map +1 -0
  264. package/dist/esm/callRecording.d.ts +70 -0
  265. package/dist/esm/callRecording.d.ts.map +1 -0
  266. package/dist/esm/callRecording.js +179 -0
  267. package/dist/esm/callRecording.js.map +1 -0
  268. package/dist/esm/contentDownloader.d.ts +25 -0
  269. package/dist/esm/contentDownloader.d.ts.map +1 -0
  270. package/dist/esm/contentDownloader.js +104 -0
  271. package/dist/esm/contentDownloader.js.map +1 -0
  272. package/dist/esm/credential/callAutomationAccessKeyCredentialPolicy.d.ts +10 -0
  273. package/dist/esm/credential/callAutomationAccessKeyCredentialPolicy.d.ts.map +1 -0
  274. package/dist/esm/credential/callAutomationAccessKeyCredentialPolicy.js +39 -0
  275. package/dist/esm/credential/callAutomationAccessKeyCredentialPolicy.js.map +1 -0
  276. package/dist/esm/credential/callAutomationAuthPolicy.d.ts +22 -0
  277. package/dist/esm/credential/callAutomationAuthPolicy.d.ts.map +1 -0
  278. package/dist/esm/credential/callAutomationAuthPolicy.js +53 -0
  279. package/dist/esm/credential/callAutomationAuthPolicy.js.map +1 -0
  280. package/dist/esm/credential/cryptoUtils.d.ts +3 -0
  281. package/dist/esm/credential/cryptoUtils.d.ts.map +1 -0
  282. package/{dist-esm/src → dist/esm}/credential/cryptoUtils.js +1 -1
  283. package/{dist-esm/src → dist/esm}/credential/cryptoUtils.js.map +1 -1
  284. package/dist/esm/credential/encodeUtils.browser.d.ts +4 -0
  285. package/dist/esm/credential/encodeUtils.browser.d.ts.map +1 -0
  286. package/dist/esm/credential/encodeUtils.browser.js +26 -0
  287. package/dist/esm/credential/encodeUtils.browser.js.map +1 -0
  288. package/dist/esm/generated/src/callAutomationApiClient.d.ts +49 -0
  289. package/dist/esm/generated/src/callAutomationApiClient.d.ts.map +1 -0
  290. package/dist/esm/generated/src/callAutomationApiClient.js +226 -0
  291. package/dist/esm/generated/src/callAutomationApiClient.js.map +1 -0
  292. package/dist/esm/generated/src/index.d.ts +5 -0
  293. package/dist/esm/generated/src/index.d.ts.map +1 -0
  294. package/dist/esm/generated/src/index.js +13 -0
  295. package/dist/esm/generated/src/index.js.map +1 -0
  296. package/dist/esm/generated/src/models/index.d.ts +1494 -0
  297. package/dist/esm/generated/src/models/index.d.ts.map +1 -0
  298. package/dist/esm/generated/src/models/index.js +200 -0
  299. package/dist/esm/generated/src/models/index.js.map +1 -0
  300. package/dist/esm/generated/src/models/mappers.d.ts +82 -0
  301. package/dist/esm/generated/src/models/mappers.d.ts.map +1 -0
  302. package/dist/esm/generated/src/models/mappers.js +2853 -0
  303. package/dist/esm/generated/src/models/mappers.js.map +1 -0
  304. package/dist/esm/generated/src/models/parameters.d.ts +29 -0
  305. package/dist/esm/generated/src/models/parameters.d.ts.map +1 -0
  306. package/dist/esm/generated/src/models/parameters.js +180 -0
  307. package/dist/esm/generated/src/models/parameters.js.map +1 -0
  308. package/dist/esm/generated/src/operations/callConnection.d.ts +96 -0
  309. package/dist/esm/generated/src/operations/callConnection.d.ts.map +1 -0
  310. package/dist/esm/generated/src/operations/callConnection.js +402 -0
  311. package/dist/esm/generated/src/operations/callConnection.js.map +1 -0
  312. package/dist/esm/generated/src/operations/callMedia.d.ts +68 -0
  313. package/dist/esm/generated/src/operations/callMedia.d.ts.map +1 -0
  314. package/dist/esm/generated/src/operations/callMedia.js +227 -0
  315. package/dist/esm/generated/src/operations/callMedia.js.map +1 -0
  316. package/dist/esm/generated/src/operations/callRecording.d.ts +43 -0
  317. package/dist/esm/generated/src/operations/callRecording.d.ts.map +1 -0
  318. package/dist/esm/generated/src/operations/callRecording.js +144 -0
  319. package/dist/esm/generated/src/operations/callRecording.js.map +1 -0
  320. package/dist/esm/generated/src/operations/index.d.ts +4 -0
  321. package/dist/esm/generated/src/operations/index.d.ts.map +1 -0
  322. package/dist/esm/generated/src/operations/index.js +11 -0
  323. package/dist/esm/generated/src/operations/index.js.map +1 -0
  324. package/dist/esm/generated/src/operationsInterfaces/callConnection.d.ts +73 -0
  325. package/dist/esm/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -0
  326. package/dist/esm/generated/src/operationsInterfaces/callConnection.js +9 -0
  327. package/dist/esm/generated/src/operationsInterfaces/callConnection.js.map +1 -0
  328. package/dist/esm/generated/src/operationsInterfaces/callMedia.d.ts +60 -0
  329. package/dist/esm/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -0
  330. package/dist/esm/generated/src/operationsInterfaces/callMedia.js +9 -0
  331. package/dist/esm/generated/src/operationsInterfaces/callMedia.js.map +1 -0
  332. package/dist/esm/generated/src/operationsInterfaces/callRecording.d.ts +35 -0
  333. package/dist/esm/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -0
  334. package/dist/esm/generated/src/operationsInterfaces/callRecording.js +9 -0
  335. package/dist/esm/generated/src/operationsInterfaces/callRecording.js.map +1 -0
  336. package/dist/esm/generated/src/operationsInterfaces/index.d.ts +4 -0
  337. package/dist/esm/generated/src/operationsInterfaces/index.d.ts.map +1 -0
  338. package/dist/esm/generated/src/operationsInterfaces/index.js +11 -0
  339. package/dist/esm/generated/src/operationsInterfaces/index.js.map +1 -0
  340. package/dist/esm/generated/src/pagingHelper.d.ts +13 -0
  341. package/dist/esm/generated/src/pagingHelper.d.ts.map +1 -0
  342. package/dist/esm/generated/src/pagingHelper.js +32 -0
  343. package/dist/esm/generated/src/pagingHelper.js.map +1 -0
  344. package/dist/esm/index.d.ts +10 -0
  345. package/dist/esm/index.d.ts.map +1 -0
  346. package/dist/esm/index.js +12 -0
  347. package/dist/esm/index.js.map +1 -0
  348. package/dist/esm/models/constants.d.ts +2 -0
  349. package/dist/esm/models/constants.d.ts.map +1 -0
  350. package/dist/esm/models/constants.js +4 -0
  351. package/dist/esm/models/constants.js.map +1 -0
  352. package/dist/esm/models/events.d.ts +395 -0
  353. package/dist/esm/models/events.d.ts.map +1 -0
  354. package/dist/esm/models/events.js +4 -0
  355. package/dist/esm/models/events.js.map +1 -0
  356. package/dist/esm/models/logger.d.ts +5 -0
  357. package/dist/esm/models/logger.d.ts.map +1 -0
  358. package/dist/esm/models/logger.js +8 -0
  359. package/dist/esm/models/logger.js.map +1 -0
  360. package/dist/esm/models/mapper.d.ts +3 -0
  361. package/dist/esm/models/mapper.d.ts.map +1 -0
  362. package/dist/esm/models/mapper.js +76 -0
  363. package/dist/esm/models/mapper.js.map +1 -0
  364. package/dist/esm/models/models.d.ts +188 -0
  365. package/dist/esm/models/models.d.ts.map +1 -0
  366. package/dist/esm/models/models.js +54 -0
  367. package/dist/esm/models/models.js.map +1 -0
  368. package/dist/esm/models/options.d.ts +315 -0
  369. package/dist/esm/models/options.d.ts.map +1 -0
  370. package/dist/esm/models/options.js +4 -0
  371. package/dist/esm/models/options.js.map +1 -0
  372. package/dist/esm/models/responses.d.ts +73 -0
  373. package/dist/esm/models/responses.d.ts.map +1 -0
  374. package/dist/esm/models/responses.js +4 -0
  375. package/dist/esm/models/responses.js.map +1 -0
  376. package/dist/esm/package.json +3 -0
  377. package/dist/esm/utli/converters.d.ts +22 -0
  378. package/dist/esm/utli/converters.d.ts.map +1 -0
  379. package/dist/esm/utli/converters.js +142 -0
  380. package/dist/esm/utli/converters.js.map +1 -0
  381. package/dist/react-native/callAutomationClient.d.ts +98 -0
  382. package/dist/react-native/callAutomationClient.d.ts.map +1 -0
  383. package/dist/react-native/callAutomationClient.js +214 -0
  384. package/dist/react-native/callAutomationClient.js.map +1 -0
  385. package/dist/react-native/callAutomationEventParser.d.ts +6 -0
  386. package/dist/react-native/callAutomationEventParser.d.ts.map +1 -0
  387. package/dist/react-native/callAutomationEventParser.js +148 -0
  388. package/dist/react-native/callAutomationEventParser.js.map +1 -0
  389. package/dist/react-native/callConnection.d.ts +76 -0
  390. package/dist/react-native/callConnection.d.ts.map +1 -0
  391. package/dist/react-native/callConnection.js +211 -0
  392. package/dist/react-native/callConnection.js.map +1 -0
  393. package/dist/react-native/callMedia.d.ts +84 -0
  394. package/dist/react-native/callMedia.d.ts.map +1 -0
  395. package/dist/react-native/callMedia.js +322 -0
  396. package/dist/react-native/callMedia.js.map +1 -0
  397. package/dist/react-native/callRecording.d.ts +70 -0
  398. package/dist/react-native/callRecording.d.ts.map +1 -0
  399. package/dist/react-native/callRecording.js +179 -0
  400. package/dist/react-native/callRecording.js.map +1 -0
  401. package/dist/react-native/contentDownloader.d.ts +25 -0
  402. package/dist/react-native/contentDownloader.d.ts.map +1 -0
  403. package/dist/react-native/contentDownloader.js +104 -0
  404. package/dist/react-native/contentDownloader.js.map +1 -0
  405. package/dist/react-native/credential/callAutomationAccessKeyCredentialPolicy.d.ts +10 -0
  406. package/dist/react-native/credential/callAutomationAccessKeyCredentialPolicy.d.ts.map +1 -0
  407. package/dist/react-native/credential/callAutomationAccessKeyCredentialPolicy.js +39 -0
  408. package/dist/react-native/credential/callAutomationAccessKeyCredentialPolicy.js.map +1 -0
  409. package/dist/react-native/credential/callAutomationAuthPolicy.d.ts +22 -0
  410. package/dist/react-native/credential/callAutomationAuthPolicy.d.ts.map +1 -0
  411. package/dist/react-native/credential/callAutomationAuthPolicy.js +53 -0
  412. package/dist/react-native/credential/callAutomationAuthPolicy.js.map +1 -0
  413. package/dist/react-native/credential/cryptoUtils.d.ts +3 -0
  414. package/dist/react-native/credential/cryptoUtils.d.ts.map +1 -0
  415. package/dist/react-native/credential/cryptoUtils.js +9 -0
  416. package/dist/react-native/credential/cryptoUtils.js.map +1 -0
  417. package/dist/react-native/credential/encodeUtils.browser.d.ts +4 -0
  418. package/dist/react-native/credential/encodeUtils.browser.d.ts.map +1 -0
  419. package/dist/react-native/credential/encodeUtils.browser.js +26 -0
  420. package/dist/react-native/credential/encodeUtils.browser.js.map +1 -0
  421. package/dist/react-native/generated/src/callAutomationApiClient.d.ts +49 -0
  422. package/dist/react-native/generated/src/callAutomationApiClient.d.ts.map +1 -0
  423. package/dist/react-native/generated/src/callAutomationApiClient.js +226 -0
  424. package/dist/react-native/generated/src/callAutomationApiClient.js.map +1 -0
  425. package/dist/react-native/generated/src/index.d.ts +5 -0
  426. package/dist/react-native/generated/src/index.d.ts.map +1 -0
  427. package/dist/react-native/generated/src/index.js +13 -0
  428. package/dist/react-native/generated/src/index.js.map +1 -0
  429. package/dist/react-native/generated/src/models/index.d.ts +1494 -0
  430. package/dist/react-native/generated/src/models/index.d.ts.map +1 -0
  431. package/dist/react-native/generated/src/models/index.js +200 -0
  432. package/dist/react-native/generated/src/models/index.js.map +1 -0
  433. package/dist/react-native/generated/src/models/mappers.d.ts +82 -0
  434. package/dist/react-native/generated/src/models/mappers.d.ts.map +1 -0
  435. package/dist/react-native/generated/src/models/mappers.js +2853 -0
  436. package/dist/react-native/generated/src/models/mappers.js.map +1 -0
  437. package/dist/react-native/generated/src/models/parameters.d.ts +29 -0
  438. package/dist/react-native/generated/src/models/parameters.d.ts.map +1 -0
  439. package/dist/react-native/generated/src/models/parameters.js +180 -0
  440. package/dist/react-native/generated/src/models/parameters.js.map +1 -0
  441. package/dist/react-native/generated/src/operations/callConnection.d.ts +96 -0
  442. package/dist/react-native/generated/src/operations/callConnection.d.ts.map +1 -0
  443. package/dist/react-native/generated/src/operations/callConnection.js +402 -0
  444. package/dist/react-native/generated/src/operations/callConnection.js.map +1 -0
  445. package/dist/react-native/generated/src/operations/callMedia.d.ts +68 -0
  446. package/dist/react-native/generated/src/operations/callMedia.d.ts.map +1 -0
  447. package/dist/react-native/generated/src/operations/callMedia.js +227 -0
  448. package/dist/react-native/generated/src/operations/callMedia.js.map +1 -0
  449. package/dist/react-native/generated/src/operations/callRecording.d.ts +43 -0
  450. package/dist/react-native/generated/src/operations/callRecording.d.ts.map +1 -0
  451. package/dist/react-native/generated/src/operations/callRecording.js +144 -0
  452. package/dist/react-native/generated/src/operations/callRecording.js.map +1 -0
  453. package/dist/react-native/generated/src/operations/index.d.ts +4 -0
  454. package/dist/react-native/generated/src/operations/index.d.ts.map +1 -0
  455. package/dist/react-native/generated/src/operations/index.js +11 -0
  456. package/dist/react-native/generated/src/operations/index.js.map +1 -0
  457. package/dist/react-native/generated/src/operationsInterfaces/callConnection.d.ts +73 -0
  458. package/dist/react-native/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -0
  459. package/dist/react-native/generated/src/operationsInterfaces/callConnection.js +9 -0
  460. package/dist/react-native/generated/src/operationsInterfaces/callConnection.js.map +1 -0
  461. package/dist/react-native/generated/src/operationsInterfaces/callMedia.d.ts +60 -0
  462. package/dist/react-native/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -0
  463. package/dist/react-native/generated/src/operationsInterfaces/callMedia.js +9 -0
  464. package/dist/react-native/generated/src/operationsInterfaces/callMedia.js.map +1 -0
  465. package/dist/react-native/generated/src/operationsInterfaces/callRecording.d.ts +35 -0
  466. package/dist/react-native/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -0
  467. package/dist/react-native/generated/src/operationsInterfaces/callRecording.js +9 -0
  468. package/dist/react-native/generated/src/operationsInterfaces/callRecording.js.map +1 -0
  469. package/dist/react-native/generated/src/operationsInterfaces/index.d.ts +4 -0
  470. package/dist/react-native/generated/src/operationsInterfaces/index.d.ts.map +1 -0
  471. package/dist/react-native/generated/src/operationsInterfaces/index.js +11 -0
  472. package/dist/react-native/generated/src/operationsInterfaces/index.js.map +1 -0
  473. package/dist/react-native/generated/src/pagingHelper.d.ts +13 -0
  474. package/dist/react-native/generated/src/pagingHelper.d.ts.map +1 -0
  475. package/dist/react-native/generated/src/pagingHelper.js +32 -0
  476. package/dist/react-native/generated/src/pagingHelper.js.map +1 -0
  477. package/dist/react-native/index.d.ts +10 -0
  478. package/dist/react-native/index.d.ts.map +1 -0
  479. package/dist/react-native/index.js +12 -0
  480. package/dist/react-native/index.js.map +1 -0
  481. package/dist/react-native/models/constants.d.ts +2 -0
  482. package/dist/react-native/models/constants.d.ts.map +1 -0
  483. package/dist/react-native/models/constants.js +4 -0
  484. package/dist/react-native/models/constants.js.map +1 -0
  485. package/dist/react-native/models/events.d.ts +395 -0
  486. package/dist/react-native/models/events.d.ts.map +1 -0
  487. package/dist/react-native/models/events.js +4 -0
  488. package/dist/react-native/models/events.js.map +1 -0
  489. package/dist/react-native/models/logger.d.ts +5 -0
  490. package/dist/react-native/models/logger.d.ts.map +1 -0
  491. package/dist/react-native/models/logger.js +8 -0
  492. package/dist/react-native/models/logger.js.map +1 -0
  493. package/dist/react-native/models/mapper.d.ts +3 -0
  494. package/dist/react-native/models/mapper.d.ts.map +1 -0
  495. package/dist/react-native/models/mapper.js +76 -0
  496. package/dist/react-native/models/mapper.js.map +1 -0
  497. package/dist/react-native/models/models.d.ts +188 -0
  498. package/dist/react-native/models/models.d.ts.map +1 -0
  499. package/dist/react-native/models/models.js +54 -0
  500. package/dist/react-native/models/models.js.map +1 -0
  501. package/dist/react-native/models/options.d.ts +315 -0
  502. package/dist/react-native/models/options.d.ts.map +1 -0
  503. package/dist/react-native/models/options.js +4 -0
  504. package/dist/react-native/models/options.js.map +1 -0
  505. package/dist/react-native/models/responses.d.ts +73 -0
  506. package/dist/react-native/models/responses.d.ts.map +1 -0
  507. package/dist/react-native/models/responses.js +4 -0
  508. package/dist/react-native/models/responses.js.map +1 -0
  509. package/dist/react-native/package.json +3 -0
  510. package/dist/react-native/utli/converters.d.ts +22 -0
  511. package/dist/react-native/utli/converters.d.ts.map +1 -0
  512. package/dist/react-native/utli/converters.js +142 -0
  513. package/dist/react-native/utli/converters.js.map +1 -0
  514. package/package.json +91 -53
  515. package/dist/index.js +0 -5763
  516. package/dist/index.js.map +0 -1
  517. package/dist-esm/src/callAutomationEventParser.js.map +0 -1
  518. package/dist-esm/src/callConnection.js.map +0 -1
  519. package/dist-esm/src/callRecording.js.map +0 -1
  520. package/dist-esm/src/contentDownloader.js.map +0 -1
  521. package/dist-esm/src/credential/callAutomationAccessKeyCredentialPolicy.js.map +0 -1
  522. package/dist-esm/src/credential/callAutomationAuthPolicy.js.map +0 -1
  523. package/dist-esm/src/credential/cryptoUtils.browser.js.map +0 -1
  524. package/dist-esm/src/generated/src/callAutomationApiClient.js.map +0 -1
  525. package/dist-esm/src/generated/src/index.js.map +0 -1
  526. package/dist-esm/src/generated/src/operations/callConnection.js.map +0 -1
  527. package/dist-esm/src/generated/src/operations/callMedia.js.map +0 -1
  528. package/dist-esm/src/generated/src/operations/callRecording.js.map +0 -1
  529. package/dist-esm/src/generated/src/operations/index.js.map +0 -1
  530. package/dist-esm/src/generated/src/operationsInterfaces/callConnection.js.map +0 -1
  531. package/dist-esm/src/generated/src/operationsInterfaces/callMedia.js.map +0 -1
  532. package/dist-esm/src/generated/src/operationsInterfaces/callRecording.js.map +0 -1
  533. package/dist-esm/src/generated/src/operationsInterfaces/index.js.map +0 -1
  534. package/dist-esm/src/index.js +0 -12
  535. package/dist-esm/src/index.js.map +0 -1
  536. package/dist-esm/src/models/events.js.map +0 -1
  537. package/dist-esm/src/models/models.js.map +0 -1
  538. package/dist-esm/src/models/options.js.map +0 -1
  539. package/dist-esm/src/models/responses.js.map +0 -1
  540. package/dist-esm/src/utli/converters.js.map +0 -1
  541. package/types/communication-call-automation.d.ts +0 -2014
  542. /package/{dist-esm/src → dist/browser}/contentDownloader.js +0 -0
  543. /package/{dist-esm/src → dist/browser}/credential/encodeUtils.browser.js +0 -0
  544. /package/{dist-esm/src → dist/browser}/credential/encodeUtils.browser.js.map +0 -0
  545. /package/{dist-esm/src → dist/browser}/generated/src/models/index.js +0 -0
  546. /package/{dist-esm/src → dist/browser}/generated/src/models/index.js.map +0 -0
  547. /package/{dist-esm/src → dist/browser}/generated/src/models/mappers.js +0 -0
  548. /package/{dist-esm/src → dist/browser}/generated/src/models/mappers.js.map +0 -0
  549. /package/{dist-esm/src → dist/browser}/generated/src/operationsInterfaces/callConnection.js +0 -0
  550. /package/{dist-esm/src → dist/browser}/generated/src/operationsInterfaces/callMedia.js +0 -0
  551. /package/{dist-esm/src → dist/browser}/generated/src/operationsInterfaces/callRecording.js +0 -0
  552. /package/{dist-esm/src → dist/browser}/generated/src/pagingHelper.js +0 -0
  553. /package/{dist-esm/src → dist/browser}/generated/src/pagingHelper.js.map +0 -0
  554. /package/{dist-esm/src → dist/browser}/models/constants.js +0 -0
  555. /package/{dist-esm/src → dist/browser}/models/constants.js.map +0 -0
  556. /package/{dist-esm/src → dist/browser}/models/events.js +0 -0
  557. /package/{dist-esm/src → dist/browser}/models/logger.js +0 -0
  558. /package/{dist-esm/src → dist/browser}/models/logger.js.map +0 -0
  559. /package/{dist-esm/src → dist/browser}/models/mapper.js +0 -0
  560. /package/{dist-esm/src → dist/browser}/models/mapper.js.map +0 -0
  561. /package/{dist-esm/src → dist/browser}/models/options.js +0 -0
  562. /package/{dist-esm/src → dist/browser}/models/responses.js +0 -0
@@ -0,0 +1,326 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.CallMedia = void 0;
6
+ const index_js_1 = require("./generated/src/index.js");
7
+ const index_js_2 = require("./generated/src/operations/index.js");
8
+ const communication_common_1 = require("@azure/communication-common");
9
+ const core_util_1 = require("@azure/core-util");
10
+ /**
11
+ * CallMedia class represents call media related APIs.
12
+ */
13
+ class CallMedia {
14
+ constructor(callConnectionId, endpoint, credential, options) {
15
+ this.callAutomationApiClient = new index_js_1.CallAutomationApiClient(endpoint, options);
16
+ const authPolicy = (0, communication_common_1.createCommunicationAuthPolicy)(credential);
17
+ this.callAutomationApiClient.pipeline.addPolicy(authPolicy);
18
+ this.callConnectionId = callConnectionId;
19
+ this.callMedia = new index_js_2.CallMediaImpl(this.callAutomationApiClient);
20
+ }
21
+ createPlaySourceInternal(playSource) {
22
+ if (playSource.kind === "fileSource") {
23
+ const fileSource = {
24
+ uri: playSource.url,
25
+ };
26
+ return {
27
+ kind: index_js_1.KnownPlaySourceType.File,
28
+ file: fileSource,
29
+ playSourceCacheId: playSource.playsourcacheid,
30
+ };
31
+ }
32
+ else if (playSource.kind === "textSource") {
33
+ const textSource = {
34
+ text: playSource.text,
35
+ sourceLocale: playSource.sourceLocale,
36
+ voiceKind: playSource.voiceKind,
37
+ voiceName: playSource.voiceName,
38
+ customVoiceEndpointId: playSource.customVoiceEndpointId,
39
+ };
40
+ return {
41
+ kind: index_js_1.KnownPlaySourceType.Text,
42
+ text: textSource,
43
+ playSourceCacheId: playSource.playsourcacheid,
44
+ };
45
+ }
46
+ else if (playSource.kind === "ssmlSource") {
47
+ const ssmlSource = {
48
+ ssmlText: playSource.ssmlText,
49
+ customVoiceEndpointId: playSource.customVoiceEndpointId,
50
+ };
51
+ return {
52
+ kind: index_js_1.KnownPlaySourceType.Ssml,
53
+ ssml: ssmlSource,
54
+ playSourceCacheId: playSource.playsourcacheid,
55
+ };
56
+ }
57
+ throw new Error("Invalid play source");
58
+ }
59
+ /**
60
+ * Play audio to a specific participant.
61
+ *
62
+ * @param playSources - A PlaySource representing the sources to play. Currently only single play source per request is supported.
63
+ * @param playTo - The targets to play to.
64
+ * @param options - Additional attributes for play.
65
+ */
66
+ async play(playSources, playTo, options = { loop: false }) {
67
+ const playRequest = {
68
+ playSources: playSources.map((source) => this.createPlaySourceInternal(source)),
69
+ playTo: playTo.map((identifier) => (0, communication_common_1.serializeCommunicationIdentifier)(identifier)),
70
+ playOptions: {
71
+ loop: false,
72
+ },
73
+ operationContext: options.operationContext,
74
+ operationCallbackUri: options.operationCallbackUrl,
75
+ };
76
+ if (options.loop !== undefined) {
77
+ playRequest.playOptions = playRequest.playOptions || { loop: false }; // Ensure playOptions is defined
78
+ playRequest.playOptions.loop = options.loop;
79
+ }
80
+ return this.callMedia.play(this.callConnectionId, playRequest, options);
81
+ }
82
+ /**
83
+ * Play to all participants.
84
+ *
85
+ * @param playSources - A PlaySource representing the sources to play. Currently only single play source per request is supported.
86
+ * @param options - Additional attributes for play.
87
+ */
88
+ async playToAll(playSources, options = { loop: false }) {
89
+ const playRequest = {
90
+ playSources: playSources.map((source) => this.createPlaySourceInternal(source)),
91
+ playTo: [],
92
+ playOptions: {
93
+ loop: false,
94
+ },
95
+ interruptCallMediaOperation: options.interruptCallMediaOperation !== undefined
96
+ ? options.interruptCallMediaOperation
97
+ : false,
98
+ operationContext: options.operationContext,
99
+ operationCallbackUri: options.operationCallbackUrl,
100
+ };
101
+ if (options.loop !== undefined) {
102
+ playRequest.playOptions = playRequest.playOptions || { loop: false }; // Ensure playOptions is defined
103
+ playRequest.playOptions.loop = options.loop;
104
+ }
105
+ return this.callMedia.play(this.callConnectionId, playRequest, options);
106
+ }
107
+ createRecognizeRequest(targetParticipant, recognizeOptions) {
108
+ if (recognizeOptions.kind === "callMediaRecognizeDtmfOptions") {
109
+ const dtmfOptionsInternal = {
110
+ interToneTimeoutInSeconds: recognizeOptions.interToneTimeoutInSeconds
111
+ ? recognizeOptions.interToneTimeoutInSeconds
112
+ : 2,
113
+ maxTonesToCollect: recognizeOptions.maxTonesToCollect,
114
+ stopTones: recognizeOptions.stopDtmfTones,
115
+ };
116
+ const recognizeOptionsInternal = {
117
+ interruptPrompt: recognizeOptions.interruptPrompt,
118
+ initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds
119
+ ? recognizeOptions.initialSilenceTimeoutInSeconds
120
+ : 5,
121
+ targetParticipant: (0, communication_common_1.serializeCommunicationIdentifier)(targetParticipant),
122
+ dtmfOptions: dtmfOptionsInternal,
123
+ };
124
+ return {
125
+ recognizeInputType: index_js_1.KnownRecognizeInputType.Dtmf,
126
+ playPrompt: recognizeOptions.playPrompt
127
+ ? this.createPlaySourceInternal(recognizeOptions.playPrompt)
128
+ : undefined,
129
+ playPrompts: recognizeOptions.playPrompts !== undefined
130
+ ? recognizeOptions.playPrompts.map((source) => this.createPlaySourceInternal(source))
131
+ : undefined,
132
+ interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,
133
+ recognizeOptions: recognizeOptionsInternal,
134
+ operationContext: recognizeOptions.operationContext,
135
+ operationCallbackUri: recognizeOptions.operationCallbackUrl,
136
+ };
137
+ }
138
+ else if (recognizeOptions.kind === "callMediaRecognizeChoiceOptions") {
139
+ const recognizeOptionsInternal = {
140
+ interruptPrompt: recognizeOptions.interruptPrompt,
141
+ initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds
142
+ ? recognizeOptions.initialSilenceTimeoutInSeconds
143
+ : 5,
144
+ targetParticipant: (0, communication_common_1.serializeCommunicationIdentifier)(targetParticipant),
145
+ speechLanguage: recognizeOptions.speechLanguage,
146
+ speechRecognitionModelEndpointId: recognizeOptions.speechRecognitionModelEndpointId,
147
+ choices: recognizeOptions.choices,
148
+ };
149
+ return {
150
+ recognizeInputType: index_js_1.KnownRecognizeInputType.Choices,
151
+ playPrompt: recognizeOptions.playPrompt
152
+ ? this.createPlaySourceInternal(recognizeOptions.playPrompt)
153
+ : undefined,
154
+ playPrompts: recognizeOptions.playPrompts !== undefined
155
+ ? recognizeOptions.playPrompts.map((source) => this.createPlaySourceInternal(source))
156
+ : undefined,
157
+ interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,
158
+ recognizeOptions: recognizeOptionsInternal,
159
+ operationContext: recognizeOptions.operationContext,
160
+ operationCallbackUri: recognizeOptions.operationCallbackUrl,
161
+ };
162
+ }
163
+ else if (recognizeOptions.kind === "callMediaRecognizeSpeechOptions") {
164
+ const speechOptions = {
165
+ endSilenceTimeoutInMs: recognizeOptions.endSilenceTimeoutInSeconds
166
+ ? recognizeOptions.endSilenceTimeoutInSeconds * 1000
167
+ : 2000,
168
+ };
169
+ const recognizeOptionsInternal = {
170
+ interruptPrompt: recognizeOptions.interruptPrompt,
171
+ initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds
172
+ ? recognizeOptions.initialSilenceTimeoutInSeconds
173
+ : 5,
174
+ targetParticipant: (0, communication_common_1.serializeCommunicationIdentifier)(targetParticipant),
175
+ speechOptions: speechOptions,
176
+ speechLanguage: recognizeOptions.speechLanguage,
177
+ speechRecognitionModelEndpointId: recognizeOptions.speechRecognitionModelEndpointId,
178
+ };
179
+ return {
180
+ recognizeInputType: index_js_1.KnownRecognizeInputType.Speech,
181
+ playPrompt: recognizeOptions.playPrompt
182
+ ? this.createPlaySourceInternal(recognizeOptions.playPrompt)
183
+ : undefined,
184
+ playPrompts: recognizeOptions.playPrompts !== undefined
185
+ ? recognizeOptions.playPrompts.map((source) => this.createPlaySourceInternal(source))
186
+ : undefined,
187
+ interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,
188
+ recognizeOptions: recognizeOptionsInternal,
189
+ operationContext: recognizeOptions.operationContext,
190
+ operationCallbackUri: recognizeOptions.operationCallbackUrl,
191
+ };
192
+ }
193
+ else if (recognizeOptions.kind === "callMediaRecognizeSpeechOrDtmfOptions") {
194
+ const dtmfOptionsInternal = {
195
+ interToneTimeoutInSeconds: recognizeOptions.interToneTimeoutInSeconds
196
+ ? recognizeOptions.interToneTimeoutInSeconds
197
+ : 2,
198
+ maxTonesToCollect: recognizeOptions.maxTonesToCollect,
199
+ stopTones: recognizeOptions.stopDtmfTones,
200
+ };
201
+ const speechOptions = {
202
+ endSilenceTimeoutInMs: recognizeOptions.endSilenceTimeoutInSeconds
203
+ ? recognizeOptions.endSilenceTimeoutInSeconds * 1000
204
+ : 2000,
205
+ };
206
+ const recognizeOptionsInternal = {
207
+ interruptPrompt: recognizeOptions.interruptPrompt,
208
+ initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds
209
+ ? recognizeOptions.initialSilenceTimeoutInSeconds
210
+ : 5,
211
+ targetParticipant: (0, communication_common_1.serializeCommunicationIdentifier)(targetParticipant),
212
+ speechOptions: speechOptions,
213
+ dtmfOptions: dtmfOptionsInternal,
214
+ speechRecognitionModelEndpointId: recognizeOptions.speechRecognitionModelEndpointId,
215
+ };
216
+ return {
217
+ recognizeInputType: index_js_1.KnownRecognizeInputType.SpeechOrDtmf,
218
+ playPrompt: recognizeOptions.playPrompt
219
+ ? this.createPlaySourceInternal(recognizeOptions.playPrompt)
220
+ : undefined,
221
+ playPrompts: recognizeOptions.playPrompts !== undefined
222
+ ? recognizeOptions.playPrompts.map((source) => this.createPlaySourceInternal(source))
223
+ : undefined,
224
+ interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,
225
+ recognizeOptions: recognizeOptionsInternal,
226
+ operationContext: recognizeOptions.operationContext,
227
+ operationCallbackUri: recognizeOptions.operationCallbackUrl,
228
+ };
229
+ }
230
+ throw new Error("Invalid recognizeOptions");
231
+ }
232
+ async startRecognizing(targetParticipant, maxTonesOrOptions, options) {
233
+ if (typeof maxTonesOrOptions === "number" && options) {
234
+ // Old function signature logic
235
+ console.warn("Deprecated function signature used. Please use the new signature with targetParticipant and options params instead, and set maxTonesToCollect in options.");
236
+ options.maxTonesToCollect = maxTonesOrOptions;
237
+ return this.callMedia.recognize(this.callConnectionId, this.createRecognizeRequest(targetParticipant, options), {});
238
+ }
239
+ else if (typeof maxTonesOrOptions !== "number" && !options) {
240
+ // New function signature logic
241
+ return this.callMedia.recognize(this.callConnectionId, this.createRecognizeRequest(targetParticipant, maxTonesOrOptions), {});
242
+ }
243
+ throw new Error("Invalid params");
244
+ }
245
+ /**
246
+ * Cancels all the queued media operations.
247
+ */
248
+ async cancelAllOperations() {
249
+ return this.callMedia.cancelAllMediaOperations(this.callConnectionId, {});
250
+ }
251
+ /**
252
+ * Start continuous Dtmf recognition by subscribing to tones.
253
+ * @param targetParticipant - Target participant.
254
+ * @param options - Additional attributes for continuous Dtmf recognition.
255
+ * */
256
+ async startContinuousDtmfRecognition(targetParticipant, options = {}) {
257
+ const continuousDtmfRecognitionRequest = {
258
+ targetParticipant: (0, communication_common_1.serializeCommunicationIdentifier)(targetParticipant),
259
+ operationContext: options.operationContext,
260
+ };
261
+ return this.callMedia.startContinuousDtmfRecognition(this.callConnectionId, continuousDtmfRecognitionRequest, {});
262
+ }
263
+ /**
264
+ * Stop continuous Dtmf recognition by unsubscribing to tones.
265
+ * @param targetParticipant - Target participant.
266
+ * @param options - Additional attributes for continuous Dtmf recognition.
267
+ * */
268
+ async stopContinuousDtmfRecognition(targetParticipant, options = {}) {
269
+ const continuousDtmfRecognitionRequest = {
270
+ targetParticipant: (0, communication_common_1.serializeCommunicationIdentifier)(targetParticipant),
271
+ operationContext: options.operationContext,
272
+ operationCallbackUri: options.operationCallbackUrl,
273
+ };
274
+ return this.callMedia.stopContinuousDtmfRecognition(this.callConnectionId, continuousDtmfRecognitionRequest, {});
275
+ }
276
+ /**
277
+ * Send Dtmf tones.
278
+ * @param tones - List of tones to be sent to target participant.
279
+ * @param targetParticipant - Target participant.
280
+ * @param options - Additional attributes for send Dtmf tones.
281
+ * */
282
+ async sendDtmfTones(tones, targetParticipant, options = {}) {
283
+ const sendDtmfTonesRequest = {
284
+ tones: tones,
285
+ targetParticipant: (0, communication_common_1.serializeCommunicationIdentifier)(targetParticipant),
286
+ operationContext: options.operationContext,
287
+ operationCallbackUri: options.operationCallbackUrl,
288
+ };
289
+ const optionsInternal = Object.assign(Object.assign({}, options), { repeatabilityFirstSent: new Date(), repeatabilityRequestID: (0, core_util_1.randomUUID)() });
290
+ const result = await this.callMedia.sendDtmfTones(this.callConnectionId, sendDtmfTonesRequest, optionsInternal);
291
+ const sendDtmfTonesResult = Object.assign({}, result);
292
+ return sendDtmfTonesResult;
293
+ }
294
+ /**
295
+ * Put participant on hold while playing audio.
296
+ *
297
+ * @param targetParticipant - The targets to play to.
298
+ * @param options - Additional attributes for hold participant.
299
+ */
300
+ async hold(targetParticipant, options = {}) {
301
+ const holdRequest = {
302
+ targetParticipant: (0, communication_common_1.serializeCommunicationIdentifier)(targetParticipant),
303
+ playSourceInfo: options.playSource !== undefined
304
+ ? this.createPlaySourceInternal(options.playSource)
305
+ : undefined,
306
+ operationContext: options.operationContext !== undefined ? options.operationContext : undefined,
307
+ operationCallbackUri: options.operationCallbackUrl !== undefined ? options.operationCallbackUrl : undefined,
308
+ };
309
+ return this.callMedia.hold(this.callConnectionId, holdRequest);
310
+ }
311
+ /**
312
+ * Remove participant from hold.
313
+ *
314
+ * @param targetParticipant - The targets to play to.
315
+ * @param options - Additional attributes for unhold participant.
316
+ */
317
+ async unhold(targetParticipant, options = {}) {
318
+ const unholdRequest = {
319
+ targetParticipant: (0, communication_common_1.serializeCommunicationIdentifier)(targetParticipant),
320
+ operationContext: options.operationContext !== undefined ? options.operationContext : undefined,
321
+ };
322
+ return this.callMedia.unhold(this.callConnectionId, unholdRequest);
323
+ }
324
+ }
325
+ exports.CallMedia = CallMedia;
326
+ //# sourceMappingURL=callMedia.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"callMedia.js","sourceRoot":"","sources":["../../src/callMedia.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAML,mBAAmB,EAEnB,uBAAuB,EAGvB,uBAAuB,GAQxB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAEL,6BAA6B,EAC7B,gCAAgC,GACjC,MAAM,6BAA6B,CAAC;AAiBrC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;GAEG;AACH,MAAM,OAAO,SAAS;IAIpB,YACE,gBAAwB,EACxB,QAAgB,EAChB,UAA2C,EAC3C,OAA+C;QAE/C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AC;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;IACrE,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n PlayRequest,\n PlaySourceInternal,\n FileSourceInternal,\n TextSourceInternal,\n SsmlSourceInternal,\n KnownPlaySourceType,\n RecognizeRequest,\n KnownRecognizeInputType,\n RecognizeOptions,\n DtmfOptions,\n CallAutomationApiClient,\n CallAutomationApiClientOptionalParams,\n ContinuousDtmfRecognitionRequest,\n SendDtmfTonesRequest,\n Tone,\n SpeechOptions,\n HoldRequest,\n UnholdRequest,\n} from \"./generated/src\";\n\nimport { CallMediaImpl } from \"./generated/src/operations\";\n\nimport {\n CommunicationIdentifier,\n createCommunicationAuthPolicy,\n serializeCommunicationIdentifier,\n} from \"@azure/communication-common\";\n\nimport { FileSource, TextSource, SsmlSource, DtmfTone } from \"./models/models\";\nimport {\n PlayOptions,\n PlayToAllOptions,\n CallMediaRecognizeDtmfOptions,\n CallMediaRecognizeChoiceOptions,\n ContinuousDtmfRecognitionOptions,\n SendDtmfTonesOptions,\n CallMediaRecognizeSpeechOptions,\n CallMediaRecognizeSpeechOrDtmfOptions,\n HoldOptions,\n UnholdOptions,\n} from \"./models/options\";\nimport { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { SendDtmfTonesResult } from \"./models/responses\";\nimport { randomUUID } from \"@azure/core-util\";\n\n/**\n * CallMedia class represents call media related APIs.\n */\nexport class CallMedia {\n private readonly callConnectionId: string;\n private readonly callMedia: CallMediaImpl;\n private readonly callAutomationApiClient: CallAutomationApiClient;\n constructor(\n callConnectionId: string,\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 this.callConnectionId = callConnectionId;\n this.callMedia = new CallMediaImpl(this.callAutomationApiClient);\n }\n\n private createPlaySourceInternal(\n playSource: FileSource | TextSource | SsmlSource,\n ): PlaySourceInternal {\n if (playSource.kind === \"fileSource\") {\n const fileSource: FileSourceInternal = {\n uri: playSource.url,\n };\n return {\n kind: KnownPlaySourceType.File,\n file: fileSource,\n playSourceCacheId: playSource.playsourcacheid,\n };\n } else if (playSource.kind === \"textSource\") {\n const textSource: TextSourceInternal = {\n text: playSource.text,\n sourceLocale: playSource.sourceLocale,\n voiceKind: playSource.voiceKind,\n voiceName: playSource.voiceName,\n customVoiceEndpointId: playSource.customVoiceEndpointId,\n };\n return {\n kind: KnownPlaySourceType.Text,\n text: textSource,\n playSourceCacheId: playSource.playsourcacheid,\n };\n } else if (playSource.kind === \"ssmlSource\") {\n const ssmlSource: SsmlSourceInternal = {\n ssmlText: playSource.ssmlText,\n customVoiceEndpointId: playSource.customVoiceEndpointId,\n };\n return {\n kind: KnownPlaySourceType.Ssml,\n ssml: ssmlSource,\n playSourceCacheId: playSource.playsourcacheid,\n };\n }\n throw new Error(\"Invalid play source\");\n }\n\n /**\n * Play audio to a specific participant.\n *\n * @param playSources - A PlaySource representing the sources to play. Currently only single play source per request is supported.\n * @param playTo - The targets to play to.\n * @param options - Additional attributes for play.\n */\n public async play(\n playSources: (FileSource | TextSource | SsmlSource)[],\n playTo: CommunicationIdentifier[],\n options: PlayOptions = { loop: false },\n ): Promise<void> {\n const playRequest: PlayRequest = {\n playSources: playSources.map((source) => this.createPlaySourceInternal(source)),\n playTo: playTo.map((identifier) => serializeCommunicationIdentifier(identifier)),\n playOptions: {\n loop: false,\n },\n operationContext: options.operationContext,\n operationCallbackUri: options.operationCallbackUrl,\n };\n\n if (options.loop !== undefined) {\n playRequest.playOptions = playRequest.playOptions || { loop: false }; // Ensure playOptions is defined\n playRequest.playOptions.loop = options.loop;\n }\n return this.callMedia.play(this.callConnectionId, playRequest, options);\n }\n\n /**\n * Play to all participants.\n *\n * @param playSources - A PlaySource representing the sources to play. Currently only single play source per request is supported.\n * @param options - Additional attributes for play.\n */\n public async playToAll(\n playSources: (FileSource | TextSource | SsmlSource)[],\n options: PlayToAllOptions = { loop: false },\n ): Promise<void> {\n const playRequest: PlayRequest = {\n playSources: playSources.map((source) => this.createPlaySourceInternal(source)),\n playTo: [],\n playOptions: {\n loop: false,\n },\n interruptCallMediaOperation:\n options.interruptCallMediaOperation !== undefined\n ? options.interruptCallMediaOperation\n : false,\n operationContext: options.operationContext,\n operationCallbackUri: options.operationCallbackUrl,\n };\n\n if (options.loop !== undefined) {\n playRequest.playOptions = playRequest.playOptions || { loop: false }; // Ensure playOptions is defined\n playRequest.playOptions.loop = options.loop;\n }\n return this.callMedia.play(this.callConnectionId, playRequest, options);\n }\n\n private createRecognizeRequest(\n targetParticipant: CommunicationIdentifier,\n recognizeOptions:\n | CallMediaRecognizeDtmfOptions\n | CallMediaRecognizeChoiceOptions\n | CallMediaRecognizeSpeechOptions\n | CallMediaRecognizeSpeechOrDtmfOptions,\n ): RecognizeRequest {\n if (recognizeOptions.kind === \"callMediaRecognizeDtmfOptions\") {\n const dtmfOptionsInternal: DtmfOptions = {\n interToneTimeoutInSeconds: recognizeOptions.interToneTimeoutInSeconds\n ? recognizeOptions.interToneTimeoutInSeconds\n : 2,\n maxTonesToCollect: recognizeOptions.maxTonesToCollect,\n stopTones: recognizeOptions.stopDtmfTones,\n };\n const recognizeOptionsInternal: RecognizeOptions = {\n interruptPrompt: recognizeOptions.interruptPrompt,\n initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds\n ? recognizeOptions.initialSilenceTimeoutInSeconds\n : 5,\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n dtmfOptions: dtmfOptionsInternal,\n };\n return {\n recognizeInputType: KnownRecognizeInputType.Dtmf,\n playPrompt: recognizeOptions.playPrompt\n ? this.createPlaySourceInternal(recognizeOptions.playPrompt)\n : undefined,\n playPrompts:\n recognizeOptions.playPrompts !== undefined\n ? recognizeOptions.playPrompts.map((source) => this.createPlaySourceInternal(source))\n : undefined,\n interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,\n recognizeOptions: recognizeOptionsInternal,\n operationContext: recognizeOptions.operationContext,\n operationCallbackUri: recognizeOptions.operationCallbackUrl,\n };\n } else if (recognizeOptions.kind === \"callMediaRecognizeChoiceOptions\") {\n const recognizeOptionsInternal: RecognizeOptions = {\n interruptPrompt: recognizeOptions.interruptPrompt,\n initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds\n ? recognizeOptions.initialSilenceTimeoutInSeconds\n : 5,\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n speechLanguage: recognizeOptions.speechLanguage,\n speechRecognitionModelEndpointId: recognizeOptions.speechRecognitionModelEndpointId,\n choices: recognizeOptions.choices,\n };\n return {\n recognizeInputType: KnownRecognizeInputType.Choices,\n playPrompt: recognizeOptions.playPrompt\n ? this.createPlaySourceInternal(recognizeOptions.playPrompt)\n : undefined,\n playPrompts:\n recognizeOptions.playPrompts !== undefined\n ? recognizeOptions.playPrompts.map((source) => this.createPlaySourceInternal(source))\n : undefined,\n interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,\n recognizeOptions: recognizeOptionsInternal,\n operationContext: recognizeOptions.operationContext,\n operationCallbackUri: recognizeOptions.operationCallbackUrl,\n };\n } else if (recognizeOptions.kind === \"callMediaRecognizeSpeechOptions\") {\n const speechOptions: SpeechOptions = {\n endSilenceTimeoutInMs: recognizeOptions.endSilenceTimeoutInSeconds\n ? recognizeOptions.endSilenceTimeoutInSeconds * 1000\n : 2000,\n };\n const recognizeOptionsInternal: RecognizeOptions = {\n interruptPrompt: recognizeOptions.interruptPrompt,\n initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds\n ? recognizeOptions.initialSilenceTimeoutInSeconds\n : 5,\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n speechOptions: speechOptions,\n speechLanguage: recognizeOptions.speechLanguage,\n speechRecognitionModelEndpointId: recognizeOptions.speechRecognitionModelEndpointId,\n };\n return {\n recognizeInputType: KnownRecognizeInputType.Speech,\n playPrompt: recognizeOptions.playPrompt\n ? this.createPlaySourceInternal(recognizeOptions.playPrompt)\n : undefined,\n playPrompts:\n recognizeOptions.playPrompts !== undefined\n ? recognizeOptions.playPrompts.map((source) => this.createPlaySourceInternal(source))\n : undefined,\n interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,\n recognizeOptions: recognizeOptionsInternal,\n operationContext: recognizeOptions.operationContext,\n operationCallbackUri: recognizeOptions.operationCallbackUrl,\n };\n } else if (recognizeOptions.kind === \"callMediaRecognizeSpeechOrDtmfOptions\") {\n const dtmfOptionsInternal: DtmfOptions = {\n interToneTimeoutInSeconds: recognizeOptions.interToneTimeoutInSeconds\n ? recognizeOptions.interToneTimeoutInSeconds\n : 2,\n maxTonesToCollect: recognizeOptions.maxTonesToCollect,\n stopTones: recognizeOptions.stopDtmfTones,\n };\n const speechOptions: SpeechOptions = {\n endSilenceTimeoutInMs: recognizeOptions.endSilenceTimeoutInSeconds\n ? recognizeOptions.endSilenceTimeoutInSeconds * 1000\n : 2000,\n };\n const recognizeOptionsInternal: RecognizeOptions = {\n interruptPrompt: recognizeOptions.interruptPrompt,\n initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds\n ? recognizeOptions.initialSilenceTimeoutInSeconds\n : 5,\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n speechOptions: speechOptions,\n dtmfOptions: dtmfOptionsInternal,\n speechRecognitionModelEndpointId: recognizeOptions.speechRecognitionModelEndpointId,\n };\n return {\n recognizeInputType: KnownRecognizeInputType.SpeechOrDtmf,\n playPrompt: recognizeOptions.playPrompt\n ? this.createPlaySourceInternal(recognizeOptions.playPrompt)\n : undefined,\n playPrompts:\n recognizeOptions.playPrompts !== undefined\n ? recognizeOptions.playPrompts.map((source) => this.createPlaySourceInternal(source))\n : undefined,\n interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,\n recognizeOptions: recognizeOptionsInternal,\n operationContext: recognizeOptions.operationContext,\n operationCallbackUri: recognizeOptions.operationCallbackUrl,\n };\n }\n throw new Error(\"Invalid recognizeOptions\");\n }\n\n /**\n * Recognize participant input.\n * @deprecated This method signature is deprecated. Please use the new signature with targetParticipant and options params instead, and set maxTonesToCollect in options.\n * @param targetParticipant - Target participant.\n * @param maxTonesToCollect - Maximum number of DTMF tones to be collected.\n * @param options - Different attributes for recognize.\n * */\n public async startRecognizing(\n targetParticipant: CommunicationIdentifier,\n maxTonesToCollect: number,\n options: CallMediaRecognizeDtmfOptions,\n ): Promise<void>;\n\n /**\n * Recognize participant input.\n * @param targetParticipant - Target participant.\n * @param options - Different attributes for recognize.\n * */\n public async startRecognizing(\n targetParticipant: CommunicationIdentifier,\n options:\n | CallMediaRecognizeDtmfOptions\n | CallMediaRecognizeChoiceOptions\n | CallMediaRecognizeSpeechOptions\n | CallMediaRecognizeSpeechOrDtmfOptions,\n ): Promise<void>;\n async startRecognizing(\n targetParticipant: CommunicationIdentifier,\n maxTonesOrOptions:\n | number\n | CallMediaRecognizeDtmfOptions\n | CallMediaRecognizeChoiceOptions\n | CallMediaRecognizeSpeechOptions\n | CallMediaRecognizeSpeechOrDtmfOptions,\n options?: CallMediaRecognizeDtmfOptions,\n ): Promise<void> {\n if (typeof maxTonesOrOptions === \"number\" && options) {\n // Old function signature logic\n console.warn(\n \"Deprecated function signature used. Please use the new signature with targetParticipant and options params instead, and set maxTonesToCollect in options.\",\n );\n options.maxTonesToCollect = maxTonesOrOptions;\n return this.callMedia.recognize(\n this.callConnectionId,\n this.createRecognizeRequest(targetParticipant, options),\n {},\n );\n } else if (typeof maxTonesOrOptions !== \"number\" && !options) {\n // New function signature logic\n return this.callMedia.recognize(\n this.callConnectionId,\n this.createRecognizeRequest(targetParticipant, maxTonesOrOptions),\n {},\n );\n }\n throw new Error(\"Invalid params\");\n }\n\n /**\n * Cancels all the queued media operations.\n */\n public async cancelAllOperations(): Promise<void> {\n return this.callMedia.cancelAllMediaOperations(this.callConnectionId, {});\n }\n\n /**\n * Start continuous Dtmf recognition by subscribing to tones.\n * @param targetParticipant - Target participant.\n * @param options - Additional attributes for continuous Dtmf recognition.\n * */\n public async startContinuousDtmfRecognition(\n targetParticipant: CommunicationIdentifier,\n options: ContinuousDtmfRecognitionOptions = {},\n ): Promise<void> {\n const continuousDtmfRecognitionRequest: ContinuousDtmfRecognitionRequest = {\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n operationContext: options.operationContext,\n };\n return this.callMedia.startContinuousDtmfRecognition(\n this.callConnectionId,\n continuousDtmfRecognitionRequest,\n {},\n );\n }\n\n /**\n * Stop continuous Dtmf recognition by unsubscribing to tones.\n * @param targetParticipant - Target participant.\n * @param options - Additional attributes for continuous Dtmf recognition.\n * */\n public async stopContinuousDtmfRecognition(\n targetParticipant: CommunicationIdentifier,\n options: ContinuousDtmfRecognitionOptions = {},\n ): Promise<void> {\n const continuousDtmfRecognitionRequest: ContinuousDtmfRecognitionRequest = {\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n operationContext: options.operationContext,\n operationCallbackUri: options.operationCallbackUrl,\n };\n return this.callMedia.stopContinuousDtmfRecognition(\n this.callConnectionId,\n continuousDtmfRecognitionRequest,\n {},\n );\n }\n\n /**\n * Send Dtmf tones.\n * @param tones - List of tones to be sent to target participant.\n * @param targetParticipant - Target participant.\n * @param options - Additional attributes for send Dtmf tones.\n * */\n public async sendDtmfTones(\n tones: Tone[] | DtmfTone[],\n targetParticipant: CommunicationIdentifier,\n options: SendDtmfTonesOptions = {},\n ): Promise<SendDtmfTonesResult> {\n const sendDtmfTonesRequest: SendDtmfTonesRequest = {\n tones: tones,\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n operationContext: options.operationContext,\n operationCallbackUri: options.operationCallbackUrl,\n };\n\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const result = await this.callMedia.sendDtmfTones(\n this.callConnectionId,\n sendDtmfTonesRequest,\n optionsInternal,\n );\n const sendDtmfTonesResult: SendDtmfTonesResult = {\n ...result,\n };\n return sendDtmfTonesResult;\n }\n\n /**\n * Put participant on hold while playing audio.\n *\n * @param targetParticipant - The targets to play to.\n * @param options - Additional attributes for hold participant.\n */\n public async hold(\n targetParticipant: CommunicationIdentifier,\n options: HoldOptions = {},\n ): Promise<void> {\n const holdRequest: HoldRequest = {\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n playSourceInfo:\n options.playSource !== undefined\n ? this.createPlaySourceInternal(options.playSource)\n : undefined,\n operationContext:\n options.operationContext !== undefined ? options.operationContext : undefined,\n operationCallbackUri:\n options.operationCallbackUrl !== undefined ? options.operationCallbackUrl : undefined,\n };\n return this.callMedia.hold(this.callConnectionId, holdRequest);\n }\n\n /**\n * Remove participant from hold.\n *\n * @param targetParticipant - The targets to play to.\n * @param options - Additional attributes for unhold participant.\n */\n public async unhold(\n targetParticipant: CommunicationIdentifier,\n options: UnholdOptions = {},\n ): Promise<void> {\n const unholdRequest: UnholdRequest = {\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n operationContext:\n options.operationContext !== undefined ? options.operationContext : undefined,\n };\n return this.callMedia.unhold(this.callConnectionId, unholdRequest);\n }\n}\n"]}
1
+ {"version":3,"file":"callMedia.js","sourceRoot":"","sources":["../../src/callMedia.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,uDAmBkC;AAElC,kEAAoE;AAEpE,sEAIqC;AAiBrC,gDAA8C;AAE9C;;GAEG;AACH,MAAa,SAAS;IAIpB,YACE,gBAAwB,EACxB,QAAgB,EAChB,UAA2C,EAC3C,OAA+C;QAE/C,IAAI,CAAC,uBAAuB,GAAG,IAAI,kCAAuB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC9E,MAAM,UAAU,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C,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;IACrE,CAAC;CACF;AA/aD,8BA+aC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n PlayRequest,\n PlaySourceInternal,\n FileSourceInternal,\n TextSourceInternal,\n SsmlSourceInternal,\n KnownPlaySourceType,\n RecognizeRequest,\n KnownRecognizeInputType,\n RecognizeOptions,\n DtmfOptions,\n CallAutomationApiClient,\n CallAutomationApiClientOptionalParams,\n ContinuousDtmfRecognitionRequest,\n SendDtmfTonesRequest,\n Tone,\n SpeechOptions,\n HoldRequest,\n UnholdRequest,\n} from \"./generated/src/index.js\";\n\nimport { CallMediaImpl } from \"./generated/src/operations/index.js\";\n\nimport {\n CommunicationIdentifier,\n createCommunicationAuthPolicy,\n serializeCommunicationIdentifier,\n} from \"@azure/communication-common\";\n\nimport { FileSource, TextSource, SsmlSource, DtmfTone } from \"./models/models.js\";\nimport {\n PlayOptions,\n PlayToAllOptions,\n CallMediaRecognizeDtmfOptions,\n CallMediaRecognizeChoiceOptions,\n ContinuousDtmfRecognitionOptions,\n SendDtmfTonesOptions,\n CallMediaRecognizeSpeechOptions,\n CallMediaRecognizeSpeechOrDtmfOptions,\n HoldOptions,\n UnholdOptions,\n} from \"./models/options.js\";\nimport { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { SendDtmfTonesResult } from \"./models/responses.js\";\nimport { randomUUID } from \"@azure/core-util\";\n\n/**\n * CallMedia class represents call media related APIs.\n */\nexport class CallMedia {\n private readonly callConnectionId: string;\n private readonly callMedia: CallMediaImpl;\n private readonly callAutomationApiClient: CallAutomationApiClient;\n constructor(\n callConnectionId: string,\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 this.callConnectionId = callConnectionId;\n this.callMedia = new CallMediaImpl(this.callAutomationApiClient);\n }\n\n private createPlaySourceInternal(\n playSource: FileSource | TextSource | SsmlSource,\n ): PlaySourceInternal {\n if (playSource.kind === \"fileSource\") {\n const fileSource: FileSourceInternal = {\n uri: playSource.url,\n };\n return {\n kind: KnownPlaySourceType.File,\n file: fileSource,\n playSourceCacheId: playSource.playsourcacheid,\n };\n } else if (playSource.kind === \"textSource\") {\n const textSource: TextSourceInternal = {\n text: playSource.text,\n sourceLocale: playSource.sourceLocale,\n voiceKind: playSource.voiceKind,\n voiceName: playSource.voiceName,\n customVoiceEndpointId: playSource.customVoiceEndpointId,\n };\n return {\n kind: KnownPlaySourceType.Text,\n text: textSource,\n playSourceCacheId: playSource.playsourcacheid,\n };\n } else if (playSource.kind === \"ssmlSource\") {\n const ssmlSource: SsmlSourceInternal = {\n ssmlText: playSource.ssmlText,\n customVoiceEndpointId: playSource.customVoiceEndpointId,\n };\n return {\n kind: KnownPlaySourceType.Ssml,\n ssml: ssmlSource,\n playSourceCacheId: playSource.playsourcacheid,\n };\n }\n throw new Error(\"Invalid play source\");\n }\n\n /**\n * Play audio to a specific participant.\n *\n * @param playSources - A PlaySource representing the sources to play. Currently only single play source per request is supported.\n * @param playTo - The targets to play to.\n * @param options - Additional attributes for play.\n */\n public async play(\n playSources: (FileSource | TextSource | SsmlSource)[],\n playTo: CommunicationIdentifier[],\n options: PlayOptions = { loop: false },\n ): Promise<void> {\n const playRequest: PlayRequest = {\n playSources: playSources.map((source) => this.createPlaySourceInternal(source)),\n playTo: playTo.map((identifier) => serializeCommunicationIdentifier(identifier)),\n playOptions: {\n loop: false,\n },\n operationContext: options.operationContext,\n operationCallbackUri: options.operationCallbackUrl,\n };\n\n if (options.loop !== undefined) {\n playRequest.playOptions = playRequest.playOptions || { loop: false }; // Ensure playOptions is defined\n playRequest.playOptions.loop = options.loop;\n }\n return this.callMedia.play(this.callConnectionId, playRequest, options);\n }\n\n /**\n * Play to all participants.\n *\n * @param playSources - A PlaySource representing the sources to play. Currently only single play source per request is supported.\n * @param options - Additional attributes for play.\n */\n public async playToAll(\n playSources: (FileSource | TextSource | SsmlSource)[],\n options: PlayToAllOptions = { loop: false },\n ): Promise<void> {\n const playRequest: PlayRequest = {\n playSources: playSources.map((source) => this.createPlaySourceInternal(source)),\n playTo: [],\n playOptions: {\n loop: false,\n },\n interruptCallMediaOperation:\n options.interruptCallMediaOperation !== undefined\n ? options.interruptCallMediaOperation\n : false,\n operationContext: options.operationContext,\n operationCallbackUri: options.operationCallbackUrl,\n };\n\n if (options.loop !== undefined) {\n playRequest.playOptions = playRequest.playOptions || { loop: false }; // Ensure playOptions is defined\n playRequest.playOptions.loop = options.loop;\n }\n return this.callMedia.play(this.callConnectionId, playRequest, options);\n }\n\n private createRecognizeRequest(\n targetParticipant: CommunicationIdentifier,\n recognizeOptions:\n | CallMediaRecognizeDtmfOptions\n | CallMediaRecognizeChoiceOptions\n | CallMediaRecognizeSpeechOptions\n | CallMediaRecognizeSpeechOrDtmfOptions,\n ): RecognizeRequest {\n if (recognizeOptions.kind === \"callMediaRecognizeDtmfOptions\") {\n const dtmfOptionsInternal: DtmfOptions = {\n interToneTimeoutInSeconds: recognizeOptions.interToneTimeoutInSeconds\n ? recognizeOptions.interToneTimeoutInSeconds\n : 2,\n maxTonesToCollect: recognizeOptions.maxTonesToCollect,\n stopTones: recognizeOptions.stopDtmfTones,\n };\n const recognizeOptionsInternal: RecognizeOptions = {\n interruptPrompt: recognizeOptions.interruptPrompt,\n initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds\n ? recognizeOptions.initialSilenceTimeoutInSeconds\n : 5,\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n dtmfOptions: dtmfOptionsInternal,\n };\n return {\n recognizeInputType: KnownRecognizeInputType.Dtmf,\n playPrompt: recognizeOptions.playPrompt\n ? this.createPlaySourceInternal(recognizeOptions.playPrompt)\n : undefined,\n playPrompts:\n recognizeOptions.playPrompts !== undefined\n ? recognizeOptions.playPrompts.map((source) => this.createPlaySourceInternal(source))\n : undefined,\n interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,\n recognizeOptions: recognizeOptionsInternal,\n operationContext: recognizeOptions.operationContext,\n operationCallbackUri: recognizeOptions.operationCallbackUrl,\n };\n } else if (recognizeOptions.kind === \"callMediaRecognizeChoiceOptions\") {\n const recognizeOptionsInternal: RecognizeOptions = {\n interruptPrompt: recognizeOptions.interruptPrompt,\n initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds\n ? recognizeOptions.initialSilenceTimeoutInSeconds\n : 5,\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n speechLanguage: recognizeOptions.speechLanguage,\n speechRecognitionModelEndpointId: recognizeOptions.speechRecognitionModelEndpointId,\n choices: recognizeOptions.choices,\n };\n return {\n recognizeInputType: KnownRecognizeInputType.Choices,\n playPrompt: recognizeOptions.playPrompt\n ? this.createPlaySourceInternal(recognizeOptions.playPrompt)\n : undefined,\n playPrompts:\n recognizeOptions.playPrompts !== undefined\n ? recognizeOptions.playPrompts.map((source) => this.createPlaySourceInternal(source))\n : undefined,\n interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,\n recognizeOptions: recognizeOptionsInternal,\n operationContext: recognizeOptions.operationContext,\n operationCallbackUri: recognizeOptions.operationCallbackUrl,\n };\n } else if (recognizeOptions.kind === \"callMediaRecognizeSpeechOptions\") {\n const speechOptions: SpeechOptions = {\n endSilenceTimeoutInMs: recognizeOptions.endSilenceTimeoutInSeconds\n ? recognizeOptions.endSilenceTimeoutInSeconds * 1000\n : 2000,\n };\n const recognizeOptionsInternal: RecognizeOptions = {\n interruptPrompt: recognizeOptions.interruptPrompt,\n initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds\n ? recognizeOptions.initialSilenceTimeoutInSeconds\n : 5,\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n speechOptions: speechOptions,\n speechLanguage: recognizeOptions.speechLanguage,\n speechRecognitionModelEndpointId: recognizeOptions.speechRecognitionModelEndpointId,\n };\n return {\n recognizeInputType: KnownRecognizeInputType.Speech,\n playPrompt: recognizeOptions.playPrompt\n ? this.createPlaySourceInternal(recognizeOptions.playPrompt)\n : undefined,\n playPrompts:\n recognizeOptions.playPrompts !== undefined\n ? recognizeOptions.playPrompts.map((source) => this.createPlaySourceInternal(source))\n : undefined,\n interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,\n recognizeOptions: recognizeOptionsInternal,\n operationContext: recognizeOptions.operationContext,\n operationCallbackUri: recognizeOptions.operationCallbackUrl,\n };\n } else if (recognizeOptions.kind === \"callMediaRecognizeSpeechOrDtmfOptions\") {\n const dtmfOptionsInternal: DtmfOptions = {\n interToneTimeoutInSeconds: recognizeOptions.interToneTimeoutInSeconds\n ? recognizeOptions.interToneTimeoutInSeconds\n : 2,\n maxTonesToCollect: recognizeOptions.maxTonesToCollect,\n stopTones: recognizeOptions.stopDtmfTones,\n };\n const speechOptions: SpeechOptions = {\n endSilenceTimeoutInMs: recognizeOptions.endSilenceTimeoutInSeconds\n ? recognizeOptions.endSilenceTimeoutInSeconds * 1000\n : 2000,\n };\n const recognizeOptionsInternal: RecognizeOptions = {\n interruptPrompt: recognizeOptions.interruptPrompt,\n initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds\n ? recognizeOptions.initialSilenceTimeoutInSeconds\n : 5,\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n speechOptions: speechOptions,\n dtmfOptions: dtmfOptionsInternal,\n speechRecognitionModelEndpointId: recognizeOptions.speechRecognitionModelEndpointId,\n };\n return {\n recognizeInputType: KnownRecognizeInputType.SpeechOrDtmf,\n playPrompt: recognizeOptions.playPrompt\n ? this.createPlaySourceInternal(recognizeOptions.playPrompt)\n : undefined,\n playPrompts:\n recognizeOptions.playPrompts !== undefined\n ? recognizeOptions.playPrompts.map((source) => this.createPlaySourceInternal(source))\n : undefined,\n interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,\n recognizeOptions: recognizeOptionsInternal,\n operationContext: recognizeOptions.operationContext,\n operationCallbackUri: recognizeOptions.operationCallbackUrl,\n };\n }\n throw new Error(\"Invalid recognizeOptions\");\n }\n\n /**\n * Recognize participant input.\n * @deprecated This method signature is deprecated. Please use the new signature with targetParticipant and options params instead, and set maxTonesToCollect in options.\n * @param targetParticipant - Target participant.\n * @param maxTonesToCollect - Maximum number of DTMF tones to be collected.\n * @param options - Different attributes for recognize.\n * */\n public async startRecognizing(\n targetParticipant: CommunicationIdentifier,\n maxTonesToCollect: number,\n options: CallMediaRecognizeDtmfOptions,\n ): Promise<void>;\n\n /**\n * Recognize participant input.\n * @param targetParticipant - Target participant.\n * @param options - Different attributes for recognize.\n * */\n public async startRecognizing(\n targetParticipant: CommunicationIdentifier,\n options:\n | CallMediaRecognizeDtmfOptions\n | CallMediaRecognizeChoiceOptions\n | CallMediaRecognizeSpeechOptions\n | CallMediaRecognizeSpeechOrDtmfOptions,\n ): Promise<void>;\n async startRecognizing(\n targetParticipant: CommunicationIdentifier,\n maxTonesOrOptions:\n | number\n | CallMediaRecognizeDtmfOptions\n | CallMediaRecognizeChoiceOptions\n | CallMediaRecognizeSpeechOptions\n | CallMediaRecognizeSpeechOrDtmfOptions,\n options?: CallMediaRecognizeDtmfOptions,\n ): Promise<void> {\n if (typeof maxTonesOrOptions === \"number\" && options) {\n // Old function signature logic\n console.warn(\n \"Deprecated function signature used. Please use the new signature with targetParticipant and options params instead, and set maxTonesToCollect in options.\",\n );\n options.maxTonesToCollect = maxTonesOrOptions;\n return this.callMedia.recognize(\n this.callConnectionId,\n this.createRecognizeRequest(targetParticipant, options),\n {},\n );\n } else if (typeof maxTonesOrOptions !== \"number\" && !options) {\n // New function signature logic\n return this.callMedia.recognize(\n this.callConnectionId,\n this.createRecognizeRequest(targetParticipant, maxTonesOrOptions),\n {},\n );\n }\n throw new Error(\"Invalid params\");\n }\n\n /**\n * Cancels all the queued media operations.\n */\n public async cancelAllOperations(): Promise<void> {\n return this.callMedia.cancelAllMediaOperations(this.callConnectionId, {});\n }\n\n /**\n * Start continuous Dtmf recognition by subscribing to tones.\n * @param targetParticipant - Target participant.\n * @param options - Additional attributes for continuous Dtmf recognition.\n * */\n public async startContinuousDtmfRecognition(\n targetParticipant: CommunicationIdentifier,\n options: ContinuousDtmfRecognitionOptions = {},\n ): Promise<void> {\n const continuousDtmfRecognitionRequest: ContinuousDtmfRecognitionRequest = {\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n operationContext: options.operationContext,\n };\n return this.callMedia.startContinuousDtmfRecognition(\n this.callConnectionId,\n continuousDtmfRecognitionRequest,\n {},\n );\n }\n\n /**\n * Stop continuous Dtmf recognition by unsubscribing to tones.\n * @param targetParticipant - Target participant.\n * @param options - Additional attributes for continuous Dtmf recognition.\n * */\n public async stopContinuousDtmfRecognition(\n targetParticipant: CommunicationIdentifier,\n options: ContinuousDtmfRecognitionOptions = {},\n ): Promise<void> {\n const continuousDtmfRecognitionRequest: ContinuousDtmfRecognitionRequest = {\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n operationContext: options.operationContext,\n operationCallbackUri: options.operationCallbackUrl,\n };\n return this.callMedia.stopContinuousDtmfRecognition(\n this.callConnectionId,\n continuousDtmfRecognitionRequest,\n {},\n );\n }\n\n /**\n * Send Dtmf tones.\n * @param tones - List of tones to be sent to target participant.\n * @param targetParticipant - Target participant.\n * @param options - Additional attributes for send Dtmf tones.\n * */\n public async sendDtmfTones(\n tones: Tone[] | DtmfTone[],\n targetParticipant: CommunicationIdentifier,\n options: SendDtmfTonesOptions = {},\n ): Promise<SendDtmfTonesResult> {\n const sendDtmfTonesRequest: SendDtmfTonesRequest = {\n tones: tones,\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n operationContext: options.operationContext,\n operationCallbackUri: options.operationCallbackUrl,\n };\n\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const result = await this.callMedia.sendDtmfTones(\n this.callConnectionId,\n sendDtmfTonesRequest,\n optionsInternal,\n );\n const sendDtmfTonesResult: SendDtmfTonesResult = {\n ...result,\n };\n return sendDtmfTonesResult;\n }\n\n /**\n * Put participant on hold while playing audio.\n *\n * @param targetParticipant - The targets to play to.\n * @param options - Additional attributes for hold participant.\n */\n public async hold(\n targetParticipant: CommunicationIdentifier,\n options: HoldOptions = {},\n ): Promise<void> {\n const holdRequest: HoldRequest = {\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n playSourceInfo:\n options.playSource !== undefined\n ? this.createPlaySourceInternal(options.playSource)\n : undefined,\n operationContext:\n options.operationContext !== undefined ? options.operationContext : undefined,\n operationCallbackUri:\n options.operationCallbackUrl !== undefined ? options.operationCallbackUrl : undefined,\n };\n return this.callMedia.hold(this.callConnectionId, holdRequest);\n }\n\n /**\n * Remove participant from hold.\n *\n * @param targetParticipant - The targets to play to.\n * @param options - Additional attributes for unhold participant.\n */\n public async unhold(\n targetParticipant: CommunicationIdentifier,\n options: UnholdOptions = {},\n ): Promise<void> {\n const unholdRequest: UnholdRequest = {\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n operationContext:\n options.operationContext !== undefined ? options.operationContext : undefined,\n };\n return this.callMedia.unhold(this.callConnectionId, unholdRequest);\n }\n}\n"]}
@@ -0,0 +1,70 @@
1
+ import { CallAutomationApiClientOptionalParams } from "./generated/src/models/index.js";
2
+ import { RecordingStateResult } from "./models/responses.js";
3
+ import { StartRecordingOptions, StopRecordingOptions, PauseRecordingOptions, GetRecordingPropertiesOptions, ResumeRecordingOptions, DeleteRecordingOptions, DownloadRecordingOptions } from "./models/options.js";
4
+ import { KeyCredential, TokenCredential } from "@azure/core-auth";
5
+ /**
6
+ * CallRecording class represents call recording related APIs.
7
+ */
8
+ export declare class CallRecording {
9
+ private readonly callRecordingImpl;
10
+ private readonly contentDownloader;
11
+ private readonly callAutomationApiClient;
12
+ constructor(endpoint: string, credential: KeyCredential | TokenCredential, options?: CallAutomationApiClientOptionalParams);
13
+ /**
14
+ * Starts a call recording with the specified options.
15
+ * @param startCallRecordingRequest - options to start the call recording
16
+ * @param options - Operation options.
17
+ */
18
+ start(options: StartRecordingOptions): Promise<RecordingStateResult>;
19
+ /**
20
+ * Returns call recording properties.
21
+ * @param recordingId - The recordingId associated with the recording.
22
+ * @param options - Additional request options contains getRecordingProperties api options.
23
+ */
24
+ getState(recordingId: string, options?: GetRecordingPropertiesOptions): Promise<RecordingStateResult>;
25
+ /**
26
+ * Stops a call recording.
27
+ * @param recordingId - The recordingId associated with the recording.
28
+ * @param options - Additional request options contains stopRecording api options.
29
+ */
30
+ stop(recordingId: string, options?: StopRecordingOptions): Promise<void>;
31
+ /**
32
+ * Pauses a call recording.
33
+ * @param recordingId - The recordingId associated with the recording.
34
+ * @param options - Additional request options contains pauseRecording api options.
35
+ */
36
+ pause(recordingId: string, options?: PauseRecordingOptions): Promise<void>;
37
+ /**
38
+ * Resumes a call recording.
39
+ * @param recordingId - The recordingId associated with the recording.
40
+ * @param options - Additional request options contains resumeRecording api options.
41
+ */
42
+ resume(recordingId: string, options?: ResumeRecordingOptions): Promise<void>;
43
+ /**
44
+ * Deletes a recording.
45
+ * @param recordingLocationUrl - The recording location url. Required.
46
+ * @param options - Additional request options contains deleteRecording api options.
47
+ */
48
+ delete(recordingLocationUrl: string, options?: DeleteRecordingOptions): Promise<void>;
49
+ /**
50
+ * Returns a stream with a call recording.
51
+ * @param sourceLocationUrl - The source location url. Required.
52
+ * @param options - Additional request options contains downloadRecording api options.
53
+ */
54
+ downloadStreaming(sourceLocationUrl: string, options?: DownloadRecordingOptions): Promise<NodeJS.ReadableStream>;
55
+ /**
56
+ * Downloads a call recording file to the specified stream.
57
+ * @param sourceLocationUrl - The source location url. Required.
58
+ * @param destinationStream - The destination stream. Required.
59
+ * @param options - Additional request options contains downloadRecording api options.
60
+ */
61
+ downloadToStream(sourceLocationUrl: string, destinationStream: NodeJS.WritableStream, options?: DownloadRecordingOptions): Promise<void>;
62
+ /**
63
+ * Downloads a call recording file to the specified path.
64
+ * @param sourceLocationUrl - The source location url. Required.
65
+ * @param destinationPath - The destination path. Required.
66
+ * @param options - Additional request options contains downloadRecording api options.
67
+ */
68
+ downloadToPath(sourceLocationUrl: string, destinationPath: string, options?: DownloadRecordingOptions): Promise<void>;
69
+ }
70
+ //# sourceMappingURL=callRecording.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"callRecording.d.ts","sourceRoot":"","sources":["../../src/callRecording.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,qCAAqC,EAEtC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,6BAA6B,EAC7B,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAIlE;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAoB;IACtD,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAwB;IAC1D,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAA0B;gBAGhE,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,aAAa,GAAG,eAAe,EAC3C,OAAO,CAAC,EAAE,qCAAqC;IASjD;;;;OAIG;IACU,KAAK,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA6DjF;;;;OAIG;IACU,QAAQ,CACnB,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,6BAAkC,GAC1C,OAAO,CAAC,oBAAoB,CAAC;IAYhC;;;;OAIG;IACU,IAAI,CAAC,WAAW,EAAE,MAA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