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

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 (492) hide show
  1. package/dist/commonjs/callAutomationClient.d.ts.map +1 -1
  2. package/dist/commonjs/callAutomationClient.js +328 -271
  3. package/dist/commonjs/callAutomationClient.js.map +7 -1
  4. package/dist/commonjs/callAutomationEventParser.d.ts.map +1 -1
  5. package/dist/commonjs/callAutomationEventParser.js +193 -184
  6. package/dist/commonjs/callAutomationEventParser.js.map +7 -1
  7. package/dist/commonjs/callConnection.d.ts +5 -5
  8. package/dist/commonjs/callConnection.d.ts.map +1 -1
  9. package/dist/commonjs/callConnection.js +339 -287
  10. package/dist/commonjs/callConnection.js.map +7 -1
  11. package/dist/commonjs/callMedia.d.ts +3 -8
  12. package/dist/commonjs/callMedia.d.ts.map +1 -1
  13. package/dist/commonjs/callMedia.js +402 -429
  14. package/dist/commonjs/callMedia.js.map +7 -1
  15. package/dist/commonjs/callRecording.js +214 -190
  16. package/dist/commonjs/callRecording.js.map +7 -1
  17. package/dist/commonjs/contentDownloader.d.ts +12 -0
  18. package/dist/commonjs/contentDownloader.d.ts.map +1 -1
  19. package/dist/commonjs/contentDownloader.js +139 -101
  20. package/dist/commonjs/contentDownloader.js.map +7 -1
  21. package/dist/commonjs/generated/src/callAutomationApiClient.d.ts +1 -1
  22. package/dist/commonjs/generated/src/callAutomationApiClient.js +258 -222
  23. package/dist/commonjs/generated/src/callAutomationApiClient.js.map +7 -1
  24. package/dist/commonjs/generated/src/index.js +36 -19
  25. package/dist/commonjs/generated/src/index.js.map +7 -1
  26. package/dist/commonjs/generated/src/models/index.d.ts +243 -457
  27. package/dist/commonjs/generated/src/models/index.d.ts.map +1 -1
  28. package/dist/commonjs/generated/src/models/index.js +278 -367
  29. package/dist/commonjs/generated/src/models/index.js.map +7 -1
  30. package/dist/commonjs/generated/src/models/mappers.d.ts +21 -26
  31. package/dist/commonjs/generated/src/models/mappers.d.ts.map +1 -1
  32. package/dist/commonjs/generated/src/models/mappers.js +4240 -4281
  33. package/dist/commonjs/generated/src/models/mappers.js.map +7 -1
  34. package/dist/commonjs/generated/src/models/parameters.d.ts +0 -1
  35. package/dist/commonjs/generated/src/models/parameters.d.ts.map +1 -1
  36. package/dist/commonjs/generated/src/models/parameters.js +287 -211
  37. package/dist/commonjs/generated/src/models/parameters.js.map +7 -1
  38. package/dist/commonjs/generated/src/operations/callConnection.d.ts +1 -1
  39. package/dist/commonjs/generated/src/operations/callConnection.js +454 -382
  40. package/dist/commonjs/generated/src/operations/callConnection.js.map +7 -1
  41. package/dist/commonjs/generated/src/operations/callMedia.d.ts +1 -8
  42. package/dist/commonjs/generated/src/operations/callMedia.d.ts.map +1 -1
  43. package/dist/commonjs/generated/src/operations/callMedia.js +394 -354
  44. package/dist/commonjs/generated/src/operations/callMedia.js.map +7 -1
  45. package/dist/commonjs/generated/src/operations/callRecording.js +180 -139
  46. package/dist/commonjs/generated/src/operations/callRecording.js.map +7 -1
  47. package/dist/commonjs/generated/src/operations/index.js +26 -14
  48. package/dist/commonjs/generated/src/operations/index.js.map +7 -1
  49. package/dist/commonjs/generated/src/operationsInterfaces/callConnection.d.ts +1 -1
  50. package/dist/commonjs/generated/src/operationsInterfaces/callConnection.js +16 -10
  51. package/dist/commonjs/generated/src/operationsInterfaces/callConnection.js.map +7 -1
  52. package/dist/commonjs/generated/src/operationsInterfaces/callMedia.d.ts +1 -8
  53. package/dist/commonjs/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
  54. package/dist/commonjs/generated/src/operationsInterfaces/callMedia.js +16 -10
  55. package/dist/commonjs/generated/src/operationsInterfaces/callMedia.js.map +7 -1
  56. package/dist/commonjs/generated/src/operationsInterfaces/callRecording.js +16 -10
  57. package/dist/commonjs/generated/src/operationsInterfaces/callRecording.js.map +7 -1
  58. package/dist/commonjs/generated/src/operationsInterfaces/index.js +26 -14
  59. package/dist/commonjs/generated/src/operationsInterfaces/index.js.map +7 -1
  60. package/dist/commonjs/generated/src/pagingHelper.js +40 -30
  61. package/dist/commonjs/generated/src/pagingHelper.js.map +7 -1
  62. package/dist/commonjs/index.d.ts +3 -3
  63. package/dist/commonjs/index.d.ts.map +1 -1
  64. package/dist/commonjs/index.js +36 -17
  65. package/dist/commonjs/index.js.map +7 -1
  66. package/dist/commonjs/models/events.d.ts +297 -237
  67. package/dist/commonjs/models/events.d.ts.map +1 -1
  68. package/dist/commonjs/models/events.js +16 -5
  69. package/dist/commonjs/models/events.js.map +7 -1
  70. package/dist/commonjs/models/logger.js +29 -11
  71. package/dist/commonjs/models/logger.js.map +7 -1
  72. package/dist/commonjs/models/mapper.js +99 -78
  73. package/dist/commonjs/models/mapper.js.map +7 -1
  74. package/dist/commonjs/models/models.d.ts +8 -29
  75. package/dist/commonjs/models/models.d.ts.map +1 -1
  76. package/dist/commonjs/models/models.js +68 -61
  77. package/dist/commonjs/models/models.js.map +7 -1
  78. package/dist/commonjs/models/options.d.ts +11 -65
  79. package/dist/commonjs/models/options.d.ts.map +1 -1
  80. package/dist/commonjs/models/options.js +16 -5
  81. package/dist/commonjs/models/options.js.map +7 -1
  82. package/dist/commonjs/models/responses.js +16 -5
  83. package/dist/commonjs/models/responses.js.map +7 -1
  84. package/dist/commonjs/models/streaming.d.ts +1 -12
  85. package/dist/commonjs/models/streaming.d.ts.map +1 -1
  86. package/dist/commonjs/models/streaming.js +55 -39
  87. package/dist/commonjs/models/streaming.js.map +7 -1
  88. package/dist/commonjs/streamingData.d.ts.map +1 -1
  89. package/dist/commonjs/streamingData.js +112 -99
  90. package/dist/commonjs/streamingData.js.map +7 -1
  91. package/dist/commonjs/tsdoc-metadata.json +1 -1
  92. package/dist/commonjs/utli/converters.d.ts.map +1 -1
  93. package/dist/commonjs/utli/converters.js +285 -275
  94. package/dist/commonjs/utli/converters.js.map +7 -1
  95. package/dist/commonjs/utli/recordingUrlValidator.d.ts +9 -0
  96. package/dist/commonjs/utli/recordingUrlValidator.d.ts.map +1 -0
  97. package/dist/commonjs/utli/recordingUrlValidator.js +56 -0
  98. package/dist/commonjs/utli/recordingUrlValidator.js.map +7 -0
  99. package/dist/esm/callAutomationClient.d.ts.map +1 -1
  100. package/dist/esm/callAutomationClient.js +1 -4
  101. package/dist/esm/callAutomationClient.js.map +1 -1
  102. package/dist/esm/callAutomationEventParser.d.ts.map +1 -1
  103. package/dist/esm/callAutomationEventParser.js +8 -15
  104. package/dist/esm/callAutomationEventParser.js.map +1 -1
  105. package/dist/esm/callConnection.d.ts +5 -5
  106. package/dist/esm/callConnection.d.ts.map +1 -1
  107. package/dist/esm/callConnection.js +11 -10
  108. package/dist/esm/callConnection.js.map +1 -1
  109. package/dist/esm/callMedia.d.ts +3 -8
  110. package/dist/esm/callMedia.d.ts.map +1 -1
  111. package/dist/esm/callMedia.js +7 -35
  112. package/dist/esm/callMedia.js.map +1 -1
  113. package/dist/esm/contentDownloader.d.ts +12 -0
  114. package/dist/esm/contentDownloader.d.ts.map +1 -1
  115. package/dist/esm/contentDownloader.js +37 -8
  116. package/dist/esm/contentDownloader.js.map +1 -1
  117. package/dist/esm/generated/src/callAutomationApiClient.d.ts +1 -1
  118. package/dist/esm/generated/src/callAutomationApiClient.js +3 -3
  119. package/dist/esm/generated/src/callAutomationApiClient.js.map +1 -1
  120. package/dist/esm/generated/src/models/index.d.ts +243 -457
  121. package/dist/esm/generated/src/models/index.d.ts.map +1 -1
  122. package/dist/esm/generated/src/models/index.js +28 -40
  123. package/dist/esm/generated/src/models/index.js.map +1 -1
  124. package/dist/esm/generated/src/models/mappers.d.ts +21 -26
  125. package/dist/esm/generated/src/models/mappers.d.ts.map +1 -1
  126. package/dist/esm/generated/src/models/mappers.js +327 -602
  127. package/dist/esm/generated/src/models/mappers.js.map +1 -1
  128. package/dist/esm/generated/src/models/parameters.d.ts +0 -1
  129. package/dist/esm/generated/src/models/parameters.d.ts.map +1 -1
  130. package/dist/esm/generated/src/models/parameters.js +2 -6
  131. package/dist/esm/generated/src/models/parameters.js.map +1 -1
  132. package/dist/esm/generated/src/operations/callConnection.d.ts +1 -1
  133. package/dist/esm/generated/src/operations/callConnection.js +1 -1
  134. package/dist/esm/generated/src/operations/callConnection.js.map +1 -1
  135. package/dist/esm/generated/src/operations/callMedia.d.ts +1 -8
  136. package/dist/esm/generated/src/operations/callMedia.d.ts.map +1 -1
  137. package/dist/esm/generated/src/operations/callMedia.js +0 -25
  138. package/dist/esm/generated/src/operations/callMedia.js.map +1 -1
  139. package/dist/esm/generated/src/operationsInterfaces/callConnection.d.ts +1 -1
  140. package/dist/esm/generated/src/operationsInterfaces/callConnection.js.map +1 -1
  141. package/dist/esm/generated/src/operationsInterfaces/callMedia.d.ts +1 -8
  142. package/dist/esm/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
  143. package/dist/esm/generated/src/operationsInterfaces/callMedia.js.map +1 -1
  144. package/dist/esm/index.d.ts +3 -3
  145. package/dist/esm/index.d.ts.map +1 -1
  146. package/dist/esm/index.js +0 -3
  147. package/dist/esm/index.js.map +1 -1
  148. package/dist/esm/models/events.d.ts +297 -237
  149. package/dist/esm/models/events.d.ts.map +1 -1
  150. package/dist/esm/models/events.js.map +1 -1
  151. package/dist/esm/models/models.d.ts +8 -29
  152. package/dist/esm/models/models.d.ts.map +1 -1
  153. package/dist/esm/models/models.js.map +1 -1
  154. package/dist/esm/models/options.d.ts +11 -65
  155. package/dist/esm/models/options.d.ts.map +1 -1
  156. package/dist/esm/models/options.js.map +1 -1
  157. package/dist/esm/models/streaming.d.ts +1 -12
  158. package/dist/esm/models/streaming.d.ts.map +1 -1
  159. package/dist/esm/models/streaming.js.map +1 -1
  160. package/dist/esm/streamingData.d.ts.map +1 -1
  161. package/dist/esm/streamingData.js +0 -5
  162. package/dist/esm/streamingData.js.map +1 -1
  163. package/dist/esm/utli/converters.d.ts.map +1 -1
  164. package/dist/esm/utli/converters.js +1 -1
  165. package/dist/esm/utli/converters.js.map +1 -1
  166. package/dist/esm/utli/recordingUrlValidator.d.ts +9 -0
  167. package/dist/esm/utli/recordingUrlValidator.d.ts.map +1 -0
  168. package/dist/esm/utli/recordingUrlValidator.js +45 -0
  169. package/dist/esm/utli/recordingUrlValidator.js.map +1 -0
  170. package/package.json +37 -50
  171. package/dist/browser/callAutomationClient.d.ts +0 -98
  172. package/dist/browser/callAutomationClient.d.ts.map +0 -1
  173. package/dist/browser/callAutomationClient.js +0 -275
  174. package/dist/browser/callAutomationClient.js.map +0 -1
  175. package/dist/browser/callAutomationEventParser.d.ts +0 -6
  176. package/dist/browser/callAutomationEventParser.d.ts.map +0 -1
  177. package/dist/browser/callAutomationEventParser.js +0 -189
  178. package/dist/browser/callAutomationEventParser.js.map +0 -1
  179. package/dist/browser/callConnection.d.ts +0 -83
  180. package/dist/browser/callConnection.d.ts.map +0 -1
  181. package/dist/browser/callConnection.js +0 -289
  182. package/dist/browser/callConnection.js.map +0 -1
  183. package/dist/browser/callMedia.d.ts +0 -114
  184. package/dist/browser/callMedia.d.ts.map +0 -1
  185. package/dist/browser/callMedia.js +0 -433
  186. package/dist/browser/callMedia.js.map +0 -1
  187. package/dist/browser/callRecording.d.ts +0 -70
  188. package/dist/browser/callRecording.d.ts.map +0 -1
  189. package/dist/browser/callRecording.js +0 -195
  190. package/dist/browser/callRecording.js.map +0 -1
  191. package/dist/browser/contentDownloader.d.ts +0 -25
  192. package/dist/browser/contentDownloader.d.ts.map +0 -1
  193. package/dist/browser/contentDownloader.js +0 -103
  194. package/dist/browser/contentDownloader.js.map +0 -1
  195. package/dist/browser/credential/callAutomationAccessKeyCredentialPolicy.d.ts +0 -10
  196. package/dist/browser/credential/callAutomationAccessKeyCredentialPolicy.d.ts.map +0 -1
  197. package/dist/browser/credential/callAutomationAccessKeyCredentialPolicy.js +0 -38
  198. package/dist/browser/credential/callAutomationAccessKeyCredentialPolicy.js.map +0 -1
  199. package/dist/browser/credential/callAutomationAuthPolicy.d.ts +0 -22
  200. package/dist/browser/credential/callAutomationAuthPolicy.d.ts.map +0 -1
  201. package/dist/browser/credential/callAutomationAuthPolicy.js +0 -53
  202. package/dist/browser/credential/callAutomationAuthPolicy.js.map +0 -1
  203. package/dist/browser/credential/cryptoUtils-browser.d.mts.map +0 -1
  204. package/dist/browser/credential/cryptoUtils-browser.mjs.map +0 -1
  205. package/dist/browser/credential/cryptoUtils.d.ts +0 -3
  206. package/dist/browser/credential/cryptoUtils.js +0 -20
  207. package/dist/browser/credential/encodeUtils.browser.d.ts +0 -4
  208. package/dist/browser/credential/encodeUtils.browser.d.ts.map +0 -1
  209. package/dist/browser/credential/encodeUtils.browser.js +0 -26
  210. package/dist/browser/credential/encodeUtils.browser.js.map +0 -1
  211. package/dist/browser/generated/src/callAutomationApiClient.d.ts +0 -49
  212. package/dist/browser/generated/src/callAutomationApiClient.d.ts.map +0 -1
  213. package/dist/browser/generated/src/callAutomationApiClient.js +0 -235
  214. package/dist/browser/generated/src/callAutomationApiClient.js.map +0 -1
  215. package/dist/browser/generated/src/index.d.ts +0 -5
  216. package/dist/browser/generated/src/index.d.ts.map +0 -1
  217. package/dist/browser/generated/src/index.js +0 -13
  218. package/dist/browser/generated/src/index.js.map +0 -1
  219. package/dist/browser/generated/src/models/index.d.ts +0 -2342
  220. package/dist/browser/generated/src/models/index.d.ts.map +0 -1
  221. package/dist/browser/generated/src/models/index.js +0 -364
  222. package/dist/browser/generated/src/models/index.js.map +0 -1
  223. package/dist/browser/generated/src/models/mappers.d.ts +0 -123
  224. package/dist/browser/generated/src/models/mappers.d.ts.map +0 -1
  225. package/dist/browser/generated/src/models/mappers.js +0 -4395
  226. package/dist/browser/generated/src/models/mappers.js.map +0 -1
  227. package/dist/browser/generated/src/models/parameters.d.ts +0 -36
  228. package/dist/browser/generated/src/models/parameters.d.ts.map +0 -1
  229. package/dist/browser/generated/src/models/parameters.js +0 -208
  230. package/dist/browser/generated/src/models/parameters.js.map +0 -1
  231. package/dist/browser/generated/src/operations/callConnection.d.ts +0 -103
  232. package/dist/browser/generated/src/operations/callConnection.d.ts.map +0 -1
  233. package/dist/browser/generated/src/operations/callConnection.js +0 -417
  234. package/dist/browser/generated/src/operations/callConnection.js.map +0 -1
  235. package/dist/browser/generated/src/operations/callMedia.d.ts +0 -110
  236. package/dist/browser/generated/src/operations/callMedia.d.ts.map +0 -1
  237. package/dist/browser/generated/src/operations/callMedia.js +0 -378
  238. package/dist/browser/generated/src/operations/callMedia.js.map +0 -1
  239. package/dist/browser/generated/src/operations/callRecording.d.ts +0 -43
  240. package/dist/browser/generated/src/operations/callRecording.d.ts.map +0 -1
  241. package/dist/browser/generated/src/operations/callRecording.js +0 -148
  242. package/dist/browser/generated/src/operations/callRecording.js.map +0 -1
  243. package/dist/browser/generated/src/operations/index.d.ts +0 -4
  244. package/dist/browser/generated/src/operations/index.d.ts.map +0 -1
  245. package/dist/browser/generated/src/operations/index.js +0 -11
  246. package/dist/browser/generated/src/operations/index.js.map +0 -1
  247. package/dist/browser/generated/src/operationsInterfaces/callConnection.d.ts +0 -80
  248. package/dist/browser/generated/src/operationsInterfaces/callConnection.d.ts.map +0 -1
  249. package/dist/browser/generated/src/operationsInterfaces/callConnection.js +0 -9
  250. package/dist/browser/generated/src/operationsInterfaces/callConnection.js.map +0 -1
  251. package/dist/browser/generated/src/operationsInterfaces/callMedia.d.ts +0 -102
  252. package/dist/browser/generated/src/operationsInterfaces/callMedia.d.ts.map +0 -1
  253. package/dist/browser/generated/src/operationsInterfaces/callMedia.js +0 -9
  254. package/dist/browser/generated/src/operationsInterfaces/callMedia.js.map +0 -1
  255. package/dist/browser/generated/src/operationsInterfaces/callRecording.d.ts +0 -35
  256. package/dist/browser/generated/src/operationsInterfaces/callRecording.d.ts.map +0 -1
  257. package/dist/browser/generated/src/operationsInterfaces/callRecording.js +0 -9
  258. package/dist/browser/generated/src/operationsInterfaces/callRecording.js.map +0 -1
  259. package/dist/browser/generated/src/operationsInterfaces/index.d.ts +0 -4
  260. package/dist/browser/generated/src/operationsInterfaces/index.d.ts.map +0 -1
  261. package/dist/browser/generated/src/operationsInterfaces/index.js +0 -11
  262. package/dist/browser/generated/src/operationsInterfaces/index.js.map +0 -1
  263. package/dist/browser/generated/src/pagingHelper.d.ts +0 -13
  264. package/dist/browser/generated/src/pagingHelper.d.ts.map +0 -1
  265. package/dist/browser/generated/src/pagingHelper.js +0 -30
  266. package/dist/browser/generated/src/pagingHelper.js.map +0 -1
  267. package/dist/browser/index.d.ts +0 -12
  268. package/dist/browser/index.d.ts.map +0 -1
  269. package/dist/browser/index.js +0 -14
  270. package/dist/browser/index.js.map +0 -1
  271. package/dist/browser/models/constants.d.ts +0 -2
  272. package/dist/browser/models/constants.d.ts.map +0 -1
  273. package/dist/browser/models/constants.js +0 -4
  274. package/dist/browser/models/constants.js.map +0 -1
  275. package/dist/browser/models/events.d.ts +0 -689
  276. package/dist/browser/models/events.d.ts.map +0 -1
  277. package/dist/browser/models/events.js +0 -4
  278. package/dist/browser/models/events.js.map +0 -1
  279. package/dist/browser/models/logger.d.ts +0 -5
  280. package/dist/browser/models/logger.d.ts.map +0 -1
  281. package/dist/browser/models/logger.js +0 -8
  282. package/dist/browser/models/logger.js.map +0 -1
  283. package/dist/browser/models/mapper.d.ts +0 -3
  284. package/dist/browser/models/mapper.d.ts.map +0 -1
  285. package/dist/browser/models/mapper.js +0 -76
  286. package/dist/browser/models/mapper.js.map +0 -1
  287. package/dist/browser/models/models.d.ts +0 -305
  288. package/dist/browser/models/models.d.ts.map +0 -1
  289. package/dist/browser/models/models.js +0 -54
  290. package/dist/browser/models/models.js.map +0 -1
  291. package/dist/browser/models/options.d.ts +0 -463
  292. package/dist/browser/models/options.d.ts.map +0 -1
  293. package/dist/browser/models/options.js +0 -4
  294. package/dist/browser/models/options.js.map +0 -1
  295. package/dist/browser/models/responses.d.ts +0 -81
  296. package/dist/browser/models/responses.d.ts.map +0 -1
  297. package/dist/browser/models/responses.js +0 -4
  298. package/dist/browser/models/responses.js.map +0 -1
  299. package/dist/browser/models/streaming.d.ts +0 -128
  300. package/dist/browser/models/streaming.d.ts.map +0 -1
  301. package/dist/browser/models/streaming.js +0 -38
  302. package/dist/browser/models/streaming.js.map +0 -1
  303. package/dist/browser/package.json +0 -3
  304. package/dist/browser/streamingData.d.ts +0 -13
  305. package/dist/browser/streamingData.d.ts.map +0 -1
  306. package/dist/browser/streamingData.js +0 -99
  307. package/dist/browser/streamingData.js.map +0 -1
  308. package/dist/browser/utli/converters.d.ts +0 -46
  309. package/dist/browser/utli/converters.d.ts.map +0 -1
  310. package/dist/browser/utli/converters.js +0 -294
  311. package/dist/browser/utli/converters.js.map +0 -1
  312. package/dist/commonjs/credential/callAutomationAccessKeyCredentialPolicy.d.ts +0 -10
  313. package/dist/commonjs/credential/callAutomationAccessKeyCredentialPolicy.d.ts.map +0 -1
  314. package/dist/commonjs/credential/callAutomationAccessKeyCredentialPolicy.js +0 -41
  315. package/dist/commonjs/credential/callAutomationAccessKeyCredentialPolicy.js.map +0 -1
  316. package/dist/commonjs/credential/callAutomationAuthPolicy.d.ts +0 -22
  317. package/dist/commonjs/credential/callAutomationAuthPolicy.d.ts.map +0 -1
  318. package/dist/commonjs/credential/callAutomationAuthPolicy.js +0 -57
  319. package/dist/commonjs/credential/callAutomationAuthPolicy.js.map +0 -1
  320. package/dist/commonjs/credential/cryptoUtils.d.ts +0 -3
  321. package/dist/commonjs/credential/cryptoUtils.d.ts.map +0 -1
  322. package/dist/commonjs/credential/cryptoUtils.js +0 -14
  323. package/dist/commonjs/credential/cryptoUtils.js.map +0 -1
  324. package/dist/commonjs/credential/encodeUtils.browser.d.ts +0 -4
  325. package/dist/commonjs/credential/encodeUtils.browser.d.ts.map +0 -1
  326. package/dist/commonjs/credential/encodeUtils.browser.js +0 -32
  327. package/dist/commonjs/credential/encodeUtils.browser.js.map +0 -1
  328. package/dist/commonjs/models/constants.d.ts +0 -2
  329. package/dist/commonjs/models/constants.d.ts.map +0 -1
  330. package/dist/commonjs/models/constants.js +0 -7
  331. package/dist/commonjs/models/constants.js.map +0 -1
  332. package/dist/esm/credential/callAutomationAccessKeyCredentialPolicy.d.ts +0 -10
  333. package/dist/esm/credential/callAutomationAccessKeyCredentialPolicy.d.ts.map +0 -1
  334. package/dist/esm/credential/callAutomationAccessKeyCredentialPolicy.js +0 -38
  335. package/dist/esm/credential/callAutomationAccessKeyCredentialPolicy.js.map +0 -1
  336. package/dist/esm/credential/callAutomationAuthPolicy.d.ts +0 -22
  337. package/dist/esm/credential/callAutomationAuthPolicy.d.ts.map +0 -1
  338. package/dist/esm/credential/callAutomationAuthPolicy.js +0 -53
  339. package/dist/esm/credential/callAutomationAuthPolicy.js.map +0 -1
  340. package/dist/esm/credential/cryptoUtils.d.ts +0 -3
  341. package/dist/esm/credential/cryptoUtils.d.ts.map +0 -1
  342. package/dist/esm/credential/cryptoUtils.js +0 -9
  343. package/dist/esm/credential/cryptoUtils.js.map +0 -1
  344. package/dist/esm/credential/encodeUtils.browser.d.ts +0 -4
  345. package/dist/esm/credential/encodeUtils.browser.d.ts.map +0 -1
  346. package/dist/esm/credential/encodeUtils.browser.js +0 -26
  347. package/dist/esm/credential/encodeUtils.browser.js.map +0 -1
  348. package/dist/esm/models/constants.d.ts +0 -2
  349. package/dist/esm/models/constants.d.ts.map +0 -1
  350. package/dist/esm/models/constants.js +0 -4
  351. package/dist/esm/models/constants.js.map +0 -1
  352. package/dist/react-native/callAutomationClient.d.ts +0 -98
  353. package/dist/react-native/callAutomationClient.d.ts.map +0 -1
  354. package/dist/react-native/callAutomationClient.js +0 -275
  355. package/dist/react-native/callAutomationClient.js.map +0 -1
  356. package/dist/react-native/callAutomationEventParser.d.ts +0 -6
  357. package/dist/react-native/callAutomationEventParser.d.ts.map +0 -1
  358. package/dist/react-native/callAutomationEventParser.js +0 -189
  359. package/dist/react-native/callAutomationEventParser.js.map +0 -1
  360. package/dist/react-native/callConnection.d.ts +0 -83
  361. package/dist/react-native/callConnection.d.ts.map +0 -1
  362. package/dist/react-native/callConnection.js +0 -289
  363. package/dist/react-native/callConnection.js.map +0 -1
  364. package/dist/react-native/callMedia.d.ts +0 -114
  365. package/dist/react-native/callMedia.d.ts.map +0 -1
  366. package/dist/react-native/callMedia.js +0 -433
  367. package/dist/react-native/callMedia.js.map +0 -1
  368. package/dist/react-native/callRecording.d.ts +0 -70
  369. package/dist/react-native/callRecording.d.ts.map +0 -1
  370. package/dist/react-native/callRecording.js +0 -195
  371. package/dist/react-native/callRecording.js.map +0 -1
  372. package/dist/react-native/contentDownloader.d.ts +0 -25
  373. package/dist/react-native/contentDownloader.d.ts.map +0 -1
  374. package/dist/react-native/contentDownloader.js +0 -103
  375. package/dist/react-native/contentDownloader.js.map +0 -1
  376. package/dist/react-native/credential/callAutomationAccessKeyCredentialPolicy.d.ts +0 -10
  377. package/dist/react-native/credential/callAutomationAccessKeyCredentialPolicy.d.ts.map +0 -1
  378. package/dist/react-native/credential/callAutomationAccessKeyCredentialPolicy.js +0 -38
  379. package/dist/react-native/credential/callAutomationAccessKeyCredentialPolicy.js.map +0 -1
  380. package/dist/react-native/credential/callAutomationAuthPolicy.d.ts +0 -22
  381. package/dist/react-native/credential/callAutomationAuthPolicy.d.ts.map +0 -1
  382. package/dist/react-native/credential/callAutomationAuthPolicy.js +0 -53
  383. package/dist/react-native/credential/callAutomationAuthPolicy.js.map +0 -1
  384. package/dist/react-native/credential/cryptoUtils.d.ts +0 -3
  385. package/dist/react-native/credential/cryptoUtils.d.ts.map +0 -1
  386. package/dist/react-native/credential/cryptoUtils.js +0 -9
  387. package/dist/react-native/credential/cryptoUtils.js.map +0 -1
  388. package/dist/react-native/credential/encodeUtils.browser.d.ts +0 -4
  389. package/dist/react-native/credential/encodeUtils.browser.d.ts.map +0 -1
  390. package/dist/react-native/credential/encodeUtils.browser.js +0 -26
  391. package/dist/react-native/credential/encodeUtils.browser.js.map +0 -1
  392. package/dist/react-native/generated/src/callAutomationApiClient.d.ts +0 -49
  393. package/dist/react-native/generated/src/callAutomationApiClient.d.ts.map +0 -1
  394. package/dist/react-native/generated/src/callAutomationApiClient.js +0 -235
  395. package/dist/react-native/generated/src/callAutomationApiClient.js.map +0 -1
  396. package/dist/react-native/generated/src/index.d.ts +0 -5
  397. package/dist/react-native/generated/src/index.d.ts.map +0 -1
  398. package/dist/react-native/generated/src/index.js +0 -13
  399. package/dist/react-native/generated/src/index.js.map +0 -1
  400. package/dist/react-native/generated/src/models/index.d.ts +0 -2342
  401. package/dist/react-native/generated/src/models/index.d.ts.map +0 -1
  402. package/dist/react-native/generated/src/models/index.js +0 -364
  403. package/dist/react-native/generated/src/models/index.js.map +0 -1
  404. package/dist/react-native/generated/src/models/mappers.d.ts +0 -123
  405. package/dist/react-native/generated/src/models/mappers.d.ts.map +0 -1
  406. package/dist/react-native/generated/src/models/mappers.js +0 -4395
  407. package/dist/react-native/generated/src/models/mappers.js.map +0 -1
  408. package/dist/react-native/generated/src/models/parameters.d.ts +0 -36
  409. package/dist/react-native/generated/src/models/parameters.d.ts.map +0 -1
  410. package/dist/react-native/generated/src/models/parameters.js +0 -208
  411. package/dist/react-native/generated/src/models/parameters.js.map +0 -1
  412. package/dist/react-native/generated/src/operations/callConnection.d.ts +0 -103
  413. package/dist/react-native/generated/src/operations/callConnection.d.ts.map +0 -1
  414. package/dist/react-native/generated/src/operations/callConnection.js +0 -417
  415. package/dist/react-native/generated/src/operations/callConnection.js.map +0 -1
  416. package/dist/react-native/generated/src/operations/callMedia.d.ts +0 -110
  417. package/dist/react-native/generated/src/operations/callMedia.d.ts.map +0 -1
  418. package/dist/react-native/generated/src/operations/callMedia.js +0 -378
  419. package/dist/react-native/generated/src/operations/callMedia.js.map +0 -1
  420. package/dist/react-native/generated/src/operations/callRecording.d.ts +0 -43
  421. package/dist/react-native/generated/src/operations/callRecording.d.ts.map +0 -1
  422. package/dist/react-native/generated/src/operations/callRecording.js +0 -148
  423. package/dist/react-native/generated/src/operations/callRecording.js.map +0 -1
  424. package/dist/react-native/generated/src/operations/index.d.ts +0 -4
  425. package/dist/react-native/generated/src/operations/index.d.ts.map +0 -1
  426. package/dist/react-native/generated/src/operations/index.js +0 -11
  427. package/dist/react-native/generated/src/operations/index.js.map +0 -1
  428. package/dist/react-native/generated/src/operationsInterfaces/callConnection.d.ts +0 -80
  429. package/dist/react-native/generated/src/operationsInterfaces/callConnection.d.ts.map +0 -1
  430. package/dist/react-native/generated/src/operationsInterfaces/callConnection.js +0 -9
  431. package/dist/react-native/generated/src/operationsInterfaces/callConnection.js.map +0 -1
  432. package/dist/react-native/generated/src/operationsInterfaces/callMedia.d.ts +0 -102
  433. package/dist/react-native/generated/src/operationsInterfaces/callMedia.d.ts.map +0 -1
  434. package/dist/react-native/generated/src/operationsInterfaces/callMedia.js +0 -9
  435. package/dist/react-native/generated/src/operationsInterfaces/callMedia.js.map +0 -1
  436. package/dist/react-native/generated/src/operationsInterfaces/callRecording.d.ts +0 -35
  437. package/dist/react-native/generated/src/operationsInterfaces/callRecording.d.ts.map +0 -1
  438. package/dist/react-native/generated/src/operationsInterfaces/callRecording.js +0 -9
  439. package/dist/react-native/generated/src/operationsInterfaces/callRecording.js.map +0 -1
  440. package/dist/react-native/generated/src/operationsInterfaces/index.d.ts +0 -4
  441. package/dist/react-native/generated/src/operationsInterfaces/index.d.ts.map +0 -1
  442. package/dist/react-native/generated/src/operationsInterfaces/index.js +0 -11
  443. package/dist/react-native/generated/src/operationsInterfaces/index.js.map +0 -1
  444. package/dist/react-native/generated/src/pagingHelper.d.ts +0 -13
  445. package/dist/react-native/generated/src/pagingHelper.d.ts.map +0 -1
  446. package/dist/react-native/generated/src/pagingHelper.js +0 -30
  447. package/dist/react-native/generated/src/pagingHelper.js.map +0 -1
  448. package/dist/react-native/index.d.ts +0 -12
  449. package/dist/react-native/index.d.ts.map +0 -1
  450. package/dist/react-native/index.js +0 -14
  451. package/dist/react-native/index.js.map +0 -1
  452. package/dist/react-native/models/constants.d.ts +0 -2
  453. package/dist/react-native/models/constants.d.ts.map +0 -1
  454. package/dist/react-native/models/constants.js +0 -4
  455. package/dist/react-native/models/constants.js.map +0 -1
  456. package/dist/react-native/models/events.d.ts +0 -689
  457. package/dist/react-native/models/events.d.ts.map +0 -1
  458. package/dist/react-native/models/events.js +0 -4
  459. package/dist/react-native/models/events.js.map +0 -1
  460. package/dist/react-native/models/logger.d.ts +0 -5
  461. package/dist/react-native/models/logger.d.ts.map +0 -1
  462. package/dist/react-native/models/logger.js +0 -8
  463. package/dist/react-native/models/logger.js.map +0 -1
  464. package/dist/react-native/models/mapper.d.ts +0 -3
  465. package/dist/react-native/models/mapper.d.ts.map +0 -1
  466. package/dist/react-native/models/mapper.js +0 -76
  467. package/dist/react-native/models/mapper.js.map +0 -1
  468. package/dist/react-native/models/models.d.ts +0 -305
  469. package/dist/react-native/models/models.d.ts.map +0 -1
  470. package/dist/react-native/models/models.js +0 -54
  471. package/dist/react-native/models/models.js.map +0 -1
  472. package/dist/react-native/models/options.d.ts +0 -463
  473. package/dist/react-native/models/options.d.ts.map +0 -1
  474. package/dist/react-native/models/options.js +0 -4
  475. package/dist/react-native/models/options.js.map +0 -1
  476. package/dist/react-native/models/responses.d.ts +0 -81
  477. package/dist/react-native/models/responses.d.ts.map +0 -1
  478. package/dist/react-native/models/responses.js +0 -4
  479. package/dist/react-native/models/responses.js.map +0 -1
  480. package/dist/react-native/models/streaming.d.ts +0 -128
  481. package/dist/react-native/models/streaming.d.ts.map +0 -1
  482. package/dist/react-native/models/streaming.js +0 -38
  483. package/dist/react-native/models/streaming.js.map +0 -1
  484. package/dist/react-native/package.json +0 -3
  485. package/dist/react-native/streamingData.d.ts +0 -13
  486. package/dist/react-native/streamingData.d.ts.map +0 -1
  487. package/dist/react-native/streamingData.js +0 -99
  488. package/dist/react-native/streamingData.js.map +0 -1
  489. package/dist/react-native/utli/converters.d.ts +0 -46
  490. package/dist/react-native/utli/converters.d.ts.map +0 -1
  491. package/dist/react-native/utli/converters.js +0 -294
  492. package/dist/react-native/utli/converters.js.map +0 -1
