From 142839097d4051a0ce039db40e7b0860c6c815ff Mon Sep 17 00:00:00 2001 From: Arif Ibrahim Mohamed Date: Tue, 26 Apr 2022 14:45:47 -0700 Subject: [PATCH] Feature/sms core v2 and test recoder migration (#21328) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * sms core v2 migration changes * fixed build issue * unit test fixes * record test mode fix * recording updated * migrated to new test recorder version * Make the tests pass (#2) format and test fixes * recording update & code owner update * analyzer fix * update code owner for sms Co-authored-by: Petr Švihlík --- .github/CODEOWNERS | 4 +- common/config/rush/pnpm-lock.yaml | 6 +- .../communication-sms/CHANGELOG.md | 4 +- .../communication-sms/karma.conf.js | 27 +-- .../communication-sms/package.json | 27 ++- .../recording_can_send_an_sms_message.json | 71 ++++++- ...an_sms_message_to_multiple_recipients.json | 82 ++++++- ...an_sms_message_with_options_passed_in.json | 72 ++++++- ..._new_message_each_time_send_is_called.json | 133 +++++++++++- ...en_sending_from_a_number_you_dont_own.json | 67 +++++- ...n_when_sending_from_an_invalid_number.json | 65 +++++- .../recording_can_send_an_sms_message.json | 73 ++++++- ...an_sms_message_to_multiple_recipients.json | 84 +++++++- ...an_sms_message_with_options_passed_in.json | 74 ++++++- ..._new_message_each_time_send_is_called.json | 137 +++++++++++- ...en_sending_from_a_number_you_dont_own.json | 69 +++++- ...n_when_sending_from_an_invalid_number.json | 67 +++++- .../recording_can_send_an_sms_message.json | 117 +++++----- ...an_sms_message_to_multiple_recipients.json | 128 ++++++----- ...an_sms_message_with_options_passed_in.json | 118 ++++++----- ..._new_message_each_time_send_is_called.json | 200 +++++++++++------- ...en_sending_from_a_number_you_dont_own.json | 113 +++++----- ...n_when_sending_from_an_invalid_number.json | 110 +++++----- .../recording_can_send_an_sms_message.json | 94 +++++--- ...an_sms_message_to_multiple_recipients.json | 105 ++++++--- ...an_sms_message_with_options_passed_in.json | 95 ++++++--- ..._new_message_each_time_send_is_called.json | 178 +++++++++++----- ...en_sending_from_a_number_you_dont_own.json | 90 +++++--- ...n_when_sending_from_an_invalid_number.json | 87 +++++--- .../recording_can_send_an_sms_message.js | 5 - .../recording_can_send_an_sms_message.json | 56 +++++ ...d_an_sms_message_to_multiple_recipients.js | 5 - ...an_sms_message_to_multiple_recipients.json | 67 ++++++ ...d_an_sms_message_with_options_passed_in.js | 5 - ...an_sms_message_with_options_passed_in.json | 57 +++++ ..._a_new_message_each_time_send_is_called.js | 5 - ..._new_message_each_time_send_is_called.json | 109 ++++++++++ ...when_sending_from_a_number_you_dont_own.js | 5 - ...en_sending_from_a_number_you_dont_own.json | 52 +++++ ...ion_when_sending_from_an_invalid_number.js | 5 - ...n_when_sending_from_an_invalid_number.json | 50 +++++ .../recording_can_send_an_sms_message.js | 5 - .../recording_can_send_an_sms_message.json | 58 +++++ ...d_an_sms_message_to_multiple_recipients.js | 5 - ...an_sms_message_to_multiple_recipients.json | 69 ++++++ ...d_an_sms_message_with_options_passed_in.js | 5 - ...an_sms_message_with_options_passed_in.json | 59 ++++++ ..._a_new_message_each_time_send_is_called.js | 5 - ..._new_message_each_time_send_is_called.json | 113 ++++++++++ ...when_sending_from_a_number_you_dont_own.js | 5 - ...en_sending_from_a_number_you_dont_own.json | 54 +++++ ...ion_when_sending_from_an_invalid_number.js | 5 - ...n_when_sending_from_an_invalid_number.json | 52 +++++ .../recording_can_send_an_sms_message.js | 135 ------------ .../recording_can_send_an_sms_message.json | 56 +++++ ...d_an_sms_message_to_multiple_recipients.js | 135 ------------ ...an_sms_message_to_multiple_recipients.json | 67 ++++++ ...d_an_sms_message_with_options_passed_in.js | 135 ------------ ...an_sms_message_with_options_passed_in.json | 57 +++++ ..._a_new_message_each_time_send_is_called.js | 159 -------------- ..._new_message_each_time_send_is_called.json | 109 ++++++++++ ...when_sending_from_a_number_you_dont_own.js | 133 ------------ ...en_sending_from_a_number_you_dont_own.json | 52 +++++ ...ion_when_sending_from_an_invalid_number.js | 133 ------------ ...n_when_sending_from_an_invalid_number.json | 50 +++++ .../recording_can_send_an_sms_message.js | 27 --- .../recording_can_send_an_sms_message.json | 58 +++++ ...d_an_sms_message_to_multiple_recipients.js | 27 --- ...an_sms_message_to_multiple_recipients.json | 69 ++++++ ...d_an_sms_message_with_options_passed_in.js | 27 --- ...an_sms_message_with_options_passed_in.json | 59 ++++++ ..._a_new_message_each_time_send_is_called.js | 49 ----- ..._new_message_each_time_send_is_called.json | 113 ++++++++++ ...when_sending_from_a_number_you_dont_own.js | 25 --- ...en_sending_from_a_number_you_dont_own.json | 54 +++++ ...ion_when_sending_from_an_invalid_number.js | 25 --- ...n_when_sending_from_an_invalid_number.json | 52 +++++ .../recording_can_send_an_sms_message.js | 5 - ...d_an_sms_message_to_multiple_recipients.js | 5 - ...d_an_sms_message_with_options_passed_in.js | 5 - ..._a_new_message_each_time_send_is_called.js | 5 - ...when_sending_from_a_number_you_dont_own.js | 5 - ...ion_when_sending_from_an_invalid_number.js | 5 - .../recording_can_send_an_sms_message.js | 60 ------ ...d_an_sms_message_to_multiple_recipients.js | 60 ------ ...d_an_sms_message_with_options_passed_in.js | 60 ------ ..._a_new_message_each_time_send_is_called.js | 82 ------- ...when_sending_from_a_number_you_dont_own.js | 58 ----- ...ion_when_sending_from_an_invalid_number.js | 58 ----- .../review/communication-sms.api.md | 6 +- .../samples-dev/usingAadAuth.ts | 2 +- .../communication-sms/src/constants.ts | 2 +- .../src/extractOperationOptions.ts | 11 +- .../src/generated/src/index.ts | 12 ++ .../src/generated/src/models/index.ts | 133 ++++-------- .../src/generated/src/models/mappers.ts | 24 ++- .../src/generated/src/models/parameters.ts | 14 +- .../src/generated/src/operations/sms.ts | 37 ++-- .../src/operationsInterfaces/index.ts | 9 + .../generated/src/operationsInterfaces/sms.ts | 26 +++ .../src/generated/src/smsApiClient.ts | 21 +- .../src/generated/src/smsApiClientContext.ts | 38 ++-- .../communication-sms/src/smsClient.ts | 33 +-- .../communication-sms/src/utils/uuid.ts | 10 +- .../communication-sms/swagger/README.md | 6 +- .../smsClient.internal.mocked.spec.ts | 6 +- .../test/internal/smsClient.internal.spec.ts | 24 +-- .../test/public/smsClient.mocked.spec.ts | 8 +- .../test/public/smsClient.spec.ts | 42 ++-- .../test/public/utils/mockHttpClient.ts | 15 +- .../test/public/utils/recordedClient.ts | 170 ++++++++------- 111 files changed, 3774 insertions(+), 2442 deletions(-) delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message.js create mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message.json delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.js create mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.json delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.js create mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.json delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_sends_a_new_message_each_time_send_is_called.js create mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_sends_a_new_message_each_time_send_is_called.json delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.js create mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.js create mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.json delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_can_send_an_sms_message.js create mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_can_send_an_sms_message.json delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.js create mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.json delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.js create mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.json delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_sends_a_new_message_each_time_send_is_called.js create mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_sends_a_new_message_each_time_send_is_called.json delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.js create mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.js create mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.json delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message.js create mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message.json delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.js create mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.json delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.js create mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.json delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.js create mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.json delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.js create mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.js create mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.json delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message.js create mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message.json delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.js create mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.json delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.js create mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.json delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.js create mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.json delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.js create mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.js create mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.json delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_live_test_send_method/recording_can_send_an_sms_message.js delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_live_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.js delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_live_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.js delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_live_test_send_method/recording_sends_a_new_message_each_time_send_is_called.js delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_live_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.js delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_live_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.js delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_playbackrecord_when_sending_sms/recording_can_send_an_sms_message.js delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.js delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.js delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_playbackrecord_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.js delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.js delete mode 100644 sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.js create mode 100644 sdk/communication/communication-sms/src/generated/src/index.ts create mode 100644 sdk/communication/communication-sms/src/generated/src/operationsInterfaces/index.ts create mode 100644 sdk/communication/communication-sms/src/generated/src/operationsInterfaces/sms.ts diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4beeee4fbf27..f09a0e7d1992 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -53,10 +53,10 @@ /sdk/communication/communication-network-traversal/ @AriZavala2 # PRLabel: %Communication - SMS -/sdk/communication/communication-sms/ @arifibrahim4 @RoyHerrod +/sdk/communication/communication-sms/ @DimaKolomiiets # PRLabel: %Communication - Short Codes -/sdk/communication/communication-short-codes/ @danielav7 @AlonsoMondal +/sdk/communication/communication-short-codes/ @danielav7 # PRLabel: %Communication - Common /sdk/communication/communication-common/ @petrsvihlik @AikoBB @maximrytych-ms @martinbarnas-ms diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 73fc5751e1dd..e9cd8095d9ca 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -13855,7 +13855,7 @@ packages: dev: false file:projects/communication-chat.tgz: - resolution: {integrity: sha512-FqxHOpHgvyJ+4HOwbd46Dnvs0GLTHf2yn8GXEM+q7A+SdJlVRoSFkc0p+778/j5MjMec4wUI8o9vjwqo4NpSqg==, tarball: file:projects/communication-chat.tgz} + resolution: {integrity: sha512-F2p5XwoV7jQhN9ZEN8CJLDdTq1UBXLM0Ch9Ciz0KgJIsHFEnC6gts26YWXpJnvqligsIbdgdSoEGQSGxEEcfAA==, tarball: file:projects/communication-chat.tgz} name: '@rush-temp/communication-chat' version: 0.0.0 dependencies: @@ -14151,7 +14151,7 @@ packages: dev: false file:projects/communication-sms.tgz: - resolution: {integrity: sha512-feFwthEJpuCEmaBYXcFqYkKQ4HMJue9RVMsw+Tp6zdk+qpy6T521Dq++3mlXX4xZEfAFYZpuyHX2icTz78ABXA==, tarball: file:projects/communication-sms.tgz} + resolution: {integrity: sha512-FLvHt8YCR95J93gFFd+J0Q6yX1RQMrjeteihyIWNmdk/tukSYrqDAWOlTgvJtPFc9Rw5wVPPkvhkY7GtEjz7xQ==, tarball: file:projects/communication-sms.tgz} name: '@rush-temp/communication-sms' version: 0.0.0 dependencies: @@ -14164,6 +14164,7 @@ packages: '@types/mocha': 7.0.2 '@types/node': 12.20.47 '@types/sinon': 9.0.11 + '@types/uuid': 8.3.4 chai: 4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 @@ -14190,6 +14191,7 @@ packages: tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 + uuid: 8.3.2 transitivePeerDependencies: - bufferutil - debug diff --git a/sdk/communication/communication-sms/CHANGELOG.md b/sdk/communication/communication-sms/CHANGELOG.md index 160d031041be..76d440900e65 100644 --- a/sdk/communication/communication-sms/CHANGELOG.md +++ b/sdk/communication/communication-sms/CHANGELOG.md @@ -1,9 +1,11 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.2.0-beta.1 (Unreleased) ### Features Added +- Migrated from using `@azure/core-http` to `@azure/core-rest-pipeline` for the handling of HTTP requests. See [Azure Core v1 vs v2](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-rest-pipeline/documentation/core2.md) for more on the difference and benefits of the move. + ### Breaking Changes ### Bugs Fixed diff --git a/sdk/communication/communication-sms/karma.conf.js b/sdk/communication/communication-sms/karma.conf.js index b83b8d335cba..27981e6ca282 100644 --- a/sdk/communication/communication-sms/karma.conf.js +++ b/sdk/communication/communication-sms/karma.conf.js @@ -1,12 +1,9 @@ // https://github.com/karma-runner/karma-chrome-launcher process.env.CHROME_BIN = require("puppeteer").executablePath(); require("dotenv").config(); -const { - jsonRecordingFilterFunction, - isPlaybackMode, - isSoftRecordMode, - isRecordMode, -} = require("@azure-tools/test-recorder"); +const { relativeRecordingsPath } = require("@azure-tools/test-recorder"); + +process.env.RECORDINGS_RELATIVE_PATH = relativeRecordingsPath(); module.exports = function (config) { config.set({ @@ -28,14 +25,10 @@ module.exports = function (config) { "karma-coverage", "karma-sourcemap-loader", "karma-junit-reporter", - "karma-json-to-file-reporter", - "karma-json-preprocessor", ], // list of files / patterns to load in the browser - files: ["dist-test/index.browser.js"].concat( - isPlaybackMode() || isSoftRecordMode() ? ["recordings/browsers/**/*.json"] : [] - ), + files: ["dist-test/index.browser.js"], // list of files / patterns to exclude exclude: [], @@ -44,7 +37,6 @@ module.exports = function (config) { // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { "**/*.js": ["sourcemap", "env"], - "recordings/browsers/**/*.json": ["json"], // IMPORTANT: COMMENT following line if you want to debug in your browsers!! // Preprocess source file to calculate code coverage, however this will make source file unreadable // "dist-test/index.browser.js": ["coverage"] @@ -61,12 +53,13 @@ module.exports = function (config) { "AZURE_CLIENT_SECRET", "AZURE_TENANT_ID", "COMMUNICATION_SKIP_INT_SMS_TEST", + "RECORDINGS_RELATIVE_PATH", ], // test results reporter to use // possible values: 'dots', 'progress' // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ["mocha", "coverage", "junit", "json-to-file"], + reporters: ["mocha", "coverage", "junit"], coverageReporter: { // specify a common output directory @@ -89,11 +82,6 @@ module.exports = function (config) { properties: {}, // key value pair of properties to add to the section of the report }, - jsonToFileReporter: { - filter: jsonRecordingFilterFunction, - outputPath: ".", - }, - // web server port port: 9876, @@ -130,9 +118,6 @@ module.exports = function (config) { browserNoActivityTimeout: 600000, browserDisconnectTimeout: 10000, browserDisconnectTolerance: 3, - browserConsoleLogOptions: { - terminal: !isRecordMode(), - }, client: { mocha: { diff --git a/sdk/communication/communication-sms/package.json b/sdk/communication/communication-sms/package.json index 95096c049b52..beb4f09ebf5f 100644 --- a/sdk/communication/communication-sms/package.json +++ b/sdk/communication/communication-sms/package.json @@ -1,6 +1,6 @@ { "name": "@azure/communication-sms", - "version": "1.1.0-beta.1", + "version": "1.2.0-beta.1", "description": "SDK for Azure Communication SMS service which facilitates the sending of SMS messages.", "sdk-type": "client", "main": "dist/index.js", @@ -23,8 +23,8 @@ "extract-api": "tsc -p . && api-extractor run --local", "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"", "generate:client": "autorest --typescript ./swagger/README.md && rushx format", - "integration-test:browser": "karma start --single-run", - "integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000 \"dist-esm/test/public/*.spec.js\" \"dist-esm/test/public/node/*.spec.js\" \"dist-esm/test/internal/*.spec.js\" \"dist-esm/test/internal/node/*.spec.js\"", + "integration-test:browser": "dev-tool run test:browser", + "integration-test:node": "dev-tool run test:node-js-input -- --timeout 5000000 'dist-esm/test/**/*.spec.js'", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", "lint": "eslint package.json api-extractor.json src test --ext .ts", @@ -32,8 +32,8 @@ "test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser", "test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node", "test": "npm run build:test && npm run unit-test && npm run integration-test", - "unit-test:browser": "karma start --single-run", - "unit-test:node": "mocha -r esm -r ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace --exclude \"test/**/browser/*.spec.ts\" \"test/**/*.spec.ts\"", + "unit-test:browser": "dev-tool run test:browser", + "unit-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 --exclude 'test/**/browser/*.spec.ts' 'test/**/*.spec.ts'", "unit-test": "npm run unit-test:node && npm run unit-test:browser" }, "files": [ @@ -64,21 +64,25 @@ "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", "dependencies": { "@azure/abort-controller": "^1.0.0", - "@azure/communication-common": "^1.1.0", + "@azure/communication-common": "^2.0.0", "@azure/core-auth": "^1.3.0", - "@azure/core-http": "^2.0.0", + "@azure/core-client": "^1.3.2", + "@azure/core-rest-pipeline": "^1.3.2", "@azure/core-tracing": "1.0.0-preview.13", "@azure/logger": "^1.0.0", "events": "^3.0.0", - "tslib": "^2.2.0" + "tslib": "^2.2.0", + "uuid": "^8.3.0" }, "devDependencies": { + "@azure/core-util": "^1.0.0-beta.1", "@azure/dev-tool": "^1.0.0", "@azure/eslint-plugin-azure-sdk": "^3.0.0", "@azure/identity": "^2.0.1", "@azure/test-utils": "^1.0.0", - "@azure-tools/test-recorder": "^1.0.0", - "@microsoft/api-extractor": "7.18.11", + "@azure-tools/test-credential": "^1.0.0", + "@azure-tools/test-recorder": "^2.0.0", + "@microsoft/api-extractor": "^7.18.11", "@types/chai": "^4.1.6", "@types/mocha": "^7.0.2", "@types/node": "^12.0.0", @@ -105,6 +109,7 @@ "prettier": "^2.5.1", "rimraf": "^3.0.0", "sinon": "^9.0.2", + "@types/uuid": "^8.0.0", "typescript": "~4.2.0", "util": "^0.12.1" }, @@ -112,7 +117,7 @@ "constantPaths": [ { "path": "src/generated/src/smsApiClientContext.ts", - "prefix": "packageVersion" + "prefix": "packageDetails" }, { "path": "src/constants.ts", diff --git a/sdk/communication/communication-sms/recordings/browsers/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message.json b/sdk/communication/communication-sms/recordings/browsers/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message.json index 16e7100bfe97..44922c4bc64d 100644 --- a/sdk/communication/communication-sms/recordings/browsers/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message.json +++ b/sdk/communication/communication-sms/recordings/browsers/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message.json @@ -1,8 +1,65 @@ { - "recordings": [], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "6d39c9c57e9160d4a3a0e376be58c39d" -} \ No newline at end of file + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "230", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "2b404561-80d4-47df-8eef-bb51c7f8730a", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": false + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:25 GMT", + "MS-CV": "/a\u002BG\u002BA/qDEOnzRSsOMGzfg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0mfNlYgAAAADhVdcNzY08RZ9rrw1pYNTHV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "354ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_2022042501042551a23517-47d4-4042-8278-d4283459572d_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/browsers/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.json b/sdk/communication/communication-sms/recordings/browsers/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.json index 6761d682bf03..c177b0ed4241 100644 --- a/sdk/communication/communication-sms/recordings/browsers/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.json +++ b/sdk/communication/communication-sms/recordings/browsers/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.json @@ -1,8 +1,76 @@ { - "recordings": [], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "2eb6de647e1107f39688ece93bdde8b3" -} \ No newline at end of file + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "348", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "e8eda94b-4cdc-40f2-8393-8b8c4cf2eebf", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + }, + { + "to": "\u002B1425555012345", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": false + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:28 GMT", + "MS-CV": "\u002Bc60SUiazUOU8SR5wxNRMA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0nPNlYgAAAADiayaxqzPwR7UG\u002BOEYsyX7V1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "511ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_202204250104285e388a0d-9492-4205-a0a8-295f3e2ff9e5_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + }, + { + "to": "\u002B1425555012345", + "httpStatusCode": 400, + "errorMessage": "Invalid To phone number format.", + "successful": false + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/browsers/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.json b/sdk/communication/communication-sms/recordings/browsers/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.json index fef73cc7ace9..41884563decb 100644 --- a/sdk/communication/communication-sms/recordings/browsers/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.json +++ b/sdk/communication/communication-sms/recordings/browsers/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.json @@ -1,8 +1,66 @@ { - "recordings": [], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "513763af6208d96eebc5802f066cb6e5" -} \ No newline at end of file + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "e113a90d-2c38-4d4a-9c8e-d989f2502dc2", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:26 GMT", + "MS-CV": "gEpcqeP\u002BykSEqoaQimICxg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0mvNlYgAAAAAONi/eC1VjQ4NafHJh0ns1V1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "355ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220425010426edf77c9a-e6d2-4715-85c0-8f7999b2638f_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/browsers/smsclient_live_aad_test_send_method/recording_sends_a_new_message_each_time_send_is_called.json b/sdk/communication/communication-sms/recordings/browsers/smsclient_live_aad_test_send_method/recording_sends_a_new_message_each_time_send_is_called.json index e58e14c7c8b6..bed91be7a3b3 100644 --- a/sdk/communication/communication-sms/recordings/browsers/smsclient_live_aad_test_send_method/recording_sends_a_new_message_each_time_send_is_called.json +++ b/sdk/communication/communication-sms/recordings/browsers/smsclient_live_aad_test_send_method/recording_sends_a_new_message_each_time_send_is_called.json @@ -1,8 +1,127 @@ { - "recordings": [], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "79dd2ab18eaa39469f724e185887a994" -} \ No newline at end of file + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "5e0e2ad5-26da-4587-b70f-e0562bc7ad43", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:27 GMT", + "MS-CV": "0yRxeXIlLkOg938yUt6rzQ.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0mvNlYgAAAAACL1yO2EgySZCj/pP3E17DV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "358ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220425010427ba9f0925-de3d-409e-abc1-5f768d7a544b_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + }, + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "02f4b481-ba66-4af2-abb9-3aba9f3c8f26", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:27 GMT", + "MS-CV": "J6NDWyPieUahOZ6FCkr38A.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0m/NlYgAAAAC0GIBv5dnbR4roLKJjJsWlV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "361ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220425010427b42da96f-ee94-404b-b5c2-84c57c49daea_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/browsers/smsclient_live_aad_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json b/sdk/communication/communication-sms/recordings/browsers/smsclient_live_aad_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json index d6f408f3e1a2..d4d663877aa7 100644 --- a/sdk/communication/communication-sms/recordings/browsers/smsclient_live_aad_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json +++ b/sdk/communication/communication-sms/recordings/browsers/smsclient_live_aad_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json @@ -1,8 +1,61 @@ { - "recordings": [], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "2843d7b2d8c43380ba09ed5cf0644f0a" -} \ No newline at end of file + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "9d8b3d78-a21e-4431-97ab-e67cf12077a9", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 401, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json", + "Date": "Mon, 25 Apr 2022 01:04:29 GMT", + "MS-CV": "EqWaAKtZlEyh2IdGPsF\u002BPw.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0nPNlYgAAAABDsvtwHc5ESp9g7yUKVYZmV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "426ms" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/browsers/smsclient_live_aad_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.json b/sdk/communication/communication-sms/recordings/browsers/smsclient_live_aad_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.json index 17135575d824..4a5ae824227f 100644 --- a/sdk/communication/communication-sms/recordings/browsers/smsclient_live_aad_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.json +++ b/sdk/communication/communication-sms/recordings/browsers/smsclient_live_aad_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.json @@ -1,8 +1,59 @@ { - "recordings": [], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "f90fd00200508634c1acae0fd4a9d9c7" -} \ No newline at end of file + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "253", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "9b6b75d8-900f-466a-b3f5-2091a18259ab", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B1425555012345", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:29 GMT", + "MS-CV": "R3f\u002BSixH4Uiacvxf7jQJLQ.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0nfNlYgAAAAD/qvjhiHhMTbPSg5RZj5HYV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "12ms" + }, + "ResponseBody": { + "From": [ + "Invalid from phone number format." + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/browsers/smsclient_live_test_send_method/recording_can_send_an_sms_message.json b/sdk/communication/communication-sms/recordings/browsers/smsclient_live_test_send_method/recording_can_send_an_sms_message.json index 16e7100bfe97..b6a59cd97ad3 100644 --- a/sdk/communication/communication-sms/recordings/browsers/smsclient_live_test_send_method/recording_can_send_an_sms_message.json +++ b/sdk/communication/communication-sms/recordings/browsers/smsclient_live_test_send_method/recording_can_send_an_sms_message.json @@ -1,8 +1,67 @@ { - "recordings": [], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "6d39c9c57e9160d4a3a0e376be58c39d" -} \ No newline at end of file + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "230", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "fc57f843-931a-4708-bd5f-a9409019ef9f", + "x-ms-content-sha256": "n4ihHYYwkFhL0Z66EvESdKtoc56GyOtZu8Ns/eJk6fU=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:29 GMT", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": false + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:30 GMT", + "MS-CV": "MoIrObrOiEy7ioPVTHuTeg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0nfNlYgAAAAABxgbnnkCaSZHrS1jyv4hRV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "572ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_202204250104308d7e41c8-8048-4aba-9262-3142ffd2c76c_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/browsers/smsclient_live_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.json b/sdk/communication/communication-sms/recordings/browsers/smsclient_live_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.json index 6761d682bf03..848b9af8ea2e 100644 --- a/sdk/communication/communication-sms/recordings/browsers/smsclient_live_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.json +++ b/sdk/communication/communication-sms/recordings/browsers/smsclient_live_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.json @@ -1,8 +1,78 @@ { - "recordings": [], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "2eb6de647e1107f39688ece93bdde8b3" -} \ No newline at end of file + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "348", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "c8a9c021-ebfe-41b7-afd4-850cee213643", + "x-ms-content-sha256": "AGO1wwvEfpgH/R1J98WEkJWZGbi8CYufWlLaXylE6lI=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:32 GMT", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + }, + { + "to": "\u002B1425555012345", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": false + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:32 GMT", + "MS-CV": "OllkksBAJES3guBPE6bDvA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0oPNlYgAAAAD\u002B\u002BfrniDIAS68\u002BVQQ5kpjsV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "515ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_2022042501043202ec2563-139e-4948-b336-f384ffa8114a_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + }, + { + "to": "\u002B1425555012345", + "httpStatusCode": 400, + "errorMessage": "Invalid To phone number format.", + "successful": false + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/browsers/smsclient_live_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.json b/sdk/communication/communication-sms/recordings/browsers/smsclient_live_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.json index fef73cc7ace9..439c3b29cddf 100644 --- a/sdk/communication/communication-sms/recordings/browsers/smsclient_live_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.json +++ b/sdk/communication/communication-sms/recordings/browsers/smsclient_live_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.json @@ -1,8 +1,68 @@ { - "recordings": [], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "513763af6208d96eebc5802f066cb6e5" -} \ No newline at end of file + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "4749f530-982c-4510-a91e-03e47d6d24a0", + "x-ms-content-sha256": "/RIt\u002BuMAktrTRkHYBhpE70P4DnllS03MSxkxwJ8rnVs=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:30 GMT", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:30 GMT", + "MS-CV": "1nzO7XcAqUKlY7FV3aI1vg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0nvNlYgAAAABsqMHxISKqSZjfxMV22xZXV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "506ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220425010431c4d452c6-7885-41cf-8e3c-21819623c6cf_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/browsers/smsclient_live_test_send_method/recording_sends_a_new_message_each_time_send_is_called.json b/sdk/communication/communication-sms/recordings/browsers/smsclient_live_test_send_method/recording_sends_a_new_message_each_time_send_is_called.json index e58e14c7c8b6..9a3846d5047f 100644 --- a/sdk/communication/communication-sms/recordings/browsers/smsclient_live_test_send_method/recording_sends_a_new_message_each_time_send_is_called.json +++ b/sdk/communication/communication-sms/recordings/browsers/smsclient_live_test_send_method/recording_sends_a_new_message_each_time_send_is_called.json @@ -1,8 +1,131 @@ { - "recordings": [], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "79dd2ab18eaa39469f724e185887a994" -} \ No newline at end of file + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "e08986bf-2f53-4c65-a108-31c6fbbe2476", + "x-ms-content-sha256": "hvNMhWHUURrd8BxQqe03W9neabV8IjzXt/AWxs6sEvM=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:31 GMT", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:31 GMT", + "MS-CV": "HAZBQAbbW0yBEDUuAI3DbQ.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0n/NlYgAAAADif8K7HNqrSZ/tkpOr3n5\u002BV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "542ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220425010431df8d1ff2-e7d0-4d8e-b385-ae8eeaffa4ac_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + }, + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "b254891e-a268-463c-9541-5b37b0a1a231", + "x-ms-content-sha256": "ttqDLHlY\u002BpmkOLT1pMNKcW5wcLCvauvGu2IDZtDPbUs=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:31 GMT", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:32 GMT", + "MS-CV": "aaUuXtFKC0mdtiKxssaibw.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0n/NlYgAAAACNqo72b/wRQa6Gs7XVxRW2V1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "501ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220425010432ebb40a8a-7624-4c21-a36f-d919ee1f64dc_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/browsers/smsclient_live_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json b/sdk/communication/communication-sms/recordings/browsers/smsclient_live_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json index d6f408f3e1a2..90bccdb4386c 100644 --- a/sdk/communication/communication-sms/recordings/browsers/smsclient_live_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json +++ b/sdk/communication/communication-sms/recordings/browsers/smsclient_live_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json @@ -1,8 +1,63 @@ { - "recordings": [], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "2843d7b2d8c43380ba09ed5cf0644f0a" -} \ No newline at end of file + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "4edd1634-ee7c-4f1b-8bdb-bff8f4596e5a", + "x-ms-content-sha256": "erq3cDvvMNMMGhIgvlg95jv3gDog9XRZKkm/6/6kh4I=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:33 GMT", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 401, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json", + "Date": "Mon, 25 Apr 2022 01:04:33 GMT", + "MS-CV": "HxUOVnv1q0eogFC35JQkmQ.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0ofNlYgAAAABvy6OXk\u002ByzRac4rQZr1SSPV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "430ms" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/browsers/smsclient_live_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.json b/sdk/communication/communication-sms/recordings/browsers/smsclient_live_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.json index 17135575d824..22f4436c1284 100644 --- a/sdk/communication/communication-sms/recordings/browsers/smsclient_live_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.json +++ b/sdk/communication/communication-sms/recordings/browsers/smsclient_live_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.json @@ -1,8 +1,61 @@ { - "recordings": [], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "f90fd00200508634c1acae0fd4a9d9c7" -} \ No newline at end of file + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "253", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "3794defc-5327-4e27-9bc3-2c5861509528", + "x-ms-content-sha256": "VXtHA2BA3XN0z5cXZZ\u002BDM\u002Bf6X8hf0/wZRqeFxyXIrv8=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:33 GMT", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B1425555012345", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:33 GMT", + "MS-CV": "FakOachnVUKiRl4OCL\u002Bvpw.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0ofNlYgAAAADOp5DWNJJERbZ4TmL96S9nV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "17ms" + }, + "ResponseBody": { + "From": [ + "Invalid from phone number format." + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message.json b/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message.json index 8779249e214b..6c7ce82192f8 100644 --- a/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message.json +++ b/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message.json @@ -1,54 +1,65 @@ { - "recordings": [ - { - "method": "POST", - "url": "https://endpoint/SomeTenantId/oauth2/v2.0/token", - "query": {}, - "requestBody": "response_type=token&grant_type=client_credentials&client_id=SomeClientId&client_secret=azure_client_secret&scope=https%3A%2F%2Fsanitized%2F", - "status": 200, - "response": "{\"token_type\":\"Bearer\",\"expires_in\":86399,\"ext_expires_in\":86399,\"access_token\":\"sanitized\"}", - "responseHeaders": { - "cache-control": "no-store, no-cache", - "content-length": "1327", - "content-type": "application/json; charset=utf-8", - "date": "Thu, 27 May 2021 20:29:21 GMT", - "expires": "-1", - "nel": "{\"report_to\":\"network-errors\",\"max_age\":86400,\"success_fraction\":0.001,\"failure_fraction\":1.0}", - "p3p": "CP=\"DSP CUR OTPi IND OTRi ONL FIN\"", - "pragma": "no-cache", - "referrer-policy": "strict-origin-when-cross-origin", - "report-to": "{\"group\":\"network-errors\",\"max_age\":86400,\"endpoints\":[{\"url\":\"https://endpoint/api/report?catId=GW+estsfd+chi\"}]}", - "strict-transport-security": "max-age=31536000; includeSubDomains", - "x-content-type-options": "nosniff", - "x-ms-ests-server": "2.1.11722.21 - NCUS ProdSlices", - "x-ms-request-id": "5923c900-2e4a-4826-8b06-9eff9ee12b00" - } - }, - { - "method": "POST", - "url": "https://endpoint/sms", - "query": { - "api-version": "2021-03-07" - }, - "requestBody": "{\"from\":\"+14255550123\",\"smsRecipients\":[{\"to\":\"+14255550123\",\"repeatabilityRequestId\":\"sanitized\",\"repeatabilityFirstSent\":\"Thu, 01 Jan 1970 00:00:00 GMT\"}],\"message\":\"test message\",\"smsSendOptions\":{\"enableDeliveryReport\":false}}", - "status": 202, - "response": "{\"value\":[{\"to\":\"+14255550123\",\"messageId\":\"Outgoing_20210527202922c067b109-445e-439c-806e-798bab291ff1_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true}]}", - "responseHeaders": { - "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", - "content-type": "application/json; charset=utf-8", - "date": "Thu, 27 May 2021 20:29:21 GMT", - "ms-cv": "SWTUjgg8TUi9SXM9E5Vc/g.0", - "request-context": "appId=", - "status": "202", - "x-azure-ref": "0IQGwYAAAAACLJk6U5nRuSqSHAkKb6DvpWVZSMzBFREdFMDQxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "x-cache": "CONFIG_NOCACHE", - "x-processing-time": "529ms" - } - } - ], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "6d39c9c57e9160d4a3a0e376be58c39d" -} \ No newline at end of file + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "230", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "f0ff0dd8-0c0d-4efe-a9e7-ba8131c80fcf", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": false + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:18 GMT", + "MS-CV": "gXgRCQxwikWmrWumBFvdGQ.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0kvNlYgAAAAA8aTCtfdKYSJNsKRkA\u002BK7yV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "366ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_202204250104186952a7f4-c91d-458c-a0b2-da67f4f9dce1_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.json b/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.json index 8a4c09b12a7c..fdc604ff4fc5 100644 --- a/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.json +++ b/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.json @@ -1,54 +1,76 @@ { - "recordings": [ - { - "method": "POST", - "url": "https://endpoint/SomeTenantId/oauth2/v2.0/token", - "query": {}, - "requestBody": "response_type=token&grant_type=client_credentials&client_id=SomeClientId&client_secret=azure_client_secret&scope=https%3A%2F%2Fsanitized%2F", - "status": 200, - "response": "{\"token_type\":\"Bearer\",\"expires_in\":86399,\"ext_expires_in\":86399,\"access_token\":\"sanitized\"}", - "responseHeaders": { - "cache-control": "no-store, no-cache", - "content-length": "1327", - "content-type": "application/json; charset=utf-8", - "date": "Thu, 27 May 2021 20:29:24 GMT", - "expires": "-1", - "nel": "{\"report_to\":\"network-errors\",\"max_age\":86400,\"success_fraction\":0.001,\"failure_fraction\":1.0}", - "p3p": "CP=\"DSP CUR OTPi IND OTRi ONL FIN\"", - "pragma": "no-cache", - "referrer-policy": "strict-origin-when-cross-origin", - "report-to": "{\"group\":\"network-errors\",\"max_age\":86400,\"endpoints\":[{\"url\":\"https://endpoint/api/report?catId=GW+estsfd+chi\"}]}", - "strict-transport-security": "max-age=31536000; includeSubDomains", - "x-content-type-options": "nosniff", - "x-ms-ests-server": "2.1.11722.21 - NCUS ProdSlices", - "x-ms-request-id": "c7dd59c3-bb43-4f6b-ad62-83fd8b2b2c00" - } - }, - { - "method": "POST", - "url": "https://endpoint/sms", - "query": { - "api-version": "2021-03-07" - }, - "requestBody": "{\"from\":\"+14255550123\",\"smsRecipients\":[{\"to\":\"+14255550123\",\"repeatabilityRequestId\":\"sanitized\",\"repeatabilityFirstSent\":\"Thu, 01 Jan 1970 00:00:00 GMT\"},{\"to\":\"+1425555012345\",\"repeatabilityRequestId\":\"sanitized\",\"repeatabilityFirstSent\":\"Thu, 01 Jan 1970 00:00:00 GMT\"}],\"message\":\"test message\",\"smsSendOptions\":{\"enableDeliveryReport\":false}}", - "status": 202, - "response": "{\"value\":[{\"to\":\"+14255550123\",\"messageId\":\"Outgoing_202105272029245281822e-1036-46e2-9e81-4a2ae7ef09e6_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true},{\"to\":\"+1425555012345\",\"httpStatusCode\":400,\"errorMessage\":\"Invalid To phone number format.\",\"successful\":false}]}", - "responseHeaders": { - "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", - "content-type": "application/json; charset=utf-8", - "date": "Thu, 27 May 2021 20:29:24 GMT", - "ms-cv": "zVDKUNGn+UuH274gnpB+kg.0", - "request-context": "appId=", - "status": "202", - "x-azure-ref": "0JAGwYAAAAAAzpqhWwVUFQrXeruGhnyoTWVZSMzBFREdFMDQxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "x-cache": "CONFIG_NOCACHE", - "x-processing-time": "519ms" - } - } - ], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "2eb6de647e1107f39688ece93bdde8b3" -} \ No newline at end of file + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "348", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "1ae67a00-f56e-472a-b9fb-ddc2ef3ab072", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + }, + { + "to": "\u002B1425555012345", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": false + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:20 GMT", + "MS-CV": "m15vRKv1n0q2\u002BP9Y3c146Q.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0lPNlYgAAAAA/a2pQvJ0JQoZtC862V4jYV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "362ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_202204250104213a40a246-85cb-4762-b82e-9579b447e223_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + }, + { + "to": "\u002B1425555012345", + "httpStatusCode": 400, + "errorMessage": "Invalid To phone number format.", + "successful": false + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.json b/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.json index 869591008884..8fa6b72653e0 100644 --- a/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.json +++ b/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.json @@ -1,54 +1,66 @@ { - "recordings": [ - { - "method": "POST", - "url": "https://endpoint/SomeTenantId/oauth2/v2.0/token", - "query": {}, - "requestBody": "response_type=token&grant_type=client_credentials&client_id=SomeClientId&client_secret=azure_client_secret&scope=https%3A%2F%2Fsanitized%2F", - "status": 200, - "response": "{\"token_type\":\"Bearer\",\"expires_in\":86399,\"ext_expires_in\":86399,\"access_token\":\"sanitized\"}", - "responseHeaders": { - "cache-control": "no-store, no-cache", - "content-length": "1327", - "content-type": "application/json; charset=utf-8", - "date": "Thu, 27 May 2021 20:29:22 GMT", - "expires": "-1", - "nel": "{\"report_to\":\"network-errors\",\"max_age\":86400,\"success_fraction\":0.001,\"failure_fraction\":1.0}", - "p3p": "CP=\"DSP CUR OTPi IND OTRi ONL FIN\"", - "pragma": "no-cache", - "referrer-policy": "strict-origin-when-cross-origin", - "report-to": "{\"group\":\"network-errors\",\"max_age\":86400,\"endpoints\":[{\"url\":\"https://endpoint/api/report?catId=GW+estsfd+chi\"}]}", - "strict-transport-security": "max-age=31536000; includeSubDomains", - "x-content-type-options": "nosniff", - "x-ms-ests-server": "2.1.11722.21 - SCUS ProdSlices", - "x-ms-request-id": "8d1c9a6e-9e39-4e2b-8f63-70ee295d2f00" - } - }, - { - "method": "POST", - "url": "https://endpoint/sms", - "query": { - "api-version": "2021-03-07" - }, - "requestBody": "{\"from\":\"+14255550123\",\"smsRecipients\":[{\"to\":\"+14255550123\",\"repeatabilityRequestId\":\"sanitized\",\"repeatabilityFirstSent\":\"Thu, 01 Jan 1970 00:00:00 GMT\"}],\"message\":\"test message\",\"smsSendOptions\":{\"enableDeliveryReport\":true,\"tag\":\"SMS_LIVE_TEST\"}}", - "status": 202, - "response": "{\"value\":[{\"to\":\"+14255550123\",\"messageId\":\"Outgoing_20210527202922043dbf80-73a3-4c87-8d5a-2a5713452329_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true}]}", - "responseHeaders": { - "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", - "content-type": "application/json; charset=utf-8", - "date": "Thu, 27 May 2021 20:29:22 GMT", - "ms-cv": "G5IRlBpt7EWeh48d+kJ/dw.0", - "request-context": "appId=", - "status": "202", - "x-azure-ref": "0IgGwYAAAAACFfYcvK5JkSJ6VVYVEylM6WVZSMzBFREdFMDQxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "x-cache": "CONFIG_NOCACHE", - "x-processing-time": "523ms" - } - } - ], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "513763af6208d96eebc5802f066cb6e5" -} \ No newline at end of file + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "087c1090-9e20-4029-9459-e4761929ab9d", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:19 GMT", + "MS-CV": "HVAYDsIFFkueqO\u002BH5okqvw.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0k/NlYgAAAAAsOgSdJcdWSo/fI3A/\u002BYWzV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "365ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220425010419281f2c87-1db8-446f-a29d-af2f7cf60f5d_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_aad_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.json b/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_aad_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.json index ece4f00f08dc..645c199d26e0 100644 --- a/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_aad_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.json +++ b/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_aad_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.json @@ -1,75 +1,127 @@ { - "recordings": [ - { - "method": "POST", - "url": "https://endpoint/SomeTenantId/oauth2/v2.0/token", - "query": {}, - "requestBody": "response_type=token&grant_type=client_credentials&client_id=SomeClientId&client_secret=azure_client_secret&scope=https%3A%2F%2Fsanitized%2F", - "status": 200, - "response": "{\"token_type\":\"Bearer\",\"expires_in\":86399,\"ext_expires_in\":86399,\"access_token\":\"sanitized\"}", - "responseHeaders": { - "cache-control": "no-store, no-cache", - "content-length": "1327", - "content-type": "application/json; charset=utf-8", - "date": "Thu, 27 May 2021 20:29:22 GMT", - "expires": "-1", - "nel": "{\"report_to\":\"network-errors\",\"max_age\":86400,\"success_fraction\":0.001,\"failure_fraction\":1.0}", - "p3p": "CP=\"DSP CUR OTPi IND OTRi ONL FIN\"", - "pragma": "no-cache", - "referrer-policy": "strict-origin-when-cross-origin", - "report-to": "{\"group\":\"network-errors\",\"max_age\":86400,\"endpoints\":[{\"url\":\"https://endpoint/api/report?catId=GW+estsfd+chi\"}]}", - "strict-transport-security": "max-age=31536000; includeSubDomains", - "x-content-type-options": "nosniff", - "x-ms-ests-server": "2.1.11722.21 - SCUS ProdSlices", - "x-ms-request-id": "5be8e4b7-85e3-494d-9cd7-e47cb4012b00" - } - }, - { - "method": "POST", - "url": "https://endpoint/sms", - "query": { - "api-version": "2021-03-07" - }, - "requestBody": "{\"from\":\"+14255550123\",\"smsRecipients\":[{\"to\":\"+14255550123\",\"repeatabilityRequestId\":\"sanitized\",\"repeatabilityFirstSent\":\"Thu, 01 Jan 1970 00:00:00 GMT\"}],\"message\":\"test message\",\"smsSendOptions\":{\"enableDeliveryReport\":true,\"tag\":\"SMS_LIVE_TEST\"}}", - "status": 202, - "response": "{\"value\":[{\"to\":\"+14255550123\",\"messageId\":\"Outgoing_20210527202923596059fc-bc11-4dce-a984-5f11bc039c37_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true}]}", - "responseHeaders": { - "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", - "content-type": "application/json; charset=utf-8", - "date": "Thu, 27 May 2021 20:29:23 GMT", - "ms-cv": "UEvZjDs7vk6mihgtg4nQJw.0", - "request-context": "appId=", - "status": "202", - "x-azure-ref": "0IwGwYAAAAADsfeNFn1WwRZDCMuLl4gRgWVZSMzBFREdFMDQxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "x-cache": "CONFIG_NOCACHE", - "x-processing-time": "519ms" - } - }, - { - "method": "POST", - "url": "https://endpoint/sms", - "query": { - "api-version": "2021-03-07" - }, - "requestBody": "{\"from\":\"+14255550123\",\"smsRecipients\":[{\"to\":\"+14255550123\",\"repeatabilityRequestId\":\"sanitized\",\"repeatabilityFirstSent\":\"Thu, 01 Jan 1970 00:00:00 GMT\"}],\"message\":\"test message\",\"smsSendOptions\":{\"enableDeliveryReport\":true,\"tag\":\"SMS_LIVE_TEST\"}}", - "status": 202, - "response": "{\"value\":[{\"to\":\"+14255550123\",\"messageId\":\"Outgoing_20210527202924586ac239-1542-497f-866a-236c52441f1a_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true}]}", - "responseHeaders": { - "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", - "content-type": "application/json; charset=utf-8", - "date": "Thu, 27 May 2021 20:29:24 GMT", - "ms-cv": "85ISOcHB20y9Smjy6cbglw.0", - "request-context": "appId=", - "status": "202", - "x-azure-ref": "0IwGwYAAAAAB+gPdbQ3S3R5UPucUia5b6WVZSMzBFREdFMDQxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "x-cache": "CONFIG_NOCACHE", - "x-processing-time": "529ms" - } - } - ], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "79dd2ab18eaa39469f724e185887a994" -} \ No newline at end of file + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "d47c9c11-aeb1-4a58-9288-535f54f974a8", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:19 GMT", + "MS-CV": "dRPdwTUAKkS5D/LyEJHaEQ.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0k/NlYgAAAADJtIUV7wl2RLI0PzGmKkCzV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "358ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220425010420182c1ffb-47f0-4e9b-ae3a-3a3bc2c6ff51_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + }, + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "5b080cc9-3dad-46e7-9eda-722823ce0a64", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:20 GMT", + "MS-CV": "2Q/rQKfD1Umon/2bg220aA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0lPNlYgAAAACRMEkz/VckSoca4QhzWWgXV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "353ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_202204250104205205ebb8-3ac4-4d99-a437-57323f703bc5_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_aad_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json b/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_aad_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json index 034b6f899c89..dabf623275a6 100644 --- a/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_aad_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json +++ b/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_aad_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json @@ -1,54 +1,61 @@ { - "recordings": [ - { - "method": "POST", - "url": "https://endpoint/SomeTenantId/oauth2/v2.0/token", - "query": {}, - "requestBody": "response_type=token&grant_type=client_credentials&client_id=SomeClientId&client_secret=azure_client_secret&scope=https%3A%2F%2Fsanitized%2F", - "status": 200, - "response": "{\"token_type\":\"Bearer\",\"expires_in\":86399,\"ext_expires_in\":86399,\"access_token\":\"sanitized\"}", - "responseHeaders": { - "cache-control": "no-store, no-cache", - "content-length": "1327", - "content-type": "application/json; charset=utf-8", - "date": "Thu, 27 May 2021 20:29:24 GMT", - "expires": "-1", - "nel": "{\"report_to\":\"network-errors\",\"max_age\":86400,\"success_fraction\":0.001,\"failure_fraction\":1.0}", - "p3p": "CP=\"DSP CUR OTPi IND OTRi ONL FIN\"", - "pragma": "no-cache", - "referrer-policy": "strict-origin-when-cross-origin", - "report-to": "{\"group\":\"network-errors\",\"max_age\":86400,\"endpoints\":[{\"url\":\"https://endpoint/api/report?catId=GW+estsfd+chi\"}]}", - "strict-transport-security": "max-age=31536000; includeSubDomains", - "x-content-type-options": "nosniff", - "x-ms-ests-server": "2.1.11722.21 - NCUS ProdSlices", - "x-ms-request-id": "c7dd59c3-bb43-4f6b-ad62-83fda42b2c00" - } - }, - { - "method": "POST", - "url": "https://endpoint/sms", - "query": { - "api-version": "2021-03-07" - }, - "requestBody": "{\"from\":\"+14255550123\",\"smsRecipients\":[{\"to\":\"+14255550123\",\"repeatabilityRequestId\":\"sanitized\",\"repeatabilityFirstSent\":\"Thu, 01 Jan 1970 00:00:00 GMT\"}],\"message\":\"test message\",\"smsSendOptions\":{\"enableDeliveryReport\":true,\"tag\":\"SMS_LIVE_TEST\"}}", - "status": 401, - "response": "", - "responseHeaders": { - "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", - "content-length": "0", - "date": "Thu, 27 May 2021 20:29:25 GMT", - "ms-cv": "Fon5+ph9zUWtnAJxc1PBjA.0", - "request-context": "appId=", - "status": "401", - "x-azure-ref": "0JQGwYAAAAABNRG4wEAxsT642/yBqvPpdWVZSMzBFREdFMDQxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "x-cache": "CONFIG_NOCACHE", - "x-processing-time": "421ms" - } - } - ], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "c282ce4bca8ed2b180118d3cec818d82" -} \ No newline at end of file + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "d2cc7759-99ce-4bfb-b288-859157a80b14", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 401, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json", + "Date": "Mon, 25 Apr 2022 01:04:21 GMT", + "MS-CV": "KqL3Vn6RsU2z6mh81NwW5w.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0lfNlYgAAAABkxQww67bnRogAuLxwbVToV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "273ms" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_aad_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.json b/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_aad_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.json index 030b16949363..9fad97d39fc8 100644 --- a/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_aad_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.json +++ b/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_aad_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.json @@ -1,53 +1,59 @@ { - "recordings": [ - { - "method": "POST", - "url": "https://endpoint/SomeTenantId/oauth2/v2.0/token", - "query": {}, - "requestBody": "response_type=token&grant_type=client_credentials&client_id=SomeClientId&client_secret=azure_client_secret&scope=https%3A%2F%2Fsanitized%2F", - "status": 200, - "response": "{\"token_type\":\"Bearer\",\"expires_in\":86399,\"ext_expires_in\":86399,\"access_token\":\"sanitized\"}", - "responseHeaders": { - "cache-control": "no-store, no-cache", - "content-length": "1327", - "content-type": "application/json; charset=utf-8", - "date": "Thu, 27 May 2021 20:29:25 GMT", - "expires": "-1", - "nel": "{\"report_to\":\"network-errors\",\"max_age\":86400,\"success_fraction\":0.001,\"failure_fraction\":1.0}", - "p3p": "CP=\"DSP CUR OTPi IND OTRi ONL FIN\"", - "pragma": "no-cache", - "referrer-policy": "strict-origin-when-cross-origin", - "report-to": "{\"group\":\"network-errors\",\"max_age\":86400,\"endpoints\":[{\"url\":\"https://endpoint/api/report?catId=GW+estsfd+chi\"}]}", - "strict-transport-security": "max-age=31536000; includeSubDomains", - "x-content-type-options": "nosniff", - "x-ms-ests-server": "2.1.11722.21 - EUS ProdSlices", - "x-ms-request-id": "c958b1c7-d5d2-43a7-a6ca-b13fe03a3b00" - } - }, - { - "method": "POST", - "url": "https://endpoint/sms", - "query": { - "api-version": "2021-03-07" - }, - "requestBody": "{\"from\":\"+1425555012345\",\"smsRecipients\":[{\"to\":\"+14255550123\",\"repeatabilityRequestId\":\"sanitized\",\"repeatabilityFirstSent\":\"Thu, 01 Jan 1970 00:00:00 GMT\"}],\"message\":\"test message\",\"smsSendOptions\":{\"enableDeliveryReport\":true,\"tag\":\"SMS_LIVE_TEST\"}}", - "status": 400, - "response": "{\"From\":[\"Invalid From phone number format\"]}", - "responseHeaders": { - "content-type": "application/json; charset=utf-8", - "date": "Thu, 27 May 2021 20:29:25 GMT", - "ms-cv": "7EANnXQYnUSMpcg0vELoww.0", - "request-context": "appId=", - "status": "400", - "x-azure-ref": "0JQGwYAAAAAAE3oMtKW9jTYVCpzgPVl64WVZSMzBFREdFMDQxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "x-cache": "CONFIG_NOCACHE", - "x-processing-time": "12ms" - } - } - ], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "f90fd00200508634c1acae0fd4a9d9c7" -} \ No newline at end of file + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "253", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "6f1a2f72-ffea-40f5-9cf1-bc7cc921a572", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B1425555012345", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:21 GMT", + "MS-CV": "mdsxT7OX3UGPImwUWShuJg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0lvNlYgAAAAAPMJjSMwNfRo9S113DBPsXV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "13ms" + }, + "ResponseBody": { + "From": [ + "Invalid from phone number format." + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message.json b/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message.json index c6618b5e1eb9..88aec17a9964 100644 --- a/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message.json +++ b/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message.json @@ -1,29 +1,67 @@ { - "recordings": [ - { - "method": "POST", - "url": "https://endpoint/sms", - "query": { - "api-version": "2021-03-07" - }, - "requestBody": "{\"from\":\"+14255550123\",\"smsRecipients\":[{\"to\":\"+14255550123\",\"repeatabilityRequestId\":\"sanitized\",\"repeatabilityFirstSent\":\"Thu, 01 Jan 1970 00:00:00 GMT\"}],\"message\":\"test message\",\"smsSendOptions\":{\"enableDeliveryReport\":false}}", - "status": 202, - "response": "{\"value\":[{\"to\":\"+14255550123\",\"messageId\":\"Outgoing_20210424015251c05b9140-7557-4913-a30c-23c8ed2d2f2a_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true}]}", - "responseHeaders": { - "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", - "content-type": "application/json; charset=utf-8", - "date": "Sat, 24 Apr 2021 01:52:51 GMT", - "ms-cv": "GZmfpT+VGk+fm00Kb6s/vw.0", - "request-context": "appId=", - "status": "202", - "x-azure-ref": "083mDYAAAAACcyAjrCafIRZ03l9iuawYZWVZSMzBFREdFMDMxNwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "x-processing-time": "351ms" - } - } - ], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "6d39c9c57e9160d4a3a0e376be58c39d" -} \ No newline at end of file + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "230", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "a0ac65ef-16dd-4182-b2de-20f89b004162", + "x-ms-content-sha256": "lTECQyl3hsT2E/BH9vz0M3zqvmRTNaYzbo\u002BgCGgvoNA=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:22 GMT", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": false + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:22 GMT", + "MS-CV": "p2JgSANgiUCqzvhdKWjb4Q.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0lvNlYgAAAACUcmDbaqbPSLXWrXQ0vWcOV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "375ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_202204250104224cf2fc46-f5c1-4363-bf31-93cabfb20088_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.json b/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.json index 6100404cdaa3..b821e2f1b1d0 100644 --- a/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.json +++ b/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.json @@ -1,29 +1,78 @@ { - "recordings": [ - { - "method": "POST", - "url": "https://endpoint/sms", - "query": { - "api-version": "2021-03-07" - }, - "requestBody": "{\"from\":\"+14255550123\",\"smsRecipients\":[{\"to\":\"+14255550123\",\"repeatabilityRequestId\":\"sanitized\",\"repeatabilityFirstSent\":\"Thu, 01 Jan 1970 00:00:00 GMT\"},{\"to\":\"+1425555012345\",\"repeatabilityRequestId\":\"sanitized\",\"repeatabilityFirstSent\":\"Thu, 01 Jan 1970 00:00:00 GMT\"}],\"message\":\"test message\",\"smsSendOptions\":{\"enableDeliveryReport\":false}}", - "status": 202, - "response": "{\"value\":[{\"to\":\"+14255550123\",\"messageId\":\"Outgoing_20210424015253e635a2eb-13ad-4ef0-9967-b59e15538de6_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true},{\"to\":\"+1425555012345\",\"httpStatusCode\":400,\"errorMessage\":\"Invalid To phone number format.\",\"successful\":false}]}", - "responseHeaders": { - "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", - "content-type": "application/json; charset=utf-8", - "date": "Sat, 24 Apr 2021 01:52:53 GMT", - "ms-cv": "Lk5VfjPmPEOAl+AhEkWfpA.0", - "request-context": "appId=", - "status": "202", - "x-azure-ref": "09XmDYAAAAACzKfXGsiYpT6GWIplAsb/PWVZSMzBFREdFMDMxNwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "x-processing-time": "395ms" - } - } - ], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "2eb6de647e1107f39688ece93bdde8b3" -} \ No newline at end of file + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "348", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "7fe301e9-ad96-42c2-a583-38d5b5831d65", + "x-ms-content-sha256": "tn2hQBHO2Wjjr6R58p\u002BGk7FucAexbX14cbB9OB4hwow=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:24 GMT", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + }, + { + "to": "\u002B1425555012345", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": false + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:24 GMT", + "MS-CV": "maUISpiPn0iKFX2Q0FyfNA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0mPNlYgAAAAA3UcQMonrFS6OTOmjJkQyhV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "366ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220425010424a96cc4d8-19b3-49e3-9c53-52ecf297e473_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + }, + { + "to": "\u002B1425555012345", + "httpStatusCode": 400, + "errorMessage": "Invalid To phone number format.", + "successful": false + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.json b/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.json index 18c196c22994..ffda0fa656a8 100644 --- a/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.json +++ b/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.json @@ -1,29 +1,68 @@ { - "recordings": [ - { - "method": "POST", - "url": "https://endpoint/sms", - "query": { - "api-version": "2021-03-07" - }, - "requestBody": "{\"from\":\"+14255550123\",\"smsRecipients\":[{\"to\":\"+14255550123\",\"repeatabilityRequestId\":\"sanitized\",\"repeatabilityFirstSent\":\"Thu, 01 Jan 1970 00:00:00 GMT\"}],\"message\":\"test message\",\"smsSendOptions\":{\"enableDeliveryReport\":true,\"tag\":\"SMS_LIVE_TEST\"}}", - "status": 202, - "response": "{\"value\":[{\"to\":\"+14255550123\",\"messageId\":\"Outgoing_20210424015252995ea4c1-b445-4573-abd8-dfe422c5ea4a_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true}]}", - "responseHeaders": { - "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", - "content-type": "application/json; charset=utf-8", - "date": "Sat, 24 Apr 2021 01:52:51 GMT", - "ms-cv": "ymMZpmMnsUKaY5GdOU2XWQ.0", - "request-context": "appId=", - "status": "202", - "x-azure-ref": "083mDYAAAAABwOiRcWR+fQokiumdcrengWVZSMzBFREdFMDMxNwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "x-processing-time": "386ms" - } - } - ], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "513763af6208d96eebc5802f066cb6e5" -} \ No newline at end of file + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "4e742cc2-02a9-4dad-a351-a1b0882e2e51", + "x-ms-content-sha256": "fpXXVy6SD0gRoUnuThx8JYvOSK6vB7MUvjvlUM\u002BW2Io=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:22 GMT", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:22 GMT", + "MS-CV": "VZyOw9D7Y0\u002BlzzrxQ8bGVg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0lvNlYgAAAADtnV6FSyWSRIOr0JyALpuQV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "366ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_2022042501042341a30251-9d77-4bee-b22c-6940e51bd67a_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.json b/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.json index 2d8c10c2bcea..a6b175775142 100644 --- a/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.json +++ b/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.json @@ -1,49 +1,131 @@ { - "recordings": [ - { - "method": "POST", - "url": "https://endpoint/sms", - "query": { - "api-version": "2021-03-07" - }, - "requestBody": "{\"from\":\"+14255550123\",\"smsRecipients\":[{\"to\":\"+14255550123\",\"repeatabilityRequestId\":\"sanitized\",\"repeatabilityFirstSent\":\"Thu, 01 Jan 1970 00:00:00 GMT\"}],\"message\":\"test message\",\"smsSendOptions\":{\"enableDeliveryReport\":true,\"tag\":\"SMS_LIVE_TEST\"}}", - "status": 202, - "response": "{\"value\":[{\"to\":\"+14255550123\",\"messageId\":\"Outgoing_202104240152528ec5c4ad-e3c4-4961-b7be-4cf45cec3905_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true}]}", - "responseHeaders": { - "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", - "content-type": "application/json; charset=utf-8", - "date": "Sat, 24 Apr 2021 01:52:52 GMT", - "ms-cv": "QwJfO72hc0mBzIY+CakQLg.0", - "request-context": "appId=", - "status": "202", - "x-azure-ref": "09HmDYAAAAABTKE2XhR6/Rb81k9ewYLVjWVZSMzBFREdFMDMxNwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "x-processing-time": "392ms" - } - }, - { - "method": "POST", - "url": "https://endpoint/sms", - "query": { - "api-version": "2021-03-07" - }, - "requestBody": "{\"from\":\"+14255550123\",\"smsRecipients\":[{\"to\":\"+14255550123\",\"repeatabilityRequestId\":\"sanitized\",\"repeatabilityFirstSent\":\"Thu, 01 Jan 1970 00:00:00 GMT\"}],\"message\":\"test message\",\"smsSendOptions\":{\"enableDeliveryReport\":true,\"tag\":\"SMS_LIVE_TEST\"}}", - "status": 202, - "response": "{\"value\":[{\"to\":\"+14255550123\",\"messageId\":\"Outgoing_2021042401525343fbb265-a944-4690-8f02-74deb17f5924_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true}]}", - "responseHeaders": { - "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", - "content-type": "application/json; charset=utf-8", - "date": "Sat, 24 Apr 2021 01:52:52 GMT", - "ms-cv": "kwki6TxoLESl3X2+PViHOg.0", - "request-context": "appId=", - "status": "202", - "x-azure-ref": "09HmDYAAAAACDwFVlR96wSbRUMpKm2oV+WVZSMzBFREdFMDMxNwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "x-processing-time": "474ms" - } - } - ], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "79dd2ab18eaa39469f724e185887a994" -} \ No newline at end of file + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "0734cdff-c573-40cf-bbd2-355bd9a5774d", + "x-ms-content-sha256": "nVCy7c30z8GhxZer/uIvuySQcVgR4k9h2Z5Sa2KGICk=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:23 GMT", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:23 GMT", + "MS-CV": "ZHnOebvKqUaxNlvBLyLHCA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0l/NlYgAAAADm9YPa6muhT7\u002BhWVhTLFNWV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "368ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_2022042501042325eed125-d718-462f-8332-b7bfcbe5fe1e_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + }, + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "3ebb6a87-8648-4920-8848-93f90882e435", + "x-ms-content-sha256": "sLIEGv9NcZioMz35rkuWVHXuqHEiccd2G7UhyoNmqck=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:23 GMT", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:23 GMT", + "MS-CV": "ZY9Ivx8lI0\u002By0tLmggARLA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0l/NlYgAAAAALb7dl5i5nT4Rn5FUl/HgKV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "354ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220425010424b3f67f50-28b3-4145-9a8c-ec9d8c240142_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json b/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json index e63b5d4e9b4c..07435e519bc9 100644 --- a/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json +++ b/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json @@ -1,29 +1,63 @@ { - "recordings": [ - { - "method": "POST", - "url": "https://endpoint/sms", - "query": { - "api-version": "2021-03-07" - }, - "requestBody": "{\"from\":\"+14255550123\",\"smsRecipients\":[{\"to\":\"+14255550123\",\"repeatabilityRequestId\":\"sanitized\",\"repeatabilityFirstSent\":\"Thu, 01 Jan 1970 00:00:00 GMT\"}],\"message\":\"test message\",\"smsSendOptions\":{\"enableDeliveryReport\":true,\"tag\":\"SMS_LIVE_TEST\"}}", - "status": 401, - "response": "", - "responseHeaders": { - "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", - "content-length": "0", - "date": "Sat, 24 Apr 2021 01:52:53 GMT", - "ms-cv": "y+3Yvbaic0C7ZqJfdqp0YA.0", - "request-context": "appId=", - "status": "401", - "x-azure-ref": "09XmDYAAAAAB16lq36mMsSorud4RPhNHKWVZSMzBFREdFMDMxNwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "x-processing-time": "332ms" - } - } - ], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "c282ce4bca8ed2b180118d3cec818d82" -} \ No newline at end of file + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "b44ab95d-c784-4f3c-8c12-0f865e041d88", + "x-ms-content-sha256": "APtMVqDHyf9CHxpKwvu7im4I14Ax\u002BdYDpV4awaPXNkY=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:24 GMT", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 401, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json", + "Date": "Mon, 25 Apr 2022 01:04:24 GMT", + "MS-CV": "hIyzhQyBRkuH/Xyr0v5wxg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0mPNlYgAAAACRzDDsz5VASZkOfEWuJjBKV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "285ms" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.json b/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.json index 1b6a6b0afbcc..5c706bb50e33 100644 --- a/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.json +++ b/sdk/communication/communication-sms/recordings/browsers/smsclient_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.json @@ -1,28 +1,61 @@ { - "recordings": [ - { - "method": "POST", - "url": "https://endpoint/sms", - "query": { - "api-version": "2021-03-07" - }, - "requestBody": "{\"from\":\"+1425555012345\",\"smsRecipients\":[{\"to\":\"+14255550123\",\"repeatabilityRequestId\":\"sanitized\",\"repeatabilityFirstSent\":\"Thu, 01 Jan 1970 00:00:00 GMT\"}],\"message\":\"test message\",\"smsSendOptions\":{\"enableDeliveryReport\":true,\"tag\":\"SMS_LIVE_TEST\"}}", - "status": 400, - "response": "{\"From\":[\"Invalid From phone number format\"]}", - "responseHeaders": { - "content-type": "application/json; charset=utf-8", - "date": "Sat, 24 Apr 2021 01:52:53 GMT", - "ms-cv": "rD6ustT2CkSDMUR116HyDA.0", - "request-context": "appId=", - "status": "400", - "x-azure-ref": "09nmDYAAAAAD7F6OU/oGkRYIC1qwVN6wQWVZSMzBFREdFMDMxNwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", - "x-processing-time": "13ms" - } - } - ], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "f90fd00200508634c1acae0fd4a9d9c7" -} \ No newline at end of file + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "253", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36", + "x-ms-client-request-id": "1d7cc34f-a9d1-40a0-9ffe-c5bb22925a6c", + "x-ms-content-sha256": "uYSUdad6VUcBoz\u002B\u002BkRGYdCd5VMl/vDOfKHyj8YS8pCQ=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:25 GMT", + "x-ms-useragent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 OS/Win32" + }, + "RequestBody": { + "from": "\u002B1425555012345", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:24 GMT", + "MS-CV": "gyFtKB\u002B5PUSrB5LN2CYZKg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0mfNlYgAAAADms7UEnrDMRqt/lwQEg/Y4V1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "18ms" + }, + "ResponseBody": { + "From": [ + "Invalid from phone number format." + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message.js b/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message.js deleted file mode 100644 index 84363f42a969..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "40a36a477f7f16678261c29cc32a4387"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message.json b/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message.json new file mode 100644 index 000000000000..4e18f846dec3 --- /dev/null +++ b/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message.json @@ -0,0 +1,56 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "230", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "ecfa6014-9edc-46bc-ad07-ff0b2494b056" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": false + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:03 GMT", + "MS-CV": "WMeHaE0XCE\u002Bxz6\u002B5JXJoBg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0g/NlYgAAAABhQXJLo/4YSZSYiyDhd5j4V1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "373ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220425010403db590b8e-dddd-4db5-99d1-7e421299f176_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.js b/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.js deleted file mode 100644 index c3f4d3a7149b..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "c9d3b30b09556d605a1814b7cc66c2ba"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.json b/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.json new file mode 100644 index 000000000000..ba97ecb31db8 --- /dev/null +++ b/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.json @@ -0,0 +1,67 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "348", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "3ce28c11-ef71-4aa5-a72b-017a8de69874" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + }, + { + "to": "\u002B1425555012345", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": false + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:07 GMT", + "MS-CV": "jst\u002BOunVn02al2oNZZXmFg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0h/NlYgAAAADxidOVscRSTaDTrBQBKskLV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "514ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220425010407629b3ae2-ced9-4296-9303-3ddc9fac532b_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + }, + { + "to": "\u002B1425555012345", + "httpStatusCode": 400, + "errorMessage": "Invalid To phone number format.", + "successful": false + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.js b/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.js deleted file mode 100644 index 9ab016178034..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "e63a7c0807966575ec1513c6eb0a2b17"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.json b/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.json new file mode 100644 index 000000000000..5247c8ca1920 --- /dev/null +++ b/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.json @@ -0,0 +1,57 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "bc396c55-2982-4894-9454-53ec3c763ac5" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:04 GMT", + "MS-CV": "tnsj5GZ8g0mzCtglDA/mqw.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0hPNlYgAAAABvx7rrxZhkQ56Ib8qMfV5FV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "499ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_2022042501040443608f64-aa24-40ee-8bb0-9b7079769b1d_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_sends_a_new_message_each_time_send_is_called.js b/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_sends_a_new_message_each_time_send_is_called.js deleted file mode 100644 index aeccf28f0d77..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_sends_a_new_message_each_time_send_is_called.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "ead77ee45b60a585c7ffd2d2bad4b030"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_sends_a_new_message_each_time_send_is_called.json b/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_sends_a_new_message_each_time_send_is_called.json new file mode 100644 index 000000000000..7a84c6d42594 --- /dev/null +++ b/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_sends_a_new_message_each_time_send_is_called.json @@ -0,0 +1,109 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "e939cdec-0dab-4b63-be60-308f4155ba4e" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:05 GMT", + "MS-CV": "H4hab3AfYU2d77UepDI2rA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0hfNlYgAAAABmDkH1/O0BTLuIN9hsg\u002BI9V1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "511ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_202204250104056f052deb-4060-4ac1-badc-956036d5d700_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + }, + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "6bdbe4b3-3b4a-40d2-a238-79d3a4cacc8e" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:06 GMT", + "MS-CV": "Kvr2oKTQGkSpz3wtZU/Vpw.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0hfNlYgAAAAAq5z9I/6D4QLb4kUJtqxjMV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "547ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_202204250104063aece869-b16d-4e31-a6ed-fd1af7479050_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.js b/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.js deleted file mode 100644 index 0a9e243a1d32..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "eeff82b8ae33893e424efcce27438830"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json b/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json new file mode 100644 index 000000000000..d21322b36a96 --- /dev/null +++ b/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json @@ -0,0 +1,52 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "9a350715-6aab-4693-a5da-86634bac011b" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 401, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json", + "Date": "Mon, 25 Apr 2022 01:04:08 GMT", + "MS-CV": "k786vwJDt0yqhdMxYd1JXQ.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0iPNlYgAAAACef58bqLbITpzg/GQCE4HpV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "426ms" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.js b/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.js deleted file mode 100644 index 6e461162f325..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "e40572f5ed6d1f0cd7c4a5809ef38226"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.json b/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.json new file mode 100644 index 000000000000..09c572160833 --- /dev/null +++ b/sdk/communication/communication-sms/recordings/node/smsclient_live_aad_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.json @@ -0,0 +1,50 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "253", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "7e141b5c-c1f8-439e-b382-2544ce14cfb0" + }, + "RequestBody": { + "from": "\u002B1425555012345", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:08 GMT", + "MS-CV": "/KcAPpZcNkmQORNAfTaKew.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0ifNlYgAAAACqQQFSfBACTJMmWUBl7kIOV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "12ms" + }, + "ResponseBody": { + "From": [ + "Invalid from phone number format." + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_can_send_an_sms_message.js b/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_can_send_an_sms_message.js deleted file mode 100644 index 84363f42a969..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_can_send_an_sms_message.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "40a36a477f7f16678261c29cc32a4387"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_can_send_an_sms_message.json b/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_can_send_an_sms_message.json new file mode 100644 index 000000000000..46eb2c185bc2 --- /dev/null +++ b/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_can_send_an_sms_message.json @@ -0,0 +1,58 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "230", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "77880525-032f-40a3-91c0-4ac4889ec3a2", + "x-ms-content-sha256": "BgPBpdoyAVI58c50tp84AQxrH4UWQmKBj1TN7/GfuO8=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:09 GMT" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": false + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:09 GMT", + "MS-CV": "/iNeXGRJNUyvhIgiClRmfQ.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0ifNlYgAAAAC5lxN2R7ksRbTbst9qq\u002BRsV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "513ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_2022042501040914d01119-b679-4b11-831d-ac9751418e02_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.js b/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.js deleted file mode 100644 index c3f4d3a7149b..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "c9d3b30b09556d605a1814b7cc66c2ba"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.json b/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.json new file mode 100644 index 000000000000..3d60326dbc78 --- /dev/null +++ b/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.json @@ -0,0 +1,69 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "348", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "c89106ed-752c-4e73-9d81-1dd3467f8899", + "x-ms-content-sha256": "7buRnUDTy/ee5k8ifF1z5TqcoyDX6AEPDYOC1YxGKAo=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:11 GMT" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + }, + { + "to": "\u002B1425555012345", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": false + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:11 GMT", + "MS-CV": "GiQSD5IngkuZhw4saWW1gQ.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0i/NlYgAAAAAPNR9nni5dTLnHdG\u002Bt7CjkV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "361ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220425010411fd4b36c2-c8ee-421f-9a51-1515b83b1ba5_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + }, + { + "to": "\u002B1425555012345", + "httpStatusCode": 400, + "errorMessage": "Invalid To phone number format.", + "successful": false + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.js b/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.js deleted file mode 100644 index 9ab016178034..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "e63a7c0807966575ec1513c6eb0a2b17"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.json b/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.json new file mode 100644 index 000000000000..aeb08a24931f --- /dev/null +++ b/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.json @@ -0,0 +1,59 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "746877af-74cc-48a9-b52a-cc53797ab574", + "x-ms-content-sha256": "KHbzzWN/RKBCOlrMJTJWvpWhIFL7gHFb1R921XsneEA=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:09 GMT" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:10 GMT", + "MS-CV": "8drq0bHFeUqODL8NNDWowg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0ifNlYgAAAADgWYwMVYMpQb2bIAtmhmU4V1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "532ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220425010410613ae3b5-d1aa-49d5-ad91-a8ed10c31da9_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_sends_a_new_message_each_time_send_is_called.js b/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_sends_a_new_message_each_time_send_is_called.js deleted file mode 100644 index aeccf28f0d77..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_sends_a_new_message_each_time_send_is_called.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "ead77ee45b60a585c7ffd2d2bad4b030"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_sends_a_new_message_each_time_send_is_called.json b/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_sends_a_new_message_each_time_send_is_called.json new file mode 100644 index 000000000000..61f82f3508de --- /dev/null +++ b/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_sends_a_new_message_each_time_send_is_called.json @@ -0,0 +1,113 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "6fa6007f-488e-43fc-aab3-a6434437d0fe", + "x-ms-content-sha256": "LgauvVVu\u002Bpwi3v7HMdBQecSkBMdhnLpViJewKH8nRYE=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:10 GMT" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:10 GMT", + "MS-CV": "8ER5e8WE4kCSgp60UhFrWg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0ivNlYgAAAABd4ugu4U2URLHGXQyQlo1bV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "515ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_202204250104103231508e-ba38-4456-8dce-e36ada8967ea_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + }, + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "5159977e-3342-413c-935a-624f004331d1", + "x-ms-content-sha256": "Ui41YDJws/gH\u002BvZ4Sy8ndfSNLdDoHZbm7H3RTdNNcE4=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:11 GMT" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:11 GMT", + "MS-CV": "YsW13/CdDEK1eVG5tkDA9A.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0ivNlYgAAAAD8RCoo\u002BZ5jSJXBG0ZyyZ1oV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "375ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_2022042501041138c5461a-d4e4-4e0c-99e0-9ab9e328006f_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.js b/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.js deleted file mode 100644 index 0a9e243a1d32..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "eeff82b8ae33893e424efcce27438830"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json b/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json new file mode 100644 index 000000000000..d661e9c577ce --- /dev/null +++ b/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json @@ -0,0 +1,54 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "81032775-1ced-4612-8292-276c132c9dfd", + "x-ms-content-sha256": "bp4bj7snvuzEht1k\u002BlPVr9AmQzpv3Gbg60Ku74wGLtQ=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:11 GMT" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 401, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json", + "Date": "Mon, 25 Apr 2022 01:04:11 GMT", + "MS-CV": "JPF98gAF/UaMw\u002BBuRdKCLw.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0i/NlYgAAAAD\u002BHOWDGnNNSo2Hr\u002BWUVlN6V1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "280ms" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.js b/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.js deleted file mode 100644 index 6e461162f325..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "e40572f5ed6d1f0cd7c4a5809ef38226"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.json b/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.json new file mode 100644 index 000000000000..01c72d16cfee --- /dev/null +++ b/sdk/communication/communication-sms/recordings/node/smsclient_live_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.json @@ -0,0 +1,52 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "253", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "4af5f16a-4def-4165-a39f-83dbaac59da3", + "x-ms-content-sha256": "9hMRtzMVb/hQXSadaMtso58GCT8dDrdXVkkAz\u002BbASzA=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:12 GMT" + }, + "RequestBody": { + "from": "\u002B1425555012345", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:12 GMT", + "MS-CV": "DNPh6/QJQUat2yWncrr7Gw.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0jPNlYgAAAAAst28ySAVPR4mkw1d55GhwV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "16ms" + }, + "ResponseBody": { + "From": [ + "Invalid from phone number format." + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message.js b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message.js deleted file mode 100644 index d4d8952114ad..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message.js +++ /dev/null @@ -1,135 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "40a36a477f7f16678261c29cc32a4387"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":true}) - .get('/common/discovery/instance') - .query(true) - .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/SomeTenantId/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '39dd7de9-8509-4828-9e19-2e2e59572c03', - 'x-ms-ests-server', - '2.1.11722.21 - NCUS ProdSlices', - 'Set-Cookie', - 'fpc=An8aJvjkv89FlfmGvJw55Uw; expires=Sat, 26-Jun-2021 20:29:05 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrIAl0Tk7CZgYfnpL7aGiKMhHPhTo2xJs75e49t2gdGiuRoaXbYQFArwx2cNt-0wZe-HFMQCreui9Srwhkhtc7pTVC6af1Q2eXOzlY74uc6xeF_vJAiseLJ-TvBrQh2jXuyyjLWe4k9yqZb7LTvb063GFDpolO29MxVeJ0j7wryFMgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Thu, 27 May 2021 20:29:04 GMT', - 'Content-Length', - '980' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .get('/SomeTenantId/v2.0/.well-known/openid-configuration') - .reply(200, {"token_endpoint":"https://login.microsoftonline.com/SomeTenantId/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/SomeTenantId/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/SomeTenantId/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/SomeTenantId/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/SomeTenantId/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/SomeTenantId/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - 'f81f51cd-28eb-4a78-9a5c-66358f3c3900', - 'x-ms-ests-server', - '2.1.11722.21 - NCUS ProdSlices', - 'Set-Cookie', - 'fpc=An8aJvjkv89FlfmGvJw55Uw; expires=Sat, 26-Jun-2021 20:29:05 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrqKynDS850nTqcb_ucHNBE34wc3DgJBlDB7PKN-VfhzNfS87hvIRjIgRhy8q2i9AwJS_hUTDe0HJeQVcFyYChZm6zXqVAu2lvfS8Me5zQzKP7ZxoG7xepKTijsCXOtALznVGTPOl7xy7SAzIRPP7gIr4eT8Xgjpd2pqla5naWY0ogAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Thu, 27 May 2021 20:29:04 GMT', - 'Content-Length', - '1651' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/SomeTenantId/oauth2/v2.0/token', "client_id=SomeClientId&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&client-request-id=4d10d2e3-9740-4d46-a770-933d9b60d8f7&client_secret=azure_client_secret") - .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"sanitized"}, [ - 'Cache-Control', - 'no-store, no-cache', - 'Pragma', - 'no-cache', - 'Content-Type', - 'application/json; charset=utf-8', - 'Expires', - '-1', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - 'c17c8575-3d06-4a25-aecd-db6ae42c3500', - 'x-ms-ests-server', - '2.1.11722.21 - EUS ProdSlices', - 'x-ms-clitelem', - '1,0,0,,', - 'Set-Cookie', - 'fpc=An8aJvjkv89FlfmGvJw55UyMQo4QAQAAABH4QdgOAAAA; expires=Sat, 26-Jun-2021 20:29:05 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Thu, 27 May 2021 20:29:04 GMT', - 'Content-Length', - '1327' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/sms', {"from":"+14255550123","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":false}}) - .query(true) - .reply(202, {"value":[{"to":"+14255550123","messageId":"Outgoing_20210527202905764df9f5-f3ad-4635-82ac-de1458b9e4f6_noam","httpStatusCode":202,"repeatabilityResult":"accepted","successful":true}]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Request-Context', - 'appId=', - 'MS-CV', - 'ZqD5ncDjq0Wl0JfPM80o5g.0', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '453ms', - 'X-Cache', - 'CONFIG_NOCACHE', - 'X-Azure-Ref', - '0EQGwYAAAAABUTyeWVRTeS7EAhcn/+a4AWVZSMzBFREdFMDQwOAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', - 'Date', - 'Thu, 27 May 2021 20:29:05 GMT' -]); diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message.json b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message.json new file mode 100644 index 000000000000..32c71e194766 --- /dev/null +++ b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message.json @@ -0,0 +1,56 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "230", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "c51da63d-f2c2-4d02-9b32-24c7f3fceab2" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": false + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:03:55 GMT", + "MS-CV": "rWW3AoS1dEGl2cqg5rOdng.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0evNlYgAAAABx8yZ5OkeTQJ0d/8ma/JKOV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "365ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220425010355b27eb82c-2b55-4d86-8c1f-da1f102de6f2_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.js b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.js deleted file mode 100644 index fd0621148293..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.js +++ /dev/null @@ -1,135 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "c9d3b30b09556d605a1814b7cc66c2ba"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":true}) - .get('/common/discovery/instance') - .query(true) - .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/SomeTenantId/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '34fb361a-0b79-48a3-8f4d-34e6246d3602', - 'x-ms-ests-server', - '2.1.11722.21 - NCUS ProdSlices', - 'Set-Cookie', - 'fpc=An8aJvjkv89FlfmGvJw55UyMQo4QAwAAABH4QdgOAAAA; expires=Sat, 26-Jun-2021 20:29:08 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrgaP1zxj85lLHly3Z6Tto1QhvC-COHngZXzChKgCxRoWAhiXEO8kmbSQBwzOfHL8O9wn4TV0YdxU8NzGHTfA3V8vfdgNjG94aLQkxnPD-QBpMJlefWH0naY3ZPCSKsMPHDzNZZaYYhMNGm5XFs8IidBsxUA76R04U_e33bOerJdQgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Thu, 27 May 2021 20:29:07 GMT', - 'Content-Length', - '980' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .get('/SomeTenantId/v2.0/.well-known/openid-configuration') - .reply(200, {"token_endpoint":"https://login.microsoftonline.com/SomeTenantId/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/SomeTenantId/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/SomeTenantId/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/SomeTenantId/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/SomeTenantId/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/SomeTenantId/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '937bc6da-0192-48e1-906f-92f2c0aa3900', - 'x-ms-ests-server', - '2.1.11722.21 - EUS ProdSlices', - 'Set-Cookie', - 'fpc=An8aJvjkv89FlfmGvJw55UyMQo4QAwAAABH4QdgOAAAA; expires=Sat, 26-Jun-2021 20:29:08 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr0TV_25CnTM1Tdshk24oLijYvIQxzGJ0QrDSQTei2c8kXl5vo_Q02Q5lQZhufokXuig6q9yLUSlpAUCahvz0x7_eHbc6h25r4l5WYrxD3MrjBObx4VMR4ZLnHrtNJH_44l7WvQ2fuXXw3rkd5WBJGavqyyi1t9NiSoAwDvlIJcTAgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Thu, 27 May 2021 20:29:08 GMT', - 'Content-Length', - '1651' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/SomeTenantId/oauth2/v2.0/token', "client_id=SomeClientId&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&client-request-id=e5401dcb-275e-4fd4-a8bb-f85e67cb0b40&client_secret=azure_client_secret") - .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"sanitized"}, [ - 'Cache-Control', - 'no-store, no-cache', - 'Pragma', - 'no-cache', - 'Content-Type', - 'application/json; charset=utf-8', - 'Expires', - '-1', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '88a09481-aea9-44fa-a8a8-7527da133800', - 'x-ms-ests-server', - '2.1.11722.21 - NCUS ProdSlices', - 'x-ms-clitelem', - '1,0,0,,', - 'Set-Cookie', - 'fpc=An8aJvjkv89FlfmGvJw55UyMQo4QBAAAABH4QdgOAAAA; expires=Sat, 26-Jun-2021 20:29:08 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Thu, 27 May 2021 20:29:08 GMT', - 'Content-Length', - '1327' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/sms', {"from":"+14255550123","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"},{"to":"+1425555012345","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":false}}) - .query(true) - .reply(202, {"value":[{"to":"+14255550123","messageId":"Outgoing_202105272029096dc2d7c7-c7a5-4eea-a441-a4ead65db22e_noam","httpStatusCode":202,"repeatabilityResult":"accepted","successful":true},{"to":"+1425555012345","httpStatusCode":400,"errorMessage":"Invalid To phone number format.","successful":false}]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Request-Context', - 'appId=', - 'MS-CV', - 'yVtgbNkXrkydf7SLDpruYA.0', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '594ms', - 'X-Cache', - 'CONFIG_NOCACHE', - 'X-Azure-Ref', - '0FAGwYAAAAAAor5fOH2++TbQcH4rLHHi4WVZSMzBFREdFMDQwOAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', - 'Date', - 'Thu, 27 May 2021 20:29:08 GMT' -]); diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.json b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.json new file mode 100644 index 000000000000..1b765f82943e --- /dev/null +++ b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.json @@ -0,0 +1,67 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "348", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "a2923ccc-35be-4343-a3ab-a9faae21c52f" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + }, + { + "to": "\u002B1425555012345", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": false + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:03:58 GMT", + "MS-CV": "mSiCUAszwkWPJ7/\u002Bzliu\u002BA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0fvNlYgAAAACRB1ZqesgZRIvOGsQoaKZRV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "364ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220425010358a8e86c86-efe7-49ec-8b3c-837ac2379cab_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + }, + { + "to": "\u002B1425555012345", + "httpStatusCode": 400, + "errorMessage": "Invalid To phone number format.", + "successful": false + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.js b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.js deleted file mode 100644 index 920c6f26ce8e..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.js +++ /dev/null @@ -1,135 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "e63a7c0807966575ec1513c6eb0a2b17"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":true}) - .get('/common/discovery/instance') - .query(true) - .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/SomeTenantId/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Length', - '980', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '4e450aff-e68c-41e9-913c-e91a839f0f02', - 'x-ms-ests-server', - '2.1.11722.21 - NCUS ProdSlices', - 'Set-Cookie', - 'fpc=An8aJvjkv89FlfmGvJw55UyMQo4QAQAAABH4QdgOAAAA; expires=Sat, 26-Jun-2021 20:29:06 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrbfsmG8fr1RhS2Qv7tDa8U5sAE23A-IYP-5zHWoN5N9GoOkxjMWFUnTOCu5F0512hi8pCSxMsXn51imrEgFt_mXpnbGWx-ZFNeXOi0S5nva4y2py9GEfG_kIVeYylqIXXnnG2ybAZ-nPg6mnKd7YLjSzzqIiXW-UecjKyi7kN-p4gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Thu, 27 May 2021 20:29:05 GMT' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .get('/SomeTenantId/v2.0/.well-known/openid-configuration') - .reply(200, {"token_endpoint":"https://login.microsoftonline.com/SomeTenantId/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/SomeTenantId/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/SomeTenantId/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/SomeTenantId/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/SomeTenantId/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/SomeTenantId/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '1d38f11b-bf66-4290-9b3c-fee1a9b53100', - 'x-ms-ests-server', - '2.1.11722.21 - SCUS ProdSlices', - 'Set-Cookie', - 'fpc=An8aJvjkv89FlfmGvJw55UyMQo4QAQAAABH4QdgOAAAA; expires=Sat, 26-Jun-2021 20:29:06 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrf2mjE7BAuI-1GyaqmwcooO7nxx9A9U_b6867UwDCn44b7r2dYKH8tJtMmEN20YLa5Q-ZLd00ZTnX_77KM8KbD0Yv2kEpOKDblmyThDrofKBuM4g0HjCdBBVfYH66dX1vyKTfNdM1rG40ove1kvnMRMZwn0S4WviEO77aBqfXJF4gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Thu, 27 May 2021 20:29:05 GMT', - 'Content-Length', - '1651' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/SomeTenantId/oauth2/v2.0/token', "client_id=SomeClientId&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&client-request-id=aeabd791-df32-414b-8db4-6c98bf24d150&client_secret=azure_client_secret") - .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"sanitized"}, [ - 'Cache-Control', - 'no-store, no-cache', - 'Pragma', - 'no-cache', - 'Content-Type', - 'application/json; charset=utf-8', - 'Expires', - '-1', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '2a0db59b-a9de-42a9-9c48-cf213c7a3f00', - 'x-ms-ests-server', - '2.1.11722.21 - EUS ProdSlices', - 'x-ms-clitelem', - '1,0,0,,', - 'Set-Cookie', - 'fpc=An8aJvjkv89FlfmGvJw55UyMQo4QAgAAABH4QdgOAAAA; expires=Sat, 26-Jun-2021 20:29:06 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Thu, 27 May 2021 20:29:05 GMT', - 'Content-Length', - '1327' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/sms', {"from":"+14255550123","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":true,"tag":"SMS_LIVE_TEST"}}) - .query(true) - .reply(202, {"value":[{"to":"+14255550123","messageId":"Outgoing_20210527202906de23b54e-52fb-4fb5-8610-08b19aa8d507_noam","httpStatusCode":202,"repeatabilityResult":"accepted","successful":true}]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Request-Context', - 'appId=', - 'MS-CV', - '6/KLbp17rUuG6bnQdPFQkA.0', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '447ms', - 'X-Cache', - 'CONFIG_NOCACHE', - 'X-Azure-Ref', - '0EgGwYAAAAACnnxoT1UQpT61J9snPcIxrWVZSMzBFREdFMDQwOAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', - 'Date', - 'Thu, 27 May 2021 20:29:06 GMT' -]); diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.json b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.json new file mode 100644 index 000000000000..87b9b9aaae78 --- /dev/null +++ b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.json @@ -0,0 +1,57 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "08dffd32-2c97-4154-8ac7-16e377a17604" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:03:56 GMT", + "MS-CV": "uiLgdf2c802pJ8N8NXeeHQ.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0e/NlYgAAAACJcDIiUx2HQoUzgcbWzo6OV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "358ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220425010356a996b943-59e4-42e1-b899-36417199c3a9_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.js b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.js deleted file mode 100644 index c50967724445..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.js +++ /dev/null @@ -1,159 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "ead77ee45b60a585c7ffd2d2bad4b030"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":true}) - .get('/common/discovery/instance') - .query(true) - .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/SomeTenantId/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '1e79af0f-8b85-4ca9-9a32-f597de203102', - 'x-ms-ests-server', - '2.1.11722.21 - NCUS ProdSlices', - 'Set-Cookie', - 'fpc=An8aJvjkv89FlfmGvJw55UyMQo4QAgAAABH4QdgOAAAA; expires=Sat, 26-Jun-2021 20:29:07 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr3Wo1Ynw73QCBhfJ4QFHIdDu7XoyHOzBA8rvwM6DOtCTCw5EU8cE2cjWl7bRUDtHTbSVmwfsMxzhLhnhOjOP_5pbN6QMLRdPaxRbh-_buX8IyDDcROlcoVlfZopDnGWETmdPOTW6FlmyVISzdemvdRTyAS7DYUNkpQrRUmOMZFMQgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Thu, 27 May 2021 20:29:06 GMT', - 'Content-Length', - '980' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .get('/SomeTenantId/v2.0/.well-known/openid-configuration') - .reply(200, {"token_endpoint":"https://login.microsoftonline.com/SomeTenantId/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/SomeTenantId/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/SomeTenantId/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/SomeTenantId/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/SomeTenantId/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/SomeTenantId/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '2a0db59b-a9de-42a9-9c48-cf215a7a3f00', - 'x-ms-ests-server', - '2.1.11722.21 - EUS ProdSlices', - 'Set-Cookie', - 'fpc=An8aJvjkv89FlfmGvJw55UyMQo4QAgAAABH4QdgOAAAA; expires=Sat, 26-Jun-2021 20:29:07 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrN6P27MrkNg88TBrsWMzpzepCJ55e44haUW5SHP6cV7F-3GKM4_FlvfIFtwg5A5FwRuZRnH02z5nrlHkW65g2YquqF0IRsaBKdtX2hJOu6vU62XdBAjP9khyliVkogOtqsC9LE-3w66zKm02NUujhsIe1_YwXc08gUu0z_ahPut4gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Thu, 27 May 2021 20:29:06 GMT', - 'Content-Length', - '1651' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/SomeTenantId/oauth2/v2.0/token', "client_id=SomeClientId&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&client-request-id=0e6c9a53-e879-423a-a78f-319c80caa605&client_secret=azure_client_secret") - .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"sanitized"}, [ - 'Cache-Control', - 'no-store, no-cache', - 'Pragma', - 'no-cache', - 'Content-Type', - 'application/json; charset=utf-8', - 'Expires', - '-1', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - 'f81f51cd-28eb-4a78-9a5c-6635ef3c3900', - 'x-ms-ests-server', - '2.1.11722.21 - NCUS ProdSlices', - 'x-ms-clitelem', - '1,0,0,,', - 'Set-Cookie', - 'fpc=An8aJvjkv89FlfmGvJw55UyMQo4QAwAAABH4QdgOAAAA; expires=Sat, 26-Jun-2021 20:29:07 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Thu, 27 May 2021 20:29:06 GMT', - 'Content-Length', - '1327' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/sms', {"from":"+14255550123","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":true,"tag":"SMS_LIVE_TEST"}}) - .query(true) - .reply(202, {"value":[{"to":"+14255550123","messageId":"Outgoing_2021052720290784cb5efb-e912-4243-b50b-e1b69c215f2b_noam","httpStatusCode":202,"repeatabilityResult":"accepted","successful":true}]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Request-Context', - 'appId=', - 'MS-CV', - 'ZrQeW3u9Hk+NsneSpBYWYw.0', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '596ms', - 'X-Cache', - 'CONFIG_NOCACHE', - 'X-Azure-Ref', - '0EwGwYAAAAADlJD1VOcvXQIubMSJZLXsUWVZSMzBFREdFMDQwOAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', - 'Date', - 'Thu, 27 May 2021 20:29:07 GMT' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/sms', {"from":"+14255550123","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":true,"tag":"SMS_LIVE_TEST"}}) - .query(true) - .reply(202, {"value":[{"to":"+14255550123","messageId":"Outgoing_2021052720290863b227be-ea83-46c8-84f2-918c1b8e77a8_noam","httpStatusCode":202,"repeatabilityResult":"accepted","successful":true}]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Request-Context', - 'appId=', - 'MS-CV', - 'Nkv+pI/xbEiQxrS+lqgrFQ.0', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '445ms', - 'X-Cache', - 'CONFIG_NOCACHE', - 'X-Azure-Ref', - '0FAGwYAAAAACAmxNSYzYZRJY29giSLHGSWVZSMzBFREdFMDQwOAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', - 'Date', - 'Thu, 27 May 2021 20:29:07 GMT' -]); diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.json b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.json new file mode 100644 index 000000000000..10912a112bd5 --- /dev/null +++ b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.json @@ -0,0 +1,109 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "6d3d3cc0-bfe6-4f87-8719-b8a48db44560" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:03:57 GMT", + "MS-CV": "XTpcfpZ/b0eb8WEOjTZV\u002BA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0fPNlYgAAAABYEaJ1XjGtQZ32T8iDZ2Q5V1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "354ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220425010357d275e215-5c51-4e7a-ab78-3cbfee5caa5b_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + }, + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "8676bb00-0953-44f6-ba01-0e1244db08f0" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:03:57 GMT", + "MS-CV": "vO/iNtefaEiSLJey\u002BkAWvQ.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0ffNlYgAAAAD6sB0w79qtT7jFlHh2Bl09V1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "376ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220425010357fdfd6640-68e1-41bf-8990-09f7dcd00eb2_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.js b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.js deleted file mode 100644 index 2d4bc2fbbd08..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.js +++ /dev/null @@ -1,133 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "a7dbd7ed4811fa01946ced50fd8c3336"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":true}) - .get('/common/discovery/instance') - .query(true) - .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/SomeTenantId/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '7e3acf1a-8680-47c5-9980-419915519801', - 'x-ms-ests-server', - '2.1.11722.21 - NCUS ProdSlices', - 'Set-Cookie', - 'fpc=An8aJvjkv89FlfmGvJw55UyMQo4QBAAAABH4QdgOAAAA; expires=Sat, 26-Jun-2021 20:29:09 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrkj-dpQHi8fvBW53_c03raVi0vs3g7P1IpGMoj40gumEiNlQT2rBzrRzhxAFL6VgT0Ho-5jVNJYq4C_X8VVjHKrEpDZiQS8eYdBta30gfvgy_w1oTVSB5x02y9maDK4oeYzaBO7SU-r0uDkKUdsDJUc4vNxgKePS3GMXLXxcQyywgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Thu, 27 May 2021 20:29:08 GMT', - 'Content-Length', - '980' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .get('/SomeTenantId/v2.0/.well-known/openid-configuration') - .reply(200, {"token_endpoint":"https://login.microsoftonline.com/SomeTenantId/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/SomeTenantId/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/SomeTenantId/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/SomeTenantId/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/SomeTenantId/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/SomeTenantId/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - 'c17c8575-3d06-4a25-aecd-db6a862d3500', - 'x-ms-ests-server', - '2.1.11722.21 - EUS ProdSlices', - 'Set-Cookie', - 'fpc=An8aJvjkv89FlfmGvJw55UyMQo4QBAAAABH4QdgOAAAA; expires=Sat, 26-Jun-2021 20:29:09 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrV3UFzdt90UqQUkooAeG-aoKGCtsn2DKiJZm40pnPN2FZVQWKZ_arlR4tpcvAGr7bHhHZWHuvxbzeZRg8nhTaJ5-O-V8bqo1IZCRXKvupo5zQ54HW6EfpECe0to6Mqx5QZAJ3FgSfxZQuoNjP9NDnIv6CvCj3lgbf2_rZc26vp30gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Thu, 27 May 2021 20:29:09 GMT', - 'Content-Length', - '1651' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/SomeTenantId/oauth2/v2.0/token', "client_id=SomeClientId&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&client-request-id=10eda0f7-ca0b-4f68-a814-abcb1d979b71&client_secret=azure_client_secret") - .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"sanitized"}, [ - 'Cache-Control', - 'no-store, no-cache', - 'Pragma', - 'no-cache', - 'Content-Type', - 'application/json; charset=utf-8', - 'Expires', - '-1', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '4d0cc186-fd91-4969-8f3b-367182e03100', - 'x-ms-ests-server', - '2.1.11722.21 - NCUS ProdSlices', - 'x-ms-clitelem', - '1,0,0,,', - 'Set-Cookie', - 'fpc=An8aJvjkv89FlfmGvJw55UyMQo4QBQAAABH4QdgOAAAA; expires=Sat, 26-Jun-2021 20:29:09 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Thu, 27 May 2021 20:29:09 GMT', - 'Content-Length', - '1327' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/sms', {"from":"+14255550123","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":true,"tag":"SMS_LIVE_TEST"}}) - .query(true) - .reply(401, "", [ - 'Request-Context', - 'appId=', - 'MS-CV', - 'pTAPzeFkMEyLLGjqzSr+Nw.0', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '416ms', - 'X-Cache', - 'CONFIG_NOCACHE', - 'X-Azure-Ref', - '0FQGwYAAAAACiE7Qijsh4TrSHRunUqP1SWVZSMzBFREdFMDQwOAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', - 'Date', - 'Thu, 27 May 2021 20:29:09 GMT', - 'Content-Length', - '0' -]); diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json new file mode 100644 index 000000000000..2a5799f4a9f4 --- /dev/null +++ b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json @@ -0,0 +1,52 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "a43a3d7c-1fc5-4432-9cbc-3e6e122e8292" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 401, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json", + "Date": "Mon, 25 Apr 2022 01:03:59 GMT", + "MS-CV": "5i0fzXLj8Ei7HNIQqgu2mA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0f/NlYgAAAAB9vH15sOoUR4KE6yCiwq8BV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "275ms" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.js b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.js deleted file mode 100644 index 9d53e41973d4..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.js +++ /dev/null @@ -1,133 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "e40572f5ed6d1f0cd7c4a5809ef38226"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":true}) - .get('/common/discovery/instance') - .query(true) - .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/SomeTenantId/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Length', - '980', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '79ed6191-897d-4dfd-924d-9ec23e320c00', - 'x-ms-ests-server', - '2.1.11722.21 - WUS2 ProdSlices', - 'Set-Cookie', - 'fpc=An8aJvjkv89FlfmGvJw55UyMQo4QBQAAABH4QdgOAAAA; expires=Sat, 26-Jun-2021 20:29:10 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrN3-sT-lkX_Iew10TwlmO77QOWObJg3FOTznlKFp-aJQX7Wv9BG7qr6XK9B-r5o7vpJ2_Fe-LJazF7VYQRS24T-k3cPoMRFb40n_iusHR3O8Wv1lUs1UgN4PGLlIEq8nfgZhBR2VoTVxBrh1aSpESn_tvABaqdfSzn1JzJDYgXZMgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Thu, 27 May 2021 20:29:09 GMT' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .get('/SomeTenantId/v2.0/.well-known/openid-configuration') - .reply(200, {"token_endpoint":"https://login.microsoftonline.com/SomeTenantId/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/SomeTenantId/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/SomeTenantId/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/SomeTenantId/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/SomeTenantId/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/SomeTenantId/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - 'ca966073-a41b-4041-8283-4e5cd5e62e00', - 'x-ms-ests-server', - '2.1.11722.21 - NCUS ProdSlices', - 'Set-Cookie', - 'fpc=An8aJvjkv89FlfmGvJw55UyMQo4QBQAAABH4QdgOAAAA; expires=Sat, 26-Jun-2021 20:29:10 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrSqZ-JmOAa-bn0S8jNYMII7r4ZyB-AKkfH3YHNGl8Z10C0ndFzEhHsUSww-Taa1eH3jekJuaY4t8B7T-873jCcfX_vH5Ub0KJqow2k2UzA_YO5hC0IEmu2ALeeWq8UA8w0lLT9dCtB0Dpnavh7TBPc3DlR5GYDFvgaicYEadPl2cgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Thu, 27 May 2021 20:29:09 GMT', - 'Content-Length', - '1651' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/SomeTenantId/oauth2/v2.0/token', "client_id=SomeClientId&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&client-request-id=4830c82c-d7ff-4e21-90f9-f1aee8c0f8bf&client_secret=azure_client_secret") - .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"sanitized"}, [ - 'Cache-Control', - 'no-store, no-cache', - 'Pragma', - 'no-cache', - 'Content-Type', - 'application/json; charset=utf-8', - 'Expires', - '-1', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '1307d250-65cd-44fd-8e29-66c696c23700', - 'x-ms-ests-server', - '2.1.11722.21 - EUS ProdSlices', - 'x-ms-clitelem', - '1,0,0,,', - 'Set-Cookie', - 'fpc=An8aJvjkv89FlfmGvJw55UyMQo4QBgAAABH4QdgOAAAA; expires=Sat, 26-Jun-2021 20:29:10 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Thu, 27 May 2021 20:29:09 GMT', - 'Content-Length', - '1327' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/sms', {"from":"+1425555012345","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":true,"tag":"SMS_LIVE_TEST"}}) - .query(true) - .reply(400, {"From":["Invalid From phone number format"]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Request-Context', - 'appId=', - 'MS-CV', - 'SA/l67NMckGa+pCzB5VtxQ.0', - 'X-Processing-Time', - '11ms', - 'X-Cache', - 'CONFIG_NOCACHE', - 'X-Azure-Ref', - '0FgGwYAAAAADFHz0JYh2eTrQBy5dYuC+wWVZSMzBFREdFMDQwOAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', - 'Date', - 'Thu, 27 May 2021 20:29:09 GMT' -]); diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.json b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.json new file mode 100644 index 000000000000..6cc04e204c0e --- /dev/null +++ b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.json @@ -0,0 +1,50 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "253", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "5cb10264-a62f-4dea-b1b1-23e62b16f482" + }, + "RequestBody": { + "from": "\u002B1425555012345", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:03:59 GMT", + "MS-CV": "ZSBTP97vPkGztb/6bjFldw.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0f/NlYgAAAACtBuSTLhy2QrUYxY2wyOjmV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "11ms" + }, + "ResponseBody": { + "From": [ + "Invalid from phone number format." + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message.js b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message.js deleted file mode 100644 index e3e4048ee8be..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message.js +++ /dev/null @@ -1,27 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "40a36a477f7f16678261c29cc32a4387"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/sms', {"from":"+14255550123","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":false}}) - .query(true) - .reply(202, {"value":[{"to":"+14255550123","messageId":"Outgoing_20210414013827e95f8f5b-c129-4a1a-a39e-7d06a437c854_noam","httpStatusCode":202,"repeatabilityResult":"accepted","successful":true}]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Request-Context', - 'appId=', - 'MS-CV', - 'mRsHX8x4wEeYDPkyEw5Npg.0', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '407ms', - 'X-Azure-Ref', - '0k0d2YAAAAACd8L/11PytR4y2EsXVWYu8WVZSMzBFREdFMDQwNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', - 'Date', - 'Wed, 14 Apr 2021 01:38:27 GMT' -]); diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message.json b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message.json new file mode 100644 index 000000000000..b8510778196f --- /dev/null +++ b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message.json @@ -0,0 +1,58 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "230", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "53805160-51a6-4865-a8e6-a8df1ea905be", + "x-ms-content-sha256": "rZuFezFp9Bf9SOe3BjKG7M/1NanTe\u002BoKIKNWJKiG788=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:00 GMT" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": false + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:00 GMT", + "MS-CV": "wSTvc96LfUSkH4RxfxMyXQ.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0gPNlYgAAAAC86pTJUZhKTJtWMnlxAynLV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "471ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220425010400c788c66a-2904-4eb6-9f3c-45f9889cf87e_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.js b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.js deleted file mode 100644 index fe0dbd08d03a..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.js +++ /dev/null @@ -1,27 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "c9d3b30b09556d605a1814b7cc66c2ba"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/sms', {"from":"+14255550123","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"},{"to":"+1425555012345","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":false}}) - .query(true) - .reply(202, {"value":[{"to":"+14255550123","messageId":"Outgoing_20210414013829167f51fa-45ff-4106-85dd-81c0b715bce2_noam","httpStatusCode":202,"repeatabilityResult":"accepted","successful":true},{"to":"+1425555012345","httpStatusCode":400,"errorMessage":"Invalid To phone number format.","successful":false}]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Request-Context', - 'appId=', - 'MS-CV', - 'jXQLy02CnEG2oCceCgOsng.0', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '419ms', - 'X-Azure-Ref', - '0lUd2YAAAAACG02ZTQVQ+TYol7gfNMZ1aWVZSMzBFREdFMDQwNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', - 'Date', - 'Wed, 14 Apr 2021 01:38:29 GMT' -]); diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.json b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.json new file mode 100644 index 000000000000..d6af96e6451e --- /dev/null +++ b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.json @@ -0,0 +1,69 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "348", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "0dd75d29-87ce-4453-b543-545847c2f5a6", + "x-ms-content-sha256": "T10tIgymYZRSEer6DFSYYLDktdUlpmkA9tqJU9A7yRU=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:02 GMT" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + }, + { + "to": "\u002B1425555012345", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": false + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:02 GMT", + "MS-CV": "mmxgnlkoAU29ODZwnnX9Gw.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0gfNlYgAAAACtre0mucfpTrSwKDMmHQcnV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "362ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_2022042501040280bd8bb7-6b3a-4a9a-827f-06e2a3fb1f48_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + }, + { + "to": "\u002B1425555012345", + "httpStatusCode": 400, + "errorMessage": "Invalid To phone number format.", + "successful": false + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.js b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.js deleted file mode 100644 index c867fff68672..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.js +++ /dev/null @@ -1,27 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "e63a7c0807966575ec1513c6eb0a2b17"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/sms', {"from":"+14255550123","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":true,"tag":"SMS_LIVE_TEST"}}) - .query(true) - .reply(202, {"value":[{"to":"+14255550123","messageId":"Outgoing_2021041401382882bd6c8f-ea22-4cba-aaa5-500a23ca1031_noam","httpStatusCode":202,"repeatabilityResult":"accepted","successful":true}]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Request-Context', - 'appId=', - 'MS-CV', - 'mJZriLyLgE6zuBi8rGCfwg.0', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '468ms', - 'X-Azure-Ref', - '0k0d2YAAAAACEfy5ivpcmTo6xRbM0pCApWVZSMzBFREdFMDQwNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', - 'Date', - 'Wed, 14 Apr 2021 01:38:27 GMT' -]); diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.json b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.json new file mode 100644 index 000000000000..d0c0e5711b6a --- /dev/null +++ b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.json @@ -0,0 +1,59 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "5943d040-f570-40d2-b3ec-420aaa085221", + "x-ms-content-sha256": "qNsE7Gphk84P6bROmeam\u002BpFxSQaIbKk4hOdcI2JoeSI=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:00 GMT" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:00 GMT", + "MS-CV": "CU5mbBcI30y4Z8Hqnsu88Q.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0gPNlYgAAAABTlxvMlniqQ7xM2H6AtO\u002BGV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "371ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220425010400de09950b-d3ed-4764-832d-9623291650ce_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.js b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.js deleted file mode 100644 index 16aa1ba4604c..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.js +++ /dev/null @@ -1,49 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "ead77ee45b60a585c7ffd2d2bad4b030"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/sms', {"from":"+14255550123","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":true,"tag":"SMS_LIVE_TEST"}}) - .query(true) - .reply(202, {"value":[{"to":"+14255550123","messageId":"Outgoing_20210414013828e5905091-e190-4c5b-a79e-c8495fe7fb3f_noam","httpStatusCode":202,"repeatabilityResult":"accepted","successful":true}]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Request-Context', - 'appId=', - 'MS-CV', - 'ZmYnkPzSP0etITBUhXEvdQ.0', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '412ms', - 'X-Azure-Ref', - '0lEd2YAAAAABXDbz5AlT+TZ5eW7djv1CDWVZSMzBFREdFMDQwNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', - 'Date', - 'Wed, 14 Apr 2021 01:38:28 GMT' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/sms', {"from":"+14255550123","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":true,"tag":"SMS_LIVE_TEST"}}) - .query(true) - .reply(202, {"value":[{"to":"+14255550123","messageId":"Outgoing_2021041401382933eb6bdb-b494-49dc-9a5a-d95412248c25_noam","httpStatusCode":202,"repeatabilityResult":"accepted","successful":true}]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Request-Context', - 'appId=', - 'MS-CV', - 'YZp5v4EUqEW9suYFg98xoQ.0', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '466ms', - 'X-Azure-Ref', - '0lEd2YAAAAACGCcWlRThPQqKWH2+WNvWDWVZSMzBFREdFMDQwNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', - 'Date', - 'Wed, 14 Apr 2021 01:38:28 GMT' -]); diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.json b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.json new file mode 100644 index 000000000000..cca958170324 --- /dev/null +++ b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.json @@ -0,0 +1,113 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "30ee5279-19bf-4647-af95-cb9c084ded20", + "x-ms-content-sha256": "7/QQDPWyCi8rnVYIic\u002BT0\u002BMrJAT/VT2CYFm52JdD8t8=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:01 GMT" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:01 GMT", + "MS-CV": "YbzD5z8PWUag/w28Y/rxaA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0gfNlYgAAAABhNythwFs9TJpH1geRB2xzV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "360ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_202204250104017625f067-6ba9-4e59-af70-eb35deeb3f9f_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + }, + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "13e0f3fc-cfd7-48d3-b642-25d5be06dbc8", + "x-ms-content-sha256": "e7y1sqbyGU3BYAT4erPWR95FFtUz8ofB7OTgvGBDiRo=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:01 GMT" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:01 GMT", + "MS-CV": "CZFcVibWbEuV1HTkE02i6Q.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0gfNlYgAAAABAIVKZMHfQQaz/apt/kT/wV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "370ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_2022042501040140bccebb-6b13-4f34-994b-9a9a18a1155d_noam", + "httpStatusCode": 202, + "repeatabilityResult": "accepted", + "successful": true + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.js b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.js deleted file mode 100644 index 5ed8985d0d3c..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.js +++ /dev/null @@ -1,25 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "5696e18bc3ef230575e50ba9cb548bad"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/sms', {"from":"+14255550123","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":true,"tag":"SMS_LIVE_TEST"}}) - .query(true) - .reply(401, "", [ - 'Request-Context', - 'appId=', - 'MS-CV', - 'e6rke9G8Bk2tqTrxOH4EeQ.0', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '306ms', - 'X-Azure-Ref', - '06nmDYAAAAADsunLiwVOER7aRsbyDgCtiWVZSMzBFREdFMDQwNwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', - 'Date', - 'Sat, 24 Apr 2021 01:52:42 GMT', - 'Content-Length', - '0' -]); diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json new file mode 100644 index 000000000000..aaa9aa376ae4 --- /dev/null +++ b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.json @@ -0,0 +1,54 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "251", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "7ca9a3ab-a60e-42c7-b632-2212382ed164", + "x-ms-content-sha256": "rtEPrnBXfBDFJEeZrYRIXabwzQcI58eGkOYVbFVroG0=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:02 GMT" + }, + "RequestBody": { + "from": "\u002B14255550123", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 401, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json", + "Date": "Mon, 25 Apr 2022 01:04:02 GMT", + "MS-CV": "Ic2wM2Jln0e6hOox5M0FVg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0gvNlYgAAAADYfTcIbeskRqhLu1gdpTUPV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "282ms" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.js b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.js deleted file mode 100644 index f1525d17200c..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.js +++ /dev/null @@ -1,25 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "e40572f5ed6d1f0cd7c4a5809ef38226"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/sms', {"from":"+1425555012345","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":true,"tag":"SMS_LIVE_TEST"}}) - .query(true) - .reply(400, {"From":["Invalid From phone number format"]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Request-Context', - 'appId=', - 'MS-CV', - '9y0LcN9MpkmVEkVsayiwnA.0', - 'X-Processing-Time', - '12ms', - 'X-Azure-Ref', - '0lkd2YAAAAAB8XcFMgXW0QK0fz3sxKSHjWVZSMzBFREdFMDQwNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', - 'Date', - 'Wed, 14 Apr 2021 01:38:29 GMT' -]); diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.json b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.json new file mode 100644 index 000000000000..d5b28a453661 --- /dev/null +++ b/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.json @@ -0,0 +1,52 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/sms?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "253", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-communication-sms/1.2.0-beta.1 core-rest-pipeline/1.8.0 Node/v14.17.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "b475f380-e901-4106-8547-773aa56ceac9", + "x-ms-content-sha256": "8xUEyGiCqPDmQ7J/gRvnP6BZG85v7a9nYKTVfFjWq2k=", + "x-ms-date": "Mon, 25 Apr 2022 01:04:02 GMT" + }, + "RequestBody": { + "from": "\u002B1425555012345", + "smsRecipients": [ + { + "to": "\u002B14255550123", + "repeatabilityRequestId": "sanitized", + "repeatabilityFirstSent": "Thu, 01 Jan 1970 00:00:00 GMT" + } + ], + "message": "test message", + "smsSendOptions": { + "enableDeliveryReport": true, + "tag": "SMS_LIVE_TEST" + } + }, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 25 Apr 2022 01:04:02 GMT", + "MS-CV": "XLxsrPROEEGsMnAP6kvGCQ.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0gvNlYgAAAABomD1KVJr4QrWgb4dWy\u002BVlV1NURURHRTA4MTUAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "17ms" + }, + "ResponseBody": { + "From": [ + "Invalid from phone number format." + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_live_test_send_method/recording_can_send_an_sms_message.js b/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_live_test_send_method/recording_can_send_an_sms_message.js deleted file mode 100644 index 84363f42a969..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_live_test_send_method/recording_can_send_an_sms_message.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "40a36a477f7f16678261c29cc32a4387"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_live_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.js b/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_live_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.js deleted file mode 100644 index c3f4d3a7149b..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_live_test_send_method/recording_can_send_an_sms_message_to_multiple_recipients.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "c9d3b30b09556d605a1814b7cc66c2ba"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_live_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.js b/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_live_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.js deleted file mode 100644 index 9ab016178034..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_live_test_send_method/recording_can_send_an_sms_message_with_options_passed_in.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "e63a7c0807966575ec1513c6eb0a2b17"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_live_test_send_method/recording_sends_a_new_message_each_time_send_is_called.js b/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_live_test_send_method/recording_sends_a_new_message_each_time_send_is_called.js deleted file mode 100644 index aeccf28f0d77..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_live_test_send_method/recording_sends_a_new_message_each_time_send_is_called.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "ead77ee45b60a585c7ffd2d2bad4b030"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_live_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.js b/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_live_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.js deleted file mode 100644 index 0a9e243a1d32..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_live_test_send_method/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "eeff82b8ae33893e424efcce27438830"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_live_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.js b/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_live_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.js deleted file mode 100644 index 6e461162f325..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_live_test_send_method/recording_throws_an_exception_when_sending_from_an_invalid_number.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "e40572f5ed6d1f0cd7c4a5809ef38226"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_playbackrecord_when_sending_sms/recording_can_send_an_sms_message.js b/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_playbackrecord_when_sending_sms/recording_can_send_an_sms_message.js deleted file mode 100644 index 2c53fc7e78bf..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_playbackrecord_when_sending_sms/recording_can_send_an_sms_message.js +++ /dev/null @@ -1,60 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "40a36a477f7f16678261c29cc32a4387"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/SomeTenantId/oauth2/v2.0/token', "response_type=token&grant_type=client_credentials&client_id=SomeClientId&client_secret=azure_client_secret&scope=https%3A%2F%2Fcommunication.azure.com%2F%2F.default") - .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"sanitized"}, [ - 'Cache-Control', - 'no-store, no-cache', - 'Pragma', - 'no-cache', - 'Content-Length', - '1327', - 'Content-Type', - 'application/json; charset=utf-8', - 'Expires', - '-1', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '3359bd3b-3359-48c8-96a7-8e9423e43100', - 'x-ms-ests-server', - '2.1.11654.13 - WUS2 ProdSlices', - 'Set-Cookie', - 'fpc=AsZBMvdV-e5EuFb5Bt9qQ6aMQo4QBgAAAI8-CNgOAAAA; expires=Fri, 14-May-2021 01:38:30 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 14 Apr 2021 01:38:29 GMT' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/sms', {"from":"+14255550123","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":false}}) - .query(true) - .reply(202, {"value":[{"to":"+14255550123","messageId":"Outgoing_202104140138308e753bfc-7c54-4ed2-85dc-5ea6cec184af_noam","httpStatusCode":202,"repeatabilityResult":"accepted","successful":true}]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Request-Context', - 'appId=', - 'MS-CV', - 'cw8L51hDJkmAgMZFgLenpQ.0', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '469ms', - 'X-Azure-Ref', - '0lkd2YAAAAAB7E5u1TFRzR7hh6iBVRYhSWVZSMzBFREdFMDQwNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', - 'Date', - 'Wed, 14 Apr 2021 01:38:30 GMT' -]); diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.js b/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.js deleted file mode 100644 index 3ab7894b0f1c..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_to_multiple_recipients.js +++ /dev/null @@ -1,60 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "c9d3b30b09556d605a1814b7cc66c2ba"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/SomeTenantId/oauth2/v2.0/token', "response_type=token&grant_type=client_credentials&client_id=SomeClientId&client_secret=azure_client_secret&scope=https%3A%2F%2Fcommunication.azure.com%2F%2F.default") - .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"sanitized"}, [ - 'Cache-Control', - 'no-store, no-cache', - 'Pragma', - 'no-cache', - 'Content-Length', - '1327', - 'Content-Type', - 'application/json; charset=utf-8', - 'Expires', - '-1', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '0a4a2a1f-bded-4014-be5e-016920b5c700', - 'x-ms-ests-server', - '2.1.11622.22 - EUS ProdSlices', - 'Set-Cookie', - 'fpc=AsZBMvdV-e5EuFb5Bt9qQ6aMQo4QBgAAAI8-CNgOAAAA; expires=Fri, 14-May-2021 01:38:32 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 14 Apr 2021 01:38:31 GMT' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/sms', {"from":"+14255550123","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"},{"to":"+1425555012345","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":false}}) - .query(true) - .reply(202, {"value":[{"to":"+14255550123","messageId":"Outgoing_2021041401383345b39495-af30-4a36-8cdf-2df0197e90fc_noam","httpStatusCode":202,"repeatabilityResult":"accepted","successful":true},{"to":"+1425555012345","httpStatusCode":400,"errorMessage":"Invalid To phone number format.","successful":false}]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Request-Context', - 'appId=', - 'MS-CV', - 'e2aZcheyN0CGbKpGPYragA.0', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '530ms', - 'X-Azure-Ref', - '0mEd2YAAAAADxddwG3dZ8T6/9wPnIE6q0WVZSMzBFREdFMDQwNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', - 'Date', - 'Wed, 14 Apr 2021 01:38:32 GMT' -]); diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.js b/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.js deleted file mode 100644 index 8c2e5d128d0d..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_playbackrecord_when_sending_sms/recording_can_send_an_sms_message_with_options_passed_in.js +++ /dev/null @@ -1,60 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "e63a7c0807966575ec1513c6eb0a2b17"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/SomeTenantId/oauth2/v2.0/token', "response_type=token&grant_type=client_credentials&client_id=SomeClientId&client_secret=azure_client_secret&scope=https%3A%2F%2Fcommunication.azure.com%2F%2F.default") - .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"sanitized"}, [ - 'Cache-Control', - 'no-store, no-cache', - 'Pragma', - 'no-cache', - 'Content-Length', - '1327', - 'Content-Type', - 'application/json; charset=utf-8', - 'Expires', - '-1', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - 'b09ba858-fc7e-48cd-9fea-2b629426b600', - 'x-ms-ests-server', - '2.1.11622.22 - NCUS ProdSlices', - 'Set-Cookie', - 'fpc=AsZBMvdV-e5EuFb5Bt9qQ6aMQo4QBgAAAI8-CNgOAAAA; expires=Fri, 14-May-2021 01:38:30 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 14 Apr 2021 01:38:30 GMT' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/sms', {"from":"+14255550123","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":true,"tag":"SMS_LIVE_TEST"}}) - .query(true) - .reply(202, {"value":[{"to":"+14255550123","messageId":"Outgoing_202104140138313a0271e5-28f1-4ab9-8a25-8c63552ea98e_noam","httpStatusCode":202,"repeatabilityResult":"accepted","successful":true}]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Request-Context', - 'appId=', - 'MS-CV', - '58GR5Pu3GEyBc0qcH4zDvg.0', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '482ms', - 'X-Azure-Ref', - '0l0d2YAAAAAD/BhvuhWKmQIAGN6huPVUQWVZSMzBFREdFMDQwNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', - 'Date', - 'Wed, 14 Apr 2021 01:38:30 GMT' -]); diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_playbackrecord_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.js b/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_playbackrecord_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.js deleted file mode 100644 index 54b5360d18a8..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_playbackrecord_when_sending_sms/recording_sends_a_new_message_each_time_send_is_called.js +++ /dev/null @@ -1,82 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "ead77ee45b60a585c7ffd2d2bad4b030"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/SomeTenantId/oauth2/v2.0/token', "response_type=token&grant_type=client_credentials&client_id=SomeClientId&client_secret=azure_client_secret&scope=https%3A%2F%2Fcommunication.azure.com%2F%2F.default") - .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"sanitized"}, [ - 'Cache-Control', - 'no-store, no-cache', - 'Pragma', - 'no-cache', - 'Content-Type', - 'application/json; charset=utf-8', - 'Expires', - '-1', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '3ff76588-e2fb-49b6-b8e4-34504a2bc800', - 'x-ms-ests-server', - '2.1.11622.22 - NCUS ProdSlices', - 'Set-Cookie', - 'fpc=AsZBMvdV-e5EuFb5Bt9qQ6aMQo4QBgAAAI8-CNgOAAAA; expires=Fri, 14-May-2021 01:38:31 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 14 Apr 2021 01:38:30 GMT', - 'Content-Length', - '1327' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/sms', {"from":"+14255550123","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":true,"tag":"SMS_LIVE_TEST"}}) - .query(true) - .reply(202, {"value":[{"to":"+14255550123","messageId":"Outgoing_20210414013832ac8715bb-124c-47a9-aa85-2e12cd9efa9b_noam","httpStatusCode":202,"repeatabilityResult":"accepted","successful":true}]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Request-Context', - 'appId=', - 'MS-CV', - '2l5ZzPUaHUyC7y7A92Tf/g.0', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '460ms', - 'X-Azure-Ref', - '0l0d2YAAAAABSJphTKxU2SJ30V5M6HO7dWVZSMzBFREdFMDQwNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', - 'Date', - 'Wed, 14 Apr 2021 01:38:31 GMT' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/sms', {"from":"+14255550123","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":true,"tag":"SMS_LIVE_TEST"}}) - .query(true) - .reply(202, {"value":[{"to":"+14255550123","messageId":"Outgoing_202104140138325652ab70-d555-4670-896e-0d272382ef5a_noam","httpStatusCode":202,"repeatabilityResult":"accepted","successful":true}]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Request-Context', - 'appId=', - 'MS-CV', - '07xs9TK/mEuD+415OlS6Hg.0', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '517ms', - 'X-Azure-Ref', - '0mEd2YAAAAADq1prxQhXLS6YBIvKumej4WVZSMzBFREdFMDQwNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', - 'Date', - 'Wed, 14 Apr 2021 01:38:32 GMT' -]); diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.js b/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.js deleted file mode 100644 index a1d5cee91e36..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_a_number_you_dont_own.js +++ /dev/null @@ -1,58 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "eeff82b8ae33893e424efcce27438830"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/SomeTenantId/oauth2/v2.0/token', "response_type=token&grant_type=client_credentials&client_id=SomeClientId&client_secret=azure_client_secret&scope=https%3A%2F%2Fcommunication.azure.com%2F%2F.default") - .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"sanitized"}, [ - 'Cache-Control', - 'no-store, no-cache', - 'Pragma', - 'no-cache', - 'Content-Type', - 'application/json; charset=utf-8', - 'Expires', - '-1', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '3fcdc6ba-fc00-4b47-b2c4-c33f96abbc00', - 'x-ms-ests-server', - '2.1.11622.22 - SCUS ProdSlices', - 'Set-Cookie', - 'fpc=AsZBMvdV-e5EuFb5Bt9qQ6aMQo4QBwAAAI8-CNgOAAAA; expires=Fri, 14-May-2021 01:38:33 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 14 Apr 2021 01:38:32 GMT', - 'Content-Length', - '1327' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/sms', {"from":"+14255550123","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":true,"tag":"SMS_LIVE_TEST"}}) - .query(true) - .reply(404, "", [ - 'Request-Context', - 'appId=', - 'MS-CV', - 'd17KM8i6RUunFtWdzGpZyw.0', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '428ms', - 'X-Azure-Ref', - '0mUd2YAAAAADfPNM0W1NYS4szxZM/USFwWVZSMzBFREdFMDQwNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', - 'Date', - 'Wed, 14 Apr 2021 01:38:33 GMT', - 'Content-Length', - '0' -]); diff --git a/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.js b/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.js deleted file mode 100644 index 2a34245a17b0..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_using_token_based_authentication_playbackrecord_when_sending_sms/recording_throws_an_exception_when_sending_from_an_invalid_number.js +++ /dev/null @@ -1,58 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "e40572f5ed6d1f0cd7c4a5809ef38226"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/SomeTenantId/oauth2/v2.0/token', "response_type=token&grant_type=client_credentials&client_id=SomeClientId&client_secret=azure_client_secret&scope=https%3A%2F%2Fcommunication.azure.com%2F%2F.default") - .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"sanitized"}, [ - 'Cache-Control', - 'no-store, no-cache', - 'Pragma', - 'no-cache', - 'Content-Length', - '1327', - 'Content-Type', - 'application/json; charset=utf-8', - 'Expires', - '-1', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '69ca9e3d-de46-4507-a8e2-5fa2acc6b800', - 'x-ms-ests-server', - '2.1.11622.22 - EUS ProdSlices', - 'Set-Cookie', - 'fpc=AsZBMvdV-e5EuFb5Bt9qQ6aMQo4QCAAAAI8-CNgOAAAA; expires=Fri, 14-May-2021 01:38:34 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 14 Apr 2021 01:38:33 GMT' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/sms', {"from":"+1425555012345","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":true,"tag":"SMS_LIVE_TEST"}}) - .query(true) - .reply(400, {"From":["Invalid From phone number format"]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Request-Context', - 'appId=', - 'MS-CV', - 'SWgCndnKzkO/tf2qvCbePg.0', - 'X-Processing-Time', - '12ms', - 'X-Azure-Ref', - '0mkd2YAAAAADsItzorHQfT7956pHQrkpNWVZSMzBFREdFMDQwNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', - 'Date', - 'Wed, 14 Apr 2021 01:38:33 GMT' -]); diff --git a/sdk/communication/communication-sms/review/communication-sms.api.md b/sdk/communication/communication-sms/review/communication-sms.api.md index 28919f247a5b..c98753fea219 100644 --- a/sdk/communication/communication-sms/review/communication-sms.api.md +++ b/sdk/communication/communication-sms/review/communication-sms.api.md @@ -6,9 +6,9 @@ /// +import { CommonClientOptions } from '@azure/core-client'; import { KeyCredential } from '@azure/core-auth'; -import { OperationOptions } from '@azure/core-http'; -import { PipelineOptions } from '@azure/core-http'; +import { OperationOptions } from '@azure/core-client'; import { TokenCredential } from '@azure/core-auth'; // @public @@ -20,7 +20,7 @@ export class SmsClient { } // @public -export interface SmsClientOptions extends PipelineOptions { +export interface SmsClientOptions extends CommonClientOptions { } // @public diff --git a/sdk/communication/communication-sms/samples-dev/usingAadAuth.ts b/sdk/communication/communication-sms/samples-dev/usingAadAuth.ts index c5d930e35a5a..b8f263eede6d 100644 --- a/sdk/communication/communication-sms/samples-dev/usingAadAuth.ts +++ b/sdk/communication/communication-sms/samples-dev/usingAadAuth.ts @@ -7,7 +7,7 @@ import { parseConnectionString } from "@azure/communication-common"; import { SmsClient, SmsSendRequest } from "@azure/communication-sms"; -import { isNode } from "@azure/core-http"; +import { isNode } from "@azure/core-util"; import { ClientSecretCredential, DefaultAzureCredential, TokenCredential } from "@azure/identity"; // Load the .env file if it exists diff --git a/sdk/communication/communication-sms/src/constants.ts b/sdk/communication/communication-sms/src/constants.ts index 9ffa1892ce39..85e3e7f17866 100644 --- a/sdk/communication/communication-sms/src/constants.ts +++ b/sdk/communication/communication-sms/src/constants.ts @@ -1,4 +1,4 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -export const SDK_VERSION: string = "1.1.0"; +export const SDK_VERSION: string = "1.2.0-beta.1"; diff --git a/sdk/communication/communication-sms/src/extractOperationOptions.ts b/sdk/communication/communication-sms/src/extractOperationOptions.ts index a8fa2e5ecf12..38ec3c9e519c 100644 --- a/sdk/communication/communication-sms/src/extractOperationOptions.ts +++ b/sdk/communication/communication-sms/src/extractOperationOptions.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { OperationOptions } from "@azure/core-http"; +import { OperationOptions } from "@azure/core-client"; export const extractOperationOptions = ( obj: T @@ -9,7 +9,14 @@ export const extractOperationOptions = ( operationOptions: OperationOptions; restOptions: Pick>; } => { - const { abortSignal, requestOptions, tracingOptions, ...restOptions } = obj; + const { + abortSignal, + onResponse, + requestOptions, + serializerOptions, + tracingOptions, + ...restOptions + } = obj; return { operationOptions: { diff --git a/sdk/communication/communication-sms/src/generated/src/index.ts b/sdk/communication/communication-sms/src/generated/src/index.ts new file mode 100644 index 000000000000..7fec41dc8fd5 --- /dev/null +++ b/sdk/communication/communication-sms/src/generated/src/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./models"; +export { SmsApiClient } from "./smsApiClient"; +export { SmsApiClientContext } from "./smsApiClientContext"; +export * from "./operationsInterfaces"; diff --git a/sdk/communication/communication-sms/src/generated/src/models/index.ts b/sdk/communication/communication-sms/src/generated/src/models/index.ts index 277a772301dc..e08170980d8c 100644 --- a/sdk/communication/communication-sms/src/generated/src/models/index.ts +++ b/sdk/communication/communication-sms/src/generated/src/models/index.ts @@ -6,135 +6,86 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreHttp from "@azure/core-http"; +import * as coreClient from "@azure/core-client"; -/** - * Represents the properties of a send message request. - */ +/** Represents the properties of a send message request. */ export interface SendMessageRequest { - /** - * The sender's phone number in E.164 format that is owned by the authenticated account. - */ + /** The sender's phone number in E.164 format that is owned by the authenticated account. */ from: string; - /** - * The recipient's phone number in E.164 format. In this version, a minimum of 1 and upto 100 recipients in the list are supported. - */ + /** The recipient's phone number in E.164 format. In this version, a minimum of 1 and upto 100 recipients in the list are supported. */ smsRecipients: SmsRecipient[]; - /** - * The contents of the message that will be sent to the recipient. The allowable content is defined by RFC 5724. - */ + /** The contents of the message that will be sent to the recipient. The allowable content is defined by RFC 5724. */ message: string; - /** - * Optional configuration for sending SMS messages. - */ + /** Optional configuration for sending SMS messages. */ smsSendOptions?: SmsSendOptions; } -/** - * Recipient details for sending SMS messages. - */ +/** Recipient details for sending SMS messages. */ export interface SmsRecipient { - /** - * The recipient's phone number in E.164 format. - */ + /** The recipient's phone number in E.164 format. */ to: string; - /** - * If specified, the client directs that the request is repeatable; that is, the client can make the request multiple times with the same Repeatability-Request-ID and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-ID is an opaque string representing a client-generated, 36-character hexadecimal case-insensitive encoding of a UUID (GUID), identifier for the request. - */ + /** If specified, the client directs that the request is repeatable; that is, the client can make the request multiple times with the same Repeatability-Request-ID and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-ID is an opaque string representing a client-generated, 36-character hexadecimal case-insensitive encoding of a UUID (GUID), identifier for the request. */ repeatabilityRequestId?: string; - /** - * MUST be sent by clients to specify that a request is repeatable. Repeatability-First-Sent is used to specify the date and time at which the request was first created.eg- Tue, 26 Mar 2019 16:06:51 GMT - */ + /** MUST be sent by clients to specify that a request is repeatable. Repeatability-First-Sent is used to specify the date and time at which the request was first created.eg- Tue, 26 Mar 2019 16:06:51 GMT */ repeatabilityFirstSent?: string; } -/** - * Optional configuration for sending SMS messages. - */ +/** Optional configuration for sending SMS messages. */ export interface SmsSendOptions { - /** - * Enable this flag to receive a delivery report for this message on the Azure Resource EventGrid. - */ + /** Enable this flag to receive a delivery report for this message on the Azure Resource EventGrid. */ enableDeliveryReport: boolean; - /** - * Use this field to provide metadata that will then be sent back in the corresponding Delivery Report. - */ + /** Use this field to provide metadata that will then be sent back in the corresponding Delivery Report. */ tag?: string; } -/** - * Response for a successful or multi status send Sms request. - */ +/** Response for a successful or multi status send Sms request. */ export interface SmsSendResponse { value: SmsSendResponseItem[]; } -/** - * Response for a single recipient. - */ +/** Response for a single recipient. */ export interface SmsSendResponseItem { - /** - * The recipient's phone number in E.164 format. - */ + /** The recipient's phone number in E.164 format. */ to: string; - /** - * The identifier of the outgoing Sms message. Only present if message processed. - */ + /** The identifier of the outgoing Sms message. Only present if message processed. */ messageId?: string; - /** - * HTTP Status code. - */ + /** HTTP Status code. */ httpStatusCode: number; - /** - * The result of a repeatable request with one of the case-insensitive values accepted or rejected. - */ + /** The result of a repeatable request with one of the case-insensitive values accepted or rejected. */ repeatabilityResult?: SmsSendResponseItemRepeatabilityResult; - /** - * Indicates if the message is processed successfully or not. - */ + /** Indicates if the message is processed successfully or not. */ successful: boolean; - /** - * Optional error message in case of 4xx/5xx/repeatable errors. - */ + /** Optional error message in case of 4xx/5xx/repeatable errors. */ errorMessage?: string; } -/** - * Defines values for SmsSendResponseItemRepeatabilityResult. - */ -export type SmsSendResponseItemRepeatabilityResult = "accepted" | "rejected"; +/** Known values of {@link SmsSendResponseItemRepeatabilityResult} that the service accepts. */ +export enum KnownSmsSendResponseItemRepeatabilityResult { + Accepted = "accepted", + Rejected = "rejected" +} /** - * Contains response data for the send operation. + * Defines values for SmsSendResponseItemRepeatabilityResult. \ + * {@link KnownSmsSendResponseItemRepeatabilityResult} can be used interchangeably with SmsSendResponseItemRepeatabilityResult, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **accepted** \ + * **rejected** */ -export type SmsSendOperationResponse = SmsSendResponse & { - /** - * The underlying HTTP response. - */ - _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type SmsSendResponseItemRepeatabilityResult = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: SmsSendResponse; - }; -}; +/** Optional parameters. */ +export interface SmsSendOptionalParams extends coreClient.OperationOptions {} -/** - * Optional parameters. - */ +/** Contains response data for the send operation. */ +export type SmsSendOperationResponse = SmsSendResponse; + +/** Optional parameters. */ export interface SmsApiClientOptionalParams - extends coreHttp.ServiceClientOptions { - /** - * Api Version - */ + extends coreClient.ServiceClientOptions { + /** Api Version */ apiVersion?: string; - /** - * Overrides client endpoint. - */ + /** Overrides client endpoint. */ endpoint?: string; } diff --git a/sdk/communication/communication-sms/src/generated/src/models/mappers.ts b/sdk/communication/communication-sms/src/generated/src/models/mappers.ts index 03b109980491..0ea1f01108b1 100644 --- a/sdk/communication/communication-sms/src/generated/src/models/mappers.ts +++ b/sdk/communication/communication-sms/src/generated/src/models/mappers.ts @@ -6,9 +6,9 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreHttp from "@azure/core-http"; +import * as coreClient from "@azure/core-client"; -export const SendMessageRequest: coreHttp.CompositeMapper = { +export const SendMessageRequest: coreClient.CompositeMapper = { type: { name: "Composite", className: "SendMessageRequest", @@ -25,7 +25,12 @@ export const SendMessageRequest: coreHttp.CompositeMapper = { required: true, type: { name: "Sequence", - element: { type: { name: "Composite", className: "SmsRecipient" } } + element: { + type: { + name: "Composite", + className: "SmsRecipient" + } + } } }, message: { @@ -49,7 +54,7 @@ export const SendMessageRequest: coreHttp.CompositeMapper = { } }; -export const SmsRecipient: coreHttp.CompositeMapper = { +export const SmsRecipient: coreClient.CompositeMapper = { type: { name: "Composite", className: "SmsRecipient", @@ -77,7 +82,7 @@ export const SmsRecipient: coreHttp.CompositeMapper = { } }; -export const SmsSendOptions: coreHttp.CompositeMapper = { +export const SmsSendOptions: coreClient.CompositeMapper = { type: { name: "Composite", className: "SmsSendOptions", @@ -99,7 +104,7 @@ export const SmsSendOptions: coreHttp.CompositeMapper = { } }; -export const SmsSendResponse: coreHttp.CompositeMapper = { +export const SmsSendResponse: coreClient.CompositeMapper = { type: { name: "Composite", className: "SmsSendResponse", @@ -110,7 +115,10 @@ export const SmsSendResponse: coreHttp.CompositeMapper = { type: { name: "Sequence", element: { - type: { name: "Composite", className: "SmsSendResponseItem" } + type: { + name: "Composite", + className: "SmsSendResponseItem" + } } } } @@ -118,7 +126,7 @@ export const SmsSendResponse: coreHttp.CompositeMapper = { } }; -export const SmsSendResponseItem: coreHttp.CompositeMapper = { +export const SmsSendResponseItem: coreClient.CompositeMapper = { type: { name: "Composite", className: "SmsSendResponseItem", diff --git a/sdk/communication/communication-sms/src/generated/src/models/parameters.ts b/sdk/communication/communication-sms/src/generated/src/models/parameters.ts index ed63cae5ac65..11b554fcc05a 100644 --- a/sdk/communication/communication-sms/src/generated/src/models/parameters.ts +++ b/sdk/communication/communication-sms/src/generated/src/models/parameters.ts @@ -10,7 +10,7 @@ import { OperationParameter, OperationURLParameter, OperationQueryParameter -} from "@azure/core-http"; +} from "@azure/core-client"; import { SendMessageRequest as SendMessageRequestMapper } from "../models/mappers"; export const contentType: OperationParameter = { @@ -30,6 +30,18 @@ export const sendMessageRequest: OperationParameter = { mapper: SendMessageRequestMapper }; +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" + } + } +}; + export const endpoint: OperationURLParameter = { parameterPath: "endpoint", mapper: { diff --git a/sdk/communication/communication-sms/src/generated/src/operations/sms.ts b/sdk/communication/communication-sms/src/generated/src/operations/sms.ts index 4d55c19e24f2..4ea871c531de 100644 --- a/sdk/communication/communication-sms/src/generated/src/operations/sms.ts +++ b/sdk/communication/communication-sms/src/generated/src/operations/sms.ts @@ -6,23 +6,26 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreHttp from "@azure/core-http"; +import { Sms } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { SmsApiClient } from "../smsApiClient"; -import { SendMessageRequest, SmsSendOperationResponse } from "../models"; +import { SmsApiClientContext } from "../smsApiClientContext"; +import { + SendMessageRequest, + SmsSendOptionalParams, + SmsSendOperationResponse +} from "../models"; -/** - * Class representing a Sms. - */ -export class Sms { - private readonly client: SmsApiClient; +/** Class containing Sms operations. */ +export class SmsImpl implements Sms { + private readonly client: SmsApiClientContext; /** * Initialize a new instance of the class Sms class. * @param client Reference to the service client */ - constructor(client: SmsApiClient) { + constructor(client: SmsApiClientContext) { this.client = client; } @@ -33,22 +36,18 @@ export class Sms { */ send( sendMessageRequest: SendMessageRequest, - options?: coreHttp.OperationOptions + options?: SmsSendOptionalParams ): Promise { - const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( - options || {} - ); return this.client.sendOperationRequest( - { sendMessageRequest, options: operationOptions }, + { sendMessageRequest, options }, sendOperationSpec - ) as Promise; + ); } } // Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const serializer = new coreHttp.Serializer(Mappers, /* isXml */ false); - -const sendOperationSpec: coreHttp.OperationSpec = { +const sendOperationSpec: coreClient.OperationSpec = { path: "/sms", httpMethod: "POST", responses: { @@ -59,7 +58,7 @@ const sendOperationSpec: coreHttp.OperationSpec = { requestBody: Parameters.sendMessageRequest, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.endpoint], - headerParameters: [Parameters.contentType], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", serializer }; diff --git a/sdk/communication/communication-sms/src/generated/src/operationsInterfaces/index.ts b/sdk/communication/communication-sms/src/generated/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..6f4eb2ba2dec --- /dev/null +++ b/sdk/communication/communication-sms/src/generated/src/operationsInterfaces/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./sms"; diff --git a/sdk/communication/communication-sms/src/generated/src/operationsInterfaces/sms.ts b/sdk/communication/communication-sms/src/generated/src/operationsInterfaces/sms.ts new file mode 100644 index 000000000000..a0d7248ea800 --- /dev/null +++ b/sdk/communication/communication-sms/src/generated/src/operationsInterfaces/sms.ts @@ -0,0 +1,26 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + SendMessageRequest, + SmsSendOptionalParams, + SmsSendOperationResponse +} from "../models"; + +/** Interface representing a Sms. */ +export interface Sms { + /** + * Sends a SMS message from a phone number that belongs to the authenticated account. + * @param sendMessageRequest Represents the body of the send message request. + * @param options The options parameters. + */ + send( + sendMessageRequest: SendMessageRequest, + options?: SmsSendOptionalParams + ): Promise; +} diff --git a/sdk/communication/communication-sms/src/generated/src/smsApiClient.ts b/sdk/communication/communication-sms/src/generated/src/smsApiClient.ts index 1632590f1d22..8430398a4f27 100644 --- a/sdk/communication/communication-sms/src/generated/src/smsApiClient.ts +++ b/sdk/communication/communication-sms/src/generated/src/smsApiClient.ts @@ -6,13 +6,12 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as operations from "./operations"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; +import { SmsImpl } from "./operations"; +import { Sms } from "./operationsInterfaces"; import { SmsApiClientContext } from "./smsApiClientContext"; import { SmsApiClientOptionalParams } from "./models"; -class SmsApiClient extends SmsApiClientContext { +export class SmsApiClient extends SmsApiClientContext { /** * Initializes a new instance of the SmsApiClient class. * @param endpoint The communication resource, for example https://my-resource.communication.azure.com @@ -20,18 +19,8 @@ class SmsApiClient extends SmsApiClientContext { */ constructor(endpoint: string, options?: SmsApiClientOptionalParams) { super(endpoint, options); - this.sms = new operations.Sms(this); + this.sms = new SmsImpl(this); } - sms: operations.Sms; + sms: Sms; } - -// Operation Specifications - -export { - SmsApiClient, - SmsApiClientContext, - Models as SmsApiModels, - Mappers as SmsApiMappers -}; -export * from "./operations"; diff --git a/sdk/communication/communication-sms/src/generated/src/smsApiClientContext.ts b/sdk/communication/communication-sms/src/generated/src/smsApiClientContext.ts index 71c252332588..f0f1a1fea1d0 100644 --- a/sdk/communication/communication-sms/src/generated/src/smsApiClientContext.ts +++ b/sdk/communication/communication-sms/src/generated/src/smsApiClientContext.ts @@ -6,13 +6,10 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreHttp from "@azure/core-http"; +import * as coreClient from "@azure/core-client"; import { SmsApiClientOptionalParams } from "./models"; -const packageName = "azure-communication-sms"; -const packageVersion = "1.1.0"; - -export class SmsApiClientContext extends coreHttp.ServiceClient { +export class SmsApiClientContext extends coreClient.ServiceClient { endpoint: string; apiVersion: string; @@ -30,18 +27,25 @@ export class SmsApiClientContext extends coreHttp.ServiceClient { if (!options) { options = {}; } - - if (!options.userAgent) { - const defaultUserAgent = coreHttp.getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } - - super(undefined, options); - - this.requestContentType = "application/json; charset=utf-8"; - - this.baseUri = options.endpoint || "{endpoint}"; - + const defaults: SmsApiClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-communication-sms/1.2.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{endpoint}" + }; + super(optionsWithDefaults); // Parameter assignments this.endpoint = endpoint; diff --git a/sdk/communication/communication-sms/src/smsClient.ts b/sdk/communication/communication-sms/src/smsClient.ts index ef3c3dc69504..7d528a47b922 100644 --- a/sdk/communication/communication-sms/src/smsClient.ts +++ b/sdk/communication/communication-sms/src/smsClient.ts @@ -7,17 +7,11 @@ import { isKeyCredential, createCommunicationAuthPolicy, } from "@azure/communication-common"; -import { KeyCredential, TokenCredential } from "@azure/core-auth"; -import { - PipelineOptions, - InternalPipelineOptions, - createPipelineFromOptions, - OperationOptions, - operationOptionsToRequestOptionsBase, -} from "@azure/core-http"; +import { KeyCredential, TokenCredential, isTokenCredential } from "@azure/core-auth"; +import { CommonClientOptions, OperationOptions } from "@azure/core-client"; +import { InternalPipelineOptions } from "@azure/core-rest-pipeline"; import { SpanStatusCode } from "@azure/core-tracing"; import { SmsApiClient } from "./generated/src/smsApiClient"; -import { SDK_VERSION } from "./constants"; import { createSpan } from "./tracing"; import { logger } from "./logger"; import { extractOperationOptions } from "./extractOperationOptions"; @@ -26,7 +20,7 @@ import { generateSendMessageRequest } from "./utils/smsUtils"; /** * Client options used to configure SMS Client API requests. */ -export interface SmsClientOptions extends PipelineOptions {} +export interface SmsClientOptions extends CommonClientOptions {} /** * Values used to configure Sms message @@ -92,7 +86,7 @@ export interface SmsSendResult { * @param options - The value being checked. */ const isSmsClientOptions = (options: any): options is SmsClientOptions => - !!options && !isKeyCredential(options); + !!options && !isTokenCredential(options) && !isKeyCredential(options); /** * A SmsClient represents a Client to the Azure Communication Sms service allowing you @@ -132,17 +126,6 @@ export class SmsClient { ) { const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions); const options = isSmsClientOptions(credentialOrOptions) ? credentialOrOptions : maybeOptions; - const libInfo = `azsdk-js-communication-sms/${SDK_VERSION}`; - - if (!options.userAgentOptions) { - options.userAgentOptions = {}; - } - - if (options.userAgentOptions.userAgentPrefix) { - options.userAgentOptions.userAgentPrefix = `${options.userAgentOptions.userAgentPrefix} ${libInfo}`; - } else { - options.userAgentOptions.userAgentPrefix = libInfo; - } const internalPipelineOptions: InternalPipelineOptions = { ...options, @@ -154,8 +137,8 @@ export class SmsClient { }; const authPolicy = createCommunicationAuthPolicy(credential); - const pipeline = createPipelineFromOptions(internalPipelineOptions, authPolicy); - this.api = new SmsApiClient(url, pipeline); + this.api = new SmsApiClient(url, internalPipelineOptions); + this.api.pipeline.addPolicy(authPolicy); } /** @@ -174,7 +157,7 @@ export class SmsClient { try { const response = await this.api.sms.send( generateSendMessageRequest(sendRequest, restOptions), - operationOptionsToRequestOptionsBase(updatedOptions) + updatedOptions ); return response.value; } catch (e: any) { diff --git a/sdk/communication/communication-sms/src/utils/uuid.ts b/sdk/communication/communication-sms/src/utils/uuid.ts index c6cf92396ce3..1be96085e2c8 100644 --- a/sdk/communication/communication-sms/src/utils/uuid.ts +++ b/sdk/communication/communication-sms/src/utils/uuid.ts @@ -1,12 +1,18 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { generateUuid } from "@azure/core-http"; +import { v4 as uuidv4 } from "uuid"; // This is used as a workaround to be able to stub generateUuid // during testing. +/** + * Generated Universally Unique Identifier + * + * @returns RFC4122 v4 UUID. + * @internal + */ export class Uuid { public static generateUuid(): string { - return generateUuid(); + return uuidv4(); } } diff --git a/sdk/communication/communication-sms/swagger/README.md b/sdk/communication/communication-sms/swagger/README.md index 80d7f8371a9b..12ae03ca6144 100644 --- a/sdk/communication/communication-sms/swagger/README.md +++ b/sdk/communication/communication-sms/swagger/README.md @@ -5,7 +5,7 @@ ## Configuration ```yaml -package-name: azure-communication-sms +package-name: "@azure/communication-sms" title: SmsApiClient description: SMS Client generate-metadata: false @@ -16,9 +16,9 @@ require: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/896d05e37d model-date-time-as-string: false optional-response-headers: true use-extension: - "@autorest/typescript": "6.0.0-dev.20200623.2" + "@autorest/typescript": "6.0.0-beta.15" azure-arm: false add-credentials: false -package-version: 1.1.0 +package-version: 1.2.0-beta.1 v3: true ``` diff --git a/sdk/communication/communication-sms/test/internal/smsClient.internal.mocked.spec.ts b/sdk/communication/communication-sms/test/internal/smsClient.internal.mocked.spec.ts index 3c4c19787ea5..06d62f4982eb 100644 --- a/sdk/communication/communication-sms/test/internal/smsClient.internal.mocked.spec.ts +++ b/sdk/communication/communication-sms/test/internal/smsClient.internal.mocked.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { HttpClient } from "@azure/core-http"; +import { HttpClient } from "@azure/core-rest-pipeline"; import { Uuid } from "../../src/utils/uuid"; import { generateSendMessageRequest } from "../../src/utils/smsUtils"; @@ -16,7 +16,7 @@ const API_VERSION = apiVersion.mapper.defaultValue; const TEST_NUMBER = "+14255550123"; describe("[mocked] SmsClient Internal", async () => { - const baseUri = "https://contoso.api.fake:443"; + const baseUri = "https://contoso.api.fake"; const connectionString = `endpoint=${baseUri};accesskey=banana`; let sendRequestSpy: sinon.SinonSpy; let uuidStub: sinon.SinonStub; @@ -46,7 +46,7 @@ describe("[mocked] SmsClient Internal", async () => { assert.equal(request.url, `${baseUri}/sms?api-version=${API_VERSION}`); assert.equal(request.method, "POST"); const expectedRequestBody = generateSendMessageRequest(testSendRequest); - assert.deepEqual(JSON.parse(request.body), expectedRequestBody); + assert.deepEqual(JSON.parse(request.body as string), expectedRequestBody); }); it("generates a new repeatability id each time", async () => { diff --git a/sdk/communication/communication-sms/test/internal/smsClient.internal.spec.ts b/sdk/communication/communication-sms/test/internal/smsClient.internal.spec.ts index 56ae5e36120d..426826d15a53 100644 --- a/sdk/communication/communication-sms/test/internal/smsClient.internal.spec.ts +++ b/sdk/communication/communication-sms/test/internal/smsClient.internal.spec.ts @@ -9,30 +9,23 @@ */ import { matrix } from "@azure/test-utils"; -import { isLiveMode, isPlaybackMode, record, Recorder } from "@azure-tools/test-recorder"; -import { isNode } from "@azure/core-http"; -import * as dotenv from "dotenv"; +import { isLiveMode, isPlaybackMode, Recorder } from "@azure-tools/test-recorder"; import * as sinon from "sinon"; import { Uuid } from "../../src/utils/uuid"; import { - createSmsClient, - createSmsClientWithToken, - recorderConfiguration, + createRecordedSmsClient, + createRecordedSmsClientWithToken, } from "../public/utils/recordedClient"; import { Context } from "mocha"; import sendSmsSuites from "../public/suites/smsClient.send"; +import { SmsClient } from "../../src"; -if (isNode) { - dotenv.config(); -} - -matrix([[true, false]], async function (useAad) { +matrix([[true, false]], async function (useAad: boolean) { describe(`SmsClient [Playback/Record]${useAad ? " [AAD]" : ""}`, async () => { let recorder: Recorder; + let client: SmsClient; beforeEach(async function (this: Context) { - recorder = record(this, recorderConfiguration); - if (isLiveMode()) { this.skip(); } else if (isPlaybackMode()) { @@ -41,10 +34,11 @@ matrix([[true, false]], async function (useAad) { } if (useAad) { - this.smsClient = createSmsClientWithToken(); + ({ client, recorder } = await createRecordedSmsClientWithToken(this)); } else { - this.smsClient = createSmsClient(); + ({ client, recorder } = await createRecordedSmsClient(this)); } + this.smsClient = client; }); afterEach(async function (this: Context) { diff --git a/sdk/communication/communication-sms/test/public/smsClient.mocked.spec.ts b/sdk/communication/communication-sms/test/public/smsClient.mocked.spec.ts index 5242129a8a6b..f49046808fb1 100644 --- a/sdk/communication/communication-sms/test/public/smsClient.mocked.spec.ts +++ b/sdk/communication/communication-sms/test/public/smsClient.mocked.spec.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { HttpClient, isNode } from "@azure/core-http"; - +import { isNode } from "@azure/core-util"; +import { HttpClient } from "@azure/core-rest-pipeline"; import { AzureKeyCredential } from "@azure/core-auth"; import { assert } from "chai"; import sinon from "sinon"; @@ -13,7 +13,7 @@ import { TokenCredential } from "@azure/identity"; const TEST_NUMBER = "+14255550123"; describe("[mocked] SmsClient", async () => { - const baseUri = "https://contoso.api.fake:443"; + const baseUri = "https://contoso.api.fake"; const connectionString = `endpoint=${baseUri};accesskey=banana`; const dateHeader = "x-ms-date"; let sendRequestSpy: sinon.SinonSpy; @@ -60,7 +60,7 @@ describe("[mocked] SmsClient", async () => { const request = sendRequestSpy.getCall(0).args[0]; if (isNode) { - assert.equal(request.headers.get("host"), "contoso.api.fake:443"); + assert.equal(request.headers.get("host"), "contoso.api.fake"); } assert.typeOf(request.headers.get(dateHeader), "string"); assert.isDefined(request.headers.get("authorization")); diff --git a/sdk/communication/communication-sms/test/public/smsClient.spec.ts b/sdk/communication/communication-sms/test/public/smsClient.spec.ts index 23f4474a6f5c..2aefd9d9aed9 100644 --- a/sdk/communication/communication-sms/test/public/smsClient.spec.ts +++ b/sdk/communication/communication-sms/test/public/smsClient.spec.ts @@ -7,24 +7,18 @@ */ import { matrix } from "@azure/test-utils"; -import { record, Recorder, env } from "@azure-tools/test-recorder"; -import { isNode } from "@azure/core-http"; -import * as dotenv from "dotenv"; -import { - createSmsClient, - createSmsClientWithToken, - recorderConfiguration, -} from "./utils/recordedClient"; +import { Recorder, env, isPlaybackMode } from "@azure-tools/test-recorder"; +import { createRecordedSmsClient, createRecordedSmsClientWithToken } from "./utils/recordedClient"; import { Context } from "mocha"; import sendSmsSuites from "./suites/smsClient.send"; +import { SmsClient } from "../../src"; +import sinon from "sinon"; +import { Uuid } from "../../src/utils/uuid"; -if (isNode) { - dotenv.config(); -} - -matrix([[true, false]], async function (useAad) { +matrix([[true, false]], async function (useAad: boolean) { describe(`SmsClient [Live]${useAad ? " [AAD]" : ""}`, async () => { let recorder: Recorder; + let client: SmsClient; before(function (this: Context) { const skipIntSMSTests = env.COMMUNICATION_SKIP_INT_SMS_TEST === "true"; @@ -34,21 +28,25 @@ matrix([[true, false]], async function (useAad) { }); beforeEach(async function (this: Context) { - recorder = record(this, recorderConfiguration); - recorder.skip( - undefined, - "A UUID is randomly generated within the SDK and used in the HTTP request and cannot be preserved." - ); - + if (isPlaybackMode()) { + sinon.stub(Uuid, "generateUuid").returns("sanitized"); + sinon.stub(Date, "now").returns(0); + } if (useAad) { - this.smsClient = createSmsClientWithToken(); + ({ client, recorder } = await createRecordedSmsClientWithToken(this)); } else { - this.smsClient = createSmsClient(); + ({ client, recorder } = await createRecordedSmsClient(this)); } + this.smsClient = client; }); afterEach(async function (this: Context) { - await recorder.stop(); + if (!this.currentTest?.isPending()) { + await recorder.stop(); + } + if (isPlaybackMode()) { + sinon.restore(); + } }); describe("test send method", sendSmsSuites); diff --git a/sdk/communication/communication-sms/test/public/utils/mockHttpClient.ts b/sdk/communication/communication-sms/test/public/utils/mockHttpClient.ts index 67259490f697..89601a69042a 100644 --- a/sdk/communication/communication-sms/test/public/utils/mockHttpClient.ts +++ b/sdk/communication/communication-sms/test/public/utils/mockHttpClient.ts @@ -1,17 +1,22 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { HttpClient, HttpHeaders, WebResourceLike, HttpOperationResponse } from "@azure/core-http"; +import { + createHttpHeaders, + HttpClient, + PipelineRequest, + PipelineResponse, +} from "@azure/core-rest-pipeline"; export class MockHttpClient implements HttpClient { constructor(private _phoneNumber: string) {} - async sendRequest(httpRequest: WebResourceLike): Promise { + async sendRequest(httpRequest: PipelineRequest): Promise { return { status: 202, - headers: new HttpHeaders(), + headers: createHttpHeaders(), request: httpRequest, - parsedBody: { + bodyAsText: JSON.stringify({ value: [ { to: this._phoneNumber, @@ -22,7 +27,7 @@ export class MockHttpClient implements HttpClient { successful: true, }, ], - }, + }), }; } } diff --git a/sdk/communication/communication-sms/test/public/utils/recordedClient.ts b/sdk/communication/communication-sms/test/public/utils/recordedClient.ts index 7d7a1c5e899e..6f29c31aad39 100644 --- a/sdk/communication/communication-sms/test/public/utils/recordedClient.ts +++ b/sdk/communication/communication-sms/test/public/utils/recordedClient.ts @@ -1,98 +1,108 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { parseConnectionString } from "@azure/communication-common"; +import { Context, Test } from "mocha"; import { - DefaultHttpClient, - HttpClient, - HttpOperationResponse, - isNode, - WebResourceLike, -} from "@azure/core-http"; -import { ClientSecretCredential, DefaultAzureCredential, TokenCredential } from "@azure/identity"; -import { env, isPlaybackMode, RecorderEnvironmentSetup } from "@azure-tools/test-recorder"; -import { SmsClient, SmsClientOptions } from "../../../src"; + Recorder, + RecorderStartOptions, + SanitizerOptions, + env, + isPlaybackMode, +} from "@azure-tools/test-recorder"; +import { SmsClient } from "../../../src"; +import { parseConnectionString } from "@azure/communication-common"; +import { TokenCredential } from "@azure/core-auth"; +import { createTestCredential } from "@azure-tools/test-credential"; + +export interface RecordedClient { + client: T; + recorder: Recorder; +} + +const envSetupForPlayback: { [k: string]: string } = { + COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING: "endpoint=https://endpoint/;accesskey=banana", + AZURE_PHONE_NUMBER: "+14255550123", + AZURE_CLIENT_ID: "SomeClientId", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "SomeTenantId", + COMMUNICATION_SKIP_INT_SMS_TEST: "false", +}; -export const recorderConfiguration: RecorderEnvironmentSetup = { - replaceableVariables: { - COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING: "endpoint=https://endpoint/;accesskey=banana", - AZURE_PHONE_NUMBER: "+14255550123", - AZURE_CLIENT_ID: "SomeClientId", - AZURE_CLIENT_SECRET: "azure_client_secret", - AZURE_TENANT_ID: "SomeTenantId", - COMMUNICATION_SKIP_INT_SMS_TEST: "false", - }, - customizationsOnRecordings: [ - (recording: string): string => recording.replace(/(https:\/\/)([^/',]*)/, "$1endpoint"), - (recording: string): string => - recording.replace(/"access_token"\s?:\s?"[^"]*"/g, `"access_token":"sanitized"`), - (recording: string): string => - recording.replace( - /"repeatabilityRequestId"\s?:\s?"[^"]*"/g, - `"repeatabilityRequestId":"sanitized"` - ), - (recording: string): string => - recording.replace( - /"repeatabilityFirstSent"\s?:\s?"[^"]*"/g, - `"repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"` - ), +const sanitizerOptions: SanitizerOptions = { + connectionStringSanitizers: [ + { + actualConnString: env.COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING, + fakeConnString: envSetupForPlayback["COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING"], + }, + ], + generalSanitizers: [ + { regex: true, target: `"access_token"\\s?:\\s?"[^"]*"`, value: `"access_token":"sanitized"` }, + { + regex: true, + target: `"repeatabilityRequestId"\\s?:\\s?"[^"]*"`, + value: `"repeatabilityRequestId":"sanitized"`, + }, + { + regex: true, + target: `"repeatabilityFirstSent"\\s?:\\s?"[^"]*"`, + value: `"repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"`, + }, ], - queryParametersToSkip: [], }; -function createCredential(): TokenCredential { - if (isPlaybackMode()) { - return { - getToken: async (_scopes) => { - return { token: "testToken", expiresOnTimestamp: 11111 }; - }, - }; - } else { - if (isNode) { - return new DefaultAzureCredential(); - } else { - return new ClientSecretCredential( - env.AZURE_TENANT_ID, - env.AZURE_CLIENT_ID, - env.AZURE_CLIENT_SECRET - ); - } - } -} +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback, + sanitizerOptions: sanitizerOptions, +}; -export function createSmsClient(): SmsClient { - // workaround: casting because min testing has issues with httpClient newer versions having extra optional fields - return new SmsClient(env.COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING, { - httpClient: createTestHttpClient(), - } as SmsClientOptions); +export async function createRecorder(context: Test | undefined): Promise { + const recorder = new Recorder(context); + await recorder.start(recorderOptions); + await recorder.setMatcher("CustomDefaultMatcher", { + excludedHeaders: [ + "Accept-Language", // This is env-dependent + "x-ms-content-sha256", // This is dependent on the current datetime + ], + }); + return recorder; } -export function createSmsClientWithToken(): SmsClient { - const { endpoint } = parseConnectionString(env.COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING); - const credential: TokenCredential = createCredential(); - // workaround: casting because min testing has issues with httpClient newer versions having extra optional fields - return new SmsClient(endpoint, credential, { - httpClient: createTestHttpClient(), - } as SmsClientOptions); +export async function createRecordedSmsClient( + context: Context +): Promise> { + const recorder = await createRecorder(context.currentTest); + + const client = new SmsClient( + env.COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING ?? "", + recorder.configureClientOptions({}) + ); + return { + client, + recorder, + }; } -function createTestHttpClient(): HttpClient { - const customHttpClient = new DefaultHttpClient(); +export async function createRecordedSmsClientWithToken( + context: Context +): Promise> { + const recorder = await createRecorder(context.currentTest); - const originalSendRequest = customHttpClient.sendRequest; - customHttpClient.sendRequest = async function ( - httpRequest: WebResourceLike - ): Promise { - const requestResponse = await originalSendRequest.apply(this, [httpRequest]); + let credential: TokenCredential; + const endpoint = parseConnectionString( + env.COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING ?? "" + ).endpoint; - console.log( - `MS-CV header for request: ${httpRequest.url} (${ - requestResponse.status - } - ${requestResponse.headers.get("ms-cv")})` - ); + if (isPlaybackMode()) { + credential = { + getToken: async (_scopes: any) => { + return { token: "testToken", expiresOnTimestamp: 11111 }; + }, + }; + } else { + credential = createTestCredential(); + } - return requestResponse; - }; + const client = new SmsClient(endpoint, credential, recorder.configureClientOptions({})); - return customHttpClient; + return { client, recorder }; }