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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (477) hide show
  1. package/README.md +0 -48
  2. package/dist/browser/callAutomationClient.d.ts +0 -8
  3. package/dist/browser/callAutomationClient.d.ts.map +1 -1
  4. package/dist/browser/callAutomationClient.js +87 -141
  5. package/dist/browser/callAutomationClient.js.map +1 -1
  6. package/dist/browser/callAutomationEventParser.d.ts.map +1 -1
  7. package/dist/browser/callAutomationEventParser.js +22 -54
  8. package/dist/browser/callAutomationEventParser.js.map +1 -1
  9. package/dist/browser/callConnection.d.ts +12 -14
  10. package/dist/browser/callConnection.d.ts.map +1 -1
  11. package/dist/browser/callConnection.js +111 -183
  12. package/dist/browser/callConnection.js.map +1 -1
  13. package/dist/browser/callMedia.d.ts +15 -20
  14. package/dist/browser/callMedia.d.ts.map +1 -1
  15. package/dist/browser/callMedia.js +58 -177
  16. package/dist/browser/callMedia.js.map +1 -1
  17. package/dist/browser/callRecording.d.ts +2 -8
  18. package/dist/browser/callRecording.d.ts.map +1 -1
  19. package/dist/browser/callRecording.js +16 -26
  20. package/dist/browser/callRecording.js.map +1 -1
  21. package/dist/browser/contentDownloader.js +11 -12
  22. package/dist/browser/contentDownloader.js.map +1 -1
  23. package/dist/browser/credential/callAutomationAccessKeyCredentialPolicy.js +1 -2
  24. package/dist/browser/credential/callAutomationAccessKeyCredentialPolicy.js.map +1 -1
  25. package/dist/browser/credential/callAutomationAuthPolicy.js +1 -1
  26. package/dist/browser/credential/callAutomationAuthPolicy.js.map +1 -1
  27. package/dist/browser/credential/cryptoUtils-browser.mjs.map +1 -1
  28. package/dist/browser/credential/cryptoUtils.js +1 -2
  29. package/dist/browser/generated/src/callAutomationApiClient.d.ts +1 -2
  30. package/dist/browser/generated/src/callAutomationApiClient.d.ts.map +1 -1
  31. package/dist/browser/generated/src/callAutomationApiClient.js +14 -6
  32. package/dist/browser/generated/src/callAutomationApiClient.js.map +1 -1
  33. package/dist/browser/generated/src/models/index.d.ts +534 -1064
  34. package/dist/browser/generated/src/models/index.d.ts.map +1 -1
  35. package/dist/browser/generated/src/models/index.js +87 -159
  36. package/dist/browser/generated/src/models/index.js.map +1 -1
  37. package/dist/browser/generated/src/models/mappers.d.ts +58 -86
  38. package/dist/browser/generated/src/models/mappers.d.ts.map +1 -1
  39. package/dist/browser/generated/src/models/mappers.js +1173 -2159
  40. package/dist/browser/generated/src/models/mappers.js.map +1 -1
  41. package/dist/browser/generated/src/models/parameters.d.ts +2 -7
  42. package/dist/browser/generated/src/models/parameters.d.ts.map +1 -1
  43. package/dist/browser/generated/src/models/parameters.js +10 -41
  44. package/dist/browser/generated/src/models/parameters.js.map +1 -1
  45. package/dist/browser/generated/src/operations/callConnection.d.ts +2 -9
  46. package/dist/browser/generated/src/operations/callConnection.d.ts.map +1 -1
  47. package/dist/browser/generated/src/operations/callConnection.js +24 -73
  48. package/dist/browser/generated/src/operations/callConnection.js.map +1 -1
  49. package/dist/browser/generated/src/operations/callMedia.d.ts +15 -15
  50. package/dist/browser/generated/src/operations/callMedia.d.ts.map +1 -1
  51. package/dist/browser/generated/src/operations/callMedia.js +51 -50
  52. package/dist/browser/generated/src/operations/callMedia.js.map +1 -1
  53. package/dist/browser/generated/src/operations/callRecording.d.ts +1 -7
  54. package/dist/browser/generated/src/operations/callRecording.d.ts.map +1 -1
  55. package/dist/browser/generated/src/operations/callRecording.js +1 -24
  56. package/dist/browser/generated/src/operations/callRecording.js.map +1 -1
  57. package/dist/browser/generated/src/operations/index.d.ts +0 -1
  58. package/dist/browser/generated/src/operations/index.d.ts.map +1 -1
  59. package/dist/browser/generated/src/operations/index.js +0 -1
  60. package/dist/browser/generated/src/operations/index.js.map +1 -1
  61. package/dist/browser/generated/src/operationsInterfaces/callConnection.d.ts +2 -9
  62. package/dist/browser/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
  63. package/dist/browser/generated/src/operationsInterfaces/callConnection.js.map +1 -1
  64. package/dist/browser/generated/src/operationsInterfaces/callMedia.d.ts +15 -15
  65. package/dist/browser/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
  66. package/dist/browser/generated/src/operationsInterfaces/callMedia.js.map +1 -1
  67. package/dist/browser/generated/src/operationsInterfaces/callRecording.d.ts +1 -7
  68. package/dist/browser/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
  69. package/dist/browser/generated/src/operationsInterfaces/callRecording.js.map +1 -1
  70. package/dist/browser/generated/src/operationsInterfaces/index.d.ts +0 -1
  71. package/dist/browser/generated/src/operationsInterfaces/index.d.ts.map +1 -1
  72. package/dist/browser/generated/src/operationsInterfaces/index.js +0 -1
  73. package/dist/browser/generated/src/operationsInterfaces/index.js.map +1 -1
  74. package/dist/browser/generated/src/pagingHelper.js +2 -4
  75. package/dist/browser/generated/src/pagingHelper.js.map +1 -1
  76. package/dist/browser/index.d.ts +0 -2
  77. package/dist/browser/index.d.ts.map +1 -1
  78. package/dist/browser/index.js +0 -2
  79. package/dist/browser/index.js.map +1 -1
  80. package/dist/browser/models/constants.js +1 -1
  81. package/dist/browser/models/constants.js.map +1 -1
  82. package/dist/browser/models/events.d.ts +136 -195
  83. package/dist/browser/models/events.d.ts.map +1 -1
  84. package/dist/browser/models/events.js.map +1 -1
  85. package/dist/browser/models/models.d.ts +76 -39
  86. package/dist/browser/models/models.d.ts.map +1 -1
  87. package/dist/browser/models/models.js +1 -3
  88. package/dist/browser/models/models.js.map +1 -1
  89. package/dist/browser/models/options.d.ts +64 -30
  90. package/dist/browser/models/options.d.ts.map +1 -1
  91. package/dist/browser/models/options.js.map +1 -1
  92. package/dist/browser/models/responses.d.ts +19 -82
  93. package/dist/browser/models/responses.d.ts.map +1 -1
  94. package/dist/browser/models/responses.js.map +1 -1
  95. package/dist/browser/models/streaming.d.ts +38 -28
  96. package/dist/browser/models/streaming.d.ts.map +1 -1
  97. package/dist/browser/models/streaming.js +28 -57
  98. package/dist/browser/models/streaming.js.map +1 -1
  99. package/dist/browser/streamingData.d.ts.map +1 -1
  100. package/dist/browser/streamingData.js +15 -1
  101. package/dist/browser/streamingData.js.map +1 -1
  102. package/dist/browser/utli/converters.d.ts +1 -1
  103. package/dist/browser/utli/converters.d.ts.map +1 -1
  104. package/dist/browser/utli/converters.js +48 -9
  105. package/dist/browser/utli/converters.js.map +1 -1
  106. package/dist/commonjs/callAutomationClient.d.ts +0 -8
  107. package/dist/commonjs/callAutomationClient.d.ts.map +1 -1
  108. package/dist/commonjs/callAutomationClient.js +85 -139
  109. package/dist/commonjs/callAutomationClient.js.map +1 -1
  110. package/dist/commonjs/callAutomationEventParser.d.ts.map +1 -1
  111. package/dist/commonjs/callAutomationEventParser.js +21 -53
  112. package/dist/commonjs/callAutomationEventParser.js.map +1 -1
  113. package/dist/commonjs/callConnection.d.ts +12 -14
  114. package/dist/commonjs/callConnection.d.ts.map +1 -1
  115. package/dist/commonjs/callConnection.js +113 -185
  116. package/dist/commonjs/callConnection.js.map +1 -1
  117. package/dist/commonjs/callMedia.d.ts +15 -20
  118. package/dist/commonjs/callMedia.d.ts.map +1 -1
  119. package/dist/commonjs/callMedia.js +66 -185
  120. package/dist/commonjs/callMedia.js.map +1 -1
  121. package/dist/commonjs/callRecording.d.ts +2 -8
  122. package/dist/commonjs/callRecording.d.ts.map +1 -1
  123. package/dist/commonjs/callRecording.js +17 -27
  124. package/dist/commonjs/callRecording.js.map +1 -1
  125. package/dist/commonjs/contentDownloader.js +11 -12
  126. package/dist/commonjs/contentDownloader.js.map +1 -1
  127. package/dist/commonjs/credential/callAutomationAccessKeyCredentialPolicy.js +1 -2
  128. package/dist/commonjs/credential/callAutomationAccessKeyCredentialPolicy.js.map +1 -1
  129. package/dist/commonjs/credential/callAutomationAuthPolicy.js +1 -1
  130. package/dist/commonjs/credential/callAutomationAuthPolicy.js.map +1 -1
  131. package/dist/commonjs/generated/src/callAutomationApiClient.d.ts +1 -2
  132. package/dist/commonjs/generated/src/callAutomationApiClient.d.ts.map +1 -1
  133. package/dist/commonjs/generated/src/callAutomationApiClient.js +13 -5
  134. package/dist/commonjs/generated/src/callAutomationApiClient.js.map +1 -1
  135. package/dist/commonjs/generated/src/models/index.d.ts +534 -1064
  136. package/dist/commonjs/generated/src/models/index.d.ts.map +1 -1
  137. package/dist/commonjs/generated/src/models/index.js +88 -160
  138. package/dist/commonjs/generated/src/models/index.js.map +1 -1
  139. package/dist/commonjs/generated/src/models/mappers.d.ts +58 -86
  140. package/dist/commonjs/generated/src/models/mappers.d.ts.map +1 -1
  141. package/dist/commonjs/generated/src/models/mappers.js +1176 -2162
  142. package/dist/commonjs/generated/src/models/mappers.js.map +1 -1
  143. package/dist/commonjs/generated/src/models/parameters.d.ts +2 -7
  144. package/dist/commonjs/generated/src/models/parameters.d.ts.map +1 -1
  145. package/dist/commonjs/generated/src/models/parameters.js +10 -41
  146. package/dist/commonjs/generated/src/models/parameters.js.map +1 -1
  147. package/dist/commonjs/generated/src/operations/callConnection.d.ts +2 -9
  148. package/dist/commonjs/generated/src/operations/callConnection.d.ts.map +1 -1
  149. package/dist/commonjs/generated/src/operations/callConnection.js +24 -72
  150. package/dist/commonjs/generated/src/operations/callConnection.js.map +1 -1
  151. package/dist/commonjs/generated/src/operations/callMedia.d.ts +15 -15
  152. package/dist/commonjs/generated/src/operations/callMedia.d.ts.map +1 -1
  153. package/dist/commonjs/generated/src/operations/callMedia.js +51 -50
  154. package/dist/commonjs/generated/src/operations/callMedia.js.map +1 -1
  155. package/dist/commonjs/generated/src/operations/callRecording.d.ts +1 -7
  156. package/dist/commonjs/generated/src/operations/callRecording.d.ts.map +1 -1
  157. package/dist/commonjs/generated/src/operations/callRecording.js +1 -24
  158. package/dist/commonjs/generated/src/operations/callRecording.js.map +1 -1
  159. package/dist/commonjs/generated/src/operations/index.d.ts +0 -1
  160. package/dist/commonjs/generated/src/operations/index.d.ts.map +1 -1
  161. package/dist/commonjs/generated/src/operations/index.js +0 -1
  162. package/dist/commonjs/generated/src/operations/index.js.map +1 -1
  163. package/dist/commonjs/generated/src/operationsInterfaces/callConnection.d.ts +2 -9
  164. package/dist/commonjs/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
  165. package/dist/commonjs/generated/src/operationsInterfaces/callConnection.js.map +1 -1
  166. package/dist/commonjs/generated/src/operationsInterfaces/callMedia.d.ts +15 -15
  167. package/dist/commonjs/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
  168. package/dist/commonjs/generated/src/operationsInterfaces/callMedia.js.map +1 -1
  169. package/dist/commonjs/generated/src/operationsInterfaces/callRecording.d.ts +1 -7
  170. package/dist/commonjs/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
  171. package/dist/commonjs/generated/src/operationsInterfaces/callRecording.js.map +1 -1
  172. package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts +0 -1
  173. package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts.map +1 -1
  174. package/dist/commonjs/generated/src/operationsInterfaces/index.js +0 -1
  175. package/dist/commonjs/generated/src/operationsInterfaces/index.js.map +1 -1
  176. package/dist/commonjs/generated/src/pagingHelper.js +2 -4
  177. package/dist/commonjs/generated/src/pagingHelper.js.map +1 -1
  178. package/dist/commonjs/index.d.ts +0 -2
  179. package/dist/commonjs/index.d.ts.map +1 -1
  180. package/dist/commonjs/index.js +0 -2
  181. package/dist/commonjs/index.js.map +1 -1
  182. package/dist/commonjs/models/constants.js +1 -1
  183. package/dist/commonjs/models/constants.js.map +1 -1
  184. package/dist/commonjs/models/events.d.ts +136 -195
  185. package/dist/commonjs/models/events.d.ts.map +1 -1
  186. package/dist/commonjs/models/events.js.map +1 -1
  187. package/dist/commonjs/models/models.d.ts +76 -39
  188. package/dist/commonjs/models/models.d.ts.map +1 -1
  189. package/dist/commonjs/models/models.js +2 -21
  190. package/dist/commonjs/models/models.js.map +1 -1
  191. package/dist/commonjs/models/options.d.ts +64 -30
  192. package/dist/commonjs/models/options.d.ts.map +1 -1
  193. package/dist/commonjs/models/options.js.map +1 -1
  194. package/dist/commonjs/models/responses.d.ts +19 -82
  195. package/dist/commonjs/models/responses.d.ts.map +1 -1
  196. package/dist/commonjs/models/responses.js.map +1 -1
  197. package/dist/commonjs/models/streaming.d.ts +38 -28
  198. package/dist/commonjs/models/streaming.d.ts.map +1 -1
  199. package/dist/commonjs/models/streaming.js +31 -59
  200. package/dist/commonjs/models/streaming.js.map +1 -1
  201. package/dist/commonjs/streamingData.d.ts.map +1 -1
  202. package/dist/commonjs/streamingData.js +15 -1
  203. package/dist/commonjs/streamingData.js.map +1 -1
  204. package/dist/commonjs/tsdoc-metadata.json +11 -11
  205. package/dist/commonjs/utli/converters.d.ts +1 -1
  206. package/dist/commonjs/utli/converters.d.ts.map +1 -1
  207. package/dist/commonjs/utli/converters.js +47 -8
  208. package/dist/commonjs/utli/converters.js.map +1 -1
  209. package/dist/esm/callAutomationClient.d.ts +0 -8
  210. package/dist/esm/callAutomationClient.d.ts.map +1 -1
  211. package/dist/esm/callAutomationClient.js +87 -141
  212. package/dist/esm/callAutomationClient.js.map +1 -1
  213. package/dist/esm/callAutomationEventParser.d.ts.map +1 -1
  214. package/dist/esm/callAutomationEventParser.js +22 -54
  215. package/dist/esm/callAutomationEventParser.js.map +1 -1
  216. package/dist/esm/callConnection.d.ts +12 -14
  217. package/dist/esm/callConnection.d.ts.map +1 -1
  218. package/dist/esm/callConnection.js +111 -183
  219. package/dist/esm/callConnection.js.map +1 -1
  220. package/dist/esm/callMedia.d.ts +15 -20
  221. package/dist/esm/callMedia.d.ts.map +1 -1
  222. package/dist/esm/callMedia.js +58 -177
  223. package/dist/esm/callMedia.js.map +1 -1
  224. package/dist/esm/callRecording.d.ts +2 -8
  225. package/dist/esm/callRecording.d.ts.map +1 -1
  226. package/dist/esm/callRecording.js +16 -26
  227. package/dist/esm/callRecording.js.map +1 -1
  228. package/dist/esm/contentDownloader.js +11 -12
  229. package/dist/esm/contentDownloader.js.map +1 -1
  230. package/dist/esm/credential/callAutomationAccessKeyCredentialPolicy.js +1 -2
  231. package/dist/esm/credential/callAutomationAccessKeyCredentialPolicy.js.map +1 -1
  232. package/dist/esm/credential/callAutomationAuthPolicy.js +1 -1
  233. package/dist/esm/credential/callAutomationAuthPolicy.js.map +1 -1
  234. package/dist/esm/generated/src/callAutomationApiClient.d.ts +1 -2
  235. package/dist/esm/generated/src/callAutomationApiClient.d.ts.map +1 -1
  236. package/dist/esm/generated/src/callAutomationApiClient.js +14 -6
  237. package/dist/esm/generated/src/callAutomationApiClient.js.map +1 -1
  238. package/dist/esm/generated/src/models/index.d.ts +534 -1064
  239. package/dist/esm/generated/src/models/index.d.ts.map +1 -1
  240. package/dist/esm/generated/src/models/index.js +87 -159
  241. package/dist/esm/generated/src/models/index.js.map +1 -1
  242. package/dist/esm/generated/src/models/mappers.d.ts +58 -86
  243. package/dist/esm/generated/src/models/mappers.d.ts.map +1 -1
  244. package/dist/esm/generated/src/models/mappers.js +1173 -2159
  245. package/dist/esm/generated/src/models/mappers.js.map +1 -1
  246. package/dist/esm/generated/src/models/parameters.d.ts +2 -7
  247. package/dist/esm/generated/src/models/parameters.d.ts.map +1 -1
  248. package/dist/esm/generated/src/models/parameters.js +10 -41
  249. package/dist/esm/generated/src/models/parameters.js.map +1 -1
  250. package/dist/esm/generated/src/operations/callConnection.d.ts +2 -9
  251. package/dist/esm/generated/src/operations/callConnection.d.ts.map +1 -1
  252. package/dist/esm/generated/src/operations/callConnection.js +24 -73
  253. package/dist/esm/generated/src/operations/callConnection.js.map +1 -1
  254. package/dist/esm/generated/src/operations/callMedia.d.ts +15 -15
  255. package/dist/esm/generated/src/operations/callMedia.d.ts.map +1 -1
  256. package/dist/esm/generated/src/operations/callMedia.js +51 -50
  257. package/dist/esm/generated/src/operations/callMedia.js.map +1 -1
  258. package/dist/esm/generated/src/operations/callRecording.d.ts +1 -7
  259. package/dist/esm/generated/src/operations/callRecording.d.ts.map +1 -1
  260. package/dist/esm/generated/src/operations/callRecording.js +1 -24
  261. package/dist/esm/generated/src/operations/callRecording.js.map +1 -1
  262. package/dist/esm/generated/src/operations/index.d.ts +0 -1
  263. package/dist/esm/generated/src/operations/index.d.ts.map +1 -1
  264. package/dist/esm/generated/src/operations/index.js +0 -1
  265. package/dist/esm/generated/src/operations/index.js.map +1 -1
  266. package/dist/esm/generated/src/operationsInterfaces/callConnection.d.ts +2 -9
  267. package/dist/esm/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
  268. package/dist/esm/generated/src/operationsInterfaces/callConnection.js.map +1 -1
  269. package/dist/esm/generated/src/operationsInterfaces/callMedia.d.ts +15 -15
  270. package/dist/esm/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
  271. package/dist/esm/generated/src/operationsInterfaces/callMedia.js.map +1 -1
  272. package/dist/esm/generated/src/operationsInterfaces/callRecording.d.ts +1 -7
  273. package/dist/esm/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
  274. package/dist/esm/generated/src/operationsInterfaces/callRecording.js.map +1 -1
  275. package/dist/esm/generated/src/operationsInterfaces/index.d.ts +0 -1
  276. package/dist/esm/generated/src/operationsInterfaces/index.d.ts.map +1 -1
  277. package/dist/esm/generated/src/operationsInterfaces/index.js +0 -1
  278. package/dist/esm/generated/src/operationsInterfaces/index.js.map +1 -1
  279. package/dist/esm/generated/src/pagingHelper.js +2 -4
  280. package/dist/esm/generated/src/pagingHelper.js.map +1 -1
  281. package/dist/esm/index.d.ts +0 -2
  282. package/dist/esm/index.d.ts.map +1 -1
  283. package/dist/esm/index.js +0 -2
  284. package/dist/esm/index.js.map +1 -1
  285. package/dist/esm/models/constants.js +1 -1
  286. package/dist/esm/models/constants.js.map +1 -1
  287. package/dist/esm/models/events.d.ts +136 -195
  288. package/dist/esm/models/events.d.ts.map +1 -1
  289. package/dist/esm/models/events.js.map +1 -1
  290. package/dist/esm/models/models.d.ts +76 -39
  291. package/dist/esm/models/models.d.ts.map +1 -1
  292. package/dist/esm/models/models.js +1 -3
  293. package/dist/esm/models/models.js.map +1 -1
  294. package/dist/esm/models/options.d.ts +64 -30
  295. package/dist/esm/models/options.d.ts.map +1 -1
  296. package/dist/esm/models/options.js.map +1 -1
  297. package/dist/esm/models/responses.d.ts +19 -82
  298. package/dist/esm/models/responses.d.ts.map +1 -1
  299. package/dist/esm/models/responses.js.map +1 -1
  300. package/dist/esm/models/streaming.d.ts +38 -28
  301. package/dist/esm/models/streaming.d.ts.map +1 -1
  302. package/dist/esm/models/streaming.js +28 -57
  303. package/dist/esm/models/streaming.js.map +1 -1
  304. package/dist/esm/streamingData.d.ts.map +1 -1
  305. package/dist/esm/streamingData.js +15 -1
  306. package/dist/esm/streamingData.js.map +1 -1
  307. package/dist/esm/utli/converters.d.ts +1 -1
  308. package/dist/esm/utli/converters.d.ts.map +1 -1
  309. package/dist/esm/utli/converters.js +48 -9
  310. package/dist/esm/utli/converters.js.map +1 -1
  311. package/dist/react-native/callAutomationClient.d.ts +0 -8
  312. package/dist/react-native/callAutomationClient.d.ts.map +1 -1
  313. package/dist/react-native/callAutomationClient.js +87 -141
  314. package/dist/react-native/callAutomationClient.js.map +1 -1
  315. package/dist/react-native/callAutomationEventParser.d.ts.map +1 -1
  316. package/dist/react-native/callAutomationEventParser.js +22 -54
  317. package/dist/react-native/callAutomationEventParser.js.map +1 -1
  318. package/dist/react-native/callConnection.d.ts +12 -14
  319. package/dist/react-native/callConnection.d.ts.map +1 -1
  320. package/dist/react-native/callConnection.js +111 -183
  321. package/dist/react-native/callConnection.js.map +1 -1
  322. package/dist/react-native/callMedia.d.ts +15 -20
  323. package/dist/react-native/callMedia.d.ts.map +1 -1
  324. package/dist/react-native/callMedia.js +58 -177
  325. package/dist/react-native/callMedia.js.map +1 -1
  326. package/dist/react-native/callRecording.d.ts +2 -8
  327. package/dist/react-native/callRecording.d.ts.map +1 -1
  328. package/dist/react-native/callRecording.js +16 -26
  329. package/dist/react-native/callRecording.js.map +1 -1
  330. package/dist/react-native/contentDownloader.js +11 -12
  331. package/dist/react-native/contentDownloader.js.map +1 -1
  332. package/dist/react-native/credential/callAutomationAccessKeyCredentialPolicy.js +1 -2
  333. package/dist/react-native/credential/callAutomationAccessKeyCredentialPolicy.js.map +1 -1
  334. package/dist/react-native/credential/callAutomationAuthPolicy.js +1 -1
  335. package/dist/react-native/credential/callAutomationAuthPolicy.js.map +1 -1
  336. package/dist/react-native/generated/src/callAutomationApiClient.d.ts +1 -2
  337. package/dist/react-native/generated/src/callAutomationApiClient.d.ts.map +1 -1
  338. package/dist/react-native/generated/src/callAutomationApiClient.js +14 -6
  339. package/dist/react-native/generated/src/callAutomationApiClient.js.map +1 -1
  340. package/dist/react-native/generated/src/models/index.d.ts +534 -1064
  341. package/dist/react-native/generated/src/models/index.d.ts.map +1 -1
  342. package/dist/react-native/generated/src/models/index.js +87 -159
  343. package/dist/react-native/generated/src/models/index.js.map +1 -1
  344. package/dist/react-native/generated/src/models/mappers.d.ts +58 -86
  345. package/dist/react-native/generated/src/models/mappers.d.ts.map +1 -1
  346. package/dist/react-native/generated/src/models/mappers.js +1173 -2159
  347. package/dist/react-native/generated/src/models/mappers.js.map +1 -1
  348. package/dist/react-native/generated/src/models/parameters.d.ts +2 -7
  349. package/dist/react-native/generated/src/models/parameters.d.ts.map +1 -1
  350. package/dist/react-native/generated/src/models/parameters.js +10 -41
  351. package/dist/react-native/generated/src/models/parameters.js.map +1 -1
  352. package/dist/react-native/generated/src/operations/callConnection.d.ts +2 -9
  353. package/dist/react-native/generated/src/operations/callConnection.d.ts.map +1 -1
  354. package/dist/react-native/generated/src/operations/callConnection.js +24 -73
  355. package/dist/react-native/generated/src/operations/callConnection.js.map +1 -1
  356. package/dist/react-native/generated/src/operations/callMedia.d.ts +15 -15
  357. package/dist/react-native/generated/src/operations/callMedia.d.ts.map +1 -1
  358. package/dist/react-native/generated/src/operations/callMedia.js +51 -50
  359. package/dist/react-native/generated/src/operations/callMedia.js.map +1 -1
  360. package/dist/react-native/generated/src/operations/callRecording.d.ts +1 -7
  361. package/dist/react-native/generated/src/operations/callRecording.d.ts.map +1 -1
  362. package/dist/react-native/generated/src/operations/callRecording.js +1 -24
  363. package/dist/react-native/generated/src/operations/callRecording.js.map +1 -1
  364. package/dist/react-native/generated/src/operations/index.d.ts +0 -1
  365. package/dist/react-native/generated/src/operations/index.d.ts.map +1 -1
  366. package/dist/react-native/generated/src/operations/index.js +0 -1
  367. package/dist/react-native/generated/src/operations/index.js.map +1 -1
  368. package/dist/react-native/generated/src/operationsInterfaces/callConnection.d.ts +2 -9
  369. package/dist/react-native/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
  370. package/dist/react-native/generated/src/operationsInterfaces/callConnection.js.map +1 -1
  371. package/dist/react-native/generated/src/operationsInterfaces/callMedia.d.ts +15 -15
  372. package/dist/react-native/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
  373. package/dist/react-native/generated/src/operationsInterfaces/callMedia.js.map +1 -1
  374. package/dist/react-native/generated/src/operationsInterfaces/callRecording.d.ts +1 -7
  375. package/dist/react-native/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
  376. package/dist/react-native/generated/src/operationsInterfaces/callRecording.js.map +1 -1
  377. package/dist/react-native/generated/src/operationsInterfaces/index.d.ts +0 -1
  378. package/dist/react-native/generated/src/operationsInterfaces/index.d.ts.map +1 -1
  379. package/dist/react-native/generated/src/operationsInterfaces/index.js +0 -1
  380. package/dist/react-native/generated/src/operationsInterfaces/index.js.map +1 -1
  381. package/dist/react-native/generated/src/pagingHelper.js +2 -4
  382. package/dist/react-native/generated/src/pagingHelper.js.map +1 -1
  383. package/dist/react-native/index.d.ts +0 -2
  384. package/dist/react-native/index.d.ts.map +1 -1
  385. package/dist/react-native/index.js +0 -2
  386. package/dist/react-native/index.js.map +1 -1
  387. package/dist/react-native/models/constants.js +1 -1
  388. package/dist/react-native/models/constants.js.map +1 -1
  389. package/dist/react-native/models/events.d.ts +136 -195
  390. package/dist/react-native/models/events.d.ts.map +1 -1
  391. package/dist/react-native/models/events.js.map +1 -1
  392. package/dist/react-native/models/models.d.ts +76 -39
  393. package/dist/react-native/models/models.d.ts.map +1 -1
  394. package/dist/react-native/models/models.js +1 -3
  395. package/dist/react-native/models/models.js.map +1 -1
  396. package/dist/react-native/models/options.d.ts +64 -30
  397. package/dist/react-native/models/options.d.ts.map +1 -1
  398. package/dist/react-native/models/options.js.map +1 -1
  399. package/dist/react-native/models/responses.d.ts +19 -82
  400. package/dist/react-native/models/responses.d.ts.map +1 -1
  401. package/dist/react-native/models/responses.js.map +1 -1
  402. package/dist/react-native/models/streaming.d.ts +38 -28
  403. package/dist/react-native/models/streaming.d.ts.map +1 -1
  404. package/dist/react-native/models/streaming.js +28 -57
  405. package/dist/react-native/models/streaming.js.map +1 -1
  406. package/dist/react-native/streamingData.d.ts.map +1 -1
  407. package/dist/react-native/streamingData.js +15 -1
  408. package/dist/react-native/streamingData.js.map +1 -1
  409. package/dist/react-native/utli/converters.d.ts +1 -1
  410. package/dist/react-native/utli/converters.d.ts.map +1 -1
  411. package/dist/react-native/utli/converters.js +48 -9
  412. package/dist/react-native/utli/converters.js.map +1 -1
  413. package/package.json +35 -36
  414. package/dist/browser/eventprocessor/callAutomationEventProcessor.d.ts +0 -39
  415. package/dist/browser/eventprocessor/callAutomationEventProcessor.d.ts.map +0 -1
  416. package/dist/browser/eventprocessor/callAutomationEventProcessor.js +0 -137
  417. package/dist/browser/eventprocessor/callAutomationEventProcessor.js.map +0 -1
  418. package/dist/browser/eventprocessor/eventResponses.d.ts +0 -134
  419. package/dist/browser/eventprocessor/eventResponses.d.ts.map +0 -1
  420. package/dist/browser/eventprocessor/eventResponses.js +0 -4
  421. package/dist/browser/eventprocessor/eventResponses.js.map +0 -1
  422. package/dist/browser/generated/src/operations/callDialog.d.ts +0 -35
  423. package/dist/browser/generated/src/operations/callDialog.d.ts.map +0 -1
  424. package/dist/browser/generated/src/operations/callDialog.js +0 -111
  425. package/dist/browser/generated/src/operations/callDialog.js.map +0 -1
  426. package/dist/browser/generated/src/operationsInterfaces/callDialog.d.ts +0 -27
  427. package/dist/browser/generated/src/operationsInterfaces/callDialog.d.ts.map +0 -1
  428. package/dist/browser/generated/src/operationsInterfaces/callDialog.js +0 -9
  429. package/dist/browser/generated/src/operationsInterfaces/callDialog.js.map +0 -1
  430. package/dist/commonjs/eventprocessor/callAutomationEventProcessor.d.ts +0 -39
  431. package/dist/commonjs/eventprocessor/callAutomationEventProcessor.d.ts.map +0 -1
  432. package/dist/commonjs/eventprocessor/callAutomationEventProcessor.js +0 -141
  433. package/dist/commonjs/eventprocessor/callAutomationEventProcessor.js.map +0 -1
  434. package/dist/commonjs/eventprocessor/eventResponses.d.ts +0 -134
  435. package/dist/commonjs/eventprocessor/eventResponses.d.ts.map +0 -1
  436. package/dist/commonjs/eventprocessor/eventResponses.js +0 -5
  437. package/dist/commonjs/eventprocessor/eventResponses.js.map +0 -1
  438. package/dist/commonjs/generated/src/operations/callDialog.d.ts +0 -35
  439. package/dist/commonjs/generated/src/operations/callDialog.d.ts.map +0 -1
  440. package/dist/commonjs/generated/src/operations/callDialog.js +0 -116
  441. package/dist/commonjs/generated/src/operations/callDialog.js.map +0 -1
  442. package/dist/commonjs/generated/src/operationsInterfaces/callDialog.d.ts +0 -27
  443. package/dist/commonjs/generated/src/operationsInterfaces/callDialog.d.ts.map +0 -1
  444. package/dist/commonjs/generated/src/operationsInterfaces/callDialog.js +0 -10
  445. package/dist/commonjs/generated/src/operationsInterfaces/callDialog.js.map +0 -1
  446. package/dist/esm/eventprocessor/callAutomationEventProcessor.d.ts +0 -39
  447. package/dist/esm/eventprocessor/callAutomationEventProcessor.d.ts.map +0 -1
  448. package/dist/esm/eventprocessor/callAutomationEventProcessor.js +0 -137
  449. package/dist/esm/eventprocessor/callAutomationEventProcessor.js.map +0 -1
  450. package/dist/esm/eventprocessor/eventResponses.d.ts +0 -134
  451. package/dist/esm/eventprocessor/eventResponses.d.ts.map +0 -1
  452. package/dist/esm/eventprocessor/eventResponses.js +0 -4
  453. package/dist/esm/eventprocessor/eventResponses.js.map +0 -1
  454. package/dist/esm/generated/src/operations/callDialog.d.ts +0 -35
  455. package/dist/esm/generated/src/operations/callDialog.d.ts.map +0 -1
  456. package/dist/esm/generated/src/operations/callDialog.js +0 -111
  457. package/dist/esm/generated/src/operations/callDialog.js.map +0 -1
  458. package/dist/esm/generated/src/operationsInterfaces/callDialog.d.ts +0 -27
  459. package/dist/esm/generated/src/operationsInterfaces/callDialog.d.ts.map +0 -1
  460. package/dist/esm/generated/src/operationsInterfaces/callDialog.js +0 -9
  461. package/dist/esm/generated/src/operationsInterfaces/callDialog.js.map +0 -1
  462. package/dist/react-native/eventprocessor/callAutomationEventProcessor.d.ts +0 -39
  463. package/dist/react-native/eventprocessor/callAutomationEventProcessor.d.ts.map +0 -1
  464. package/dist/react-native/eventprocessor/callAutomationEventProcessor.js +0 -137
  465. package/dist/react-native/eventprocessor/callAutomationEventProcessor.js.map +0 -1
  466. package/dist/react-native/eventprocessor/eventResponses.d.ts +0 -134
  467. package/dist/react-native/eventprocessor/eventResponses.d.ts.map +0 -1
  468. package/dist/react-native/eventprocessor/eventResponses.js +0 -4
  469. package/dist/react-native/eventprocessor/eventResponses.js.map +0 -1
  470. package/dist/react-native/generated/src/operations/callDialog.d.ts +0 -35
  471. package/dist/react-native/generated/src/operations/callDialog.d.ts.map +0 -1
  472. package/dist/react-native/generated/src/operations/callDialog.js +0 -111
  473. package/dist/react-native/generated/src/operations/callDialog.js.map +0 -1
  474. package/dist/react-native/generated/src/operationsInterfaces/callDialog.d.ts +0 -27
  475. package/dist/react-native/generated/src/operationsInterfaces/callDialog.d.ts.map +0 -1
  476. package/dist/react-native/generated/src/operationsInterfaces/callDialog.js +0 -9
  477. package/dist/react-native/generated/src/operationsInterfaces/callDialog.js.map +0 -1
