@azure/communication-call-automation 1.1.0-beta.1 → 1.1.0-beta.3
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.
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/dist-esm/src/callRecording.js +12 -1
- package/dist-esm/src/callRecording.js.map +1 -1
- package/dist-esm/src/generated/src/callAutomationApiClient.js +1 -1
- package/dist-esm/src/generated/src/callAutomationApiClient.js.map +1 -1
- package/dist-esm/src/models/constants.js +1 -1
- package/dist-esm/src/models/constants.js.map +1 -1
- package/dist-esm/src/models/models.js.map +1 -1
- package/package.json +1 -1
- package/types/communication-call-automation.d.ts +3 -2
package/dist/index.js
CHANGED
|
@@ -3328,7 +3328,7 @@ class CallAutomationApiClient extends coreClient__namespace.ServiceClient {
|
|
|
3328
3328
|
const defaults = {
|
|
3329
3329
|
requestContentType: "application/json; charset=utf-8"
|
|
3330
3330
|
};
|
|
3331
|
-
const packageDetails = `azsdk-js-communication-call-automation/1.1.0-beta.
|
|
3331
|
+
const packageDetails = `azsdk-js-communication-call-automation/1.1.0-beta.3`;
|
|
3332
3332
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
3333
3333
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
3334
3334
|
: `${packageDetails}`;
|
|
@@ -4259,6 +4259,11 @@ class CallRecording {
|
|
|
4259
4259
|
const recordingStream = (await result).readableStreamBody;
|
|
4260
4260
|
if (recordingStream) {
|
|
4261
4261
|
recordingStream.pipe(destinationStream);
|
|
4262
|
+
const finish = new Promise((resolve, reject) => {
|
|
4263
|
+
destinationStream.on("finish", resolve);
|
|
4264
|
+
destinationStream.on("error", reject);
|
|
4265
|
+
});
|
|
4266
|
+
await finish;
|
|
4262
4267
|
}
|
|
4263
4268
|
else {
|
|
4264
4269
|
throw Error("failed to get stream");
|
|
@@ -4274,7 +4279,13 @@ class CallRecording {
|
|
|
4274
4279
|
const result = this.contentDownloader.download(sourceLocationUrl, options);
|
|
4275
4280
|
const recordingStream = (await result).readableStreamBody;
|
|
4276
4281
|
if (recordingStream) {
|
|
4277
|
-
|
|
4282
|
+
const writeFileStream = fs__namespace.createWriteStream(destinationPath);
|
|
4283
|
+
recordingStream.pipe(writeFileStream);
|
|
4284
|
+
const finish = new Promise((resolve, reject) => {
|
|
4285
|
+
writeFileStream.on("finish", resolve);
|
|
4286
|
+
writeFileStream.on("error", reject);
|
|
4287
|
+
});
|
|
4288
|
+
await finish;
|
|
4278
4289
|
}
|
|
4279
4290
|
else {
|
|
4280
4291
|
throw Error("failed to get stream");
|