@@ -1 +1,7 @@
1
- {"version":3,"file":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OAAO,CAAC,oBAAoB;YAClD,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;SAC3C,CAAC;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,kBAAkB,CACtC,IAAI,CAAC,gBAAgB,EACrB,yBAAyB,EACzB,OAAO,CACR,CAAC;IACJ,CAAC;CACF;AA3iBD,8BA2iBC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n PlayRequest,\n PlaySourceInternal,\n FileSourceInternal,\n TextSourceInternal,\n SsmlSourceInternal,\n RecognizeRequest,\n RecognizeOptions,\n DtmfOptions,\n CallAutomationApiClient,\n CallAutomationApiClientOptionalParams,\n ContinuousDtmfRecognitionRequest,\n SendDtmfTonesRequest,\n Tone,\n SpeechOptions,\n StartTranscriptionRequest,\n StopTranscriptionRequest,\n UpdateTranscriptionRequest,\n HoldRequest,\n UnholdRequest,\n StartMediaStreamingRequest,\n StopMediaStreamingRequest,\n SummarizeCallRequest,\n} from \"./generated/src/index.js\";\nimport { KnownPlaySourceType, KnownRecognizeInputType } from \"./generated/src/index.js\";\n\nimport { CallMediaImpl } from \"./generated/src/operations/index.js\";\n\nimport type { CommunicationIdentifier } from \"@azure/communication-common\";\nimport {\n createCommunicationAuthPolicy,\n serializeCommunicationIdentifier,\n} from \"@azure/communication-common\";\n\nimport type { FileSource, TextSource, SsmlSource, DtmfTone } from \"./models/models.js\";\nimport type {\n PlayOptions,\n CallMediaRecognizeDtmfOptions,\n CallMediaRecognizeChoiceOptions,\n ContinuousDtmfRecognitionOptions,\n SendDtmfTonesOptions,\n CallMediaRecognizeSpeechOptions,\n CallMediaRecognizeSpeechOrDtmfOptions,\n StartTranscriptionOptions,\n StopTranscriptionOptions,\n HoldOptions,\n UnholdOptions,\n StartMediaStreamingOptions,\n StopMediaStreamingOptions,\n PlayToAllOptions,\n UpdateTranscriptionOptions,\n SummarizeCallOptions,\n} from \"./models/options.js\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport type { SendDtmfTonesResult } from \"./models/responses.js\";\nimport { randomUUID } from \"@azure/core-util\";\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.playSourceCacheId\n ? playSource.playSourceCacheId\n : 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.playSourceCacheId\n ? playSource.playSourceCacheId\n : 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.playSourceCacheId\n ? playSource.playSourceCacheId\n : 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 await 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 operationContext: options.operationContext ? options.operationContext : randomUUID(),\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\n if (options.interruptCallMediaOperation !== undefined) {\n playRequest.playOptions = playRequest.playOptions || {\n loop: false,\n }; // Ensure playOptions is defined\n playRequest.interruptCallMediaOperation = options.interruptCallMediaOperation;\n }\n\n await 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 speechLanguages: recognizeOptions.speechLanguages,\n enableSentimentAnalysis: recognizeOptions.enableSentimentAnalysis,\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 speechLanguages: recognizeOptions.speechLanguages,\n enableSentimentAnalysis: recognizeOptions.enableSentimentAnalysis,\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 speechLanguage: recognizeOptions.speechLanguage,\n speechLanguages: recognizeOptions.speechLanguages,\n enableSentimentAnalysis: recognizeOptions.enableSentimentAnalysis,\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 maxTonesOrOptions.operationContext = maxTonesOrOptions.operationContext\n ? maxTonesOrOptions.operationContext\n : randomUUID();\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 await 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 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\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 operationCallbackUri:\n options.operationCallbackUrl !== undefined ? options.operationCallbackUrl : undefined,\n };\n return this.callMedia.unhold(this.callConnectionId, unholdRequest);\n }\n\n /**\n * Starts transcription in the call\n * @param locales - List of languages for Language Identification.\n * @param options - Additional attributes for start transcription.\n */\n public async startTranscription(options: StartTranscriptionOptions = {}): Promise<void> {\n const startTranscriptionRequest: StartTranscriptionRequest = {\n locale: options.locale,\n operationContext: options.operationContext,\n speechModelEndpointId: options.speechRecognitionModelEndpointId,\n operationCallbackUri: options.operationCallbackUrl,\n piiRedactionOptions: options.piiRedactionOptions,\n locales: options.locales,\n enableSentimentAnalysis: options.enableSentimentAnalysis,\n summarizationOptions: options.summarizationOptions,\n };\n return this.callMedia.startTranscription(this.callConnectionId, startTranscriptionRequest, {});\n }\n\n /**\n * Stops transcription in the call.\n * @param options - Additional attributes for stop transcription.\n */\n public async stopTranscription(options: StopTranscriptionOptions = {}): Promise<void> {\n const stopTranscriptionRequest: StopTranscriptionRequest = {\n operationContext: options.operationContext,\n operationCallbackUri: options.operationCallbackUrl,\n };\n return this.callMedia.stopTranscription(this.callConnectionId, stopTranscriptionRequest, {});\n }\n\n /**\n * Update transcription language.\n */\n public async updateTranscription(\n locale: string,\n options: UpdateTranscriptionOptions = {},\n ): Promise<void> {\n const updateTranscriptionRequest: UpdateTranscriptionRequest = {\n locale: locale,\n speechModelEndpointId: options.speechRecognitionModelEndpointId,\n operationContext: options.operationContext,\n operationCallbackUri: options.operationCallbackUrl,\n piiRedactionOptions: options.piiRedactionOptions,\n enableSentimentAnalysis: options.enableSentimentAnalysis,\n summarizationOptions: options.summarizationOptions,\n };\n return this.callMedia.updateTranscription(\n this.callConnectionId,\n updateTranscriptionRequest,\n {},\n );\n }\n\n /**\n * Summarize call details.\n * @param options - Additional attributes for summarize call.\n */\n public async summarizeCall(options: SummarizeCallOptions = {}): Promise<void> {\n const summarizeCallRequest: SummarizeCallRequest = {\n operationContext: options.operationContext,\n operationCallbackUri: options.operationCallbackUrl,\n summarizationOptions: {\n enableEndCallSummary: options.summarizationOptions?.enableEndCallSummary,\n locale: options.summarizationOptions?.locale,\n },\n };\n return this.callMedia.summarizeCall(this.callConnectionId, summarizeCallRequest, {});\n }\n\n /**\n * Starts media streaming in the call.\n * @param options - Additional attributes for start media streaming.\n */\n public async startMediaStreaming(options: StartMediaStreamingOptions = {}): Promise<void> {\n const startMediaStreamingRequest: StartMediaStreamingRequest = {\n operationContext: options.operationContext,\n operationCallbackUri: options.operationCallbackUrl,\n };\n return this.callMedia.startMediaStreaming(\n this.callConnectionId,\n startMediaStreamingRequest,\n options,\n );\n }\n\n /**\n * Stops media streaming in the call.\n * @param options - Additional attributes for stop media streaming.\n */\n public async stopMediaStreaming(options: StopMediaStreamingOptions = {}): Promise<void> {\n const stopMediaStreamingRequest: StopMediaStreamingRequest = {\n operationCallbackUri: options.operationCallbackUrl,\n operationContext: options.operationContext,\n };\n return this.callMedia.stopMediaStreaming(\n this.callConnectionId,\n stopMediaStreamingRequest,\n options,\n );\n }\n}\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/callMedia.ts"],
4
+ "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n PlayRequest,\n PlaySourceInternal,\n FileSourceInternal,\n TextSourceInternal,\n SsmlSourceInternal,\n RecognizeRequest,\n RecognizeOptions,\n DtmfOptions,\n CallAutomationApiClientOptionalParams,\n ContinuousDtmfRecognitionRequest,\n SendDtmfTonesRequest,\n Tone,\n SpeechOptions,\n StartTranscriptionRequest,\n StopTranscriptionRequest,\n UpdateTranscriptionRequest,\n HoldRequest,\n UnholdRequest,\n StartMediaStreamingRequest,\n StopMediaStreamingRequest,\n} from \"./generated/src/index.js\";\nimport { CallAutomationApiClient } from \"./generated/src/index.js\";\nimport { KnownPlaySourceType, KnownRecognizeInputType } from \"./generated/src/index.js\";\n\nimport { CallMediaImpl } from \"./generated/src/operations/index.js\";\n\nimport type { CommunicationIdentifier } from \"@azure/communication-common\";\nimport {\n createCommunicationAuthPolicy,\n serializeCommunicationIdentifier,\n} from \"@azure/communication-common\";\n\nimport type { FileSource, TextSource, SsmlSource, DtmfTone } from \"./models/models.js\";\nimport type {\n PlayOptions,\n CallMediaRecognizeDtmfOptions,\n CallMediaRecognizeChoiceOptions,\n ContinuousDtmfRecognitionOptions,\n SendDtmfTonesOptions,\n CallMediaRecognizeSpeechOptions,\n CallMediaRecognizeSpeechOrDtmfOptions,\n StartTranscriptionOptions,\n StopTranscriptionOptions,\n HoldOptions,\n UnholdOptions,\n StartMediaStreamingOptions,\n StopMediaStreamingOptions,\n PlayToAllOptions,\n UpdateTranscriptionOptions,\n} from \"./models/options.js\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport type { SendDtmfTonesResult } from \"./models/responses.js\";\nimport { randomUUID } from \"@azure/core-util\";\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.playSourceCacheId\n ? playSource.playSourceCacheId\n : 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.playSourceCacheId\n ? playSource.playSourceCacheId\n : 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.playSourceCacheId\n ? playSource.playSourceCacheId\n : 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 await 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 operationContext: options.operationContext ? options.operationContext : randomUUID(),\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\n if (options.interruptCallMediaOperation !== undefined) {\n playRequest.playOptions = playRequest.playOptions || {\n loop: false,\n }; // Ensure playOptions is defined\n playRequest.interruptCallMediaOperation = options.interruptCallMediaOperation;\n }\n\n await 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 speechLanguage: recognizeOptions.speechLanguage,\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 maxTonesOrOptions.operationContext = maxTonesOrOptions.operationContext\n ? maxTonesOrOptions.operationContext\n : randomUUID();\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 await 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 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\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 operationCallbackUri:\n options.operationCallbackUrl !== undefined ? options.operationCallbackUrl : undefined,\n };\n return this.callMedia.unhold(this.callConnectionId, unholdRequest);\n }\n\n /**\n * Starts transcription in the call\n * @param options - Additional attributes for start transcription.\n */\n public async startTranscription(options: StartTranscriptionOptions = {}): Promise<void> {\n const startTranscriptionRequest: StartTranscriptionRequest = {\n locale: options.locale,\n operationContext: options.operationContext,\n speechModelEndpointId: options.speechRecognitionModelEndpointId,\n operationCallbackUri: options.operationCallbackUrl,\n };\n return this.callMedia.startTranscription(this.callConnectionId, startTranscriptionRequest, {});\n }\n\n /**\n * Stops transcription in the call.\n * @param options - Additional attributes for stop transcription.\n */\n public async stopTranscription(options: StopTranscriptionOptions = {}): Promise<void> {\n const stopTranscriptionRequest: StopTranscriptionRequest = {\n operationContext: options.operationContext,\n operationCallbackUri: options.operationCallbackUrl,\n };\n return this.callMedia.stopTranscription(this.callConnectionId, stopTranscriptionRequest, {});\n }\n\n /**\n * Update transcription language.\n * @param locale - Defines new locale for transcription.\n */\n public async updateTranscription(\n locale: string,\n options?: UpdateTranscriptionOptions,\n ): Promise<void> {\n const updateTranscriptionRequest: UpdateTranscriptionRequest = {\n locale: locale,\n speechModelEndpointId: options?.speechRecognitionModelEndpointId,\n operationContext: options?.operationContext,\n operationCallbackUri: options?.operationCallbackUrl,\n };\n return this.callMedia.updateTranscription(\n this.callConnectionId,\n updateTranscriptionRequest,\n {},\n );\n }\n /**\n * Starts media streaming in the call.\n * @param options - Additional attributes for start media streaming.\n */\n public async startMediaStreaming(options: StartMediaStreamingOptions = {}): Promise<void> {\n const startMediaStreamingRequest: StartMediaStreamingRequest = {\n operationContext: options.operationContext,\n operationCallbackUri: options.operationCallbackUrl,\n };\n return this.callMedia.startMediaStreaming(\n this.callConnectionId,\n startMediaStreamingRequest,\n options,\n );\n }\n\n /**\n * Stops media streaming in the call.\n * @param options - Additional attributes for stop media streaming.\n */\n public async stopMediaStreaming(options: StopMediaStreamingOptions = {}): Promise<void> {\n const stopMediaStreamingRequest: StopMediaStreamingRequest = {\n operationCallbackUri: options.operationCallbackUrl,\n operationContext: options.operationContext,\n };\n return this.callMedia.stopMediaStreaming(\n this.callConnectionId,\n stopMediaStreamingRequest,\n options,\n );\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBA,iBAAwC;AACxC,IAAAA,cAA6D;AAE7D,wBAA8B;AAG9B,kCAGO;AAsBP,uBAA2B;AAIpB,MAAM,UAAU;AAAA,EACJ;AAAA,EACA;AAAA,EACA;AAAA,EACjB,YACE,kBACA,UACA,YACA,SACA;AACA,SAAK,0BAA0B,IAAI,mCAAwB,UAAU,OAAO;AAC5E,UAAM,iBAAa,2DAA8B,UAAU;AAC3D,SAAK,wBAAwB,SAAS,UAAU,UAAU;AAC1D,SAAK,mBAAmB;AACxB,SAAK,YAAY,IAAI,gCAAc,KAAK,uBAAuB;AAAA,EACjE;AAAA,EAEQ,yBACN,YACoB;AACpB,QAAI,WAAW,SAAS,cAAc;AACpC,YAAM,aAAiC;AAAA,QACrC,KAAK,WAAW;AAAA,MAClB;AACA,aAAO;AAAA,QACL,MAAM,gCAAoB;AAAA,QAC1B,MAAM;AAAA,QACN,mBAAmB,WAAW,oBAC1B,WAAW,oBACX,WAAW;AAAA,MACjB;AAAA,IACF,WAAW,WAAW,SAAS,cAAc;AAC3C,YAAM,aAAiC;AAAA,QACrC,MAAM,WAAW;AAAA,QACjB,cAAc,WAAW;AAAA,QACzB,WAAW,WAAW;AAAA,QACtB,WAAW,WAAW;AAAA,QACtB,uBAAuB,WAAW;AAAA,MACpC;AACA,aAAO;AAAA,QACL,MAAM,gCAAoB;AAAA,QAC1B,MAAM;AAAA,QACN,mBAAmB,WAAW,oBAC1B,WAAW,oBACX,WAAW;AAAA,MACjB;AAAA,IACF,WAAW,WAAW,SAAS,cAAc;AAC3C,YAAM,aAAiC;AAAA,QACrC,UAAU,WAAW;AAAA,QACrB,uBAAuB,WAAW;AAAA,MACpC;AACA,aAAO;AAAA,QACL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S;AAAA,MAC3B,sBAAsB,SAAS;AAAA,IACjC;AACA,WAAO,KAAK,UAAU;AAAA,MACpB,KAAK;AAAA,MACL;AAAA,MACA,CAAC;AAAA,IACH;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA,MAAa,oBAAoB,UAAsC,CAAC,GAAkB;AACxF,UAAM,6BAAyD;AAAA,MAC7D,kBAAkB,QAAQ;AAAA,MAC1B,sBAAsB,QAAQ;AAAA,IAChC;AACA,WAAO,KAAK,UAAU;AAAA,MACpB,KAAK;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAa,mBAAmB,UAAqC,CAAC,GAAkB;AACtF,UAAM,4BAAuD;AAAA,MAC3D,sBAAsB,QAAQ;AAAA,MAC9B,kBAAkB,QAAQ;AAAA,IAC5B;AACA,WAAO,KAAK,UAAU;AAAA,MACpB,KAAK;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
6
+ "names": ["import_src"]
7
+ }
@@ -1,200 +1,224 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CallRecording = void 0;
4
- const tslib_1 = require("tslib");
5
- // Copyright (c) Microsoft Corporation.
6
- // Licensed under the MIT License.
7
- const index_js_1 = require("./generated/src/operations/index.js");
8
- const converters_js_1 = require("./utli/converters.js");
9
- const contentDownloader_js_1 = require("./contentDownloader.js");
10
- const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
11
- const core_util_1 = require("@azure/core-util");
12
- const index_js_2 = require("./generated/src/index.js");
13
- const communication_common_1 = require("@azure/communication-common");
14
- /**
15
- * CallRecording class represents call recording related APIs.
16
- */
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var callRecording_exports = {};
29
+ __export(callRecording_exports, {
30
+ CallRecording: () => CallRecording
31
+ });
32
+ module.exports = __toCommonJS(callRecording_exports);
33
+ var import_operations = require("./generated/src/operations/index.js");
34
+ var import_converters = require("./utli/converters.js");
35
+ var import_contentDownloader = require("./contentDownloader.js");
36
+ var import_node_fs = __toESM(require("node:fs"));
37
+ var import_core_util = require("@azure/core-util");
38
+ var import_src = require("./generated/src/index.js");
39
+ var import_communication_common = require("@azure/communication-common");
17
40
  class CallRecording {
18
- callRecordingImpl;
19
- contentDownloader;
20
- callAutomationApiClient;
21
- constructor(endpoint, credential, options) {
22
- this.callAutomationApiClient = new index_js_2.CallAutomationApiClient(endpoint, options);
23
- const authPolicy = (0, communication_common_1.createCommunicationAuthPolicy)(credential);
24
- this.callAutomationApiClient.pipeline.addPolicy(authPolicy);
25
- this.callRecordingImpl = new index_js_1.CallRecordingImpl(this.callAutomationApiClient);
26
- this.contentDownloader = new contentDownloader_js_1.ContentDownloaderImpl(this.callAutomationApiClient);
41
+ callRecordingImpl;
42
+ contentDownloader;
43
+ callAutomationApiClient;
44
+ constructor(endpoint, credential, options) {
45
+ this.callAutomationApiClient = new import_src.CallAutomationApiClient(endpoint, options);
46
+ const authPolicy = (0, import_communication_common.createCommunicationAuthPolicy)(credential);
47
+ this.callAutomationApiClient.pipeline.addPolicy(authPolicy);
48
+ this.callRecordingImpl = new import_operations.CallRecordingImpl(this.callAutomationApiClient);
49
+ this.contentDownloader = new import_contentDownloader.ContentDownloaderImpl(this.callAutomationApiClient);
50
+ }
51
+ /**
52
+ * Starts a call recording with the specified options.
53
+ * @param startCallRecordingRequest - options to start the call recording
54
+ * @param options - Operation options.
55
+ */
56
+ async start(options) {
57
+ const startCallRecordingRequest = {
58
+ callLocator: options.callLocator ? options.callLocator : void 0
59
+ };
60
+ startCallRecordingRequest.recordingChannelType = options.recordingChannel;
61
+ startCallRecordingRequest.recordingContentType = options.recordingContent;
62
+ startCallRecordingRequest.recordingFormatType = options.recordingFormat;
63
+ startCallRecordingRequest.recordingStateCallbackUri = options.recordingStateCallbackEndpointUrl;
64
+ startCallRecordingRequest.pauseOnStart = options.pauseOnStart;
65
+ startCallRecordingRequest.recordingStorage = options.recordingStorage;
66
+ startCallRecordingRequest.callConnectionId = options.callConnectionId ? options.callConnectionId : void 0;
67
+ if (options.channelAffinity) {
68
+ startCallRecordingRequest.channelAffinity = [];
69
+ options.channelAffinity.forEach((identifier) => {
70
+ startCallRecordingRequest.channelAffinity?.push({
71
+ participant: (0, import_converters.communicationIdentifierModelConverter)(identifier.targetParticipant),
72
+ channel: identifier.channel
73
+ });
74
+ });
27
75
  }
28
- /**
29
- * Starts a call recording with the specified options.
30
- * @param startCallRecordingRequest - options to start the call recording
31
- * @param options - Operation options.
32
- */
33
- async start(options) {
34
- const startCallRecordingRequest = {
35
- callLocator: options.callLocator ? options.callLocator : undefined,
36
- };
37
- startCallRecordingRequest.recordingChannelType = options.recordingChannel;
38
- startCallRecordingRequest.recordingContentType = options.recordingContent;
39
- startCallRecordingRequest.recordingFormatType = options.recordingFormat;
40
- startCallRecordingRequest.recordingStateCallbackUri = options.recordingStateCallbackEndpointUrl;
41
- startCallRecordingRequest.pauseOnStart = options.pauseOnStart;
42
- startCallRecordingRequest.recordingStorage = options.recordingStorage;
43
- startCallRecordingRequest.callConnectionId = options.callConnectionId
44
- ? options.callConnectionId
45
- : undefined;
46
- if (options.channelAffinity) {
47
- startCallRecordingRequest.channelAffinity = [];
48
- options.channelAffinity.forEach((identifier) => {
49
- startCallRecordingRequest.channelAffinity?.push({
50
- participant: (0, converters_js_1.communicationIdentifierModelConverter)(identifier.targetParticipant),
51
- channel: identifier.channel,
52
- });
53
- });
54
- }
55
- if (options.audioChannelParticipantOrdering) {
56
- startCallRecordingRequest.audioChannelParticipantOrdering = [];
57
- options.audioChannelParticipantOrdering.forEach((identifier) => {
58
- startCallRecordingRequest.audioChannelParticipantOrdering?.push((0, converters_js_1.communicationIdentifierModelConverter)(identifier));
59
- });
60
- }
61
- if (options.callLocator) {
62
- if (options.callLocator.kind === "groupCallLocator") {
63
- startCallRecordingRequest.callLocator = {
64
- groupCallId: options.callLocator.id,
65
- kind: "groupCallLocator",
66
- };
67
- }
68
- else if (options.callLocator.kind === "roomCallLocator") {
69
- startCallRecordingRequest.callLocator = {
70
- roomId: options.callLocator.id,
71
- kind: "roomCallLocator",
72
- };
73
- }
74
- else {
75
- startCallRecordingRequest.callLocator = {
76
- serverCallId: options.callLocator.id,
77
- kind: "serverCallLocator",
78
- };
79
- }
80
- }
81
- const optionsInternal = {
82
- ...options,
83
- repeatabilityFirstSent: new Date(),
84
- repeatabilityRequestID: (0, core_util_1.randomUUID)(),
76
+ if (options.audioChannelParticipantOrdering) {
77
+ startCallRecordingRequest.audioChannelParticipantOrdering = [];
78
+ options.audioChannelParticipantOrdering.forEach((identifier) => {
79
+ startCallRecordingRequest.audioChannelParticipantOrdering?.push(
80
+ (0, import_converters.communicationIdentifierModelConverter)(identifier)
81
+ );
82
+ });
83
+ }
84
+ if (options.callLocator) {
85
+ if (options.callLocator.kind === "groupCallLocator") {
86
+ startCallRecordingRequest.callLocator = {
87
+ groupCallId: options.callLocator.id,
88
+ kind: "groupCallLocator"
85
89
  };
86
- const response = await this.callRecordingImpl.startRecording(startCallRecordingRequest, optionsInternal);
87
- const result = {
88
- recordingId: response.recordingId,
89
- recordingKind: response.recordingKind,
90
- recordingState: response.recordingState,
90
+ } else if (options.callLocator.kind === "roomCallLocator") {
91
+ startCallRecordingRequest.callLocator = {
92
+ roomId: options.callLocator.id,
93
+ kind: "roomCallLocator"
91
94
  };
92
- return result;
93
- }
94
- /**
95
- * Returns call recording properties.
96
- * @param recordingId - The recordingId associated with the recording.
97
- * @param options - Additional request options contains getRecordingProperties api options.
98
- */
99
- async getState(recordingId, options = {}) {
100
- const response = await this.callRecordingImpl.getRecordingProperties(recordingId, options);
101
- const result = {
102
- recordingId: response.recordingId,
103
- recordingKind: response.recordingKind,
104
- recordingState: response.recordingState,
95
+ } else {
96
+ startCallRecordingRequest.callLocator = {
97
+ serverCallId: options.callLocator.id,
98
+ kind: "serverCallLocator"
105
99
  };
106
- return result;
107
- }
108
- /**
109
- * Stops a call recording.
110
- * @param recordingId - The recordingId associated with the recording.
111
- * @param options - Additional request options contains stopRecording api options.
112
- */
113
- async stop(recordingId, options = {}) {
114
- return this.callRecordingImpl.stopRecording(recordingId, options);
115
- }
116
- /**
117
- * Pauses a call recording.
118
- * @param recordingId - The recordingId associated with the recording.
119
- * @param options - Additional request options contains pauseRecording api options.
120
- */
121
- async pause(recordingId, options = {}) {
122
- return this.callRecordingImpl.pauseRecording(recordingId, options);
123
- }
124
- /**
125
- * Resumes a call recording.
126
- * @param recordingId - The recordingId associated with the recording.
127
- * @param options - Additional request options contains resumeRecording api options.
128
- */
129
- async resume(recordingId, options = {}) {
130
- return this.callRecordingImpl.resumeRecording(recordingId, options);
131
- }
132
- /**
133
- * Deletes a recording.
134
- * @param recordingLocationUrl - The recording location url. Required.
135
- * @param options - Additional request options contains deleteRecording api options.
136
- */
137
- async delete(recordingLocationUrl, options = {}) {
138
- await this.contentDownloader.deleteRecording(recordingLocationUrl, options);
100
+ }
139
101
  }
140
- /**
141
- * Returns a stream with a call recording.
142
- * @param sourceLocationUrl - The source location url. Required.
143
- * @param options - Additional request options contains downloadRecording api options.
144
- */
145
- async downloadStreaming(sourceLocationUrl, options = {}) {
146
- const result = this.contentDownloader.download(sourceLocationUrl, options);
147
- const recordingStream = (await result).readableStreamBody;
148
- if (recordingStream) {
149
- return recordingStream;
150
- }
151
- else {
152
- throw Error("failed to get stream");
153
- }
102
+ const optionsInternal = {
103
+ ...options,
104
+ repeatabilityFirstSent: /* @__PURE__ */ new Date(),
105
+ repeatabilityRequestID: (0, import_core_util.randomUUID)()
106
+ };
107
+ const response = await this.callRecordingImpl.startRecording(
108
+ startCallRecordingRequest,
109
+ optionsInternal
110
+ );
111
+ const result = {
112
+ recordingId: response.recordingId,
113
+ recordingKind: response.recordingKind,
114
+ recordingState: response.recordingState
115
+ };
116
+ return result;
117
+ }
118
+ /**
119
+ * Returns call recording properties.
120
+ * @param recordingId - The recordingId associated with the recording.
121
+ * @param options - Additional request options contains getRecordingProperties api options.
122
+ */
123
+ async getState(recordingId, options = {}) {
124
+ const response = await this.callRecordingImpl.getRecordingProperties(recordingId, options);
125
+ const result = {
126
+ recordingId: response.recordingId,
127
+ recordingKind: response.recordingKind,
128
+ recordingState: response.recordingState
129
+ };
130
+ return result;
131
+ }
132
+ /**
133
+ * Stops a call recording.
134
+ * @param recordingId - The recordingId associated with the recording.
135
+ * @param options - Additional request options contains stopRecording api options.
136
+ */
137
+ async stop(recordingId, options = {}) {
138
+ return this.callRecordingImpl.stopRecording(recordingId, options);
139
+ }
140
+ /**
141
+ * Pauses a call recording.
142
+ * @param recordingId - The recordingId associated with the recording.
143
+ * @param options - Additional request options contains pauseRecording api options.
144
+ */
145
+ async pause(recordingId, options = {}) {
146
+ return this.callRecordingImpl.pauseRecording(recordingId, options);
147
+ }
148
+ /**
149
+ * Resumes a call recording.
150
+ * @param recordingId - The recordingId associated with the recording.
151
+ * @param options - Additional request options contains resumeRecording api options.
152
+ */
153
+ async resume(recordingId, options = {}) {
154
+ return this.callRecordingImpl.resumeRecording(recordingId, options);
155
+ }
156
+ /**
157
+ * Deletes a recording.
158
+ * @param recordingLocationUrl - The recording location url. Required.
159
+ * @param options - Additional request options contains deleteRecording api options.
160
+ */
161
+ async delete(recordingLocationUrl, options = {}) {
162
+ await this.contentDownloader.deleteRecording(recordingLocationUrl, options);
163
+ }
164
+ /**
165
+ * Returns a stream with a call recording.
166
+ * @param sourceLocationUrl - The source location url. Required.
167
+ * @param options - Additional request options contains downloadRecording api options.
168
+ */
169
+ async downloadStreaming(sourceLocationUrl, options = {}) {
170
+ const result = this.contentDownloader.download(sourceLocationUrl, options);
171
+ const recordingStream = (await result).readableStreamBody;
172
+ if (recordingStream) {
173
+ return recordingStream;
174
+ } else {
175
+ throw Error("failed to get stream");
154
176
  }
155
- /**
156
- * Downloads a call recording file to the specified stream.
157
- * @param sourceLocationUrl - The source location url. Required.
158
- * @param destinationStream - The destination stream. Required.
159
- * @param options - Additional request options contains downloadRecording api options.
160
- */
161
- async downloadToStream(sourceLocationUrl, destinationStream, options = {}) {
162
- const result = this.contentDownloader.download(sourceLocationUrl, options);
163
- const recordingStream = (await result).readableStreamBody;
164
- if (recordingStream) {
165
- recordingStream.pipe(destinationStream);
166
- const finish = new Promise((resolve, reject) => {
167
- destinationStream.on("finish", resolve);
168
- destinationStream.on("error", reject);
169
- });
170
- await finish;
171
- }
172
- else {
173
- throw Error("failed to get stream");
174
- }
177
+ }
178
+ /**
179
+ * Downloads a call recording file to the specified stream.
180
+ * @param sourceLocationUrl - The source location url. Required.
181
+ * @param destinationStream - The destination stream. Required.
182
+ * @param options - Additional request options contains downloadRecording api options.
183
+ */
184
+ async downloadToStream(sourceLocationUrl, destinationStream, options = {}) {
185
+ const result = this.contentDownloader.download(sourceLocationUrl, options);
186
+ const recordingStream = (await result).readableStreamBody;
187
+ if (recordingStream) {
188
+ recordingStream.pipe(destinationStream);
189
+ const finish = new Promise((resolve, reject) => {
190
+ destinationStream.on("finish", resolve);
191
+ destinationStream.on("error", reject);
192
+ });
193
+ await finish;
194
+ } else {
195
+ throw Error("failed to get stream");
175
196
  }
176
- /**
177
- * Downloads a call recording file to the specified path.
178
- * @param sourceLocationUrl - The source location url. Required.
179
- * @param destinationPath - The destination path. Required.
180
- * @param options - Additional request options contains downloadRecording api options.
181
- */
182
- async downloadToPath(sourceLocationUrl, destinationPath, options = {}) {
183
- const result = this.contentDownloader.download(sourceLocationUrl, options);
184
- const recordingStream = (await result).readableStreamBody;
185
- if (recordingStream) {
186
- const writeFileStream = node_fs_1.default.createWriteStream(destinationPath);
187
- recordingStream.pipe(writeFileStream);
188
- const finish = new Promise((resolve, reject) => {
189
- writeFileStream.on("finish", resolve);
190
- writeFileStream.on("error", reject);
191
- });
192
- await finish;
193
- }
194
- else {
195
- throw Error("failed to get stream");
196
- }
197
+ }
198
+ /**
199
+ * Downloads a call recording file to the specified path.
200
+ * @param sourceLocationUrl - The source location url. Required.
201
+ * @param destinationPath - The destination path. Required.
202
+ * @param options - Additional request options contains downloadRecording api options.
203
+ */
204
+ async downloadToPath(sourceLocationUrl, destinationPath, options = {}) {
205
+ const result = this.contentDownloader.download(sourceLocationUrl, options);
206
+ const recordingStream = (await result).readableStreamBody;
207
+ if (recordingStream) {
208
+ const writeFileStream = import_node_fs.default.createWriteStream(destinationPath);
209
+ recordingStream.pipe(writeFileStream);
210
+ const finish = new Promise((resolve, reject) => {
211
+ writeFileStream.on("finish", resolve);
212
+ writeFileStream.on("error", reject);
213
+ });
214
+ await finish;
215
+ } else {
216
+ throw Error("failed to get stream");
197
217
  }
218
+ }
198
219
  }
199
- exports.CallRecording = CallRecording;
200
- //# sourceMappingURL=callRecording.js.map
220
+ // Annotate the CommonJS export names for ESM import in node:
221
+ 0 && (module.exports = {
222
+ CallRecording
223
+ });
224
+ //# sourceMappingURL=callRecording.js.map