@@ -3,15 +3,21 @@
3
3
  import { CallRecordingImpl } from "./generated/src/operations/index.js";
4
4
  import { communicationIdentifierModelConverter } from "./utli/converters.js";
5
5
  import { ContentDownloaderImpl } from "./contentDownloader.js";
6
- import * as fs from "node:fs";
6
+ import fs from "node:fs";
7
7
  import { randomUUID } from "@azure/core-util";
8
- import { createCustomCallAutomationApiClient } from "./credential/callAutomationAuthPolicy.js";
8
+ import { CallAutomationApiClient } from "./generated/src/index.js";
9
+ import { createCommunicationAuthPolicy } from "@azure/communication-common";
9
10
  /**
10
11
  * CallRecording class represents call recording related APIs.
11
12
  */
12
13
  export class CallRecording {
14
+ callRecordingImpl;
15
+ contentDownloader;
16
+ callAutomationApiClient;
13
17
  constructor(endpoint, credential, options) {
14
- this.callAutomationApiClient = createCustomCallAutomationApiClient(credential, options, endpoint);
18
+ this.callAutomationApiClient = new CallAutomationApiClient(endpoint, options);
19
+ const authPolicy = createCommunicationAuthPolicy(credential);
20
+ this.callAutomationApiClient.pipeline.addPolicy(authPolicy);
15
21
  this.callRecordingImpl = new CallRecordingImpl(this.callAutomationApiClient);
16
22
  this.contentDownloader = new ContentDownloaderImpl(this.callAutomationApiClient);
17
23
  }
@@ -36,8 +42,7 @@ export class CallRecording {
36
42
  if (options.channelAffinity) {
37
43
  startCallRecordingRequest.channelAffinity = [];
38
44
  options.channelAffinity.forEach((identifier) => {
39
- var _a;
40
- (_a = startCallRecordingRequest.channelAffinity) === null || _a === void 0 ? void 0 : _a.push({
45
+ startCallRecordingRequest.channelAffinity?.push({
41
46
  participant: communicationIdentifierModelConverter(identifier.targetParticipant),
42
47
  channel: identifier.channel,
43
48
  });
@@ -46,8 +51,7 @@ export class CallRecording {
46
51
  if (options.audioChannelParticipantOrdering) {
47
52
  startCallRecordingRequest.audioChannelParticipantOrdering = [];
48
53
  options.audioChannelParticipantOrdering.forEach((identifier) => {
49
- var _a;
50
- (_a = startCallRecordingRequest.audioChannelParticipantOrdering) === null || _a === void 0 ? void 0 : _a.push(communicationIdentifierModelConverter(identifier));
54
+ startCallRecordingRequest.audioChannelParticipantOrdering?.push(communicationIdentifierModelConverter(identifier));
51
55
  });
52
56
  }
53
57
  if (options.callLocator) {
@@ -70,7 +74,11 @@ export class CallRecording {
70
74
  };
71
75
  }
72
76
  }
73
- const optionsInternal = Object.assign(Object.assign({}, options), { repeatabilityFirstSent: new Date(), repeatabilityRequestID: randomUUID() });
77
+ const optionsInternal = {
78
+ ...options,
79
+ repeatabilityFirstSent: new Date(),
80
+ repeatabilityRequestID: randomUUID(),
81
+ };
74
82
  const response = await this.callRecordingImpl.startRecording(startCallRecordingRequest, optionsInternal);
75
83
  const result = {
76
84
  recordingId: response.recordingId,
@@ -117,24 +125,6 @@ export class CallRecording {
117
125
  async resume(recordingId, options = {}) {
118
126
  return this.callRecordingImpl.resumeRecording(recordingId, options);
119
127
  }
120
- /**
121
- * Returns call recording result.
122
- * @param recordingId - The recordingId associated with the recording.
123
- * @param options - Additional request options contains getRecordingProperties api options.
124
- */
125
- async getRecordingResult(recordingId, options = {}) {
126
- const response = await this.callRecordingImpl.getRecordingResult(recordingId, options);
127
- const result = {
128
- recordingId: response.recordingId,
129
- errors: response.errors,
130
- recordingDurationMs: response.recordingDurationMs,
131
- recordingExpirationTime: response.recordingExpirationTime,
132
- recordingStartTime: response.recordingStartTime,
133
- recordingStorageInfo: response.recordingStorageInfo,
134
- sessionEndReason: response.sessionEndReason,
135
- };
136
- return result;
137
- }
138
128
  /**
139
129
  * Deletes a recording.
140
130
  * @param recordingLocationUrl - The recording location url. Required.
@@ -1 +1 @@
1
- {"version":3,"file":"callRecording.js","sourceRoot":"","sources":["../../src/callRecording.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAgBxE,OAAO,EAAE,qCAAqC,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,OAAO,EAAE,m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\nimport { CallRecordingImpl } from \"./generated/src/operations/index.js\";\nimport type {\n CallAutomationApiClientOptionalParams,\n StartCallRecordingRequest,\n} from \"./generated/src/models/index.js\";\nimport type { RecordingResult, RecordingStateResult } from \"./models/responses.js\";\nimport type {\n StartRecordingOptions,\n StopRecordingOptions,\n PauseRecordingOptions,\n GetRecordingPropertiesOptions,\n GetRecordingResultOptions,\n ResumeRecordingOptions,\n DeleteRecordingOptions,\n DownloadRecordingOptions,\n} from \"./models/options.js\";\nimport { communicationIdentifierModelConverter } from \"./utli/converters.js\";\nimport { ContentDownloaderImpl } from \"./contentDownloader.js\";\nimport * as fs from \"node:fs\";\nimport { randomUUID } from \"@azure/core-util\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport type { CallAutomationApiClient } from \"./generated/src/index.js\";\nimport { createCustomCallAutomationApiClient } from \"./credential/callAutomationAuthPolicy.js\";\n\n/**\n * CallRecording class represents call recording related APIs.\n */\nexport class CallRecording {\n private readonly callRecordingImpl: CallRecordingImpl;\n private readonly contentDownloader: ContentDownloaderImpl;\n private readonly callAutomationApiClient: CallAutomationApiClient;\n\n constructor(\n endpoint: string,\n credential: KeyCredential | TokenCredential,\n options?: CallAutomationApiClientOptionalParams,\n ) {\n this.callAutomationApiClient = createCustomCallAutomationApiClient(\n credential,\n options,\n endpoint,\n );\n\n this.callRecordingImpl = new CallRecordingImpl(this.callAutomationApiClient);\n this.contentDownloader = new ContentDownloaderImpl(this.callAutomationApiClient);\n }\n\n /**\n * Starts a call recording with the specified options.\n * @param startCallRecordingRequest - options to start the call recording\n * @param options - Operation options.\n */\n public async start(options: StartRecordingOptions): Promise<RecordingStateResult> {\n const startCallRecordingRequest: StartCallRecordingRequest = {\n callLocator: options.callLocator ? options.callLocator : undefined,\n };\n\n startCallRecordingRequest.recordingChannelType = options.recordingChannel;\n startCallRecordingRequest.recordingContentType = options.recordingContent;\n startCallRecordingRequest.recordingFormatType = options.recordingFormat;\n startCallRecordingRequest.recordingStateCallbackUri = options.recordingStateCallbackEndpointUrl;\n startCallRecordingRequest.pauseOnStart = options.pauseOnStart;\n startCallRecordingRequest.recordingStorage = options.recordingStorage;\n startCallRecordingRequest.callConnectionId = options.callConnectionId\n ? options.callConnectionId\n : undefined;\n\n if (options.channelAffinity) {\n startCallRecordingRequest.channelAffinity = [];\n options.channelAffinity.forEach((identifier) => {\n startCallRecordingRequest.channelAffinity?.push({\n participant: communicationIdentifierModelConverter(identifier.targetParticipant),\n channel: identifier.channel,\n });\n });\n }\n\n if (options.audioChannelParticipantOrdering) {\n startCallRecordingRequest.audioChannelParticipantOrdering = [];\n options.audioChannelParticipantOrdering.forEach((identifier) => {\n startCallRecordingRequest.audioChannelParticipantOrdering?.push(\n communicationIdentifierModelConverter(identifier),\n );\n });\n }\n if (options.callLocator) {\n if (options.callLocator.kind === \"groupCallLocator\") {\n startCallRecordingRequest.callLocator = {\n groupCallId: options.callLocator.id,\n kind: \"groupCallLocator\",\n };\n } else if (options.callLocator.kind === \"roomCallLocator\") {\n startCallRecordingRequest.callLocator = {\n roomId: options.callLocator.id,\n kind: \"roomCallLocator\",\n };\n } else {\n startCallRecordingRequest.callLocator = {\n serverCallId: options.callLocator.id,\n kind: \"serverCallLocator\",\n };\n }\n }\n\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const response = await this.callRecordingImpl.startRecording(\n startCallRecordingRequest,\n optionsInternal,\n );\n\n const result: RecordingStateResult = {\n recordingId: response.recordingId!,\n recordingKind: response.recordingKind!,\n recordingState: response.recordingState!,\n };\n\n return result;\n }\n\n /**\n * Returns call recording properties.\n * @param recordingId - The recordingId associated with the recording.\n * @param options - Additional request options contains getRecordingProperties api options.\n */\n public async getState(\n recordingId: string,\n options: GetRecordingPropertiesOptions = {},\n ): Promise<RecordingStateResult> {\n const response = await this.callRecordingImpl.getRecordingProperties(recordingId, options);\n\n const result: RecordingStateResult = {\n recordingId: response.recordingId!,\n recordingKind: response.recordingKind!,\n recordingState: response.recordingState!,\n };\n\n return result;\n }\n\n /**\n * Stops a call recording.\n * @param recordingId - The recordingId associated with the recording.\n * @param options - Additional request options contains stopRecording api options.\n */\n public async stop(recordingId: string, options: StopRecordingOptions = {}): Promise<void> {\n return this.callRecordingImpl.stopRecording(recordingId, options);\n }\n\n /**\n * Pauses a call recording.\n * @param recordingId - The recordingId associated with the recording.\n * @param options - Additional request options contains pauseRecording api options.\n */\n public async pause(recordingId: string, options: PauseRecordingOptions = {}): Promise<void> {\n return this.callRecordingImpl.pauseRecording(recordingId, options);\n }\n\n /**\n * Resumes a call recording.\n * @param recordingId - The recordingId associated with the recording.\n * @param options - Additional request options contains resumeRecording api options.\n */\n public async resume(recordingId: string, options: ResumeRecordingOptions = {}): Promise<void> {\n return this.callRecordingImpl.resumeRecording(recordingId, options);\n }\n\n /**\n * Returns call recording result.\n * @param recordingId - The recordingId associated with the recording.\n * @param options - Additional request options contains getRecordingProperties api options.\n */\n public async getRecordingResult(\n recordingId: string,\n options: GetRecordingResultOptions = {},\n ): Promise<RecordingResult> {\n const response = await this.callRecordingImpl.getRecordingResult(recordingId, options);\n\n const result: RecordingResult = {\n recordingId: response.recordingId!,\n errors: response.errors,\n recordingDurationMs: response.recordingDurationMs,\n recordingExpirationTime: response.recordingExpirationTime,\n recordingStartTime: response.recordingStartTime,\n recordingStorageInfo: response.recordingStorageInfo,\n sessionEndReason: response.sessionEndReason,\n };\n\n return result;\n }\n\n /**\n * Deletes a recording.\n * @param recordingLocationUrl - The recording location url. Required.\n * @param options - Additional request options contains deleteRecording api options.\n */\n public async delete(\n recordingLocationUrl: string,\n options: DeleteRecordingOptions = {},\n ): Promise<void> {\n await this.contentDownloader.deleteRecording(recordingLocationUrl, options);\n }\n\n /**\n * Returns a stream with a call recording.\n * @param sourceLocationUrl - The source location url. Required.\n * @param options - Additional request options contains downloadRecording api options.\n */\n public async downloadStreaming(\n sourceLocationUrl: string,\n options: DownloadRecordingOptions = {},\n ): Promise<NodeJS.ReadableStream> {\n const result = this.contentDownloader.download(sourceLocationUrl, options);\n const recordingStream = (await result).readableStreamBody;\n if (recordingStream) {\n return recordingStream;\n } else {\n throw Error(\"failed to get stream\");\n }\n }\n\n /**\n * Downloads a call recording file to the specified stream.\n * @param sourceLocationUrl - The source location url. Required.\n * @param destinationStream - The destination stream. Required.\n * @param options - Additional request options contains downloadRecording api options.\n */\n public async downloadToStream(\n sourceLocationUrl: string,\n destinationStream: NodeJS.WritableStream,\n options: DownloadRecordingOptions = {},\n ): Promise<void> {\n const result = this.contentDownloader.download(sourceLocationUrl, options);\n const recordingStream = (await result).readableStreamBody;\n if (recordingStream) {\n recordingStream.pipe(destinationStream);\n const finish = new Promise<void>((resolve, reject) => {\n destinationStream.on(\"finish\", resolve);\n destinationStream.on(\"error\", reject);\n });\n await finish;\n } else {\n throw Error(\"failed to get stream\");\n }\n }\n\n /**\n * Downloads a call recording file to the specified path.\n * @param sourceLocationUrl - The source location url. Required.\n * @param destinationPath - The destination path. Required.\n * @param options - Additional request options contains downloadRecording api options.\n */\n public async downloadToPath(\n sourceLocationUrl: string,\n destinationPath: string,\n options: DownloadRecordingOptions = {},\n ): Promise<void> {\n const result = this.contentDownloader.download(sourceLocationUrl, options);\n const recordingStream = (await result).readableStreamBody;\n if (recordingStream) {\n const writeFileStream = fs.createWriteStream(destinationPath);\n recordingStream.pipe(writeFileStream);\n const finish = new Promise<void>((resolve, reject) => {\n writeFileStream.on(\"finish\", resolve);\n writeFileStream.on(\"error\", reject);\n });\n await finish;\n } else {\n throw Error(\"failed to get stream\");\n }\n }\n}\n"]}
1
+ {"version":3,"file":"callRecording.js","sourceRoot":"","sources":["../../src/callRecording.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAexE,OAAO,EAAE,qCAAqC,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EA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AE,EAAE;gBACnD,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;gBACxC,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YACxC,CAAC,CAAC,CAAC;YACH,MAAM,MAAM,CAAC;QACf,CAAC;aAAM,CAAC;YACN,MAAM,KAAK,CAAC,sBAAsB,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,cAAc,CACzB,iBAAyB,EACzB,eAAuB,EACvB,UAAoC,EAAE;QAEtC,MAAM,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;QAC3E,MAAM,eAAe,GAAG,CAAC,MAAM,MAAM,CAAC,CAAC,kBAAkB,CAAC;QAC1D,IAAI,eAAe,EAAE,CAAC;YACpB,MAAM,eAAe,GAAG,EAAE,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC;YAC9D,eAAe,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACtC,MAAM,MAAM,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBACnD,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;gBACtC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YACtC,CAAC,CAAC,CAAC;YACH,MAAM,MAAM,CAAC;QACf,CAAC;aAAM,CAAC;YACN,MAAM,KAAK,CAAC,sBAAsB,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { CallRecordingImpl } from \"./generated/src/operations/index.js\";\nimport type {\n CallAutomationApiClientOptionalParams,\n StartCallRecordingRequest,\n} from \"./generated/src/models/index.js\";\nimport type { RecordingStateResult } from \"./models/responses.js\";\nimport type {\n StartRecordingOptions,\n StopRecordingOptions,\n PauseRecordingOptions,\n GetRecordingPropertiesOptions,\n ResumeRecordingOptions,\n DeleteRecordingOptions,\n DownloadRecordingOptions,\n} from \"./models/options.js\";\nimport { communicationIdentifierModelConverter } from \"./utli/converters.js\";\nimport { ContentDownloaderImpl } from \"./contentDownloader.js\";\nimport fs from \"node:fs\";\nimport { randomUUID } from \"@azure/core-util\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { CallAutomationApiClient } from \"./generated/src/index.js\";\nimport { createCommunicationAuthPolicy } from \"@azure/communication-common\";\n\n/**\n * CallRecording class represents call recording related APIs.\n */\nexport class CallRecording {\n private readonly callRecordingImpl: CallRecordingImpl;\n private readonly contentDownloader: ContentDownloaderImpl;\n private readonly callAutomationApiClient: CallAutomationApiClient;\n\n constructor(\n endpoint: string,\n credential: KeyCredential | TokenCredential,\n options?: CallAutomationApiClientOptionalParams,\n ) {\n this.callAutomationApiClient = new CallAutomationApiClient(endpoint, options);\n const authPolicy = createCommunicationAuthPolicy(credential);\n this.callAutomationApiClient.pipeline.addPolicy(authPolicy);\n\n this.callRecordingImpl = new CallRecordingImpl(this.callAutomationApiClient);\n this.contentDownloader = new ContentDownloaderImpl(this.callAutomationApiClient);\n }\n\n /**\n * Starts a call recording with the specified options.\n * @param startCallRecordingRequest - options to start the call recording\n * @param options - Operation options.\n */\n public async start(options: StartRecordingOptions): Promise<RecordingStateResult> {\n const startCallRecordingRequest: StartCallRecordingRequest = {\n callLocator: options.callLocator ? options.callLocator : undefined,\n };\n\n startCallRecordingRequest.recordingChannelType = options.recordingChannel;\n startCallRecordingRequest.recordingContentType = options.recordingContent;\n startCallRecordingRequest.recordingFormatType = options.recordingFormat;\n startCallRecordingRequest.recordingStateCallbackUri = options.recordingStateCallbackEndpointUrl;\n startCallRecordingRequest.pauseOnStart = options.pauseOnStart;\n startCallRecordingRequest.recordingStorage = options.recordingStorage;\n startCallRecordingRequest.callConnectionId = options.callConnectionId\n ? options.callConnectionId\n : undefined;\n\n if (options.channelAffinity) {\n startCallRecordingRequest.channelAffinity = [];\n options.channelAffinity.forEach((identifier) => {\n startCallRecordingRequest.channelAffinity?.push({\n participant: communicationIdentifierModelConverter(identifier.targetParticipant),\n channel: identifier.channel,\n });\n });\n }\n\n if (options.audioChannelParticipantOrdering) {\n startCallRecordingRequest.audioChannelParticipantOrdering = [];\n options.audioChannelParticipantOrdering.forEach((identifier) => {\n startCallRecordingRequest.audioChannelParticipantOrdering?.push(\n communicationIdentifierModelConverter(identifier),\n );\n });\n }\n if (options.callLocator) {\n if (options.callLocator.kind === \"groupCallLocator\") {\n startCallRecordingRequest.callLocator = {\n groupCallId: options.callLocator.id,\n kind: \"groupCallLocator\",\n };\n } else if (options.callLocator.kind === \"roomCallLocator\") {\n startCallRecordingRequest.callLocator = {\n roomId: options.callLocator.id,\n kind: \"roomCallLocator\",\n };\n } else {\n startCallRecordingRequest.callLocator = {\n serverCallId: options.callLocator.id,\n kind: \"serverCallLocator\",\n };\n }\n }\n\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const response = await this.callRecordingImpl.startRecording(\n startCallRecordingRequest,\n optionsInternal,\n );\n\n const result: RecordingStateResult = {\n recordingId: response.recordingId!,\n recordingKind: response.recordingKind!,\n recordingState: response.recordingState!,\n };\n\n return result;\n }\n\n /**\n * Returns call recording properties.\n * @param recordingId - The recordingId associated with the recording.\n * @param options - Additional request options contains getRecordingProperties api options.\n */\n public async getState(\n recordingId: string,\n options: GetRecordingPropertiesOptions = {},\n ): Promise<RecordingStateResult> {\n const response = await this.callRecordingImpl.getRecordingProperties(recordingId, options);\n\n const result: RecordingStateResult = {\n recordingId: response.recordingId!,\n recordingKind: response.recordingKind!,\n recordingState: response.recordingState!,\n };\n\n return result;\n }\n\n /**\n * Stops a call recording.\n * @param recordingId - The recordingId associated with the recording.\n * @param options - Additional request options contains stopRecording api options.\n */\n public async stop(recordingId: string, options: StopRecordingOptions = {}): Promise<void> {\n return this.callRecordingImpl.stopRecording(recordingId, options);\n }\n\n /**\n * Pauses a call recording.\n * @param recordingId - The recordingId associated with the recording.\n * @param options - Additional request options contains pauseRecording api options.\n */\n public async pause(recordingId: string, options: PauseRecordingOptions = {}): Promise<void> {\n return this.callRecordingImpl.pauseRecording(recordingId, options);\n }\n\n /**\n * Resumes a call recording.\n * @param recordingId - The recordingId associated with the recording.\n * @param options - Additional request options contains resumeRecording api options.\n */\n public async resume(recordingId: string, options: ResumeRecordingOptions = {}): Promise<void> {\n return this.callRecordingImpl.resumeRecording(recordingId, options);\n }\n\n /**\n * Deletes a recording.\n * @param recordingLocationUrl - The recording location url. Required.\n * @param options - Additional request options contains deleteRecording api options.\n */\n public async delete(\n recordingLocationUrl: string,\n options: DeleteRecordingOptions = {},\n ): Promise<void> {\n await this.contentDownloader.deleteRecording(recordingLocationUrl, options);\n }\n\n /**\n * Returns a stream with a call recording.\n * @param sourceLocationUrl - The source location url. Required.\n * @param options - Additional request options contains downloadRecording api options.\n */\n public async downloadStreaming(\n sourceLocationUrl: string,\n options: DownloadRecordingOptions = {},\n ): Promise<NodeJS.ReadableStream> {\n const result = this.contentDownloader.download(sourceLocationUrl, options);\n const recordingStream = (await result).readableStreamBody;\n if (recordingStream) {\n return recordingStream;\n } else {\n throw Error(\"failed to get stream\");\n }\n }\n\n /**\n * Downloads a call recording file to the specified stream.\n * @param sourceLocationUrl - The source location url. Required.\n * @param destinationStream - The destination stream. Required.\n * @param options - Additional request options contains downloadRecording api options.\n */\n public async downloadToStream(\n sourceLocationUrl: string,\n destinationStream: NodeJS.WritableStream,\n options: DownloadRecordingOptions = {},\n ): Promise<void> {\n const result = this.contentDownloader.download(sourceLocationUrl, options);\n const recordingStream = (await result).readableStreamBody;\n if (recordingStream) {\n recordingStream.pipe(destinationStream);\n const finish = new Promise<void>((resolve, reject) => {\n destinationStream.on(\"finish\", resolve);\n destinationStream.on(\"error\", reject);\n });\n await finish;\n } else {\n throw Error(\"failed to get stream\");\n }\n }\n\n /**\n * Downloads a call recording file to the specified path.\n * @param sourceLocationUrl - The source location url. Required.\n * @param destinationPath - The destination path. Required.\n * @param options - Additional request options contains downloadRecording api options.\n */\n public async downloadToPath(\n sourceLocationUrl: string,\n destinationPath: string,\n options: DownloadRecordingOptions = {},\n ): Promise<void> {\n const result = this.contentDownloader.download(sourceLocationUrl, options);\n const recordingStream = (await result).readableStreamBody;\n if (recordingStream) {\n const writeFileStream = fs.createWriteStream(destinationPath);\n recordingStream.pipe(writeFileStream);\n const finish = new Promise<void>((resolve, reject) => {\n writeFileStream.on(\"finish\", resolve);\n writeFileStream.on(\"error\", reject);\n });\n await finish;\n } else {\n throw Error(\"failed to get stream\");\n }\n }\n}\n"]}
@@ -3,6 +3,7 @@
3
3
  import { createHttpHeaders, createPipelineRequest } from "@azure/core-rest-pipeline";
4
4
  /** Class containing ContentDownloading operations. */
5
5
  export class ContentDownloaderImpl {
6
+ client;
6
7
  /**
7
8
  * Initialize a new instance of the class ContentDownloader class.
8
9
  * @param client - Reference to the service client
@@ -32,7 +33,6 @@ export class ContentDownloaderImpl {
32
33
  * @param deleteLocationUrl - The recording location url. Required.
33
34
  */
34
35
  async deleteRecording(deleteLocationUrl, options) {
35
- var _a, _b, _c;
36
36
  const fileLocation = new URL(deleteLocationUrl);
37
37
  const endpoint = new URL(this.client.endpoint);
38
38
  const modifiedUrlForSigning = endpoint.origin + fileLocation.pathname;
@@ -41,12 +41,12 @@ export class ContentDownloaderImpl {
41
41
  method: "DELETE",
42
42
  headers: createHttpHeaders(),
43
43
  body: "",
44
- abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal,
45
- tracingOptions: options === null || options === void 0 ? void 0 : options.tracingOptions,
44
+ abortSignal: options?.abortSignal,
45
+ tracingOptions: options?.tracingOptions,
46
46
  };
47
- (_a = opt.headers) === null || _a === void 0 ? void 0 : _a.set("OriginalUrl", deleteLocationUrl);
48
- (_b = opt.headers) === null || _b === void 0 ? void 0 : _b.set("x-ms-host", endpoint.host);
49
- (_c = opt.headers) === null || _c === void 0 ? void 0 : _c.set("accept", "application/json");
47
+ opt.headers?.set("OriginalUrl", deleteLocationUrl);
48
+ opt.headers?.set("x-ms-host", endpoint.host);
49
+ opt.headers?.set("accept", "application/json");
50
50
  const req = createPipelineRequest(opt);
51
51
  const results = await this.client.sendRequest(req);
52
52
  if (results.status !== 200) {
@@ -63,7 +63,6 @@ export class ContentDownloaderImpl {
63
63
  * @param options - Additional request options contains downloadRecording options.
64
64
  */
65
65
  async download(sourceLocationUrl, options) {
66
- var _a, _b, _c, _d;
67
66
  const fileLocation = new URL(sourceLocationUrl);
68
67
  const endpoint = new URL(this.client.endpoint);
69
68
  const modifiedUrlForSigning = endpoint.origin + fileLocation.pathname;
@@ -74,7 +73,7 @@ export class ContentDownloaderImpl {
74
73
  body: "",
75
74
  streamResponseStatusCodes: new Set([200, 206]),
76
75
  abortSignal: options.abortSignal,
77
- tracingOptions: options === null || options === void 0 ? void 0 : options.tracingOptions,
76
+ tracingOptions: options?.tracingOptions,
78
77
  };
79
78
  if (options.length && !options.offset) {
80
79
  throw Error("Download offset value must not be empty if length is set.");
@@ -85,10 +84,10 @@ export class ContentDownloaderImpl {
85
84
  let rangeHeader = "bytes=" + options.offset;
86
85
  if (options.length)
87
86
  rangeHeader += "-" + options.length;
88
- (_a = opt.headers) === null || _a === void 0 ? void 0 : _a.set("OriginalUrl", sourceLocationUrl);
89
- (_b = opt.headers) === null || _b === void 0 ? void 0 : _b.set("x-ms-host", endpoint.host);
90
- (_c = opt.headers) === null || _c === void 0 ? void 0 : _c.set("accept", "application/json");
91
- (_d = opt.headers) === null || _d === void 0 ? void 0 : _d.set("Range", rangeHeader);
87
+ opt.headers?.set("OriginalUrl", sourceLocationUrl);
88
+ opt.headers?.set("x-ms-host", endpoint.host);
89
+ opt.headers?.set("accept", "application/json");
90
+ opt.headers?.set("Range", rangeHeader);
92
91
  const req = createPipelineRequest(opt);
93
92
  const results = await this.client.sendRequest(req);
94
93
  if (results.status !== 200 && results.status !== 206) {
@@ -1 +1 @@
1
- {"version":3,"file":"contentDownloader.js","sourceRoot":"","sources":["../../src/contentDownloader.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAUlC,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAGrF,sDAAsD;AACtD,MAAM,OAAO,qBAAqB;IAGhC;;;OAGG;IACH,YAAY,MAA+B;QACzC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,sBAAsB,EAAE,CAAC;IAChC,CAAC;IAEO,sBAAsB;QAC5B,MAAM,aAAa,GAAG;YACpB,IAAI,EAAE,qBAAqB;YAC3B,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;gBAC3D,IAAI,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;oBACvC,OAAO,CAAC,GAAG,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;oBACtD,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;oBAC7C,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;gBACpD,CAAC;gBACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC;QAEF,MAAM,eAAe,GAAuB,EAAE,CAAC;QAC/C,eAAe,CAAC,UAAU,GAAG,MAAM,CAAC;QACpC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;IACjE,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,eAAe,CAAC,iBAAyB,EAAE,OAA+B;;QAC9E,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAChD,MAA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AO,0CAAE,GAAG,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;QAC/C,MAAA,GAAG,CAAC,OAAO,0CAAE,GAAG,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QAEvC,MAAM,GAAG,GAAG,qBAAqB,CAAC,GAAG,CAAC,CAAC;QAEvC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAEnD,IAAI,OAAO,CAAC,MAAM,KAAK,GAAG,IAAI,OAAO,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YACrD,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;gBACvB,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;gBAChD,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;YAC/D,CAAC;YACD,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;QACnC,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { CallAutomationApiClient } from \"./generated/src/callAutomationApiClient.js\";\nimport type {\n AddPipelineOptions,\n PipelineRequest,\n PipelineRequestOptions,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport { createHttpHeaders, createPipelineRequest } from \"@azure/core-rest-pipeline\";\nimport type { DeleteRecordingOptions, DownloadRecordingOptions } from \"./models/options.js\";\n\n/** Class containing ContentDownloading operations. */\nexport class ContentDownloaderImpl {\n private readonly client: CallAutomationApiClient;\n\n /**\n * Initialize a new instance of the class ContentDownloader class.\n * @param client - Reference to the service client\n */\n constructor(client: CallAutomationApiClient) {\n this.client = client;\n this.addCustomSignUrlPolicy();\n }\n\n private addCustomSignUrlPolicy(): void {\n const signUrlPolicy = {\n name: \"CustomSignUrlPolicy\",\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n if (request.headers.has(\"OriginalUrl\")) {\n request.url = `${request.headers.get(\"OriginalUrl\")}`;\n const originalRequest = new URL(request.url);\n request.headers.set(\"Host\", originalRequest.host);\n }\n return next(request);\n },\n };\n\n const pipelineOptions: AddPipelineOptions = {};\n pipelineOptions.afterPhase = \"Sign\";\n this.client.pipeline.addPolicy(signUrlPolicy, pipelineOptions);\n }\n\n /**\n * Deletes a recording.\n * @param deleteLocationUrl - The recording location url. Required.\n */\n async deleteRecording(deleteLocationUrl: string, options: DeleteRecordingOptions): Promise<void> {\n const fileLocation = new URL(deleteLocationUrl);\n const endpoint = new URL(this.client.endpoint);\n const modifiedUrlForSigning = endpoint.origin + fileLocation.pathname;\n\n const opt: PipelineRequestOptions = {\n url: modifiedUrlForSigning,\n method: \"DELETE\",\n headers: createHttpHeaders(),\n body: \"\",\n abortSignal: options?.abortSignal,\n tracingOptions: options?.tracingOptions,\n };\n\n opt.headers?.set(\"OriginalUrl\", deleteLocationUrl);\n opt.headers?.set(\"x-ms-host\", endpoint.host);\n opt.headers?.set(\"accept\", \"application/json\");\n\n const req = createPipelineRequest(opt);\n\n const results = await this.client.sendRequest(req);\n\n if (results.status !== 200) {\n if (results.bodyAsText) {\n const jsonBody = JSON.parse(results.bodyAsText);\n throw { status: jsonBody.status, message: jsonBody.message };\n }\n throw { status: results.status };\n }\n }\n\n /**\n * Returns a stream with a call recording.\n * @param sourceLocationUrl - The source location url. Required.\n * @param options - Additional request options contains downloadRecording options.\n */\n async download(\n sourceLocationUrl: string,\n options: DownloadRecordingOptions,\n ): Promise<PipelineResponse> {\n const fileLocation = new URL(sourceLocationUrl);\n const endpoint = new URL(this.client.endpoint);\n const modifiedUrlForSigning = endpoint.origin + fileLocation.pathname;\n\n const opt: PipelineRequestOptions = {\n url: modifiedUrlForSigning,\n method: \"GET\",\n headers: createHttpHeaders(),\n body: \"\",\n streamResponseStatusCodes: new Set([200, 206]),\n abortSignal: options.abortSignal,\n tracingOptions: options?.tracingOptions,\n };\n\n if (options.length && !options.offset) {\n throw Error(\"Download offset value must not be empty if length is set.\");\n } else if (options.length && options.offset) {\n options.length = options.offset + options.length - 1;\n }\n\n let rangeHeader = \"bytes=\" + options.offset;\n if (options.length) rangeHeader += \"-\" + options.length;\n\n opt.headers?.set(\"OriginalUrl\", sourceLocationUrl);\n opt.headers?.set(\"x-ms-host\", endpoint.host);\n opt.headers?.set(\"accept\", \"application/json\");\n opt.headers?.set(\"Range\", rangeHeader);\n\n const req = createPipelineRequest(opt);\n\n const results = await this.client.sendRequest(req);\n\n if (results.status !== 200 && results.status !== 206) {\n if (results.bodyAsText) {\n const jsonBody = JSON.parse(results.bodyAsText);\n throw { status: jsonBody.status, message: jsonBody.message };\n }\n throw { status: results.status };\n }\n return results;\n }\n}\n"]}
1
+ {"version":3,"file":"contentDownloader.js","sourceRoot":"","sources":["../../src/contentDownloader.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAUlC,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAGrF,sDAAsD;AACtD,MAAM,OAAO,qBAAqB;IACf,MAAM,CAA0B;IAEjD;;;OAGG;IACH,YAAY,MAA+B;QACzC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,sBAAsB,EAAE,CAAC;IAChC,CAAC;IAEO,sBAAsB;QAC5B,MAAM,aAAa,GAAG;YACpB,IAAI,EAAE,qBAAqB;YAC3B,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;gBAC3D,IAAI,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;oBACvC,OAAO,CAAC,GAAG,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;oBACtD,MAAM,eAAe,GAAG,IA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,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;QACvD,CAAC;QAED,IAAI,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;QAC5C,IAAI,OAAO,CAAC,MAAM;YAAE,WAAW,IAAI,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;QAExD,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAC;QACnD,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,WAAW,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC7C,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;QAC/C,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QAEvC,MAAM,GAAG,GAAG,qBAAqB,CAAC,GAAG,CAAC,CAAC;QAEvC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAEnD,IAAI,OAAO,CAAC,MAAM,KAAK,GAAG,IAAI,OAAO,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YACrD,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;gBACvB,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;gBAChD,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;YAC/D,CAAC;YACD,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;QACnC,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { CallAutomationApiClient } from \"./generated/src/callAutomationApiClient.js\";\nimport type {\n AddPipelineOptions,\n PipelineRequest,\n PipelineRequestOptions,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport { createHttpHeaders, createPipelineRequest } from \"@azure/core-rest-pipeline\";\nimport type { DeleteRecordingOptions, DownloadRecordingOptions } from \"./models/options.js\";\n\n/** Class containing ContentDownloading operations. */\nexport class ContentDownloaderImpl {\n private readonly client: CallAutomationApiClient;\n\n /**\n * Initialize a new instance of the class ContentDownloader class.\n * @param client - Reference to the service client\n */\n constructor(client: CallAutomationApiClient) {\n this.client = client;\n this.addCustomSignUrlPolicy();\n }\n\n private addCustomSignUrlPolicy(): void {\n const signUrlPolicy = {\n name: \"CustomSignUrlPolicy\",\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n if (request.headers.has(\"OriginalUrl\")) {\n request.url = `${request.headers.get(\"OriginalUrl\")}`;\n const originalRequest = new URL(request.url);\n request.headers.set(\"Host\", originalRequest.host);\n }\n return next(request);\n },\n };\n\n const pipelineOptions: AddPipelineOptions = {};\n pipelineOptions.afterPhase = \"Sign\";\n this.client.pipeline.addPolicy(signUrlPolicy, pipelineOptions);\n }\n\n /**\n * Deletes a recording.\n * @param deleteLocationUrl - The recording location url. Required.\n */\n async deleteRecording(deleteLocationUrl: string, options: DeleteRecordingOptions): Promise<void> {\n const fileLocation = new URL(deleteLocationUrl);\n const endpoint = new URL(this.client.endpoint);\n const modifiedUrlForSigning = endpoint.origin + fileLocation.pathname;\n\n const opt: PipelineRequestOptions = {\n url: modifiedUrlForSigning,\n method: \"DELETE\",\n headers: createHttpHeaders(),\n body: \"\",\n abortSignal: options?.abortSignal,\n tracingOptions: options?.tracingOptions,\n };\n\n opt.headers?.set(\"OriginalUrl\", deleteLocationUrl);\n opt.headers?.set(\"x-ms-host\", endpoint.host);\n opt.headers?.set(\"accept\", \"application/json\");\n\n const req = createPipelineRequest(opt);\n\n const results = await this.client.sendRequest(req);\n\n if (results.status !== 200) {\n if (results.bodyAsText) {\n const jsonBody = JSON.parse(results.bodyAsText);\n throw { status: jsonBody.status, message: jsonBody.message };\n }\n throw { status: results.status };\n }\n }\n\n /**\n * Returns a stream with a call recording.\n * @param sourceLocationUrl - The source location url. Required.\n * @param options - Additional request options contains downloadRecording options.\n */\n async download(\n sourceLocationUrl: string,\n options: DownloadRecordingOptions,\n ): Promise<PipelineResponse> {\n const fileLocation = new URL(sourceLocationUrl);\n const endpoint = new URL(this.client.endpoint);\n const modifiedUrlForSigning = endpoint.origin + fileLocation.pathname;\n\n const opt: PipelineRequestOptions = {\n url: modifiedUrlForSigning,\n method: \"GET\",\n headers: createHttpHeaders(),\n body: \"\",\n streamResponseStatusCodes: new Set([200, 206]),\n abortSignal: options.abortSignal,\n tracingOptions: options?.tracingOptions,\n };\n\n if (options.length && !options.offset) {\n throw Error(\"Download offset value must not be empty if length is set.\");\n } else if (options.length && options.offset) {\n options.length = options.offset + options.length - 1;\n }\n\n let rangeHeader = \"bytes=\" + options.offset;\n if (options.length) rangeHeader += \"-\" + options.length;\n\n opt.headers?.set(\"OriginalUrl\", sourceLocationUrl);\n opt.headers?.set(\"x-ms-host\", endpoint.host);\n opt.headers?.set(\"accept\", \"application/json\");\n opt.headers?.set(\"Range\", rangeHeader);\n\n const req = createPipelineRequest(opt);\n\n const results = await this.client.sendRequest(req);\n\n if (results.status !== 200 && results.status !== 206) {\n if (results.bodyAsText) {\n const jsonBody = JSON.parse(results.bodyAsText);\n throw { status: jsonBody.status, message: jsonBody.message };\n }\n throw { status: results.status };\n }\n return results;\n }\n}\n"]}
@@ -13,10 +13,9 @@ export function createCallAutomationAccessKeyCredentialPolicy(credential, acsUrl
13
13
  return {
14
14
  name: callAutomationAccessKeyCredentialPolicy,
15
15
  async sendRequest(request, next) {
16
- var _a;
17
16
  const verb = request.method.toUpperCase();
18
17
  const utcNow = new Date().toUTCString();
19
- const contentHash = await shaHash(((_a = request.body) === null || _a === void 0 ? void 0 : _a.toString()) || "");
18
+ const contentHash = await shaHash(request.body?.toString() || "");
20
19
  const dateHeader = "x-ms-date";
21
20
  const signedHeaders = `${dateHeader};host;x-ms-content-sha256`;
22
21
  const acsUrlCast = new URL(acsUrl);
@@ -1 +1 @@
1
- {"version":3,"file":"callAutomationAccessKeyCredentialPolicy.js","sourceRoot":"","sources":["../../../src/credential/callAutomationAccessKeyCredentialPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,uCAAuC,GAAG,yCAAyC,CAAC;AAE1F;;;;;GAKG;AACH,MAAM,UAAU,6CAA6C,CAC3D,UAAyB,EACzB,MAAc;IAEd,OAAO;QACL,IAAI,EAAE,uCAAuC;QAC7C,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;;YAC3D,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;YAC1C,MAAM,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;YACxC,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,CAAA,MAAA,OAAO,CAAC,IAAI,0CAAE,QAAQ,EAAE,KAAI,EAAE,CAAC,CAAC;YAClE,MAAM,UAAU,GAAG,WAAW,CAAC;YAC/B,MAAM,aAAa,GAAG,GAAG,UAAU,2BAA2B,CAAC;YAE/D,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;YACnC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;YAElD,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACjC,MAAM,KAAK,GAAG,GAAG,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;YAC1C,MAAM,eAAe,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,QAAQ,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC;YAE1E,MAAM,YAAY,GAAG,GAAG,IAAI,KAAK,eAAe,KAAK,MAAM,IAAI,UAAU,CAAC,IAAI,IAAI,WAAW,EAAE,CAAC;YAChG,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;YAE9D,IAAI,MAAM,EAAE,CAAC;gBACX,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;YAC9C,CAAC;YAED,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;YACxC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC;YACxD,OAAO,CAAC,OAAO,CAAC,GAAG,CACjB,eAAe,EACf,6BAA6B,aAAa,cAAc,SAAS,EAAE,CACpE,CAAC;YACF,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport type { KeyCredential } from \"@azure/core-auth\";\nimport { shaHMAC, shaHash } from \"./cryptoUtils.js\";\nimport { isNode } from \"@azure/core-util\";\n\nconst callAutomationAccessKeyCredentialPolicy = \"CallAutomationAccessKeyCredentialPolicy\";\n\n/**\n * Creates an HTTP pipeline policy to authenticate a request using a `KeyCredential`.\n * @hidden\n *\n * @param credential - The key credential.\n */\nexport function createCallAutomationAccessKeyCredentialPolicy(\n credential: KeyCredential,\n acsUrl: string,\n): PipelinePolicy {\n return {\n name: callAutomationAccessKeyCredentialPolicy,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n const verb = request.method.toUpperCase();\n const utcNow = new Date().toUTCString();\n const contentHash = await shaHash(request.body?.toString() || \"\");\n const dateHeader = \"x-ms-date\";\n const signedHeaders = `${dateHeader};host;x-ms-content-sha256`;\n\n const acsUrlCast = new URL(acsUrl);\n request.headers.set(\"x-ms-host\", acsUrlCast.host);\n\n const url = new URL(request.url);\n const query = url.searchParams.toString();\n const urlPathAndQuery = query ? `${url.pathname}?${query}` : url.pathname;\n\n const stringToSign = `${verb}\\n${urlPathAndQuery}\\n${utcNow};${acsUrlCast.host};${contentHash}`;\n const signature = await shaHMAC(credential.key, stringToSign);\n\n if (isNode) {\n request.headers.set(\"Host\", url.host || \"\");\n }\n\n request.headers.set(dateHeader, utcNow);\n request.headers.set(\"x-ms-content-sha256\", contentHash);\n request.headers.set(\n \"Authorization\",\n `HMAC-SHA256 SignedHeaders=${signedHeaders}&Signature=${signature}`,\n );\n return next(request);\n },\n };\n}\n"]}
1
+ {"version":3,"file":"callAutomationAccessKeyCredentialPolicy.js","sourceRoot":"","sources":["../../../src/credential/callAutomationAccessKeyCredentialPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,uCAAuC,GAAG,yCAAyC,CAAC;AAE1F;;;;;GAKG;AACH,MAAM,UAAU,6CAA6C,CAC3D,UAAyB,EACzB,MAAc;IAEd,OAAO;QACL,IAAI,EAAE,uCAAuC;QAC7C,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;YAC1C,MAAM,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;YACxC,MAAM,WAAW,GA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;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport type { KeyCredential } from \"@azure/core-auth\";\nimport { shaHMAC, shaHash } from \"./cryptoUtils.js\";\nimport { isNode } from \"@azure/core-util\";\n\nconst callAutomationAccessKeyCredentialPolicy = \"CallAutomationAccessKeyCredentialPolicy\";\n\n/**\n * Creates an HTTP pipeline policy to authenticate a request using a `KeyCredential`.\n * @hidden\n *\n * @param credential - The key credential.\n */\nexport function createCallAutomationAccessKeyCredentialPolicy(\n credential: KeyCredential,\n acsUrl: string,\n): PipelinePolicy {\n return {\n name: callAutomationAccessKeyCredentialPolicy,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n const verb = request.method.toUpperCase();\n const utcNow = new Date().toUTCString();\n const contentHash = await shaHash(request.body?.toString() || \"\");\n const dateHeader = \"x-ms-date\";\n const signedHeaders = `${dateHeader};host;x-ms-content-sha256`;\n\n const acsUrlCast = new URL(acsUrl);\n request.headers.set(\"x-ms-host\", acsUrlCast.host);\n\n const url = new URL(request.url);\n const query = url.searchParams.toString();\n const urlPathAndQuery = query ? `${url.pathname}?${query}` : url.pathname;\n\n const stringToSign = `${verb}\\n${urlPathAndQuery}\\n${utcNow};${acsUrlCast.host};${contentHash}`;\n const signature = await shaHMAC(credential.key, stringToSign);\n\n if (isNode) {\n request.headers.set(\"Host\", url.host || \"\");\n }\n\n request.headers.set(dateHeader, utcNow);\n request.headers.set(\"x-ms-content-sha256\", contentHash);\n request.headers.set(\n \"Authorization\",\n `HMAC-SHA256 SignedHeaders=${signedHeaders}&Signature=${signature}`,\n );\n return next(request);\n },\n };\n}\n"]}
@@ -37,7 +37,7 @@ export function createCustomCallAutomationApiClient(credential, internalPipeline
37
37
  const customEnabled = process.env.COMMUNICATION_CUSTOM_ENDPOINT_ENABLED;
38
38
  const customUrl = process.env.COMMUNICATION_CUSTOM_URL;
39
39
  let callAutomationApiClient;
40
- if ((customEnabled === null || customEnabled === void 0 ? void 0 : customEnabled.toLowerCase()) === "true" && customUrl) {
40
+ if (customEnabled?.toLowerCase() === "true" && customUrl) {
41
41
  // add custom header for Call Automation auth when flag is true
42
42
  callAutomationApiClient = new CallAutomationApiClient(customUrl, internalPipelineOptions);
43
43
  const callAutomationAuthPolicy = createCallAutomationAuthPolicy(credential, url);
@@ -1 +1 @@
1
- {"version":3,"file":"callAutomationAuthPolicy.js","sourceRoot":"","sources":["../../../src/credential/callAutomationAuthPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AAE5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,6CAA6C,EAAE,MAAM,8CAA8C,CAAC;AAE7G,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E;;;;;;GAMG;AACH,MAAM,UAAU,8BAA8B,CAC5C,UAA2C,EAC3C,MAAc;IAEd,IAAI,iBAAiB,CAAC,UAAU,CAAC,EAAE,CAAC;QAClC,MAAM,aAAa,GAA2C;YAC5D,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE,CAAC,2CAA2C,CAAC;SACtD,CAAC;QACF,OAAO,+BAA+B,CAAC,aAAa,CAAC,CAAC;IACxD,CAAC;SAAM,CAAC;QACN,OAAO,6CAA6C,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAC3E,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mCAAmC,CACjD,UAA2C,EAC3C,uBAA0E,EAC1E,GAAW;IAEX,oDAAoD;IACpD,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC;IACxE,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC;IACvD,IAAI,uBAAgD,CAAC;IAErD,IAAI,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,WAAW,EAAE,MAAK,MAAM,IAAI,SAAS,EAAE,CAAC;QACzD,+DAA+D;QAC/D,uBAAuB,GAAG,IAAI,uBAAuB,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC;QAC1F,MAAM,wBAAwB,GAAG,8BAA8B,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;QACjF,uBAAuB,CAAC,QAAQ,CAAC,SAAS,CAAC,wBAAwB,CAAC,CAAC;IACvE,CAAC;SAAM,CAAC;QACN,uBAAuB,GAAG,IAAI,uBAAuB,CAAC,GAAG,EAAE,uBAAuB,CAAC,CAAC;QACpF,MAAM,UAAU,GAAG,6BAA6B,CAAC,UAAU,CAAC,CAAC;QAC7D,uBAAuB,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,uBAAuB,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n BearerTokenAuthenticationPolicyOptions,\n PipelinePolicy,\n} from \"@azure/core-rest-pipeline\";\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport { createCallAutomationAccessKeyCredentialPolicy } from \"./callAutomationAccessKeyCredentialPolicy.js\";\nimport type { CallAutomationApiClientOptionalParams } from \"./../generated/src/index.js\";\nimport { CallAutomationApiClient } from \"./../generated/src/index.js\";\nimport { createCommunicationAuthPolicy } from \"@azure/communication-common\";\n/**\n * Creates a pipeline policy to authenticate request based\n * on the credential passed in.\n * @hidden\n *\n * @param credential - The KeyCredential or TokenCredential.\n */\nexport function createCallAutomationAuthPolicy(\n credential: KeyCredential | TokenCredential,\n acsUrl: string,\n): PipelinePolicy {\n if (isTokenCredential(credential)) {\n const policyOptions: BearerTokenAuthenticationPolicyOptions = {\n credential: credential,\n scopes: [\"https://communication.azure.com//.default\"],\n };\n return bearerTokenAuthenticationPolicy(policyOptions);\n } else {\n return createCallAutomationAccessKeyCredentialPolicy(credential, acsUrl);\n }\n}\n\n/**\n * Creates CallAutomationApiClient for custom endpoint\n * @hidden\n *\n * @param credential - The KeyCredential or TokenCredential.\n * @param internalPipelineOptions - CallAutomationApiClientOptionalParams if provided.\n * @param url - ACS url.\n */\nexport function createCustomCallAutomationApiClient(\n credential: KeyCredential | TokenCredential,\n internalPipelineOptions: CallAutomationApiClientOptionalParams | undefined,\n url: string,\n): CallAutomationApiClient {\n // read environment variable for callAutomation auth\n const customEnabled = process.env.COMMUNICATION_CUSTOM_ENDPOINT_ENABLED;\n const customUrl = process.env.COMMUNICATION_CUSTOM_URL;\n let callAutomationApiClient: CallAutomationApiClient;\n\n if (customEnabled?.toLowerCase() === \"true\" && customUrl) {\n // add custom header for Call Automation auth when flag is true\n callAutomationApiClient = new CallAutomationApiClient(customUrl, internalPipelineOptions);\n const callAutomationAuthPolicy = createCallAutomationAuthPolicy(credential, url);\n callAutomationApiClient.pipeline.addPolicy(callAutomationAuthPolicy);\n } else {\n callAutomationApiClient = new CallAutomationApiClient(url, internalPipelineOptions);\n const authPolicy = createCommunicationAuthPolicy(credential);\n callAutomationApiClient.pipeline.addPolicy(authPolicy);\n }\n return callAutomationApiClient;\n}\n"]}
1
+ {"version":3,"file":"callAutomationAuthPolicy.js","sourceRoot":"","sources":["../../../src/credential/callAutomationAuthPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AAE5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,6CAA6C,EAAE,MAAM,8CAA8C,CAAC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AU,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,uBAAuB,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n BearerTokenAuthenticationPolicyOptions,\n PipelinePolicy,\n} from \"@azure/core-rest-pipeline\";\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport { createCallAutomationAccessKeyCredentialPolicy } from \"./callAutomationAccessKeyCredentialPolicy.js\";\nimport type { CallAutomationApiClientOptionalParams } from \"./../generated/src/index.js\";\nimport { CallAutomationApiClient } from \"./../generated/src/index.js\";\nimport { createCommunicationAuthPolicy } from \"@azure/communication-common\";\n/**\n * Creates a pipeline policy to authenticate request based\n * on the credential passed in.\n * @hidden\n *\n * @param credential - The KeyCredential or TokenCredential.\n */\nexport function createCallAutomationAuthPolicy(\n credential: KeyCredential | TokenCredential,\n acsUrl: string,\n): PipelinePolicy {\n if (isTokenCredential(credential)) {\n const policyOptions: BearerTokenAuthenticationPolicyOptions = {\n credential: credential,\n scopes: [\"https://communication.azure.com//.default\"],\n };\n return bearerTokenAuthenticationPolicy(policyOptions);\n } else {\n return createCallAutomationAccessKeyCredentialPolicy(credential, acsUrl);\n }\n}\n\n/**\n * Creates CallAutomationApiClient for custom endpoint\n * @hidden\n *\n * @param credential - The KeyCredential or TokenCredential.\n * @param internalPipelineOptions - CallAutomationApiClientOptionalParams if provided.\n * @param url - ACS url.\n */\nexport function createCustomCallAutomationApiClient(\n credential: KeyCredential | TokenCredential,\n internalPipelineOptions: CallAutomationApiClientOptionalParams | undefined,\n url: string,\n): CallAutomationApiClient {\n // read environment variable for callAutomation auth\n const customEnabled = process.env.COMMUNICATION_CUSTOM_ENDPOINT_ENABLED;\n const customUrl = process.env.COMMUNICATION_CUSTOM_URL;\n let callAutomationApiClient: CallAutomationApiClient;\n\n if (customEnabled?.toLowerCase() === \"true\" && customUrl) {\n // add custom header for Call Automation auth when flag is true\n callAutomationApiClient = new CallAutomationApiClient(customUrl, internalPipelineOptions);\n const callAutomationAuthPolicy = createCallAutomationAuthPolicy(credential, url);\n callAutomationApiClient.pipeline.addPolicy(callAutomationAuthPolicy);\n } else {\n callAutomationApiClient = new CallAutomationApiClient(url, internalPipelineOptions);\n const authPolicy = createCommunicationAuthPolicy(credential);\n callAutomationApiClient.pipeline.addPolicy(authPolicy);\n }\n return callAutomationApiClient;\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import * as coreClient from "@azure/core-client";
2
- import { CallConnection, CallMedia, CallDialog, CallRecording } from "./operationsInterfaces/index.js";
2
+ import { CallConnection, CallMedia, CallRecording } from "./operationsInterfaces/index.js";
3
3
  import { CallAutomationApiClientOptionalParams, CreateCallRequest, CreateCallOptionalParams, CreateCallResponse, AnswerCallRequest, AnswerCallOptionalParams, AnswerCallResponse, RedirectCallRequest, RedirectCallOptionalParams, RejectCallRequest, RejectCallOptionalParams, ConnectRequest, ConnectOptionalParams, ConnectResponse } from "./models/index.js";
4
4
  export declare class CallAutomationApiClient extends coreClient.ServiceClient {
5
5
  endpoint: string;
@@ -44,7 +44,6 @@ export declare class CallAutomationApiClient extends coreClient.ServiceClient {
44
44
  connect(connectRequest: ConnectRequest, options?: ConnectOptionalParams): Promise<ConnectResponse>;
45
45
  callConnection: CallConnection;
46
46
  callMedia: CallMedia;
47
- callDialog: CallDialog;
48
47
  callRecording: CallRecording;
49
48
  }
50
49
  //# sourceMappingURL=callAutomationApiClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"callAutomationApiClient.d.ts","sourceRoot":"","sources":["../../../../src/generated/src/callAutomationApiClient.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAYjD,OAAO,EACL,cAAc,EACd,SAAS,EACT,UAAU,EACV,aAAa,EACd,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EACL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,CAAC;IAC/B,SAAS,EAAE,SAAS,CAAC;IACrB,aAAa,EAAE,aAAa,CAAC;CAC9B"}
@@ -6,17 +6,18 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
  import * as coreClient from "@azure/core-client";
9
- import { CallConnectionImpl, CallMediaImpl, CallDialogImpl, CallRecordingImpl, } from "./operations/index.js";
9
+ import { CallConnectionImpl, CallMediaImpl, CallRecordingImpl, } from "./operations/index.js";
10
10
  import * as Parameters from "./models/parameters.js";
11
11
  import * as Mappers from "./models/mappers.js";
12
12
  export class CallAutomationApiClient extends coreClient.ServiceClient {
13
+ endpoint;
14
+ apiVersion;
13
15
  /**
14
16
  * Initializes a new instance of the CallAutomationApiClient class.
15
17
  * @param endpoint The endpoint of the Azure Communication resource.
16
18
  * @param options The parameter options
17
19
  */
18
20
  constructor(endpoint, options) {
19
- var _a, _b;
20
21
  if (endpoint === undefined) {
21
22
  throw new Error("'endpoint' cannot be null");
22
23
  }
@@ -31,17 +32,21 @@ export class CallAutomationApiClient extends coreClient.ServiceClient {
31
32
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
32
33
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
33
34
  : `${packageDetails}`;
34
- const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
35
+ const optionsWithDefaults = {
36
+ ...defaults,
37
+ ...options,
38
+ userAgentOptions: {
35
39
  userAgentPrefix,
36
- }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{endpoint}" });
40
+ },
41
+ endpoint: options.endpoint ?? options.baseUri ?? "{endpoint}",
42
+ };
37
43
  super(optionsWithDefaults);
38
44
  // Parameter assignments
39
45
  this.endpoint = endpoint;
40
46
  // Assigning values to Constant parameters
41
- this.apiVersion = options.apiVersion || "2024-09-01-preview";
47
+ this.apiVersion = options.apiVersion || "2025-08-15-preview";
42
48
  this.callConnection = new CallConnectionImpl(this);
43
49
  this.callMedia = new CallMediaImpl(this);
44
- this.callDialog = new CallDialogImpl(this);
45
50
  this.callRecording = new CallRecordingImpl(this);
46
51
  this.addCustomApiVersionPolicy(options.apiVersion);
47
52
  }
@@ -110,6 +115,9 @@ export class CallAutomationApiClient extends coreClient.ServiceClient {
110
115
  connect(connectRequest, options) {
111
116
  return this.sendOperationRequest({ connectRequest, options }, connectOperationSpec);
112
117
  }
118
+ callConnection;
119
+ callMedia;
120
+ callRecording;
113
121
  }
114
122
  // Operation Specifications
115
123
  const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
@@ -1 +1 @@
1
- {"version":3,"file":"callAutomationApiClient.js","sourceRoot":"","sources":["../../../../src/generated/src/callAutomationApiClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAMjD,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAO/B,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAkB/C,MAAM,OAAO,uBAAwB,SAAQ,UAAU,CAAC,aAAa;IAInE;;;;OAIG;IACH,YACE,QAAgB,EAChB,OAA+C;;QAE/C,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAC/C,CAAC;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM,QAAQ,GAA0C;YACtD,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,qDAAqD,CAAC;QAC7E,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,e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U,EAAE,OAAO,CAAC,0BAA0B;SAC/C;KACF;IACD,WAAW,EAAE,UAAU,CAAC,cAAc;IACtC,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,gBAAgB,EAAE;QAChB,UAAU,CAAC,WAAW;QACtB,UAAU,CAAC,MAAM;QACjB,UAAU,CAAC,sBAAsB;QACjC,UAAU,CAAC,sBAAsB;KAClC;IACD,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport {\n CallConnectionImpl,\n CallMediaImpl,\n CallDialogImpl,\n CallRecordingImpl,\n} from \"./operations/index.js\";\nimport {\n CallConnection,\n CallMedia,\n CallDialog,\n CallRecording,\n} from \"./operationsInterfaces/index.js\";\nimport * as Parameters from \"./models/parameters.js\";\nimport * as Mappers from \"./models/mappers.js\";\nimport {\n CallAutomationApiClientOptionalParams,\n CreateCallRequest,\n CreateCallOptionalParams,\n CreateCallResponse,\n AnswerCallRequest,\n AnswerCallOptionalParams,\n AnswerCallResponse,\n RedirectCallRequest,\n RedirectCallOptionalParams,\n RejectCallRequest,\n RejectCallOptionalParams,\n ConnectRequest,\n ConnectOptionalParams,\n ConnectResponse,\n} from \"./models/index.js\";\n\nexport class CallAutomationApiClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the CallAutomationApiClient class.\n * @param endpoint The endpoint of the Azure Communication resource.\n * @param options The parameter options\n */\n constructor(\n endpoint: string,\n options?: CallAutomationApiClientOptionalParams,\n ) {\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: CallAutomationApiClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n };\n\n const packageDetails = `azsdk-js-communication-call-automation/1.6.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n endpoint: options.endpoint ?? options.baseUri ?? \"{endpoint}\",\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2024-09-01-preview\";\n this.callConnection = new CallConnectionImpl(this);\n this.callMedia = new CallMediaImpl(this);\n this.callDialog = new CallDialogImpl(this);\n this.callRecording = new CallRecordingImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(\n request: PipelineRequest,\n next: SendRequest,\n ): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n },\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n /**\n * Create an outbound call.\n * @param createCallRequest The create call request.\n * @param options The options parameters.\n */\n createCall(\n createCallRequest: CreateCallRequest,\n options?: CreateCallOptionalParams,\n ): Promise<CreateCallResponse> {\n return this.sendOperationRequest(\n { createCallRequest, options },\n createCallOperationSpec,\n );\n }\n\n /**\n * Answer a call using the IncomingCallContext from Event Grid.\n * @param answerCallRequest The answer call request.\n * @param options The options parameters.\n */\n answerCall(\n answerCallRequest: AnswerCallRequest,\n options?: AnswerCallOptionalParams,\n ): Promise<AnswerCallResponse> {\n return this.sendOperationRequest(\n { answerCallRequest, options },\n answerCallOperationSpec,\n );\n }\n\n /**\n * Redirect a call.\n * @param redirectCallRequest The redirect call request.\n * @param options The options parameters.\n */\n redirectCall(\n redirectCallRequest: RedirectCallRequest,\n options?: RedirectCallOptionalParams,\n ): Promise<void> {\n return this.sendOperationRequest(\n { redirectCallRequest, options },\n redirectCallOperationSpec,\n );\n }\n\n /**\n * Reject the call.\n * @param rejectCallRequest The reject call request.\n * @param options The options parameters.\n */\n rejectCall(\n rejectCallRequest: RejectCallRequest,\n options?: RejectCallOptionalParams,\n ): Promise<void> {\n return this.sendOperationRequest(\n { rejectCallRequest, options },\n rejectCallOperationSpec,\n );\n }\n\n /**\n * Create a connection to a CallLocator.\n * @param connectRequest The create connection request.\n * @param options The options parameters.\n */\n connect(\n connectRequest: ConnectRequest,\n options?: ConnectOptionalParams,\n ): Promise<ConnectResponse> {\n return this.sendOperationRequest(\n { connectRequest, options },\n connectOperationSpec,\n );\n }\n\n callConnection: CallConnection;\n callMedia: CallMedia;\n callDialog: CallDialog;\n callRecording: CallRecording;\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst createCallOperationSpec: coreClient.OperationSpec = {\n path: \"/calling/callConnections\",\n httpMethod: \"POST\",\n responses: {\n 201: {\n bodyMapper: Mappers.CallConnectionPropertiesInternal,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: Parameters.createCallRequest,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [\n Parameters.contentType,\n Parameters.accept,\n Parameters.repeatabilityRequestID,\n Parameters.repeatabilityFirstSent,\n ],\n mediaType: \"json\",\n serializer,\n};\nconst answerCallOperationSpec: coreClient.OperationSpec = {\n path: \"/calling/callConnections:answer\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CallConnectionPropertiesInternal,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: Parameters.answerCallRequest,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [\n Parameters.contentType,\n Parameters.accept,\n Parameters.repeatabilityRequestID,\n Parameters.repeatabilityFirstSent,\n ],\n mediaType: \"json\",\n serializer,\n};\nconst redirectCallOperationSpec: coreClient.OperationSpec = {\n path: \"/calling/callConnections:redirect\",\n httpMethod: \"POST\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: Parameters.redirectCallRequest,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [\n Parameters.contentType,\n Parameters.accept,\n Parameters.repeatabilityRequestID,\n Parameters.repeatabilityFirstSent,\n ],\n mediaType: \"json\",\n serializer,\n};\nconst rejectCallOperationSpec: coreClient.OperationSpec = {\n path: \"/calling/callConnections:reject\",\n httpMethod: \"POST\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: Parameters.rejectCallRequest,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [\n Parameters.contentType,\n Parameters.accept,\n Parameters.repeatabilityRequestID,\n Parameters.repeatabilityFirstSent,\n ],\n mediaType: \"json\",\n serializer,\n};\nconst connectOperationSpec: coreClient.OperationSpec = {\n path: \"/calling/callConnections:connect\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CallConnectionPropertiesInternal,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: Parameters.connectRequest,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [\n Parameters.contentType,\n Parameters.accept,\n Parameters.repeatabilityRequestID,\n Parameters.repeatabilityFirstSent,\n ],\n mediaType: \"json\",\n serializer,\n};\n"]}
1
+ {"version":3,"file":"callAutomationApiClient.js","sourceRoot":"","sources":["../../../../src/generated/src/callAutomationApiClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAMjD,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAM/B,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAkB/C,MAAM,OAAO,uBAAwB,SAAQ,UAAU,CAAC,aAAa;IACnE,QAAQ,CAAS;IACjB,UAAU,CAAS;IAEnB;;;;OAIG;IACH,YACE,QAAgB,EAChB,OAA+C;QAE/C,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAC/C,CAAC;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM,QAAQ,GAA0C;YACtD,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,qDAAqD,CAAC;QAC7E,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,MAAM,mBAAmB,GAAG;YAC1B,GAAG,QAAQ;YACX,GAAG,OAAO;YACV,gBAAgB,EAAE;gBAChB,eAAe;aAChB;YACD,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,OAA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AsB;KAClC;IACD,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport {\n CallConnectionImpl,\n CallMediaImpl,\n CallRecordingImpl,\n} from \"./operations/index.js\";\nimport {\n CallConnection,\n CallMedia,\n CallRecording,\n} from \"./operationsInterfaces/index.js\";\nimport * as Parameters from \"./models/parameters.js\";\nimport * as Mappers from \"./models/mappers.js\";\nimport {\n CallAutomationApiClientOptionalParams,\n CreateCallRequest,\n CreateCallOptionalParams,\n CreateCallResponse,\n AnswerCallRequest,\n AnswerCallOptionalParams,\n AnswerCallResponse,\n RedirectCallRequest,\n RedirectCallOptionalParams,\n RejectCallRequest,\n RejectCallOptionalParams,\n ConnectRequest,\n ConnectOptionalParams,\n ConnectResponse,\n} from \"./models/index.js\";\n\nexport class CallAutomationApiClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the CallAutomationApiClient class.\n * @param endpoint The endpoint of the Azure Communication resource.\n * @param options The parameter options\n */\n constructor(\n endpoint: string,\n options?: CallAutomationApiClientOptionalParams,\n ) {\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: CallAutomationApiClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n };\n\n const packageDetails = `azsdk-js-communication-call-automation/1.6.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n endpoint: options.endpoint ?? options.baseUri ?? \"{endpoint}\",\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2025-08-15-preview\";\n this.callConnection = new CallConnectionImpl(this);\n this.callMedia = new CallMediaImpl(this);\n this.callRecording = new CallRecordingImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(\n request: PipelineRequest,\n next: SendRequest,\n ): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n },\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n /**\n * Create an outbound call.\n * @param createCallRequest The create call request.\n * @param options The options parameters.\n */\n createCall(\n createCallRequest: CreateCallRequest,\n options?: CreateCallOptionalParams,\n ): Promise<CreateCallResponse> {\n return this.sendOperationRequest(\n { createCallRequest, options },\n createCallOperationSpec,\n );\n }\n\n /**\n * Answer a call using the IncomingCallContext from Event Grid.\n * @param answerCallRequest The answer call request.\n * @param options The options parameters.\n */\n answerCall(\n answerCallRequest: AnswerCallRequest,\n options?: AnswerCallOptionalParams,\n ): Promise<AnswerCallResponse> {\n return this.sendOperationRequest(\n { answerCallRequest, options },\n answerCallOperationSpec,\n );\n }\n\n /**\n * Redirect a call.\n * @param redirectCallRequest The redirect call request.\n * @param options The options parameters.\n */\n redirectCall(\n redirectCallRequest: RedirectCallRequest,\n options?: RedirectCallOptionalParams,\n ): Promise<void> {\n return this.sendOperationRequest(\n { redirectCallRequest, options },\n redirectCallOperationSpec,\n );\n }\n\n /**\n * Reject the call.\n * @param rejectCallRequest The reject call request.\n * @param options The options parameters.\n */\n rejectCall(\n rejectCallRequest: RejectCallRequest,\n options?: RejectCallOptionalParams,\n ): Promise<void> {\n return this.sendOperationRequest(\n { rejectCallRequest, options },\n rejectCallOperationSpec,\n );\n }\n\n /**\n * Create a connection to a CallLocator.\n * @param connectRequest The create connection request.\n * @param options The options parameters.\n */\n connect(\n connectRequest: ConnectRequest,\n options?: ConnectOptionalParams,\n ): Promise<ConnectResponse> {\n return this.sendOperationRequest(\n { connectRequest, options },\n connectOperationSpec,\n );\n }\n\n callConnection: CallConnection;\n callMedia: CallMedia;\n callRecording: CallRecording;\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst createCallOperationSpec: coreClient.OperationSpec = {\n path: \"/calling/callConnections\",\n httpMethod: \"POST\",\n responses: {\n 201: {\n bodyMapper: Mappers.CallConnectionPropertiesInternal,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: Parameters.createCallRequest,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [\n Parameters.contentType,\n Parameters.accept,\n Parameters.repeatabilityRequestID,\n Parameters.repeatabilityFirstSent,\n ],\n mediaType: \"json\",\n serializer,\n};\nconst answerCallOperationSpec: coreClient.OperationSpec = {\n path: \"/calling/callConnections:answer\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CallConnectionPropertiesInternal,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: Parameters.answerCallRequest,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [\n Parameters.contentType,\n Parameters.accept,\n Parameters.repeatabilityRequestID,\n Parameters.repeatabilityFirstSent,\n ],\n mediaType: \"json\",\n serializer,\n};\nconst redirectCallOperationSpec: coreClient.OperationSpec = {\n path: \"/calling/callConnections:redirect\",\n httpMethod: \"POST\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: Parameters.redirectCallRequest,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [\n Parameters.contentType,\n Parameters.accept,\n Parameters.repeatabilityRequestID,\n Parameters.repeatabilityFirstSent,\n ],\n mediaType: \"json\",\n serializer,\n};\nconst rejectCallOperationSpec: coreClient.OperationSpec = {\n path: \"/calling/callConnections:reject\",\n httpMethod: \"POST\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: Parameters.rejectCallRequest,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [\n Parameters.contentType,\n Parameters.accept,\n Parameters.repeatabilityRequestID,\n Parameters.repeatabilityFirstSent,\n ],\n mediaType: \"json\",\n serializer,\n};\nconst connectOperationSpec: coreClient.OperationSpec = {\n path: \"/calling/callConnections:connect\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CallConnectionPropertiesInternal,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: Parameters.connectRequest,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [\n Parameters.contentType,\n Parameters.accept,\n Parameters.repeatabilityRequestID,\n Parameters.repeatabilityFirstSent,\n ],\n mediaType: \"json\",\n serializer,\n};\n"]}