diff --git a/sdk/communication/communication-sms/karma.conf.js b/sdk/communication/communication-sms/karma.conf.js index 851aae3eec2f..27981e6ca282 100644 --- a/sdk/communication/communication-sms/karma.conf.js +++ b/sdk/communication/communication-sms/karma.conf.js @@ -53,13 +53,13 @@ module.exports = function (config) { "AZURE_CLIENT_SECRET", "AZURE_TENANT_ID", "COMMUNICATION_SKIP_INT_SMS_TEST", - "RECORDINGS_RELATIVE_PATH" + "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",], + reporters: ["mocha", "coverage", "junit"], coverageReporter: { // specify a common output directory @@ -82,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, 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..c6880ae7bd00 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": "cs", + "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": "358e29ad-a97a-4624-9a16-ccf126158283", + "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": "Thu, 21 Apr 2022 14:59:23 GMT", + "MS-CV": "D5aS0Tz\u002BTkiT9dSx69xAWg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0S3FhYgAAAAA9PkiRVLitT6lpg0tzVyqlUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "366ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_202204211459235a22bb98-8a07-4601-b13e-692f761377c2_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..eb76d60e15a4 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": "cs", + "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": "9490473e-6982-4333-83e4-4ea9b7c6721f", + "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": "Thu, 21 Apr 2022 14:59:25 GMT", + "MS-CV": "3uN4b762TUygZaRhlJswPw.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0TXFhYgAAAACLRWDayHVWSrFoQO7arTAJUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "283ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220421145925b80607f3-7f2e-400c-93f9-19ba1c21969e_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..6315c0ca3764 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": "cs", + "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": "f6aa13e3-21d4-4dfe-9e4f-bf68cdae1a0c", + "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": "Thu, 21 Apr 2022 14:59:24 GMT", + "MS-CV": "eBXoP6Cb3UGqa0/AJ4cQmA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0THFhYgAAAABkIFkaX/GuRK5ymvnsB7c5UFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "96ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_2022042114592422454580-404e-461c-9fb1-b550118fe638_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..66b8aaee1588 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": "cs", + "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": "2ff7f50d-a6d2-4971-8218-35ad7adc5e78", + "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": "Thu, 21 Apr 2022 14:59:24 GMT", + "MS-CV": "M4S8Utfaw0qVKGbdKJxa3w.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0THFhYgAAAABGPWOHPXpoSbESAFXv/55QUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "263ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220421145924d89d254b-96eb-46ef-ac96-94f9fca0d0b8_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": "cs", + "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": "35a3151e-f8d0-4557-acff-3baa5959dcff", + "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": "Thu, 21 Apr 2022 14:59:25 GMT", + "MS-CV": "kBar8BkTPE25H9T1tR7JAA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0TXFhYgAAAAC24DnmWLqfRpDyNj7g1xUXUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "233ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_2022042114592527eb56db-5c6f-4975-a7b9-1102697d1592_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..d9f529b85692 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": "cs", + "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": "fe451fbb-d995-4f1b-88b7-4208c55f3742", + "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": "Thu, 21 Apr 2022 14:59:26 GMT", + "MS-CV": "nTtGfwBgwE\u002BL5VWy6AmBOg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0TnFhYgAAAACAXeyerY/xTYH4Rt6qjJpeUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "178ms" + }, + "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..a61ae430306c 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": "cs", + "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": "70d0631d-2455-4012-909f-6e567bbb55ab", + "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": "Thu, 21 Apr 2022 14:59:26 GMT", + "MS-CV": "Sn5xuDPfPE6qpiDZpGIz2w.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0TnFhYgAAAAAaWLbssoBLSaLSCdIYdtu7UFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "15ms" + }, + "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..2b1636c6b92a 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": "cs", + "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": "b327bdb4-b6e8-4e34-b9a6-6f5ca8f34d0f", + "x-ms-content-sha256": "7V8Q25f2RaiSaT\u002BPUgb2ccDgFx5yID7xhH43LH5Dyv8=", + "x-ms-date": "Thu, 21 Apr 2022 14:59:26 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": "Thu, 21 Apr 2022 14:59:27 GMT", + "MS-CV": "J9rMtrikzk2xgNZiWIDOSA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0TnFhYgAAAAAi53DtN9bRRbs85wQKJQrkUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "267ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220421145927520f1481-358d-4070-919e-4e738b0f1fb3_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..61dd253a21ae 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": "cs", + "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": "ea9cd442-37f2-469f-a777-17d885af401c", + "x-ms-content-sha256": "2tU2EwnEjupHSSj0f1TW1E/9ej8axtHFX1yKss76LzQ=", + "x-ms-date": "Thu, 21 Apr 2022 14:59:28 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": "Thu, 21 Apr 2022 14:59:28 GMT", + "MS-CV": "K/8kyYloMU2BZrrOIBRKBA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0UHFhYgAAAABiLG\u002BLMA5gSqJkr9VlV9O9UFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "234ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_202204211459289fbcfd83-ee51-4622-ace6-913aaadee921_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..83a348af7c16 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": "cs", + "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": "b32971a7-f482-4331-b1c4-786b53dfeb4c", + "x-ms-content-sha256": "hWOuD5nTpRC\u002BCcN6NyTVq6bwMdjDp7KDJ98Oq9xQxcc=", + "x-ms-date": "Thu, 21 Apr 2022 14:59:27 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": "Thu, 21 Apr 2022 14:59:27 GMT", + "MS-CV": "pj3Hmg1XGU28W6D4bGxAJA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0T3FhYgAAAAAADN8JecJyR59s4sLk4/QkUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "271ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220421145927ead03e7f-871f-4e43-89cd-2ff731658f8a_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..dac238bc8ff3 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": "cs", + "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": "17bd3f4e-0f68-4356-a066-91f46367f5c4", + "x-ms-content-sha256": "yO8B79pgOr81bdAstqxuOfpsc4Sus2TX1kDkfCrb6us=", + "x-ms-date": "Thu, 21 Apr 2022 14:59:27 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": "Thu, 21 Apr 2022 14:59:27 GMT", + "MS-CV": "PUOnOgD6bEehta1tlz9ZBA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0T3FhYgAAAADLSJDWlYdcR6T9u/M63I1KUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "259ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220421145927983da229-1630-4b04-af88-ea25be10f26f_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": "cs", + "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": "238d4278-945e-49fe-94e7-1fdf9adf99de", + "x-ms-content-sha256": "P2BAZ9G5p52sdroDden6HzOQwTv71JiYfOqTHu2XJX4=", + "x-ms-date": "Thu, 21 Apr 2022 14:59:28 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": "Thu, 21 Apr 2022 14:59:28 GMT", + "MS-CV": "Wi7fgNgK1EeCXH6TnMSQ0g.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0UHFhYgAAAABTG7SV/ssRRYZYqaDOIquJUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "289ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_202204211459282b467ce6-be63-41af-9a4d-85ace14aaa98_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..a120578664d6 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": "cs", + "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": "9a6c5928-1b7a-4a5a-93ec-005914faa919", + "x-ms-content-sha256": "lezAlpu3V4YNj2y3APetEbI4FxmVKe7JnYPZPqScGxI=", + "x-ms-date": "Thu, 21 Apr 2022 14:59:28 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": "Thu, 21 Apr 2022 14:59:29 GMT", + "MS-CV": "B3/SO73cT029AT6VRV1Thg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0UHFhYgAAAAAsf0HeDespRq4sYRS6ficfUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "196ms" + }, + "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..ea6a3729f83e 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": "cs", + "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": "7da279f8-5542-4114-b961-71cccbdc9aae", + "x-ms-content-sha256": "tcMTTe54zazzLcv97UIH/UJ4SJ7zBMiY5n8qbWOXAgA=", + "x-ms-date": "Thu, 21 Apr 2022 14:59:29 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": "Thu, 21 Apr 2022 14:59:29 GMT", + "MS-CV": "hRapX3BLWkywhj45Rt1j6g.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0UXFhYgAAAABZE7oWhRLzR7FUpV9zYBdvUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "20ms" + }, + "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 d90329684873..1498adcedf9f 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,34 +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=1k9VaCT---MeE%7EiBrPgN7V84XPYQ59P6_j&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": "Fri, 08 Apr 2022 12:51:10 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+est\"}]}", - "strict-transport-security": "max-age=31536000; includeSubDomains", - "x-content-type-options": "nosniff", - "x-ms-ests-server": "2.1.12621.9 - WUS2 ProdSlices", - "x-ms-request-id": "29940708-53c5-46e0-830a-5f23cd163d00", - "x-xss-protection": "0" - } - } - ], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "4bcdd6659364710541989b8bee3507ee" -} \ 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": "cs", + "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": "f21e4c75-95b8-4a32-b01a-65c9e4c231aa", + "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": "Thu, 21 Apr 2022 14:59:17 GMT", + "MS-CV": "gbwA4e1w5keJTsPfpHbWGg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0RnFhYgAAAADRSDyiKG2QRL2ZGz9dOWprUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "101ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220421145918a340a8f1-812e-4bc3-a836-c595dbe85af8_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 fd09f90e7eed..b39fbb0e0f4d 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,34 +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=1k9VaCT---MeE%7EiBrPgN7V84XPYQ59P6_j&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": "Fri, 08 Apr 2022 12:51:13 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+est\"}]}", - "strict-transport-security": "max-age=31536000; includeSubDomains", - "x-content-type-options": "nosniff", - "x-ms-ests-server": "2.1.12621.9 - SCUS ProdSlices", - "x-ms-request-id": "25945dff-5e04-4270-be95-f6acc1464600", - "x-xss-protection": "0" - } - } - ], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "e5e54e711569bace350ec5c4564b4b23" -} \ 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": "cs", + "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": "f7239b8f-2718-49f7-a535-56427d378684", + "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": "Thu, 21 Apr 2022 14:59:19 GMT", + "MS-CV": "8FwMvp3tNE\u002BiF3Y1HCeaEw.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0R3FhYgAAAABRMvY5kDwwSLkEF8l/quIRUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "101ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_202204211459207b52a54a-54bf-4a31-9755-90de879063c1_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 db9510c05b21..b3bb45860bc6 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,34 +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=1k9VaCT---MeE%7EiBrPgN7V84XPYQ59P6_j&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": "Fri, 08 Apr 2022 12:51:11 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+est\"}]}", - "strict-transport-security": "max-age=31536000; includeSubDomains", - "x-content-type-options": "nosniff", - "x-ms-ests-server": "2.1.12621.9 - SCUS ProdSlices", - "x-ms-request-id": "9d208c7f-3031-4a4b-b963-9be402be4600", - "x-xss-protection": "0" - } - } - ], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "06d6d20999014a4ee7a7796c5e5ac76a" -} \ 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": "cs", + "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": "31d4166b-067a-41e0-a6e6-399c5bb56899", + "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": "Thu, 21 Apr 2022 14:59:18 GMT", + "MS-CV": "vtqKB2cBa0SYciP\u002BLFwarA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0RnFhYgAAAAD93cepm/59Sb4UTWG3HEt3UFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "101ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220421145919acf6967b-c304-4bd3-bb71-d5a700b5e891_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 5bbe63b0c4a5..ff0dd10625e8 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,34 +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=1k9VaCT---MeE%7EiBrPgN7V84XPYQ59P6_j&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": "Fri, 08 Apr 2022 12:51:12 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+est\"}]}", - "strict-transport-security": "max-age=31536000; includeSubDomains", - "x-content-type-options": "nosniff", - "x-ms-ests-server": "2.1.12621.9 - WUS2 ProdSlices", - "x-ms-request-id": "f4f7c94b-ac8a-4a99-b31d-e45984e03600", - "x-xss-protection": "0" - } - } - ], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "d41e935127f967fa836f5203486c2049" -} \ 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": "cs", + "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": "46b1dcf4-0e04-4e6f-b3bd-41ce66deacba", + "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": "Thu, 21 Apr 2022 14:59:18 GMT", + "MS-CV": "pxQ3x8IMKkKAHCoHBhuiQA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0R3FhYgAAAACRV3WoK5JCR7SpSwURYy4iUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "110ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220421145919685ac2e6-dd0a-433d-8548-7d7a49091260_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": "cs", + "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": "2e7012b3-1195-4670-8cb2-d51a7126f9f8", + "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": "Thu, 21 Apr 2022 14:59:18 GMT", + "MS-CV": "DmiZPdv7rEqMWErTzai4Wg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0R3FhYgAAAADbbbySwe\u002BjTZpQdHCzDxN1UFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "106ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220421145919dd404bd8-fd29-4dad-9d0a-84d297d0945b_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 dc0c0e36065a..e2d9f89e7f35 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,34 +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=1k9VaCT---MeE%7EiBrPgN7V84XPYQ59P6_j&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": "Fri, 08 Apr 2022 12:51:14 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+est\"}]}", - "strict-transport-security": "max-age=31536000; includeSubDomains", - "x-content-type-options": "nosniff", - "x-ms-ests-server": "2.1.12621.9 - SCUS ProdSlices", - "x-ms-request-id": "9d208c7f-3031-4a4b-b963-9be47cbe4600", - "x-xss-protection": "0" - } - } - ], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "d9f97bf1b0608a03810d5571884c2756" -} \ 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": "cs", + "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": "3a9d36ea-5e0f-4650-a98d-fe5b2891c23b", + "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": "Thu, 21 Apr 2022 14:59:19 GMT", + "MS-CV": "BgPANCjqVUawopbKLt9kKw.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0SHFhYgAAAAAAlieLY6akQ7E7dxXoyUsqUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "52ms" + }, + "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 91bbd9190174..c17abc928082 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,34 +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=1k9VaCT---MeE%7EiBrPgN7V84XPYQ59P6_j&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": "Fri, 08 Apr 2022 12:51:15 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+est\"}]}", - "strict-transport-security": "max-age=31536000; includeSubDomains", - "x-content-type-options": "nosniff", - "x-ms-ests-server": "2.1.12621.9 - NCUS ProdSlices", - "x-ms-request-id": "63c1f730-6e4c-403b-a543-650cbbdf2800", - "x-xss-protection": "0" - } - } - ], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "e830f0d478454c137a071b9e63b90611" -} \ 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": "cs", + "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": "92dc9cd4-c733-42de-abb0-dad6c1119037", + "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": "Thu, 21 Apr 2022 14:59:19 GMT", + "MS-CV": "N6utOiWzO0qCqVqB455aHQ.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0SHFhYgAAAACyXbqXgUSlTYIcGw0wTm4HUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "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 b803d168fe72..f0765e3b1188 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_202204081251165e0e8fd4-3c87-4071-b741-0c43a13f1692_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"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": "Fri, 08 Apr 2022 12:51:15 GMT", - "ms-cv": "B9o3D5cW8Ui3PsTL6Hmtaw.0", - "strict-transport-security": "max-age=2592000", - "x-azure-ref": "0xC9QYgAAAADVU/1HO+nBSK681MrScymCV1NURURHRTA4MTIAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", - "x-cache": "CONFIG_NOCACHE", - "x-processing-time": "503ms" - } - } - ], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "4bcdd6659364710541989b8bee3507ee" -} \ 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": "cs", + "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": "0a75aa8e-a8e9-47e6-a140-7a6bf245e4ef", + "x-ms-content-sha256": "ZM8EHPfdyEHl\u002BxZujBWfL4A/vgLM320N5\u002B\u002BFjt6Jnuw=", + "x-ms-date": "Thu, 21 Apr 2022 14:59:20 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": "Thu, 21 Apr 2022 14:59:21 GMT", + "MS-CV": "z\u002B0eBWPqgEuUI5dWmVlwDA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0SHFhYgAAAABPnhTefSJsR7iHKbXrbVh5UFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "103ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220421145921c05582f2-aa22-4a01-b65b-ec41209c6f40_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 2f55cbd386d0..1cf6070d732e 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_20220408125118f88dc062-9bcf-4167-b76c-4858fe80f1ea_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":false},{\"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": "Fri, 08 Apr 2022 12:51:17 GMT", - "ms-cv": "kQDHr3ooY0SGpPRBpUeORg.0", - "strict-transport-security": "max-age=2592000", - "x-azure-ref": "0xi9QYgAAAABSFZx+qUynQo/ZM/E7LQ2HV1NURURHRTA4MTIAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", - "x-cache": "CONFIG_NOCACHE", - "x-processing-time": "362ms" - } - } - ], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "e5e54e711569bace350ec5c4564b4b23" -} \ 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": "cs", + "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": "5dd7e4b8-f1a1-41d1-8bee-3fb105dbb259", + "x-ms-content-sha256": "DPImxJjHqJgWcrkZcxF6jn/LXczRG7BSP4n3QNRbNUk=", + "x-ms-date": "Thu, 21 Apr 2022 14:59: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" + }, + { + "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": "Thu, 21 Apr 2022 14:59:22 GMT", + "MS-CV": "wOnooi2Zi0OJ\u002BWMjkREMUg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0SnFhYgAAAAD02L84X38WTq1I7qOCpzBEUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "173ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220421145922f6e896b6-d13e-4b29-97c1-9c2c5a0d5c51_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 c5bfe30d0c8e..89d48182c347 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\":false,\"tag\":\"SMS_LIVE_TEST\"}}", - "status": 202, - "response": "{\"value\":[{\"to\":\"+14255550123\",\"messageId\":\"Outgoing_20220408125117e60c73f7-813f-4941-bcd8-866c2c03d287_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"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": "Fri, 08 Apr 2022 12:51:16 GMT", - "ms-cv": "jNa9FdBgP0uyC37vrek2Gg.0", - "strict-transport-security": "max-age=2592000", - "x-azure-ref": "0xC9QYgAAAADqBfSTXXIrTL+OEAB8dIsmV1NURURHRTA4MTIAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", - "x-cache": "CONFIG_NOCACHE", - "x-processing-time": "355ms" - } - } - ], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "06d6d20999014a4ee7a7796c5e5ac76a" -} \ 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": "cs", + "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": "5e2d11f0-c2c4-41e4-a1ce-bc071d74e9fe", + "x-ms-content-sha256": "7b76dQrGW9xGICH/QWYYY/Q8x5dWb09GcwkkUfMjNwA=", + "x-ms-date": "Thu, 21 Apr 2022 14:59:21 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": "Thu, 21 Apr 2022 14:59:21 GMT", + "MS-CV": "NApg8j1XPkCOCfAo\u002B1a6Hg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0SXFhYgAAAAA/SfSF9wVEQYMgOKQ5CVPZUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "442ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_2022042114592187790b20-a8aa-4191-ad44-906b19153e74_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 ad9edf315b47..562d3ad8efa1 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\":false,\"tag\":\"SMS_LIVE_TEST\"}}", - "status": 202, - "response": "{\"value\":[{\"to\":\"+14255550123\",\"messageId\":\"Outgoing_2022040812511733d67a71-f031-4456-b32c-ca8d747af1ab_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"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": "Fri, 08 Apr 2022 12:51:16 GMT", - "ms-cv": "zldw85C6QEyB+VN1KYYd9A.0", - "strict-transport-security": "max-age=2592000", - "x-azure-ref": "0xS9QYgAAAAATYjsP2dsXSqtJq2Hxd27AV1NURURHRTA4MTIAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", - "x-cache": "CONFIG_NOCACHE", - "x-processing-time": "360ms" - } - }, - { - "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,\"tag\":\"SMS_LIVE_TEST\"}}", - "status": 202, - "response": "{\"value\":[{\"to\":\"+14255550123\",\"messageId\":\"Outgoing_20220408125118196349e8-ab78-4683-94b7-cc942140f2c4_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"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": "Fri, 08 Apr 2022 12:51:17 GMT", - "ms-cv": "mShCeXt08EeyJZMJj8JTVg.0", - "strict-transport-security": "max-age=2592000", - "x-azure-ref": "0xS9QYgAAAACHiOVr6BHUTLSvJe3Us0v8V1NURURHRTA4MTIAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", - "x-cache": "CONFIG_NOCACHE", - "x-processing-time": "359ms" - } - } - ], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "d41e935127f967fa836f5203486c2049" -} \ 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": "cs", + "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": "0bafab12-3617-450c-9964-5b5ba27f2101", + "x-ms-content-sha256": "3p5O7ntXe3VviZr1KUzCRJ9pTM8SjeGBAGdr12KDXbo=", + "x-ms-date": "Thu, 21 Apr 2022 14:59:21 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": "Thu, 21 Apr 2022 14:59:21 GMT", + "MS-CV": "DpcCLX7oeECpbffaEspJug.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0SXFhYgAAAACpxmQ5qDcfTpBR\u002BtklWjuBUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "105ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220421145921b172c87f-34cd-4944-ad32-a324d859d75e_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": "cs", + "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": "24c1ab41-a410-4c77-bb11-4e8e828f2c38", + "x-ms-content-sha256": "3G956r8qNoRgV7AFvsyTjty0H28ovFpumugJotjzJzE=", + "x-ms-date": "Thu, 21 Apr 2022 14:59:21 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": "Thu, 21 Apr 2022 14:59:22 GMT", + "MS-CV": "j/QrfYJrsUqMbgyaq1D4Vw.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0SXFhYgAAAACFub0LJy6BSY0QSFMmwvnpUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "298ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_202204211459224829c55f-3002-4889-9286-b3ed9cd8dae4_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 b9f6c5e7dc5c..587763387e18 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\":false,\"tag\":\"SMS_LIVE_TEST\"}}", - "status": 401, - "response": "{\"error\":{\"code\":\"Unauthorized\",\"message\":\"\"}}", - "responseHeaders": { - "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", - "content-type": "application/json", - "date": "Fri, 08 Apr 2022 12:51:17 GMT", - "ms-cv": "mpG3MQK4dEW30W5QhCVoog.0", - "strict-transport-security": "max-age=2592000", - "x-azure-ref": "0xi9QYgAAAADVV2erLt8UQoS2pJlTC7L6V1NURURHRTA4MTIAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", - "x-cache": "CONFIG_NOCACHE", - "x-processing-time": "280ms" - } - } - ], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "d9f97bf1b0608a03810d5571884c2756" -} \ 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": "cs", + "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": "09d88cb1-ab34-4269-8551-18b49dd1511b", + "x-ms-content-sha256": "1hdxJvVLhl83MSLot6cBpzJccFcqlD5PM7eef1c0Ag0=", + "x-ms-date": "Thu, 21 Apr 2022 14:59: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": 401, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "Content-Type": "application/json", + "Date": "Thu, 21 Apr 2022 14:59:23 GMT", + "MS-CV": "BzMqGjjUnk\u002Bs1GMV6Y6F3g.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0SnFhYgAAAACKtql3n2AyTaFxQq72nat8UFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "191ms" + }, + "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 b53648a0114c..aa679bf3509d 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\":false,\"tag\":\"SMS_LIVE_TEST\"}}", - "status": 400, - "response": "{\"From\":[\"Invalid from phone number format.\"]}", - "responseHeaders": { - "content-type": "application/json; charset=utf-8", - "date": "Fri, 08 Apr 2022 12:51:18 GMT", - "ms-cv": "NBNERT7+JUannyDetc+N+Q.0", - "strict-transport-security": "max-age=2592000", - "x-azure-ref": "0xy9QYgAAAAAPvhh6sI7IQJoyOa0+3xzMV1NURURHRTA4MTIAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", - "x-cache": "CONFIG_NOCACHE", - "x-processing-time": "20ms" - } - } - ], - "uniqueTestInfo": { - "uniqueName": {}, - "newDate": {} - }, - "hash": "e830f0d478454c137a071b9e63b90611" -} \ 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": "cs", + "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": "3db1359e-3f83-432b-ab6a-8b15318da8e2", + "x-ms-content-sha256": "XKcVNmFZX9gd0lz7f7PDFMUwa1yIkPUMwiH3KUJnI/8=", + "x-ms-date": "Thu, 21 Apr 2022 14:59:23 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": "Thu, 21 Apr 2022 14:59:23 GMT", + "MS-CV": "geqdNdvp2UybD8upIgFoWg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0S3FhYgAAAACk3QRWvl12RKxc2/Vo6OFeUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "20ms" + }, + "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..4b57fb11350e --- /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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "3405de06-2db5-466d-b512-32449f29bda9" + }, + "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": "Thu, 21 Apr 2022 14:59:07 GMT", + "MS-CV": "rslY8uUzIUOnfKj9FI8/YA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0PHFhYgAAAAA/pzH5dgaJSLTGWxoZqnn0UFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "230ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_202204211459088aa5006e-5a12-459b-bbc8-843f8dd4a89b_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..b74b4cdd3ead --- /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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "16b1ef49-1e4f-45c7-9b29-de68b04e9711" + }, + "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": "Thu, 21 Apr 2022 14:59:09 GMT", + "MS-CV": "UQEvTxbOGE6yOZIn7mCdsQ.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0PnFhYgAAAADm7cYZC7uAS4S0mGy8BFCxUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "92ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_202204211459102608f5f1-6ab5-4778-91f8-632909b85fb0_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..f8a98c48feb1 --- /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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "6d208838-d559-4538-a73d-6b9139e860b7" + }, + "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": "Thu, 21 Apr 2022 14:59:08 GMT", + "MS-CV": "Tvj5K30jdEChJ6JOqwZlwg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0PHFhYgAAAAD7gsmEXKKKToD1lxQxVQjRUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "229ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220421145909f894321b-e673-4459-ab9d-76151cc223e1_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..c46a2ff50f85 --- /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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "cf0cfac0-7d99-4445-aa99-ca91e98e5d60" + }, + "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": "Thu, 21 Apr 2022 14:59:08 GMT", + "MS-CV": "/AbCUWKQoU6CyzlyUTHjcQ.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0PXFhYgAAAABAMh6Kp9KXRaUbLuhhGVu8UFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "232ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220421145909ada3c074-057d-4b1f-8891-6b9575ad0385_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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "88dc4a82-ccca-4b82-8387-0f9cb55cc230" + }, + "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": "Thu, 21 Apr 2022 14:59:09 GMT", + "MS-CV": "MMQIgOCBiE\u002BkM0O\u002Bvs54bA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0PXFhYgAAAAApIKGV/iMSSISpvvtpG1kkUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "109ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220421145909a1255764-3404-4510-8d9f-54aff45f65cf_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..ddd42c078e04 --- /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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "0c202dba-039b-4eee-a655-3e8a2373554b" + }, + "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": "Thu, 21 Apr 2022 14:59:09 GMT", + "MS-CV": "\u002BF\u002BNaJpK2UaueC53\u002BeV3Ug.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0PnFhYgAAAAB/ZmtRmh1TTbYBenhJFjOWUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "51ms" + }, + "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..0e5f40b5e778 --- /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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "9902b195-8d74-4b92-965a-99d0241de1e6" + }, + "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": "Thu, 21 Apr 2022 14:59:10 GMT", + "MS-CV": "BrD6gN2Z3U6paixfL\u002B8Jsg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0P3FhYgAAAAC5oxV62yX7TK79511I7CAgUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "13ms" + }, + "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..c617bc25a285 --- /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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "96eaa9f9-1a3a-470d-9664-a12d099573ed", + "x-ms-content-sha256": "1EijGVQv8XOtsRGZYmD7dJEiaDU9s5AwYPd/LaqroQw=", + "x-ms-date": "Thu, 21 Apr 2022 14:59:11 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": "Thu, 21 Apr 2022 14:59:10 GMT", + "MS-CV": "WqckibhS6UO2M6ObEqmrZw.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0P3FhYgAAAAA5zxsajRGLSryFAhunwFk4UFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "114ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220421145911d59780be-094f-4e64-a9f5-940bc7784ff3_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..f9faaa8184e0 --- /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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "4048a6bd-9b0d-417a-83e6-43112a139c84", + "x-ms-content-sha256": "JiSgzkiBvKs6B3cJqVjEdXpkNwDjBOg6W9bRDTytF2Y=", + "x-ms-date": "Thu, 21 Apr 2022 14:59:12 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": "Thu, 21 Apr 2022 14:59:11 GMT", + "MS-CV": "x0ee46q35UCU14KeEn3EQQ.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0QHFhYgAAAADv2ldP2mCKRpeEpYT6zjFVUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "103ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220421145912f0a95d67-e779-4278-b366-4435bda12f50_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..e288b0ad0823 --- /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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "d6d26ef1-2a72-448f-a6ff-34431e84c624", + "x-ms-content-sha256": "4rw155OcALE7lhzv8MUjGO6UWJnL5kI2cv/4ZcOwLqY=", + "x-ms-date": "Thu, 21 Apr 2022 14:59: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": "Thu, 21 Apr 2022 14:59:10 GMT", + "MS-CV": "3Ztk3mlreEKk\u002Bz6nNGfeyA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0P3FhYgAAAAB1BeXVrUoeQKGmwKEpXb8MUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "109ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_2022042114591129921524-2eb8-4ec0-9295-4e7bbe83c30f_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..26b122b19853 --- /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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "ff5e7921-bb03-426a-9775-287743c53cab", + "x-ms-content-sha256": "RBOB23dqZZEl/KSaUNqytWb6o2k9tykKCqT8eAn/Ok8=", + "x-ms-date": "Thu, 21 Apr 2022 14:59: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": "Thu, 21 Apr 2022 14:59:11 GMT", + "MS-CV": "2BFQ\u002BOYiPkyVvEhQpSJ\u002B0w.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0P3FhYgAAAAAdkSpfheXCQZeLOqIrSqtgUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "103ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_202204211459110f65c399-1405-4e26-a997-e7c63fff7f0d_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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "3151f161-6154-45d4-9e98-52c5705cf27d", + "x-ms-content-sha256": "FAMxZju0wMXJZcbRoU/7LE52iYE0rpM/yDmvdSdB17E=", + "x-ms-date": "Thu, 21 Apr 2022 14:59: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": "Thu, 21 Apr 2022 14:59:11 GMT", + "MS-CV": "0G\u002BjCHbIj0qILt/q1RwCTQ.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0QHFhYgAAAAAD/UKGsKLxR4mUgL//tZbOUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "102ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_202204211459127728d178-ab3a-4cf5-a29e-018064b73d89_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..d7d16f4dbf48 --- /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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "d9d33585-1b5e-4e7c-a0ef-582cde24a9cc", + "x-ms-content-sha256": "26T3W313jOppMv1k/xpfVagqNV5yK3\u002BZ/9UkeXr1JdY=", + "x-ms-date": "Thu, 21 Apr 2022 14:59:12 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": "Thu, 21 Apr 2022 14:59:11 GMT", + "MS-CV": "OIhmBohDSkCHGKsESoSOOA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0QHFhYgAAAAADddBJ\u002B9rYTLhPvY2IbV8PUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "60ms" + }, + "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..96e89f23b460 --- /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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "0366ea5e-06f2-4788-a816-e652e23d9fc2", + "x-ms-content-sha256": "E/46I5DkY/QPaYDVRcYtCZWYKhIywmWnEDTflAKLw\u002Bw=", + "x-ms-date": "Thu, 21 Apr 2022 14:59: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": "Thu, 21 Apr 2022 14:59:11 GMT", + "MS-CV": "OJ8cc0wRl0ie\u002BbWfY11cFw.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0QHFhYgAAAAB6WgSBd6SnTqZhMMECDRTCUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "20ms" + }, + "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 56723b6029f8..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_aad_when_sending_sms/recording_can_send_an_sms_message.js +++ /dev/null @@ -1,139 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "83d058dc072c9d4f54912651d15b4836"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":false}) - .get('/common/discovery/instance') - .query(false) - .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', - '839e65f7-d190-4492-8445-2e4e17462002', - 'x-ms-ests-server', - '2.1.12570.16 - SCUS ProdSlices', - 'Set-Cookie', - 'fpc=ApxA_ocS0kRHgiC5hLQ_CRE; expires=Sun, 08-May-2022 12:50:55 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrqzvm3jti4EZinBHhHyntf29ASfAqrDE78BbotnbPngH2qHxD9XGdtfW69wBvAbSiOfMAiV5Gdjzr-hD4dDhINUpPYtIGuUjX42sBQhuDz6infZIcaZg_mi860oydz-srxb7mqvpfb4ZYTLcI8N1jKe9TYH91uSahX98Vwocfaw8gAA; 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', - 'Fri, 08 Apr 2022 12:50:55 GMT', - 'Content-Length', - '980' -]); - -nock('https://endpoint', {"encodedQueryParams":false}) - .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":false,"frontchannel_logout_supported":false,"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"],"kerberos_endpoint":"https://login.microsoftonline.com/SomeTenantId/kerberos","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', - '39c1a46f-8755-4ce9-a899-a065c21b4400', - 'x-ms-ests-server', - '2.1.12621.9 - SCUS ProdSlices', - 'X-XSS-Protection', - '0', - 'Set-Cookie', - 'fpc=As7TN3sr-rdIi2f6RE74Dk4; expires=Sun, 08-May-2022 12:50:55 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrfVaPyvP7CbVhXjksiodIoTMgS1NwLT_GJhrv1PsRHq7REZaJFQA1hmVkp_HRual7VjJdwqNaJf15qHCVpXMnoGCEk0RYnRWUgnFL3SyX5-Nq42eY6cEyOYhIhCEBknL1aj38Ibum9KILfJGCGuQjh2yum2OEmuaVSVkqw-FdUbogAA; 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', - 'Fri, 08 Apr 2022 12:50:55 GMT', - 'Content-Length', - '1753' -]); - -nock('https://endpoint', {"encodedQueryParams":false}) - .post('/SomeTenantId/oauth2/v2.0/token', "client_id=SomeClientId&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.5.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=04bdf40f-fbbc-4f13-9ab7-3aa184326f17&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") - .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', - '39c1a46f-8755-4ce9-a899-a065c71b4400', - 'x-ms-ests-server', - '2.1.12621.9 - SCUS ProdSlices', - 'x-ms-clitelem', - '1,0,0,,', - 'X-XSS-Protection', - '0', - 'Set-Cookie', - 'fpc=ArNvJv5hmIJMgkQ7Fi5XTtWVC-yCAQAAAK8m4tkOAAAA; expires=Sun, 08-May-2022 12:50:55 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', - 'Fri, 08 Apr 2022 12:50:55 GMT', - 'Content-Length', - '1327' -]); - -nock('https://endpoint', {"encodedQueryParams":false}) - .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(false) - .reply(202, {"value":[{"to":"+14255550123","messageId":"Outgoing_202204081250560be43b78-d2e3-4f37-ad08-20ac984bff0c_noam","httpStatusCode":202,"repeatabilityResult":"accepted","successful":false}]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'MS-CV', - 'vnIosNtte0eT7qZSGMkZig.0', - 'Strict-Transport-Security', - 'max-age=2592000', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '721ms', - 'X-Cache', - 'CONFIG_NOCACHE', - 'X-Azure-Ref', - '0ry9QYgAAAADM+vErIRRoT7lKDiHXyPpKV1NURURHRTA4MTAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', - 'Date', - 'Fri, 08 Apr 2022 12:50:55 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..5ba4c0bd8181 --- /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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "4c3ab460-c014-4ecb-9640-01c6af14edc6" + }, + "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": "Thu, 21 Apr 2022 14:59:01 GMT", + "MS-CV": "TUFhIOCVWEGBarv\u002BdtStCA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0NXFhYgAAAAAVNUUETzeyQotbNWEY8R87UFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "264ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220421145901c7f3e788-0757-44a7-83a4-e3467339f66f_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 b1950d7a40b3..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,139 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "ddf1e270fd770f2610ccf69742b2c3d7"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":false}) - .get('/common/discovery/instance') - .query(false) - .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', - '0f366ec3-695e-4648-93b0-c3f75f861702', - 'x-ms-ests-server', - '2.1.12570.16 - EUS ProdSlices', - 'Set-Cookie', - 'fpc=An2mhAAGKFRGrht1XtSdYXs; expires=Sun, 08-May-2022 12:50:59 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrEAZ_a1hhkZskEY1pq93voD6-YY3-uJOLfinz_q6IQmzSAR5NgKDPgnhQgg2UWJ960LPTDIwEJbB1gFT4RnAqM5h9H86Uu1Z3YYmv47ovciC9OUOVGE27tsasW7ns0SdXxyrPHAJ1s15HXdZyLJpa_r80Ch29faVUYFkO3Q1kgbIgAA; 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', - 'Fri, 08 Apr 2022 12:50:59 GMT', - 'Content-Length', - '980' -]); - -nock('https://endpoint', {"encodedQueryParams":false}) - .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":false,"frontchannel_logout_supported":false,"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"],"kerberos_endpoint":"https://login.microsoftonline.com/SomeTenantId/kerberos","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', - 'e0fe102d-95bd-4d89-9d50-bd6580b24100', - 'x-ms-ests-server', - '2.1.12621.9 - EUS ProdSlices', - 'X-XSS-Protection', - '0', - 'Set-Cookie', - 'fpc=Ag34fNkwMGNFopmAizxaCZI; expires=Sun, 08-May-2022 12:50:59 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrXu_EPo-yKKVXZ_IdDSJtd_FjhRH3aQXJYCNMVTqfa3cLJG3_T4_3dNxG6Nkj2n6NJX34AfUOkWjQAHoMMo4nEAHh5leYZIKSEGiCGslZkVQIDpvq1tZWnWm5MkrnTrxYWsNaw1zzsFbvvmVFpCQt9I9XVY4WbwoTJNlAokQ_giMgAA; 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', - 'Fri, 08 Apr 2022 12:50:59 GMT', - 'Content-Length', - '1753' -]); - -nock('https://endpoint', {"encodedQueryParams":false}) - .post('/SomeTenantId/oauth2/v2.0/token', "client_id=SomeClientId&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.5.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=59010e13-ee66-44ab-837c-00bf8eb905f0&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") - .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', - '88078335-7759-4b1e-8ead-c5b277f24700', - 'x-ms-ests-server', - '2.1.12621.9 - SCUS ProdSlices', - 'x-ms-clitelem', - '1,0,0,,', - 'X-XSS-Protection', - '0', - 'Set-Cookie', - 'fpc=Avs9glRN41ZNi4tadSuHsHiVC-yCAQAAALMm4tkOAAAA; expires=Sun, 08-May-2022 12:50:59 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', - 'Fri, 08 Apr 2022 12:50:59 GMT', - 'Content-Length', - '1327' -]); - -nock('https://endpoint', {"encodedQueryParams":false}) - .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(false) - .reply(202, {"value":[{"to":"+14255550123","messageId":"Outgoing_20220408125100d352c8f5-1c99-4dee-92ec-3346eb9a428b_noam","httpStatusCode":202,"repeatabilityResult":"accepted","successful":false},{"to":"+1425555012345","httpStatusCode":400,"errorMessage":"Invalid To phone number format.","successful":false}]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'MS-CV', - '07gQD7ZSUUygkyA5G0FAMg.0', - 'Strict-Transport-Security', - 'max-age=2592000', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '553ms', - 'X-Cache', - 'CONFIG_NOCACHE', - 'X-Azure-Ref', - '0sy9QYgAAAAANgdu7GNMUTpK+eXkaqNhdV1NURURHRTA4MTAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', - 'Date', - 'Fri, 08 Apr 2022 12:50:59 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..48f194e5ecee --- /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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "b2f62600-187c-4f5c-b023-a2cdb19b59b1" + }, + "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": "Thu, 21 Apr 2022 14:59:03 GMT", + "MS-CV": "Nx2wqPTc9k2enxu4N0xQjg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0N3FhYgAAAAA3mJ5u71uFTo7NJXUPmk9XUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "223ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_202204211459036d38b0a3-c2f4-41cd-ae59-47133ce22aab_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 37ee3f3ca15a..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,141 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "94a53f2b724b1d07990177d0612de57d"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":false}) - .get('/common/discovery/instance') - .query(false) - .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', - '2ee7d765-6b15-45a0-af1b-68977f8f4f00', - 'x-ms-ests-server', - '2.1.12621.9 - EUS ProdSlices', - 'X-XSS-Protection', - '0', - 'Set-Cookie', - 'fpc=An0OlD40N5tKkpUCTQaPlYQ; expires=Sun, 08-May-2022 12:50:56 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr1Jkrg4u9YKKrpS7nv3ZQJ0MdOEDy49aqqKQp1Xh3CzriSFixyoKdJ5kQncrbOLmdtKzAgYlPUfAT23QO-A5gvworAAH9omJB4KfSH9vaJ9F6LgUNkrIhfUwSurmuHpKu4IXZITnTUPL1u0NXdFnzCMWqfl4SQStSInojUfBXOf4gAA; 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', - 'Fri, 08 Apr 2022 12:50:56 GMT', - 'Content-Length', - '980' -]); - -nock('https://endpoint', {"encodedQueryParams":false}) - .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":false,"frontchannel_logout_supported":false,"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"],"kerberos_endpoint":"https://login.microsoftonline.com/SomeTenantId/kerberos","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', - '9f7837e8-f418-48e9-b1c8-8f3aee873e00', - 'x-ms-ests-server', - '2.1.12621.9 - WUS2 ProdSlices', - 'X-XSS-Protection', - '0', - 'Set-Cookie', - 'fpc=AgGRcDjIq6FNphSNMLzZIRo; expires=Sun, 08-May-2022 12:50:56 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrT2R5vZOM_L3X1k23UrStq45DXYGcZ0X0PiQKJAhgzkDdHddPOqrlZu2gyNNIj0iknSsAXrlYSGsabcc0buLS0gJO5mHISxwnUnLi8kCojbtu-EX3tIwmL3hljZpnXCh9DUUhwkO4CfFXOtiZ03hNcHWOIeJXxuk2tvtvbTds6A4gAA; 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', - 'Fri, 08 Apr 2022 12:50:56 GMT', - 'Content-Length', - '1753' -]); - -nock('https://endpoint', {"encodedQueryParams":false}) - .post('/SomeTenantId/oauth2/v2.0/token', "client_id=SomeClientId&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.5.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=ec4b54ec-d54a-47e7-a204-84ba66529f64&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") - .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', - '9f7837e8-f418-48e9-b1c8-8f3af6873e00', - 'x-ms-ests-server', - '2.1.12621.9 - WUS2 ProdSlices', - 'x-ms-clitelem', - '1,0,0,,', - 'X-XSS-Protection', - '0', - 'Set-Cookie', - 'fpc=ArakOoUf9n9OgUoDEOuqT00; expires=Sun, 08-May-2022 12:50:57 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', - 'Fri, 08 Apr 2022 12:50:57 GMT', - 'Content-Length', - '1327' -]); - -nock('https://endpoint', {"encodedQueryParams":false}) - .post('/sms', {"from":"+14255550123","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":false,"tag":"SMS_LIVE_TEST"}}) - .query(false) - .reply(202, {"value":[{"to":"+14255550123","messageId":"Outgoing_2022040812505782015270-019f-4958-9c16-b042d0f9d6c9_noam","httpStatusCode":202,"repeatabilityResult":"accepted","successful":false}]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'MS-CV', - 'm8hsYyEMXEmxtCLTvQF65w.0', - 'Strict-Transport-Security', - 'max-age=2592000', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '524ms', - 'X-Cache', - 'CONFIG_NOCACHE', - 'X-Azure-Ref', - '0sS9QYgAAAAD04/MGJAfyR4TKqsatpmlsV1NURURHRTA4MTAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', - 'Date', - 'Fri, 08 Apr 2022 12:50:57 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..e59141c7f886 --- /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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "8f5590f5-e899-45ef-8f99-65740d0d6a95" + }, + "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": "Thu, 21 Apr 2022 14:59:01 GMT", + "MS-CV": "OD8lOE61NE6d\u002Be1pJaY63w.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0NnFhYgAAAADUah7DPO4rQquT0ocD\u002BmtVUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "252ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220421145902af2bfe4c-c86e-4432-b708-951b25bcc220_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 424d924e067d..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,163 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "9a17617be8b47b129ee4b7eda55945c8"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":false}) - .get('/common/discovery/instance') - .query(false) - .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', - 'f38503be-112a-4db8-8d25-4d0054a11001', - 'x-ms-ests-server', - '2.1.12570.16 - NCUS ProdSlices', - 'Set-Cookie', - 'fpc=AtGRToNsxeVHgTxql1abIs0; expires=Sun, 08-May-2022 12:50:57 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr_nuK888cMD7aLhzGJNb5pEZH2zxLifP31MVVkeTVyg3iPKLY9bzdEdzaZL6JOeOwltrsQsZD5YfOYbtflLzUmaIrM-1P6GAlniAmDImLWvfIX9uuhp8ZYLPz20JCrUFbOpEiNOvlGIdM4XLic26YIDH7LFmA0bClCw8_lBIZaQ8gAA; 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', - 'Fri, 08 Apr 2022 12:50:57 GMT', - 'Content-Length', - '980' -]); - -nock('https://endpoint', {"encodedQueryParams":false}) - .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":false,"frontchannel_logout_supported":false,"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"],"kerberos_endpoint":"https://login.microsoftonline.com/SomeTenantId/kerberos","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', - '39c1a46f-8755-4ce9-a899-a0653b1c4400', - 'x-ms-ests-server', - '2.1.12621.9 - SCUS ProdSlices', - 'X-XSS-Protection', - '0', - 'Set-Cookie', - 'fpc=AuFLd09iAAdNkvwaJ2UEkPc; expires=Sun, 08-May-2022 12:50:58 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrr8J_3JkfZJiQRse83LsIPGCFwKZ_ENmYh5m_239wHvcU8nLs79IGFFTuymzLZAFXO08UtKX6JksyTnwioYsItyOyzgEr5vLbw8GAXmPfhsbsqcfT6WCluEmoJExYkCVVL4ktQ9Fc--e1sU1ewZwUq8dWm17smMrwJ5WyARfITRIgAA; 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', - 'Fri, 08 Apr 2022 12:50:57 GMT', - 'Content-Length', - '1753' -]); - -nock('https://endpoint', {"encodedQueryParams":false}) - .post('/SomeTenantId/oauth2/v2.0/token', "client_id=SomeClientId&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.5.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=d1cf6aa1-4107-4156-baed-346c43cd3979&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") - .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', - '63c1f730-6e4c-403b-a543-650c87de2800', - 'x-ms-ests-server', - '2.1.12621.9 - NCUS ProdSlices', - 'x-ms-clitelem', - '1,0,0,,', - 'X-XSS-Protection', - '0', - 'Set-Cookie', - 'fpc=AsUXpIj1vtdFub6za8lKI3aVC-yCAQAAALEm4tkOAAAA; expires=Sun, 08-May-2022 12:50:58 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', - 'Fri, 08 Apr 2022 12:50:58 GMT', - 'Content-Length', - '1327' -]); - -nock('https://endpoint', {"encodedQueryParams":false}) - .post('/sms', {"from":"+14255550123","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":false,"tag":"SMS_LIVE_TEST"}}) - .query(false) - .reply(202, {"value":[{"to":"+14255550123","messageId":"Outgoing_202204081250588653b103-9b67-41b4-990e-b81d30838d93_noam","httpStatusCode":202,"repeatabilityResult":"accepted","successful":false}]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'MS-CV', - 'ubLRb/tEHE2HAZUFWglA1w.0', - 'Strict-Transport-Security', - 'max-age=2592000', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '547ms', - 'X-Cache', - 'CONFIG_NOCACHE', - 'X-Azure-Ref', - '0si9QYgAAAADXL9WjVzihS7S3WiGKgfDKV1NURURHRTA4MTAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', - 'Date', - 'Fri, 08 Apr 2022 12:50:58 GMT' -]); - -nock('https://endpoint', {"encodedQueryParams":false}) - .post('/sms', {"from":"+14255550123","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":false,"tag":"SMS_LIVE_TEST"}}) - .query(false) - .reply(202, {"value":[{"to":"+14255550123","messageId":"Outgoing_2022040812505903d967f0-8187-4ded-b0ba-ea1515838718_noam","httpStatusCode":202,"repeatabilityResult":"accepted","successful":false}]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'MS-CV', - 'mVSat6xJ1kOHNi8H9Ftgbg.0', - 'Strict-Transport-Security', - 'max-age=2592000', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '537ms', - 'X-Cache', - 'CONFIG_NOCACHE', - 'X-Azure-Ref', - '0si9QYgAAAABMImX6EinPQaJKKiiMlh6ZV1NURURHRTA4MTAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', - 'Date', - 'Fri, 08 Apr 2022 12:50:58 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..006a5c4633a0 --- /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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "b173a6b6-2d60-45ba-9d7b-a4851bfe1f76" + }, + "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": "Thu, 21 Apr 2022 14:59:02 GMT", + "MS-CV": "J4Ftp9wpxUCUvi3n/Df09g.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0NnFhYgAAAABjaloaz4h4SrL8jcrwxYCJUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "234ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_202204211459031decf6f5-73eb-4c3a-9aa0-21e52d80b5a5_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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "3eb1764f-b7aa-49f9-9f6c-215556c779d2" + }, + "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": "Thu, 21 Apr 2022 14:59:02 GMT", + "MS-CV": "R6qI/UTMBUeTLlCg2HwIqg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0N3FhYgAAAADj5D7a4hn0TLifea\u002B6166aUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "235ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220421145903033b14b9-e6b3-4fa5-9fde-e43872ff9796_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 de0449821360..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,139 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "fcd97290e112ccfacfa0fdb8ed965072"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":false}) - .get('/common/discovery/instance') - .query(false) - .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', - '5d245aeb-9f02-412a-af61-6256820e6401', - 'x-ms-ests-server', - '2.1.12570.16 - EUS ProdSlices', - 'Set-Cookie', - 'fpc=AuBa9t_9astNl3ukf82BunI; expires=Sun, 08-May-2022 12:51:00 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr43o-9kQeKjA-kNj2foDLmQm2sYomO_ktYG4qU_aQA2DOYGASGMJ2ItWyGKTnFJ3AuqoOuBDGmGL53Znc2TdoAjiTtuKYBZgzpR54MbHTHfY9i178cKzwUi5rAjZwN8vOrsu5R_mrl9hCASi-CN2b-E7mbkSQXNU5be0wHqOWyNMgAA; 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', - 'Fri, 08 Apr 2022 12:51:00 GMT', - 'Content-Length', - '980' -]); - -nock('https://endpoint', {"encodedQueryParams":false}) - .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":false,"frontchannel_logout_supported":false,"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"],"kerberos_endpoint":"https://login.microsoftonline.com/SomeTenantId/kerberos","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', - '39c1a46f-8755-4ce9-a899-a065bb1c4400', - 'x-ms-ests-server', - '2.1.12621.9 - SCUS ProdSlices', - 'X-XSS-Protection', - '0', - 'Set-Cookie', - 'fpc=Ap9srd5fT79AnuCKc4LgWXI; expires=Sun, 08-May-2022 12:51:00 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrboeXFyjkKuxOL4IsCO3RyO9-_xZGt4maDKqD-l4VyO2dvC7_4HlHcaBFENJocAX-7cjGjib01jGxvwzbHfyQ6JRFMtcpgntnKa6tbQ44QJWOqWBl9tJOn2Nie7L9kGD-fkDt6OLDrQPCSs-7dhNmRtQBKZ7ZiGuUh2Od3cHDKvkgAA; 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', - 'Fri, 08 Apr 2022 12:51:00 GMT', - 'Content-Length', - '1753' -]); - -nock('https://endpoint', {"encodedQueryParams":false}) - .post('/SomeTenantId/oauth2/v2.0/token', "client_id=SomeClientId&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.5.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=8d2f720e-d3cb-4fa2-8f28-1b2a3a05b7ed&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") - .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', - '4eef928d-8f5d-4a1b-b4f2-bf9bd8743900', - 'x-ms-ests-server', - '2.1.12621.9 - NCUS ProdSlices', - 'x-ms-clitelem', - '1,0,0,,', - 'X-XSS-Protection', - '0', - 'Set-Cookie', - 'fpc=AjE0LmwM251Nnr_bw5u6p9qVC-yCAQAAALQm4tkOAAAA; expires=Sun, 08-May-2022 12:51:00 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', - 'Fri, 08 Apr 2022 12:51:00 GMT', - 'Content-Length', - '1327' -]); - -nock('https://endpoint', {"encodedQueryParams":false}) - .post('/sms', {"from":"+14255550123","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":false,"tag":"SMS_LIVE_TEST"}}) - .query(false) - .reply(401, {"error":{"code":"Unauthorized","message":""}}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json', - 'MS-CV', - 'uPDGh8GPVEuI7BJ0hNtSkg.0', - 'Strict-Transport-Security', - 'max-age=2592000', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '634ms', - 'X-Cache', - 'CONFIG_NOCACHE', - 'X-Azure-Ref', - '0tC9QYgAAAAC4fe3N/2CSSLwik/1/12epV1NURURHRTA4MTAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', - 'Date', - 'Fri, 08 Apr 2022 12:51:00 GMT' -]); 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..d505f0738276 --- /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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "c137a16f-1937-49f0-a651-9bacc0906d0b" + }, + "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": "Thu, 21 Apr 2022 14:59:03 GMT", + "MS-CV": "QBADi4U5uU2jMjO2Vva1DQ.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0OHFhYgAAAABUaIJgMJgKRqNZ3zs/s3XIUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "188ms" + }, + "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 edc3248f34a6..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,137 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "025a6529e78fc34152b097fad8ae5137"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":false}) - .get('/common/discovery/instance') - .query(false) - .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', - '11c31ab4-ee11-4660-ae79-291c1d496401', - 'x-ms-ests-server', - '2.1.12570.16 - SCUS ProdSlices', - 'Set-Cookie', - 'fpc=Anslv3F6F09DgmvFodZSkO8; expires=Sun, 08-May-2022 12:51:01 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr_ekrBvG0SzpQcK3CA_CLLhR_iqj4ZQnRqvbVk3wgSTZvbIXtEiPwv2tD2yWwXIR5_lmQlxZWcZPoPSvsnUVzDgAvuYZhMGw4l8T8NK0pvcJPFoyRAV4cpw-590vpUfhfKeK35uGls5fBmRhX69Vfb54jsTWjLXYMAHCWmZjT5HYgAA; 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', - 'Fri, 08 Apr 2022 12:51:01 GMT', - 'Content-Length', - '980' -]); - -nock('https://endpoint', {"encodedQueryParams":false}) - .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":false,"frontchannel_logout_supported":false,"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"],"kerberos_endpoint":"https://login.microsoftonline.com/SomeTenantId/kerberos","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', - '29940708-53c5-46e0-830a-5f2392153d00', - 'x-ms-ests-server', - '2.1.12621.9 - WUS2 ProdSlices', - 'X-XSS-Protection', - '0', - 'Set-Cookie', - 'fpc=AgcstaUkgVxIibzagyE9DFo; expires=Sun, 08-May-2022 12:51:01 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrEpHUWsJeLmId78CGVhLO3EO0PhPQoXjKwHly0fHuDMZgUvhxTbL2k94tu8qn-AkccIloFAvIbqCCnjdjKSS_G5awGVSZY0sYEflQ756pyOpX-6tkEpy91wZL6k9eGkrwHYTEWFsiycHhc_xyko1Ik5xK2SmVnu2sUSLacHu_C3IgAA; 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', - 'Fri, 08 Apr 2022 12:51:01 GMT', - 'Content-Length', - '1753' -]); - -nock('https://endpoint', {"encodedQueryParams":false}) - .post('/SomeTenantId/oauth2/v2.0/token', "client_id=SomeClientId&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.5.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=b32c83cd-4626-49ec-bf26-c8ac72dd279c&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") - .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', - 'ad5d6047-6b35-4fb1-803a-803343391c00', - 'x-ms-ests-server', - '2.1.12621.9 - NCUS ProdSlices', - 'x-ms-clitelem', - '1,0,0,,', - 'X-XSS-Protection', - '0', - 'Set-Cookie', - 'fpc=AtX8-WQs-05LjYstdXVFb2eVC-yCAQAAALQm4tkOAAAA; expires=Sun, 08-May-2022 12:51:01 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', - 'Fri, 08 Apr 2022 12:51:01 GMT', - 'Content-Length', - '1327' -]); - -nock('https://endpoint', {"encodedQueryParams":false}) - .post('/sms', {"from":"+1425555012345","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":false,"tag":"SMS_LIVE_TEST"}}) - .query(false) - .reply(400, {"From":["Invalid from phone number format."]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'MS-CV', - 'kwDj3jEMS0aydDEhcNXu8g.0', - 'Strict-Transport-Security', - 'max-age=2592000', - 'X-Processing-Time', - '13ms', - 'X-Cache', - 'CONFIG_NOCACHE', - 'X-Azure-Ref', - '0ti9QYgAAAAA9F7XWKY64Sp5tni0jv3lOV1NURURHRTA4MTAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', - 'Date', - 'Fri, 08 Apr 2022 12:51:01 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..f970356bba0c --- /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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "6b7a8169-3ddb-492f-bc04-b0eab206281b" + }, + "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": "Thu, 21 Apr 2022 14:59:04 GMT", + "MS-CV": "RDVc1/Xd2U6lbD67ZgHzvA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0OHFhYgAAAADYl9gGZD/0SbxF7ZE1/Ew4UFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "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_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 91e7527068c8..000000000000 --- a/sdk/communication/communication-sms/recordings/node/smsclient_playbackrecord_when_sending_sms/recording_can_send_an_sms_message.js +++ /dev/null @@ -1,29 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "83d058dc072c9d4f54912651d15b4836"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":false}) - .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(false) - .reply(202, {"value":[{"to":"+14255550123","messageId":"Outgoing_20220408125102f1a233ab-ccc6-4dd9-9b45-c40699f77526_noam","httpStatusCode":202,"repeatabilityResult":"accepted","successful":false}]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'MS-CV', - 'UatUYe+iRE+mMA26nTtEAQ.0', - 'Strict-Transport-Security', - 'max-age=2592000', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '703ms', - 'X-Cache', - 'CONFIG_NOCACHE', - 'X-Azure-Ref', - '0ti9QYgAAAACEkyZs0E5hRoYslXqtv16EV1NURURHRTA4MTAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', - 'Date', - 'Fri, 08 Apr 2022 12:51:02 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..05cff5bcc947 --- /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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "2fe25533-2214-4eed-b997-845921792087", + "x-ms-content-sha256": "GHhQe77R3mEtxA\u002B8O858uUmr08eSsEI/Arg4Nki/BP8=", + "x-ms-date": "Thu, 21 Apr 2022 14:59:05 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": "Thu, 21 Apr 2022 14:59:04 GMT", + "MS-CV": "ocTlgZBTz0OgZUzlfruwCg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0OXFhYgAAAAAtuzNCLIbjTbs1QZZzHnivUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "233ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_2022042114590586f44e65-192b-41fd-952f-9013bde85136_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 69fabeddf06b..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,29 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "ddf1e270fd770f2610ccf69742b2c3d7"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":false}) - .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(false) - .reply(202, {"value":[{"to":"+14255550123","messageId":"Outgoing_20220408125105bd3371ca-ff15-4858-89ad-204b1d9f82f5_noam","httpStatusCode":202,"repeatabilityResult":"accepted","successful":false},{"to":"+1425555012345","httpStatusCode":400,"errorMessage":"Invalid To phone number format.","successful":false}]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'MS-CV', - '1pzm+9k42EqOgeDksoOQGg.0', - 'Strict-Transport-Security', - 'max-age=2592000', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '496ms', - 'X-Cache', - 'CONFIG_NOCACHE', - 'X-Azure-Ref', - '0uC9QYgAAAAAfGVsGj6Z6SpHMAAFUuxD1V1NURURHRTA4MTAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', - 'Date', - 'Fri, 08 Apr 2022 12:51:04 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..ea4e7f0cb351 --- /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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "8c3da7bc-d64d-40c1-90c3-ff26e2dbadb3", + "x-ms-content-sha256": "D/Oe\u002BYy6aTeRztYcOy9btluDxxtPiLyII4P1G361XrM=", + "x-ms-date": "Thu, 21 Apr 2022 14:59:06 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": "Thu, 21 Apr 2022 14:59:06 GMT", + "MS-CV": "pVMEEKWO0kmalW\u002BE87oAoQ.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0OnFhYgAAAACCAfzqRwiyT5Ak2e3Cz3K0UFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "230ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220421145906ee6ee364-75c7-44fe-a4e8-f2471f8e6b83_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 0563c40e8b3c..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,29 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "94a53f2b724b1d07990177d0612de57d"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":false}) - .post('/sms', {"from":"+14255550123","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":false,"tag":"SMS_LIVE_TEST"}}) - .query(false) - .reply(202, {"value":[{"to":"+14255550123","messageId":"Outgoing_20220408125103487140b9-7af5-4ad8-b3c4-1d0a8a01c829_noam","httpStatusCode":202,"repeatabilityResult":"accepted","successful":false}]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'MS-CV', - 'dNrjuXfCSEe9BlDX4plKYg.0', - 'Strict-Transport-Security', - 'max-age=2592000', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '511ms', - 'X-Cache', - 'CONFIG_NOCACHE', - 'X-Azure-Ref', - '0ti9QYgAAAACQRYgMWK9wQoo/bKPYolR/V1NURURHRTA4MTAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', - 'Date', - 'Fri, 08 Apr 2022 12:51:02 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..314e7aebfa28 --- /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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "2e1847f2-06ce-440d-951f-71f2900802c9", + "x-ms-content-sha256": "my/201h0\u002BSNpsn6eaBXGW0qBi1xEukZvHCBiJgOrBos=", + "x-ms-date": "Thu, 21 Apr 2022 14:59:05 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": "Thu, 21 Apr 2022 14:59:04 GMT", + "MS-CV": "Wv1z4/ssrkaisX/LoMM0Vg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0OXFhYgAAAAAP\u002BAKQ8XZzQqVgjXEfZP1pUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "228ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_20220421145905e326691a-c1f8-46ae-9e85-0109580d69e5_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 1d37cbd65c24..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,53 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "9a17617be8b47b129ee4b7eda55945c8"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":false}) - .post('/sms', {"from":"+14255550123","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":false,"tag":"SMS_LIVE_TEST"}}) - .query(false) - .reply(202, {"value":[{"to":"+14255550123","messageId":"Outgoing_20220408125103677036d2-c2c1-49e6-84e2-d701e17ffa64_noam","httpStatusCode":202,"repeatabilityResult":"accepted","successful":false}]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'MS-CV', - 'CqFLy9PB60uxYqcXOf0wgQ.0', - 'Strict-Transport-Security', - 'max-age=2592000', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '516ms', - 'X-Cache', - 'CONFIG_NOCACHE', - 'X-Azure-Ref', - '0ty9QYgAAAABrt1fqTozNSaWdlUbC6oWJV1NURURHRTA4MTAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', - 'Date', - 'Fri, 08 Apr 2022 12:51:03 GMT' -]); - -nock('https://endpoint', {"encodedQueryParams":false}) - .post('/sms', {"from":"+14255550123","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":false,"tag":"SMS_LIVE_TEST"}}) - .query(false) - .reply(202, {"value":[{"to":"+14255550123","messageId":"Outgoing_202204081251045a6dbc77-463c-4ab1-ba7a-6042562fcb3f_noam","httpStatusCode":202,"repeatabilityResult":"accepted","successful":false}]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'MS-CV', - 'l0h5QLBDx0+ulECfRMChFg.0', - 'Strict-Transport-Security', - 'max-age=2592000', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '540ms', - 'X-Cache', - 'CONFIG_NOCACHE', - 'X-Azure-Ref', - '0uC9QYgAAAADv8CjTw4qXQIqtP1VoVB9FV1NURURHRTA4MTAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', - 'Date', - 'Fri, 08 Apr 2022 12:51:03 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..5685affc6c17 --- /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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "044a42f0-ab5d-4f47-86ac-b8050823679d", + "x-ms-content-sha256": "xv8LWOJdvjgusb3utCar50YxQqhQnAWfae2S0o3uhCk=", + "x-ms-date": "Thu, 21 Apr 2022 14:59:05 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": "Thu, 21 Apr 2022 14:59:05 GMT", + "MS-CV": "VjOgRFZuLkaJ2jtLgeDtgQ.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0OXFhYgAAAADyz7iUIlBRRov0/Hl9b7eWUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "234ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_202204211459069972c907-044b-4d62-bd5f-b71d29206aac_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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "ba38e85a-8edf-4e75-93ee-d3dcb3e343e5", + "x-ms-content-sha256": "SPqpzpgq9aXRiDtBiAwZSYDysceP8HsM9JgMXL55r18=", + "x-ms-date": "Thu, 21 Apr 2022 14:59:06 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": "Thu, 21 Apr 2022 14:59:05 GMT", + "MS-CV": "TKB6fzbR0U\u002BzPfQUtyT5Zg.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0OnFhYgAAAACLMgYkMaDYTa2JYNnYjtQ0UFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "250ms" + }, + "ResponseBody": { + "value": [ + { + "to": "\u002B14255550123", + "messageId": "Outgoing_202204211459064c6e0277-24d2-4990-8a51-9c4ac327fb03_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 ec26c803ddd7..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,29 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "fcd97290e112ccfacfa0fdb8ed965072"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":false}) - .post('/sms', {"from":"+14255550123","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":false,"tag":"SMS_LIVE_TEST"}}) - .query(false) - .reply(401, {"error":{"code":"Unauthorized","message":""}}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json', - 'MS-CV', - 'r8czj9liUEyWjd52bOX3Jw.0', - 'Strict-Transport-Security', - 'max-age=2592000', - 'api-supported-versions', - '2020-07-20-preview1, 2020-08-20-preview, 2021-03-07', - 'X-Processing-Time', - '469ms', - 'X-Cache', - 'CONFIG_NOCACHE', - 'X-Azure-Ref', - '0uS9QYgAAAAD6iQn/IAPhTrJUbW5X0rGyV1NURURHRTA4MTAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', - 'Date', - 'Fri, 08 Apr 2022 12:51:04 GMT' -]); 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..f7b11688bc85 --- /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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "ae41837b-ff80-4970-834a-cc042d7f7b9a", + "x-ms-content-sha256": "WK2XoRzdvgDFygXQ0tHHi\u002BFeyWXpJnDVFWX5srpd4GQ=", + "x-ms-date": "Thu, 21 Apr 2022 14:59:06 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": "Thu, 21 Apr 2022 14:59:06 GMT", + "MS-CV": "QR1UY\u002BY7l0Co/MR3RaafhQ.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0OnFhYgAAAABW685n3QBdRqF4C\u002Bz4pIZlUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "220ms" + }, + "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 cc428523815e..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,27 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "025a6529e78fc34152b097fad8ae5137"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://endpoint', {"encodedQueryParams":false}) - .post('/sms', {"from":"+1425555012345","smsRecipients":[{"to":"+14255550123","repeatabilityRequestId":"sanitized","repeatabilityFirstSent":"Thu, 01 Jan 1970 00:00:00 GMT"}],"message":"test message","smsSendOptions":{"enableDeliveryReport":false,"tag":"SMS_LIVE_TEST"}}) - .query(false) - .reply(400, {"From":["Invalid from phone number format."]}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'MS-CV', - 'dd4B/XBNPU2mvdI9pyH8Ww.0', - 'Strict-Transport-Security', - 'max-age=2592000', - 'X-Processing-Time', - '16ms', - 'X-Cache', - 'CONFIG_NOCACHE', - 'X-Azure-Ref', - '0uS9QYgAAAADQf0KcXfq3To8tfZbQUxlnV1NURURHRTA4MTAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', - 'Date', - 'Fri, 08 Apr 2022 12:51:04 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..44bd80c930fd --- /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.19.0 OS/(x64-Windows_NT-10.0.22000)", + "x-ms-client-request-id": "9f5ab44f-2240-4ae4-b5b0-7876cd91f81c", + "x-ms-content-sha256": "YREpxF7gz7gST1khcAJqosynA/L1x889/vx5xr5Tc0g=", + "x-ms-date": "Thu, 21 Apr 2022 14:59:07 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": "Thu, 21 Apr 2022 14:59:06 GMT", + "MS-CV": "m1dGcObC9kSZ7l6ZUBRfnA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0O3FhYgAAAAD3yobdsI6QTZTvIG0mByBzUFJHMDFFREdFMDkxNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "89ms" + }, + "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/src/extractOperationOptions.ts b/sdk/communication/communication-sms/src/extractOperationOptions.ts index ca377c609676..38ec3c9e519c 100644 --- a/sdk/communication/communication-sms/src/extractOperationOptions.ts +++ b/sdk/communication/communication-sms/src/extractOperationOptions.ts @@ -9,7 +9,14 @@ export const extractOperationOptions = ( operationOptions: OperationOptions; restOptions: Pick>; } => { - const { abortSignal, onResponse, requestOptions, serializerOptions, tracingOptions, ...restOptions } = obj; + const { + abortSignal, + onResponse, + requestOptions, + serializerOptions, + tracingOptions, + ...restOptions + } = obj; return { operationOptions: { diff --git a/sdk/communication/communication-sms/src/smsClient.ts b/sdk/communication/communication-sms/src/smsClient.ts index 98748f80d520..f5396a821d36 100644 --- a/sdk/communication/communication-sms/src/smsClient.ts +++ b/sdk/communication/communication-sms/src/smsClient.ts @@ -7,11 +7,8 @@ import { isKeyCredential, createCommunicationAuthPolicy, } from "@azure/communication-common"; -import { KeyCredential, TokenCredential } from "@azure/core-auth"; -import { - CommonClientOptions, - OperationOptions -} from "@azure/core-client"; +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"; @@ -89,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 @@ -129,7 +126,7 @@ export class SmsClient { ) { const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions); const options = isSmsClientOptions(credentialOrOptions) ? credentialOrOptions : maybeOptions; - + const internalPipelineOptions: InternalPipelineOptions = { ...options, ...{ 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 dc47d8fea1f6..426826d15a53 100644 --- a/sdk/communication/communication-sms/test/internal/smsClient.internal.spec.ts +++ b/sdk/communication/communication-sms/test/internal/smsClient.internal.spec.ts @@ -26,7 +26,6 @@ matrix([[true, false]], async function (useAad: boolean) { let client: SmsClient; beforeEach(async function (this: Context) { - if (isLiveMode()) { this.skip(); } else if (isPlaybackMode()) { diff --git a/sdk/communication/communication-sms/test/public/smsClient.spec.ts b/sdk/communication/communication-sms/test/public/smsClient.spec.ts index cf58fe1e1b69..2aefd9d9aed9 100644 --- a/sdk/communication/communication-sms/test/public/smsClient.spec.ts +++ b/sdk/communication/communication-sms/test/public/smsClient.spec.ts @@ -7,14 +7,13 @@ */ import { matrix } from "@azure/test-utils"; -import { Recorder, env } from "@azure-tools/test-recorder"; -import { - createRecordedSmsClient, - createRecordedSmsClientWithToken, -} 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"; matrix([[true, false]], async function (useAad: boolean) { describe(`SmsClient [Live]${useAad ? " [AAD]" : ""}`, async () => { @@ -29,6 +28,10 @@ matrix([[true, false]], async function (useAad: boolean) { }); beforeEach(async function (this: Context) { + if (isPlaybackMode()) { + sinon.stub(Uuid, "generateUuid").returns("sanitized"); + sinon.stub(Date, "now").returns(0); + } if (useAad) { ({ client, recorder } = await createRecordedSmsClientWithToken(this)); } else { @@ -38,7 +41,12 @@ matrix([[true, false]], async function (useAad: boolean) { }); 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 abb1525b1fc5..89601a69042a 100644 --- a/sdk/communication/communication-sms/test/public/utils/mockHttpClient.ts +++ b/sdk/communication/communication-sms/test/public/utils/mockHttpClient.ts @@ -1,7 +1,12 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { createHttpHeaders, HttpClient, PipelineRequest, PipelineResponse } from "@azure/core-rest-pipeline"; +import { + createHttpHeaders, + HttpClient, + PipelineRequest, + PipelineResponse, +} from "@azure/core-rest-pipeline"; export class MockHttpClient implements HttpClient { constructor(private _phoneNumber: string) {} diff --git a/sdk/communication/communication-sms/test/public/utils/recordedClient.ts b/sdk/communication/communication-sms/test/public/utils/recordedClient.ts index 2abc4f07e926..92ac3f6f3c53 100644 --- a/sdk/communication/communication-sms/test/public/utils/recordedClient.ts +++ b/sdk/communication/communication-sms/test/public/utils/recordedClient.ts @@ -14,7 +14,6 @@ import { createTestCredential } from "@azure-tools/test-credential"; import { parseConnectionString } from "@azure/communication-common"; import { SmsClient } from "../../../src"; - export interface RecordedClient { client: T; recorder: Recorder; @@ -37,10 +36,17 @@ const sanitizerOptions: SanitizerOptions = { }, ], generalSanitizers: [ - { regex: true, target: "(https:\/\/)([^/',]*)", value: "$1endpoint" }, { 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"` }, + { + 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"`, + }, ], }; @@ -67,7 +73,7 @@ export async function createRecordedSmsClient( const recorder = await createRecorder(context.currentTest); const client = new SmsClient( - env.COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING ?? "", + env.COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING ?? "", recorder.configureClientOptions({}) ); return { @@ -82,7 +88,9 @@ export async function createRecordedSmsClientWithToken( const recorder = await createRecorder(context.currentTest); let credential: TokenCredential; - const endpoint = parseConnectionString(env.COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING ?? "").endpoint; + const endpoint = parseConnectionString( + env.COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING ?? "" + ).endpoint; if (isPlaybackMode()) { credential = { @@ -94,12 +102,7 @@ export async function createRecordedSmsClientWithToken( credential = createTestCredential(); } - const client = new SmsClient( - endpoint, - credential, - recorder.configureClientOptions({}) - ); + const client = new SmsClient(endpoint, credential, recorder.configureClientOptions({})); return { client, recorder }; } -