@azure/communication-call-automation 1.3.0 → 1.3.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 +66 -57
- package/dist/browser/callAutomationClient.d.ts +98 -0
- package/dist/browser/callAutomationClient.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/callAutomationClient.js +5 -5
- package/dist/browser/callAutomationClient.js.map +1 -0
- package/dist/browser/callAutomationEventParser.d.ts +6 -0
- package/dist/browser/callAutomationEventParser.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/callAutomationEventParser.js +2 -2
- package/dist/browser/callAutomationEventParser.js.map +1 -0
- package/dist/browser/callConnection.d.ts +76 -0
- package/dist/browser/callConnection.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/callConnection.js +4 -4
- package/dist/browser/callConnection.js.map +1 -0
- package/dist/browser/callMedia.d.ts +84 -0
- package/dist/browser/callMedia.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/callMedia.js +2 -2
- package/dist/browser/callMedia.js.map +1 -0
- package/dist/browser/callRecording.d.ts +70 -0
- package/dist/browser/callRecording.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/callRecording.js +5 -5
- package/dist/browser/callRecording.js.map +1 -0
- package/dist/browser/contentDownloader.d.ts +25 -0
- package/dist/browser/contentDownloader.d.ts.map +1 -0
- package/dist/browser/contentDownloader.js.map +1 -0
- package/dist/browser/credential/callAutomationAccessKeyCredentialPolicy.d.ts +10 -0
- package/dist/browser/credential/callAutomationAccessKeyCredentialPolicy.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/credential/callAutomationAccessKeyCredentialPolicy.js +1 -1
- package/dist/browser/credential/callAutomationAccessKeyCredentialPolicy.js.map +1 -0
- package/dist/browser/credential/callAutomationAuthPolicy.d.ts +22 -0
- package/dist/browser/credential/callAutomationAuthPolicy.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/credential/callAutomationAuthPolicy.js +2 -2
- package/dist/browser/credential/callAutomationAuthPolicy.js.map +1 -0
- package/dist/browser/credential/cryptoUtils-browser.d.mts.map +1 -0
- package/dist/browser/credential/cryptoUtils-browser.mjs.map +1 -0
- package/dist/browser/credential/cryptoUtils.d.ts +3 -0
- package/{dist-esm/src/credential/cryptoUtils.browser.js → dist/browser/credential/cryptoUtils.js} +2 -2
- package/dist/browser/credential/encodeUtils.browser.d.ts +4 -0
- package/dist/browser/credential/encodeUtils.browser.d.ts.map +1 -0
- package/dist/browser/generated/src/callAutomationApiClient.d.ts +49 -0
- package/dist/browser/generated/src/callAutomationApiClient.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/generated/src/callAutomationApiClient.js +3 -3
- package/dist/browser/generated/src/callAutomationApiClient.js.map +1 -0
- package/dist/browser/generated/src/index.d.ts +5 -0
- package/dist/browser/generated/src/index.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/generated/src/index.js +4 -4
- package/dist/browser/generated/src/index.js.map +1 -0
- package/dist/browser/generated/src/models/index.d.ts +1494 -0
- package/dist/browser/generated/src/models/index.d.ts.map +1 -0
- package/dist/browser/generated/src/models/mappers.d.ts +82 -0
- package/dist/browser/generated/src/models/mappers.d.ts.map +1 -0
- package/dist/browser/generated/src/models/parameters.d.ts +29 -0
- package/dist/browser/generated/src/models/parameters.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/generated/src/models/parameters.js +1 -1
- package/{dist-esm/src → dist/browser}/generated/src/models/parameters.js.map +1 -1
- package/dist/browser/generated/src/operations/callConnection.d.ts +96 -0
- package/dist/browser/generated/src/operations/callConnection.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/generated/src/operations/callConnection.js +3 -3
- package/dist/browser/generated/src/operations/callConnection.js.map +1 -0
- package/dist/browser/generated/src/operations/callMedia.d.ts +68 -0
- package/dist/browser/generated/src/operations/callMedia.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/generated/src/operations/callMedia.js +2 -2
- package/dist/browser/generated/src/operations/callMedia.js.map +1 -0
- package/dist/browser/generated/src/operations/callRecording.d.ts +43 -0
- package/dist/browser/generated/src/operations/callRecording.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/generated/src/operations/callRecording.js +2 -2
- package/dist/browser/generated/src/operations/callRecording.js.map +1 -0
- package/dist/browser/generated/src/operations/index.d.ts +4 -0
- package/dist/browser/generated/src/operations/index.d.ts.map +1 -0
- package/{dist-esm/src/generated/src/operationsInterfaces → dist/browser/generated/src/operations}/index.js +3 -3
- package/dist/browser/generated/src/operations/index.js.map +1 -0
- package/dist/browser/generated/src/operationsInterfaces/callConnection.d.ts +73 -0
- package/dist/browser/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -0
- package/dist/browser/generated/src/operationsInterfaces/callConnection.js.map +1 -0
- package/dist/browser/generated/src/operationsInterfaces/callMedia.d.ts +60 -0
- package/dist/browser/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -0
- package/dist/browser/generated/src/operationsInterfaces/callMedia.js.map +1 -0
- package/dist/browser/generated/src/operationsInterfaces/callRecording.d.ts +35 -0
- package/dist/browser/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -0
- package/dist/browser/generated/src/operationsInterfaces/callRecording.js.map +1 -0
- package/dist/browser/generated/src/operationsInterfaces/index.d.ts +4 -0
- package/dist/browser/generated/src/operationsInterfaces/index.d.ts.map +1 -0
- package/dist/browser/generated/src/operationsInterfaces/index.js +11 -0
- package/dist/browser/generated/src/operationsInterfaces/index.js.map +1 -0
- package/dist/browser/generated/src/pagingHelper.d.ts +13 -0
- package/dist/browser/generated/src/pagingHelper.d.ts.map +1 -0
- package/dist/browser/index.d.ts +10 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +12 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/models/constants.d.ts +2 -0
- package/dist/browser/models/constants.d.ts.map +1 -0
- package/dist/browser/models/events.d.ts +395 -0
- package/dist/browser/models/events.d.ts.map +1 -0
- package/dist/browser/models/events.js.map +1 -0
- package/dist/browser/models/logger.d.ts +5 -0
- package/dist/browser/models/logger.d.ts.map +1 -0
- package/dist/browser/models/mapper.d.ts +3 -0
- package/dist/browser/models/mapper.d.ts.map +1 -0
- package/dist/browser/models/models.d.ts +188 -0
- package/dist/browser/models/models.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/models/models.js +1 -1
- package/dist/browser/models/models.js.map +1 -0
- package/dist/browser/models/options.d.ts +315 -0
- package/dist/browser/models/options.d.ts.map +1 -0
- package/dist/browser/models/options.js.map +1 -0
- package/dist/browser/models/responses.d.ts +73 -0
- package/dist/browser/models/responses.d.ts.map +1 -0
- package/dist/browser/models/responses.js.map +1 -0
- package/dist/browser/package.json +3 -0
- package/dist/browser/utli/converters.d.ts +22 -0
- package/dist/browser/utli/converters.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/utli/converters.js +15 -1
- package/dist/browser/utli/converters.js.map +1 -0
- package/dist/commonjs/callAutomationClient.d.ts +98 -0
- package/dist/commonjs/callAutomationClient.d.ts.map +1 -0
- package/dist/commonjs/callAutomationClient.js +218 -0
- package/{dist-esm/src → dist/commonjs}/callAutomationClient.js.map +1 -1
- package/dist/commonjs/callAutomationEventParser.d.ts +6 -0
- package/dist/commonjs/callAutomationEventParser.d.ts.map +1 -0
- package/dist/commonjs/callAutomationEventParser.js +151 -0
- package/dist/commonjs/callAutomationEventParser.js.map +1 -0
- package/dist/commonjs/callConnection.d.ts +76 -0
- package/dist/commonjs/callConnection.d.ts.map +1 -0
- package/dist/commonjs/callConnection.js +215 -0
- package/dist/commonjs/callConnection.js.map +1 -0
- package/dist/commonjs/callMedia.d.ts +84 -0
- package/dist/commonjs/callMedia.d.ts.map +1 -0
- package/dist/commonjs/callMedia.js +326 -0
- package/{dist-esm/src → dist/commonjs}/callMedia.js.map +1 -1
- package/dist/commonjs/callRecording.d.ts +70 -0
- package/dist/commonjs/callRecording.d.ts.map +1 -0
- package/dist/commonjs/callRecording.js +184 -0
- package/dist/commonjs/callRecording.js.map +1 -0
- package/dist/commonjs/contentDownloader.d.ts +25 -0
- package/dist/commonjs/contentDownloader.d.ts.map +1 -0
- package/dist/commonjs/contentDownloader.js +108 -0
- package/dist/commonjs/contentDownloader.js.map +1 -0
- package/dist/commonjs/credential/callAutomationAccessKeyCredentialPolicy.d.ts +10 -0
- package/dist/commonjs/credential/callAutomationAccessKeyCredentialPolicy.d.ts.map +1 -0
- package/dist/commonjs/credential/callAutomationAccessKeyCredentialPolicy.js +42 -0
- package/dist/commonjs/credential/callAutomationAccessKeyCredentialPolicy.js.map +1 -0
- package/dist/commonjs/credential/callAutomationAuthPolicy.d.ts +22 -0
- package/dist/commonjs/credential/callAutomationAuthPolicy.d.ts.map +1 -0
- package/dist/commonjs/credential/callAutomationAuthPolicy.js +57 -0
- package/dist/commonjs/credential/callAutomationAuthPolicy.js.map +1 -0
- package/dist/commonjs/credential/cryptoUtils.d.ts +3 -0
- package/dist/commonjs/credential/cryptoUtils.d.ts.map +1 -0
- package/dist/commonjs/credential/cryptoUtils.js +14 -0
- package/dist/commonjs/credential/cryptoUtils.js.map +1 -0
- package/dist/commonjs/credential/encodeUtils.browser.d.ts +4 -0
- package/dist/commonjs/credential/encodeUtils.browser.d.ts.map +1 -0
- package/dist/commonjs/credential/encodeUtils.browser.js +32 -0
- package/dist/commonjs/credential/encodeUtils.browser.js.map +1 -0
- package/dist/commonjs/generated/src/callAutomationApiClient.d.ts +49 -0
- package/dist/commonjs/generated/src/callAutomationApiClient.d.ts.map +1 -0
- package/dist/commonjs/generated/src/callAutomationApiClient.js +231 -0
- package/dist/commonjs/generated/src/callAutomationApiClient.js.map +1 -0
- package/dist/commonjs/generated/src/index.d.ts +5 -0
- package/dist/commonjs/generated/src/index.d.ts.map +1 -0
- package/dist/commonjs/generated/src/index.js +19 -0
- package/dist/commonjs/generated/src/index.js.map +1 -0
- package/dist/commonjs/generated/src/models/index.d.ts +1494 -0
- package/dist/commonjs/generated/src/models/index.d.ts.map +1 -0
- package/dist/commonjs/generated/src/models/index.js +203 -0
- package/dist/commonjs/generated/src/models/index.js.map +1 -0
- package/dist/commonjs/generated/src/models/mappers.d.ts +82 -0
- package/dist/commonjs/generated/src/models/mappers.d.ts.map +1 -0
- package/dist/commonjs/generated/src/models/mappers.js +2857 -0
- package/dist/commonjs/generated/src/models/mappers.js.map +1 -0
- package/dist/commonjs/generated/src/models/parameters.d.ts +29 -0
- package/dist/commonjs/generated/src/models/parameters.d.ts.map +1 -0
- package/dist/commonjs/generated/src/models/parameters.js +183 -0
- package/dist/commonjs/generated/src/models/parameters.js.map +1 -0
- package/dist/commonjs/generated/src/operations/callConnection.d.ts +96 -0
- package/dist/commonjs/generated/src/operations/callConnection.d.ts.map +1 -0
- package/dist/commonjs/generated/src/operations/callConnection.js +406 -0
- package/dist/commonjs/generated/src/operations/callConnection.js.map +1 -0
- package/dist/commonjs/generated/src/operations/callMedia.d.ts +68 -0
- package/dist/commonjs/generated/src/operations/callMedia.d.ts.map +1 -0
- package/dist/commonjs/generated/src/operations/callMedia.js +232 -0
- package/dist/commonjs/generated/src/operations/callMedia.js.map +1 -0
- package/dist/commonjs/generated/src/operations/callRecording.d.ts +43 -0
- package/dist/commonjs/generated/src/operations/callRecording.d.ts.map +1 -0
- package/dist/commonjs/generated/src/operations/callRecording.js +149 -0
- package/dist/commonjs/generated/src/operations/callRecording.js.map +1 -0
- package/dist/commonjs/generated/src/operations/index.d.ts +4 -0
- package/dist/commonjs/generated/src/operations/index.d.ts.map +1 -0
- package/dist/commonjs/generated/src/operations/index.js +14 -0
- package/dist/commonjs/generated/src/operations/index.js.map +1 -0
- package/dist/commonjs/generated/src/operationsInterfaces/callConnection.d.ts +73 -0
- package/dist/commonjs/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -0
- package/{dist-esm/src/generated/src/operations/index.js → dist/commonjs/generated/src/operationsInterfaces/callConnection.js} +3 -4
- package/dist/commonjs/generated/src/operationsInterfaces/callConnection.js.map +1 -0
- package/dist/commonjs/generated/src/operationsInterfaces/callMedia.d.ts +60 -0
- package/dist/commonjs/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -0
- package/dist/commonjs/generated/src/operationsInterfaces/callMedia.js +10 -0
- package/dist/commonjs/generated/src/operationsInterfaces/callMedia.js.map +1 -0
- package/dist/commonjs/generated/src/operationsInterfaces/callRecording.d.ts +35 -0
- package/dist/commonjs/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -0
- package/dist/commonjs/generated/src/operationsInterfaces/callRecording.js +10 -0
- package/dist/commonjs/generated/src/operationsInterfaces/callRecording.js.map +1 -0
- package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts +4 -0
- package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts.map +1 -0
- package/dist/commonjs/generated/src/operationsInterfaces/index.js +14 -0
- package/dist/commonjs/generated/src/operationsInterfaces/index.js.map +1 -0
- package/dist/commonjs/generated/src/pagingHelper.d.ts +13 -0
- package/dist/commonjs/generated/src/pagingHelper.d.ts.map +1 -0
- package/dist/commonjs/generated/src/pagingHelper.js +36 -0
- package/dist/commonjs/generated/src/pagingHelper.js.map +1 -0
- package/dist/commonjs/index.d.ts +10 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +15 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/models/constants.d.ts +2 -0
- package/dist/commonjs/models/constants.d.ts.map +1 -0
- package/dist/commonjs/models/constants.js +7 -0
- package/dist/commonjs/models/constants.js.map +1 -0
- package/dist/commonjs/models/events.d.ts +395 -0
- package/dist/commonjs/models/events.d.ts.map +1 -0
- package/dist/commonjs/models/events.js +5 -0
- package/dist/commonjs/models/events.js.map +1 -0
- package/dist/commonjs/models/logger.d.ts +5 -0
- package/dist/commonjs/models/logger.d.ts.map +1 -0
- package/dist/commonjs/models/logger.js +11 -0
- package/dist/commonjs/models/logger.js.map +1 -0
- package/dist/commonjs/models/mapper.d.ts +3 -0
- package/dist/commonjs/models/mapper.d.ts.map +1 -0
- package/dist/commonjs/models/mapper.js +79 -0
- package/dist/commonjs/models/mapper.js.map +1 -0
- package/dist/commonjs/models/models.d.ts +188 -0
- package/dist/commonjs/models/models.d.ts.map +1 -0
- package/dist/commonjs/models/models.js +58 -0
- package/dist/commonjs/models/models.js.map +1 -0
- package/dist/commonjs/models/options.d.ts +315 -0
- package/dist/commonjs/models/options.d.ts.map +1 -0
- package/dist/commonjs/models/options.js +5 -0
- package/dist/commonjs/models/options.js.map +1 -0
- package/dist/commonjs/models/responses.d.ts +73 -0
- package/dist/commonjs/models/responses.d.ts.map +1 -0
- package/dist/commonjs/models/responses.js +5 -0
- package/dist/commonjs/models/responses.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/tsdoc-metadata.json +11 -0
- package/dist/commonjs/utli/converters.d.ts +22 -0
- package/dist/commonjs/utli/converters.d.ts.map +1 -0
- package/dist/commonjs/utli/converters.js +153 -0
- package/dist/commonjs/utli/converters.js.map +1 -0
- package/dist/esm/callAutomationClient.d.ts +98 -0
- package/dist/esm/callAutomationClient.d.ts.map +1 -0
- package/dist/esm/callAutomationClient.js +214 -0
- package/dist/esm/callAutomationClient.js.map +1 -0
- package/dist/esm/callAutomationEventParser.d.ts +6 -0
- package/dist/esm/callAutomationEventParser.d.ts.map +1 -0
- package/dist/esm/callAutomationEventParser.js +148 -0
- package/dist/esm/callAutomationEventParser.js.map +1 -0
- package/dist/esm/callConnection.d.ts +76 -0
- package/dist/esm/callConnection.d.ts.map +1 -0
- package/dist/esm/callConnection.js +211 -0
- package/dist/esm/callConnection.js.map +1 -0
- package/dist/esm/callMedia.d.ts +84 -0
- package/dist/esm/callMedia.d.ts.map +1 -0
- package/dist/esm/callMedia.js +322 -0
- package/dist/esm/callMedia.js.map +1 -0
- package/dist/esm/callRecording.d.ts +70 -0
- package/dist/esm/callRecording.d.ts.map +1 -0
- package/dist/esm/callRecording.js +179 -0
- package/dist/esm/callRecording.js.map +1 -0
- package/dist/esm/contentDownloader.d.ts +25 -0
- package/dist/esm/contentDownloader.d.ts.map +1 -0
- package/dist/esm/contentDownloader.js +104 -0
- package/dist/esm/contentDownloader.js.map +1 -0
- package/dist/esm/credential/callAutomationAccessKeyCredentialPolicy.d.ts +10 -0
- package/dist/esm/credential/callAutomationAccessKeyCredentialPolicy.d.ts.map +1 -0
- package/dist/esm/credential/callAutomationAccessKeyCredentialPolicy.js +39 -0
- package/dist/esm/credential/callAutomationAccessKeyCredentialPolicy.js.map +1 -0
- package/dist/esm/credential/callAutomationAuthPolicy.d.ts +22 -0
- package/dist/esm/credential/callAutomationAuthPolicy.d.ts.map +1 -0
- package/dist/esm/credential/callAutomationAuthPolicy.js +53 -0
- package/dist/esm/credential/callAutomationAuthPolicy.js.map +1 -0
- package/dist/esm/credential/cryptoUtils.d.ts +3 -0
- package/dist/esm/credential/cryptoUtils.d.ts.map +1 -0
- package/{dist-esm/src → dist/esm}/credential/cryptoUtils.js +1 -1
- package/{dist-esm/src → dist/esm}/credential/cryptoUtils.js.map +1 -1
- package/dist/esm/credential/encodeUtils.browser.d.ts +4 -0
- package/dist/esm/credential/encodeUtils.browser.d.ts.map +1 -0
- package/dist/esm/credential/encodeUtils.browser.js +26 -0
- package/dist/esm/credential/encodeUtils.browser.js.map +1 -0
- package/dist/esm/generated/src/callAutomationApiClient.d.ts +49 -0
- package/dist/esm/generated/src/callAutomationApiClient.d.ts.map +1 -0
- package/dist/esm/generated/src/callAutomationApiClient.js +226 -0
- package/dist/esm/generated/src/callAutomationApiClient.js.map +1 -0
- package/dist/esm/generated/src/index.d.ts +5 -0
- package/dist/esm/generated/src/index.d.ts.map +1 -0
- package/dist/esm/generated/src/index.js +13 -0
- package/dist/esm/generated/src/index.js.map +1 -0
- package/dist/esm/generated/src/models/index.d.ts +1494 -0
- package/dist/esm/generated/src/models/index.d.ts.map +1 -0
- package/dist/esm/generated/src/models/index.js +200 -0
- package/dist/esm/generated/src/models/index.js.map +1 -0
- package/dist/esm/generated/src/models/mappers.d.ts +82 -0
- package/dist/esm/generated/src/models/mappers.d.ts.map +1 -0
- package/dist/esm/generated/src/models/mappers.js +2853 -0
- package/dist/esm/generated/src/models/mappers.js.map +1 -0
- package/dist/esm/generated/src/models/parameters.d.ts +29 -0
- package/dist/esm/generated/src/models/parameters.d.ts.map +1 -0
- package/dist/esm/generated/src/models/parameters.js +180 -0
- package/dist/esm/generated/src/models/parameters.js.map +1 -0
- package/dist/esm/generated/src/operations/callConnection.d.ts +96 -0
- package/dist/esm/generated/src/operations/callConnection.d.ts.map +1 -0
- package/dist/esm/generated/src/operations/callConnection.js +402 -0
- package/dist/esm/generated/src/operations/callConnection.js.map +1 -0
- package/dist/esm/generated/src/operations/callMedia.d.ts +68 -0
- package/dist/esm/generated/src/operations/callMedia.d.ts.map +1 -0
- package/dist/esm/generated/src/operations/callMedia.js +227 -0
- package/dist/esm/generated/src/operations/callMedia.js.map +1 -0
- package/dist/esm/generated/src/operations/callRecording.d.ts +43 -0
- package/dist/esm/generated/src/operations/callRecording.d.ts.map +1 -0
- package/dist/esm/generated/src/operations/callRecording.js +144 -0
- package/dist/esm/generated/src/operations/callRecording.js.map +1 -0
- package/dist/esm/generated/src/operations/index.d.ts +4 -0
- package/dist/esm/generated/src/operations/index.d.ts.map +1 -0
- package/dist/esm/generated/src/operations/index.js +11 -0
- package/dist/esm/generated/src/operations/index.js.map +1 -0
- package/dist/esm/generated/src/operationsInterfaces/callConnection.d.ts +73 -0
- package/dist/esm/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -0
- package/dist/esm/generated/src/operationsInterfaces/callConnection.js +9 -0
- package/dist/esm/generated/src/operationsInterfaces/callConnection.js.map +1 -0
- package/dist/esm/generated/src/operationsInterfaces/callMedia.d.ts +60 -0
- package/dist/esm/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -0
- package/dist/esm/generated/src/operationsInterfaces/callMedia.js +9 -0
- package/dist/esm/generated/src/operationsInterfaces/callMedia.js.map +1 -0
- package/dist/esm/generated/src/operationsInterfaces/callRecording.d.ts +35 -0
- package/dist/esm/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -0
- package/dist/esm/generated/src/operationsInterfaces/callRecording.js +9 -0
- package/dist/esm/generated/src/operationsInterfaces/callRecording.js.map +1 -0
- package/dist/esm/generated/src/operationsInterfaces/index.d.ts +4 -0
- package/dist/esm/generated/src/operationsInterfaces/index.d.ts.map +1 -0
- package/dist/esm/generated/src/operationsInterfaces/index.js +11 -0
- package/dist/esm/generated/src/operationsInterfaces/index.js.map +1 -0
- package/dist/esm/generated/src/pagingHelper.d.ts +13 -0
- package/dist/esm/generated/src/pagingHelper.d.ts.map +1 -0
- package/dist/esm/generated/src/pagingHelper.js +32 -0
- package/dist/esm/generated/src/pagingHelper.js.map +1 -0
- package/dist/esm/index.d.ts +10 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/models/constants.d.ts +2 -0
- package/dist/esm/models/constants.d.ts.map +1 -0
- package/dist/esm/models/constants.js +4 -0
- package/dist/esm/models/constants.js.map +1 -0
- package/dist/esm/models/events.d.ts +395 -0
- package/dist/esm/models/events.d.ts.map +1 -0
- package/dist/esm/models/events.js +4 -0
- package/dist/esm/models/events.js.map +1 -0
- package/dist/esm/models/logger.d.ts +5 -0
- package/dist/esm/models/logger.d.ts.map +1 -0
- package/dist/esm/models/logger.js +8 -0
- package/dist/esm/models/logger.js.map +1 -0
- package/dist/esm/models/mapper.d.ts +3 -0
- package/dist/esm/models/mapper.d.ts.map +1 -0
- package/dist/esm/models/mapper.js +76 -0
- package/dist/esm/models/mapper.js.map +1 -0
- package/dist/esm/models/models.d.ts +188 -0
- package/dist/esm/models/models.d.ts.map +1 -0
- package/dist/esm/models/models.js +54 -0
- package/dist/esm/models/models.js.map +1 -0
- package/dist/esm/models/options.d.ts +315 -0
- package/dist/esm/models/options.d.ts.map +1 -0
- package/dist/esm/models/options.js +4 -0
- package/dist/esm/models/options.js.map +1 -0
- package/dist/esm/models/responses.d.ts +73 -0
- package/dist/esm/models/responses.d.ts.map +1 -0
- package/dist/esm/models/responses.js +4 -0
- package/dist/esm/models/responses.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/utli/converters.d.ts +22 -0
- package/dist/esm/utli/converters.d.ts.map +1 -0
- package/dist/esm/utli/converters.js +142 -0
- package/dist/esm/utli/converters.js.map +1 -0
- package/dist/react-native/callAutomationClient.d.ts +98 -0
- package/dist/react-native/callAutomationClient.d.ts.map +1 -0
- package/dist/react-native/callAutomationClient.js +214 -0
- package/dist/react-native/callAutomationClient.js.map +1 -0
- package/dist/react-native/callAutomationEventParser.d.ts +6 -0
- package/dist/react-native/callAutomationEventParser.d.ts.map +1 -0
- package/dist/react-native/callAutomationEventParser.js +148 -0
- package/dist/react-native/callAutomationEventParser.js.map +1 -0
- package/dist/react-native/callConnection.d.ts +76 -0
- package/dist/react-native/callConnection.d.ts.map +1 -0
- package/dist/react-native/callConnection.js +211 -0
- package/dist/react-native/callConnection.js.map +1 -0
- package/dist/react-native/callMedia.d.ts +84 -0
- package/dist/react-native/callMedia.d.ts.map +1 -0
- package/dist/react-native/callMedia.js +322 -0
- package/dist/react-native/callMedia.js.map +1 -0
- package/dist/react-native/callRecording.d.ts +70 -0
- package/dist/react-native/callRecording.d.ts.map +1 -0
- package/dist/react-native/callRecording.js +179 -0
- package/dist/react-native/callRecording.js.map +1 -0
- package/dist/react-native/contentDownloader.d.ts +25 -0
- package/dist/react-native/contentDownloader.d.ts.map +1 -0
- package/dist/react-native/contentDownloader.js +104 -0
- package/dist/react-native/contentDownloader.js.map +1 -0
- package/dist/react-native/credential/callAutomationAccessKeyCredentialPolicy.d.ts +10 -0
- package/dist/react-native/credential/callAutomationAccessKeyCredentialPolicy.d.ts.map +1 -0
- package/dist/react-native/credential/callAutomationAccessKeyCredentialPolicy.js +39 -0
- package/dist/react-native/credential/callAutomationAccessKeyCredentialPolicy.js.map +1 -0
- package/dist/react-native/credential/callAutomationAuthPolicy.d.ts +22 -0
- package/dist/react-native/credential/callAutomationAuthPolicy.d.ts.map +1 -0
- package/dist/react-native/credential/callAutomationAuthPolicy.js +53 -0
- package/dist/react-native/credential/callAutomationAuthPolicy.js.map +1 -0
- package/dist/react-native/credential/cryptoUtils.d.ts +3 -0
- package/dist/react-native/credential/cryptoUtils.d.ts.map +1 -0
- package/dist/react-native/credential/cryptoUtils.js +9 -0
- package/dist/react-native/credential/cryptoUtils.js.map +1 -0
- package/dist/react-native/credential/encodeUtils.browser.d.ts +4 -0
- package/dist/react-native/credential/encodeUtils.browser.d.ts.map +1 -0
- package/dist/react-native/credential/encodeUtils.browser.js +26 -0
- package/dist/react-native/credential/encodeUtils.browser.js.map +1 -0
- package/dist/react-native/generated/src/callAutomationApiClient.d.ts +49 -0
- package/dist/react-native/generated/src/callAutomationApiClient.d.ts.map +1 -0
- package/dist/react-native/generated/src/callAutomationApiClient.js +226 -0
- package/dist/react-native/generated/src/callAutomationApiClient.js.map +1 -0
- package/dist/react-native/generated/src/index.d.ts +5 -0
- package/dist/react-native/generated/src/index.d.ts.map +1 -0
- package/dist/react-native/generated/src/index.js +13 -0
- package/dist/react-native/generated/src/index.js.map +1 -0
- package/dist/react-native/generated/src/models/index.d.ts +1494 -0
- package/dist/react-native/generated/src/models/index.d.ts.map +1 -0
- package/dist/react-native/generated/src/models/index.js +200 -0
- package/dist/react-native/generated/src/models/index.js.map +1 -0
- package/dist/react-native/generated/src/models/mappers.d.ts +82 -0
- package/dist/react-native/generated/src/models/mappers.d.ts.map +1 -0
- package/dist/react-native/generated/src/models/mappers.js +2853 -0
- package/dist/react-native/generated/src/models/mappers.js.map +1 -0
- package/dist/react-native/generated/src/models/parameters.d.ts +29 -0
- package/dist/react-native/generated/src/models/parameters.d.ts.map +1 -0
- package/dist/react-native/generated/src/models/parameters.js +180 -0
- package/dist/react-native/generated/src/models/parameters.js.map +1 -0
- package/dist/react-native/generated/src/operations/callConnection.d.ts +96 -0
- package/dist/react-native/generated/src/operations/callConnection.d.ts.map +1 -0
- package/dist/react-native/generated/src/operations/callConnection.js +402 -0
- package/dist/react-native/generated/src/operations/callConnection.js.map +1 -0
- package/dist/react-native/generated/src/operations/callMedia.d.ts +68 -0
- package/dist/react-native/generated/src/operations/callMedia.d.ts.map +1 -0
- package/dist/react-native/generated/src/operations/callMedia.js +227 -0
- package/dist/react-native/generated/src/operations/callMedia.js.map +1 -0
- package/dist/react-native/generated/src/operations/callRecording.d.ts +43 -0
- package/dist/react-native/generated/src/operations/callRecording.d.ts.map +1 -0
- package/dist/react-native/generated/src/operations/callRecording.js +144 -0
- package/dist/react-native/generated/src/operations/callRecording.js.map +1 -0
- package/dist/react-native/generated/src/operations/index.d.ts +4 -0
- package/dist/react-native/generated/src/operations/index.d.ts.map +1 -0
- package/dist/react-native/generated/src/operations/index.js +11 -0
- package/dist/react-native/generated/src/operations/index.js.map +1 -0
- package/dist/react-native/generated/src/operationsInterfaces/callConnection.d.ts +73 -0
- package/dist/react-native/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -0
- package/dist/react-native/generated/src/operationsInterfaces/callConnection.js +9 -0
- package/dist/react-native/generated/src/operationsInterfaces/callConnection.js.map +1 -0
- package/dist/react-native/generated/src/operationsInterfaces/callMedia.d.ts +60 -0
- package/dist/react-native/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -0
- package/dist/react-native/generated/src/operationsInterfaces/callMedia.js +9 -0
- package/dist/react-native/generated/src/operationsInterfaces/callMedia.js.map +1 -0
- package/dist/react-native/generated/src/operationsInterfaces/callRecording.d.ts +35 -0
- package/dist/react-native/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -0
- package/dist/react-native/generated/src/operationsInterfaces/callRecording.js +9 -0
- package/dist/react-native/generated/src/operationsInterfaces/callRecording.js.map +1 -0
- package/dist/react-native/generated/src/operationsInterfaces/index.d.ts +4 -0
- package/dist/react-native/generated/src/operationsInterfaces/index.d.ts.map +1 -0
- package/dist/react-native/generated/src/operationsInterfaces/index.js +11 -0
- package/dist/react-native/generated/src/operationsInterfaces/index.js.map +1 -0
- package/dist/react-native/generated/src/pagingHelper.d.ts +13 -0
- package/dist/react-native/generated/src/pagingHelper.d.ts.map +1 -0
- package/dist/react-native/generated/src/pagingHelper.js +32 -0
- package/dist/react-native/generated/src/pagingHelper.js.map +1 -0
- package/dist/react-native/index.d.ts +10 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +12 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/models/constants.d.ts +2 -0
- package/dist/react-native/models/constants.d.ts.map +1 -0
- package/dist/react-native/models/constants.js +4 -0
- package/dist/react-native/models/constants.js.map +1 -0
- package/dist/react-native/models/events.d.ts +395 -0
- package/dist/react-native/models/events.d.ts.map +1 -0
- package/dist/react-native/models/events.js +4 -0
- package/dist/react-native/models/events.js.map +1 -0
- package/dist/react-native/models/logger.d.ts +5 -0
- package/dist/react-native/models/logger.d.ts.map +1 -0
- package/dist/react-native/models/logger.js +8 -0
- package/dist/react-native/models/logger.js.map +1 -0
- package/dist/react-native/models/mapper.d.ts +3 -0
- package/dist/react-native/models/mapper.d.ts.map +1 -0
- package/dist/react-native/models/mapper.js +76 -0
- package/dist/react-native/models/mapper.js.map +1 -0
- package/dist/react-native/models/models.d.ts +188 -0
- package/dist/react-native/models/models.d.ts.map +1 -0
- package/dist/react-native/models/models.js +54 -0
- package/dist/react-native/models/models.js.map +1 -0
- package/dist/react-native/models/options.d.ts +315 -0
- package/dist/react-native/models/options.d.ts.map +1 -0
- package/dist/react-native/models/options.js +4 -0
- package/dist/react-native/models/options.js.map +1 -0
- package/dist/react-native/models/responses.d.ts +73 -0
- package/dist/react-native/models/responses.d.ts.map +1 -0
- package/dist/react-native/models/responses.js +4 -0
- package/dist/react-native/models/responses.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/dist/react-native/utli/converters.d.ts +22 -0
- package/dist/react-native/utli/converters.d.ts.map +1 -0
- package/dist/react-native/utli/converters.js +142 -0
- package/dist/react-native/utli/converters.js.map +1 -0
- package/package.json +91 -53
- package/dist/index.js +0 -5763
- package/dist/index.js.map +0 -1
- package/dist-esm/src/callAutomationEventParser.js.map +0 -1
- package/dist-esm/src/callConnection.js.map +0 -1
- package/dist-esm/src/callRecording.js.map +0 -1
- package/dist-esm/src/contentDownloader.js.map +0 -1
- package/dist-esm/src/credential/callAutomationAccessKeyCredentialPolicy.js.map +0 -1
- package/dist-esm/src/credential/callAutomationAuthPolicy.js.map +0 -1
- package/dist-esm/src/credential/cryptoUtils.browser.js.map +0 -1
- package/dist-esm/src/generated/src/callAutomationApiClient.js.map +0 -1
- package/dist-esm/src/generated/src/index.js.map +0 -1
- package/dist-esm/src/generated/src/operations/callConnection.js.map +0 -1
- package/dist-esm/src/generated/src/operations/callMedia.js.map +0 -1
- package/dist-esm/src/generated/src/operations/callRecording.js.map +0 -1
- package/dist-esm/src/generated/src/operations/index.js.map +0 -1
- package/dist-esm/src/generated/src/operationsInterfaces/callConnection.js.map +0 -1
- package/dist-esm/src/generated/src/operationsInterfaces/callMedia.js.map +0 -1
- package/dist-esm/src/generated/src/operationsInterfaces/callRecording.js.map +0 -1
- package/dist-esm/src/generated/src/operationsInterfaces/index.js.map +0 -1
- package/dist-esm/src/index.js +0 -12
- package/dist-esm/src/index.js.map +0 -1
- package/dist-esm/src/models/events.js.map +0 -1
- package/dist-esm/src/models/models.js.map +0 -1
- package/dist-esm/src/models/options.js.map +0 -1
- package/dist-esm/src/models/responses.js.map +0 -1
- package/dist-esm/src/utli/converters.js.map +0 -1
- package/types/communication-call-automation.d.ts +0 -2014
- /package/{dist-esm/src → dist/browser}/contentDownloader.js +0 -0
- /package/{dist-esm/src → dist/browser}/credential/encodeUtils.browser.js +0 -0
- /package/{dist-esm/src → dist/browser}/credential/encodeUtils.browser.js.map +0 -0
- /package/{dist-esm/src → dist/browser}/generated/src/models/index.js +0 -0
- /package/{dist-esm/src → dist/browser}/generated/src/models/index.js.map +0 -0
- /package/{dist-esm/src → dist/browser}/generated/src/models/mappers.js +0 -0
- /package/{dist-esm/src → dist/browser}/generated/src/models/mappers.js.map +0 -0
- /package/{dist-esm/src → dist/browser}/generated/src/operationsInterfaces/callConnection.js +0 -0
- /package/{dist-esm/src → dist/browser}/generated/src/operationsInterfaces/callMedia.js +0 -0
- /package/{dist-esm/src → dist/browser}/generated/src/operationsInterfaces/callRecording.js +0 -0
- /package/{dist-esm/src → dist/browser}/generated/src/pagingHelper.js +0 -0
- /package/{dist-esm/src → dist/browser}/generated/src/pagingHelper.js.map +0 -0
- /package/{dist-esm/src → dist/browser}/models/constants.js +0 -0
- /package/{dist-esm/src → dist/browser}/models/constants.js.map +0 -0
- /package/{dist-esm/src → dist/browser}/models/events.js +0 -0
- /package/{dist-esm/src → dist/browser}/models/logger.js +0 -0
- /package/{dist-esm/src → dist/browser}/models/logger.js.map +0 -0
- /package/{dist-esm/src → dist/browser}/models/mapper.js +0 -0
- /package/{dist-esm/src → dist/browser}/models/mapper.js.map +0 -0
- /package/{dist-esm/src → dist/browser}/models/options.js +0 -0
- /package/{dist-esm/src → dist/browser}/models/responses.js +0 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { CallAutomationApiClientOptionalParams, Tone } from "./generated/src/index.js";
|
|
2
|
+
import { CommunicationIdentifier } from "@azure/communication-common";
|
|
3
|
+
import { FileSource, TextSource, SsmlSource, DtmfTone } from "./models/models.js";
|
|
4
|
+
import { PlayOptions, PlayToAllOptions, CallMediaRecognizeDtmfOptions, CallMediaRecognizeChoiceOptions, ContinuousDtmfRecognitionOptions, SendDtmfTonesOptions, CallMediaRecognizeSpeechOptions, CallMediaRecognizeSpeechOrDtmfOptions, HoldOptions, UnholdOptions } from "./models/options.js";
|
|
5
|
+
import { KeyCredential, TokenCredential } from "@azure/core-auth";
|
|
6
|
+
import { SendDtmfTonesResult } from "./models/responses.js";
|
|
7
|
+
/**
|
|
8
|
+
* CallMedia class represents call media related APIs.
|
|
9
|
+
*/
|
|
10
|
+
export declare class CallMedia {
|
|
11
|
+
private readonly callConnectionId;
|
|
12
|
+
private readonly callMedia;
|
|
13
|
+
private readonly callAutomationApiClient;
|
|
14
|
+
constructor(callConnectionId: string, endpoint: string, credential: KeyCredential | TokenCredential, options?: CallAutomationApiClientOptionalParams);
|
|
15
|
+
private createPlaySourceInternal;
|
|
16
|
+
/**
|
|
17
|
+
* Play audio to a specific participant.
|
|
18
|
+
*
|
|
19
|
+
* @param playSources - A PlaySource representing the sources to play. Currently only single play source per request is supported.
|
|
20
|
+
* @param playTo - The targets to play to.
|
|
21
|
+
* @param options - Additional attributes for play.
|
|
22
|
+
*/
|
|
23
|
+
play(playSources: (FileSource | TextSource | SsmlSource)[], playTo: CommunicationIdentifier[], options?: PlayOptions): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Play to all participants.
|
|
26
|
+
*
|
|
27
|
+
* @param playSources - A PlaySource representing the sources to play. Currently only single play source per request is supported.
|
|
28
|
+
* @param options - Additional attributes for play.
|
|
29
|
+
*/
|
|
30
|
+
playToAll(playSources: (FileSource | TextSource | SsmlSource)[], options?: PlayToAllOptions): Promise<void>;
|
|
31
|
+
private createRecognizeRequest;
|
|
32
|
+
/**
|
|
33
|
+
* Recognize participant input.
|
|
34
|
+
* @deprecated This method signature is deprecated. Please use the new signature with targetParticipant and options params instead, and set maxTonesToCollect in options.
|
|
35
|
+
* @param targetParticipant - Target participant.
|
|
36
|
+
* @param maxTonesToCollect - Maximum number of DTMF tones to be collected.
|
|
37
|
+
* @param options - Different attributes for recognize.
|
|
38
|
+
* */
|
|
39
|
+
startRecognizing(targetParticipant: CommunicationIdentifier, maxTonesToCollect: number, options: CallMediaRecognizeDtmfOptions): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Recognize participant input.
|
|
42
|
+
* @param targetParticipant - Target participant.
|
|
43
|
+
* @param options - Different attributes for recognize.
|
|
44
|
+
* */
|
|
45
|
+
startRecognizing(targetParticipant: CommunicationIdentifier, options: CallMediaRecognizeDtmfOptions | CallMediaRecognizeChoiceOptions | CallMediaRecognizeSpeechOptions | CallMediaRecognizeSpeechOrDtmfOptions): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Cancels all the queued media operations.
|
|
48
|
+
*/
|
|
49
|
+
cancelAllOperations(): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Start continuous Dtmf recognition by subscribing to tones.
|
|
52
|
+
* @param targetParticipant - Target participant.
|
|
53
|
+
* @param options - Additional attributes for continuous Dtmf recognition.
|
|
54
|
+
* */
|
|
55
|
+
startContinuousDtmfRecognition(targetParticipant: CommunicationIdentifier, options?: ContinuousDtmfRecognitionOptions): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Stop continuous Dtmf recognition by unsubscribing to tones.
|
|
58
|
+
* @param targetParticipant - Target participant.
|
|
59
|
+
* @param options - Additional attributes for continuous Dtmf recognition.
|
|
60
|
+
* */
|
|
61
|
+
stopContinuousDtmfRecognition(targetParticipant: CommunicationIdentifier, options?: ContinuousDtmfRecognitionOptions): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Send Dtmf tones.
|
|
64
|
+
* @param tones - List of tones to be sent to target participant.
|
|
65
|
+
* @param targetParticipant - Target participant.
|
|
66
|
+
* @param options - Additional attributes for send Dtmf tones.
|
|
67
|
+
* */
|
|
68
|
+
sendDtmfTones(tones: Tone[] | DtmfTone[], targetParticipant: CommunicationIdentifier, options?: SendDtmfTonesOptions): Promise<SendDtmfTonesResult>;
|
|
69
|
+
/**
|
|
70
|
+
* Put participant on hold while playing audio.
|
|
71
|
+
*
|
|
72
|
+
* @param targetParticipant - The targets to play to.
|
|
73
|
+
* @param options - Additional attributes for hold participant.
|
|
74
|
+
*/
|
|
75
|
+
hold(targetParticipant: CommunicationIdentifier, options?: HoldOptions): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Remove participant from hold.
|
|
78
|
+
*
|
|
79
|
+
* @param targetParticipant - The targets to play to.
|
|
80
|
+
* @param options - Additional attributes for unhold participant.
|
|
81
|
+
*/
|
|
82
|
+
unhold(targetParticipant: CommunicationIdentifier, options?: UnholdOptions): Promise<void>;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=callMedia.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callMedia.d.ts","sourceRoot":"","sources":["../../src/callMedia.ts"],"names":[],"mappings":"AAGA,OAAO,EAYL,qCAAqC,EAGrC,IAAI,EAIL,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EACL,uBAAuB,EAGxB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,6BAA6B,EAC7B,+BAA+B,EAC/B,gCAAgC,EAChC,oBAAoB,EACpB,+BAA+B,EAC/B,qCAAqC,EACrC,WAAW,EACX,aAAa,EACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D;;GAEG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;IAC1C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAgB;IAC1C,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAA0B;gBAEhE,gBAAgB,EAAE,MAAM,EACxB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,aAAa,GAAG,eAAe,EAC3C,OAAO,CAAC,EAAE,qCAAqC;IASjD,OAAO,CAAC,wBAAwB;IAuChC;;;;;;OAMG;IACU,IAAI,CACf,WAAW,EAAE,CAAC,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC,EAAE,EACrD,MAAM,EAAE,uBAAuB,EAAE,EAC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AAI,CAAC;CAQjB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
import { KnownPlaySourceType, KnownRecognizeInputType, CallAutomationApiClient, } from "./generated/src";
|
|
4
|
-
import { CallMediaImpl } from "./generated/src/operations";
|
|
3
|
+
import { KnownPlaySourceType, KnownRecognizeInputType, CallAutomationApiClient, } from "./generated/src/index.js";
|
|
4
|
+
import { CallMediaImpl } from "./generated/src/operations/index.js";
|
|
5
5
|
import { createCommunicationAuthPolicy, serializeCommunicationIdentifier, } from "@azure/communication-common";
|
|
6
6
|
import { randomUUID } from "@azure/core-util";
|
|
7
7
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callMedia.js","sourceRoot":"","sources":["../../src/callMedia.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAML,mBAAmB,EAEnB,uBAAuB,EAGvB,uBAAuB,GAQxB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EAEL,6BAA6B,EAC7B,gCAAgC,GACjC,MAAM,6BAA6B,CAAC;AAiBrC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;GAEG;AACH,MAAM,OAAO,SAAS;IAIpB,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,SAAS,GAAG,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,mBAAmB,CAAC;IAC7B,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,IAAI,CACf,iBAA0C,EAC1C,UAAuB,EAAE;QAEzB,MAAM,WAAW,GAAgB;YAC/B,iBAAiB,EAAE,gCAAgC,CAAC,iBAAiB,CAAC;YACtE,cAAc,EACZ,OAAO,CAAC,UAAU,KAAK,SAAS;gBAC9B,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,UAAU,CAAC;gBACnD,CAAC,CAAC,SAAS;YACf,gBAAgB,EACd,OAAO,CAAC,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS;YAC/E,oBAAoB,EAClB,OAAO,CAAC,oBAAoB,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,SAAS;SACxF,CAAC;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC;IACjE,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,MAAM,CACjB,iBAA0C,EAC1C,UAAyB,EAAE;QAE3B,MAAM,aAAa,GAAkB;YACnC,iBAAiB,EAAE,gCAAgC,CAAC,iBAAiB,CAAC;YACtE,gBAAgB,EACd,OAAO,CAAC,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS;SAChF,CAAC;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;IACrE,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n PlayRequest,\n PlaySourceInternal,\n FileSourceInternal,\n TextSourceInternal,\n SsmlSourceInternal,\n KnownPlaySourceType,\n RecognizeRequest,\n KnownRecognizeInputType,\n RecognizeOptions,\n DtmfOptions,\n CallAutomationApiClient,\n CallAutomationApiClientOptionalParams,\n ContinuousDtmfRecognitionRequest,\n SendDtmfTonesRequest,\n Tone,\n SpeechOptions,\n HoldRequest,\n UnholdRequest,\n} from \"./generated/src/index.js\";\n\nimport { CallMediaImpl } from \"./generated/src/operations/index.js\";\n\nimport {\n CommunicationIdentifier,\n createCommunicationAuthPolicy,\n serializeCommunicationIdentifier,\n} from \"@azure/communication-common\";\n\nimport { FileSource, TextSource, SsmlSource, DtmfTone } from \"./models/models.js\";\nimport {\n PlayOptions,\n PlayToAllOptions,\n CallMediaRecognizeDtmfOptions,\n CallMediaRecognizeChoiceOptions,\n ContinuousDtmfRecognitionOptions,\n SendDtmfTonesOptions,\n CallMediaRecognizeSpeechOptions,\n CallMediaRecognizeSpeechOrDtmfOptions,\n HoldOptions,\n UnholdOptions,\n} from \"./models/options.js\";\nimport { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { SendDtmfTonesResult } from \"./models/responses.js\";\nimport { randomUUID } from \"@azure/core-util\";\n\n/**\n * CallMedia class represents call media related APIs.\n */\nexport class CallMedia {\n private readonly callConnectionId: string;\n private readonly callMedia: CallMediaImpl;\n private readonly callAutomationApiClient: CallAutomationApiClient;\n constructor(\n callConnectionId: string,\n endpoint: string,\n credential: KeyCredential | TokenCredential,\n options?: CallAutomationApiClientOptionalParams,\n ) {\n this.callAutomationApiClient = new CallAutomationApiClient(endpoint, options);\n const authPolicy = createCommunicationAuthPolicy(credential);\n this.callAutomationApiClient.pipeline.addPolicy(authPolicy);\n this.callConnectionId = callConnectionId;\n this.callMedia = new CallMediaImpl(this.callAutomationApiClient);\n }\n\n private createPlaySourceInternal(\n playSource: FileSource | TextSource | SsmlSource,\n ): PlaySourceInternal {\n if (playSource.kind === \"fileSource\") {\n const fileSource: FileSourceInternal = {\n uri: playSource.url,\n };\n return {\n kind: KnownPlaySourceType.File,\n file: fileSource,\n playSourceCacheId: playSource.playsourcacheid,\n };\n } else if (playSource.kind === \"textSource\") {\n const textSource: TextSourceInternal = {\n text: playSource.text,\n sourceLocale: playSource.sourceLocale,\n voiceKind: playSource.voiceKind,\n voiceName: playSource.voiceName,\n customVoiceEndpointId: playSource.customVoiceEndpointId,\n };\n return {\n kind: KnownPlaySourceType.Text,\n text: textSource,\n playSourceCacheId: playSource.playsourcacheid,\n };\n } else if (playSource.kind === \"ssmlSource\") {\n const ssmlSource: SsmlSourceInternal = {\n ssmlText: playSource.ssmlText,\n customVoiceEndpointId: playSource.customVoiceEndpointId,\n };\n return {\n kind: KnownPlaySourceType.Ssml,\n ssml: ssmlSource,\n playSourceCacheId: playSource.playsourcacheid,\n };\n }\n throw new Error(\"Invalid play source\");\n }\n\n /**\n * Play audio to a specific participant.\n *\n * @param playSources - A PlaySource representing the sources to play. Currently only single play source per request is supported.\n * @param playTo - The targets to play to.\n * @param options - Additional attributes for play.\n */\n public async play(\n playSources: (FileSource | TextSource | SsmlSource)[],\n playTo: CommunicationIdentifier[],\n options: PlayOptions = { loop: false },\n ): Promise<void> {\n const playRequest: PlayRequest = {\n playSources: playSources.map((source) => this.createPlaySourceInternal(source)),\n playTo: playTo.map((identifier) => serializeCommunicationIdentifier(identifier)),\n playOptions: {\n loop: false,\n },\n operationContext: options.operationContext,\n operationCallbackUri: options.operationCallbackUrl,\n };\n\n if (options.loop !== undefined) {\n playRequest.playOptions = playRequest.playOptions || { loop: false }; // Ensure playOptions is defined\n playRequest.playOptions.loop = options.loop;\n }\n return this.callMedia.play(this.callConnectionId, playRequest, options);\n }\n\n /**\n * Play to all participants.\n *\n * @param playSources - A PlaySource representing the sources to play. Currently only single play source per request is supported.\n * @param options - Additional attributes for play.\n */\n public async playToAll(\n playSources: (FileSource | TextSource | SsmlSource)[],\n options: PlayToAllOptions = { loop: false },\n ): Promise<void> {\n const playRequest: PlayRequest = {\n playSources: playSources.map((source) => this.createPlaySourceInternal(source)),\n playTo: [],\n playOptions: {\n loop: false,\n },\n interruptCallMediaOperation:\n options.interruptCallMediaOperation !== undefined\n ? options.interruptCallMediaOperation\n : false,\n operationContext: options.operationContext,\n operationCallbackUri: options.operationCallbackUrl,\n };\n\n if (options.loop !== undefined) {\n playRequest.playOptions = playRequest.playOptions || { loop: false }; // Ensure playOptions is defined\n playRequest.playOptions.loop = options.loop;\n }\n return this.callMedia.play(this.callConnectionId, playRequest, options);\n }\n\n private createRecognizeRequest(\n targetParticipant: CommunicationIdentifier,\n recognizeOptions:\n | CallMediaRecognizeDtmfOptions\n | CallMediaRecognizeChoiceOptions\n | CallMediaRecognizeSpeechOptions\n | CallMediaRecognizeSpeechOrDtmfOptions,\n ): RecognizeRequest {\n if (recognizeOptions.kind === \"callMediaRecognizeDtmfOptions\") {\n const dtmfOptionsInternal: DtmfOptions = {\n interToneTimeoutInSeconds: recognizeOptions.interToneTimeoutInSeconds\n ? recognizeOptions.interToneTimeoutInSeconds\n : 2,\n maxTonesToCollect: recognizeOptions.maxTonesToCollect,\n stopTones: recognizeOptions.stopDtmfTones,\n };\n const recognizeOptionsInternal: RecognizeOptions = {\n interruptPrompt: recognizeOptions.interruptPrompt,\n initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds\n ? recognizeOptions.initialSilenceTimeoutInSeconds\n : 5,\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n dtmfOptions: dtmfOptionsInternal,\n };\n return {\n recognizeInputType: KnownRecognizeInputType.Dtmf,\n playPrompt: recognizeOptions.playPrompt\n ? this.createPlaySourceInternal(recognizeOptions.playPrompt)\n : undefined,\n playPrompts:\n recognizeOptions.playPrompts !== undefined\n ? recognizeOptions.playPrompts.map((source) => this.createPlaySourceInternal(source))\n : undefined,\n interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,\n recognizeOptions: recognizeOptionsInternal,\n operationContext: recognizeOptions.operationContext,\n operationCallbackUri: recognizeOptions.operationCallbackUrl,\n };\n } else if (recognizeOptions.kind === \"callMediaRecognizeChoiceOptions\") {\n const recognizeOptionsInternal: RecognizeOptions = {\n interruptPrompt: recognizeOptions.interruptPrompt,\n initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds\n ? recognizeOptions.initialSilenceTimeoutInSeconds\n : 5,\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n speechLanguage: recognizeOptions.speechLanguage,\n speechRecognitionModelEndpointId: recognizeOptions.speechRecognitionModelEndpointId,\n choices: recognizeOptions.choices,\n };\n return {\n recognizeInputType: KnownRecognizeInputType.Choices,\n playPrompt: recognizeOptions.playPrompt\n ? this.createPlaySourceInternal(recognizeOptions.playPrompt)\n : undefined,\n playPrompts:\n recognizeOptions.playPrompts !== undefined\n ? recognizeOptions.playPrompts.map((source) => this.createPlaySourceInternal(source))\n : undefined,\n interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,\n recognizeOptions: recognizeOptionsInternal,\n operationContext: recognizeOptions.operationContext,\n operationCallbackUri: recognizeOptions.operationCallbackUrl,\n };\n } else if (recognizeOptions.kind === \"callMediaRecognizeSpeechOptions\") {\n const speechOptions: SpeechOptions = {\n endSilenceTimeoutInMs: recognizeOptions.endSilenceTimeoutInSeconds\n ? recognizeOptions.endSilenceTimeoutInSeconds * 1000\n : 2000,\n };\n const recognizeOptionsInternal: RecognizeOptions = {\n interruptPrompt: recognizeOptions.interruptPrompt,\n initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds\n ? recognizeOptions.initialSilenceTimeoutInSeconds\n : 5,\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n speechOptions: speechOptions,\n speechLanguage: recognizeOptions.speechLanguage,\n speechRecognitionModelEndpointId: recognizeOptions.speechRecognitionModelEndpointId,\n };\n return {\n recognizeInputType: KnownRecognizeInputType.Speech,\n playPrompt: recognizeOptions.playPrompt\n ? this.createPlaySourceInternal(recognizeOptions.playPrompt)\n : undefined,\n playPrompts:\n recognizeOptions.playPrompts !== undefined\n ? recognizeOptions.playPrompts.map((source) => this.createPlaySourceInternal(source))\n : undefined,\n interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,\n recognizeOptions: recognizeOptionsInternal,\n operationContext: recognizeOptions.operationContext,\n operationCallbackUri: recognizeOptions.operationCallbackUrl,\n };\n } else if (recognizeOptions.kind === \"callMediaRecognizeSpeechOrDtmfOptions\") {\n const dtmfOptionsInternal: DtmfOptions = {\n interToneTimeoutInSeconds: recognizeOptions.interToneTimeoutInSeconds\n ? recognizeOptions.interToneTimeoutInSeconds\n : 2,\n maxTonesToCollect: recognizeOptions.maxTonesToCollect,\n stopTones: recognizeOptions.stopDtmfTones,\n };\n const speechOptions: SpeechOptions = {\n endSilenceTimeoutInMs: recognizeOptions.endSilenceTimeoutInSeconds\n ? recognizeOptions.endSilenceTimeoutInSeconds * 1000\n : 2000,\n };\n const recognizeOptionsInternal: RecognizeOptions = {\n interruptPrompt: recognizeOptions.interruptPrompt,\n initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds\n ? recognizeOptions.initialSilenceTimeoutInSeconds\n : 5,\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n speechOptions: speechOptions,\n dtmfOptions: dtmfOptionsInternal,\n speechRecognitionModelEndpointId: recognizeOptions.speechRecognitionModelEndpointId,\n };\n return {\n recognizeInputType: KnownRecognizeInputType.SpeechOrDtmf,\n playPrompt: recognizeOptions.playPrompt\n ? this.createPlaySourceInternal(recognizeOptions.playPrompt)\n : undefined,\n playPrompts:\n recognizeOptions.playPrompts !== undefined\n ? recognizeOptions.playPrompts.map((source) => this.createPlaySourceInternal(source))\n : undefined,\n interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,\n recognizeOptions: recognizeOptionsInternal,\n operationContext: recognizeOptions.operationContext,\n operationCallbackUri: recognizeOptions.operationCallbackUrl,\n };\n }\n throw new Error(\"Invalid recognizeOptions\");\n }\n\n /**\n * Recognize participant input.\n * @deprecated This method signature is deprecated. Please use the new signature with targetParticipant and options params instead, and set maxTonesToCollect in options.\n * @param targetParticipant - Target participant.\n * @param maxTonesToCollect - Maximum number of DTMF tones to be collected.\n * @param options - Different attributes for recognize.\n * */\n public async startRecognizing(\n targetParticipant: CommunicationIdentifier,\n maxTonesToCollect: number,\n options: CallMediaRecognizeDtmfOptions,\n ): Promise<void>;\n\n /**\n * Recognize participant input.\n * @param targetParticipant - Target participant.\n * @param options - Different attributes for recognize.\n * */\n public async startRecognizing(\n targetParticipant: CommunicationIdentifier,\n options:\n | CallMediaRecognizeDtmfOptions\n | CallMediaRecognizeChoiceOptions\n | CallMediaRecognizeSpeechOptions\n | CallMediaRecognizeSpeechOrDtmfOptions,\n ): Promise<void>;\n async startRecognizing(\n targetParticipant: CommunicationIdentifier,\n maxTonesOrOptions:\n | number\n | CallMediaRecognizeDtmfOptions\n | CallMediaRecognizeChoiceOptions\n | CallMediaRecognizeSpeechOptions\n | CallMediaRecognizeSpeechOrDtmfOptions,\n options?: CallMediaRecognizeDtmfOptions,\n ): Promise<void> {\n if (typeof maxTonesOrOptions === \"number\" && options) {\n // Old function signature logic\n console.warn(\n \"Deprecated function signature used. Please use the new signature with targetParticipant and options params instead, and set maxTonesToCollect in options.\",\n );\n options.maxTonesToCollect = maxTonesOrOptions;\n return this.callMedia.recognize(\n this.callConnectionId,\n this.createRecognizeRequest(targetParticipant, options),\n {},\n );\n } else if (typeof maxTonesOrOptions !== \"number\" && !options) {\n // New function signature logic\n return this.callMedia.recognize(\n this.callConnectionId,\n this.createRecognizeRequest(targetParticipant, maxTonesOrOptions),\n {},\n );\n }\n throw new Error(\"Invalid params\");\n }\n\n /**\n * Cancels all the queued media operations.\n */\n public async cancelAllOperations(): Promise<void> {\n return this.callMedia.cancelAllMediaOperations(this.callConnectionId, {});\n }\n\n /**\n * Start continuous Dtmf recognition by subscribing to tones.\n * @param targetParticipant - Target participant.\n * @param options - Additional attributes for continuous Dtmf recognition.\n * */\n public async startContinuousDtmfRecognition(\n targetParticipant: CommunicationIdentifier,\n options: ContinuousDtmfRecognitionOptions = {},\n ): Promise<void> {\n const continuousDtmfRecognitionRequest: ContinuousDtmfRecognitionRequest = {\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n operationContext: options.operationContext,\n };\n return this.callMedia.startContinuousDtmfRecognition(\n this.callConnectionId,\n continuousDtmfRecognitionRequest,\n {},\n );\n }\n\n /**\n * Stop continuous Dtmf recognition by unsubscribing to tones.\n * @param targetParticipant - Target participant.\n * @param options - Additional attributes for continuous Dtmf recognition.\n * */\n public async stopContinuousDtmfRecognition(\n targetParticipant: CommunicationIdentifier,\n options: ContinuousDtmfRecognitionOptions = {},\n ): Promise<void> {\n const continuousDtmfRecognitionRequest: ContinuousDtmfRecognitionRequest = {\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n operationContext: options.operationContext,\n operationCallbackUri: options.operationCallbackUrl,\n };\n return this.callMedia.stopContinuousDtmfRecognition(\n this.callConnectionId,\n continuousDtmfRecognitionRequest,\n {},\n );\n }\n\n /**\n * Send Dtmf tones.\n * @param tones - List of tones to be sent to target participant.\n * @param targetParticipant - Target participant.\n * @param options - Additional attributes for send Dtmf tones.\n * */\n public async sendDtmfTones(\n tones: Tone[] | DtmfTone[],\n targetParticipant: CommunicationIdentifier,\n options: SendDtmfTonesOptions = {},\n ): Promise<SendDtmfTonesResult> {\n const sendDtmfTonesRequest: SendDtmfTonesRequest = {\n tones: tones,\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n operationContext: options.operationContext,\n operationCallbackUri: options.operationCallbackUrl,\n };\n\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const result = await this.callMedia.sendDtmfTones(\n this.callConnectionId,\n sendDtmfTonesRequest,\n optionsInternal,\n );\n const sendDtmfTonesResult: SendDtmfTonesResult = {\n ...result,\n };\n return sendDtmfTonesResult;\n }\n\n /**\n * Put participant on hold while playing audio.\n *\n * @param targetParticipant - The targets to play to.\n * @param options - Additional attributes for hold participant.\n */\n public async hold(\n targetParticipant: CommunicationIdentifier,\n options: HoldOptions = {},\n ): Promise<void> {\n const holdRequest: HoldRequest = {\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n playSourceInfo:\n options.playSource !== undefined\n ? this.createPlaySourceInternal(options.playSource)\n : undefined,\n operationContext:\n options.operationContext !== undefined ? options.operationContext : undefined,\n operationCallbackUri:\n options.operationCallbackUrl !== undefined ? options.operationCallbackUrl : undefined,\n };\n return this.callMedia.hold(this.callConnectionId, holdRequest);\n }\n\n /**\n * Remove participant from hold.\n *\n * @param targetParticipant - The targets to play to.\n * @param options - Additional attributes for unhold participant.\n */\n public async unhold(\n targetParticipant: CommunicationIdentifier,\n options: UnholdOptions = {},\n ): Promise<void> {\n const unholdRequest: UnholdRequest = {\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n operationContext:\n options.operationContext !== undefined ? options.operationContext : undefined,\n };\n return this.callMedia.unhold(this.callConnectionId, unholdRequest);\n }\n}\n"]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { CallAutomationApiClientOptionalParams } from "./generated/src/models/index.js";
|
|
2
|
+
import { RecordingStateResult } from "./models/responses.js";
|
|
3
|
+
import { StartRecordingOptions, StopRecordingOptions, PauseRecordingOptions, GetRecordingPropertiesOptions, ResumeRecordingOptions, DeleteRecordingOptions, DownloadRecordingOptions } from "./models/options.js";
|
|
4
|
+
import { KeyCredential, TokenCredential } from "@azure/core-auth";
|
|
5
|
+
/**
|
|
6
|
+
* CallRecording class represents call recording related APIs.
|
|
7
|
+
*/
|
|
8
|
+
export declare class CallRecording {
|
|
9
|
+
private readonly callRecordingImpl;
|
|
10
|
+
private readonly contentDownloader;
|
|
11
|
+
private readonly callAutomationApiClient;
|
|
12
|
+
constructor(endpoint: string, credential: KeyCredential | TokenCredential, options?: CallAutomationApiClientOptionalParams);
|
|
13
|
+
/**
|
|
14
|
+
* Starts a call recording with the specified options.
|
|
15
|
+
* @param startCallRecordingRequest - options to start the call recording
|
|
16
|
+
* @param options - Operation options.
|
|
17
|
+
*/
|
|
18
|
+
start(options: StartRecordingOptions): Promise<RecordingStateResult>;
|
|
19
|
+
/**
|
|
20
|
+
* Returns call recording properties.
|
|
21
|
+
* @param recordingId - The recordingId associated with the recording.
|
|
22
|
+
* @param options - Additional request options contains getRecordingProperties api options.
|
|
23
|
+
*/
|
|
24
|
+
getState(recordingId: string, options?: GetRecordingPropertiesOptions): Promise<RecordingStateResult>;
|
|
25
|
+
/**
|
|
26
|
+
* Stops a call recording.
|
|
27
|
+
* @param recordingId - The recordingId associated with the recording.
|
|
28
|
+
* @param options - Additional request options contains stopRecording api options.
|
|
29
|
+
*/
|
|
30
|
+
stop(recordingId: string, options?: StopRecordingOptions): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Pauses a call recording.
|
|
33
|
+
* @param recordingId - The recordingId associated with the recording.
|
|
34
|
+
* @param options - Additional request options contains pauseRecording api options.
|
|
35
|
+
*/
|
|
36
|
+
pause(recordingId: string, options?: PauseRecordingOptions): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Resumes a call recording.
|
|
39
|
+
* @param recordingId - The recordingId associated with the recording.
|
|
40
|
+
* @param options - Additional request options contains resumeRecording api options.
|
|
41
|
+
*/
|
|
42
|
+
resume(recordingId: string, options?: ResumeRecordingOptions): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Deletes a recording.
|
|
45
|
+
* @param recordingLocationUrl - The recording location url. Required.
|
|
46
|
+
* @param options - Additional request options contains deleteRecording api options.
|
|
47
|
+
*/
|
|
48
|
+
delete(recordingLocationUrl: string, options?: DeleteRecordingOptions): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Returns a stream with a call recording.
|
|
51
|
+
* @param sourceLocationUrl - The source location url. Required.
|
|
52
|
+
* @param options - Additional request options contains downloadRecording api options.
|
|
53
|
+
*/
|
|
54
|
+
downloadStreaming(sourceLocationUrl: string, options?: DownloadRecordingOptions): Promise<NodeJS.ReadableStream>;
|
|
55
|
+
/**
|
|
56
|
+
* Downloads a call recording file to the specified stream.
|
|
57
|
+
* @param sourceLocationUrl - The source location url. Required.
|
|
58
|
+
* @param destinationStream - The destination stream. Required.
|
|
59
|
+
* @param options - Additional request options contains downloadRecording api options.
|
|
60
|
+
*/
|
|
61
|
+
downloadToStream(sourceLocationUrl: string, destinationStream: NodeJS.WritableStream, options?: DownloadRecordingOptions): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Downloads a call recording file to the specified path.
|
|
64
|
+
* @param sourceLocationUrl - The source location url. Required.
|
|
65
|
+
* @param destinationPath - The destination path. Required.
|
|
66
|
+
* @param options - Additional request options contains downloadRecording api options.
|
|
67
|
+
*/
|
|
68
|
+
downloadToPath(sourceLocationUrl: string, destinationPath: string, options?: DownloadRecordingOptions): Promise<void>;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=callRecording.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callRecording.d.ts","sourceRoot":"","sources":["../../src/callRecording.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,qCAAqC,EAEtC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,6BAA6B,EAC7B,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAIlE;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAoB;IACtD,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAwB;IAC1D,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAA0B;gBAGhE,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,aAAa,GAAG,eAAe,EAC3C,OAAO,CAAC,EAAE,qCAAqC;IASjD;;;;OAIG;IACU,KAAK,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA6DjF;;;;OAIG;IACU,QAAQ,CACnB,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,6BAAkC,GAC1C,OAAO,CAAC,oBAAoB,CAAC;IAYhC;;;;OAIG;IACU,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,GAAE,oBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzF;;;;OAIG;IACU,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3F;;;;OAIG;IACU,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,GAAE,sBAA2B,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7F;;;;OAIG;IACU,MAAM,CACjB,oBAAoB,EAAE,MAAM,EAC5B,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,IAAI,CAAC;IAIhB;;;;OAIG;IACU,iBAAiB,CAC5B,iBAAiB,EAAE,MAAM,EACzB,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC;IAUjC;;;;;OAKG;IACU,gBAAgB,CAC3B,iBAAiB,EAAE,MAAM,EACzB,iBAAiB,EAAE,MAAM,CAAC,cAAc,EACxC,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,IAAI,CAAC;IAehB;;;;;OAKG;IACU,cAAc,CACzB,iBAAiB,EAAE,MAAM,EACzB,eAAe,EAAE,MAAM,EACvB,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,IAAI,CAAC;CAejB"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
import { CallRecordingImpl } from "./generated/src/operations";
|
|
4
|
-
import { communicationIdentifierModelConverter } from "./utli/converters";
|
|
5
|
-
import { ContentDownloaderImpl } from "./contentDownloader";
|
|
6
|
-
import * as fs from "fs";
|
|
3
|
+
import { CallRecordingImpl } from "./generated/src/operations/index.js";
|
|
4
|
+
import { communicationIdentifierModelConverter } from "./utli/converters.js";
|
|
5
|
+
import { ContentDownloaderImpl } from "./contentDownloader.js";
|
|
6
|
+
import * as fs from "node:fs";
|
|
7
7
|
import { randomUUID } from "@azure/core-util";
|
|
8
|
-
import { CallAutomationApiClient } from "./generated/src";
|
|
8
|
+
import { CallAutomationApiClient } from "./generated/src/index.js";
|
|
9
9
|
import { createCommunicationAuthPolicy } from "@azure/communication-common";
|
|
10
10
|
/**
|
|
11
11
|
* CallRecording class represents call recording related APIs.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callRecording.js","sourceRoot":"","sources":["../../src/callRecording.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAexE,OAAO,EAAE,qCAAqC,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAE5E;;GAEG;AACH,MAAM,OAAO,aAAa;IAKxB,YACE,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,UAA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ACnD,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;gBACtC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YACtC,CAAC,CAAC,CAAC;YACH,MAAM,MAAM,CAAC;QACf,CAAC;aAAM,CAAC;YACN,MAAM,KAAK,CAAC,sBAAsB,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { CallRecordingImpl } from \"./generated/src/operations/index.js\";\nimport {\n CallAutomationApiClientOptionalParams,\n StartCallRecordingRequest,\n} from \"./generated/src/models/index.js\";\nimport { RecordingStateResult } from \"./models/responses.js\";\nimport {\n StartRecordingOptions,\n StopRecordingOptions,\n PauseRecordingOptions,\n GetRecordingPropertiesOptions,\n ResumeRecordingOptions,\n DeleteRecordingOptions,\n DownloadRecordingOptions,\n} from \"./models/options.js\";\nimport { communicationIdentifierModelConverter } from \"./utli/converters.js\";\nimport { ContentDownloaderImpl } from \"./contentDownloader.js\";\nimport * as fs from \"node:fs\";\nimport { randomUUID } from \"@azure/core-util\";\nimport { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { CallAutomationApiClient } from \"./generated/src/index.js\";\nimport { createCommunicationAuthPolicy } from \"@azure/communication-common\";\n\n/**\n * CallRecording class represents call recording related APIs.\n */\nexport class CallRecording {\n private readonly callRecordingImpl: CallRecordingImpl;\n private readonly contentDownloader: ContentDownloaderImpl;\n private readonly callAutomationApiClient: CallAutomationApiClient;\n\n constructor(\n endpoint: string,\n credential: KeyCredential | TokenCredential,\n options?: CallAutomationApiClientOptionalParams,\n ) {\n this.callAutomationApiClient = new CallAutomationApiClient(endpoint, options);\n const authPolicy = createCommunicationAuthPolicy(credential);\n this.callAutomationApiClient.pipeline.addPolicy(authPolicy);\n this.callRecordingImpl = new CallRecordingImpl(this.callAutomationApiClient);\n this.contentDownloader = new ContentDownloaderImpl(this.callAutomationApiClient);\n }\n\n /**\n * Starts a call recording with the specified options.\n * @param startCallRecordingRequest - options to start the call recording\n * @param options - Operation options.\n */\n public async start(options: StartRecordingOptions): Promise<RecordingStateResult> {\n const startCallRecordingRequest: StartCallRecordingRequest = {\n callLocator: options.callLocator,\n };\n\n startCallRecordingRequest.recordingChannelType = options.recordingChannel;\n startCallRecordingRequest.recordingContentType = options.recordingContent;\n startCallRecordingRequest.recordingFormatType = options.recordingFormat;\n startCallRecordingRequest.recordingStateCallbackUri = options.recordingStateCallbackEndpointUrl;\n startCallRecordingRequest.pauseOnStart = options.pauseOnStart;\n startCallRecordingRequest.recordingStorage = options.recordingStorage;\n\n if (options.channelAffinity) {\n startCallRecordingRequest.channelAffinity = [];\n options.channelAffinity.forEach((identifier) => {\n startCallRecordingRequest.channelAffinity?.push({\n participant: communicationIdentifierModelConverter(identifier.targetParticipant),\n channel: identifier.channel,\n });\n });\n }\n\n if (options.audioChannelParticipantOrdering) {\n startCallRecordingRequest.audioChannelParticipantOrdering = [];\n options.audioChannelParticipantOrdering.forEach((identifier) => {\n startCallRecordingRequest.audioChannelParticipantOrdering?.push(\n communicationIdentifierModelConverter(identifier),\n );\n });\n }\n\n if (options.callLocator.kind === \"groupCallLocator\") {\n startCallRecordingRequest.callLocator.kind = \"groupCallLocator\";\n startCallRecordingRequest.callLocator.groupCallId = options.callLocator.id;\n } else if (options.callLocator.kind === \"roomCallLocator\") {\n startCallRecordingRequest.callLocator.kind = \"roomCallLocator\";\n startCallRecordingRequest.callLocator.roomId = options.callLocator.id;\n } else {\n startCallRecordingRequest.callLocator.kind = \"serverCallLocator\";\n startCallRecordingRequest.callLocator.serverCallId = options.callLocator.id;\n }\n\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const response = await this.callRecordingImpl.startRecording(\n startCallRecordingRequest,\n optionsInternal,\n );\n\n const result: RecordingStateResult = {\n recordingId: response.recordingId!,\n recordingKind: response.recordingKind!,\n recordingState: response.recordingState!,\n };\n\n return result;\n }\n\n /**\n * Returns call recording properties.\n * @param recordingId - The recordingId associated with the recording.\n * @param options - Additional request options contains getRecordingProperties api options.\n */\n public async getState(\n recordingId: string,\n options: GetRecordingPropertiesOptions = {},\n ): Promise<RecordingStateResult> {\n const response = await this.callRecordingImpl.getRecordingProperties(recordingId, options);\n\n const result: RecordingStateResult = {\n recordingId: response.recordingId!,\n recordingKind: response.recordingKind!,\n recordingState: response.recordingState!,\n };\n\n return result;\n }\n\n /**\n * Stops a call recording.\n * @param recordingId - The recordingId associated with the recording.\n * @param options - Additional request options contains stopRecording api options.\n */\n public async stop(recordingId: string, options: StopRecordingOptions = {}): Promise<void> {\n return this.callRecordingImpl.stopRecording(recordingId, options);\n }\n\n /**\n * Pauses a call recording.\n * @param recordingId - The recordingId associated with the recording.\n * @param options - Additional request options contains pauseRecording api options.\n */\n public async pause(recordingId: string, options: PauseRecordingOptions = {}): Promise<void> {\n return this.callRecordingImpl.pauseRecording(recordingId, options);\n }\n\n /**\n * Resumes a call recording.\n * @param recordingId - The recordingId associated with the recording.\n * @param options - Additional request options contains resumeRecording api options.\n */\n public async resume(recordingId: string, options: ResumeRecordingOptions = {}): Promise<void> {\n return this.callRecordingImpl.resumeRecording(recordingId, options);\n }\n\n /**\n * Deletes a recording.\n * @param recordingLocationUrl - The recording location url. Required.\n * @param options - Additional request options contains deleteRecording api options.\n */\n public async delete(\n recordingLocationUrl: string,\n options: DeleteRecordingOptions = {},\n ): Promise<void> {\n await this.contentDownloader.deleteRecording(recordingLocationUrl, options);\n }\n\n /**\n * Returns a stream with a call recording.\n * @param sourceLocationUrl - The source location url. Required.\n * @param options - Additional request options contains downloadRecording api options.\n */\n public async downloadStreaming(\n sourceLocationUrl: string,\n options: DownloadRecordingOptions = {},\n ): Promise<NodeJS.ReadableStream> {\n const result = this.contentDownloader.download(sourceLocationUrl, options);\n const recordingStream = (await result).readableStreamBody;\n if (recordingStream) {\n return recordingStream;\n } else {\n throw Error(\"failed to get stream\");\n }\n }\n\n /**\n * Downloads a call recording file to the specified stream.\n * @param sourceLocationUrl - The source location url. Required.\n * @param destinationStream - The destination stream. Required.\n * @param options - Additional request options contains downloadRecording api options.\n */\n public async downloadToStream(\n sourceLocationUrl: string,\n destinationStream: NodeJS.WritableStream,\n options: DownloadRecordingOptions = {},\n ): Promise<void> {\n const result = this.contentDownloader.download(sourceLocationUrl, options);\n const recordingStream = (await result).readableStreamBody;\n if (recordingStream) {\n recordingStream.pipe(destinationStream);\n const finish = new Promise<void>((resolve, reject) => {\n destinationStream.on(\"finish\", resolve);\n destinationStream.on(\"error\", reject);\n });\n await finish;\n } else {\n throw Error(\"failed to get stream\");\n }\n }\n\n /**\n * Downloads a call recording file to the specified path.\n * @param sourceLocationUrl - The source location url. Required.\n * @param destinationPath - The destination path. Required.\n * @param options - Additional request options contains downloadRecording api options.\n */\n public async downloadToPath(\n sourceLocationUrl: string,\n destinationPath: string,\n options: DownloadRecordingOptions = {},\n ): Promise<void> {\n const result = this.contentDownloader.download(sourceLocationUrl, options);\n const recordingStream = (await result).readableStreamBody;\n if (recordingStream) {\n const writeFileStream = fs.createWriteStream(destinationPath);\n recordingStream.pipe(writeFileStream);\n const finish = new Promise<void>((resolve, reject) => {\n writeFileStream.on(\"finish\", resolve);\n writeFileStream.on(\"error\", reject);\n });\n await finish;\n } else {\n throw Error(\"failed to get stream\");\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { CallAutomationApiClient } from "./generated/src/callAutomationApiClient.js";
|
|
2
|
+
import type { PipelineResponse } from "@azure/core-rest-pipeline";
|
|
3
|
+
import type { DeleteRecordingOptions, DownloadRecordingOptions } from "./models/options.js";
|
|
4
|
+
/** Class containing ContentDownloading operations. */
|
|
5
|
+
export declare class ContentDownloaderImpl {
|
|
6
|
+
private readonly client;
|
|
7
|
+
/**
|
|
8
|
+
* Initialize a new instance of the class ContentDownloader class.
|
|
9
|
+
* @param client - Reference to the service client
|
|
10
|
+
*/
|
|
11
|
+
constructor(client: CallAutomationApiClient);
|
|
12
|
+
private addCustomSignUrlPolicy;
|
|
13
|
+
/**
|
|
14
|
+
* Deletes a recording.
|
|
15
|
+
* @param deleteLocationUrl - The recording location url. Required.
|
|
16
|
+
*/
|
|
17
|
+
deleteRecording(deleteLocationUrl: string, options: DeleteRecordingOptions): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Returns a stream with a call recording.
|
|
20
|
+
* @param sourceLocationUrl - The source location url. Required.
|
|
21
|
+
* @param options - Additional request options contains downloadRecording options.
|
|
22
|
+
*/
|
|
23
|
+
download(sourceLocationUrl: string, options: DownloadRecordingOptions): Promise<PipelineResponse>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=contentDownloader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contentDownloader.d.ts","sourceRoot":"","sources":["../../src/contentDownloader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,KAAK,EAIV,gBAAgB,EAEjB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAE5F,sDAAsD;AACtD,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0B;IAEjD;;;OAGG;gBACS,MAAM,EAAE,uBAAuB;IAK3C,OAAO,CAAC,sBAAsB;IAkB9B;;;OAGG;IACG,eAAe,CAAC,iBAAiB,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IA+BhG;;;;OAIG;IACG,QAAQ,CACZ,iBAAiB,EAAE,MAAM,EACzB,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,gBAAgB,CAAC;CA0C7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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MAAA,GAAG,CAAC,OAAO,0CAAE,GAAG,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QAEvC,MAAM,GAAG,GAAG,qBAAqB,CAAC,GAAG,CAAC,CAAC;QAEvC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAEnD,IAAI,OAAO,CAAC,MAAM,KAAK,GAAG,IAAI,OAAO,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YACrD,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;gBACvB,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;gBAChD,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;YAC/D,CAAC;YACD,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;QACnC,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { CallAutomationApiClient } from \"./generated/src/callAutomationApiClient.js\";\nimport type {\n AddPipelineOptions,\n PipelineRequest,\n PipelineRequestOptions,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport { createHttpHeaders, createPipelineRequest } from \"@azure/core-rest-pipeline\";\nimport type { DeleteRecordingOptions, DownloadRecordingOptions } from \"./models/options.js\";\n\n/** Class containing ContentDownloading operations. */\nexport class ContentDownloaderImpl {\n private readonly client: CallAutomationApiClient;\n\n /**\n * Initialize a new instance of the class ContentDownloader class.\n * @param client - Reference to the service client\n */\n constructor(client: CallAutomationApiClient) {\n this.client = client;\n this.addCustomSignUrlPolicy();\n }\n\n private addCustomSignUrlPolicy(): void {\n const signUrlPolicy = {\n name: \"CustomSignUrlPolicy\",\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n if (request.headers.has(\"OriginalUrl\")) {\n request.url = `${request.headers.get(\"OriginalUrl\")}`;\n const originalRequest = new URL(request.url);\n request.headers.set(\"Host\", originalRequest.host);\n }\n return next(request);\n },\n };\n\n const pipelineOptions: AddPipelineOptions = {};\n pipelineOptions.afterPhase = \"Sign\";\n this.client.pipeline.addPolicy(signUrlPolicy, pipelineOptions);\n }\n\n /**\n * Deletes a recording.\n * @param deleteLocationUrl - The recording location url. Required.\n */\n async deleteRecording(deleteLocationUrl: string, options: DeleteRecordingOptions): Promise<void> {\n const fileLocation = new URL(deleteLocationUrl);\n const endpoint = new URL(this.client.endpoint);\n const modifiedUrlForSigning = endpoint.origin + fileLocation.pathname;\n\n const opt: PipelineRequestOptions = {\n url: modifiedUrlForSigning,\n method: \"DELETE\",\n headers: createHttpHeaders(),\n body: \"\",\n abortSignal: options?.abortSignal,\n tracingOptions: options?.tracingOptions,\n };\n\n opt.headers?.set(\"OriginalUrl\", deleteLocationUrl);\n opt.headers?.set(\"x-ms-host\", endpoint.host);\n opt.headers?.set(\"accept\", \"application/json\");\n\n const req = createPipelineRequest(opt);\n\n const results = await this.client.sendRequest(req);\n\n if (results.status !== 200) {\n if (results.bodyAsText) {\n const jsonBody = JSON.parse(results.bodyAsText);\n throw { status: jsonBody.status, message: jsonBody.message };\n }\n throw { status: results.status };\n }\n }\n\n /**\n * Returns a stream with a call recording.\n * @param sourceLocationUrl - The source location url. Required.\n * @param options - Additional request options contains downloadRecording options.\n */\n async download(\n sourceLocationUrl: string,\n options: DownloadRecordingOptions,\n ): Promise<PipelineResponse> {\n const fileLocation = new URL(sourceLocationUrl);\n const endpoint = new URL(this.client.endpoint);\n const modifiedUrlForSigning = endpoint.origin + fileLocation.pathname;\n\n const opt: PipelineRequestOptions = {\n url: modifiedUrlForSigning,\n method: \"GET\",\n headers: createHttpHeaders(),\n body: \"\",\n streamResponseStatusCodes: new Set([200, 206]),\n abortSignal: options.abortSignal,\n tracingOptions: options?.tracingOptions,\n };\n\n if (options.length && !options.offset) {\n throw Error(\"Download offset value must not be empty if length is set.\");\n } else if (options.length && options.offset) {\n options.length = options.offset + options.length - 1;\n }\n\n let rangeHeader = \"bytes=\" + options.offset;\n if (options.length) rangeHeader += \"-\" + options.length;\n\n opt.headers?.set(\"OriginalUrl\", sourceLocationUrl);\n opt.headers?.set(\"x-ms-host\", endpoint.host);\n opt.headers?.set(\"accept\", \"application/json\");\n opt.headers?.set(\"Range\", rangeHeader);\n\n const req = createPipelineRequest(opt);\n\n const results = await this.client.sendRequest(req);\n\n if (results.status !== 200 && results.status !== 206) {\n if (results.bodyAsText) {\n const jsonBody = JSON.parse(results.bodyAsText);\n throw { status: jsonBody.status, message: jsonBody.message };\n }\n throw { status: results.status };\n }\n return results;\n }\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PipelinePolicy } from "@azure/core-rest-pipeline";
|
|
2
|
+
import type { KeyCredential } from "@azure/core-auth";
|
|
3
|
+
/**
|
|
4
|
+
* Creates an HTTP pipeline policy to authenticate a request using a `KeyCredential`.
|
|
5
|
+
* @hidden
|
|
6
|
+
*
|
|
7
|
+
* @param credential - The key credential.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createCallAutomationAccessKeyCredentialPolicy(credential: KeyCredential, acsUrl: string): PipelinePolicy;
|
|
10
|
+
//# sourceMappingURL=callAutomationAccessKeyCredentialPolicy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callAutomationAccessKeyCredentialPolicy.d.ts","sourceRoot":"","sources":["../../../src/credential/callAutomationAccessKeyCredentialPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,cAAc,EAIf,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMtD;;;;;GAKG;AACH,wBAAgB,6CAA6C,CAC3D,UAAU,EAAE,aAAa,EACzB,MAAM,EAAE,MAAM,GACb,cAAc,CAiChB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
import { shaHMAC, shaHash } from "./cryptoUtils";
|
|
3
|
+
import { shaHMAC, shaHash } from "./cryptoUtils.js";
|
|
4
4
|
import { isNode } from "@azure/core-util";
|
|
5
5
|
const callAutomationAccessKeyCredentialPolicy = "CallAutomationAccessKeyCredentialPolicy";
|
|
6
6
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callAutomationAccessKeyCredentialPolicy.js","sourceRoot":"","sources":["../../../src/credential/callAutomationAccessKeyCredentialPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,uCAAuC,GAAG,yCAAyC,CAAC;AAE1F;;;;;GAKG;AACH,MAAM,UAAU,6CAA6C,CAC3D,UAAyB,EACzB,MAAc;IAEd,OAAO;QACL,IAAI,EAAE,uCAAuC;QAC7C,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;;YAC3D,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;YAC1C,MAAM,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;YACxC,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,CAAA,MAAA,OAAO,CAAC,IAAI,0CAAE,QAAQ,EAAE,KAAI,EAAE,CAAC,CAAC;YAClE,MAAM,UAAU,GAAG,WAAW,CAAC;YAC/B,MAAM,aAAa,GAAG,GAAG,UAAU,2BAA2B,CAAC;YAE/D,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;YACnC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;YAElD,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACjC,MAAM,KAAK,GAAG,GAAG,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;YAC1C,MAAM,eAAe,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,QAAQ,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC;YAE1E,MAAM,YAAY,GAAG,GAAG,IAAI,KAAK,eAAe,KAAK,MAAM,IAAI,UAAU,CAAC,IAAI,IAAI,WAAW,EAAE,CAAC;YAChG,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;YAE9D,IAAI,MAAM,EAAE,CAAC;gBACX,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;YAC9C,CAAC;YAED,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;YACxC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC;YACxD,OAAO,CAAC,OAAO,CAAC,GAAG,CACjB,eAAe,EACf,6BAA6B,aAAa,cAAc,SAAS,EAAE,CACpE,CAAC;YACF,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport type { KeyCredential } from \"@azure/core-auth\";\nimport { shaHMAC, shaHash } from \"./cryptoUtils.js\";\nimport { isNode } from \"@azure/core-util\";\n\nconst callAutomationAccessKeyCredentialPolicy = \"CallAutomationAccessKeyCredentialPolicy\";\n\n/**\n * Creates an HTTP pipeline policy to authenticate a request using a `KeyCredential`.\n * @hidden\n *\n * @param credential - The key credential.\n */\nexport function createCallAutomationAccessKeyCredentialPolicy(\n credential: KeyCredential,\n acsUrl: string,\n): PipelinePolicy {\n return {\n name: callAutomationAccessKeyCredentialPolicy,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n const verb = request.method.toUpperCase();\n const utcNow = new Date().toUTCString();\n const contentHash = await shaHash(request.body?.toString() || \"\");\n const dateHeader = \"x-ms-date\";\n const signedHeaders = `${dateHeader};host;x-ms-content-sha256`;\n\n const acsUrlCast = new URL(acsUrl);\n request.headers.set(\"x-ms-host\", acsUrlCast.host);\n\n const url = new URL(request.url);\n const query = url.searchParams.toString();\n const urlPathAndQuery = query ? `${url.pathname}?${query}` : url.pathname;\n\n const stringToSign = `${verb}\\n${urlPathAndQuery}\\n${utcNow};${acsUrlCast.host};${contentHash}`;\n const signature = await shaHMAC(credential.key, stringToSign);\n\n if (isNode) {\n request.headers.set(\"Host\", url.host || \"\");\n }\n\n request.headers.set(dateHeader, utcNow);\n request.headers.set(\"x-ms-content-sha256\", contentHash);\n request.headers.set(\n \"Authorization\",\n `HMAC-SHA256 SignedHeaders=${signedHeaders}&Signature=${signature}`,\n );\n return next(request);\n },\n };\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PipelinePolicy } from "@azure/core-rest-pipeline";
|
|
2
|
+
import type { KeyCredential, TokenCredential } from "@azure/core-auth";
|
|
3
|
+
import type { CallAutomationApiClientOptionalParams } from "./../generated/src/index.js";
|
|
4
|
+
import { CallAutomationApiClient } from "./../generated/src/index.js";
|
|
5
|
+
/**
|
|
6
|
+
* Creates a pipeline policy to authenticate request based
|
|
7
|
+
* on the credential passed in.
|
|
8
|
+
* @hidden
|
|
9
|
+
*
|
|
10
|
+
* @param credential - The KeyCredential or TokenCredential.
|
|
11
|
+
*/
|
|
12
|
+
export declare function createCallAutomationAuthPolicy(credential: KeyCredential | TokenCredential, acsUrl: string): PipelinePolicy;
|
|
13
|
+
/**
|
|
14
|
+
* Creates CallAutomationApiClient for custom endpoint
|
|
15
|
+
* @hidden
|
|
16
|
+
*
|
|
17
|
+
* @param credential - The KeyCredential or TokenCredential.
|
|
18
|
+
* @param internalPipelineOptions - CallAutomationApiClientOptionalParams if provided.
|
|
19
|
+
* @param url - ACS url.
|
|
20
|
+
*/
|
|
21
|
+
export declare function createCustomCallAutomationApiClient(credential: KeyCredential | TokenCredential, internalPipelineOptions: CallAutomationApiClientOptionalParams | undefined, url: string): CallAutomationApiClient;
|
|
22
|
+
//# sourceMappingURL=callAutomationAuthPolicy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callAutomationAuthPolicy.d.ts","sourceRoot":"","sources":["../../../src/credential/callAutomationAuthPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,cAAc,EACf,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGvE,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,aAAa,GAAG,eAAe,EAC3C,MAAM,EAAE,MAAM,GACb,cAAc,CAUhB;AAED;;;;;;;GAOG;AACH,wBAAgB,mCAAmC,CACjD,UAAU,EAAE,aAAa,GAAG,eAAe,EAC3C,uBAAuB,EAAE,qCAAqC,GAAG,SAAS,EAC1E,GAAG,EAAE,MAAM,GACV,uBAAuB,CAiBzB"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
import { bearerTokenAuthenticationPolicy } from "@azure/core-rest-pipeline";
|
|
4
4
|
import { isTokenCredential } from "@azure/core-auth";
|
|
5
|
-
import { createCallAutomationAccessKeyCredentialPolicy } from "./callAutomationAccessKeyCredentialPolicy";
|
|
6
|
-
import { CallAutomationApiClient } from "./../generated/src";
|
|
5
|
+
import { createCallAutomationAccessKeyCredentialPolicy } from "./callAutomationAccessKeyCredentialPolicy.js";
|
|
6
|
+
import { CallAutomationApiClient } from "./../generated/src/index.js";
|
|
7
7
|
import { createCommunicationAuthPolicy } from "@azure/communication-common";
|
|
8
8
|
/**
|
|
9
9
|
* Creates a pipeline policy to authenticate request based
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callAutomationAuthPolicy.js","sourceRoot":"","sources":["../../../src/credential/callAutomationAuthPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AAE5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,6CAA6C,EAAE,MAAM,8CAA8C,CAAC;AAE7G,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E;;;;;;GAMG;AACH,MAAM,UAAU,8BAA8B,CAC5C,UAA2C,EAC3C,MAAc;IAEd,IAAI,iBAAiB,CAAC,UAAU,CAAC,EAAE,CAAC;QAClC,MAAM,aAAa,GAA2C;YAC5D,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE,CAAC,2CAA2C,CAAC;SACtD,CAAC;QACF,OAAO,+BAA+B,CAAC,aAAa,CAAC,CAAC;IACxD,CAAC;SAAM,CAAC;QACN,OAAO,6CAA6C,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAC3E,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mCAAmC,CACjD,UAA2C,EAC3C,uBAA0E,EAC1E,GAAW;IAEX,oDAAoD;IACpD,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC;IACxE,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC;IACvD,IAAI,uBAAgD,CAAC;IAErD,IAAI,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,WAAW,EAAE,MAAK,MAAM,IAAI,SAAS,EAAE,CAAC;QACzD,+DAA+D;QAC/D,uBAAuB,GAAG,IAAI,uBAAuB,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC;QAC1F,MAAM,wBAAwB,GAAG,8BAA8B,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;QACjF,uBAAuB,CAAC,QAAQ,CAAC,SAAS,CAAC,wBAAwB,CAAC,CAAC;IACvE,CAAC;SAAM,CAAC;QACN,uBAAuB,GAAG,IAAI,uBAAuB,CAAC,GAAG,EAAE,uBAAuB,CAAC,CAAC;QACpF,MAAM,UAAU,GAAG,6BAA6B,CAAC,UAAU,CAAC,CAAC;QAC7D,uBAAuB,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,uBAAuB,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n BearerTokenAuthenticationPolicyOptions,\n PipelinePolicy,\n} from \"@azure/core-rest-pipeline\";\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport { createCallAutomationAccessKeyCredentialPolicy } from \"./callAutomationAccessKeyCredentialPolicy.js\";\nimport type { CallAutomationApiClientOptionalParams } from \"./../generated/src/index.js\";\nimport { CallAutomationApiClient } from \"./../generated/src/index.js\";\nimport { createCommunicationAuthPolicy } from \"@azure/communication-common\";\n/**\n * Creates a pipeline policy to authenticate request based\n * on the credential passed in.\n * @hidden\n *\n * @param credential - The KeyCredential or TokenCredential.\n */\nexport function createCallAutomationAuthPolicy(\n credential: KeyCredential | TokenCredential,\n acsUrl: string,\n): PipelinePolicy {\n if (isTokenCredential(credential)) {\n const policyOptions: BearerTokenAuthenticationPolicyOptions = {\n credential: credential,\n scopes: [\"https://communication.azure.com//.default\"],\n };\n return bearerTokenAuthenticationPolicy(policyOptions);\n } else {\n return createCallAutomationAccessKeyCredentialPolicy(credential, acsUrl);\n }\n}\n\n/**\n * Creates CallAutomationApiClient for custom endpoint\n * @hidden\n *\n * @param credential - The KeyCredential or TokenCredential.\n * @param internalPipelineOptions - CallAutomationApiClientOptionalParams if provided.\n * @param url - ACS url.\n */\nexport function createCustomCallAutomationApiClient(\n credential: KeyCredential | TokenCredential,\n internalPipelineOptions: CallAutomationApiClientOptionalParams | undefined,\n url: string,\n): CallAutomationApiClient {\n // read environment variable for callAutomation auth\n const customEnabled = process.env.COMMUNICATION_CUSTOM_ENDPOINT_ENABLED;\n const customUrl = process.env.COMMUNICATION_CUSTOM_URL;\n let callAutomationApiClient: CallAutomationApiClient;\n\n if (customEnabled?.toLowerCase() === \"true\" && customUrl) {\n // add custom header for Call Automation auth when flag is true\n callAutomationApiClient = new CallAutomationApiClient(customUrl, internalPipelineOptions);\n const callAutomationAuthPolicy = createCallAutomationAuthPolicy(credential, url);\n callAutomationApiClient.pipeline.addPolicy(callAutomationAuthPolicy);\n } else {\n callAutomationApiClient = new CallAutomationApiClient(url, internalPipelineOptions);\n const authPolicy = createCommunicationAuthPolicy(credential);\n callAutomationApiClient.pipeline.addPolicy(authPolicy);\n }\n return callAutomationApiClient;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cryptoUtils-browser.d.mts","sourceRoot":"","sources":["../../../src/credential/cryptoUtils-browser.mts"],"names":[],"mappings":"AASA,eAAO,MAAM,OAAO,YAAmB,MAAM,KAAG,OAAO,CAAC,MAAM,CAI7D,CAAC;AAEF,eAA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S,EAAE,cAAc,CAAC,CAAC;IAC7E,OAAO,YAAY,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/// <reference lib=\"dom\" />\n\nimport { encodeBase64, encodeUTF8, encodeUTF8fromBase64 } from \"./encodeUtils.browser.js\";\n\nconst subtle = (globalThis as any)?.crypto?.subtle as SubtleCrypto;\n\nexport const shaHash = async (content: string): Promise<string> => {\n const data = encodeUTF8(content);\n const hash = await subtle.digest(\"SHA-256\", data);\n return encodeBase64(hash);\n};\n\nexport const shaHMAC = async (secret: string, content: string): Promise<string> => {\n const importParams: HmacImportParams = { name: \"HMAC\", hash: { name: \"SHA-256\" } };\n const encodedMessage = encodeUTF8(content);\n const encodedKey = encodeUTF8fromBase64(secret);\n const crypto = subtle;\n const cryptoKey = await crypto.importKey(\"raw\", encodedKey, importParams, false, [\"sign\"]);\n const signature = await crypto.sign(importParams, cryptoKey, encodedMessage);\n return encodeBase64(signature);\n};\n"]}
|
package/{dist-esm/src/credential/cryptoUtils.browser.js → dist/browser/credential/cryptoUtils.js}
RENAMED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
var _a;
|
|
4
4
|
/// <reference lib="dom" />
|
|
5
|
-
import { encodeBase64, encodeUTF8, encodeUTF8fromBase64 } from "./encodeUtils.browser";
|
|
5
|
+
import { encodeBase64, encodeUTF8, encodeUTF8fromBase64 } from "./encodeUtils.browser.js";
|
|
6
6
|
const subtle = (_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.crypto) === null || _a === void 0 ? void 0 : _a.subtle;
|
|
7
7
|
export const shaHash = async (content) => {
|
|
8
8
|
const data = encodeUTF8(content);
|
|
@@ -18,4 +18,4 @@ export const shaHMAC = async (secret, content) => {
|
|
|
18
18
|
const signature = await crypto.sign(importParams, cryptoKey, encodedMessage);
|
|
19
19
|
return encodeBase64(signature);
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=cryptoUtils
|
|
21
|
+
//# sourceMappingURL=cryptoUtils-browser.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encodeUtils.browser.d.ts","sourceRoot":"","sources":["../../../src/credential/encodeUtils.browser.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,QAAS,MAAM,KAAG,UAA2C,CAAC;AAErF,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAU5D;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAUvD"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as coreClient from "@azure/core-client";
|
|
2
|
+
import { CallConnection, CallMedia, CallRecording } from "./operationsInterfaces/index.js";
|
|
3
|
+
import { CallAutomationApiClientOptionalParams, CreateCallRequest, CreateCallOptionalParams, CreateCallResponse, AnswerCallRequest, AnswerCallOptionalParams, AnswerCallResponse, RedirectCallRequest, RedirectCallOptionalParams, RejectCallRequest, RejectCallOptionalParams, ConnectRequest, ConnectOptionalParams, ConnectResponse } from "./models/index.js";
|
|
4
|
+
export declare class CallAutomationApiClient extends coreClient.ServiceClient {
|
|
5
|
+
endpoint: string;
|
|
6
|
+
apiVersion: string;
|
|
7
|
+
/**
|
|
8
|
+
* Initializes a new instance of the CallAutomationApiClient class.
|
|
9
|
+
* @param endpoint The endpoint of the Azure Communication resource.
|
|
10
|
+
* @param options The parameter options
|
|
11
|
+
*/
|
|
12
|
+
constructor(endpoint: string, options?: CallAutomationApiClientOptionalParams);
|
|
13
|
+
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
|
|
14
|
+
private addCustomApiVersionPolicy;
|
|
15
|
+
/**
|
|
16
|
+
* Create an outbound call.
|
|
17
|
+
* @param createCallRequest The create call request.
|
|
18
|
+
* @param options The options parameters.
|
|
19
|
+
*/
|
|
20
|
+
createCall(createCallRequest: CreateCallRequest, options?: CreateCallOptionalParams): Promise<CreateCallResponse>;
|
|
21
|
+
/**
|
|
22
|
+
* Answer a call using the IncomingCallContext from Event Grid.
|
|
23
|
+
* @param answerCallRequest The answer call request.
|
|
24
|
+
* @param options The options parameters.
|
|
25
|
+
*/
|
|
26
|
+
answerCall(answerCallRequest: AnswerCallRequest, options?: AnswerCallOptionalParams): Promise<AnswerCallResponse>;
|
|
27
|
+
/**
|
|
28
|
+
* Redirect a call.
|
|
29
|
+
* @param redirectCallRequest The redirect call request.
|
|
30
|
+
* @param options The options parameters.
|
|
31
|
+
*/
|
|
32
|
+
redirectCall(redirectCallRequest: RedirectCallRequest, options?: RedirectCallOptionalParams): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Reject the call.
|
|
35
|
+
* @param rejectCallRequest The reject call request.
|
|
36
|
+
* @param options The options parameters.
|
|
37
|
+
*/
|
|
38
|
+
rejectCall(rejectCallRequest: RejectCallRequest, options?: RejectCallOptionalParams): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Create a connection to a CallLocator.
|
|
41
|
+
* @param connectRequest The create connection request.
|
|
42
|
+
* @param options The options parameters.
|
|
43
|
+
*/
|
|
44
|
+
connect(connectRequest: ConnectRequest, options?: ConnectOptionalParams): Promise<ConnectResponse>;
|
|
45
|
+
callConnection: CallConnection;
|
|
46
|
+
callMedia: CallMedia;
|
|
47
|
+
callRecording: CallRecording;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=callAutomationApiClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callAutomationApiClient.d.ts","sourceRoot":"","sources":["../../../../src/generated/src/callAutomationApiClient.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAWjD,OAAO,EACL,cAAc,EACd,SAAS,EACT,aAAa,EACd,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EACL,qCAAqC,EACrC,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,EAClB,mBAAmB,EACnB,0BAA0B,EAC1B,iBAAiB,EACjB,wBAAwB,EACxB,cAAc,EACd,qBAAqB,EACrB,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAE3B,qBAAa,uBAAwB,SAAQ,UAAU,CAAC,aAAa;IACnE,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;gBAED,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,qCAAqC;IAwCjD,8GAA8G;IAC9G,OAAO,CAAC,yBAAyB;IA2BjC;;;;OAIG;IACH,UAAU,CACR,iBAAiB,EAAE,iBAAiB,EACpC,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,kBAAkB,CAAC;IAO9B;;;;OAIG;IACH,UAAU,CACR,iBAAiB,EAAE,iBAAiB,EACpC,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,kBAAkB,CAAC;IAO9B;;;;OAIG;IACH,YAAY,CACV,mBAAmB,EAAE,mBAAmB,EACxC,OAAO,CAAC,EAAE,0BAA0B,GACnC,OAAO,CAAC,IAAI,CAAC;IAOhB;;;;OAIG;IACH,UAAU,CACR,iBAAiB,EAAE,iBAAiB,EACpC,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,IAAI,CAAC;IAOhB;;;;OAIG;IACH,OAAO,CACL,cAAc,EAAE,cAAc,EAC9B,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,eAAe,CAAC;IAO3B,cAAc,EAAE,cAAc,CAAC;IAC/B,SAAS,EAAE,SAAS,CAAC;IACrB,aAAa,EAAE,aAAa,CAAC;CAC9B"}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
8
|
import * as coreClient from "@azure/core-client";
|
|
9
|
-
import { CallConnectionImpl, CallMediaImpl, CallRecordingImpl, } from "./operations";
|
|
10
|
-
import * as Parameters from "./models/parameters";
|
|
11
|
-
import * as Mappers from "./models/mappers";
|
|
9
|
+
import { CallConnectionImpl, CallMediaImpl, CallRecordingImpl, } from "./operations/index.js";
|
|
10
|
+
import * as Parameters from "./models/parameters.js";
|
|
11
|
+
import * as Mappers from "./models/mappers.js";
|
|
12
12
|
export class CallAutomationApiClient extends coreClient.ServiceClient {
|
|
13
13
|
/**
|
|
14
14
|
* Initializes a new instance of the CallAutomationApiClient class.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callAutomationApiClient.js","sourceRoot":"","sources":["../../../../src/generated/src/callAutomationApiClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAMjD,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAM/B,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAkB/C,MAAM,OAAO,uBAAwB,SAAQ,UAAU,CAAC,aAAa;IAInE;;;;OAIG;IACH,YACE,QAAgB,EAChB,OAA+C;;QAE/C,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAC/C,CAAC;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM,QAAQ,GAA0C;YACtD,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,8CAA8C,CAAC;QACtE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAA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IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,gBAAgB,EAAE;QAChB,UAAU,CAAC,WAAW;QACtB,UAAU,CAAC,MAAM;QACjB,UAAU,CAAC,sBAAsB;QACjC,UAAU,CAAC,sBAAsB;KAClC;IACD,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport {\n CallConnectionImpl,\n CallMediaImpl,\n CallRecordingImpl,\n} from \"./operations/index.js\";\nimport {\n CallConnection,\n CallMedia,\n CallRecording,\n} from \"./operationsInterfaces/index.js\";\nimport * as Parameters from \"./models/parameters.js\";\nimport * as Mappers from \"./models/mappers.js\";\nimport {\n CallAutomationApiClientOptionalParams,\n CreateCallRequest,\n CreateCallOptionalParams,\n CreateCallResponse,\n AnswerCallRequest,\n AnswerCallOptionalParams,\n AnswerCallResponse,\n RedirectCallRequest,\n RedirectCallOptionalParams,\n RejectCallRequest,\n RejectCallOptionalParams,\n ConnectRequest,\n ConnectOptionalParams,\n ConnectResponse,\n} from \"./models/index.js\";\n\nexport class CallAutomationApiClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the CallAutomationApiClient class.\n * @param endpoint The endpoint of the Azure Communication resource.\n * @param options The parameter options\n */\n constructor(\n endpoint: string,\n options?: CallAutomationApiClientOptionalParams,\n ) {\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: CallAutomationApiClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n };\n\n const packageDetails = `azsdk-js-communication-call-automation/1.3.0`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n endpoint: options.endpoint ?? options.baseUri ?? \"{endpoint}\",\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2024-09-15\";\n this.callConnection = new CallConnectionImpl(this);\n this.callMedia = new CallMediaImpl(this);\n this.callRecording = new CallRecordingImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(\n request: PipelineRequest,\n next: SendRequest,\n ): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n },\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n /**\n * Create an outbound call.\n * @param createCallRequest The create call request.\n * @param options The options parameters.\n */\n createCall(\n createCallRequest: CreateCallRequest,\n options?: CreateCallOptionalParams,\n ): Promise<CreateCallResponse> {\n return this.sendOperationRequest(\n { createCallRequest, options },\n createCallOperationSpec,\n );\n }\n\n /**\n * Answer a call using the IncomingCallContext from Event Grid.\n * @param answerCallRequest The answer call request.\n * @param options The options parameters.\n */\n answerCall(\n answerCallRequest: AnswerCallRequest,\n options?: AnswerCallOptionalParams,\n ): Promise<AnswerCallResponse> {\n return this.sendOperationRequest(\n { answerCallRequest, options },\n answerCallOperationSpec,\n );\n }\n\n /**\n * Redirect a call.\n * @param redirectCallRequest The redirect call request.\n * @param options The options parameters.\n */\n redirectCall(\n redirectCallRequest: RedirectCallRequest,\n options?: RedirectCallOptionalParams,\n ): Promise<void> {\n return this.sendOperationRequest(\n { redirectCallRequest, options },\n redirectCallOperationSpec,\n );\n }\n\n /**\n * Reject the call.\n * @param rejectCallRequest The reject call request.\n * @param options The options parameters.\n */\n rejectCall(\n rejectCallRequest: RejectCallRequest,\n options?: RejectCallOptionalParams,\n ): Promise<void> {\n return this.sendOperationRequest(\n { rejectCallRequest, options },\n rejectCallOperationSpec,\n );\n }\n\n /**\n * Create a connection to a CallLocator.\n * @param connectRequest The create connection request.\n * @param options The options parameters.\n */\n connect(\n connectRequest: ConnectRequest,\n options?: ConnectOptionalParams,\n ): Promise<ConnectResponse> {\n return this.sendOperationRequest(\n { connectRequest, options },\n connectOperationSpec,\n );\n }\n\n callConnection: CallConnection;\n callMedia: CallMedia;\n callRecording: CallRecording;\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst createCallOperationSpec: coreClient.OperationSpec = {\n path: \"/calling/callConnections\",\n httpMethod: \"POST\",\n responses: {\n 201: {\n bodyMapper: Mappers.CallConnectionPropertiesInternal,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: Parameters.createCallRequest,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [\n Parameters.contentType,\n Parameters.accept,\n Parameters.repeatabilityRequestID,\n Parameters.repeatabilityFirstSent,\n ],\n mediaType: \"json\",\n serializer,\n};\nconst answerCallOperationSpec: coreClient.OperationSpec = {\n path: \"/calling/callConnections:answer\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CallConnectionPropertiesInternal,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: Parameters.answerCallRequest,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [\n Parameters.contentType,\n Parameters.accept,\n Parameters.repeatabilityRequestID,\n Parameters.repeatabilityFirstSent,\n ],\n mediaType: \"json\",\n serializer,\n};\nconst redirectCallOperationSpec: coreClient.OperationSpec = {\n path: \"/calling/callConnections:redirect\",\n httpMethod: \"POST\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: Parameters.redirectCallRequest,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [\n Parameters.contentType,\n Parameters.accept,\n Parameters.repeatabilityRequestID,\n Parameters.repeatabilityFirstSent,\n ],\n mediaType: \"json\",\n serializer,\n};\nconst rejectCallOperationSpec: coreClient.OperationSpec = {\n path: \"/calling/callConnections:reject\",\n httpMethod: \"POST\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: Parameters.rejectCallRequest,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [\n Parameters.contentType,\n Parameters.accept,\n Parameters.repeatabilityRequestID,\n Parameters.repeatabilityFirstSent,\n ],\n mediaType: \"json\",\n serializer,\n};\nconst connectOperationSpec: coreClient.OperationSpec = {\n path: \"/calling/callConnections:connect\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CallConnectionPropertiesInternal,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: Parameters.connectRequest,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [\n Parameters.contentType,\n Parameters.accept,\n Parameters.repeatabilityRequestID,\n Parameters.repeatabilityFirstSent,\n ],\n mediaType: \"json\",\n serializer,\n};\n"]}
|