@azure/communication-call-automation 1.5.0-alpha.20250516.3 → 1.5.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 +1 -51
- package/dist/browser/callAutomationClient.d.ts +2 -9
- package/dist/browser/callAutomationClient.d.ts.map +1 -1
- package/dist/browser/callAutomationClient.js +9 -106
- package/dist/browser/callAutomationClient.js.map +1 -1
- package/dist/browser/callAutomationEventParser.d.ts.map +1 -1
- package/dist/browser/callAutomationEventParser.js +0 -18
- package/dist/browser/callAutomationEventParser.js.map +1 -1
- package/dist/browser/callConnection.d.ts +4 -6
- package/dist/browser/callConnection.d.ts.map +1 -1
- package/dist/browser/callConnection.js +13 -112
- package/dist/browser/callConnection.js.map +1 -1
- package/dist/browser/callMedia.d.ts +10 -20
- package/dist/browser/callMedia.d.ts.map +1 -1
- package/dist/browser/callMedia.js +20 -188
- package/dist/browser/callMedia.js.map +1 -1
- package/dist/browser/callRecording.d.ts.map +1 -1
- package/dist/browser/callRecording.js +5 -2
- package/dist/browser/callRecording.js.map +1 -1
- 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 +2 -3
- package/dist/browser/generated/src/callAutomationApiClient.js.map +1 -1
- package/dist/browser/generated/src/models/index.d.ts +205 -850
- package/dist/browser/generated/src/models/index.d.ts.map +1 -1
- package/dist/browser/generated/src/models/index.js +48 -126
- package/dist/browser/generated/src/models/index.js.map +1 -1
- package/dist/browser/generated/src/models/mappers.d.ts +11 -48
- package/dist/browser/generated/src/models/mappers.d.ts.map +1 -1
- package/dist/browser/generated/src/models/mappers.js +460 -1644
- package/dist/browser/generated/src/models/mappers.js.map +1 -1
- package/dist/browser/generated/src/models/parameters.d.ts +1 -7
- package/dist/browser/generated/src/models/parameters.d.ts.map +1 -1
- package/dist/browser/generated/src/models/parameters.js +6 -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 +1 -33
- package/dist/browser/generated/src/operations/callConnection.js.map +1 -1
- package/dist/browser/generated/src/operations/callMedia.d.ts +8 -15
- package/dist/browser/generated/src/operations/callMedia.d.ts.map +1 -1
- package/dist/browser/generated/src/operations/callMedia.js +25 -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 +0 -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 +8 -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/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 +67 -155
- 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 +5 -14
- 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 +2 -35
- 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 +10 -51
- package/dist/browser/models/responses.d.ts.map +1 -1
- package/dist/browser/models/responses.js.map +1 -1
- package/dist/browser/utli/converters.d.ts.map +1 -1
- package/dist/browser/utli/converters.js +19 -1
- package/dist/browser/utli/converters.js.map +1 -1
- package/dist/commonjs/callAutomationClient.d.ts +2 -9
- package/dist/commonjs/callAutomationClient.d.ts.map +1 -1
- package/dist/commonjs/callAutomationClient.js +11 -108
- package/dist/commonjs/callAutomationClient.js.map +1 -1
- package/dist/commonjs/callAutomationEventParser.d.ts.map +1 -1
- package/dist/commonjs/callAutomationEventParser.js +0 -18
- package/dist/commonjs/callAutomationEventParser.js.map +1 -1
- package/dist/commonjs/callConnection.d.ts +4 -6
- package/dist/commonjs/callConnection.d.ts.map +1 -1
- package/dist/commonjs/callConnection.js +15 -114
- package/dist/commonjs/callConnection.js.map +1 -1
- package/dist/commonjs/callMedia.d.ts +10 -20
- package/dist/commonjs/callMedia.d.ts.map +1 -1
- package/dist/commonjs/callMedia.js +39 -207
- package/dist/commonjs/callMedia.js.map +1 -1
- package/dist/commonjs/callRecording.d.ts.map +1 -1
- package/dist/commonjs/callRecording.js +5 -2
- package/dist/commonjs/callRecording.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 +1 -2
- package/dist/commonjs/generated/src/callAutomationApiClient.js.map +1 -1
- package/dist/commonjs/generated/src/models/index.d.ts +205 -850
- package/dist/commonjs/generated/src/models/index.d.ts.map +1 -1
- package/dist/commonjs/generated/src/models/index.js +49 -127
- package/dist/commonjs/generated/src/models/index.js.map +1 -1
- package/dist/commonjs/generated/src/models/mappers.d.ts +11 -48
- package/dist/commonjs/generated/src/models/mappers.d.ts.map +1 -1
- package/dist/commonjs/generated/src/models/mappers.js +463 -1647
- package/dist/commonjs/generated/src/models/mappers.js.map +1 -1
- package/dist/commonjs/generated/src/models/parameters.d.ts +1 -7
- package/dist/commonjs/generated/src/models/parameters.d.ts.map +1 -1
- package/dist/commonjs/generated/src/models/parameters.js +6 -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 +1 -33
- package/dist/commonjs/generated/src/operations/callConnection.js.map +1 -1
- package/dist/commonjs/generated/src/operations/callMedia.d.ts +8 -15
- package/dist/commonjs/generated/src/operations/callMedia.d.ts.map +1 -1
- package/dist/commonjs/generated/src/operations/callMedia.js +25 -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 +0 -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 +8 -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/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 +67 -155
- 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 +5 -14
- package/dist/commonjs/models/models.d.ts.map +1 -1
- package/dist/commonjs/models/models.js +6 -10
- package/dist/commonjs/models/models.js.map +1 -1
- package/dist/commonjs/models/options.d.ts +2 -35
- 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 +10 -51
- package/dist/commonjs/models/responses.d.ts.map +1 -1
- package/dist/commonjs/models/responses.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/commonjs/utli/converters.d.ts.map +1 -1
- package/dist/commonjs/utli/converters.js +18 -0
- package/dist/commonjs/utli/converters.js.map +1 -1
- package/dist/esm/callAutomationClient.d.ts +2 -9
- package/dist/esm/callAutomationClient.d.ts.map +1 -1
- package/dist/esm/callAutomationClient.js +9 -106
- package/dist/esm/callAutomationClient.js.map +1 -1
- package/dist/esm/callAutomationEventParser.d.ts.map +1 -1
- package/dist/esm/callAutomationEventParser.js +0 -18
- package/dist/esm/callAutomationEventParser.js.map +1 -1
- package/dist/esm/callConnection.d.ts +4 -6
- package/dist/esm/callConnection.d.ts.map +1 -1
- package/dist/esm/callConnection.js +13 -112
- package/dist/esm/callConnection.js.map +1 -1
- package/dist/esm/callMedia.d.ts +10 -20
- package/dist/esm/callMedia.d.ts.map +1 -1
- package/dist/esm/callMedia.js +20 -188
- package/dist/esm/callMedia.js.map +1 -1
- package/dist/esm/callRecording.d.ts.map +1 -1
- package/dist/esm/callRecording.js +5 -2
- package/dist/esm/callRecording.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 +2 -3
- package/dist/esm/generated/src/callAutomationApiClient.js.map +1 -1
- package/dist/esm/generated/src/models/index.d.ts +205 -850
- package/dist/esm/generated/src/models/index.d.ts.map +1 -1
- package/dist/esm/generated/src/models/index.js +48 -126
- package/dist/esm/generated/src/models/index.js.map +1 -1
- package/dist/esm/generated/src/models/mappers.d.ts +11 -48
- package/dist/esm/generated/src/models/mappers.d.ts.map +1 -1
- package/dist/esm/generated/src/models/mappers.js +460 -1644
- package/dist/esm/generated/src/models/mappers.js.map +1 -1
- package/dist/esm/generated/src/models/parameters.d.ts +1 -7
- package/dist/esm/generated/src/models/parameters.d.ts.map +1 -1
- package/dist/esm/generated/src/models/parameters.js +6 -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 +1 -33
- package/dist/esm/generated/src/operations/callConnection.js.map +1 -1
- package/dist/esm/generated/src/operations/callMedia.d.ts +8 -15
- package/dist/esm/generated/src/operations/callMedia.d.ts.map +1 -1
- package/dist/esm/generated/src/operations/callMedia.js +25 -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 +0 -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 +8 -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/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 +67 -155
- 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 +5 -14
- 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 +2 -35
- 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 +10 -51
- package/dist/esm/models/responses.d.ts.map +1 -1
- package/dist/esm/models/responses.js.map +1 -1
- package/dist/esm/utli/converters.d.ts.map +1 -1
- package/dist/esm/utli/converters.js +19 -1
- package/dist/esm/utli/converters.js.map +1 -1
- package/dist/react-native/callAutomationClient.d.ts +2 -9
- package/dist/react-native/callAutomationClient.d.ts.map +1 -1
- package/dist/react-native/callAutomationClient.js +9 -106
- 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 +0 -18
- package/dist/react-native/callAutomationEventParser.js.map +1 -1
- package/dist/react-native/callConnection.d.ts +4 -6
- package/dist/react-native/callConnection.d.ts.map +1 -1
- package/dist/react-native/callConnection.js +13 -112
- package/dist/react-native/callConnection.js.map +1 -1
- package/dist/react-native/callMedia.d.ts +10 -20
- package/dist/react-native/callMedia.d.ts.map +1 -1
- package/dist/react-native/callMedia.js +20 -188
- package/dist/react-native/callMedia.js.map +1 -1
- package/dist/react-native/callRecording.d.ts.map +1 -1
- package/dist/react-native/callRecording.js +5 -2
- package/dist/react-native/callRecording.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 +2 -3
- package/dist/react-native/generated/src/callAutomationApiClient.js.map +1 -1
- package/dist/react-native/generated/src/models/index.d.ts +205 -850
- package/dist/react-native/generated/src/models/index.d.ts.map +1 -1
- package/dist/react-native/generated/src/models/index.js +48 -126
- package/dist/react-native/generated/src/models/index.js.map +1 -1
- package/dist/react-native/generated/src/models/mappers.d.ts +11 -48
- package/dist/react-native/generated/src/models/mappers.d.ts.map +1 -1
- package/dist/react-native/generated/src/models/mappers.js +460 -1644
- package/dist/react-native/generated/src/models/mappers.js.map +1 -1
- package/dist/react-native/generated/src/models/parameters.d.ts +1 -7
- package/dist/react-native/generated/src/models/parameters.d.ts.map +1 -1
- package/dist/react-native/generated/src/models/parameters.js +6 -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 +1 -33
- package/dist/react-native/generated/src/operations/callConnection.js.map +1 -1
- package/dist/react-native/generated/src/operations/callMedia.d.ts +8 -15
- package/dist/react-native/generated/src/operations/callMedia.d.ts.map +1 -1
- package/dist/react-native/generated/src/operations/callMedia.js +25 -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 +0 -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 +8 -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/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 +67 -155
- 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 +5 -14
- 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 +2 -35
- 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 +10 -51
- 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/utli/converters.d.ts.map +1 -1
- package/dist/react-native/utli/converters.js +19 -1
- package/dist/react-native/utli/converters.js.map +1 -1
- package/package.json +17 -11
- 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 -123
- 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 -123
- 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 -123
- 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 -123
- 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/call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;gBAC9B,qBAAqB,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE;oBACxD,MAAM,sBAAsB,GAA2B;wBACrD,SAAS,EAAE,KAAK;qBACjB,CAAC;oBACF,MAAM,IAAI,CAAC,4BAA4B,CAAC,qBAAqB,CAC3D,CAAC,KAAK,EAAE,EAAE;wBACR,IAAI,KAAK,CAAC,gBAAgB,KAAK,gBAAgB,IAAI,KAAK,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;4BAClF,sBAAsB,CAAC,SAAS,GAAG,IAAI,CAAC;4BACxC,sBAAsB,CAAC,aAAa,GAAG,KAAK,CAAC;4BAC7C,OAAO,IAAI,CAAC;wBACd,CAAC;wBACD,IAAI,KAAK,CAAC,gBAAgB,KAAK,gBAAgB,IAAI,KAAK,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;4BAClF,sBAAsB,CAAC,SAAS,GAAG,KAAK,CAAC;4BACzC,sBAAsB,CAAC,aAAa,GAAG,KAAK,CAAC;4BAC7C,OAAO,IAAI,CAAC;wBACd,CAAC;6BAAM,CAAC;4BACN,OAAO,KAAK,CAAC;wBACf,CAAC;oBACH,CAAC,EACD,WAAW,EACX,WAAW,CACZ,CAAC;oBACF,OAAO,sBAAsB,CAAC;gBAChC,CAAC;aACF,CAAC;YACF,OAAO,aAAa,CAAC;QACvB,CAAC;QACD,MAAM,0EAA0E,CAAC;IACnF,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport type { CommonClientOptions } from \"@azure/core-client\";\nimport type { InternalPipelineOptions } from \"@azure/core-rest-pipeline\";\nimport type {\n CommunicationIdentifier,\n CommunicationUserIdentifier,\n} from \"@azure/communication-common\";\nimport { parseClientArguments, isKeyCredential } from \"@azure/communication-common\";\nimport { logger } from \"./models/logger.js\";\nimport type {\n AnswerCallRequest,\n CallAutomationApiClient,\n CommunicationUserIdentifierModel,\n CreateCallRequest,\n RedirectCallRequest,\n RejectCallRequest,\n CustomCallingContextInternal,\n ConnectRequest,\n} from \"./generated/src/index.js\";\nimport { CallConnection } from \"./callConnection.js\";\nimport { CallRecording } from \"./callRecording.js\";\nimport type {\n AnswerCallOptions,\n ConnectCallOptions,\n CreateCallOptions,\n RedirectCallOptions,\n RejectCallOptions,\n} from \"./models/options.js\";\nimport type { AnswerCallResult, ConnectCallResult, CreateCallResult } from \"./models/responses.js\";\nimport {\n type CallConnectionProperties,\n type CallInvite,\n type CallLocator,\n type CustomCallingContext,\n} from \"./models/models.js\";\nimport {\n communicationIdentifierConverter,\n communicationIdentifierModelConverter,\n communicationUserIdentifierConverter,\n communicationUserIdentifierModelConverter,\n microsoftTeamsAppIdentifierModelConverter,\n phoneNumberIdentifierConverter,\n PhoneNumberIdentifierModelConverter,\n} from \"./utli/converters.js\";\nimport { randomUUID } from \"@azure/core-util\";\nimport { createCustomCallAutomationApiClient } from \"./credential/callAutomationAuthPolicy.js\";\nimport { CallAutomationEventProcessor } from \"./eventprocessor/callAutomationEventProcessor.js\";\nimport type {\n AnswerCallEventResult,\n ConnectCallEventResult,\n CreateCallEventResult,\n} from \"./eventprocessor/eventResponses.js\";\n/**\n * Client options used to configure CallAutomation Client API requests.\n */\nexport interface CallAutomationClientOptions extends CommonClientOptions {\n /**\n * The identifier of the source of the call for call creating/answering/inviting operation.\n */\n sourceIdentity?: CommunicationUserIdentifier;\n}\n\n/**\n * Checks whether the type of a value is CallAutomationClientOptions or not.\n *\n * @param options - The value being checked.\n */\nconst isCallAutomationClientOptions = (options: any): options is CallAutomationClientOptions =>\n !!options && !isTokenCredential(options) && !isKeyCredential(options);\n\n/**\n * A CallAutomationClient represents a Client to the Azure Communication CallAutomation service.\n */\nexport class CallAutomationClient {\n private readonly callAutomationApiClient: CallAutomationApiClient;\n private readonly sourceIdentity?: CommunicationUserIdentifierModel;\n private readonly credential: TokenCredential | KeyCredential;\n private readonly internalPipelineOptions: InternalPipelineOptions;\n private readonly callAutomationEventProcessor: CallAutomationEventProcessor;\n private readonly endpoint: string;\n /**\n * Initializes a new instance of the CallAutomationClient class.\n * @param connectionString - Connection string to connect to an Azure Communication Service resource.\n * Example: \"endpoint=https://contoso.eastus.communications.azure.net/;accesskey=secret\";\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n constructor(connectionString: string, options?: CallAutomationClientOptions);\n\n /**\n * Initializes a new instance of the CallAutomationClient class using a TokenCredential or KeyCredential.\n * @param endpoint - The endpoint of the service (ex: https://contoso.eastus.communications.azure.net).\n * @param credential - TokenCredential or KeyCredential that is used to authenticate requests to the service.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n constructor(\n endpoint: string,\n credential: TokenCredential | KeyCredential,\n options?: CallAutomationClientOptions,\n );\n\n constructor(\n connectionStringOrUrl: string,\n credentialOrOptions?: KeyCredential | TokenCredential | CallAutomationClientOptions,\n maybeOptions: CallAutomationClientOptions = {},\n ) {\n const options = isCallAutomationClientOptions(credentialOrOptions)\n ? credentialOrOptions\n : maybeOptions;\n\n if (!options?.userAgentOptions) {\n options.userAgentOptions = {};\n }\n\n this.internalPipelineOptions = {\n ...options,\n ...{\n loggingOptions: {\n logger: logger.info,\n },\n },\n };\n\n const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);\n this.endpoint = url;\n\n this.credential = credential;\n\n // create event processor\n this.callAutomationEventProcessor = new CallAutomationEventProcessor();\n\n // create api client (using custom api endpoint if available)\n this.callAutomationApiClient = createCustomCallAutomationApiClient(\n credential,\n this.internalPipelineOptions,\n this.endpoint,\n );\n\n this.sourceIdentity = communicationUserIdentifierModelConverter(options.sourceIdentity);\n }\n\n /**\n * Initializes a new instance of CallConnection.\n * @param callConnectionId - The CallConnection id for the CallConnection instance. (ex: 421CONTOSO-cRD6-4RDc-a078-99dRANDOMf).\n */\n public getCallConnection(callConnectionId: string): CallConnection {\n return new CallConnection(\n callConnectionId,\n this.endpoint,\n this.credential,\n this.callAutomationEventProcessor,\n this.internalPipelineOptions,\n );\n }\n\n /**\n * Initializes a new instance of CallRecording.\n */\n public getCallRecording(): CallRecording {\n return new CallRecording(this.endpoint, this.credential, this.internalPipelineOptions);\n }\n\n /**\n * Get Source Identity that is used for create and answer call\n */\n public getSourceIdentity(): CommunicationUserIdentifier | undefined {\n return communicationUserIdentifierConverter(this.sourceIdentity);\n }\n\n /**\n * Get event processor to work with call automation events\n */\n public getEventProcessor(): CallAutomationEventProcessor {\n return this.callAutomationEventProcessor;\n }\n\n private async createCallInternal(\n request: CreateCallRequest,\n options?: CreateCallOptions,\n ): Promise<CreateCallResult> {\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const {\n callConnectionId,\n answeredBy,\n targets,\n sourceCallerIdNumber,\n source,\n answeredFor,\n ...result\n } = await this.callAutomationApiClient.createCall(request, optionsInternal);\n\n if (callConnectionId) {\n const callConnectionPropertiesDto: CallConnectionProperties = {\n ...result,\n callConnectionId: callConnectionId,\n source: source ? communicationIdentifierConverter(source) : undefined,\n answeredby: communicationUserIdentifierConverter(answeredBy),\n answeredFor: answeredFor ? phoneNumberIdentifierConverter(answeredFor) : undefined,\n targetParticipants: targets?.map((returnedTarget) =>\n communicationIdentifierConverter(returnedTarget),\n ),\n sourceCallerIdNumber: sourceCallerIdNumber\n ? phoneNumberIdentifierConverter(sourceCallerIdNumber)\n : undefined,\n };\n const callConnection = new CallConnection(\n callConnectionId,\n this.endpoint,\n this.credential,\n this.callAutomationEventProcessor,\n this.internalPipelineOptions,\n );\n const createCallResult: CreateCallResult = {\n callConnectionProperties: callConnectionPropertiesDto,\n callConnection: callConnection,\n waitForEventProcessor: async (abortSignal, timeoutInMs) => {\n const createCallEventResult: CreateCallEventResult = {\n isSuccess: false,\n };\n await this.callAutomationEventProcessor.waitForEventProcessor(\n (event) => {\n if (event.callConnectionId === callConnectionId && event.kind === \"CallConnected\") {\n createCallEventResult.isSuccess = true;\n createCallEventResult.successResult = event;\n return true;\n } else if (\n event.callConnectionId === callConnectionId &&\n event.kind === \"CreateCallFailed\"\n ) {\n createCallEventResult.isSuccess = false;\n createCallEventResult.failureResult = event;\n return true;\n } else {\n return false;\n }\n },\n abortSignal,\n timeoutInMs,\n );\n\n return createCallEventResult;\n },\n };\n return createCallResult;\n }\n throw \"callConnectionProperties / callConnectionId is missing in createCall result\";\n }\n\n /**\n * Create an outgoing call from source to a target identity.\n * @param targetParticipant - A single target.\n * @param callbackUrl - The callback url.\n * @param options - Additional request options contains createCallConnection api options.\n */\n public async createCall(\n targetParticipant: CallInvite,\n callbackUrl: string,\n options: CreateCallOptions = {},\n ): Promise<CreateCallResult> {\n const request: CreateCallRequest = {\n source: this.sourceIdentity,\n teamsAppSource: microsoftTeamsAppIdentifierModelConverter(options.teamsAppSource),\n targets: [communicationIdentifierModelConverter(targetParticipant.targetParticipant)],\n callbackUri: callbackUrl,\n operationContext: options.operationContext,\n callIntelligenceOptions: options.callIntelligenceOptions,\n mediaStreamingOptions: options.mediaStreamingOptions,\n transcriptionOptions: options.transcriptionOptions,\n customCallingContext: this.createCustomCallingContextInternal(\n targetParticipant.customCallingContext!,\n ),\n sourceCallerIdNumber: PhoneNumberIdentifierModelConverter(\n targetParticipant.sourceCallIdNumber,\n ),\n sourceDisplayName: targetParticipant.sourceDisplayName,\n };\n\n return this.createCallInternal(request, options);\n }\n\n /**\n * Create an outgoing call from source to a group of targets identities.\n * @param targetParticipants - A group of targets identities.\n * @param callbackUrl - The callback url.\n * @param options - Additional request options contains createCallConnection api options.\n */\n public async createGroupCall(\n targetParticipants: CommunicationIdentifier[],\n callbackUrl: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: CreateCallOptions = {},\n ): Promise<CreateCallResult> {\n const request: CreateCallRequest = {\n source: this.sourceIdentity,\n teamsAppSource: microsoftTeamsAppIdentifierModelConverter(options.teamsAppSource),\n targets: targetParticipants.map((target) => communicationIdentifierModelConverter(target)),\n callbackUri: callbackUrl,\n operationContext: options.operationContext,\n callIntelligenceOptions: options.callIntelligenceOptions,\n mediaStreamingOptions: options.mediaStreamingOptions,\n transcriptionOptions: options.transcriptionOptions,\n sourceCallerIdNumber: PhoneNumberIdentifierModelConverter(options.sourceCallIdNumber),\n sourceDisplayName: options.sourceDisplayName,\n };\n\n return this.createCallInternal(request, options);\n }\n\n /**\n * Answer the call.\n * @param incomingCallContext - The context associated with the call.\n * @param callbackUrl - The callback url.\n * @param options - Additional request options contains answerCall api options.\n */\n public async answerCall(\n incomingCallContext: string,\n callbackUrl: string,\n options: AnswerCallOptions = {},\n ): Promise<AnswerCallResult> {\n const {\n callIntelligenceOptions,\n mediaStreamingOptions,\n transcriptionOptions,\n operationContext,\n ...operationOptions\n } = options;\n const request: AnswerCallRequest = {\n incomingCallContext: incomingCallContext,\n mediaStreamingOptions: mediaStreamingOptions,\n transcriptionOptions: transcriptionOptions,\n callIntelligenceOptions: callIntelligenceOptions,\n customCallingContext: this.createCustomCallingContextInternal(options.customCallingContext!),\n operationContext: operationContext,\n callbackUri: callbackUrl,\n answeredBy: this.sourceIdentity,\n };\n const optionsInternal = {\n ...operationOptions,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const {\n callConnectionId,\n targets,\n sourceCallerIdNumber,\n answeredBy,\n source,\n answeredFor,\n ...result\n } = await this.callAutomationApiClient.answerCall(request, optionsInternal);\n\n if (callConnectionId) {\n const callConnectionProperties: CallConnectionProperties = {\n ...result,\n callConnectionId: callConnectionId,\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 const callConnection = new CallConnection(\n callConnectionId,\n this.endpoint,\n this.credential,\n this.callAutomationEventProcessor,\n this.internalPipelineOptions,\n );\n const answerCallResult: AnswerCallResult = {\n callConnectionProperties: callConnectionProperties,\n callConnection: callConnection,\n waitForEventProcessor: async (abortSignal, timeoutInMs) => {\n const answerCallEventResult: AnswerCallEventResult = {\n isSuccess: false,\n };\n await this.callAutomationEventProcessor.waitForEventProcessor(\n (event) => {\n if (event.callConnectionId === callConnectionId && event.kind === \"CallConnected\") {\n answerCallEventResult.isSuccess = true;\n answerCallEventResult.successResult = event;\n return true;\n }\n if (event.callConnectionId === callConnectionId && event.kind === \"AnswerFailed\") {\n answerCallEventResult.isSuccess = false;\n answerCallEventResult.failureResult = event;\n return true;\n } else {\n return false;\n }\n },\n abortSignal,\n timeoutInMs,\n );\n return answerCallEventResult;\n },\n };\n return answerCallResult;\n }\n throw \"callConnectionProperties / callConnectionId is missing in createCall result\";\n }\n\n /**\n * Redirect the call.\n *\n * @param incomingCallContext - The context associated with the call.\n * @param targetParticipant - The target identity to redirect the call to.\n * @param options - Additional request options contains redirectCall api options.\n */\n public async redirectCall(\n incomingCallContext: string,\n targetParticipant: CallInvite,\n options: RedirectCallOptions = {},\n ): Promise<void> {\n const request: RedirectCallRequest = {\n incomingCallContext: incomingCallContext,\n target: communicationIdentifierModelConverter(targetParticipant.targetParticipant),\n customCallingContext: this.createCustomCallingContextInternal(\n targetParticipant.customCallingContext!,\n ),\n };\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n\n return this.callAutomationApiClient.redirectCall(request, optionsInternal);\n }\n\n /**\n * Reject the call.\n *\n * @param incomingCallContext - The context associated with the call.\n * @param options - Additional request options contains rejectCall api options.\n */\n public async rejectCall(\n incomingCallContext: string,\n options: RejectCallOptions = {},\n ): Promise<void> {\n const request: RejectCallRequest = {\n incomingCallContext: incomingCallContext,\n callRejectReason: options.callRejectReason,\n };\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n\n return this.callAutomationApiClient.rejectCall(request, optionsInternal);\n }\n\n private createCustomCallingContextInternal(\n customCallingContext: CustomCallingContext,\n ): CustomCallingContextInternal {\n const sipHeaders: { [key: string]: string } = {};\n const voipHeaders: { [key: string]: string } = {};\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 }\n }\n }\n return { sipHeaders: sipHeaders, voipHeaders: voipHeaders };\n }\n\n /**\n * Create connection to room call.\n * @param callLocator - Call locator to create connection.\n * @param callbackUrl - The callback url\n * @param options - Additional request options contains connect api options.\n */\n public async connectCall(\n callLocator: CallLocator,\n callbackUrl: string,\n options: ConnectCallOptions = {},\n ): Promise<ConnectCallResult> {\n const connectRequest: ConnectRequest = {\n callLocator: callLocator,\n callbackUri: callbackUrl,\n operationContext: options.operationContext,\n callIntelligenceOptions: options.callIntelligenceOptions,\n mediaStreamingOptions: options.mediaStreamingOptions,\n transcriptionOptions: options.transcriptionOptions,\n };\n\n if (callLocator.kind === \"groupCallLocator\") {\n connectRequest.callLocator.kind = \"groupCallLocator\";\n connectRequest.callLocator.groupCallId = callLocator.id;\n } else if (callLocator.kind === \"roomCallLocator\") {\n connectRequest.callLocator.kind = \"roomCallLocator\";\n connectRequest.callLocator.roomId = callLocator.id;\n } else {\n connectRequest.callLocator.kind = \"serverCallLocator\";\n connectRequest.callLocator.serverCallId = callLocator.id;\n }\n\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n\n const {\n callConnectionId,\n targets,\n sourceCallerIdNumber,\n answeredBy,\n source,\n answeredFor,\n ...result\n } = await this.callAutomationApiClient.connect(connectRequest, optionsInternal);\n\n if (callConnectionId) {\n const callConnectionProperties: CallConnectionProperties = {\n ...result,\n callConnectionId: callConnectionId,\n source: source ? communicationIdentifierConverter(source) : undefined,\n answeredby: answeredBy ? communicationUserIdentifierConverter(answeredBy) : undefined,\n targetParticipants: targets?.map((target) => communicationIdentifierConverter(target)),\n answeredFor: answeredFor ? phoneNumberIdentifierConverter(answeredFor) : undefined,\n sourceCallerIdNumber: sourceCallerIdNumber\n ? phoneNumberIdentifierConverter(sourceCallerIdNumber)\n : undefined,\n };\n const callConnection = new CallConnection(\n callConnectionId,\n this.callAutomationApiClient.endpoint,\n this.credential,\n this.callAutomationEventProcessor,\n this.internalPipelineOptions,\n );\n const connectResult: ConnectCallResult = {\n callConnectionProperties: callConnectionProperties,\n callConnection: callConnection,\n waitForEventProcessor: async (abortSignal, timeoutInMs) => {\n const connectCallEventResult: ConnectCallEventResult = {\n isSuccess: false,\n };\n await this.callAutomationEventProcessor.waitForEventProcessor(\n (event) => {\n if (event.callConnectionId === callConnectionId && event.kind === \"CallConnected\") {\n connectCallEventResult.isSuccess = true;\n connectCallEventResult.successResult = event;\n return true;\n }\n if (event.callConnectionId === callConnectionId && event.kind === \"ConnectFailed\") {\n connectCallEventResult.isSuccess = false;\n connectCallEventResult.failureResult = event;\n return true;\n } else {\n return false;\n }\n },\n abortSignal,\n timeoutInMs,\n );\n return connectCallEventResult;\n },\n };\n return connectResult;\n }\n throw \"callConnectionProperties / callConnectionId is missing in connect result\";\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"callAutomationClient.js","sourceRoot":"","sources":["../../src/callAutomationClient.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,OAAO,EAEL,6BAA6B,GAE9B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACpF,OAAO,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,CAAC,MAAM,EAAE,EAAE,CAAC,gCAAgC,CAAC,MAAM,CAAC,CAAC,EACtF,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,8BAA8B,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,EAClF,oBAAoB,EAAE,oBAAoB;oBACxC,CAAC,CAAC,8BAA8B,CAAC,oBAAoB,CAAC;oBACtD,CAAC,CAAC,SAAS,GACd,CAAC;YACF,MAAM,cAAc,GAAG,IAAI,cAAc,CACvC,gBAAgB,EAChB,IAAI,CAAC,uBAAuB,CAAC,QAAQ,EACrC,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,uBAAuB,CAC7B,CAAC;YACF,MAAM,aAAa,GAAsB;gBACvC,wBAAwB,EAAE,wBAAwB;gBAClD,cAAc,EAAE,cAAc;aAC/B,CAAC;YACF,OAAO,aAAa,CAAC;QACvB,CAAC;QACD,MAAM,0EAA0E,CAAC;IACnF,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport type { CommonClientOptions } from \"@azure/core-client\";\nimport type { InternalPipelineOptions } from \"@azure/core-rest-pipeline\";\nimport {\n CommunicationIdentifier,\n createCommunicationAuthPolicy,\n CommunicationUserIdentifier,\n} from \"@azure/communication-common\";\nimport { parseClientArguments, isKeyCredential } from \"@azure/communication-common\";\nimport { logger } from \"./models/logger.js\";\nimport {\n AnswerCallRequest,\n CallAutomationApiClient,\n CommunicationUserIdentifierModel,\n CreateCallRequest,\n RedirectCallRequest,\n RejectCallRequest,\n ConnectRequest,\n} from \"./generated/src/index.js\";\nimport { CallConnection } from \"./callConnection.js\";\nimport { CallRecording } from \"./callRecording.js\";\nimport type {\n AnswerCallOptions,\n ConnectCallOptions,\n CreateCallOptions,\n RedirectCallOptions,\n RejectCallOptions,\n} from \"./models/options.js\";\nimport type { AnswerCallResult, ConnectCallResult, CreateCallResult } from \"./models/responses.js\";\nimport type { CallConnectionProperties, CallInvite, CallLocator } from \"./models/models.js\";\nimport {\n communicationIdentifierConverter,\n communicationIdentifierModelConverter,\n communicationUserIdentifierConverter,\n communicationUserIdentifierModelConverter,\n microsoftTeamsAppIdentifierModelConverter,\n phoneNumberIdentifierConverter,\n PhoneNumberIdentifierModelConverter,\n} from \"./utli/converters.js\";\nimport { randomUUID } from \"@azure/core-util\";\n/**\n * Client options used to configure CallAutomation Client API requests.\n */\nexport interface CallAutomationClientOptions extends CommonClientOptions {\n /**\n * The identifier of the source of the call for call creating/answering/inviting operation.\n */\n sourceIdentity?: CommunicationUserIdentifier;\n}\n\n/**\n * Checks whether the type of a value is CallAutomationClientOptions or not.\n *\n * @param options - The value being checked.\n */\nconst isCallAutomationClientOptions = (options: any): options is CallAutomationClientOptions =>\n !!options && !isTokenCredential(options) && !isKeyCredential(options);\n\n/**\n * A CallAutomationClient represents a Client to the Azure Communication CallAutomation service.\n */\nexport class CallAutomationClient {\n private readonly callAutomationApiClient: CallAutomationApiClient;\n private readonly sourceIdentity?: CommunicationUserIdentifierModel;\n private readonly credential: TokenCredential | KeyCredential;\n private readonly internalPipelineOptions: InternalPipelineOptions;\n private readonly endpoint: string;\n /**\n * Initializes a new instance of the CallAutomationClient class.\n * @param connectionString - Connection string to connect to an Azure Communication Service resource.\n * Example: \"endpoint=https://contoso.eastus.communications.azure.net/;accesskey=secret\";\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n constructor(connectionString: string, options?: CallAutomationClientOptions);\n\n /**\n * Initializes a new instance of the CallAutomationClient class using a TokenCredential or KeyCredential.\n * @param endpoint - The endpoint of the service (ex: https://contoso.eastus.communications.azure.net).\n * @param credential - TokenCredential or KeyCredential that is used to authenticate requests to the service.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n constructor(\n endpoint: string,\n credential: TokenCredential | KeyCredential,\n options?: CallAutomationClientOptions,\n );\n\n constructor(\n connectionStringOrUrl: string,\n credentialOrOptions?: KeyCredential | TokenCredential | CallAutomationClientOptions,\n maybeOptions: CallAutomationClientOptions = {},\n ) {\n const options = isCallAutomationClientOptions(credentialOrOptions)\n ? credentialOrOptions\n : maybeOptions;\n\n if (!options?.userAgentOptions) {\n options.userAgentOptions = {};\n }\n\n this.internalPipelineOptions = {\n ...options,\n ...{\n loggingOptions: {\n logger: logger.info,\n },\n },\n };\n\n const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);\n this.endpoint = url;\n const authPolicy = createCommunicationAuthPolicy(credential);\n this.credential = credential;\n\n this.callAutomationApiClient = new CallAutomationApiClient(url, this.internalPipelineOptions);\n this.callAutomationApiClient.pipeline.addPolicy(authPolicy);\n\n this.sourceIdentity = communicationUserIdentifierModelConverter(options.sourceIdentity);\n }\n\n /**\n * Initializes a new instance of CallConnection.\n * @param callConnectionId - The CallConnection id for the CallConnection instance. (ex: 421CONTOSO-cRD6-4RDc-a078-99dRANDOMf).\n */\n public getCallConnection(callConnectionId: string): CallConnection {\n return new CallConnection(\n callConnectionId,\n this.endpoint,\n this.credential,\n this.internalPipelineOptions,\n );\n }\n\n /**\n * Initializes a new instance of CallRecording.\n */\n public getCallRecording(): CallRecording {\n return new CallRecording(this.endpoint, this.credential, this.internalPipelineOptions);\n }\n\n /**\n * Get Source Identity that is used for create and answer call\n */\n public getSourceIdentity(): CommunicationUserIdentifier | undefined {\n return communicationUserIdentifierConverter(this.sourceIdentity);\n }\n\n private async createCallInternal(\n request: CreateCallRequest,\n options?: CreateCallOptions,\n ): Promise<CreateCallResult> {\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const {\n callConnectionId,\n answeredBy,\n targets,\n sourceCallerIdNumber,\n source,\n answeredFor,\n ...result\n } = await this.callAutomationApiClient.createCall(request, optionsInternal);\n\n if (callConnectionId) {\n const callConnectionPropertiesDto: CallConnectionProperties = {\n ...result,\n callConnectionId: callConnectionId,\n source: source ? communicationIdentifierConverter(source) : undefined,\n answeredby: communicationUserIdentifierConverter(answeredBy),\n answeredFor: answeredFor ? phoneNumberIdentifierConverter(answeredFor) : undefined,\n targetParticipants: targets?.map((returnedTarget) =>\n communicationIdentifierConverter(returnedTarget),\n ),\n sourceCallerIdNumber: sourceCallerIdNumber\n ? phoneNumberIdentifierConverter(sourceCallerIdNumber)\n : undefined,\n };\n const callConnection = new CallConnection(\n callConnectionId,\n this.endpoint,\n this.credential,\n this.internalPipelineOptions,\n );\n const createCallResult: CreateCallResult = {\n callConnectionProperties: callConnectionPropertiesDto,\n callConnection: callConnection,\n };\n return createCallResult;\n }\n throw \"callConnectionProperties / callConnectionId is missing in createCall result\";\n }\n\n /**\n * Create an outgoing call from source to a target identity.\n * @param targetParticipant - A single target.\n * @param callbackUrl - The callback url.\n * @param options - Additional request options contains createCallConnection api options.\n */\n public async createCall(\n targetParticipant: CallInvite,\n callbackUrl: string,\n options: CreateCallOptions = {},\n ): Promise<CreateCallResult> {\n const request: CreateCallRequest = {\n source: this.sourceIdentity,\n teamsAppSource: microsoftTeamsAppIdentifierModelConverter(options.teamsAppSource),\n targets: [communicationIdentifierModelConverter(targetParticipant.targetParticipant)],\n callbackUri: callbackUrl,\n operationContext: options.operationContext,\n callIntelligenceOptions: options.callIntelligenceOptions,\n mediaStreamingOptions: options.mediaStreamingOptions,\n transcriptionOptions: options.transcriptionOptions,\n sourceCallerIdNumber: PhoneNumberIdentifierModelConverter(\n targetParticipant.sourceCallIdNumber,\n ),\n sourceDisplayName: targetParticipant.sourceDisplayName,\n };\n\n return this.createCallInternal(request, options);\n }\n\n /**\n * Create an outgoing call from source to a group of targets identities.\n * @param targetParticipants - A group of targets identities.\n * @param callbackUrl - The callback url.\n * @param options - Additional request options contains createCallConnection api options.\n */\n public async createGroupCall(\n targetParticipants: CommunicationIdentifier[],\n callbackUrl: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: CreateCallOptions = {},\n ): Promise<CreateCallResult> {\n const request: CreateCallRequest = {\n source: this.sourceIdentity,\n teamsAppSource: microsoftTeamsAppIdentifierModelConverter(options.teamsAppSource),\n targets: targetParticipants.map((target) => communicationIdentifierModelConverter(target)),\n callbackUri: callbackUrl,\n operationContext: options.operationContext,\n callIntelligenceOptions: options.callIntelligenceOptions,\n mediaStreamingOptions: options.mediaStreamingOptions,\n transcriptionOptions: options.transcriptionOptions,\n sourceCallerIdNumber: PhoneNumberIdentifierModelConverter(options.sourceCallIdNumber),\n sourceDisplayName: options.sourceDisplayName,\n };\n\n return this.createCallInternal(request, options);\n }\n\n /**\n * Answer the call.\n * @param incomingCallContext - The context associated with the call.\n * @param callbackUrl - The callback url.\n * @param options - Additional request options contains answerCall api options.\n */\n public async answerCall(\n incomingCallContext: string,\n callbackUrl: string,\n options: AnswerCallOptions = {},\n ): Promise<AnswerCallResult> {\n const {\n callIntelligenceOptions,\n mediaStreamingOptions,\n transcriptionOptions,\n operationContext,\n ...operationOptions\n } = options;\n const request: AnswerCallRequest = {\n incomingCallContext: incomingCallContext,\n mediaStreamingOptions: mediaStreamingOptions,\n transcriptionOptions: transcriptionOptions,\n callIntelligenceOptions: callIntelligenceOptions,\n operationContext: operationContext,\n callbackUri: callbackUrl,\n answeredBy: this.sourceIdentity,\n };\n const optionsInternal = {\n ...operationOptions,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const {\n callConnectionId,\n targets,\n sourceCallerIdNumber,\n answeredBy,\n source,\n answeredFor,\n ...result\n } = await this.callAutomationApiClient.answerCall(request, optionsInternal);\n\n if (callConnectionId) {\n const callConnectionProperties: CallConnectionProperties = {\n ...result,\n callConnectionId: callConnectionId,\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 const callConnection = new CallConnection(\n callConnectionId,\n this.endpoint,\n this.credential,\n this.internalPipelineOptions,\n );\n const answerCallResult: AnswerCallResult = {\n callConnectionProperties: callConnectionProperties,\n callConnection: callConnection,\n };\n return answerCallResult;\n }\n throw \"callConnectionProperties / callConnectionId is missing in createCall result\";\n }\n\n /**\n * Redirect the call.\n *\n * @param incomingCallContext - The context associated with the call.\n * @param targetParticipant - The target identity to redirect the call to.\n * @param options - Additional request options contains redirectCall api options.\n */\n public async redirectCall(\n incomingCallContext: string,\n targetParticipant: CallInvite,\n options: RedirectCallOptions = {},\n ): Promise<void> {\n const request: RedirectCallRequest = {\n incomingCallContext: incomingCallContext,\n target: communicationIdentifierModelConverter(targetParticipant.targetParticipant),\n };\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n\n return this.callAutomationApiClient.redirectCall(request, optionsInternal);\n }\n\n /**\n * Reject the call.\n *\n * @param incomingCallContext - The context associated with the call.\n * @param options - Additional request options contains rejectCall api options.\n */\n public async rejectCall(\n incomingCallContext: string,\n options: RejectCallOptions = {},\n ): Promise<void> {\n const request: RejectCallRequest = {\n incomingCallContext: incomingCallContext,\n callRejectReason: options.callRejectReason,\n };\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n\n return this.callAutomationApiClient.rejectCall(request, optionsInternal);\n }\n\n /**\n * Create connection to room call.\n * @param callLocator - Call locator to create connection.\n * @param callbackUrl - The callback url\n * @param options - Additional request options contains connect api options.\n */\n public async connectCall(\n callLocator: CallLocator,\n callbackUrl: string,\n options: ConnectCallOptions = {},\n ): Promise<ConnectCallResult> {\n const connectRequest: ConnectRequest = {\n callLocator: callLocator,\n callbackUri: callbackUrl,\n operationContext: options.operationContext,\n callIntelligenceOptions: options.callIntelligenceOptions,\n mediaStreamingOptions: options.mediaStreamingOptions,\n transcriptionOptions: options.transcriptionOptions,\n };\n\n if (callLocator.kind === \"groupCallLocator\") {\n connectRequest.callLocator.kind = \"groupCallLocator\";\n connectRequest.callLocator.groupCallId = callLocator.id;\n } else if (callLocator.kind === \"roomCallLocator\") {\n connectRequest.callLocator.kind = \"roomCallLocator\";\n connectRequest.callLocator.roomId = callLocator.id;\n } else {\n connectRequest.callLocator.kind = \"serverCallLocator\";\n connectRequest.callLocator.serverCallId = callLocator.id;\n }\n\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n\n const {\n callConnectionId,\n targets,\n sourceCallerIdNumber,\n answeredBy,\n source,\n answeredFor,\n ...result\n } = await this.callAutomationApiClient.connect(connectRequest, optionsInternal);\n\n if (callConnectionId) {\n const callConnectionProperties: CallConnectionProperties = {\n ...result,\n callConnectionId: callConnectionId,\n source: source ? communicationIdentifierConverter(source) : undefined,\n answeredby: answeredBy ? communicationUserIdentifierConverter(answeredBy) : undefined,\n targetParticipants: targets?.map((target) => communicationIdentifierConverter(target)),\n answeredFor: answeredFor ? phoneNumberIdentifierConverter(answeredFor) : undefined,\n sourceCallerIdNumber: sourceCallerIdNumber\n ? phoneNumberIdentifierConverter(sourceCallerIdNumber)\n : undefined,\n };\n const callConnection = new CallConnection(\n callConnectionId,\n this.callAutomationApiClient.endpoint,\n this.credential,\n this.internalPipelineOptions,\n );\n const connectResult: ConnectCallResult = {\n callConnectionProperties: callConnectionProperties,\n callConnection: callConnection,\n };\n return connectResult;\n }\n throw \"callConnectionProperties / callConnectionId is missing in connect result\";\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callAutomationEventParser.d.ts","sourceRoot":"","sources":["../../src/callAutomationEventParser.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,mBAAmB,
|
|
1
|
+
{"version":3,"file":"callAutomationEventParser.d.ts","sourceRoot":"","sources":["../../src/callAutomationEventParser.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,mBAAmB,EAsCpB,MAAM,oBAAoB,CAAC;AAO5B;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9C,mBAAmB,CA2IrB"}
|
|
@@ -140,24 +140,6 @@ export function parseCallAutomationEvent(encodedEvents) {
|
|
|
140
140
|
case "Microsoft.Communication.PlayStarted":
|
|
141
141
|
callbackEvent = { kind: "PlayStarted" };
|
|
142
142
|
break;
|
|
143
|
-
case "Microsoft.Communication.PlayPaused":
|
|
144
|
-
callbackEvent = { kind: "PlayPaused" };
|
|
145
|
-
break;
|
|
146
|
-
case "Microsoft.Communication.PlayResumed":
|
|
147
|
-
callbackEvent = { kind: "PlayResumed" };
|
|
148
|
-
break;
|
|
149
|
-
case "Microsoft.Communication.HoldAudioStarted":
|
|
150
|
-
callbackEvent = { kind: "HoldAudioStarted" };
|
|
151
|
-
break;
|
|
152
|
-
case "Microsoft.Communication.HoldAudioPaused":
|
|
153
|
-
callbackEvent = { kind: "HoldAudioPaused" };
|
|
154
|
-
break;
|
|
155
|
-
case "Microsoft.Communication.HoldAudioResumed":
|
|
156
|
-
callbackEvent = { kind: "HoldAudioResumed" };
|
|
157
|
-
break;
|
|
158
|
-
case "Microsoft.Communication.HoldAudioCompleted":
|
|
159
|
-
callbackEvent = { kind: "HoldAudioCompleted" };
|
|
160
|
-
break;
|
|
161
143
|
default:
|
|
162
144
|
throw new TypeError(`Unknown Call Automation Event type: ${eventType}`);
|
|
163
145
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callAutomationEventParser.js","sourceRoot":"","sources":["../../src/callAutomationEventParser.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gCAAgC,EAAE,wBAAwB,EAAE,MAAM,sBAAs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AE,CAAC;QAC3C,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;QACzC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;YACrB,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACnB,MAAM,KAAK,CAAC,oBAAoB,CAAC,CAAC;YACpC,CAAC;YACD,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QACd,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,CAAC;QACX,CAAC;IACH,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE,CAAC;QACtC,IAAI,kBAAkB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACpC,MAAM,KAAK,CAAC,oBAAoB,CAAC,CAAC;QACpC,CAAC;QACD,OAAO,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;SAAM,CAAC;QACN,OAAO,kBAAkB,CAAC;IAC5B,CAAC;AACH,CAAC;AAED,SAAS,0BAA0B,CAAC,IAAS;IAC3C,MAAM,EAAE,YAAY,KAAc,IAAI,EAAb,IAAI,UAAK,IAAI,EAAhC,gBAAyB,CAAO,CAAC;IACvC,uCACK,IAAI,KACP,YAAY,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,GAAG,CAAC,CAAC,WAAoC,EAAE,EAAE,CACvE,wBAAwB,CAAC,WAAW,CAAC,CACtC,IACD;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createSerializer } from \"@azure/core-client\";\nimport { communicationIdentifierConverter, callParticipantConverter } from \"./utli/converters.js\";\nimport type {\n CallAutomationEvent,\n AddParticipantSucceeded,\n AddParticipantFailed,\n CallConnected,\n CallDisconnected,\n CallTransferAccepted,\n CallTransferFailed,\n ParticipantsUpdated,\n RecordingStateChanged,\n PlayCompleted,\n PlayFailed,\n PlayCanceled,\n RecognizeCompleted,\n RecognizeCanceled,\n RecognizeFailed,\n RemoveParticipantSucceeded,\n RemoveParticipantFailed,\n ContinuousDtmfRecognitionToneReceived,\n ContinuousDtmfRecognitionToneFailed,\n ContinuousDtmfRecognitionStopped,\n SendDtmfTonesCompleted,\n SendDtmfTonesFailed,\n CancelAddParticipantSucceeded,\n CancelAddParticipantFailed,\n TranscriptionStarted,\n TranscriptionStopped,\n TranscriptionUpdated,\n TranscriptionFailed,\n CreateCallFailed,\n AnswerFailed,\n HoldFailed,\n ConnectFailed,\n MediaStreamingStarted,\n MediaStreamingStopped,\n MediaStreamingFailed,\n StartRecordingFailed,\n PlayStarted,\n PlayPaused,\n PlayResumed,\n HoldAudioStarted,\n HoldAudioPaused,\n HoldAudioResumed,\n HoldAudioCompleted,\n IncomingCall,\n} from \"./models/events.js\";\n\nimport { CloudEventMapper } from \"./models/mapper.js\";\nimport type { CallParticipantInternal } from \"./generated/src/index.js\";\n\nconst serializer = createSerializer();\n\n/**\n * Helper function for parsing Acs callback events.\n */\nexport function parseCallAutomationEvent(\n encodedEvents: string | Record<string, unknown>,\n): CallAutomationEvent {\n const decodedInput = parseAndWrap(encodedEvents);\n\n // parse cloudevent\n const deserialized = serializer.deserialize(CloudEventMapper, decodedInput, \"\");\n const data = deserialized.data;\n const eventType = deserialized.type;\n\n // get proper callbackevent and its parser\n let callbackEvent: CallAutomationEvent;\n let parsed: any = data;\n switch (eventType) {\n case \"Microsoft.Communication.AddParticipantSucceeded\":\n callbackEvent = { kind: \"AddParticipantSucceeded\" } as AddParticipantSucceeded;\n parsed.participant = communicationIdentifierConverter(data.participant);\n break;\n case \"Microsoft.Communication.AddParticipantFailed\":\n callbackEvent = { kind: \"AddParticipantFailed\" } as AddParticipantFailed;\n parsed.participant = communicationIdentifierConverter(data.participant);\n break;\n case \"Microsoft.Communication.RemoveParticipantSucceeded\":\n callbackEvent = { kind: \"RemoveParticipantSucceeded\" } as RemoveParticipantSucceeded;\n parsed.participant = communicationIdentifierConverter(data.participant);\n break;\n case \"Microsoft.Communication.RemoveParticipantFailed\":\n callbackEvent = { kind: \"RemoveParticipantFailed\" } as RemoveParticipantFailed;\n parsed.participant = communicationIdentifierConverter(data.participant);\n break;\n case \"Microsoft.Communication.CallConnected\":\n callbackEvent = { kind: \"CallConnected\" } as CallConnected;\n break;\n case \"Microsoft.Communication.IncomingCall\":\n callbackEvent = { kind: \"IncomingCall\" } as IncomingCall;\n break;\n case \"Microsoft.Communication.CallDisconnected\":\n callbackEvent = { kind: \"CallDisconnected\" } as CallDisconnected;\n break;\n case \"Microsoft.Communication.CallTransferAccepted\":\n callbackEvent = { kind: \"CallTransferAccepted\" } as CallTransferAccepted;\n break;\n case \"Microsoft.Communication.CallTransferFailed\":\n callbackEvent = { kind: \"CallTransferFailed\" } as CallTransferFailed;\n break;\n case \"Microsoft.Communication.ParticipantsUpdated\":\n callbackEvent = { kind: \"ParticipantsUpdated\" } as ParticipantsUpdated;\n parsed = participantsParserForEvent(data);\n break;\n case \"Microsoft.Communication.RecordingStateChanged\":\n callbackEvent = { kind: \"RecordingStateChanged\" } as RecordingStateChanged;\n break;\n case \"Microsoft.Communication.PlayCompleted\":\n callbackEvent = { kind: \"PlayCompleted\" } as PlayCompleted;\n break;\n case \"Microsoft.Communication.PlayFailed\":\n callbackEvent = { kind: \"PlayFailed\" } as PlayFailed;\n break;\n case \"Microsoft.Communication.PlayCanceled\":\n callbackEvent = { kind: \"PlayCanceled\" } as PlayCanceled;\n break;\n case \"Microsoft.Communication.RecognizeCompleted\":\n callbackEvent = { kind: \"RecognizeCompleted\" } as RecognizeCompleted;\n break;\n case \"Microsoft.Communication.RecognizeCanceled\":\n callbackEvent = { kind: \"RecognizeCanceled\" } as RecognizeCanceled;\n break;\n case \"Microsoft.Communication.RecognizeFailed\":\n callbackEvent = { kind: \"RecognizeFailed\" } as RecognizeFailed;\n break;\n case \"Microsoft.Communication.ContinuousDtmfRecognitionToneReceived\":\n callbackEvent = {\n kind: \"ContinuousDtmfRecognitionToneReceived\",\n } as ContinuousDtmfRecognitionToneReceived;\n break;\n case \"Microsoft.Communication.ContinuousDtmfRecognitionToneFailed\":\n callbackEvent = {\n kind: \"ContinuousDtmfRecognitionToneFailed\",\n } as ContinuousDtmfRecognitionToneFailed;\n break;\n case \"Microsoft.Communication.ContinuousDtmfRecognitionStopped\":\n callbackEvent = {\n kind: \"ContinuousDtmfRecognitionStopped\",\n } as ContinuousDtmfRecognitionStopped;\n break;\n case \"Microsoft.Communication.SendDtmfTonesCompleted\":\n callbackEvent = { kind: \"SendDtmfTonesCompleted\" } as SendDtmfTonesCompleted;\n break;\n case \"Microsoft.Communication.SendDtmfTonesFailed\":\n callbackEvent = { kind: \"SendDtmfTonesFailed\" } as SendDtmfTonesFailed;\n break;\n case \"Microsoft.Communication.CancelAddParticipantSucceeded\":\n callbackEvent = { kind: \"CancelAddParticipantSucceeded\" } as CancelAddParticipantSucceeded;\n break;\n case \"Microsoft.Communication.CancelAddParticipantFailed\":\n callbackEvent = { kind: \"CancelAddParticipantFailed\" } as CancelAddParticipantFailed;\n break;\n case \"Microsoft.Communication.TranscriptionStarted\":\n callbackEvent = { kind: \"TranscriptionStarted\" } as TranscriptionStarted;\n break;\n case \"Microsoft.Communication.TranscriptionStopped\":\n callbackEvent = { kind: \"TranscriptionStopped\" } as TranscriptionStopped;\n break;\n case \"Microsoft.Communication.TranscriptionUpdated\":\n callbackEvent = { kind: \"TranscriptionUpdated\" } as TranscriptionUpdated;\n break;\n case \"Microsoft.Communication.TranscriptionFailed\":\n callbackEvent = { kind: \"TranscriptionFailed\" } as TranscriptionFailed;\n break;\n case \"Microsoft.Communication.CreateCallFailed\":\n callbackEvent = { kind: \"CreateCallFailed\" } as CreateCallFailed;\n break;\n case \"Microsoft.Communication.AnswerFailed\":\n callbackEvent = { kind: \"AnswerFailed\" } as AnswerFailed;\n break;\n case \"Microsoft.Communication.HoldFailed\":\n callbackEvent = { kind: \"HoldFailed\" } as HoldFailed;\n break;\n case \"Microsoft.Communication.ConnectFailed\":\n callbackEvent = { kind: \"ConnectFailed\" } as ConnectFailed;\n break;\n case \"Microsoft.Communication.MediaStreamingStarted\":\n callbackEvent = { kind: \"MediaStreamingStarted\" } as MediaStreamingStarted;\n break;\n case \"Microsoft.Communication.MediaStreamingStopped\":\n callbackEvent = { kind: \"MediaStreamingStopped\" } as MediaStreamingStopped;\n break;\n case \"Microsoft.Communication.MediaStreamingFailed\":\n callbackEvent = { kind: \"MediaStreamingFailed\" } as MediaStreamingFailed;\n break;\n case \"Microsoft.Communication.StartRecordingFailed\":\n callbackEvent = { kind: \"StartRecordingFailed\" } as StartRecordingFailed;\n break;\n case \"Microsoft.Communication.PlayStarted\":\n callbackEvent = { kind: \"PlayStarted\" } as PlayStarted;\n break;\n case \"Microsoft.Communication.PlayPaused\":\n callbackEvent = { kind: \"PlayPaused\" } as PlayPaused;\n break;\n case \"Microsoft.Communication.PlayResumed\":\n callbackEvent = { kind: \"PlayResumed\" } as PlayResumed;\n break;\n case \"Microsoft.Communication.HoldAudioStarted\":\n callbackEvent = { kind: \"HoldAudioStarted\" } as HoldAudioStarted;\n break;\n case \"Microsoft.Communication.HoldAudioPaused\":\n callbackEvent = { kind: \"HoldAudioPaused\" } as HoldAudioPaused;\n break;\n case \"Microsoft.Communication.HoldAudioResumed\":\n callbackEvent = { kind: \"HoldAudioResumed\" } as HoldAudioResumed;\n break;\n case \"Microsoft.Communication.HoldAudioCompleted\":\n callbackEvent = { kind: \"HoldAudioCompleted\" } as HoldAudioCompleted;\n break;\n default:\n throw new TypeError(`Unknown Call Automation Event type: ${eventType}`);\n }\n\n return { ...parsed, ...callbackEvent } as CallAutomationEvent;\n}\n\nfunction parseAndWrap(jsonStringOrObject: string | Record<string, unknown>): any {\n if (typeof jsonStringOrObject === \"string\") {\n const o = JSON.parse(jsonStringOrObject);\n if (Array.isArray(o)) {\n if (o.length === 0) {\n throw Error(\"Empty event array.\");\n }\n return o[0];\n } else {\n return o;\n }\n }\n\n if (Array.isArray(jsonStringOrObject)) {\n if (jsonStringOrObject.length === 0) {\n throw Error(\"Empty event array.\");\n }\n return jsonStringOrObject[0];\n } else {\n return jsonStringOrObject;\n }\n}\n\nfunction participantsParserForEvent(data: any): any {\n const { participants, ...rest } = data;\n return {\n ...rest,\n participants: participants?.map((participant: CallParticipantInternal) =>\n callParticipantConverter(participant),\n ),\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"callAutomationEventParser.js","sourceRoot":"","sources":["../../src/callAutomationEventParser.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gCAAgC,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AA0ClG,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,MAAM,UAAU,GAAG,gBAAgB,EAAE,CAAC;AAEtC;;GAEG;AACH,MAAM,UAAU,wBAAwB,CACtC,aAA+C;IAE/C,MAAM,YAAY,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;IAEjD,mBAAmB;IACnB,MAAM,YAAY,GAAG,UAAU,CAAC,WAAW,CAAC,gBAAgB,EAAE,YAAY,EAAE,EAAE,CAAC,CAAC;IAChF,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC;IAC/B,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC;IAEpC,0CAA0C;IAC1C,IAAI,aAAkC,CAAC;IACvC,IAAI,MAAM,GAAQ,IAAI,CAAC;IACvB,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,iDAAiD;YACpD,aAAa,GAAG,EAAE,IAAI,EAAE,yBAAyB,EAA6B,CAAC;YAC/E,MAAM,CAAC,WAAW,GAAG,gCAAgC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACxE,MAAM;QACR,KAAK,8CAA8C;YACjD,aAAa,GAAG,EAAE,IAAI,EAAE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,kBAAkB,CAAC,CAAC;QACzC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;YACrB,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACnB,MAAM,KAAK,CAAC,oBAAoB,CAAC,CAAC;YACpC,CAAC;YACD,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QACd,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,CAAC;QACX,CAAC;IACH,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE,CAAC;QACtC,IAAI,kBAAkB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACpC,MAAM,KAAK,CAAC,oBAAoB,CAAC,CAAC;QACpC,CAAC;QACD,OAAO,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;SAAM,CAAC;QACN,OAAO,kBAAkB,CAAC;IAC5B,CAAC;AACH,CAAC;AAED,SAAS,0BAA0B,CAAC,IAAS;IAC3C,MAAM,EAAE,YAAY,KAAc,IAAI,EAAb,IAAI,UAAK,IAAI,EAAhC,gBAAyB,CAAO,CAAC;IACvC,uCACK,IAAI,KACP,YAAY,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,GAAG,CAAC,CAAC,WAAoC,EAAE,EAAE,CACvE,wBAAwB,CAAC,WAAW,CAAC,CACtC,IACD;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createSerializer } from \"@azure/core-client\";\nimport { communicationIdentifierConverter, callParticipantConverter } from \"./utli/converters.js\";\nimport type {\n CallAutomationEvent,\n AddParticipantSucceeded,\n AddParticipantFailed,\n CallConnected,\n CallDisconnected,\n CallTransferAccepted,\n CallTransferFailed,\n ParticipantsUpdated,\n RecordingStateChanged,\n PlayCompleted,\n PlayFailed,\n PlayCanceled,\n RecognizeCompleted,\n RecognizeCanceled,\n RecognizeFailed,\n RemoveParticipantSucceeded,\n RemoveParticipantFailed,\n ContinuousDtmfRecognitionToneReceived,\n ContinuousDtmfRecognitionToneFailed,\n ContinuousDtmfRecognitionStopped,\n SendDtmfTonesCompleted,\n SendDtmfTonesFailed,\n CancelAddParticipantSucceeded,\n CancelAddParticipantFailed,\n TranscriptionStarted,\n TranscriptionStopped,\n TranscriptionUpdated,\n TranscriptionFailed,\n CreateCallFailed,\n AnswerFailed,\n HoldFailed,\n ConnectFailed,\n MediaStreamingStarted,\n MediaStreamingStopped,\n MediaStreamingFailed,\n StartRecordingFailed,\n PlayStarted,\n IncomingCall,\n} from \"./models/events.js\";\n\nimport { CloudEventMapper } from \"./models/mapper.js\";\nimport type { CallParticipantInternal } from \"./generated/src/index.js\";\n\nconst serializer = createSerializer();\n\n/**\n * Helper function for parsing Acs callback events.\n */\nexport function parseCallAutomationEvent(\n encodedEvents: string | Record<string, unknown>,\n): CallAutomationEvent {\n const decodedInput = parseAndWrap(encodedEvents);\n\n // parse cloudevent\n const deserialized = serializer.deserialize(CloudEventMapper, decodedInput, \"\");\n const data = deserialized.data;\n const eventType = deserialized.type;\n\n // get proper callbackevent and its parser\n let callbackEvent: CallAutomationEvent;\n let parsed: any = data;\n switch (eventType) {\n case \"Microsoft.Communication.AddParticipantSucceeded\":\n callbackEvent = { kind: \"AddParticipantSucceeded\" } as AddParticipantSucceeded;\n parsed.participant = communicationIdentifierConverter(data.participant);\n break;\n case \"Microsoft.Communication.AddParticipantFailed\":\n callbackEvent = { kind: \"AddParticipantFailed\" } as AddParticipantFailed;\n parsed.participant = communicationIdentifierConverter(data.participant);\n break;\n case \"Microsoft.Communication.RemoveParticipantSucceeded\":\n callbackEvent = { kind: \"RemoveParticipantSucceeded\" } as RemoveParticipantSucceeded;\n parsed.participant = communicationIdentifierConverter(data.participant);\n break;\n case \"Microsoft.Communication.RemoveParticipantFailed\":\n callbackEvent = { kind: \"RemoveParticipantFailed\" } as RemoveParticipantFailed;\n parsed.participant = communicationIdentifierConverter(data.participant);\n break;\n case \"Microsoft.Communication.CallConnected\":\n callbackEvent = { kind: \"CallConnected\" } as CallConnected;\n break;\n case \"Microsoft.Communication.IncomingCall\":\n callbackEvent = { kind: \"IncomingCall\" } as IncomingCall;\n break;\n case \"Microsoft.Communication.CallDisconnected\":\n callbackEvent = { kind: \"CallDisconnected\" } as CallDisconnected;\n break;\n case \"Microsoft.Communication.CallTransferAccepted\":\n callbackEvent = { kind: \"CallTransferAccepted\" } as CallTransferAccepted;\n break;\n case \"Microsoft.Communication.CallTransferFailed\":\n callbackEvent = { kind: \"CallTransferFailed\" } as CallTransferFailed;\n break;\n case \"Microsoft.Communication.ParticipantsUpdated\":\n callbackEvent = { kind: \"ParticipantsUpdated\" } as ParticipantsUpdated;\n parsed = participantsParserForEvent(data);\n break;\n case \"Microsoft.Communication.RecordingStateChanged\":\n callbackEvent = { kind: \"RecordingStateChanged\" } as RecordingStateChanged;\n break;\n case \"Microsoft.Communication.PlayCompleted\":\n callbackEvent = { kind: \"PlayCompleted\" } as PlayCompleted;\n break;\n case \"Microsoft.Communication.PlayFailed\":\n callbackEvent = { kind: \"PlayFailed\" } as PlayFailed;\n break;\n case \"Microsoft.Communication.PlayCanceled\":\n callbackEvent = { kind: \"PlayCanceled\" } as PlayCanceled;\n break;\n case \"Microsoft.Communication.RecognizeCompleted\":\n callbackEvent = { kind: \"RecognizeCompleted\" } as RecognizeCompleted;\n break;\n case \"Microsoft.Communication.RecognizeCanceled\":\n callbackEvent = { kind: \"RecognizeCanceled\" } as RecognizeCanceled;\n break;\n case \"Microsoft.Communication.RecognizeFailed\":\n callbackEvent = { kind: \"RecognizeFailed\" } as RecognizeFailed;\n break;\n case \"Microsoft.Communication.ContinuousDtmfRecognitionToneReceived\":\n callbackEvent = {\n kind: \"ContinuousDtmfRecognitionToneReceived\",\n } as ContinuousDtmfRecognitionToneReceived;\n break;\n case \"Microsoft.Communication.ContinuousDtmfRecognitionToneFailed\":\n callbackEvent = {\n kind: \"ContinuousDtmfRecognitionToneFailed\",\n } as ContinuousDtmfRecognitionToneFailed;\n break;\n case \"Microsoft.Communication.ContinuousDtmfRecognitionStopped\":\n callbackEvent = {\n kind: \"ContinuousDtmfRecognitionStopped\",\n } as ContinuousDtmfRecognitionStopped;\n break;\n case \"Microsoft.Communication.SendDtmfTonesCompleted\":\n callbackEvent = { kind: \"SendDtmfTonesCompleted\" } as SendDtmfTonesCompleted;\n break;\n case \"Microsoft.Communication.SendDtmfTonesFailed\":\n callbackEvent = { kind: \"SendDtmfTonesFailed\" } as SendDtmfTonesFailed;\n break;\n case \"Microsoft.Communication.CancelAddParticipantSucceeded\":\n callbackEvent = { kind: \"CancelAddParticipantSucceeded\" } as CancelAddParticipantSucceeded;\n break;\n case \"Microsoft.Communication.CancelAddParticipantFailed\":\n callbackEvent = { kind: \"CancelAddParticipantFailed\" } as CancelAddParticipantFailed;\n break;\n case \"Microsoft.Communication.TranscriptionStarted\":\n callbackEvent = { kind: \"TranscriptionStarted\" } as TranscriptionStarted;\n break;\n case \"Microsoft.Communication.TranscriptionStopped\":\n callbackEvent = { kind: \"TranscriptionStopped\" } as TranscriptionStopped;\n break;\n case \"Microsoft.Communication.TranscriptionUpdated\":\n callbackEvent = { kind: \"TranscriptionUpdated\" } as TranscriptionUpdated;\n break;\n case \"Microsoft.Communication.TranscriptionFailed\":\n callbackEvent = { kind: \"TranscriptionFailed\" } as TranscriptionFailed;\n break;\n case \"Microsoft.Communication.CreateCallFailed\":\n callbackEvent = { kind: \"CreateCallFailed\" } as CreateCallFailed;\n break;\n case \"Microsoft.Communication.AnswerFailed\":\n callbackEvent = { kind: \"AnswerFailed\" } as AnswerFailed;\n break;\n case \"Microsoft.Communication.HoldFailed\":\n callbackEvent = { kind: \"HoldFailed\" } as HoldFailed;\n break;\n case \"Microsoft.Communication.ConnectFailed\":\n callbackEvent = { kind: \"ConnectFailed\" } as ConnectFailed;\n break;\n case \"Microsoft.Communication.MediaStreamingStarted\":\n callbackEvent = { kind: \"MediaStreamingStarted\" } as MediaStreamingStarted;\n break;\n case \"Microsoft.Communication.MediaStreamingStopped\":\n callbackEvent = { kind: \"MediaStreamingStopped\" } as MediaStreamingStopped;\n break;\n case \"Microsoft.Communication.MediaStreamingFailed\":\n callbackEvent = { kind: \"MediaStreamingFailed\" } as MediaStreamingFailed;\n break;\n case \"Microsoft.Communication.StartRecordingFailed\":\n callbackEvent = { kind: \"StartRecordingFailed\" } as StartRecordingFailed;\n break;\n case \"Microsoft.Communication.PlayStarted\":\n callbackEvent = { kind: \"PlayStarted\" } as PlayStarted;\n break;\n default:\n throw new TypeError(`Unknown Call Automation Event type: ${eventType}`);\n }\n\n return { ...parsed, ...callbackEvent } as CallAutomationEvent;\n}\n\nfunction parseAndWrap(jsonStringOrObject: string | Record<string, unknown>): any {\n if (typeof jsonStringOrObject === \"string\") {\n const o = JSON.parse(jsonStringOrObject);\n if (Array.isArray(o)) {\n if (o.length === 0) {\n throw Error(\"Empty event array.\");\n }\n return o[0];\n } else {\n return o;\n }\n }\n\n if (Array.isArray(jsonStringOrObject)) {\n if (jsonStringOrObject.length === 0) {\n throw Error(\"Empty event array.\");\n }\n return jsonStringOrObject[0];\n } else {\n return jsonStringOrObject;\n }\n}\n\nfunction participantsParserForEvent(data: any): any {\n const { participants, ...rest } = data;\n return {\n ...rest,\n participants: participants?.map((participant: CallParticipantInternal) =>\n callParticipantConverter(participant),\n ),\n };\n}\n"]}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { CommunicationIdentifier } from "@azure/communication-common";
|
|
2
2
|
import { CallMedia } from "./callMedia.js";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
3
|
+
import { CallAutomationApiClientOptionalParams } from "./generated/src/index.js";
|
|
4
|
+
import type { CallConnectionProperties, CallInvite, CallParticipant } from "./models/models.js";
|
|
5
5
|
import type { AddParticipantOptions, CancelAddParticipantOperationOptions, GetCallConnectionPropertiesOptions, GetParticipantOptions, HangUpOptions, MuteParticipantOption, RemoveParticipantsOption, TransferCallToParticipantOptions } from "./models/options.js";
|
|
6
6
|
import type { ListParticipantsResult, TransferCallResult, AddParticipantResult, RemoveParticipantResult, MuteParticipantResult, CancelAddParticipantOperationResult } from "./models/responses.js";
|
|
7
7
|
import type { KeyCredential, TokenCredential } from "@azure/core-auth";
|
|
8
|
-
import type { CallAutomationEventProcessor } from "./eventprocessor/callAutomationEventProcessor.js";
|
|
9
8
|
/**
|
|
10
9
|
* CallConnection class represents call connection based APIs.
|
|
11
10
|
*/
|
|
@@ -16,8 +15,7 @@ export declare class CallConnection {
|
|
|
16
15
|
private readonly endpoint;
|
|
17
16
|
private readonly credential;
|
|
18
17
|
private readonly callAutomationApiClientOptions?;
|
|
19
|
-
|
|
20
|
-
constructor(callConnectionId: string, endpoint: string, credential: KeyCredential | TokenCredential, eventProcessor: CallAutomationEventProcessor, options?: CallAutomationApiClientOptionalParams);
|
|
18
|
+
constructor(callConnectionId: string, endpoint: string, credential: KeyCredential | TokenCredential, options?: CallAutomationApiClientOptionalParams);
|
|
21
19
|
/**
|
|
22
20
|
* Initializes a new instance of CallMedia.
|
|
23
21
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callConnection.d.ts","sourceRoot":"","sources":["../../src/callConnection.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"callConnection.d.ts","sourceRoot":"","sources":["../../src/callConnection.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,uBAAuB,EAExB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAGL,qCAAqC,EAKtC,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EACV,wBAAwB,EACxB,UAAU,EACV,eAAe,EAEhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EACV,qBAAqB,EACrB,oCAAoC,EACpC,kCAAkC,EAClC,qBAAqB,EACrB,aAAa,EACb,qBAAqB,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qBAA0B,GAClC,OAAO,CAAC,oBAAoB,CAAC;IAoChC;;;;OAIG;IACU,yBAAyB,CACpC,iBAAiB,EAAE,uBAAuB,EAC1C,OAAO,GAAE,gCAAqC,GAC7C,OAAO,CAAC,kBAAkB,CAAC;IAyB9B;;;;OAIG;IACU,iBAAiB,CAC5B,WAAW,EAAE,uBAAuB,EACpC,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,uBAAuB,CAAC;IAsBnC;;;;;OAKG;IACU,eAAe,CAC1B,WAAW,EAAE,uBAAuB,EACpC,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,qBAAqB,CAAC;IAqBjC;;;OAGG;IACU,6BAA6B,CACxC,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,oCAAyC,GACjD,OAAO,CAAC,mCAAmC,CAAC;CA6BhD"}
|
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
import { __asyncValues, __rest } from "tslib";
|
|
4
|
+
import { createCommunicationAuthPolicy, } from "@azure/communication-common";
|
|
4
5
|
import { CallMedia } from "./callMedia.js";
|
|
6
|
+
import { CallAutomationApiClient, } from "./generated/src/index.js";
|
|
5
7
|
import { CallConnectionImpl } from "./generated/src/operations/index.js";
|
|
6
8
|
import { callParticipantConverter, communicationIdentifierConverter, communicationIdentifierModelConverter, communicationUserIdentifierConverter, phoneNumberIdentifierConverter, PhoneNumberIdentifierModelConverter, } from "./utli/converters.js";
|
|
7
9
|
import { randomUUID } from "@azure/core-util";
|
|
8
|
-
import { createCustomCallAutomationApiClient } from "./credential/callAutomationAuthPolicy.js";
|
|
9
10
|
/**
|
|
10
11
|
* CallConnection class represents call connection based APIs.
|
|
11
12
|
*/
|
|
12
13
|
export class CallConnection {
|
|
13
|
-
constructor(callConnectionId, endpoint, credential,
|
|
14
|
-
this.callAutomationApiClient =
|
|
14
|
+
constructor(callConnectionId, endpoint, credential, options) {
|
|
15
|
+
this.callAutomationApiClient = new CallAutomationApiClient(endpoint, options);
|
|
16
|
+
const authPolicy = createCommunicationAuthPolicy(credential);
|
|
17
|
+
this.callAutomationApiClient.pipeline.addPolicy(authPolicy);
|
|
15
18
|
this.callConnectionId = callConnectionId;
|
|
16
19
|
this.callConnection = new CallConnectionImpl(this.callAutomationApiClient);
|
|
17
20
|
this.endpoint = endpoint;
|
|
18
21
|
this.credential = credential;
|
|
19
|
-
this.callAutomationEventProcessor = eventProcessor;
|
|
20
22
|
this.callAutomationApiClientOptions = options;
|
|
21
23
|
}
|
|
22
24
|
/**
|
|
23
25
|
* Initializes a new instance of CallMedia.
|
|
24
26
|
*/
|
|
25
27
|
getCallMedia() {
|
|
26
|
-
return new CallMedia(this.callConnectionId, this.endpoint, this.credential, this.
|
|
28
|
+
return new CallMedia(this.callConnectionId, this.endpoint, this.credential, this.callAutomationApiClientOptions);
|
|
27
29
|
}
|
|
28
30
|
/**
|
|
29
31
|
* Get call connection properties of the call
|
|
@@ -105,12 +107,7 @@ export class CallConnection {
|
|
|
105
107
|
sipHeaders[`User-To-User`] = header.value;
|
|
106
108
|
}
|
|
107
109
|
else if (header.kind === "sipx") {
|
|
108
|
-
|
|
109
|
-
sipHeaders[`X-${header.key}`] = header.value;
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
sipHeaders[`X-MS-Custom-${header.key}`] = header.value;
|
|
113
|
-
}
|
|
110
|
+
sipHeaders[`X-MS-Custom-${header.key}`] = header.value;
|
|
114
111
|
}
|
|
115
112
|
else if (header.kind === "voip") {
|
|
116
113
|
voipHeaders[`${header.key}`] = header.value;
|
|
@@ -131,7 +128,7 @@ export class CallConnection {
|
|
|
131
128
|
sourceCallerIdNumber: PhoneNumberIdentifierModelConverter(targetParticipant.sourceCallIdNumber),
|
|
132
129
|
sourceDisplayName: targetParticipant.sourceDisplayName,
|
|
133
130
|
invitationTimeoutInSeconds: options.invitationTimeoutInSeconds,
|
|
134
|
-
operationContext: options.operationContext
|
|
131
|
+
operationContext: options.operationContext,
|
|
135
132
|
operationCallbackUri: options.operationCallbackUrl,
|
|
136
133
|
customCallingContext: this.createCustomCallingContextInternal(targetParticipant.customCallingContext),
|
|
137
134
|
};
|
|
@@ -139,31 +136,7 @@ export class CallConnection {
|
|
|
139
136
|
const result = await this.callConnection.addParticipant(this.callConnectionId, addParticipantRequest, optionsInternal);
|
|
140
137
|
const addParticipantsResult = Object.assign(Object.assign({}, result), { participant: Object.assign(Object.assign({}, result.participant), { identifier: ((_a = result.participant) === null || _a === void 0 ? void 0 : _a.identifier)
|
|
141
138
|
? communicationIdentifierConverter((_b = result.participant) === null || _b === void 0 ? void 0 : _b.identifier)
|
|
142
|
-
: undefined })
|
|
143
|
-
const addParticipantEventResult = {
|
|
144
|
-
isSuccess: false,
|
|
145
|
-
};
|
|
146
|
-
await this.callAutomationEventProcessor.waitForEventProcessor((event) => {
|
|
147
|
-
if (event.callConnectionId === this.callConnectionId &&
|
|
148
|
-
event.kind === "AddParticipantSucceeded" &&
|
|
149
|
-
event.operationContext === addParticipantRequest.operationContext) {
|
|
150
|
-
addParticipantEventResult.isSuccess = true;
|
|
151
|
-
addParticipantEventResult.successResult = event;
|
|
152
|
-
return true;
|
|
153
|
-
}
|
|
154
|
-
else if (event.callConnectionId === this.callConnectionId &&
|
|
155
|
-
event.kind === "AddParticipantFailed" &&
|
|
156
|
-
event.operationContext === addParticipantRequest.operationContext) {
|
|
157
|
-
addParticipantEventResult.isSuccess = false;
|
|
158
|
-
addParticipantEventResult.failureResult = event;
|
|
159
|
-
return true;
|
|
160
|
-
}
|
|
161
|
-
else {
|
|
162
|
-
return false;
|
|
163
|
-
}
|
|
164
|
-
}, abortSignal, timeoutInMs);
|
|
165
|
-
return addParticipantEventResult;
|
|
166
|
-
} });
|
|
139
|
+
: undefined }) });
|
|
167
140
|
return addParticipantsResult;
|
|
168
141
|
}
|
|
169
142
|
/**
|
|
@@ -182,31 +155,7 @@ export class CallConnection {
|
|
|
182
155
|
};
|
|
183
156
|
const optionsInternal = Object.assign(Object.assign({}, options), { repeatabilityFirstSent: new Date(), repeatabilityRequestID: randomUUID() });
|
|
184
157
|
const result = await this.callConnection.transferToParticipant(this.callConnectionId, transferToParticipantRequest, optionsInternal);
|
|
185
|
-
const transferCallResult = Object.assign(
|
|
186
|
-
const transferCallToParticipantEventResult = {
|
|
187
|
-
isSuccess: false,
|
|
188
|
-
};
|
|
189
|
-
await this.callAutomationEventProcessor.waitForEventProcessor((event) => {
|
|
190
|
-
if (event.callConnectionId === this.callConnectionId &&
|
|
191
|
-
event.kind === "CallTransferAccepted" &&
|
|
192
|
-
event.operationContext === transferToParticipantRequest.operationContext) {
|
|
193
|
-
transferCallToParticipantEventResult.isSuccess = true;
|
|
194
|
-
transferCallToParticipantEventResult.successResult = event;
|
|
195
|
-
return true;
|
|
196
|
-
}
|
|
197
|
-
else if (event.callConnectionId === this.callConnectionId &&
|
|
198
|
-
event.kind === "CallTransferFailed" &&
|
|
199
|
-
event.operationContext === transferToParticipantRequest.operationContext) {
|
|
200
|
-
transferCallToParticipantEventResult.isSuccess = false;
|
|
201
|
-
transferCallToParticipantEventResult.failureResult = event;
|
|
202
|
-
return true;
|
|
203
|
-
}
|
|
204
|
-
else {
|
|
205
|
-
return false;
|
|
206
|
-
}
|
|
207
|
-
}, abortSignal, timeoutInMs);
|
|
208
|
-
return transferCallToParticipantEventResult;
|
|
209
|
-
} });
|
|
158
|
+
const transferCallResult = Object.assign({}, result);
|
|
210
159
|
return transferCallResult;
|
|
211
160
|
}
|
|
212
161
|
/**
|
|
@@ -222,31 +171,7 @@ export class CallConnection {
|
|
|
222
171
|
};
|
|
223
172
|
const optionsInternal = Object.assign(Object.assign({}, options), { repeatabilityFirstSent: new Date(), repeatabilityRequestID: randomUUID() });
|
|
224
173
|
const result = await this.callConnection.removeParticipant(this.callConnectionId, removeParticipantRequest, optionsInternal);
|
|
225
|
-
const removeParticipantsResult = Object.assign(
|
|
226
|
-
const removeParticipantEventResult = {
|
|
227
|
-
isSuccess: false,
|
|
228
|
-
};
|
|
229
|
-
await this.callAutomationEventProcessor.waitForEventProcessor((event) => {
|
|
230
|
-
if (event.callConnectionId === this.callConnectionId &&
|
|
231
|
-
event.kind === "RemoveParticipantSucceeded" &&
|
|
232
|
-
event.operationContext === removeParticipantRequest.operationContext) {
|
|
233
|
-
removeParticipantEventResult.isSuccess = true;
|
|
234
|
-
removeParticipantEventResult.successResult = event;
|
|
235
|
-
return true;
|
|
236
|
-
}
|
|
237
|
-
else if (event.callConnectionId === this.callConnectionId &&
|
|
238
|
-
event.kind === "RemoveParticipantFailed" &&
|
|
239
|
-
event.operationContext === removeParticipantRequest.operationContext) {
|
|
240
|
-
removeParticipantEventResult.isSuccess = false;
|
|
241
|
-
removeParticipantEventResult.failureResult = event;
|
|
242
|
-
return true;
|
|
243
|
-
}
|
|
244
|
-
else {
|
|
245
|
-
return false;
|
|
246
|
-
}
|
|
247
|
-
}, abortSignal, timeoutInMs);
|
|
248
|
-
return removeParticipantEventResult;
|
|
249
|
-
} });
|
|
174
|
+
const removeParticipantsResult = Object.assign({}, result);
|
|
250
175
|
return removeParticipantsResult;
|
|
251
176
|
}
|
|
252
177
|
/**
|
|
@@ -278,31 +203,7 @@ export class CallConnection {
|
|
|
278
203
|
};
|
|
279
204
|
const optionsInternal = Object.assign(Object.assign({}, operationOptions), { repeatabilityFirstSent: new Date(), repeatabilityRequestID: randomUUID() });
|
|
280
205
|
const result = await this.callConnection.cancelAddParticipant(this.callConnectionId, cancelAddParticipantRequest, optionsInternal);
|
|
281
|
-
const cancelAddParticipantResult = Object.assign(
|
|
282
|
-
const cancelAddParticipantEventResult = {
|
|
283
|
-
isSuccess: false,
|
|
284
|
-
};
|
|
285
|
-
await this.callAutomationEventProcessor.waitForEventProcessor((event) => {
|
|
286
|
-
if (event.callConnectionId === this.callConnectionId &&
|
|
287
|
-
event.kind === "CancelAddParticipantSucceeded" &&
|
|
288
|
-
event.operationContext === cancelAddParticipantRequest.operationContext) {
|
|
289
|
-
cancelAddParticipantEventResult.isSuccess = true;
|
|
290
|
-
cancelAddParticipantEventResult.successResult = event;
|
|
291
|
-
return true;
|
|
292
|
-
}
|
|
293
|
-
else if (event.callConnectionId === this.callConnectionId &&
|
|
294
|
-
event.kind === "CancelAddParticipantFailed" &&
|
|
295
|
-
event.operationContext === cancelAddParticipantRequest.operationContext) {
|
|
296
|
-
cancelAddParticipantEventResult.isSuccess = false;
|
|
297
|
-
cancelAddParticipantEventResult.failureResult = event;
|
|
298
|
-
return true;
|
|
299
|
-
}
|
|
300
|
-
else {
|
|
301
|
-
return false;
|
|
302
|
-
}
|
|
303
|
-
}, abortSignal, timeoutInMs);
|
|
304
|
-
return cancelAddParticipantEventResult;
|
|
305
|
-
} });
|
|
206
|
+
const cancelAddParticipantResult = Object.assign({}, result);
|
|
306
207
|
return cancelAddParticipantResult;
|
|
307
208
|
}
|
|
308
209
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callConnection.js","sourceRoot":"","sources":["../../src/callConnection.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAU3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAyBzE,OAAO,EACL,wBAAwB,EACxB,gCAAgC,EAChC,qCAAqC,EACrC,oCAAoC,EACpC,8BAA8B,EAC9B,mCAAmC,GACpC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAS9C,OAAO,EAAE,mCAAmC,EAAE,MAAM,0CAA0C,CAAC;AAE/F;;GAEG;AACH,MAAM,OAAO,cAAc;IAQzB,YACE,gBAAwB,EACxB,QAAgB,EAChB,UAA2C,EAC3C,cAA4C,EAC5C,OAA+C;QAE/C,IAAI,CAAC,uBAAuB,GAAG,mCAAmC,CAChE,UAAU,EACV,OAAO,EACP,QA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ChD,KAAK,CAAC,IAAI,KAAK,4BAA4B;wBAC3C,KAAK,CAAC,gBAAgB,KAAK,2BAA2B,CAAC,gBAAgB,EACvE,CAAC;wBACD,+BAA+B,CAAC,SAAS,GAAG,KAAK,CAAC;wBAClD,+BAA+B,CAAC,aAAa,GAAG,KAAK,CAAC;wBACtD,OAAO,IAAI,CAAC;oBACd,CAAC;yBAAM,CAAC;wBACN,OAAO,KAAK,CAAC;oBACf,CAAC;gBACH,CAAC,EACD,WAAW,EACX,WAAW,CACZ,CAAC;gBACF,OAAO,+BAA+B,CAAC;YACzC,CAAC,GACF,CAAC;QAEF,OAAO,0BAA0B,CAAC;IACpC,CAAC;CACF","sourcesContent":["// 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 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 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} from \"./models/responses.js\";\nimport {\n callParticipantConverter,\n communicationIdentifierConverter,\n communicationIdentifierModelConverter,\n communicationUserIdentifierConverter,\n phoneNumberIdentifierConverter,\n PhoneNumberIdentifierModelConverter,\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 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 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 }\n }\n }\n return { sipHeaders: sipHeaders, voipHeaders: voipHeaders };\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 * 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,OAAO,EAEL,6BAA6B,GAC9B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAEL,uBAAuB,GAMxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAyBzE,OAAO,EACL,wBAAwB,EACxB,gCAAgC,EAChC,qCAAqC,EACrC,oCAAoC,EACpC,8BAA8B,EAC9B,mCAAmC,GACpC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C;;GAEG;AACH,MAAM,OAAO,cAAc;IAOzB,YACE,gBAAwB,EACxB,QAAgB,EAChB,UAA2C,EAC3C,OAA+C;QAE/C,IAAI,CAAC,uBAAuB,GAAG,IAAI,uBAAuB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC9E,MAAM,UAAU,GAAG,6BAA6B,CAAC,UAAU,CAAC,CAAC;QAC7D,IAAI,CAAC,uBAAuB,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAC5D,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,cAAc,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;QAC3E,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,8BAA8B,GAAG,OAAO,CAAC;IAChD,CAAC;IAED;;OAEG;IACI,YAAY;QACjB,OA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,eAAe,mCAChB,OAAO,KACV,sBAAsB,EAAE,IAAI,IAAI,EAAE,EAClC,sBAAsB,EAAE,UAAU,EAAE,GACrC,CAAC;QACF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CAC3C,IAAI,CAAC,gBAAgB,EACrB,uBAAuB,EACvB,eAAe,CAChB,CAAC;QACF,MAAM,qBAAqB,qBACtB,MAAM,CACV,CAAC;QACF,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,6BAA6B,CACxC,YAAoB,EACpB,UAAgD,EAAE;QAElD,MAAM,EACJ,gBAAgB,EAChB,oBAAoB,EAAE,oBAAoB,KAExC,OAAO,EADN,gBAAgB,UACjB,OAAO,EAJL,4CAIL,CAAU,CAAC;QACZ,MAAM,2BAA2B,GAAG;YAClC,YAAY;YACZ,gBAAgB,EAAE,gBAAgB,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,UAAU,EAAE;YACpE,oBAAoB;SACrB,CAAC;QACF,MAAM,eAAe,mCAChB,gBAAgB,KACnB,sBAAsB,EAAE,IAAI,IAAI,EAAE,EAClC,sBAAsB,EAAE,UAAU,EAAE,GACrC,CAAC;QAEF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,oBAAoB,CAC3D,IAAI,CAAC,gBAAgB,EACrB,2BAA2B,EAC3B,eAAe,CAChB,CAAC;QAEF,MAAM,0BAA0B,qBAC3B,MAAM,CACV,CAAC;QAEF,OAAO,0BAA0B,CAAC;IACpC,CAAC;CACF","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 MuteParticipantsRequest,\n RemoveParticipantRequest,\n TransferToParticipantRequest,\n} from \"./generated/src/index.js\";\nimport { CallConnectionImpl } from \"./generated/src/operations/index.js\";\nimport type {\n CallConnectionProperties,\n CallInvite,\n CallParticipant,\n CustomCallingContext,\n} from \"./models/models.js\";\nimport type {\n AddParticipantOptions,\n CancelAddParticipantOperationOptions,\n GetCallConnectionPropertiesOptions,\n GetParticipantOptions,\n HangUpOptions,\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} from \"./models/responses.js\";\nimport {\n callParticipantConverter,\n communicationIdentifierConverter,\n communicationIdentifierModelConverter,\n communicationUserIdentifierConverter,\n phoneNumberIdentifierConverter,\n PhoneNumberIdentifierModelConverter,\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 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 sipHeaders[`X-MS-Custom-${header.key}`] = header.value;\n } else if (header.kind === \"voip\") {\n voipHeaders[`${header.key}`] = header.value;\n }\n }\n }\n return { sipHeaders: sipHeaders, voipHeaders: voipHeaders };\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"]}
|