@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.
- package/README.md +0 -48
- package/dist/browser/callAutomationClient.d.ts +0 -8
- package/dist/browser/callAutomationClient.d.ts.map +1 -1
- package/dist/browser/callAutomationClient.js +87 -141
- package/dist/browser/callAutomationClient.js.map +1 -1
- package/dist/browser/callAutomationEventParser.d.ts.map +1 -1
- package/dist/browser/callAutomationEventParser.js +22 -54
- package/dist/browser/callAutomationEventParser.js.map +1 -1
- package/dist/browser/callConnection.d.ts +12 -14
- package/dist/browser/callConnection.d.ts.map +1 -1
- package/dist/browser/callConnection.js +111 -183
- package/dist/browser/callConnection.js.map +1 -1
- package/dist/browser/callMedia.d.ts +15 -20
- package/dist/browser/callMedia.d.ts.map +1 -1
- package/dist/browser/callMedia.js +58 -177
- package/dist/browser/callMedia.js.map +1 -1
- package/dist/browser/callRecording.d.ts +2 -8
- package/dist/browser/callRecording.d.ts.map +1 -1
- package/dist/browser/callRecording.js +16 -26
- package/dist/browser/callRecording.js.map +1 -1
- package/dist/browser/contentDownloader.js +11 -12
- package/dist/browser/contentDownloader.js.map +1 -1
- package/dist/browser/credential/callAutomationAccessKeyCredentialPolicy.js +1 -2
- package/dist/browser/credential/callAutomationAccessKeyCredentialPolicy.js.map +1 -1
- package/dist/browser/credential/callAutomationAuthPolicy.js +1 -1
- package/dist/browser/credential/callAutomationAuthPolicy.js.map +1 -1
- package/dist/browser/credential/cryptoUtils-browser.mjs.map +1 -1
- package/dist/browser/credential/cryptoUtils.js +1 -2
- package/dist/browser/generated/src/callAutomationApiClient.d.ts +1 -2
- package/dist/browser/generated/src/callAutomationApiClient.d.ts.map +1 -1
- package/dist/browser/generated/src/callAutomationApiClient.js +14 -6
- package/dist/browser/generated/src/callAutomationApiClient.js.map +1 -1
- package/dist/browser/generated/src/models/index.d.ts +534 -1064
- package/dist/browser/generated/src/models/index.d.ts.map +1 -1
- package/dist/browser/generated/src/models/index.js +87 -159
- package/dist/browser/generated/src/models/index.js.map +1 -1
- package/dist/browser/generated/src/models/mappers.d.ts +58 -86
- package/dist/browser/generated/src/models/mappers.d.ts.map +1 -1
- package/dist/browser/generated/src/models/mappers.js +1173 -2159
- package/dist/browser/generated/src/models/mappers.js.map +1 -1
- package/dist/browser/generated/src/models/parameters.d.ts +2 -7
- package/dist/browser/generated/src/models/parameters.d.ts.map +1 -1
- package/dist/browser/generated/src/models/parameters.js +10 -41
- package/dist/browser/generated/src/models/parameters.js.map +1 -1
- package/dist/browser/generated/src/operations/callConnection.d.ts +2 -9
- package/dist/browser/generated/src/operations/callConnection.d.ts.map +1 -1
- package/dist/browser/generated/src/operations/callConnection.js +24 -73
- package/dist/browser/generated/src/operations/callConnection.js.map +1 -1
- package/dist/browser/generated/src/operations/callMedia.d.ts +15 -15
- package/dist/browser/generated/src/operations/callMedia.d.ts.map +1 -1
- package/dist/browser/generated/src/operations/callMedia.js +51 -50
- package/dist/browser/generated/src/operations/callMedia.js.map +1 -1
- package/dist/browser/generated/src/operations/callRecording.d.ts +1 -7
- package/dist/browser/generated/src/operations/callRecording.d.ts.map +1 -1
- package/dist/browser/generated/src/operations/callRecording.js +1 -24
- package/dist/browser/generated/src/operations/callRecording.js.map +1 -1
- package/dist/browser/generated/src/operations/index.d.ts +0 -1
- package/dist/browser/generated/src/operations/index.d.ts.map +1 -1
- package/dist/browser/generated/src/operations/index.js +0 -1
- package/dist/browser/generated/src/operations/index.js.map +1 -1
- package/dist/browser/generated/src/operationsInterfaces/callConnection.d.ts +2 -9
- package/dist/browser/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
- package/dist/browser/generated/src/operationsInterfaces/callConnection.js.map +1 -1
- package/dist/browser/generated/src/operationsInterfaces/callMedia.d.ts +15 -15
- package/dist/browser/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
- package/dist/browser/generated/src/operationsInterfaces/callMedia.js.map +1 -1
- package/dist/browser/generated/src/operationsInterfaces/callRecording.d.ts +1 -7
- package/dist/browser/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
- package/dist/browser/generated/src/operationsInterfaces/callRecording.js.map +1 -1
- package/dist/browser/generated/src/operationsInterfaces/index.d.ts +0 -1
- package/dist/browser/generated/src/operationsInterfaces/index.d.ts.map +1 -1
- package/dist/browser/generated/src/operationsInterfaces/index.js +0 -1
- package/dist/browser/generated/src/operationsInterfaces/index.js.map +1 -1
- package/dist/browser/generated/src/pagingHelper.js +2 -4
- package/dist/browser/generated/src/pagingHelper.js.map +1 -1
- package/dist/browser/index.d.ts +0 -2
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +0 -2
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/models/constants.js +1 -1
- package/dist/browser/models/constants.js.map +1 -1
- package/dist/browser/models/events.d.ts +136 -195
- package/dist/browser/models/events.d.ts.map +1 -1
- package/dist/browser/models/events.js.map +1 -1
- package/dist/browser/models/models.d.ts +76 -39
- package/dist/browser/models/models.d.ts.map +1 -1
- package/dist/browser/models/models.js +1 -3
- package/dist/browser/models/models.js.map +1 -1
- package/dist/browser/models/options.d.ts +64 -30
- package/dist/browser/models/options.d.ts.map +1 -1
- package/dist/browser/models/options.js.map +1 -1
- package/dist/browser/models/responses.d.ts +19 -82
- package/dist/browser/models/responses.d.ts.map +1 -1
- package/dist/browser/models/responses.js.map +1 -1
- package/dist/browser/models/streaming.d.ts +38 -28
- package/dist/browser/models/streaming.d.ts.map +1 -1
- package/dist/browser/models/streaming.js +28 -57
- package/dist/browser/models/streaming.js.map +1 -1
- package/dist/browser/streamingData.d.ts.map +1 -1
- package/dist/browser/streamingData.js +15 -1
- package/dist/browser/streamingData.js.map +1 -1
- package/dist/browser/utli/converters.d.ts +1 -1
- package/dist/browser/utli/converters.d.ts.map +1 -1
- package/dist/browser/utli/converters.js +48 -9
- package/dist/browser/utli/converters.js.map +1 -1
- package/dist/commonjs/callAutomationClient.d.ts +0 -8
- package/dist/commonjs/callAutomationClient.d.ts.map +1 -1
- package/dist/commonjs/callAutomationClient.js +85 -139
- package/dist/commonjs/callAutomationClient.js.map +1 -1
- package/dist/commonjs/callAutomationEventParser.d.ts.map +1 -1
- package/dist/commonjs/callAutomationEventParser.js +21 -53
- package/dist/commonjs/callAutomationEventParser.js.map +1 -1
- package/dist/commonjs/callConnection.d.ts +12 -14
- package/dist/commonjs/callConnection.d.ts.map +1 -1
- package/dist/commonjs/callConnection.js +113 -185
- package/dist/commonjs/callConnection.js.map +1 -1
- package/dist/commonjs/callMedia.d.ts +15 -20
- package/dist/commonjs/callMedia.d.ts.map +1 -1
- package/dist/commonjs/callMedia.js +66 -185
- package/dist/commonjs/callMedia.js.map +1 -1
- package/dist/commonjs/callRecording.d.ts +2 -8
- package/dist/commonjs/callRecording.d.ts.map +1 -1
- package/dist/commonjs/callRecording.js +17 -27
- package/dist/commonjs/callRecording.js.map +1 -1
- package/dist/commonjs/contentDownloader.js +11 -12
- package/dist/commonjs/contentDownloader.js.map +1 -1
- package/dist/commonjs/credential/callAutomationAccessKeyCredentialPolicy.js +1 -2
- package/dist/commonjs/credential/callAutomationAccessKeyCredentialPolicy.js.map +1 -1
- package/dist/commonjs/credential/callAutomationAuthPolicy.js +1 -1
- package/dist/commonjs/credential/callAutomationAuthPolicy.js.map +1 -1
- package/dist/commonjs/generated/src/callAutomationApiClient.d.ts +1 -2
- package/dist/commonjs/generated/src/callAutomationApiClient.d.ts.map +1 -1
- package/dist/commonjs/generated/src/callAutomationApiClient.js +13 -5
- package/dist/commonjs/generated/src/callAutomationApiClient.js.map +1 -1
- package/dist/commonjs/generated/src/models/index.d.ts +534 -1064
- package/dist/commonjs/generated/src/models/index.d.ts.map +1 -1
- package/dist/commonjs/generated/src/models/index.js +88 -160
- package/dist/commonjs/generated/src/models/index.js.map +1 -1
- package/dist/commonjs/generated/src/models/mappers.d.ts +58 -86
- package/dist/commonjs/generated/src/models/mappers.d.ts.map +1 -1
- package/dist/commonjs/generated/src/models/mappers.js +1176 -2162
- package/dist/commonjs/generated/src/models/mappers.js.map +1 -1
- package/dist/commonjs/generated/src/models/parameters.d.ts +2 -7
- package/dist/commonjs/generated/src/models/parameters.d.ts.map +1 -1
- package/dist/commonjs/generated/src/models/parameters.js +10 -41
- package/dist/commonjs/generated/src/models/parameters.js.map +1 -1
- package/dist/commonjs/generated/src/operations/callConnection.d.ts +2 -9
- package/dist/commonjs/generated/src/operations/callConnection.d.ts.map +1 -1
- package/dist/commonjs/generated/src/operations/callConnection.js +24 -72
- package/dist/commonjs/generated/src/operations/callConnection.js.map +1 -1
- package/dist/commonjs/generated/src/operations/callMedia.d.ts +15 -15
- package/dist/commonjs/generated/src/operations/callMedia.d.ts.map +1 -1
- package/dist/commonjs/generated/src/operations/callMedia.js +51 -50
- package/dist/commonjs/generated/src/operations/callMedia.js.map +1 -1
- package/dist/commonjs/generated/src/operations/callRecording.d.ts +1 -7
- package/dist/commonjs/generated/src/operations/callRecording.d.ts.map +1 -1
- package/dist/commonjs/generated/src/operations/callRecording.js +1 -24
- package/dist/commonjs/generated/src/operations/callRecording.js.map +1 -1
- package/dist/commonjs/generated/src/operations/index.d.ts +0 -1
- package/dist/commonjs/generated/src/operations/index.d.ts.map +1 -1
- package/dist/commonjs/generated/src/operations/index.js +0 -1
- package/dist/commonjs/generated/src/operations/index.js.map +1 -1
- package/dist/commonjs/generated/src/operationsInterfaces/callConnection.d.ts +2 -9
- package/dist/commonjs/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
- package/dist/commonjs/generated/src/operationsInterfaces/callConnection.js.map +1 -1
- package/dist/commonjs/generated/src/operationsInterfaces/callMedia.d.ts +15 -15
- package/dist/commonjs/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
- package/dist/commonjs/generated/src/operationsInterfaces/callMedia.js.map +1 -1
- package/dist/commonjs/generated/src/operationsInterfaces/callRecording.d.ts +1 -7
- package/dist/commonjs/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
- package/dist/commonjs/generated/src/operationsInterfaces/callRecording.js.map +1 -1
- package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts +0 -1
- package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts.map +1 -1
- package/dist/commonjs/generated/src/operationsInterfaces/index.js +0 -1
- package/dist/commonjs/generated/src/operationsInterfaces/index.js.map +1 -1
- package/dist/commonjs/generated/src/pagingHelper.js +2 -4
- package/dist/commonjs/generated/src/pagingHelper.js.map +1 -1
- package/dist/commonjs/index.d.ts +0 -2
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +0 -2
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/models/constants.js +1 -1
- package/dist/commonjs/models/constants.js.map +1 -1
- package/dist/commonjs/models/events.d.ts +136 -195
- package/dist/commonjs/models/events.d.ts.map +1 -1
- package/dist/commonjs/models/events.js.map +1 -1
- package/dist/commonjs/models/models.d.ts +76 -39
- package/dist/commonjs/models/models.d.ts.map +1 -1
- package/dist/commonjs/models/models.js +2 -21
- package/dist/commonjs/models/models.js.map +1 -1
- package/dist/commonjs/models/options.d.ts +64 -30
- package/dist/commonjs/models/options.d.ts.map +1 -1
- package/dist/commonjs/models/options.js.map +1 -1
- package/dist/commonjs/models/responses.d.ts +19 -82
- package/dist/commonjs/models/responses.d.ts.map +1 -1
- package/dist/commonjs/models/responses.js.map +1 -1
- package/dist/commonjs/models/streaming.d.ts +38 -28
- package/dist/commonjs/models/streaming.d.ts.map +1 -1
- package/dist/commonjs/models/streaming.js +31 -59
- package/dist/commonjs/models/streaming.js.map +1 -1
- package/dist/commonjs/streamingData.d.ts.map +1 -1
- package/dist/commonjs/streamingData.js +15 -1
- package/dist/commonjs/streamingData.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/commonjs/utli/converters.d.ts +1 -1
- package/dist/commonjs/utli/converters.d.ts.map +1 -1
- package/dist/commonjs/utli/converters.js +47 -8
- package/dist/commonjs/utli/converters.js.map +1 -1
- package/dist/esm/callAutomationClient.d.ts +0 -8
- package/dist/esm/callAutomationClient.d.ts.map +1 -1
- package/dist/esm/callAutomationClient.js +87 -141
- package/dist/esm/callAutomationClient.js.map +1 -1
- package/dist/esm/callAutomationEventParser.d.ts.map +1 -1
- package/dist/esm/callAutomationEventParser.js +22 -54
- package/dist/esm/callAutomationEventParser.js.map +1 -1
- package/dist/esm/callConnection.d.ts +12 -14
- package/dist/esm/callConnection.d.ts.map +1 -1
- package/dist/esm/callConnection.js +111 -183
- package/dist/esm/callConnection.js.map +1 -1
- package/dist/esm/callMedia.d.ts +15 -20
- package/dist/esm/callMedia.d.ts.map +1 -1
- package/dist/esm/callMedia.js +58 -177
- package/dist/esm/callMedia.js.map +1 -1
- package/dist/esm/callRecording.d.ts +2 -8
- package/dist/esm/callRecording.d.ts.map +1 -1
- package/dist/esm/callRecording.js +16 -26
- package/dist/esm/callRecording.js.map +1 -1
- package/dist/esm/contentDownloader.js +11 -12
- package/dist/esm/contentDownloader.js.map +1 -1
- package/dist/esm/credential/callAutomationAccessKeyCredentialPolicy.js +1 -2
- package/dist/esm/credential/callAutomationAccessKeyCredentialPolicy.js.map +1 -1
- package/dist/esm/credential/callAutomationAuthPolicy.js +1 -1
- package/dist/esm/credential/callAutomationAuthPolicy.js.map +1 -1
- package/dist/esm/generated/src/callAutomationApiClient.d.ts +1 -2
- package/dist/esm/generated/src/callAutomationApiClient.d.ts.map +1 -1
- package/dist/esm/generated/src/callAutomationApiClient.js +14 -6
- package/dist/esm/generated/src/callAutomationApiClient.js.map +1 -1
- package/dist/esm/generated/src/models/index.d.ts +534 -1064
- package/dist/esm/generated/src/models/index.d.ts.map +1 -1
- package/dist/esm/generated/src/models/index.js +87 -159
- package/dist/esm/generated/src/models/index.js.map +1 -1
- package/dist/esm/generated/src/models/mappers.d.ts +58 -86
- package/dist/esm/generated/src/models/mappers.d.ts.map +1 -1
- package/dist/esm/generated/src/models/mappers.js +1173 -2159
- package/dist/esm/generated/src/models/mappers.js.map +1 -1
- package/dist/esm/generated/src/models/parameters.d.ts +2 -7
- package/dist/esm/generated/src/models/parameters.d.ts.map +1 -1
- package/dist/esm/generated/src/models/parameters.js +10 -41
- package/dist/esm/generated/src/models/parameters.js.map +1 -1
- package/dist/esm/generated/src/operations/callConnection.d.ts +2 -9
- package/dist/esm/generated/src/operations/callConnection.d.ts.map +1 -1
- package/dist/esm/generated/src/operations/callConnection.js +24 -73
- package/dist/esm/generated/src/operations/callConnection.js.map +1 -1
- package/dist/esm/generated/src/operations/callMedia.d.ts +15 -15
- package/dist/esm/generated/src/operations/callMedia.d.ts.map +1 -1
- package/dist/esm/generated/src/operations/callMedia.js +51 -50
- package/dist/esm/generated/src/operations/callMedia.js.map +1 -1
- package/dist/esm/generated/src/operations/callRecording.d.ts +1 -7
- package/dist/esm/generated/src/operations/callRecording.d.ts.map +1 -1
- package/dist/esm/generated/src/operations/callRecording.js +1 -24
- package/dist/esm/generated/src/operations/callRecording.js.map +1 -1
- package/dist/esm/generated/src/operations/index.d.ts +0 -1
- package/dist/esm/generated/src/operations/index.d.ts.map +1 -1
- package/dist/esm/generated/src/operations/index.js +0 -1
- package/dist/esm/generated/src/operations/index.js.map +1 -1
- package/dist/esm/generated/src/operationsInterfaces/callConnection.d.ts +2 -9
- package/dist/esm/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
- package/dist/esm/generated/src/operationsInterfaces/callConnection.js.map +1 -1
- package/dist/esm/generated/src/operationsInterfaces/callMedia.d.ts +15 -15
- package/dist/esm/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
- package/dist/esm/generated/src/operationsInterfaces/callMedia.js.map +1 -1
- package/dist/esm/generated/src/operationsInterfaces/callRecording.d.ts +1 -7
- package/dist/esm/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
- package/dist/esm/generated/src/operationsInterfaces/callRecording.js.map +1 -1
- package/dist/esm/generated/src/operationsInterfaces/index.d.ts +0 -1
- package/dist/esm/generated/src/operationsInterfaces/index.d.ts.map +1 -1
- package/dist/esm/generated/src/operationsInterfaces/index.js +0 -1
- package/dist/esm/generated/src/operationsInterfaces/index.js.map +1 -1
- package/dist/esm/generated/src/pagingHelper.js +2 -4
- package/dist/esm/generated/src/pagingHelper.js.map +1 -1
- package/dist/esm/index.d.ts +0 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/models/constants.js +1 -1
- package/dist/esm/models/constants.js.map +1 -1
- package/dist/esm/models/events.d.ts +136 -195
- package/dist/esm/models/events.d.ts.map +1 -1
- package/dist/esm/models/events.js.map +1 -1
- package/dist/esm/models/models.d.ts +76 -39
- package/dist/esm/models/models.d.ts.map +1 -1
- package/dist/esm/models/models.js +1 -3
- package/dist/esm/models/models.js.map +1 -1
- package/dist/esm/models/options.d.ts +64 -30
- package/dist/esm/models/options.d.ts.map +1 -1
- package/dist/esm/models/options.js.map +1 -1
- package/dist/esm/models/responses.d.ts +19 -82
- package/dist/esm/models/responses.d.ts.map +1 -1
- package/dist/esm/models/responses.js.map +1 -1
- package/dist/esm/models/streaming.d.ts +38 -28
- package/dist/esm/models/streaming.d.ts.map +1 -1
- package/dist/esm/models/streaming.js +28 -57
- package/dist/esm/models/streaming.js.map +1 -1
- package/dist/esm/streamingData.d.ts.map +1 -1
- package/dist/esm/streamingData.js +15 -1
- package/dist/esm/streamingData.js.map +1 -1
- package/dist/esm/utli/converters.d.ts +1 -1
- package/dist/esm/utli/converters.d.ts.map +1 -1
- package/dist/esm/utli/converters.js +48 -9
- package/dist/esm/utli/converters.js.map +1 -1
- package/dist/react-native/callAutomationClient.d.ts +0 -8
- package/dist/react-native/callAutomationClient.d.ts.map +1 -1
- package/dist/react-native/callAutomationClient.js +87 -141
- package/dist/react-native/callAutomationClient.js.map +1 -1
- package/dist/react-native/callAutomationEventParser.d.ts.map +1 -1
- package/dist/react-native/callAutomationEventParser.js +22 -54
- package/dist/react-native/callAutomationEventParser.js.map +1 -1
- package/dist/react-native/callConnection.d.ts +12 -14
- package/dist/react-native/callConnection.d.ts.map +1 -1
- package/dist/react-native/callConnection.js +111 -183
- package/dist/react-native/callConnection.js.map +1 -1
- package/dist/react-native/callMedia.d.ts +15 -20
- package/dist/react-native/callMedia.d.ts.map +1 -1
- package/dist/react-native/callMedia.js +58 -177
- package/dist/react-native/callMedia.js.map +1 -1
- package/dist/react-native/callRecording.d.ts +2 -8
- package/dist/react-native/callRecording.d.ts.map +1 -1
- package/dist/react-native/callRecording.js +16 -26
- package/dist/react-native/callRecording.js.map +1 -1
- package/dist/react-native/contentDownloader.js +11 -12
- package/dist/react-native/contentDownloader.js.map +1 -1
- package/dist/react-native/credential/callAutomationAccessKeyCredentialPolicy.js +1 -2
- package/dist/react-native/credential/callAutomationAccessKeyCredentialPolicy.js.map +1 -1
- package/dist/react-native/credential/callAutomationAuthPolicy.js +1 -1
- package/dist/react-native/credential/callAutomationAuthPolicy.js.map +1 -1
- package/dist/react-native/generated/src/callAutomationApiClient.d.ts +1 -2
- package/dist/react-native/generated/src/callAutomationApiClient.d.ts.map +1 -1
- package/dist/react-native/generated/src/callAutomationApiClient.js +14 -6
- package/dist/react-native/generated/src/callAutomationApiClient.js.map +1 -1
- package/dist/react-native/generated/src/models/index.d.ts +534 -1064
- package/dist/react-native/generated/src/models/index.d.ts.map +1 -1
- package/dist/react-native/generated/src/models/index.js +87 -159
- package/dist/react-native/generated/src/models/index.js.map +1 -1
- package/dist/react-native/generated/src/models/mappers.d.ts +58 -86
- package/dist/react-native/generated/src/models/mappers.d.ts.map +1 -1
- package/dist/react-native/generated/src/models/mappers.js +1173 -2159
- package/dist/react-native/generated/src/models/mappers.js.map +1 -1
- package/dist/react-native/generated/src/models/parameters.d.ts +2 -7
- package/dist/react-native/generated/src/models/parameters.d.ts.map +1 -1
- package/dist/react-native/generated/src/models/parameters.js +10 -41
- package/dist/react-native/generated/src/models/parameters.js.map +1 -1
- package/dist/react-native/generated/src/operations/callConnection.d.ts +2 -9
- package/dist/react-native/generated/src/operations/callConnection.d.ts.map +1 -1
- package/dist/react-native/generated/src/operations/callConnection.js +24 -73
- package/dist/react-native/generated/src/operations/callConnection.js.map +1 -1
- package/dist/react-native/generated/src/operations/callMedia.d.ts +15 -15
- package/dist/react-native/generated/src/operations/callMedia.d.ts.map +1 -1
- package/dist/react-native/generated/src/operations/callMedia.js +51 -50
- package/dist/react-native/generated/src/operations/callMedia.js.map +1 -1
- package/dist/react-native/generated/src/operations/callRecording.d.ts +1 -7
- package/dist/react-native/generated/src/operations/callRecording.d.ts.map +1 -1
- package/dist/react-native/generated/src/operations/callRecording.js +1 -24
- package/dist/react-native/generated/src/operations/callRecording.js.map +1 -1
- package/dist/react-native/generated/src/operations/index.d.ts +0 -1
- package/dist/react-native/generated/src/operations/index.d.ts.map +1 -1
- package/dist/react-native/generated/src/operations/index.js +0 -1
- package/dist/react-native/generated/src/operations/index.js.map +1 -1
- package/dist/react-native/generated/src/operationsInterfaces/callConnection.d.ts +2 -9
- package/dist/react-native/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
- package/dist/react-native/generated/src/operationsInterfaces/callConnection.js.map +1 -1
- package/dist/react-native/generated/src/operationsInterfaces/callMedia.d.ts +15 -15
- package/dist/react-native/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
- package/dist/react-native/generated/src/operationsInterfaces/callMedia.js.map +1 -1
- package/dist/react-native/generated/src/operationsInterfaces/callRecording.d.ts +1 -7
- package/dist/react-native/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
- package/dist/react-native/generated/src/operationsInterfaces/callRecording.js.map +1 -1
- package/dist/react-native/generated/src/operationsInterfaces/index.d.ts +0 -1
- package/dist/react-native/generated/src/operationsInterfaces/index.d.ts.map +1 -1
- package/dist/react-native/generated/src/operationsInterfaces/index.js +0 -1
- package/dist/react-native/generated/src/operationsInterfaces/index.js.map +1 -1
- package/dist/react-native/generated/src/pagingHelper.js +2 -4
- package/dist/react-native/generated/src/pagingHelper.js.map +1 -1
- package/dist/react-native/index.d.ts +0 -2
- package/dist/react-native/index.d.ts.map +1 -1
- package/dist/react-native/index.js +0 -2
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/models/constants.js +1 -1
- package/dist/react-native/models/constants.js.map +1 -1
- package/dist/react-native/models/events.d.ts +136 -195
- package/dist/react-native/models/events.d.ts.map +1 -1
- package/dist/react-native/models/events.js.map +1 -1
- package/dist/react-native/models/models.d.ts +76 -39
- package/dist/react-native/models/models.d.ts.map +1 -1
- package/dist/react-native/models/models.js +1 -3
- package/dist/react-native/models/models.js.map +1 -1
- package/dist/react-native/models/options.d.ts +64 -30
- package/dist/react-native/models/options.d.ts.map +1 -1
- package/dist/react-native/models/options.js.map +1 -1
- package/dist/react-native/models/responses.d.ts +19 -82
- package/dist/react-native/models/responses.d.ts.map +1 -1
- package/dist/react-native/models/responses.js.map +1 -1
- package/dist/react-native/models/streaming.d.ts +38 -28
- package/dist/react-native/models/streaming.d.ts.map +1 -1
- package/dist/react-native/models/streaming.js +28 -57
- package/dist/react-native/models/streaming.js.map +1 -1
- package/dist/react-native/streamingData.d.ts.map +1 -1
- package/dist/react-native/streamingData.js +15 -1
- package/dist/react-native/streamingData.js.map +1 -1
- package/dist/react-native/utli/converters.d.ts +1 -1
- package/dist/react-native/utli/converters.d.ts.map +1 -1
- package/dist/react-native/utli/converters.js +48 -9
- package/dist/react-native/utli/converters.js.map +1 -1
- package/package.json +35 -36
- package/dist/browser/eventprocessor/callAutomationEventProcessor.d.ts +0 -39
- package/dist/browser/eventprocessor/callAutomationEventProcessor.d.ts.map +0 -1
- package/dist/browser/eventprocessor/callAutomationEventProcessor.js +0 -137
- package/dist/browser/eventprocessor/callAutomationEventProcessor.js.map +0 -1
- package/dist/browser/eventprocessor/eventResponses.d.ts +0 -134
- package/dist/browser/eventprocessor/eventResponses.d.ts.map +0 -1
- package/dist/browser/eventprocessor/eventResponses.js +0 -4
- package/dist/browser/eventprocessor/eventResponses.js.map +0 -1
- package/dist/browser/generated/src/operations/callDialog.d.ts +0 -35
- package/dist/browser/generated/src/operations/callDialog.d.ts.map +0 -1
- package/dist/browser/generated/src/operations/callDialog.js +0 -111
- package/dist/browser/generated/src/operations/callDialog.js.map +0 -1
- package/dist/browser/generated/src/operationsInterfaces/callDialog.d.ts +0 -27
- package/dist/browser/generated/src/operationsInterfaces/callDialog.d.ts.map +0 -1
- package/dist/browser/generated/src/operationsInterfaces/callDialog.js +0 -9
- package/dist/browser/generated/src/operationsInterfaces/callDialog.js.map +0 -1
- package/dist/commonjs/eventprocessor/callAutomationEventProcessor.d.ts +0 -39
- package/dist/commonjs/eventprocessor/callAutomationEventProcessor.d.ts.map +0 -1
- package/dist/commonjs/eventprocessor/callAutomationEventProcessor.js +0 -141
- package/dist/commonjs/eventprocessor/callAutomationEventProcessor.js.map +0 -1
- package/dist/commonjs/eventprocessor/eventResponses.d.ts +0 -134
- package/dist/commonjs/eventprocessor/eventResponses.d.ts.map +0 -1
- package/dist/commonjs/eventprocessor/eventResponses.js +0 -5
- package/dist/commonjs/eventprocessor/eventResponses.js.map +0 -1
- package/dist/commonjs/generated/src/operations/callDialog.d.ts +0 -35
- package/dist/commonjs/generated/src/operations/callDialog.d.ts.map +0 -1
- package/dist/commonjs/generated/src/operations/callDialog.js +0 -116
- package/dist/commonjs/generated/src/operations/callDialog.js.map +0 -1
- package/dist/commonjs/generated/src/operationsInterfaces/callDialog.d.ts +0 -27
- package/dist/commonjs/generated/src/operationsInterfaces/callDialog.d.ts.map +0 -1
- package/dist/commonjs/generated/src/operationsInterfaces/callDialog.js +0 -10
- package/dist/commonjs/generated/src/operationsInterfaces/callDialog.js.map +0 -1
- package/dist/esm/eventprocessor/callAutomationEventProcessor.d.ts +0 -39
- package/dist/esm/eventprocessor/callAutomationEventProcessor.d.ts.map +0 -1
- package/dist/esm/eventprocessor/callAutomationEventProcessor.js +0 -137
- package/dist/esm/eventprocessor/callAutomationEventProcessor.js.map +0 -1
- package/dist/esm/eventprocessor/eventResponses.d.ts +0 -134
- package/dist/esm/eventprocessor/eventResponses.d.ts.map +0 -1
- package/dist/esm/eventprocessor/eventResponses.js +0 -4
- package/dist/esm/eventprocessor/eventResponses.js.map +0 -1
- package/dist/esm/generated/src/operations/callDialog.d.ts +0 -35
- package/dist/esm/generated/src/operations/callDialog.d.ts.map +0 -1
- package/dist/esm/generated/src/operations/callDialog.js +0 -111
- package/dist/esm/generated/src/operations/callDialog.js.map +0 -1
- package/dist/esm/generated/src/operationsInterfaces/callDialog.d.ts +0 -27
- package/dist/esm/generated/src/operationsInterfaces/callDialog.d.ts.map +0 -1
- package/dist/esm/generated/src/operationsInterfaces/callDialog.js +0 -9
- package/dist/esm/generated/src/operationsInterfaces/callDialog.js.map +0 -1
- package/dist/react-native/eventprocessor/callAutomationEventProcessor.d.ts +0 -39
- package/dist/react-native/eventprocessor/callAutomationEventProcessor.d.ts.map +0 -1
- package/dist/react-native/eventprocessor/callAutomationEventProcessor.js +0 -137
- package/dist/react-native/eventprocessor/callAutomationEventProcessor.js.map +0 -1
- package/dist/react-native/eventprocessor/eventResponses.d.ts +0 -134
- package/dist/react-native/eventprocessor/eventResponses.d.ts.map +0 -1
- package/dist/react-native/eventprocessor/eventResponses.js +0 -4
- package/dist/react-native/eventprocessor/eventResponses.js.map +0 -1
- package/dist/react-native/generated/src/operations/callDialog.d.ts +0 -35
- package/dist/react-native/generated/src/operations/callDialog.d.ts.map +0 -1
- package/dist/react-native/generated/src/operations/callDialog.js +0 -111
- package/dist/react-native/generated/src/operations/callDialog.js.map +0 -1
- package/dist/react-native/generated/src/operationsInterfaces/callDialog.d.ts +0 -27
- package/dist/react-native/generated/src/operationsInterfaces/callDialog.d.ts.map +0 -1
- package/dist/react-native/generated/src/operationsInterfaces/callDialog.js +0 -9
- package/dist/react-native/generated/src/operationsInterfaces/callDialog.js.map +0 -1
|
@@ -3,39 +3,53 @@
|
|
|
3
3
|
// Licensed under the MIT License.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.CallConnection = void 0;
|
|
6
|
-
const
|
|
6
|
+
const communication_common_1 = require("@azure/communication-common");
|
|
7
7
|
const callMedia_js_1 = require("./callMedia.js");
|
|
8
|
-
const index_js_1 = require("./generated/src/
|
|
8
|
+
const index_js_1 = require("./generated/src/index.js");
|
|
9
|
+
const index_js_2 = require("./generated/src/operations/index.js");
|
|
9
10
|
const converters_js_1 = require("./utli/converters.js");
|
|
10
11
|
const core_util_1 = require("@azure/core-util");
|
|
11
|
-
const callAutomationAuthPolicy_js_1 = require("./credential/callAutomationAuthPolicy.js");
|
|
12
12
|
/**
|
|
13
13
|
* CallConnection class represents call connection based APIs.
|
|
14
14
|
*/
|
|
15
15
|
class CallConnection {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
callConnectionId;
|
|
17
|
+
callConnection;
|
|
18
|
+
callAutomationApiClient;
|
|
19
|
+
endpoint;
|
|
20
|
+
credential;
|
|
21
|
+
callAutomationApiClientOptions;
|
|
22
|
+
constructor(callConnectionId, endpoint, credential, options) {
|
|
23
|
+
this.callAutomationApiClient = new index_js_1.CallAutomationApiClient(endpoint, options);
|
|
24
|
+
const authPolicy = (0, communication_common_1.createCommunicationAuthPolicy)(credential);
|
|
25
|
+
this.callAutomationApiClient.pipeline.addPolicy(authPolicy);
|
|
18
26
|
this.callConnectionId = callConnectionId;
|
|
19
|
-
this.callConnection = new
|
|
27
|
+
this.callConnection = new index_js_2.CallConnectionImpl(this.callAutomationApiClient);
|
|
20
28
|
this.endpoint = endpoint;
|
|
21
29
|
this.credential = credential;
|
|
22
|
-
this.callAutomationEventProcessor = eventProcessor;
|
|
23
30
|
this.callAutomationApiClientOptions = options;
|
|
24
31
|
}
|
|
25
32
|
/**
|
|
26
33
|
* Initializes a new instance of CallMedia.
|
|
27
34
|
*/
|
|
28
35
|
getCallMedia() {
|
|
29
|
-
return new callMedia_js_1.CallMedia(this.callConnectionId, this.endpoint, this.credential, this.
|
|
36
|
+
return new callMedia_js_1.CallMedia(this.callConnectionId, this.endpoint, this.credential, this.callAutomationApiClientOptions);
|
|
30
37
|
}
|
|
31
38
|
/**
|
|
32
39
|
* Get call connection properties of the call
|
|
33
40
|
*/
|
|
34
41
|
async getCallConnectionProperties(options = {}) {
|
|
35
|
-
const
|
|
36
|
-
const callConnectionProperties =
|
|
42
|
+
const { targets, sourceCallerIdNumber, answeredBy, source, answeredFor, ...result } = await this.callConnection.getCall(this.callConnectionId, options);
|
|
43
|
+
const callConnectionProperties = {
|
|
44
|
+
...result,
|
|
45
|
+
source: source ? (0, converters_js_1.communicationIdentifierConverter)(source) : undefined,
|
|
46
|
+
answeredby: (0, converters_js_1.communicationUserIdentifierConverter)(answeredBy),
|
|
47
|
+
answeredFor: answeredFor ? (0, converters_js_1.phoneNumberIdentifierConverter)(answeredFor) : undefined,
|
|
48
|
+
targetParticipants: targets?.map((target) => (0, converters_js_1.communicationIdentifierConverter)(target)),
|
|
49
|
+
sourceCallerIdNumber: sourceCallerIdNumber
|
|
37
50
|
? (0, converters_js_1.phoneNumberIdentifierConverter)(sourceCallerIdNumber)
|
|
38
|
-
: undefined
|
|
51
|
+
: undefined,
|
|
52
|
+
};
|
|
39
53
|
return callConnectionProperties;
|
|
40
54
|
}
|
|
41
55
|
/**
|
|
@@ -45,7 +59,11 @@ class CallConnection {
|
|
|
45
59
|
*/
|
|
46
60
|
async hangUp(isForEveryone, options = {}) {
|
|
47
61
|
if (isForEveryone) {
|
|
48
|
-
const optionsInternal =
|
|
62
|
+
const optionsInternal = {
|
|
63
|
+
...options,
|
|
64
|
+
repeatabilityFirstSent: new Date(),
|
|
65
|
+
repeatabilityRequestID: (0, core_util_1.randomUUID)(),
|
|
66
|
+
};
|
|
49
67
|
await this.callConnection.terminateCall(this.callConnectionId, optionsInternal);
|
|
50
68
|
}
|
|
51
69
|
else {
|
|
@@ -75,28 +93,18 @@ class CallConnection {
|
|
|
75
93
|
* Get all participants from the call
|
|
76
94
|
*/
|
|
77
95
|
async listParticipants(options = {}) {
|
|
78
|
-
var _a, e_1, _b, _c;
|
|
79
96
|
const result = this.callConnection.listParticipants(this.callConnectionId, options);
|
|
80
97
|
const participants = [];
|
|
81
|
-
const pages = result
|
|
82
|
-
|
|
83
|
-
for (
|
|
84
|
-
|
|
85
|
-
_d = false;
|
|
86
|
-
const page = _c;
|
|
87
|
-
for (const participant of page) {
|
|
88
|
-
participants.push((0, converters_js_1.callParticipantConverter)(participant));
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
93
|
-
finally {
|
|
94
|
-
try {
|
|
95
|
-
if (!_d && !_a && (_b = pages_1.return)) await _b.call(pages_1);
|
|
98
|
+
const pages = result?.byPage();
|
|
99
|
+
for await (const page of pages) {
|
|
100
|
+
for (const participant of page) {
|
|
101
|
+
participants.push((0, converters_js_1.callParticipantConverter)(participant));
|
|
96
102
|
}
|
|
97
|
-
finally { if (e_1) throw e_1.error; }
|
|
98
103
|
}
|
|
99
|
-
const listParticipantResponse =
|
|
104
|
+
const listParticipantResponse = {
|
|
105
|
+
...result,
|
|
106
|
+
values: participants,
|
|
107
|
+
};
|
|
100
108
|
return listParticipantResponse;
|
|
101
109
|
}
|
|
102
110
|
createCustomCallingContextInternal(customCallingContext) {
|
|
@@ -136,45 +144,30 @@ class CallConnection {
|
|
|
136
144
|
* @param participant - The participant is going to be added.
|
|
137
145
|
*/
|
|
138
146
|
async addParticipant(targetParticipant, options = {}) {
|
|
139
|
-
var _a, _b;
|
|
140
147
|
const addParticipantRequest = {
|
|
141
148
|
participantToAdd: (0, converters_js_1.communicationIdentifierModelConverter)(targetParticipant.targetParticipant),
|
|
142
149
|
sourceCallerIdNumber: (0, converters_js_1.PhoneNumberIdentifierModelConverter)(targetParticipant.sourceCallIdNumber),
|
|
143
150
|
sourceDisplayName: targetParticipant.sourceDisplayName,
|
|
144
151
|
invitationTimeoutInSeconds: options.invitationTimeoutInSeconds,
|
|
145
|
-
operationContext: options.operationContext
|
|
152
|
+
operationContext: options.operationContext,
|
|
146
153
|
operationCallbackUri: options.operationCallbackUrl,
|
|
147
154
|
customCallingContext: this.createCustomCallingContextInternal(targetParticipant.customCallingContext),
|
|
148
155
|
};
|
|
149
|
-
const optionsInternal =
|
|
156
|
+
const optionsInternal = {
|
|
157
|
+
...options,
|
|
158
|
+
repeatabilityFirstSent: new Date(),
|
|
159
|
+
repeatabilityRequestID: (0, core_util_1.randomUUID)(),
|
|
160
|
+
};
|
|
150
161
|
const result = await this.callConnection.addParticipant(this.callConnectionId, addParticipantRequest, optionsInternal);
|
|
151
|
-
const addParticipantsResult =
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
event.operationContext === addParticipantRequest.operationContext) {
|
|
161
|
-
addParticipantEventResult.isSuccess = true;
|
|
162
|
-
addParticipantEventResult.successResult = event;
|
|
163
|
-
return true;
|
|
164
|
-
}
|
|
165
|
-
else if (event.callConnectionId === this.callConnectionId &&
|
|
166
|
-
event.kind === "AddParticipantFailed" &&
|
|
167
|
-
event.operationContext === addParticipantRequest.operationContext) {
|
|
168
|
-
addParticipantEventResult.isSuccess = false;
|
|
169
|
-
addParticipantEventResult.failureResult = event;
|
|
170
|
-
return true;
|
|
171
|
-
}
|
|
172
|
-
else {
|
|
173
|
-
return false;
|
|
174
|
-
}
|
|
175
|
-
}, abortSignal, timeoutInMs);
|
|
176
|
-
return addParticipantEventResult;
|
|
177
|
-
} });
|
|
162
|
+
const addParticipantsResult = {
|
|
163
|
+
...result,
|
|
164
|
+
participant: {
|
|
165
|
+
...result.participant,
|
|
166
|
+
identifier: result.participant?.identifier
|
|
167
|
+
? (0, converters_js_1.communicationIdentifierConverter)(result.participant?.identifier)
|
|
168
|
+
: undefined,
|
|
169
|
+
},
|
|
170
|
+
};
|
|
178
171
|
return addParticipantsResult;
|
|
179
172
|
}
|
|
180
173
|
/**
|
|
@@ -191,33 +184,15 @@ class CallConnection {
|
|
|
191
184
|
customCallingContext: this.createCustomCallingContextInternal(options.customCallingContext),
|
|
192
185
|
sourceCallerIdNumber: (0, converters_js_1.PhoneNumberIdentifierModelConverter)(options.sourceCallIdNumber),
|
|
193
186
|
};
|
|
194
|
-
const optionsInternal =
|
|
187
|
+
const optionsInternal = {
|
|
188
|
+
...options,
|
|
189
|
+
repeatabilityFirstSent: new Date(),
|
|
190
|
+
repeatabilityRequestID: (0, core_util_1.randomUUID)(),
|
|
191
|
+
};
|
|
195
192
|
const result = await this.callConnection.transferToParticipant(this.callConnectionId, transferToParticipantRequest, optionsInternal);
|
|
196
|
-
const transferCallResult =
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
};
|
|
200
|
-
await this.callAutomationEventProcessor.waitForEventProcessor((event) => {
|
|
201
|
-
if (event.callConnectionId === this.callConnectionId &&
|
|
202
|
-
event.kind === "CallTransferAccepted" &&
|
|
203
|
-
event.operationContext === transferToParticipantRequest.operationContext) {
|
|
204
|
-
transferCallToParticipantEventResult.isSuccess = true;
|
|
205
|
-
transferCallToParticipantEventResult.successResult = event;
|
|
206
|
-
return true;
|
|
207
|
-
}
|
|
208
|
-
else if (event.callConnectionId === this.callConnectionId &&
|
|
209
|
-
event.kind === "CallTransferFailed" &&
|
|
210
|
-
event.operationContext === transferToParticipantRequest.operationContext) {
|
|
211
|
-
transferCallToParticipantEventResult.isSuccess = false;
|
|
212
|
-
transferCallToParticipantEventResult.failureResult = event;
|
|
213
|
-
return true;
|
|
214
|
-
}
|
|
215
|
-
else {
|
|
216
|
-
return false;
|
|
217
|
-
}
|
|
218
|
-
}, abortSignal, timeoutInMs);
|
|
219
|
-
return transferCallToParticipantEventResult;
|
|
220
|
-
} });
|
|
193
|
+
const transferCallResult = {
|
|
194
|
+
...result,
|
|
195
|
+
};
|
|
221
196
|
return transferCallResult;
|
|
222
197
|
}
|
|
223
198
|
/**
|
|
@@ -231,78 +206,16 @@ class CallConnection {
|
|
|
231
206
|
operationContext: options.operationContext ? options.operationContext : (0, core_util_1.randomUUID)(),
|
|
232
207
|
operationCallbackUri: options.operationCallbackUrl,
|
|
233
208
|
};
|
|
234
|
-
const optionsInternal =
|
|
209
|
+
const optionsInternal = {
|
|
210
|
+
...options,
|
|
211
|
+
repeatabilityFirstSent: new Date(),
|
|
212
|
+
repeatabilityRequestID: (0, core_util_1.randomUUID)(),
|
|
213
|
+
};
|
|
235
214
|
const result = await this.callConnection.removeParticipant(this.callConnectionId, removeParticipantRequest, optionsInternal);
|
|
236
|
-
const removeParticipantsResult =
|
|
237
|
-
|
|
238
|
-
isSuccess: false,
|
|
239
|
-
};
|
|
240
|
-
await this.callAutomationEventProcessor.waitForEventProcessor((event) => {
|
|
241
|
-
if (event.callConnectionId === this.callConnectionId &&
|
|
242
|
-
event.kind === "RemoveParticipantSucceeded" &&
|
|
243
|
-
event.operationContext === removeParticipantRequest.operationContext) {
|
|
244
|
-
removeParticipantEventResult.isSuccess = true;
|
|
245
|
-
removeParticipantEventResult.successResult = event;
|
|
246
|
-
return true;
|
|
247
|
-
}
|
|
248
|
-
else if (event.callConnectionId === this.callConnectionId &&
|
|
249
|
-
event.kind === "RemoveParticipantFailed" &&
|
|
250
|
-
event.operationContext === removeParticipantRequest.operationContext) {
|
|
251
|
-
removeParticipantEventResult.isSuccess = false;
|
|
252
|
-
removeParticipantEventResult.failureResult = event;
|
|
253
|
-
return true;
|
|
254
|
-
}
|
|
255
|
-
else {
|
|
256
|
-
return false;
|
|
257
|
-
}
|
|
258
|
-
}, abortSignal, timeoutInMs);
|
|
259
|
-
return removeParticipantEventResult;
|
|
260
|
-
} });
|
|
261
|
-
return removeParticipantsResult;
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* Move participants to the call
|
|
265
|
-
*
|
|
266
|
-
* @param targetParticipants - The participants to be moved to the call.
|
|
267
|
-
* @param fromCall - The CallConnectionId for the call you want to move the participant from.
|
|
268
|
-
* @param options - Additional attributes for move participants.
|
|
269
|
-
*/
|
|
270
|
-
async moveParticipants(targetParticipants, fromCall, options = {}) {
|
|
271
|
-
var _a;
|
|
272
|
-
const moveParticipantsRequest = {
|
|
273
|
-
targetParticipants: targetParticipants.map((participant) => (0, converters_js_1.communicationIdentifierModelConverter)(participant)),
|
|
274
|
-
fromCall: fromCall,
|
|
275
|
-
operationContext: options.operationContext ? options.operationContext : (0, core_util_1.randomUUID)(),
|
|
276
|
-
operationCallbackUri: options.operationCallbackUrl,
|
|
215
|
+
const removeParticipantsResult = {
|
|
216
|
+
...result,
|
|
277
217
|
};
|
|
278
|
-
|
|
279
|
-
const result = await this.callConnection.moveParticipants(this.callConnectionId, moveParticipantsRequest, optionsInternal);
|
|
280
|
-
const moveParticipantsResult = Object.assign(Object.assign({}, result), { participants: (_a = result.participants) === null || _a === void 0 ? void 0 : _a.map((participant) => (0, converters_js_1.callParticipantConverter)(participant)), fromCall: fromCall, waitForEventProcessor: async (abortSignal, timeoutInMs) => {
|
|
281
|
-
const moveParticipantEventResult = {
|
|
282
|
-
isSuccess: false,
|
|
283
|
-
};
|
|
284
|
-
await this.callAutomationEventProcessor.waitForEventProcessor((event) => {
|
|
285
|
-
if (event.callConnectionId === this.callConnectionId &&
|
|
286
|
-
event.kind === "MoveParticipantSucceeded" &&
|
|
287
|
-
event.operationContext === moveParticipantsRequest.operationContext) {
|
|
288
|
-
moveParticipantEventResult.isSuccess = true;
|
|
289
|
-
moveParticipantEventResult.successResult = event;
|
|
290
|
-
return true;
|
|
291
|
-
}
|
|
292
|
-
else if (event.callConnectionId === this.callConnectionId &&
|
|
293
|
-
event.kind === "MoveParticipantFailed" &&
|
|
294
|
-
event.operationContext === moveParticipantsRequest.operationContext) {
|
|
295
|
-
moveParticipantEventResult.isSuccess = false;
|
|
296
|
-
moveParticipantEventResult.failureResult = event;
|
|
297
|
-
return true;
|
|
298
|
-
}
|
|
299
|
-
else {
|
|
300
|
-
return false;
|
|
301
|
-
}
|
|
302
|
-
}, abortSignal, timeoutInMs);
|
|
303
|
-
return moveParticipantEventResult;
|
|
304
|
-
} });
|
|
305
|
-
return moveParticipantsResult;
|
|
218
|
+
return removeParticipantsResult;
|
|
306
219
|
}
|
|
307
220
|
/**
|
|
308
221
|
* Mute participant from the call.
|
|
@@ -315,9 +228,15 @@ class CallConnection {
|
|
|
315
228
|
targetParticipants: [(0, converters_js_1.communicationIdentifierModelConverter)(participant)],
|
|
316
229
|
operationContext: options.operationContext,
|
|
317
230
|
};
|
|
318
|
-
const optionsInternal =
|
|
231
|
+
const optionsInternal = {
|
|
232
|
+
...options,
|
|
233
|
+
repeatabilityFirstSent: new Date(),
|
|
234
|
+
repeatabilityRequestID: (0, core_util_1.randomUUID)(),
|
|
235
|
+
};
|
|
319
236
|
const result = await this.callConnection.mute(this.callConnectionId, muteParticipantsRequest, optionsInternal);
|
|
320
|
-
const muteParticipantResult =
|
|
237
|
+
const muteParticipantResult = {
|
|
238
|
+
...result,
|
|
239
|
+
};
|
|
321
240
|
return muteParticipantResult;
|
|
322
241
|
}
|
|
323
242
|
/** Cancel add participant request.
|
|
@@ -325,41 +244,50 @@ class CallConnection {
|
|
|
325
244
|
* @param invitationId - Invitation ID used to cancel the add participant request.
|
|
326
245
|
*/
|
|
327
246
|
async cancelAddParticipantOperation(invitationId, options = {}) {
|
|
328
|
-
const { operationContext, operationCallbackUrl: operationCallbackUri
|
|
247
|
+
const { operationContext, operationCallbackUrl: operationCallbackUri, ...operationOptions } = options;
|
|
329
248
|
const cancelAddParticipantRequest = {
|
|
330
249
|
invitationId,
|
|
331
250
|
operationContext: operationContext ? operationContext : (0, core_util_1.randomUUID)(),
|
|
332
251
|
operationCallbackUri,
|
|
333
252
|
};
|
|
334
|
-
const optionsInternal =
|
|
253
|
+
const optionsInternal = {
|
|
254
|
+
...operationOptions,
|
|
255
|
+
repeatabilityFirstSent: new Date(),
|
|
256
|
+
repeatabilityRequestID: (0, core_util_1.randomUUID)(),
|
|
257
|
+
};
|
|
335
258
|
const result = await this.callConnection.cancelAddParticipant(this.callConnectionId, cancelAddParticipantRequest, optionsInternal);
|
|
336
|
-
const cancelAddParticipantResult =
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
};
|
|
340
|
-
await this.callAutomationEventProcessor.waitForEventProcessor((event) => {
|
|
341
|
-
if (event.callConnectionId === this.callConnectionId &&
|
|
342
|
-
event.kind === "CancelAddParticipantSucceeded" &&
|
|
343
|
-
event.operationContext === cancelAddParticipantRequest.operationContext) {
|
|
344
|
-
cancelAddParticipantEventResult.isSuccess = true;
|
|
345
|
-
cancelAddParticipantEventResult.successResult = event;
|
|
346
|
-
return true;
|
|
347
|
-
}
|
|
348
|
-
else if (event.callConnectionId === this.callConnectionId &&
|
|
349
|
-
event.kind === "CancelAddParticipantFailed" &&
|
|
350
|
-
event.operationContext === cancelAddParticipantRequest.operationContext) {
|
|
351
|
-
cancelAddParticipantEventResult.isSuccess = false;
|
|
352
|
-
cancelAddParticipantEventResult.failureResult = event;
|
|
353
|
-
return true;
|
|
354
|
-
}
|
|
355
|
-
else {
|
|
356
|
-
return false;
|
|
357
|
-
}
|
|
358
|
-
}, abortSignal, timeoutInMs);
|
|
359
|
-
return cancelAddParticipantEventResult;
|
|
360
|
-
} });
|
|
259
|
+
const cancelAddParticipantResult = {
|
|
260
|
+
...result,
|
|
261
|
+
};
|
|
361
262
|
return cancelAddParticipantResult;
|
|
362
263
|
}
|
|
264
|
+
/**
|
|
265
|
+
* Move participants to the call
|
|
266
|
+
*
|
|
267
|
+
* @param targetParticipants - The participants to be moved to the call.
|
|
268
|
+
* @param fromCall - The CallConnectionId for the call you want to move the participant from.
|
|
269
|
+
* @param options - Additional attributes for move participants.
|
|
270
|
+
*/
|
|
271
|
+
async moveParticipants(targetParticipants, fromCall, options = {}) {
|
|
272
|
+
const moveParticipantsRequest = {
|
|
273
|
+
targetParticipants: targetParticipants.map((participant) => (0, converters_js_1.communicationIdentifierModelConverter)(participant)),
|
|
274
|
+
fromCall: fromCall,
|
|
275
|
+
operationContext: options.operationContext ? options.operationContext : (0, core_util_1.randomUUID)(),
|
|
276
|
+
operationCallbackUri: options.operationCallbackUrl,
|
|
277
|
+
};
|
|
278
|
+
const optionsInternal = {
|
|
279
|
+
...options,
|
|
280
|
+
repeatabilityFirstSent: new Date(),
|
|
281
|
+
repeatabilityRequestID: (0, core_util_1.randomUUID)(),
|
|
282
|
+
};
|
|
283
|
+
const result = await this.callConnection.moveParticipants(this.callConnectionId, moveParticipantsRequest, optionsInternal);
|
|
284
|
+
const moveParticipantsResult = {
|
|
285
|
+
...result,
|
|
286
|
+
participants: result.participants?.map((participant) => (0, converters_js_1.callParticipantConverter)(participant)),
|
|
287
|
+
fromCall: fromCall,
|
|
288
|
+
};
|
|
289
|
+
return moveParticipantsResult;
|
|
290
|
+
}
|
|
363
291
|
}
|
|
364
292
|
exports.CallConnection = CallConnection;
|
|
365
293
|
//# sourceMappingURL=callConnection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callConnection.js","sourceRoot":"","sources":["../../src/callConnection.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAGlC,iDAA2C;AAW3C,kEAAyE;AA2BzE,wDAQ8B;AAC9B,gDAA8C;AAU9C,0FAA+F;AAE/F;;GAEG;AACH,MAAa,cAAc;IAQzB,YACE,gBAAwB,EACxB,QAAgB,EAChB,UAA2C,EAC3C,cAA4C,EAC5C,OAA+C;QAE/C,IAAI,CAAC,uBAAuB,GAAG,IAAA,iEAAmC,EAChE,UAAU,EACV,OAAO,EACP,QAAQ,CACT,CAAC;QACF,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,cAAc,GAAG,IAAI,6BAAkB,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;QAC3E,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CA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copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { CommunicationIdentifier } from \"@azure/communication-common\";\nimport { CallMedia } from \"./callMedia.js\";\nimport type {\n AddParticipantRequest,\n CallAutomationApiClient,\n CallAutomationApiClientOptionalParams,\n CustomCallingContextInternal,\n MoveParticipantsRequest,\n MuteParticipantsRequest,\n RemoveParticipantRequest,\n TransferToParticipantRequest,\n} from \"./generated/src/index.js\";\nimport { CallConnectionImpl } from \"./generated/src/operations/index.js\";\nimport {\n type CallConnectionProperties,\n type CallInvite,\n type CallParticipant,\n type CustomCallingContext,\n} from \"./models/models.js\";\nimport type {\n AddParticipantOptions,\n CancelAddParticipantOperationOptions,\n GetCallConnectionPropertiesOptions,\n GetParticipantOptions,\n HangUpOptions,\n MoveParticipantsOptions,\n MuteParticipantOption,\n RemoveParticipantsOption,\n TransferCallToParticipantOptions,\n} from \"./models/options.js\";\nimport type {\n ListParticipantsResult,\n TransferCallResult,\n AddParticipantResult,\n RemoveParticipantResult,\n MoveParticipantsResult,\n MuteParticipantResult,\n CancelAddParticipantOperationResult,\n} from \"./models/responses.js\";\nimport {\n callParticipantConverter,\n communicationIdentifierConverter,\n communicationIdentifierModelConverter,\n communicationUserIdentifierConverter,\n phoneNumberIdentifierConverter,\n PhoneNumberIdentifierModelConverter,\n teamsPhoneCallDetailsModelConverter,\n} from \"./utli/converters.js\";\nimport { randomUUID } from \"@azure/core-util\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport type { CallAutomationEventProcessor } from \"./eventprocessor/callAutomationEventProcessor.js\";\nimport type {\n AddParticipantEventResult,\n CancelAddParticipantEventResult,\n RemoveParticipantEventResult,\n MoveParticipantEventResult,\n TransferCallToParticipantEventResult,\n} from \"./eventprocessor/eventResponses.js\";\nimport { createCustomCallAutomationApiClient } from \"./credential/callAutomationAuthPolicy.js\";\n\n/**\n * CallConnection class represents call connection based APIs.\n */\nexport class CallConnection {\n private readonly callConnectionId: string;\n private readonly callConnection: CallConnectionImpl;\n private readonly callAutomationApiClient: CallAutomationApiClient;\n private readonly endpoint: string;\n private readonly credential: TokenCredential | KeyCredential;\n private readonly callAutomationApiClientOptions?: CallAutomationApiClientOptionalParams;\n private readonly callAutomationEventProcessor: CallAutomationEventProcessor;\n constructor(\n callConnectionId: string,\n endpoint: string,\n credential: KeyCredential | TokenCredential,\n eventProcessor: CallAutomationEventProcessor,\n options?: CallAutomationApiClientOptionalParams,\n ) {\n this.callAutomationApiClient = createCustomCallAutomationApiClient(\n credential,\n options,\n endpoint,\n );\n this.callConnectionId = callConnectionId;\n this.callConnection = new CallConnectionImpl(this.callAutomationApiClient);\n this.endpoint = endpoint;\n this.credential = credential;\n this.callAutomationEventProcessor = eventProcessor;\n this.callAutomationApiClientOptions = options;\n }\n\n /**\n * Initializes a new instance of CallMedia.\n */\n public getCallMedia(): CallMedia {\n return new CallMedia(\n this.callConnectionId,\n this.endpoint,\n this.credential,\n this.callAutomationEventProcessor,\n this.callAutomationApiClientOptions,\n );\n }\n\n /**\n * Get call connection properties of the call\n */\n public async getCallConnectionProperties(\n options: GetCallConnectionPropertiesOptions = {},\n ): Promise<CallConnectionProperties> {\n const { targets, sourceCallerIdNumber, answeredBy, source, answeredFor, ...result } =\n await this.callConnection.getCall(this.callConnectionId, options);\n const callConnectionProperties: CallConnectionProperties = {\n ...result,\n source: source ? communicationIdentifierConverter(source) : undefined,\n answeredby: communicationUserIdentifierConverter(answeredBy),\n answeredFor: answeredFor ? phoneNumberIdentifierConverter(answeredFor) : undefined,\n targetParticipants: targets?.map((target) => communicationIdentifierConverter(target)),\n sourceCallerIdNumber: sourceCallerIdNumber\n ? phoneNumberIdentifierConverter(sourceCallerIdNumber)\n : undefined,\n };\n return callConnectionProperties;\n }\n\n /**\n * Hang up the call for itself or terminate the whole call.\n *\n * @param isForEveryOne - Determine if every one in the call would be hung up or not.\n */\n public async hangUp(isForEveryone: boolean, options: HangUpOptions = {}): Promise<void> {\n if (isForEveryone) {\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n await this.callConnection.terminateCall(this.callConnectionId, optionsInternal);\n } else {\n await this.callConnection.hangupCall(this.callConnectionId, options);\n }\n return;\n }\n\n /**\n * Get a participant from the call\n *\n * @param targetParticipant - The communication identifier of requested participant.\n */\n public async getParticipant(\n targetParticipant: CommunicationIdentifier,\n options: GetParticipantOptions = {},\n ): Promise<CallParticipant> {\n let rawId: string | undefined = communicationIdentifierModelConverter(targetParticipant).rawId;\n rawId = rawId === undefined ? \"\" : rawId;\n\n const result = await this.callConnection.getParticipant(this.callConnectionId, rawId, options);\n const callParticipant: CallParticipant = {\n identifier: result.identifier\n ? communicationIdentifierConverter(result.identifier)\n : undefined,\n isMuted: result.isMuted,\n isOnHold: result.isOnHold,\n };\n return callParticipant;\n }\n\n /**\n * Get all participants from the call\n */\n public async listParticipants(\n options: GetParticipantOptions = {},\n ): Promise<ListParticipantsResult> {\n const result = this.callConnection.listParticipants(this.callConnectionId, options);\n const participants = [];\n const pages = result?.byPage();\n\n for await (const page of pages) {\n for (const participant of page) {\n participants.push(callParticipantConverter(participant));\n }\n }\n\n const listParticipantResponse: ListParticipantsResult = {\n ...result,\n values: participants,\n };\n return listParticipantResponse;\n }\n\n private createCustomCallingContextInternal(\n customCallingContext: CustomCallingContext,\n ): CustomCallingContextInternal {\n const sipHeaders: { [key: string]: string } = {};\n const voipHeaders: { [key: string]: string } = {};\n let teamsPhoneCallDetails: any = undefined;\n\n if (customCallingContext) {\n for (const header of customCallingContext) {\n if (header.kind === \"sipuui\") {\n sipHeaders[`User-To-User`] = header.value;\n } else if (header.kind === \"sipx\") {\n if (header.sipHeaderPrefix === \"X-\") {\n sipHeaders[`X-${header.key}`] = header.value;\n } else {\n sipHeaders[`X-MS-Custom-${header.key}`] = header.value;\n }\n } else if (header.kind === \"voip\") {\n voipHeaders[`${header.key}`] = header.value;\n } else if (header.kind === \"teamsPhoneCallDetails\") {\n teamsPhoneCallDetails = teamsPhoneCallDetailsModelConverter(header);\n }\n }\n }\n return {\n sipHeaders: sipHeaders,\n voipHeaders: voipHeaders,\n teamsPhoneCallDetails: teamsPhoneCallDetails,\n };\n }\n\n /**\n * Add a participant to the call\n *\n * @param participant - The participant is going to be added.\n */\n public async addParticipant(\n targetParticipant: CallInvite,\n options: AddParticipantOptions = {},\n ): Promise<AddParticipantResult> {\n const addParticipantRequest: AddParticipantRequest = {\n participantToAdd: communicationIdentifierModelConverter(targetParticipant.targetParticipant),\n sourceCallerIdNumber: PhoneNumberIdentifierModelConverter(\n targetParticipant.sourceCallIdNumber,\n ),\n sourceDisplayName: targetParticipant.sourceDisplayName,\n invitationTimeoutInSeconds: options.invitationTimeoutInSeconds,\n operationContext: options.operationContext ? options.operationContext : randomUUID(),\n operationCallbackUri: options.operationCallbackUrl,\n customCallingContext: this.createCustomCallingContextInternal(\n targetParticipant.customCallingContext!,\n ),\n };\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const result = await this.callConnection.addParticipant(\n this.callConnectionId,\n addParticipantRequest,\n optionsInternal,\n );\n const addParticipantsResult: AddParticipantResult = {\n ...result,\n participant: {\n ...result.participant,\n identifier: result.participant?.identifier\n ? communicationIdentifierConverter(result.participant?.identifier)\n : undefined,\n },\n waitForEventProcessor: async (abortSignal, timeoutInMs) => {\n const addParticipantEventResult: AddParticipantEventResult = {\n isSuccess: false,\n };\n await this.callAutomationEventProcessor.waitForEventProcessor(\n (event) => {\n if (\n event.callConnectionId === this.callConnectionId &&\n event.kind === \"AddParticipantSucceeded\" &&\n event.operationContext === addParticipantRequest.operationContext\n ) {\n addParticipantEventResult.isSuccess = true;\n addParticipantEventResult.successResult = event;\n return true;\n } else if (\n event.callConnectionId === this.callConnectionId &&\n event.kind === \"AddParticipantFailed\" &&\n event.operationContext === addParticipantRequest.operationContext\n ) {\n addParticipantEventResult.isSuccess = false;\n addParticipantEventResult.failureResult = event;\n return true;\n } else {\n return false;\n }\n },\n abortSignal,\n timeoutInMs,\n );\n return addParticipantEventResult;\n },\n };\n return addParticipantsResult;\n }\n\n /**\n * Transfer the call to a target participant\n *\n * @param targetParticipant - The target to be transferred to.\n */\n public async transferCallToParticipant(\n targetParticipant: CommunicationIdentifier,\n options: TransferCallToParticipantOptions = {},\n ): Promise<TransferCallResult> {\n const transferToParticipantRequest: TransferToParticipantRequest = {\n targetParticipant: communicationIdentifierModelConverter(targetParticipant),\n operationContext: options.operationContext ? options.operationContext : randomUUID(),\n operationCallbackUri: options.operationCallbackUrl,\n transferee: options.transferee && communicationIdentifierModelConverter(options.transferee),\n customCallingContext: this.createCustomCallingContextInternal(options.customCallingContext!),\n sourceCallerIdNumber: PhoneNumberIdentifierModelConverter(options.sourceCallIdNumber),\n };\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const result = await this.callConnection.transferToParticipant(\n this.callConnectionId,\n transferToParticipantRequest,\n optionsInternal,\n );\n const transferCallResult: TransferCallResult = {\n ...result,\n waitForEventProcessor: async (abortSignal, timeoutInMs) => {\n const transferCallToParticipantEventResult: TransferCallToParticipantEventResult = {\n isSuccess: false,\n };\n await this.callAutomationEventProcessor.waitForEventProcessor(\n (event) => {\n if (\n event.callConnectionId === this.callConnectionId &&\n event.kind === \"CallTransferAccepted\" &&\n event.operationContext === transferToParticipantRequest.operationContext\n ) {\n transferCallToParticipantEventResult.isSuccess = true;\n transferCallToParticipantEventResult.successResult = event;\n return true;\n } else if (\n event.callConnectionId === this.callConnectionId &&\n event.kind === \"CallTransferFailed\" &&\n event.operationContext === transferToParticipantRequest.operationContext\n ) {\n transferCallToParticipantEventResult.isSuccess = false;\n transferCallToParticipantEventResult.failureResult = event;\n return true;\n } else {\n return false;\n }\n },\n abortSignal,\n timeoutInMs,\n );\n return transferCallToParticipantEventResult;\n },\n };\n return transferCallResult;\n }\n\n /**\n * Remove a participant from the call\n *\n * @param participant - The participant is going to be removed from the call.\n */\n public async removeParticipant(\n participant: CommunicationIdentifier,\n options: RemoveParticipantsOption = {},\n ): Promise<RemoveParticipantResult> {\n const removeParticipantRequest: RemoveParticipantRequest = {\n participantToRemove: communicationIdentifierModelConverter(participant),\n operationContext: options.operationContext ? options.operationContext : randomUUID(),\n operationCallbackUri: options.operationCallbackUrl,\n };\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const result = await this.callConnection.removeParticipant(\n this.callConnectionId,\n removeParticipantRequest,\n optionsInternal,\n );\n const removeParticipantsResult: RemoveParticipantResult = {\n ...result,\n waitForEventProcessor: async (abortSignal, timeoutInMs) => {\n const removeParticipantEventResult: RemoveParticipantEventResult = {\n isSuccess: false,\n };\n await this.callAutomationEventProcessor.waitForEventProcessor(\n (event) => {\n if (\n event.callConnectionId === this.callConnectionId &&\n event.kind === \"RemoveParticipantSucceeded\" &&\n event.operationContext === removeParticipantRequest.operationContext\n ) {\n removeParticipantEventResult.isSuccess = true;\n removeParticipantEventResult.successResult = event;\n return true;\n } else if (\n event.callConnectionId === this.callConnectionId &&\n event.kind === \"RemoveParticipantFailed\" &&\n event.operationContext === removeParticipantRequest.operationContext\n ) {\n removeParticipantEventResult.isSuccess = false;\n removeParticipantEventResult.failureResult = event;\n return true;\n } else {\n return false;\n }\n },\n abortSignal,\n timeoutInMs,\n );\n return removeParticipantEventResult;\n },\n };\n return removeParticipantsResult;\n }\n\n /**\n * Move participants to the call\n *\n * @param targetParticipants - The participants to be moved to the call.\n * @param fromCall - The CallConnectionId for the call you want to move the participant from.\n * @param options - Additional attributes for move participants.\n */\n public async moveParticipants(\n targetParticipants: CommunicationIdentifier[],\n fromCall: string,\n options: MoveParticipantsOptions = {},\n ): Promise<MoveParticipantsResult> {\n const moveParticipantsRequest: MoveParticipantsRequest = {\n targetParticipants: targetParticipants.map((participant) =>\n communicationIdentifierModelConverter(participant),\n ),\n fromCall: fromCall,\n operationContext: options.operationContext ? options.operationContext : randomUUID(),\n operationCallbackUri: options.operationCallbackUrl,\n };\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const result = await this.callConnection.moveParticipants(\n this.callConnectionId,\n moveParticipantsRequest,\n optionsInternal,\n );\n const moveParticipantsResult: MoveParticipantsResult = {\n ...result,\n participants: result.participants?.map((participant) =>\n callParticipantConverter(participant),\n ),\n fromCall: fromCall,\n waitForEventProcessor: async (abortSignal, timeoutInMs) => {\n const moveParticipantEventResult: MoveParticipantEventResult = {\n isSuccess: false,\n };\n await this.callAutomationEventProcessor.waitForEventProcessor(\n (event) => {\n if (\n event.callConnectionId === this.callConnectionId &&\n event.kind === \"MoveParticipantSucceeded\" &&\n event.operationContext === moveParticipantsRequest.operationContext\n ) {\n moveParticipantEventResult.isSuccess = true;\n moveParticipantEventResult.successResult = event;\n return true;\n } else if (\n event.callConnectionId === this.callConnectionId &&\n event.kind === \"MoveParticipantFailed\" &&\n event.operationContext === moveParticipantsRequest.operationContext\n ) {\n moveParticipantEventResult.isSuccess = false;\n moveParticipantEventResult.failureResult = event;\n return true;\n } else {\n return false;\n }\n },\n abortSignal,\n timeoutInMs,\n );\n return moveParticipantEventResult;\n },\n };\n return moveParticipantsResult;\n }\n\n /**\n * Mute participant from the call.\n *\n * @param participant - Participant to be muted from the call.\n * @param options - Additional attributes for mute participant.\n */\n public async muteParticipant(\n participant: CommunicationIdentifier,\n options: MuteParticipantOption = {},\n ): Promise<MuteParticipantResult> {\n const muteParticipantsRequest: MuteParticipantsRequest = {\n targetParticipants: [communicationIdentifierModelConverter(participant)],\n operationContext: options.operationContext,\n };\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const result = await this.callConnection.mute(\n this.callConnectionId,\n muteParticipantsRequest,\n optionsInternal,\n );\n const muteParticipantResult: MuteParticipantResult = {\n ...result,\n };\n return muteParticipantResult;\n }\n\n /** Cancel add participant request.\n *\n * @param invitationId - Invitation ID used to cancel the add participant request.\n */\n public async cancelAddParticipantOperation(\n invitationId: string,\n options: CancelAddParticipantOperationOptions = {},\n ): Promise<CancelAddParticipantOperationResult> {\n const {\n operationContext,\n operationCallbackUrl: operationCallbackUri,\n ...operationOptions\n } = options;\n const cancelAddParticipantRequest = {\n invitationId,\n operationContext: operationContext ? operationContext : randomUUID(),\n operationCallbackUri,\n };\n const optionsInternal = {\n ...operationOptions,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n\n const result = await this.callConnection.cancelAddParticipant(\n this.callConnectionId,\n cancelAddParticipantRequest,\n optionsInternal,\n );\n\n const cancelAddParticipantResult: CancelAddParticipantOperationResult = {\n ...result,\n waitForEventProcessor: async (abortSignal, timeoutInMs) => {\n const cancelAddParticipantEventResult: CancelAddParticipantEventResult = {\n isSuccess: false,\n };\n await this.callAutomationEventProcessor.waitForEventProcessor(\n (event) => {\n if (\n event.callConnectionId === this.callConnectionId &&\n event.kind === \"CancelAddParticipantSucceeded\" &&\n event.operationContext === cancelAddParticipantRequest.operationContext\n ) {\n cancelAddParticipantEventResult.isSuccess = true;\n cancelAddParticipantEventResult.successResult = event;\n return true;\n } else if (\n event.callConnectionId === this.callConnectionId &&\n event.kind === \"CancelAddParticipantFailed\" &&\n event.operationContext === cancelAddParticipantRequest.operationContext\n ) {\n cancelAddParticipantEventResult.isSuccess = false;\n cancelAddParticipantEventResult.failureResult = event;\n return true;\n } else {\n return false;\n }\n },\n abortSignal,\n timeoutInMs,\n );\n return cancelAddParticipantEventResult;\n },\n };\n\n return cancelAddParticipantResult;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"callConnection.js","sourceRoot":"","sources":["../../src/callConnection.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,sEAGqC;AACrC,iDAA2C;AAC3C,uDASkC;AAClC,kEAAyE;AA2BzE,wDAQ8B;AAC9B,gDAA8C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C,WAAW,CAAC,CACnD;YACD,QAAQ,EAAE,QAAQ;YAClB,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAA,sBAAU,GAAE;YACpF,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;SACnD,CAAC;QACF,MAAM,eAAe,GAAG;YACtB,GAAG,OAAO;YACV,sBAAsB,EAAE,IAAI,IAAI,EAAE;YAClC,sBAAsB,EAAE,IAAA,sBAAU,GAAE;SACrC,CAAC;QACF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,gBAAgB,CACvD,IAAI,CAAC,gBAAgB,EACrB,uBAAuB,EACvB,eAAe,CAChB,CAAC;QACF,MAAM,sBAAsB,GAA2B;YACrD,GAAG,MAAM;YACT,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CACrD,IAAA,wCAAwB,EAAC,WAAW,CAAC,CACtC;YACD,QAAQ,EAAE,QAAQ;SACnB,CAAC;QACF,OAAO,sBAAsB,CAAC;IAChC,CAAC;CACF;AA5WD,wCA4WC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n CommunicationIdentifier,\n createCommunicationAuthPolicy,\n} from \"@azure/communication-common\";\nimport { CallMedia } from \"./callMedia.js\";\nimport {\n AddParticipantRequest,\n CallAutomationApiClient,\n CallAutomationApiClientOptionalParams,\n CustomCallingContextInternal,\n MoveParticipantsRequest,\n MuteParticipantsRequest,\n RemoveParticipantRequest,\n TransferToParticipantRequest,\n} from \"./generated/src/index.js\";\nimport { CallConnectionImpl } from \"./generated/src/operations/index.js\";\nimport {\n type CallConnectionProperties,\n type CallInvite,\n type CallParticipant,\n type CustomCallingContext,\n} from \"./models/models.js\";\nimport type {\n AddParticipantOptions,\n CancelAddParticipantOperationOptions,\n GetCallConnectionPropertiesOptions,\n GetParticipantOptions,\n HangUpOptions,\n MoveParticipantsOptions,\n MuteParticipantOption,\n RemoveParticipantsOption,\n TransferCallToParticipantOptions,\n} from \"./models/options.js\";\nimport type {\n ListParticipantsResult,\n TransferCallResult,\n AddParticipantResult,\n RemoveParticipantResult,\n MuteParticipantResult,\n CancelAddParticipantOperationResult,\n MoveParticipantsResult,\n} from \"./models/responses.js\";\nimport {\n callParticipantConverter,\n communicationIdentifierConverter,\n communicationIdentifierModelConverter,\n communicationUserIdentifierConverter,\n phoneNumberIdentifierConverter,\n PhoneNumberIdentifierModelConverter,\n teamsPhoneCallDetailsModelConverter,\n} from \"./utli/converters.js\";\nimport { randomUUID } from \"@azure/core-util\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\n\n/**\n * CallConnection class represents call connection based APIs.\n */\nexport class CallConnection {\n private readonly callConnectionId: string;\n private readonly callConnection: CallConnectionImpl;\n private readonly callAutomationApiClient: CallAutomationApiClient;\n private readonly endpoint: string;\n private readonly credential: TokenCredential | KeyCredential;\n private readonly callAutomationApiClientOptions?: CallAutomationApiClientOptionalParams;\n constructor(\n callConnectionId: string,\n endpoint: string,\n credential: KeyCredential | TokenCredential,\n options?: CallAutomationApiClientOptionalParams,\n ) {\n this.callAutomationApiClient = new CallAutomationApiClient(endpoint, options);\n const authPolicy = createCommunicationAuthPolicy(credential);\n this.callAutomationApiClient.pipeline.addPolicy(authPolicy);\n this.callConnectionId = callConnectionId;\n this.callConnection = new CallConnectionImpl(this.callAutomationApiClient);\n this.endpoint = endpoint;\n this.credential = credential;\n this.callAutomationApiClientOptions = options;\n }\n\n /**\n * Initializes a new instance of CallMedia.\n */\n public getCallMedia(): CallMedia {\n return new CallMedia(\n this.callConnectionId,\n this.endpoint,\n this.credential,\n this.callAutomationApiClientOptions,\n );\n }\n\n /**\n * Get call connection properties of the call\n */\n public async getCallConnectionProperties(\n options: GetCallConnectionPropertiesOptions = {},\n ): Promise<CallConnectionProperties> {\n const { targets, sourceCallerIdNumber, answeredBy, source, answeredFor, ...result } =\n await this.callConnection.getCall(this.callConnectionId, options);\n const callConnectionProperties: CallConnectionProperties = {\n ...result,\n source: source ? communicationIdentifierConverter(source) : undefined,\n answeredby: communicationUserIdentifierConverter(answeredBy),\n answeredFor: answeredFor ? phoneNumberIdentifierConverter(answeredFor) : undefined,\n targetParticipants: targets?.map((target) => communicationIdentifierConverter(target)),\n sourceCallerIdNumber: sourceCallerIdNumber\n ? phoneNumberIdentifierConverter(sourceCallerIdNumber)\n : undefined,\n };\n return callConnectionProperties;\n }\n\n /**\n * Hang up the call for itself or terminate the whole call.\n *\n * @param isForEveryOne - Determine if every one in the call would be hung up or not.\n */\n public async hangUp(isForEveryone: boolean, options: HangUpOptions = {}): Promise<void> {\n if (isForEveryone) {\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n await this.callConnection.terminateCall(this.callConnectionId, optionsInternal);\n } else {\n await this.callConnection.hangupCall(this.callConnectionId, options);\n }\n return;\n }\n\n /**\n * Get a participant from the call\n *\n * @param targetParticipant - The communication identifier of requested participant.\n */\n public async getParticipant(\n targetParticipant: CommunicationIdentifier,\n options: GetParticipantOptions = {},\n ): Promise<CallParticipant> {\n let rawId: string | undefined = communicationIdentifierModelConverter(targetParticipant).rawId;\n rawId = rawId === undefined ? \"\" : rawId;\n\n const result = await this.callConnection.getParticipant(this.callConnectionId, rawId, options);\n const callParticipant: CallParticipant = {\n identifier: result.identifier\n ? communicationIdentifierConverter(result.identifier)\n : undefined,\n isMuted: result.isMuted,\n isOnHold: result.isOnHold,\n };\n return callParticipant;\n }\n\n /**\n * Get all participants from the call\n */\n public async listParticipants(\n options: GetParticipantOptions = {},\n ): Promise<ListParticipantsResult> {\n const result = this.callConnection.listParticipants(this.callConnectionId, options);\n const participants = [];\n const pages = result?.byPage();\n\n for await (const page of pages) {\n for (const participant of page) {\n participants.push(callParticipantConverter(participant));\n }\n }\n\n const listParticipantResponse: ListParticipantsResult = {\n ...result,\n values: participants,\n };\n return listParticipantResponse;\n }\n\n private createCustomCallingContextInternal(\n customCallingContext: CustomCallingContext,\n ): CustomCallingContextInternal {\n const sipHeaders: { [key: string]: string } = {};\n const voipHeaders: { [key: string]: string } = {};\n let teamsPhoneCallDetails: any = undefined;\n if (customCallingContext) {\n for (const header of customCallingContext) {\n if (header.kind === \"sipuui\") {\n sipHeaders[`User-To-User`] = header.value;\n } else if (header.kind === \"sipx\") {\n if (header.sipHeaderPrefix === \"X-\") {\n sipHeaders[`X-${header.key}`] = header.value;\n } else {\n sipHeaders[`X-MS-Custom-${header.key}`] = header.value;\n }\n } else if (header.kind === \"voip\") {\n voipHeaders[`${header.key}`] = header.value;\n } else if (header.kind === \"teamsPhoneCallDetails\") {\n teamsPhoneCallDetails = teamsPhoneCallDetailsModelConverter(header);\n }\n }\n }\n return {\n sipHeaders: sipHeaders,\n voipHeaders: voipHeaders,\n teamsPhoneCallDetails: teamsPhoneCallDetails,\n };\n }\n\n /**\n * Add a participant to the call\n *\n * @param participant - The participant is going to be added.\n */\n public async addParticipant(\n targetParticipant: CallInvite,\n options: AddParticipantOptions = {},\n ): Promise<AddParticipantResult> {\n const addParticipantRequest: AddParticipantRequest = {\n participantToAdd: communicationIdentifierModelConverter(targetParticipant.targetParticipant),\n sourceCallerIdNumber: PhoneNumberIdentifierModelConverter(\n targetParticipant.sourceCallIdNumber,\n ),\n sourceDisplayName: targetParticipant.sourceDisplayName,\n invitationTimeoutInSeconds: options.invitationTimeoutInSeconds,\n operationContext: options.operationContext,\n operationCallbackUri: options.operationCallbackUrl,\n customCallingContext: this.createCustomCallingContextInternal(\n targetParticipant.customCallingContext!,\n ),\n };\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const result = await this.callConnection.addParticipant(\n this.callConnectionId,\n addParticipantRequest,\n optionsInternal,\n );\n const addParticipantsResult: AddParticipantResult = {\n ...result,\n participant: {\n ...result.participant,\n identifier: result.participant?.identifier\n ? communicationIdentifierConverter(result.participant?.identifier)\n : undefined,\n },\n };\n return addParticipantsResult;\n }\n\n /**\n * Transfer the call to a target participant\n *\n * @param targetParticipant - The target to be transferred to.\n */\n public async transferCallToParticipant(\n targetParticipant: CommunicationIdentifier,\n options: TransferCallToParticipantOptions = {},\n ): Promise<TransferCallResult> {\n const transferToParticipantRequest: TransferToParticipantRequest = {\n targetParticipant: communicationIdentifierModelConverter(targetParticipant),\n operationContext: options.operationContext ? options.operationContext : randomUUID(),\n operationCallbackUri: options.operationCallbackUrl,\n transferee: options.transferee && communicationIdentifierModelConverter(options.transferee),\n customCallingContext: this.createCustomCallingContextInternal(options.customCallingContext!),\n sourceCallerIdNumber: PhoneNumberIdentifierModelConverter(options.sourceCallIdNumber),\n };\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const result = await this.callConnection.transferToParticipant(\n this.callConnectionId,\n transferToParticipantRequest,\n optionsInternal,\n );\n const transferCallResult: TransferCallResult = {\n ...result,\n };\n return transferCallResult;\n }\n\n /**\n * Remove a participant from the call\n *\n * @param participant - The participant is going to be removed from the call.\n */\n public async removeParticipant(\n participant: CommunicationIdentifier,\n options: RemoveParticipantsOption = {},\n ): Promise<RemoveParticipantResult> {\n const removeParticipantRequest: RemoveParticipantRequest = {\n participantToRemove: communicationIdentifierModelConverter(participant),\n operationContext: options.operationContext ? options.operationContext : randomUUID(),\n operationCallbackUri: options.operationCallbackUrl,\n };\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const result = await this.callConnection.removeParticipant(\n this.callConnectionId,\n removeParticipantRequest,\n optionsInternal,\n );\n const removeParticipantsResult: RemoveParticipantResult = {\n ...result,\n };\n return removeParticipantsResult;\n }\n\n /**\n * Mute participant from the call.\n *\n * @param participant - Participant to be muted from the call.\n * @param options - Additional attributes for mute participant.\n */\n public async muteParticipant(\n participant: CommunicationIdentifier,\n options: MuteParticipantOption = {},\n ): Promise<MuteParticipantResult> {\n const muteParticipantsRequest: MuteParticipantsRequest = {\n targetParticipants: [communicationIdentifierModelConverter(participant)],\n operationContext: options.operationContext,\n };\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const result = await this.callConnection.mute(\n this.callConnectionId,\n muteParticipantsRequest,\n optionsInternal,\n );\n const muteParticipantResult: MuteParticipantResult = {\n ...result,\n };\n return muteParticipantResult;\n }\n\n /** Cancel add participant request.\n *\n * @param invitationId - Invitation ID used to cancel the add participant request.\n */\n public async cancelAddParticipantOperation(\n invitationId: string,\n options: CancelAddParticipantOperationOptions = {},\n ): Promise<CancelAddParticipantOperationResult> {\n const {\n operationContext,\n operationCallbackUrl: operationCallbackUri,\n ...operationOptions\n } = options;\n const cancelAddParticipantRequest = {\n invitationId,\n operationContext: operationContext ? operationContext : randomUUID(),\n operationCallbackUri,\n };\n const optionsInternal = {\n ...operationOptions,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n\n const result = await this.callConnection.cancelAddParticipant(\n this.callConnectionId,\n cancelAddParticipantRequest,\n optionsInternal,\n );\n\n const cancelAddParticipantResult: CancelAddParticipantOperationResult = {\n ...result,\n };\n\n return cancelAddParticipantResult;\n }\n\n /**\n * Move participants to the call\n *\n * @param targetParticipants - The participants to be moved to the call.\n * @param fromCall - The CallConnectionId for the call you want to move the participant from.\n * @param options - Additional attributes for move participants.\n */\n public async moveParticipants(\n targetParticipants: CommunicationIdentifier[],\n fromCall: string,\n options: MoveParticipantsOptions = {},\n ): Promise<MoveParticipantsResult> {\n const moveParticipantsRequest: MoveParticipantsRequest = {\n targetParticipants: targetParticipants.map((participant) =>\n communicationIdentifierModelConverter(participant),\n ),\n fromCall: fromCall,\n operationContext: options.operationContext ? options.operationContext : randomUUID(),\n operationCallbackUri: options.operationCallbackUrl,\n };\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const result = await this.callConnection.moveParticipants(\n this.callConnectionId,\n moveParticipantsRequest,\n optionsInternal,\n );\n const moveParticipantsResult: MoveParticipantsResult = {\n ...result,\n participants: result.participants?.map((participant) =>\n callParticipantConverter(participant),\n ),\n fromCall: fromCall,\n };\n return moveParticipantsResult;\n }\n}\n"]}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { CallAutomationApiClientOptionalParams, Tone } from "./generated/src/index.js";
|
|
2
2
|
import type { CommunicationIdentifier } from "@azure/communication-common";
|
|
3
3
|
import type { FileSource, TextSource, SsmlSource, DtmfTone } from "./models/models.js";
|
|
4
|
-
import type { PlayOptions, CallMediaRecognizeDtmfOptions, CallMediaRecognizeChoiceOptions, ContinuousDtmfRecognitionOptions, SendDtmfTonesOptions, CallMediaRecognizeSpeechOptions, CallMediaRecognizeSpeechOrDtmfOptions, StartTranscriptionOptions, StopTranscriptionOptions, HoldOptions, UnholdOptions, StartMediaStreamingOptions, StopMediaStreamingOptions, PlayToAllOptions, UpdateTranscriptionOptions,
|
|
4
|
+
import type { PlayOptions, CallMediaRecognizeDtmfOptions, CallMediaRecognizeChoiceOptions, ContinuousDtmfRecognitionOptions, SendDtmfTonesOptions, CallMediaRecognizeSpeechOptions, CallMediaRecognizeSpeechOrDtmfOptions, StartTranscriptionOptions, StopTranscriptionOptions, HoldOptions, UnholdOptions, StartMediaStreamingOptions, StopMediaStreamingOptions, PlayToAllOptions, UpdateTranscriptionOptions, SummarizeCallOptions } from "./models/options.js";
|
|
5
5
|
import type { KeyCredential, TokenCredential } from "@azure/core-auth";
|
|
6
|
-
import type {
|
|
7
|
-
import type { CallAutomationEventProcessor } from "./eventprocessor/callAutomationEventProcessor.js";
|
|
6
|
+
import type { SendDtmfTonesResult } from "./models/responses.js";
|
|
8
7
|
/**
|
|
9
8
|
* CallMedia class represents call media related APIs.
|
|
10
9
|
*/
|
|
@@ -12,8 +11,7 @@ export declare class CallMedia {
|
|
|
12
11
|
private readonly callConnectionId;
|
|
13
12
|
private readonly callMedia;
|
|
14
13
|
private readonly callAutomationApiClient;
|
|
15
|
-
|
|
16
|
-
constructor(callConnectionId: string, endpoint: string, credential: KeyCredential | TokenCredential, eventProcessor: CallAutomationEventProcessor, options?: CallAutomationApiClientOptionalParams);
|
|
14
|
+
constructor(callConnectionId: string, endpoint: string, credential: KeyCredential | TokenCredential, options?: CallAutomationApiClientOptionalParams);
|
|
17
15
|
private createPlaySourceInternal;
|
|
18
16
|
/**
|
|
19
17
|
* Play audio to a specific participant.
|
|
@@ -22,14 +20,14 @@ export declare class CallMedia {
|
|
|
22
20
|
* @param playTo - The targets to play to.
|
|
23
21
|
* @param options - Additional attributes for play.
|
|
24
22
|
*/
|
|
25
|
-
play(playSources: (FileSource | TextSource | SsmlSource)[], playTo: CommunicationIdentifier[], options?: PlayOptions): Promise<
|
|
23
|
+
play(playSources: (FileSource | TextSource | SsmlSource)[], playTo: CommunicationIdentifier[], options?: PlayOptions): Promise<void>;
|
|
26
24
|
/**
|
|
27
25
|
* Play to all participants.
|
|
28
26
|
*
|
|
29
27
|
* @param playSources - A PlaySource representing the sources to play. Currently only single play source per request is supported.
|
|
30
28
|
* @param options - Additional attributes for play.
|
|
31
29
|
*/
|
|
32
|
-
playToAll(playSources: (FileSource | TextSource | SsmlSource)[], options?: PlayToAllOptions): Promise<
|
|
30
|
+
playToAll(playSources: (FileSource | TextSource | SsmlSource)[], options?: PlayToAllOptions): Promise<void>;
|
|
33
31
|
private createRecognizeRequest;
|
|
34
32
|
/**
|
|
35
33
|
* Recognize participant input.
|
|
@@ -38,17 +36,17 @@ export declare class CallMedia {
|
|
|
38
36
|
* @param maxTonesToCollect - Maximum number of DTMF tones to be collected.
|
|
39
37
|
* @param options - Different attributes for recognize.
|
|
40
38
|
* */
|
|
41
|
-
startRecognizing(targetParticipant: CommunicationIdentifier, maxTonesToCollect: number, options: CallMediaRecognizeDtmfOptions): Promise<
|
|
39
|
+
startRecognizing(targetParticipant: CommunicationIdentifier, maxTonesToCollect: number, options: CallMediaRecognizeDtmfOptions): Promise<void>;
|
|
42
40
|
/**
|
|
43
41
|
* Recognize participant input.
|
|
44
42
|
* @param targetParticipant - Target participant.
|
|
45
43
|
* @param options - Different attributes for recognize.
|
|
46
44
|
* */
|
|
47
|
-
startRecognizing(targetParticipant: CommunicationIdentifier, options: CallMediaRecognizeDtmfOptions | CallMediaRecognizeChoiceOptions | CallMediaRecognizeSpeechOptions | CallMediaRecognizeSpeechOrDtmfOptions): Promise<
|
|
45
|
+
startRecognizing(targetParticipant: CommunicationIdentifier, options: CallMediaRecognizeDtmfOptions | CallMediaRecognizeChoiceOptions | CallMediaRecognizeSpeechOptions | CallMediaRecognizeSpeechOrDtmfOptions): Promise<void>;
|
|
48
46
|
/**
|
|
49
47
|
* Cancels all the queued media operations.
|
|
50
48
|
*/
|
|
51
|
-
cancelAllOperations(): Promise<
|
|
49
|
+
cancelAllOperations(): Promise<void>;
|
|
52
50
|
/**
|
|
53
51
|
* Start continuous Dtmf recognition by subscribing to tones.
|
|
54
52
|
* @param targetParticipant - Target participant.
|
|
@@ -84,6 +82,7 @@ export declare class CallMedia {
|
|
|
84
82
|
unhold(targetParticipant: CommunicationIdentifier, options?: UnholdOptions): Promise<void>;
|
|
85
83
|
/**
|
|
86
84
|
* Starts transcription in the call
|
|
85
|
+
* @param locales - List of languages for Language Identification.
|
|
87
86
|
* @param options - Additional attributes for start transcription.
|
|
88
87
|
*/
|
|
89
88
|
startTranscription(options?: StartTranscriptionOptions): Promise<void>;
|
|
@@ -94,9 +93,13 @@ export declare class CallMedia {
|
|
|
94
93
|
stopTranscription(options?: StopTranscriptionOptions): Promise<void>;
|
|
95
94
|
/**
|
|
96
95
|
* Update transcription language.
|
|
97
|
-
* @param locale - Defines new locale for transcription.
|
|
98
96
|
*/
|
|
99
97
|
updateTranscription(locale: string, options?: UpdateTranscriptionOptions): Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* Summarize call details.
|
|
100
|
+
* @param options - Additional attributes for summarize call.
|
|
101
|
+
*/
|
|
102
|
+
summarizeCall(options?: SummarizeCallOptions): Promise<void>;
|
|
100
103
|
/**
|
|
101
104
|
* Starts media streaming in the call.
|
|
102
105
|
* @param options - Additional attributes for start media streaming.
|
|
@@ -107,13 +110,5 @@ export declare class CallMedia {
|
|
|
107
110
|
* @param options - Additional attributes for stop media streaming.
|
|
108
111
|
*/
|
|
109
112
|
stopMediaStreaming(options?: StopMediaStreamingOptions): Promise<void>;
|
|
110
|
-
/**
|
|
111
|
-
* Interrupt audio and announce to specific participant.
|
|
112
|
-
*
|
|
113
|
-
* @param playSources - A PlaySource representing the sources to play.
|
|
114
|
-
* @param playTo - The targets to play to.
|
|
115
|
-
* @param options - Additional attributes for interrupt audio and announce.
|
|
116
|
-
*/
|
|
117
|
-
interruptAudioAndAnnounce(playSources: (FileSource | TextSource | SsmlSource)[], playTo: CommunicationIdentifier, options?: InterruptAudioAndAnnounceOptions): Promise<void>;
|
|
118
113
|
}
|
|
119
114
|
//# sourceMappingURL=callMedia.d.ts.map
|