From afed7f86b7eca4a15e96058b4854e16b98f286e8 Mon Sep 17 00:00:00 2001 From: Dominik Messinger Date: Fri, 22 Jan 2021 15:01:31 -0800 Subject: [PATCH 1/6] [communication] Extract new communication-identity package --- rush.json | 5 + sdk/communication/ci.yml | 2 + .../communication-administration/README.md | 72 +- .../communication-administration/package.json | 3 +- ...sues_a_token_for_a_user_multiple_scopes.js | 86 -- ..._issues_a_token_for_a_user_single_scope.js | 86 -- .../recording_can_get_area_codes.js | 45 +- .../recording_can_get_location_options.js | 801 +++++++++++++++++- ...groupid_and_phoneplanid_for_other_tests.js | 126 ++- ...ding_successfully_gets_phoneplangroupid.js | 143 ++-- .../communication-administration.api.md | 40 - .../samples/javascript/README.md | 20 +- .../samples/typescript/README.md | 20 +- .../communication-administration/src/index.ts | 2 - .../test/utils/mockHttpClients.ts | 19 - .../test/utils/recordedClient.ts | 44 +- .../communication-identity/.gitignore | 2 + .../communication-identity/.nycrc | 10 + .../.vscode/launch.json | 42 + .../communication-identity/CHANGELOG.md | 57 ++ .../communication-identity/LICENSE | 21 + .../communication-identity/README.md | 136 +++ .../communication-identity/api-extractor.json | 35 + .../communication-identity/karma.conf.js | 152 ++++ .../communication-identity/package.json | 129 +++ ...recording_successfully_creates_a_user.json | 0 ...successfully_creates_a_user_and_token.json | 0 ...recording_successfully_deletes_a_user.json | 0 ...es_a_token_for_a_user_multiple_scopes.json | 0 ...ssues_a_token_for_a_user_single_scope.json | 0 ...ully_revokes_tokens_issued_for_a_user.json | 0 ...es_a_token_for_a_user_multiple_scopes.json | 0 ...ssues_a_token_for_a_user_single_scope.json | 0 .../recording_successfully_creates_a_user.js | 8 +- ...g_successfully_creates_a_user_and_token.js | 0 .../recording_successfully_deletes_a_user.js | 8 +- ...sues_a_token_for_a_user_multiple_scopes.js | 4 +- ..._issues_a_token_for_a_user_single_scope.js | 4 +- ...sfully_revokes_tokens_issued_for_a_user.js | 4 +- ...sues_a_token_for_a_user_multiple_scopes.js | 99 +++ ..._issues_a_token_for_a_user_single_scope.js | 99 +++ .../review/communication-identity.api.md | 64 ++ .../rollup.base.config.js | 131 +++ .../communication-identity/rollup.config.js | 13 + .../rollup.test.config.js | 3 + .../communication-identity/sample.env | 10 + .../communication-identity/samples/.gitignore | 1 + .../samples/javascript/README.md | 64 ++ .../samples/javascript/issueToken.js | 2 +- .../samples/javascript/package.json | 29 + .../samples/javascript/revokeTokens.js | 2 +- .../samples/javascript/sample.env | 3 + .../samples/tsconfig.json | 10 + .../samples/typescript/README.md | 70 ++ .../samples/typescript/package.json | 38 + .../samples/typescript/sample.env | 3 + .../samples/typescript/src/issueToken.ts | 2 +- .../samples/typescript/src/revokeTokens.ts | 0 .../samples/typescript/tsconfig.json | 13 + .../src/common/logger.ts | 9 + .../src/common/mappers.ts | 18 + .../src/common/models.ts | 15 + .../src/common/tracing.ts | 57 ++ .../src}/communicationIdentityClient.ts | 8 +- .../src}/constants.ts | 0 .../src}/generated/src/identityRestClient.ts | 0 .../src/identityRestClientContext.ts | 0 .../src}/generated/src/models/index.ts | 0 .../src}/generated/src/models/mappers.ts | 0 .../src}/generated/src/models/parameters.ts | 0 .../src/operations/communicationIdentity.ts | 0 .../src}/generated/src/operations/index.ts | 0 .../communication-identity/src/index.ts | 6 + .../src}/models.ts | 2 +- .../swagger/swagger.md} | 2 +- .../communication-identity/test/README.md | 19 + ...communicationIdentityClient.mocked.spec.ts | 0 .../test/communicationIdentityClient.spec.ts | 0 ...mmunicationIdentityClientWithToken.spec.ts | 0 .../test/utils/mockHttpClients.ts | 40 + .../test/utils/recordedClient.ts | 99 +++ .../utils/testCommunicationIdentityClient.ts | 0 .../communication-identity/tests.yml | 11 + .../communication-identity/tsconfig.json | 17 + 84 files changed, 2567 insertions(+), 518 deletions(-) delete mode 100644 sdk/communication/communication-administration/recordings/node/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.js delete mode 100644 sdk/communication/communication-administration/recordings/node/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.js create mode 100644 sdk/communication/communication-identity/.gitignore create mode 100644 sdk/communication/communication-identity/.nycrc create mode 100644 sdk/communication/communication-identity/.vscode/launch.json create mode 100644 sdk/communication/communication-identity/CHANGELOG.md create mode 100644 sdk/communication/communication-identity/LICENSE create mode 100644 sdk/communication/communication-identity/README.md create mode 100644 sdk/communication/communication-identity/api-extractor.json create mode 100644 sdk/communication/communication-identity/karma.conf.js create mode 100644 sdk/communication/communication-identity/package.json rename sdk/communication/{communication-administration => communication-identity}/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_creates_a_user.json (100%) rename sdk/communication/{communication-administration => communication-identity}/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_creates_a_user_and_token.json (100%) rename sdk/communication/{communication-administration => communication-identity}/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_deletes_a_user.json (100%) rename sdk/communication/{communication-administration => communication-identity}/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.json (100%) rename sdk/communication/{communication-administration => communication-identity}/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.json (100%) rename sdk/communication/{communication-administration => communication-identity}/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_revokes_tokens_issued_for_a_user.json (100%) rename sdk/communication/{communication-administration => communication-identity}/recordings/browsers/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.json (100%) rename sdk/communication/{communication-administration => communication-identity}/recordings/browsers/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.json (100%) rename sdk/communication/{communication-administration => communication-identity}/recordings/node/communicationidentityclient_playbacklive/recording_successfully_creates_a_user.js (79%) rename sdk/communication/{communication-administration => communication-identity}/recordings/node/communicationidentityclient_playbacklive/recording_successfully_creates_a_user_and_token.js (100%) rename sdk/communication/{communication-administration => communication-identity}/recordings/node/communicationidentityclient_playbacklive/recording_successfully_deletes_a_user.js (74%) rename sdk/communication/{communication-administration => communication-identity}/recordings/node/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.js (90%) rename sdk/communication/{communication-administration => communication-identity}/recordings/node/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.js (90%) rename sdk/communication/{communication-administration => communication-identity}/recordings/node/communicationidentityclient_playbacklive/recording_successfully_revokes_tokens_issued_for_a_user.js (87%) create mode 100644 sdk/communication/communication-identity/recordings/node/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.js create mode 100644 sdk/communication/communication-identity/recordings/node/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.js create mode 100644 sdk/communication/communication-identity/review/communication-identity.api.md create mode 100644 sdk/communication/communication-identity/rollup.base.config.js create mode 100644 sdk/communication/communication-identity/rollup.config.js create mode 100644 sdk/communication/communication-identity/rollup.test.config.js create mode 100644 sdk/communication/communication-identity/sample.env create mode 100644 sdk/communication/communication-identity/samples/.gitignore create mode 100644 sdk/communication/communication-identity/samples/javascript/README.md rename sdk/communication/{communication-administration => communication-identity}/samples/javascript/issueToken.js (98%) create mode 100644 sdk/communication/communication-identity/samples/javascript/package.json rename sdk/communication/{communication-administration => communication-identity}/samples/javascript/revokeTokens.js (98%) create mode 100644 sdk/communication/communication-identity/samples/javascript/sample.env create mode 100644 sdk/communication/communication-identity/samples/tsconfig.json create mode 100644 sdk/communication/communication-identity/samples/typescript/README.md create mode 100644 sdk/communication/communication-identity/samples/typescript/package.json create mode 100644 sdk/communication/communication-identity/samples/typescript/sample.env rename sdk/communication/{communication-administration => communication-identity}/samples/typescript/src/issueToken.ts (97%) rename sdk/communication/{communication-administration => communication-identity}/samples/typescript/src/revokeTokens.ts (100%) create mode 100644 sdk/communication/communication-identity/samples/typescript/tsconfig.json create mode 100644 sdk/communication/communication-identity/src/common/logger.ts create mode 100644 sdk/communication/communication-identity/src/common/mappers.ts create mode 100644 sdk/communication/communication-identity/src/common/models.ts create mode 100644 sdk/communication/communication-identity/src/common/tracing.ts rename sdk/communication/{communication-administration/src/communicationIdentity => communication-identity/src}/communicationIdentityClient.ts (97%) rename sdk/communication/{communication-administration/src/communicationIdentity => communication-identity/src}/constants.ts (100%) rename sdk/communication/{communication-administration/src/communicationIdentity => communication-identity/src}/generated/src/identityRestClient.ts (100%) rename sdk/communication/{communication-administration/src/communicationIdentity => communication-identity/src}/generated/src/identityRestClientContext.ts (100%) rename sdk/communication/{communication-administration/src/communicationIdentity => communication-identity/src}/generated/src/models/index.ts (100%) rename sdk/communication/{communication-administration/src/communicationIdentity => communication-identity/src}/generated/src/models/mappers.ts (100%) rename sdk/communication/{communication-administration/src/communicationIdentity => communication-identity/src}/generated/src/models/parameters.ts (100%) rename sdk/communication/{communication-administration/src/communicationIdentity => communication-identity/src}/generated/src/operations/communicationIdentity.ts (100%) rename sdk/communication/{communication-administration/src/communicationIdentity => communication-identity/src}/generated/src/operations/index.ts (100%) create mode 100644 sdk/communication/communication-identity/src/index.ts rename sdk/communication/{communication-administration/src/communicationIdentity => communication-identity/src}/models.ts (96%) rename sdk/communication/{communication-administration/swagger/CommunicationIdentity.md => communication-identity/swagger/swagger.md} (93%) create mode 100644 sdk/communication/communication-identity/test/README.md rename sdk/communication/{communication-administration => communication-identity}/test/communicationIdentityClient.mocked.spec.ts (100%) rename sdk/communication/{communication-administration => communication-identity}/test/communicationIdentityClient.spec.ts (100%) rename sdk/communication/{communication-administration => communication-identity}/test/communicationIdentityClientWithToken.spec.ts (100%) create mode 100644 sdk/communication/communication-identity/test/utils/mockHttpClients.ts create mode 100644 sdk/communication/communication-identity/test/utils/recordedClient.ts rename sdk/communication/{communication-administration => communication-identity}/test/utils/testCommunicationIdentityClient.ts (100%) create mode 100644 sdk/communication/communication-identity/tests.yml create mode 100644 sdk/communication/communication-identity/tsconfig.json diff --git a/rush.json b/rush.json index ce3974754dd1..e2cab55fccc7 100644 --- a/rush.json +++ b/rush.json @@ -377,6 +377,11 @@ "projectFolder": "sdk/communication/communication-common", "versionPolicyName": "client" }, + { + "packageName": "@azure/communication-identity", + "projectFolder": "sdk/communication/communication-identity", + "versionPolicyName": "client" + }, { "packageName": "@azure/communication-sms", "projectFolder": "sdk/communication/communication-sms", diff --git a/sdk/communication/ci.yml b/sdk/communication/ci.yml index 07fa45913f7a..f0262a524782 100644 --- a/sdk/communication/ci.yml +++ b/sdk/communication/ci.yml @@ -34,3 +34,5 @@ extends: safeName: azurecommunicationsms - name: azure-communication-chat safeName: azurecommunicationchat + - name: azure-communication-identity + safeName: azurecommunicationidentity diff --git a/sdk/communication/communication-administration/README.md b/sdk/communication/communication-administration/README.md index 3e73ee9bd18f..9f87eb674213 100644 --- a/sdk/communication/communication-administration/README.md +++ b/sdk/communication/communication-administration/README.md @@ -1,6 +1,6 @@ # Azure Communication Administration client library for JavaScript -The administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration. +The administration library provides capabilities for phone number administration. Acquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL. @@ -21,7 +21,7 @@ npm install @azure/communication-administration ### Clients -The administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers. +The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers. ### Phone plans overview @@ -41,95 +41,41 @@ Phone numbers can be assigned to a callback URL via the configure number API. As ## Authentication -You can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods: +You can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods: ### Create `KeyCredential` with `AzureKeyCredential` before initializing the client ```typescript import { AzureKeyCredential } from "@azure/core-auth"; -import { CommunicationIdentityClient } from "@azure/communication-administration"; +import { PhoneNumberAdministrationClient } from "@azure/communication-administration"; const credential = new AzureKeyCredential(KEY); -const client = new CommunicationIdentityClient(HOST, credential); +const client = new PhoneNumberAdministrationClient(HOST, credential); ``` ### Using a connection string ```typescript -import { CommunicationIdentityClient } from "@azure/communication-administration"; +import { PhoneNumberAdministrationClient } from "@azure/communication-administration"; const connectionString = `endpoint=HOST;accessKey=KEY`; -const client = new CommunicationIdentityClient(connectionString); +const client = new PhoneNumberAdministrationClient(connectionString); ``` ### Using Azure Active Directory Authentication ```typescript -import { CommunicationIdentityClient } from "@azure/communication-administration"; +import { PhoneNumberAdministrationClient } from "@azure/communication-administration"; import { DefaultAzureCredential } from "@azure/identity"; const credential = new DefaultAzureCredential(); -const client = new CommunicationIdentityClient(HOST, credential); +const client = new PhoneNumberAdministrationClient(HOST, credential); ``` If you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal]. ## Usage -### CommunicationIdentityClient - -### Creating an instance of CommunicationIdentityClient - -```typescript -import { CommunicationIdentityClient } from "@azure/communication-administration"; - -const client = new CommunicationIdentityClient(CONNECTION_STRING); -``` - -#### Creating a new user - -Use the `createUser` method to create a new user. - -```typescript -const user = await client.createUser(); -``` - -#### Creating and refreshing a user token - -Use the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include: - -- `chat` (Chat) -- `pstn` (Public switched telephone network) -- `voip` (Voice over IP) - -```typescript -let { token } = await client.issueToken(user, ["chat"]); -``` - -To refresh the user token, issue another token with the same user. - -```typescript -{ token } = await client.issueToken(user, ["chat"]); -``` - -#### Revoking tokens for a user - -Use the `revokeTokens` method to revoke all the issued tokens of a user. - -```typescript -await client.revokeTokens(user); -``` - -`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked. - -#### Deleting a user - -Use the `deleteUser` method to delete a user. - -```typescript -await client.deleteUser(user); -``` - ### PhoneNumberAdministrationClient #### Creating an instance of PhoneNumberAdministrationClient diff --git a/sdk/communication/communication-administration/package.json b/sdk/communication/communication-administration/package.json index e59d689a5086..d75615f6c1b5 100644 --- a/sdk/communication/communication-administration/package.json +++ b/sdk/communication/communication-administration/package.json @@ -9,8 +9,7 @@ "scripts": { "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", "build": "tsc -p . && rollup -c 2>&1 && api-extractor run --local", - "build:autorest": "npm run build:autorest-identity && npm run build:autorest-phone", - "build:autorest-identity": "autorest --typescript --version=3.0.6267 --v3 ./swagger/CommunicationIdentity.md && rushx format", + "build:autorest": "npm run build:autorest-phone", "build:autorest-phone": "autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format", "build:clean": "rush update --recheck && rush rebuild && npm run build", "build:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1", diff --git a/sdk/communication/communication-administration/recordings/node/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.js b/sdk/communication/communication-administration/recordings/node/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.js deleted file mode 100644 index 5b7e35b4c760..000000000000 --- a/sdk/communication/communication-administration/recordings/node/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.js +++ /dev/null @@ -1,86 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "95d4fe335e315e75dac78e9070647d6a"; - -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=SomeClientSecret&scope=https%3A%2F%2Fcommunication.azure.com%2F%2F.default") - .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyIsImtpZCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyJ9.eyJhdWQiOiJodHRwczovL2NvbW11bmljYXRpb24uYXp1cmUuY29tLyIsImlzcyI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0LzcyZjk4OGJmLTg2ZjEtNDFhZi05MWFiLTJkN2NkMDExZGI0Ny8iLCJpYXQiOjE2MTEyNjIzNjUsIm5iZiI6MTYxMTI2MjM2NSwiZXhwIjoxNjExMzQ5MDY1LCJhaW8iOiJFMkpnWUZpNmFPN2Z3ek1jYTM2dHVDUEJYVkVpRFFBPSIsImFwcGlkIjoiNmM4MTgxYzctOTFhNi00ZTJlLTg0ODAtZDU0MDIxYWM0YzRiIiwiYXBwaWRhY3IiOiIxIiwiaWRwIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvNzJmOTg4YmYtODZmMS00MWFmLTkxYWItMmQ3Y2QwMTFkYjQ3LyIsIm9pZCI6IjNlMGM3MTRmLTk3YWMtNGQ2My1hZWFmLTE0YmFhNWUwNjRjYiIsInJoIjoiMC5BUm9BdjRqNWN2R0dyMEdScXkxODBCSGJSOGVCZ1d5bWtTNU9oSURWUUNHc1RFc2FBQUEuIiwic3ViIjoiM2UwYzcxNGYtOTdhYy00ZDYzLWFlYWYtMTRiYWE1ZTA2NGNiIiwidGlkIjoiNzJmOTg4YmYtODZmMS00MWFmLTkxYWItMmQ3Y2QwMTFkYjQ3IiwidXRpIjoiRFVLSWpaQjl5RWV4d1hkTTNZaDVBQSIsInZlciI6IjEuMCJ9.JFGFdPsTMELbqaBARXr3rjOTRbLxZYqNBp2wsp4mBPXFf8O5ufzrsyVpeWEiHH0iJovO9WmzTw7sRPpi13pDdwNKmhzvBP6E8xj97xqP1qZomCkrkcA2AtaljTrQNAFHlmBMVKO1M991dIgohzj2q1P3hq7rMdrEzyliSGisEOS_ZwfsjsdM4H1dOj0SKpparzYjlxGGJmQXq2x7iaWtR8QjWALw89vLLFRcclU_g7GKyjaX4dKglw5ZrAXI0sL11h7p0mD7g8jrROVBHMNvcwTDKGhiLd_JE4x3lUZbTK28lY-iMy3WEAl8zit7LI-LgANxlsoUlJBBgtzhW9ZZ_g"}, [ - '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', - 'sanitized', - 'x-ms-ests-server', - '2.1.11419.13 - WUS2 ProdSlices', - 'Set-Cookie', - 'fpc=Als6EcbA-MhChtTVqw6cUoRWyo4SAgAAAMjhm9cOAAAA; expires=Sat, 20-Feb-2021 20:57:45 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Thu, 21 Jan 2021 20:57:44 GMT', - 'Content-Length', - '1327' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/identities') - .query(true) - .reply(201, {"identity":{"id":"sanitized"}}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'MS-CV', - 'V4TLz8KrFEeylfMNcYQ+VA.0', - 'Strict-Transport-Security', - 'max-age=2592000', - 'x-ms-client-request-id', - 'sanitized', - 'api-supported-versions', - '2020-07-20-preview2, 2021-03-07', - 'X-Processing-Time', - '168ms', - 'X-Azure-Ref', - '0yeoJYAAAAACzSdMcCjsUSq72sh5fe2s2V1NURURHRTA4MjEAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', - 'Date', - 'Thu, 21 Jan 2021 20:57:45 GMT' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/identities/sanitized/:issueAccessToken', {"scopes":["chat","voip"]}) - .query(true) - .reply(200, {"token":"sanitized","expiresOn":"2021-01-22T20:57:44.6176611+00:00"}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'MS-CV', - 'gpfTcujLuUKCwZjdhAkYeQ.0', - 'Strict-Transport-Security', - 'max-age=2592000', - 'x-ms-client-request-id', - 'sanitized', - 'api-supported-versions', - '2020-07-20-preview2, 2021-03-07', - 'X-Processing-Time', - '27ms', - 'X-Azure-Ref', - '0yeoJYAAAAAABE3T5bcgNTKrj+ZEgsWi3V1NURURHRTA4MjEAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', - 'Date', - 'Thu, 21 Jan 2021 20:57:45 GMT' -]); diff --git a/sdk/communication/communication-administration/recordings/node/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.js b/sdk/communication/communication-administration/recordings/node/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.js deleted file mode 100644 index 4c462ac4eef7..000000000000 --- a/sdk/communication/communication-administration/recordings/node/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.js +++ /dev/null @@ -1,86 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "aedb306f8b207ace647b71fce293ba76"; - -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=SomeClientSecret&scope=https%3A%2F%2Fcommunication.azure.com%2F%2F.default") - .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyIsImtpZCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyJ9.eyJhdWQiOiJodHRwczovL2NvbW11bmljYXRpb24uYXp1cmUuY29tLyIsImlzcyI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0LzcyZjk4OGJmLTg2ZjEtNDFhZi05MWFiLTJkN2NkMDExZGI0Ny8iLCJpYXQiOjE2MTEyNjIzNjQsIm5iZiI6MTYxMTI2MjM2NCwiZXhwIjoxNjExMzQ5MDY0LCJhaW8iOiJFMkpnWURnUWt1cG91TWorOHlXbjEwZFhSUDFZQ2dBPSIsImFwcGlkIjoiNmM4MTgxYzctOTFhNi00ZTJlLTg0ODAtZDU0MDIxYWM0YzRiIiwiYXBwaWRhY3IiOiIxIiwiaWRwIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvNzJmOTg4YmYtODZmMS00MWFmLTkxYWItMmQ3Y2QwMTFkYjQ3LyIsIm9pZCI6IjNlMGM3MTRmLTk3YWMtNGQ2My1hZWFmLTE0YmFhNWUwNjRjYiIsInJoIjoiMC5BUm9BdjRqNWN2R0dyMEdScXkxODBCSGJSOGVCZ1d5bWtTNU9oSURWUUNHc1RFc2FBQUEuIiwic3ViIjoiM2UwYzcxNGYtOTdhYy00ZDYzLWFlYWYtMTRiYWE1ZTA2NGNiIiwidGlkIjoiNzJmOTg4YmYtODZmMS00MWFmLTkxYWItMmQ3Y2QwMTFkYjQ3IiwidXRpIjoiTjBKZ1dWclpWa1diTnRVbHlHeEhBQSIsInZlciI6IjEuMCJ9.dhiqSaZCTqiMKehO-QcGLg0sx7KTI4U6fPvUsNT_z5T7L3dLyxbHkI4pAZDSX8iJ7jSdiR_400D0vaoGIqGiWl_quQRwv3hsrpu3aCmyjPgu_c6Nr5BZbmAAj7pGBUi20nkJOEFROBmWtfNja20SbvDs4-8psy6TiMYwDmTaEnCljACIN2zp88uH6JZ1atXLOVCGWBdWcouqmGFWfy5bQKqG9K77Ff5MTj-NYU4dCM0mr2Shb34eOla0f_6FoxLGvJHCja1ZgYJYOvcjX0CSxnwBjh4PWe5wAqhDCfvruSu28WEycMsGyobvllxpBaNhSpKFCGWUCHBIKMQI5KHxVg"}, [ - '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', - 'sanitized', - 'x-ms-ests-server', - '2.1.11419.13 - SCUS ProdSlices', - 'Set-Cookie', - 'fpc=Als6EcbA-MhChtTVqw6cUoRWyo4SAQAAAMjhm9cOAAAA; expires=Sat, 20-Feb-2021 20:57:44 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Thu, 21 Jan 2021 20:57:44 GMT', - 'Content-Length', - '1327' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/identities') - .query(true) - .reply(201, {"identity":{"id":"sanitized"}}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'MS-CV', - '0es/Sq8wF0iEnxKIRQkv6w.0', - 'Strict-Transport-Security', - 'max-age=2592000', - 'x-ms-client-request-id', - 'sanitized', - 'api-supported-versions', - '2020-07-20-preview2, 2021-03-07', - 'X-Processing-Time', - '213ms', - 'X-Azure-Ref', - '0yOoJYAAAAAATCHaXNXC4RJncsdzEr3NhV1NURURHRTA4MjEAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', - 'Date', - 'Thu, 21 Jan 2021 20:57:44 GMT' -]); - -nock('https://endpoint', {"encodedQueryParams":true}) - .post('/identities/sanitized/:issueAccessToken', {"scopes":["chat"]}) - .query(true) - .reply(200, {"token":"sanitized","expiresOn":"2021-01-22T20:57:44.1854858+00:00"}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'MS-CV', - 'Q7lsVPlt20OUgp5kYqRlyQ.0', - 'Strict-Transport-Security', - 'max-age=2592000', - 'x-ms-client-request-id', - 'sanitized', - 'api-supported-versions', - '2020-07-20-preview2, 2021-03-07', - 'X-Processing-Time', - '279ms', - 'X-Azure-Ref', - '0yOoJYAAAAABZA22O5iLWR52OkBmGLsOqV1NURURHRTA4MjEAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', - 'Date', - 'Thu, 21 Jan 2021 20:57:44 GMT' -]); diff --git a/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclient_playbacklive/recording_can_get_area_codes.js b/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclient_playbacklive/recording_can_get_area_codes.js index 702bd53ae5d6..5c6f409491e0 100644 --- a/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclient_playbacklive/recording_can_get_area_codes.js +++ b/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclient_playbacklive/recording_can_get_area_codes.js @@ -1,25 +1,30 @@ -let nock = require('nock'); +let nock = require("nock"); module.exports.hash = "928546984836e09bc337975d29dfcdda"; -module.exports.testInfo = {"uniqueName":{},"newDate":{}} +module.exports.testInfo = { uniqueName: {}, newDate: {} }; -nock('https://endpoint', {"encodedQueryParams":false}) - .post('/administration/phonenumbers/countries/US/areacodes', {"locationOptions":[{"labelId":"state","optionsValue":"CA"},{"labelId":"city","optionsValue":"NOAM-US-CA-LA"}]}) +nock("https://endpoint", { encodedQueryParams: false }) + .post("/administration/phonenumbers/countries/US/areacodes", { + locationOptions: [ + { labelId: "state", optionsValue: "CA" }, + { labelId: "city", optionsValue: "NOAM-US-CA-LA" } + ] + }) .query(true) - .reply(200, {"primaryAreaCodes":["213","818"],"secondaryAreaCodes":[],"nextLink":null}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Request-Context', - 'appId=', - 'MS-CV', - 'X3/1RBP6FU6xbMoggoWeBg.0', - 'X-Processing-Time', - '367ms', - 'X-Azure-Ref', - '0hOUFYAAAAACiEOFcrM6zQKCC1Jokqtl9RVdSMzBFREdFMDYxMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', - 'Date', - 'Mon, 18 Jan 2021 19:46:12 GMT' -]); + .reply(200, { primaryAreaCodes: ["213", "818"], secondaryAreaCodes: [], nextLink: null }, [ + "Transfer-Encoding", + "chunked", + "Content-Type", + "application/json; charset=utf-8", + "Request-Context", + "appId=", + "MS-CV", + "X3/1RBP6FU6xbMoggoWeBg.0", + "X-Processing-Time", + "367ms", + "X-Azure-Ref", + "0hOUFYAAAAACiEOFcrM6zQKCC1Jokqtl9RVdSMzBFREdFMDYxMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Date", + "Mon, 18 Jan 2021 19:46:12 GMT" + ]); diff --git a/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclient_playbacklive/recording_can_get_location_options.js b/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclient_playbacklive/recording_can_get_location_options.js index b78033d3236d..5686aa6ce582 100644 --- a/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclient_playbacklive/recording_can_get_location_options.js +++ b/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclient_playbacklive/recording_can_get_location_options.js @@ -1,25 +1,786 @@ -let nock = require('nock'); +let nock = require("nock"); module.exports.hash = "f43c4bb7c05826fd644a4f3f038c8768"; -module.exports.testInfo = {"uniqueName":{},"newDate":{}} +module.exports.testInfo = { uniqueName: {}, newDate: {} }; -nock('https://endpoint', {"encodedQueryParams":false}) - .get('/administration/phonenumbers/countries/US/phoneplangroups/sanitized/phoneplans/sanitized/locationoptions') +nock("https://endpoint", { encodedQueryParams: false }) + .get( + "/administration/phonenumbers/countries/US/phoneplangroups/sanitized/phoneplans/sanitized/locationoptions" + ) .query(true) - .reply(200, {"locationOptions":{"labelId":"state","labelName":"State","options":[{"name":"AL","value":"AL","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Birmingham","value":"NOAM-US-AL-BI","locationOptions":[]},{"name":"Huntsville","value":"NOAM-US-AL-HN","locationOptions":[]},{"name":"Mobile","value":"NOAM-US-AL-MO","locationOptions":[]},{"name":"Montgomery","value":"NOAM-US-AL-MN","locationOptions":[]}]}]},{"name":"AR","value":"AR","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Fort Smith","value":"NOAM-US-AR-FS","locationOptions":[]},{"name":"Jonesboro","value":"NOAM-US-AR-JO","locationOptions":[]},{"name":"Little Rock","value":"NOAM-US-AR-LR","locationOptions":[]}]}]},{"name":"AZ","value":"AZ","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Phoenix","value":"NOAM-US-AZ-PH","locationOptions":[]}]}]},{"name":"CA","value":"CA","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Anaheim","value":"NOAM-US-CA-AN","locationOptions":[]},{"name":"Burbank","value":"NOAM-US-CA-BU","locationOptions":[]},{"name":"Concord","value":"NOAM-US-CA-CO","locationOptions":[]},{"name":"Fresno","value":"NOAM-US-CA-FR","locationOptions":[]},{"name":"Irvine","value":"NOAM-US-CA-IR","locationOptions":[]},{"name":"Los Angeles","value":"NOAM-US-CA-LA","locationOptions":[]},{"name":"Riverside","value":"NOAM-US-CA-RI","locationOptions":[]},{"name":"Sacramento","value":"NOAM-US-CA-SA","locationOptions":[]},{"name":"Salinas","value":"NOAM-US-CA-SL","locationOptions":[]},{"name":"San Diego","value":"NOAM-US-CA-SD","locationOptions":[]},{"name":"San Francisco","value":"NOAM-US-CA-SF","locationOptions":[]},{"name":"San Jose","value":"NOAM-US-CA-SJ","locationOptions":[]},{"name":"Santa Barbara","value":"NOAM-US-CA-SB","locationOptions":[]},{"name":"Santa Clarita","value":"NOAM-US-CA-SC","locationOptions":[]},{"name":"Santa Rosa","value":"NOAM-US-CA-SR","locationOptions":[]},{"name":"Stockton","value":"NOAM-US-CA-ST","locationOptions":[]},{"name":"Truckee","value":"NOAM-US-CA-TR","locationOptions":[]}]}]},{"name":"CL","value":"CL","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Washington DC","value":"NOAM-US-CL-DC","locationOptions":[]}]}]},{"name":"CO","value":"CO","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Denver","value":"NOAM-US-CO-DE","locationOptions":[]},{"name":"Pueblo","value":"NOAM-US-CO-PU","locationOptions":[]}]}]},{"name":"CT","value":"CT","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Bridgeport","value":"NOAM-US-CT-BR","locationOptions":[]},{"name":"Hartford","value":"NOAM-US-CT-HA","locationOptions":[]}]}]},{"name":"DE","value":"DE","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Wilmington","value":"NOAM-US-DE-WI","locationOptions":[]}]}]},{"name":"FL","value":"FL","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Cape Coral","value":"NOAM-US-FL-CC","locationOptions":[]},{"name":"Daytona Beach","value":"NOAM-US-FL-DB","locationOptions":[]},{"name":"Fort Lauderdale","value":"NOAM-US-FL-FL","locationOptions":[]},{"name":"Gainesville","value":"NOAM-US-FL-GA","locationOptions":[]},{"name":"Jacksonville","value":"NOAM-US-FL-JA","locationOptions":[]},{"name":"Lakeland","value":"NOAM-US-FL-LA","locationOptions":[]},{"name":"Miami","value":"NOAM-US-FL-MI","locationOptions":[]},{"name":"Orlando","value":"NOAM-US-FL-OR","locationOptions":[]},{"name":"Port St Lucie","value":"NOAM-US-FL-PS","locationOptions":[]},{"name":"Sarasota","value":"NOAM-US-FL-SA","locationOptions":[]},{"name":"St. Petersburg","value":"NOAM-US-FL-SP","locationOptions":[]},{"name":"Tallahassee","value":"NOAM-US-FL-TA","locationOptions":[]},{"name":"West Palm Beach","value":"NOAM-US-FL-WP","locationOptions":[]}]}]},{"name":"GA","value":"GA","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Albany","value":"NOAM-US-GA-AL","locationOptions":[]},{"name":"Atlanta","value":"NOAM-US-GA-AT","locationOptions":[]},{"name":"Augusta","value":"NOAM-US-GA-AU","locationOptions":[]},{"name":"Macon","value":"NOAM-US-GA-MA","locationOptions":[]},{"name":"Savannah","value":"NOAM-US-GA-SA","locationOptions":[]}]}]},{"name":"HI","value":"HI","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Honolulu","value":"NOAM-US-HI-HO","locationOptions":[]}]}]},{"name":"IA","value":"IA","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Cedar Rapids","value":"NOAM-US-IA-CR","locationOptions":[]},{"name":"Davenport","value":"NOAM-US-IA-DA","locationOptions":[]},{"name":"Mason City","value":"NOAM-US-IA-MC","locationOptions":[]},{"name":"Sioux City","value":"NOAM-US-IA-SC","locationOptions":[]}]}]},{"name":"ID","value":"ID","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Boise","value":"NOAM-US-ID-BO","locationOptions":[]}]}]},{"name":"IL","value":"IL","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Aurora","value":"NOAM-US-IL-AU","locationOptions":[]},{"name":"Champaign","value":"NOAM-US-IL-CA","locationOptions":[]},{"name":"Chicago","value":"NOAM-US-IL-CH","locationOptions":[]},{"name":"Cicero","value":"NOAM-US-IL-CI","locationOptions":[]},{"name":"Rock Island","value":"NOAM-US-IL-RI","locationOptions":[]},{"name":"Rockford","value":"NOAM-US-IL-RO","locationOptions":[]}]}]},{"name":"IN","value":"IN","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Evansville","value":"NOAM-US-IN-EV","locationOptions":[]},{"name":"Fort Wayne","value":"NOAM-US-IN-FW","locationOptions":[]},{"name":"Gary","value":"NOAM-US-IN-GA","locationOptions":[]},{"name":"Indianapolis","value":"NOAM-US-IN-IN","locationOptions":[]},{"name":"South Bend","value":"NOAM-US-IN-SB","locationOptions":[]}]}]},{"name":"KS","value":"KS","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Dodge City","value":"NOAM-US-KS-DC","locationOptions":[]},{"name":"Kansas City","value":"NOAM-US-KS-KS","locationOptions":[]},{"name":"Topeka","value":"NOAM-US-KS-TO","locationOptions":[]},{"name":"Wichita","value":"NOAM-US-KS-WI","locationOptions":[]}]}]},{"name":"KY","value":"KY","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Ashland","value":"NOAM-US-KY-AS","locationOptions":[]},{"name":"Lexington","value":"NOAM-US-KY-LE","locationOptions":[]},{"name":"Louisville","value":"NOAM-US-KY-LO","locationOptions":[]},{"name":"Owensboro","value":"NOAM-US-KY-OW","locationOptions":[]}]}]},{"name":"LA","value":"LA","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Baton Rouge","value":"NOAM-US-LA-BR","locationOptions":[]},{"name":"Lafayette","value":"NOAM-US-LA-LA","locationOptions":[]},{"name":"New Orleans","value":"NOAM-US-LA-NO","locationOptions":[]},{"name":"Shreveport","value":"NOAM-US-LA-SH","locationOptions":[]}]}]},{"name":"MA","value":"MA","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Lowell","value":"NOAM-US-MA-LO","locationOptions":[]}]}]},{"name":"MD","value":"MD","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Baltimore","value":"NOAM-US-MD-BA","locationOptions":[]}]}]},{"name":"ME","value":"ME","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Portland","value":"NOAM-US-ME-PO","locationOptions":[]}]}]},{"name":"MI","value":"MI","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Ann Arbor","value":"NOAM-US-MI-AA","locationOptions":[]},{"name":"Detroit","value":"NOAM-US-MI-DE","locationOptions":[]},{"name":"Flint","value":"NOAM-US-MI-FL","locationOptions":[]},{"name":"Grand Rapids","value":"NOAM-US-MI-GP","locationOptions":[]},{"name":"Grant","value":"NOAM-US-MI-GR","locationOptions":[]},{"name":"Lansing","value":"NOAM-US-MI-LA","locationOptions":[]},{"name":"Otsego","value":"NOAM-US-MI-OT","locationOptions":[]},{"name":"Saginaw","value":"NOAM-US-MI-SA","locationOptions":[]},{"name":"Sault Ste Marie","value":"NOAM-US-MI-SS","locationOptions":[]}]}]},{"name":"MN","value":"MN","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Alexandria","value":"NOAM-US-MN-AL","locationOptions":[]},{"name":"Bloomington","value":"NOAM-US-MN-BL","locationOptions":[]},{"name":"Duluth","value":"NOAM-US-MN-DU","locationOptions":[]},{"name":"Minneapolis","value":"NOAM-US-MN-MI","locationOptions":[]},{"name":"Plymouth","value":"NOAM-US-MN-PL","locationOptions":[]}]}]},{"name":"MO","value":"MO","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Columbia","value":"NOAM-US-MO-CO","locationOptions":[]},{"name":"Kansas City","value":"NOAM-US-MO-KS","locationOptions":[]},{"name":"Marshall","value":"NOAM-US-MO-MA","locationOptions":[]},{"name":"Springfield","value":"NOAM-US-MO-SP","locationOptions":[]},{"name":"St. Charles","value":"NOAM-US-MO-SC","locationOptions":[]},{"name":"St. Louis","value":"NOAM-US-MO-SL","locationOptions":[]}]}]},{"name":"MS","value":"MS","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Biloxi","value":"NOAM-US-MS-BI","locationOptions":[]},{"name":"Jackson","value":"NOAM-US-MS-JA","locationOptions":[]},{"name":"Starkville","value":"NOAM-US-MS-ST","locationOptions":[]}]}]},{"name":"MT","value":"MT","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Billings","value":"NOAM-US-MT-BI","locationOptions":[]}]}]},{"name":"NC","value":"NC","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Asheville","value":"NOAM-US-NC-AS","locationOptions":[]},{"name":"Charlotte","value":"NOAM-US-NC-CH","locationOptions":[]},{"name":"Fayetteville","value":"NOAM-US-NC-FA","locationOptions":[]},{"name":"Greensboro","value":"NOAM-US-NC-GR","locationOptions":[]},{"name":"Raleigh","value":"NOAM-US-NC-RA","locationOptions":[]},{"name":"Rocky Mount","value":"NOAM-US-NC-RM","locationOptions":[]}]}]},{"name":"ND","value":"ND","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Fargo","value":"NOAM-US-ND-FA","locationOptions":[]}]}]},{"name":"NE","value":"NE","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Kearney","value":"NOAM-US-NE-KE","locationOptions":[]},{"name":"Omaha","value":"NOAM-US-NE-OM","locationOptions":[]}]}]},{"name":"NH","value":"NH","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Concord","value":"NOAM-US-NH-CO","locationOptions":[]}]}]},{"name":"NJ","value":"NJ","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Atlantic City","value":"NOAM-US-NJ-AC","locationOptions":[]},{"name":"Camden","value":"NOAM-US-NJ-CA","locationOptions":[]},{"name":"Edison","value":"NOAM-US-NJ-ED","locationOptions":[]},{"name":"Elizabeth","value":"NOAM-US-NJ-EL","locationOptions":[]},{"name":"Jersey City","value":"NOAM-US-NJ-JC","locationOptions":[]},{"name":"Newark","value":"NOAM-US-NJ-NE","locationOptions":[]}]}]},{"name":"NM","value":"NM","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Albuquerque","value":"NOAM-US-NM-AL","locationOptions":[]},{"name":"Las Cruces","value":"NOAM-US-NM-LC","locationOptions":[]}]}]},{"name":"NV","value":"NV","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Las Vegas","value":"NOAM-US-NV-LV","locationOptions":[]},{"name":"Reno","value":"NOAM-US-NV-RE","locationOptions":[]}]}]},{"name":"NY","value":"NY","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Albany","value":"NOAM-US-NY-AL","locationOptions":[]},{"name":"Brentwood","value":"NOAM-US-NY-BR","locationOptions":[]},{"name":"Elmira","value":"NOAM-US-NY-EL","locationOptions":[]},{"name":"Hempstead","value":"NOAM-US-NY-HE","locationOptions":[]},{"name":"New York City","value":"NOAM-US-NY-NY","locationOptions":[]},{"name":"Niagara Falls","value":"NOAM-US-NY-NF","locationOptions":[]},{"name":"Rochester","value":"NOAM-US-NY-RO","locationOptions":[]},{"name":"Yonkers","value":"NOAM-US-NY-YO","locationOptions":[]}]}]},{"name":"OH","value":"OH","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Akron","value":"NOAM-US-OH-AK","locationOptions":[]},{"name":"Cincinnati","value":"NOAM-US-OH-CI","locationOptions":[]},{"name":"Cleveland","value":"NOAM-US-OH-CL","locationOptions":[]},{"name":"Columbus","value":"NOAM-US-OH-CO","locationOptions":[]},{"name":"Dayton","value":"NOAM-US-OH-DA","locationOptions":[]},{"name":"Toledo","value":"NOAM-US-OH-TO","locationOptions":[]}]}]},{"name":"OK","value":"OK","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Lawton","value":"NOAM-US-OK-LA","locationOptions":[]},{"name":"Oklahoma City","value":"NOAM-US-OK-OC","locationOptions":[]},{"name":"Tulsa","value":"NOAM-US-OK-TU","locationOptions":[]}]}]},{"name":"OR","value":"OR","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Portland","value":"NOAM-US-OR-PO","locationOptions":[]}]}]},{"name":"PA","value":"PA","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Erie","value":"NOAM-US-PA-ER","locationOptions":[]},{"name":"Lancaster","value":"NOAM-US-PA-LA","locationOptions":[]},{"name":"Philadelphia","value":"NOAM-US-PA-PI","locationOptions":[]},{"name":"Pittsburgh","value":"NOAM-US-PA-PT","locationOptions":[]},{"name":"Scranton","value":"NOAM-US-PA-SC","locationOptions":[]}]}]},{"name":"RI","value":"RI","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Providence","value":"NOAM-US-RI-PR","locationOptions":[]}]}]},{"name":"SC","value":"SC","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Charleston","value":"NOAM-US-SC-CH","locationOptions":[]},{"name":"Columbia","value":"NOAM-US-SC-CO","locationOptions":[]},{"name":"Greenville","value":"NOAM-US-SC-GR","locationOptions":[]}]}]},{"name":"SD","value":"SD","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Sioux Falls","value":"NOAM-US-SD-SF","locationOptions":[]}]}]},{"name":"TN","value":"TN","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Chattanooga","value":"NOAM-US-TN-CH","locationOptions":[]},{"name":"Clarksville","value":"NOAM-US-TN-CL","locationOptions":[]},{"name":"Jackson","value":"NOAM-US-TN-JA","locationOptions":[]},{"name":"Knoxville","value":"NOAM-US-TN-KN","locationOptions":[]},{"name":"Memphis","value":"NOAM-US-TN-ME","locationOptions":[]},{"name":"Nashville","value":"NOAM-US-TN-NA","locationOptions":[]}]}]},{"name":"TX","value":"TX","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Abilene","value":"NOAM-US-TX-AB","locationOptions":[]},{"name":"Austin","value":"NOAM-US-TX-AU","locationOptions":[]},{"name":"Bryan","value":"NOAM-US-TX-BR","locationOptions":[]},{"name":"Corpus Christi","value":"NOAM-US-TX-CC","locationOptions":[]},{"name":"Dallas","value":"NOAM-US-TX-DA","locationOptions":[]},{"name":"Denton","value":"NOAM-US-TX-DE","locationOptions":[]},{"name":"El Paso","value":"NOAM-US-TX-EP","locationOptions":[]},{"name":"Fort Worth","value":"NOAM-US-TX-FW","locationOptions":[]},{"name":"Galveston","value":"NOAM-US-TX-GA","locationOptions":[]},{"name":"Hamilton","value":"NOAM-US-TX-HA","locationOptions":[]},{"name":"Houston","value":"NOAM-US-TX-HO","locationOptions":[]},{"name":"Huntsville","value":"NOAM-US-TX-HU","locationOptions":[]},{"name":"Laredo","value":"NOAM-US-TX-LA","locationOptions":[]},{"name":"Lubbock","value":"NOAM-US-TX-LU","locationOptions":[]},{"name":"Odessa","value":"NOAM-US-TX-OD","locationOptions":[]},{"name":"San Antonio","value":"NOAM-US-TX-SA","locationOptions":[]},{"name":"Tyler","value":"NOAM-US-TX-TY","locationOptions":[]}]}]},{"name":"UT","value":"UT","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Salt Lake City","value":"NOAM-US-UT-SL","locationOptions":[]},{"name":"St. George","value":"NOAM-US-UT-SG","locationOptions":[]}]}]},{"name":"VA","value":"VA","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Arlington","value":"NOAM-US-VA-AR","locationOptions":[]},{"name":"Lynchburg","value":"NOAM-US-VA-LY","locationOptions":[]},{"name":"Richmond","value":"NOAM-US-VA-RI","locationOptions":[]},{"name":"Roanoke","value":"NOAM-US-VA-RO","locationOptions":[]},{"name":"Virginia Beach","value":"NOAM-US-VA-VB","locationOptions":[]}]}]},{"name":"VT","value":"VT","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Brattleboro","value":"NOAM-US-VT-BR","locationOptions":[]},{"name":"Burlington","value":"NOAM-US-VT-BU","locationOptions":[]},{"name":"Newport","value":"NOAM-US-VT-NE","locationOptions":[]}]}]},{"name":"WI","value":"WI","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Eau Claire","value":"NOAM-US-WI-EC","locationOptions":[]},{"name":"Kenosha","value":"NOAM-US-WI-KE","locationOptions":[]},{"name":"Madison","value":"NOAM-US-WI-MA","locationOptions":[]},{"name":"Milwaukee","value":"NOAM-US-WI-MI","locationOptions":[]}]}]},{"name":"WV","value":"WV","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Charleston","value":"NOAM-US-WV-CH","locationOptions":[]}]}]},{"name":"WY","value":"WY","locationOptions":[{"labelId":"city","labelName":"City","options":[{"name":"Laramie","value":"NOAM-US-WY-LA","locationOptions":[]}]}]}]}}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Request-Context', - 'appId=', - 'MS-CV', - 'zYqyp5H2wUe1K3YfpRcCBw.0', - 'X-Processing-Time', - '425ms', - 'X-Azure-Ref', - '0hOUFYAAAAACQh1I8jmuPQZ6BwuOUgCC+RVdSMzBFREdFMDUyMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', - 'Date', - 'Mon, 18 Jan 2021 19:46:12 GMT' -]); + .reply( + 200, + { + locationOptions: { + labelId: "state", + labelName: "State", + options: [ + { + name: "AL", + value: "AL", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Birmingham", value: "NOAM-US-AL-BI", locationOptions: [] }, + { name: "Huntsville", value: "NOAM-US-AL-HN", locationOptions: [] }, + { name: "Mobile", value: "NOAM-US-AL-MO", locationOptions: [] }, + { name: "Montgomery", value: "NOAM-US-AL-MN", locationOptions: [] } + ] + } + ] + }, + { + name: "AR", + value: "AR", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Fort Smith", value: "NOAM-US-AR-FS", locationOptions: [] }, + { name: "Jonesboro", value: "NOAM-US-AR-JO", locationOptions: [] }, + { name: "Little Rock", value: "NOAM-US-AR-LR", locationOptions: [] } + ] + } + ] + }, + { + name: "AZ", + value: "AZ", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [{ name: "Phoenix", value: "NOAM-US-AZ-PH", locationOptions: [] }] + } + ] + }, + { + name: "CA", + value: "CA", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Anaheim", value: "NOAM-US-CA-AN", locationOptions: [] }, + { name: "Burbank", value: "NOAM-US-CA-BU", locationOptions: [] }, + { name: "Concord", value: "NOAM-US-CA-CO", locationOptions: [] }, + { name: "Fresno", value: "NOAM-US-CA-FR", locationOptions: [] }, + { name: "Irvine", value: "NOAM-US-CA-IR", locationOptions: [] }, + { name: "Los Angeles", value: "NOAM-US-CA-LA", locationOptions: [] }, + { name: "Riverside", value: "NOAM-US-CA-RI", locationOptions: [] }, + { name: "Sacramento", value: "NOAM-US-CA-SA", locationOptions: [] }, + { name: "Salinas", value: "NOAM-US-CA-SL", locationOptions: [] }, + { name: "San Diego", value: "NOAM-US-CA-SD", locationOptions: [] }, + { name: "San Francisco", value: "NOAM-US-CA-SF", locationOptions: [] }, + { name: "San Jose", value: "NOAM-US-CA-SJ", locationOptions: [] }, + { name: "Santa Barbara", value: "NOAM-US-CA-SB", locationOptions: [] }, + { name: "Santa Clarita", value: "NOAM-US-CA-SC", locationOptions: [] }, + { name: "Santa Rosa", value: "NOAM-US-CA-SR", locationOptions: [] }, + { name: "Stockton", value: "NOAM-US-CA-ST", locationOptions: [] }, + { name: "Truckee", value: "NOAM-US-CA-TR", locationOptions: [] } + ] + } + ] + }, + { + name: "CL", + value: "CL", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [{ name: "Washington DC", value: "NOAM-US-CL-DC", locationOptions: [] }] + } + ] + }, + { + name: "CO", + value: "CO", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Denver", value: "NOAM-US-CO-DE", locationOptions: [] }, + { name: "Pueblo", value: "NOAM-US-CO-PU", locationOptions: [] } + ] + } + ] + }, + { + name: "CT", + value: "CT", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Bridgeport", value: "NOAM-US-CT-BR", locationOptions: [] }, + { name: "Hartford", value: "NOAM-US-CT-HA", locationOptions: [] } + ] + } + ] + }, + { + name: "DE", + value: "DE", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [{ name: "Wilmington", value: "NOAM-US-DE-WI", locationOptions: [] }] + } + ] + }, + { + name: "FL", + value: "FL", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Cape Coral", value: "NOAM-US-FL-CC", locationOptions: [] }, + { name: "Daytona Beach", value: "NOAM-US-FL-DB", locationOptions: [] }, + { name: "Fort Lauderdale", value: "NOAM-US-FL-FL", locationOptions: [] }, + { name: "Gainesville", value: "NOAM-US-FL-GA", locationOptions: [] }, + { name: "Jacksonville", value: "NOAM-US-FL-JA", locationOptions: [] }, + { name: "Lakeland", value: "NOAM-US-FL-LA", locationOptions: [] }, + { name: "Miami", value: "NOAM-US-FL-MI", locationOptions: [] }, + { name: "Orlando", value: "NOAM-US-FL-OR", locationOptions: [] }, + { name: "Port St Lucie", value: "NOAM-US-FL-PS", locationOptions: [] }, + { name: "Sarasota", value: "NOAM-US-FL-SA", locationOptions: [] }, + { name: "St. Petersburg", value: "NOAM-US-FL-SP", locationOptions: [] }, + { name: "Tallahassee", value: "NOAM-US-FL-TA", locationOptions: [] }, + { name: "West Palm Beach", value: "NOAM-US-FL-WP", locationOptions: [] } + ] + } + ] + }, + { + name: "GA", + value: "GA", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Albany", value: "NOAM-US-GA-AL", locationOptions: [] }, + { name: "Atlanta", value: "NOAM-US-GA-AT", locationOptions: [] }, + { name: "Augusta", value: "NOAM-US-GA-AU", locationOptions: [] }, + { name: "Macon", value: "NOAM-US-GA-MA", locationOptions: [] }, + { name: "Savannah", value: "NOAM-US-GA-SA", locationOptions: [] } + ] + } + ] + }, + { + name: "HI", + value: "HI", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [{ name: "Honolulu", value: "NOAM-US-HI-HO", locationOptions: [] }] + } + ] + }, + { + name: "IA", + value: "IA", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Cedar Rapids", value: "NOAM-US-IA-CR", locationOptions: [] }, + { name: "Davenport", value: "NOAM-US-IA-DA", locationOptions: [] }, + { name: "Mason City", value: "NOAM-US-IA-MC", locationOptions: [] }, + { name: "Sioux City", value: "NOAM-US-IA-SC", locationOptions: [] } + ] + } + ] + }, + { + name: "ID", + value: "ID", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [{ name: "Boise", value: "NOAM-US-ID-BO", locationOptions: [] }] + } + ] + }, + { + name: "IL", + value: "IL", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Aurora", value: "NOAM-US-IL-AU", locationOptions: [] }, + { name: "Champaign", value: "NOAM-US-IL-CA", locationOptions: [] }, + { name: "Chicago", value: "NOAM-US-IL-CH", locationOptions: [] }, + { name: "Cicero", value: "NOAM-US-IL-CI", locationOptions: [] }, + { name: "Rock Island", value: "NOAM-US-IL-RI", locationOptions: [] }, + { name: "Rockford", value: "NOAM-US-IL-RO", locationOptions: [] } + ] + } + ] + }, + { + name: "IN", + value: "IN", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Evansville", value: "NOAM-US-IN-EV", locationOptions: [] }, + { name: "Fort Wayne", value: "NOAM-US-IN-FW", locationOptions: [] }, + { name: "Gary", value: "NOAM-US-IN-GA", locationOptions: [] }, + { name: "Indianapolis", value: "NOAM-US-IN-IN", locationOptions: [] }, + { name: "South Bend", value: "NOAM-US-IN-SB", locationOptions: [] } + ] + } + ] + }, + { + name: "KS", + value: "KS", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Dodge City", value: "NOAM-US-KS-DC", locationOptions: [] }, + { name: "Kansas City", value: "NOAM-US-KS-KS", locationOptions: [] }, + { name: "Topeka", value: "NOAM-US-KS-TO", locationOptions: [] }, + { name: "Wichita", value: "NOAM-US-KS-WI", locationOptions: [] } + ] + } + ] + }, + { + name: "KY", + value: "KY", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Ashland", value: "NOAM-US-KY-AS", locationOptions: [] }, + { name: "Lexington", value: "NOAM-US-KY-LE", locationOptions: [] }, + { name: "Louisville", value: "NOAM-US-KY-LO", locationOptions: [] }, + { name: "Owensboro", value: "NOAM-US-KY-OW", locationOptions: [] } + ] + } + ] + }, + { + name: "LA", + value: "LA", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Baton Rouge", value: "NOAM-US-LA-BR", locationOptions: [] }, + { name: "Lafayette", value: "NOAM-US-LA-LA", locationOptions: [] }, + { name: "New Orleans", value: "NOAM-US-LA-NO", locationOptions: [] }, + { name: "Shreveport", value: "NOAM-US-LA-SH", locationOptions: [] } + ] + } + ] + }, + { + name: "MA", + value: "MA", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [{ name: "Lowell", value: "NOAM-US-MA-LO", locationOptions: [] }] + } + ] + }, + { + name: "MD", + value: "MD", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [{ name: "Baltimore", value: "NOAM-US-MD-BA", locationOptions: [] }] + } + ] + }, + { + name: "ME", + value: "ME", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [{ name: "Portland", value: "NOAM-US-ME-PO", locationOptions: [] }] + } + ] + }, + { + name: "MI", + value: "MI", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Ann Arbor", value: "NOAM-US-MI-AA", locationOptions: [] }, + { name: "Detroit", value: "NOAM-US-MI-DE", locationOptions: [] }, + { name: "Flint", value: "NOAM-US-MI-FL", locationOptions: [] }, + { name: "Grand Rapids", value: "NOAM-US-MI-GP", locationOptions: [] }, + { name: "Grant", value: "NOAM-US-MI-GR", locationOptions: [] }, + { name: "Lansing", value: "NOAM-US-MI-LA", locationOptions: [] }, + { name: "Otsego", value: "NOAM-US-MI-OT", locationOptions: [] }, + { name: "Saginaw", value: "NOAM-US-MI-SA", locationOptions: [] }, + { name: "Sault Ste Marie", value: "NOAM-US-MI-SS", locationOptions: [] } + ] + } + ] + }, + { + name: "MN", + value: "MN", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Alexandria", value: "NOAM-US-MN-AL", locationOptions: [] }, + { name: "Bloomington", value: "NOAM-US-MN-BL", locationOptions: [] }, + { name: "Duluth", value: "NOAM-US-MN-DU", locationOptions: [] }, + { name: "Minneapolis", value: "NOAM-US-MN-MI", locationOptions: [] }, + { name: "Plymouth", value: "NOAM-US-MN-PL", locationOptions: [] } + ] + } + ] + }, + { + name: "MO", + value: "MO", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Columbia", value: "NOAM-US-MO-CO", locationOptions: [] }, + { name: "Kansas City", value: "NOAM-US-MO-KS", locationOptions: [] }, + { name: "Marshall", value: "NOAM-US-MO-MA", locationOptions: [] }, + { name: "Springfield", value: "NOAM-US-MO-SP", locationOptions: [] }, + { name: "St. Charles", value: "NOAM-US-MO-SC", locationOptions: [] }, + { name: "St. Louis", value: "NOAM-US-MO-SL", locationOptions: [] } + ] + } + ] + }, + { + name: "MS", + value: "MS", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Biloxi", value: "NOAM-US-MS-BI", locationOptions: [] }, + { name: "Jackson", value: "NOAM-US-MS-JA", locationOptions: [] }, + { name: "Starkville", value: "NOAM-US-MS-ST", locationOptions: [] } + ] + } + ] + }, + { + name: "MT", + value: "MT", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [{ name: "Billings", value: "NOAM-US-MT-BI", locationOptions: [] }] + } + ] + }, + { + name: "NC", + value: "NC", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Asheville", value: "NOAM-US-NC-AS", locationOptions: [] }, + { name: "Charlotte", value: "NOAM-US-NC-CH", locationOptions: [] }, + { name: "Fayetteville", value: "NOAM-US-NC-FA", locationOptions: [] }, + { name: "Greensboro", value: "NOAM-US-NC-GR", locationOptions: [] }, + { name: "Raleigh", value: "NOAM-US-NC-RA", locationOptions: [] }, + { name: "Rocky Mount", value: "NOAM-US-NC-RM", locationOptions: [] } + ] + } + ] + }, + { + name: "ND", + value: "ND", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [{ name: "Fargo", value: "NOAM-US-ND-FA", locationOptions: [] }] + } + ] + }, + { + name: "NE", + value: "NE", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Kearney", value: "NOAM-US-NE-KE", locationOptions: [] }, + { name: "Omaha", value: "NOAM-US-NE-OM", locationOptions: [] } + ] + } + ] + }, + { + name: "NH", + value: "NH", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [{ name: "Concord", value: "NOAM-US-NH-CO", locationOptions: [] }] + } + ] + }, + { + name: "NJ", + value: "NJ", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Atlantic City", value: "NOAM-US-NJ-AC", locationOptions: [] }, + { name: "Camden", value: "NOAM-US-NJ-CA", locationOptions: [] }, + { name: "Edison", value: "NOAM-US-NJ-ED", locationOptions: [] }, + { name: "Elizabeth", value: "NOAM-US-NJ-EL", locationOptions: [] }, + { name: "Jersey City", value: "NOAM-US-NJ-JC", locationOptions: [] }, + { name: "Newark", value: "NOAM-US-NJ-NE", locationOptions: [] } + ] + } + ] + }, + { + name: "NM", + value: "NM", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Albuquerque", value: "NOAM-US-NM-AL", locationOptions: [] }, + { name: "Las Cruces", value: "NOAM-US-NM-LC", locationOptions: [] } + ] + } + ] + }, + { + name: "NV", + value: "NV", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Las Vegas", value: "NOAM-US-NV-LV", locationOptions: [] }, + { name: "Reno", value: "NOAM-US-NV-RE", locationOptions: [] } + ] + } + ] + }, + { + name: "NY", + value: "NY", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Albany", value: "NOAM-US-NY-AL", locationOptions: [] }, + { name: "Brentwood", value: "NOAM-US-NY-BR", locationOptions: [] }, + { name: "Elmira", value: "NOAM-US-NY-EL", locationOptions: [] }, + { name: "Hempstead", value: "NOAM-US-NY-HE", locationOptions: [] }, + { name: "New York City", value: "NOAM-US-NY-NY", locationOptions: [] }, + { name: "Niagara Falls", value: "NOAM-US-NY-NF", locationOptions: [] }, + { name: "Rochester", value: "NOAM-US-NY-RO", locationOptions: [] }, + { name: "Yonkers", value: "NOAM-US-NY-YO", locationOptions: [] } + ] + } + ] + }, + { + name: "OH", + value: "OH", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Akron", value: "NOAM-US-OH-AK", locationOptions: [] }, + { name: "Cincinnati", value: "NOAM-US-OH-CI", locationOptions: [] }, + { name: "Cleveland", value: "NOAM-US-OH-CL", locationOptions: [] }, + { name: "Columbus", value: "NOAM-US-OH-CO", locationOptions: [] }, + { name: "Dayton", value: "NOAM-US-OH-DA", locationOptions: [] }, + { name: "Toledo", value: "NOAM-US-OH-TO", locationOptions: [] } + ] + } + ] + }, + { + name: "OK", + value: "OK", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Lawton", value: "NOAM-US-OK-LA", locationOptions: [] }, + { name: "Oklahoma City", value: "NOAM-US-OK-OC", locationOptions: [] }, + { name: "Tulsa", value: "NOAM-US-OK-TU", locationOptions: [] } + ] + } + ] + }, + { + name: "OR", + value: "OR", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [{ name: "Portland", value: "NOAM-US-OR-PO", locationOptions: [] }] + } + ] + }, + { + name: "PA", + value: "PA", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Erie", value: "NOAM-US-PA-ER", locationOptions: [] }, + { name: "Lancaster", value: "NOAM-US-PA-LA", locationOptions: [] }, + { name: "Philadelphia", value: "NOAM-US-PA-PI", locationOptions: [] }, + { name: "Pittsburgh", value: "NOAM-US-PA-PT", locationOptions: [] }, + { name: "Scranton", value: "NOAM-US-PA-SC", locationOptions: [] } + ] + } + ] + }, + { + name: "RI", + value: "RI", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [{ name: "Providence", value: "NOAM-US-RI-PR", locationOptions: [] }] + } + ] + }, + { + name: "SC", + value: "SC", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Charleston", value: "NOAM-US-SC-CH", locationOptions: [] }, + { name: "Columbia", value: "NOAM-US-SC-CO", locationOptions: [] }, + { name: "Greenville", value: "NOAM-US-SC-GR", locationOptions: [] } + ] + } + ] + }, + { + name: "SD", + value: "SD", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [{ name: "Sioux Falls", value: "NOAM-US-SD-SF", locationOptions: [] }] + } + ] + }, + { + name: "TN", + value: "TN", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Chattanooga", value: "NOAM-US-TN-CH", locationOptions: [] }, + { name: "Clarksville", value: "NOAM-US-TN-CL", locationOptions: [] }, + { name: "Jackson", value: "NOAM-US-TN-JA", locationOptions: [] }, + { name: "Knoxville", value: "NOAM-US-TN-KN", locationOptions: [] }, + { name: "Memphis", value: "NOAM-US-TN-ME", locationOptions: [] }, + { name: "Nashville", value: "NOAM-US-TN-NA", locationOptions: [] } + ] + } + ] + }, + { + name: "TX", + value: "TX", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Abilene", value: "NOAM-US-TX-AB", locationOptions: [] }, + { name: "Austin", value: "NOAM-US-TX-AU", locationOptions: [] }, + { name: "Bryan", value: "NOAM-US-TX-BR", locationOptions: [] }, + { name: "Corpus Christi", value: "NOAM-US-TX-CC", locationOptions: [] }, + { name: "Dallas", value: "NOAM-US-TX-DA", locationOptions: [] }, + { name: "Denton", value: "NOAM-US-TX-DE", locationOptions: [] }, + { name: "El Paso", value: "NOAM-US-TX-EP", locationOptions: [] }, + { name: "Fort Worth", value: "NOAM-US-TX-FW", locationOptions: [] }, + { name: "Galveston", value: "NOAM-US-TX-GA", locationOptions: [] }, + { name: "Hamilton", value: "NOAM-US-TX-HA", locationOptions: [] }, + { name: "Houston", value: "NOAM-US-TX-HO", locationOptions: [] }, + { name: "Huntsville", value: "NOAM-US-TX-HU", locationOptions: [] }, + { name: "Laredo", value: "NOAM-US-TX-LA", locationOptions: [] }, + { name: "Lubbock", value: "NOAM-US-TX-LU", locationOptions: [] }, + { name: "Odessa", value: "NOAM-US-TX-OD", locationOptions: [] }, + { name: "San Antonio", value: "NOAM-US-TX-SA", locationOptions: [] }, + { name: "Tyler", value: "NOAM-US-TX-TY", locationOptions: [] } + ] + } + ] + }, + { + name: "UT", + value: "UT", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Salt Lake City", value: "NOAM-US-UT-SL", locationOptions: [] }, + { name: "St. George", value: "NOAM-US-UT-SG", locationOptions: [] } + ] + } + ] + }, + { + name: "VA", + value: "VA", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Arlington", value: "NOAM-US-VA-AR", locationOptions: [] }, + { name: "Lynchburg", value: "NOAM-US-VA-LY", locationOptions: [] }, + { name: "Richmond", value: "NOAM-US-VA-RI", locationOptions: [] }, + { name: "Roanoke", value: "NOAM-US-VA-RO", locationOptions: [] }, + { name: "Virginia Beach", value: "NOAM-US-VA-VB", locationOptions: [] } + ] + } + ] + }, + { + name: "VT", + value: "VT", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Brattleboro", value: "NOAM-US-VT-BR", locationOptions: [] }, + { name: "Burlington", value: "NOAM-US-VT-BU", locationOptions: [] }, + { name: "Newport", value: "NOAM-US-VT-NE", locationOptions: [] } + ] + } + ] + }, + { + name: "WI", + value: "WI", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [ + { name: "Eau Claire", value: "NOAM-US-WI-EC", locationOptions: [] }, + { name: "Kenosha", value: "NOAM-US-WI-KE", locationOptions: [] }, + { name: "Madison", value: "NOAM-US-WI-MA", locationOptions: [] }, + { name: "Milwaukee", value: "NOAM-US-WI-MI", locationOptions: [] } + ] + } + ] + }, + { + name: "WV", + value: "WV", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [{ name: "Charleston", value: "NOAM-US-WV-CH", locationOptions: [] }] + } + ] + }, + { + name: "WY", + value: "WY", + locationOptions: [ + { + labelId: "city", + labelName: "City", + options: [{ name: "Laramie", value: "NOAM-US-WY-LA", locationOptions: [] }] + } + ] + } + ] + } + }, + [ + "Transfer-Encoding", + "chunked", + "Content-Type", + "application/json; charset=utf-8", + "Request-Context", + "appId=", + "MS-CV", + "zYqyp5H2wUe1K3YfpRcCBw.0", + "X-Processing-Time", + "425ms", + "X-Azure-Ref", + "0hOUFYAAAAACQh1I8jmuPQZ6BwuOUgCC+RVdSMzBFREdFMDUyMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Date", + "Mon, 18 Jan 2021 19:46:12 GMT" + ] + ); diff --git a/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclient_playbacklive/recording_can_get_phoneplangroupid_and_phoneplanid_for_other_tests.js b/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclient_playbacklive/recording_can_get_phoneplangroupid_and_phoneplanid_for_other_tests.js index 893cc199349a..a9807d7c7bea 100644 --- a/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclient_playbacklive/recording_can_get_phoneplangroupid_and_phoneplanid_for_other_tests.js +++ b/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclient_playbacklive/recording_can_get_phoneplangroupid_and_phoneplanid_for_other_tests.js @@ -1,45 +1,95 @@ -let nock = require('nock'); +let nock = require("nock"); module.exports.hash = "dec4a115d96e27442dce416e17a705bb"; -module.exports.testInfo = {"uniqueName":{},"newDate":{}} +module.exports.testInfo = { uniqueName: {}, newDate: {} }; -nock('https://endpoint', {"encodedQueryParams":false}) - .get('/administration/phonenumbers/countries/US/phoneplangroups') +nock("https://endpoint", { encodedQueryParams: false }) + .get("/administration/phonenumbers/countries/US/phoneplangroups") .query(true) - .reply(200, {"phonePlanGroups":[{"phonePlanGroupId":"sanitized","phoneNumberType":"Geographic","localizedName":"Azure- User - Geographic","localizedDescription":"These are numbers used by Azure resources."},{"phonePlanGroupId":"sanitized","phoneNumberType":"Geographic","localizedName":"Azure - Geographic","localizedDescription":"These are numbers used by Azure resources."},{"phonePlanGroupId":"sanitized","phoneNumberType":"TollFree","localizedName":"Azure - Toll Free","localizedDescription":"These are toll free numbers used by Azure resources."}],"nextLink":null}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Request-Context', - 'appId=', - 'MS-CV', - 'HKu6PbrTEUejg1blYguRIQ.0', - 'X-Processing-Time', - '412ms', - 'X-Azure-Ref', - '0g+UFYAAAAACy/DlzIxHLTZt8jT1W98YqRVdSMzBFREdFMDUyMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', - 'Date', - 'Mon, 18 Jan 2021 19:46:11 GMT' -]); + .reply( + 200, + { + phonePlanGroups: [ + { + phonePlanGroupId: "sanitized", + phoneNumberType: "Geographic", + localizedName: "Azure- User - Geographic", + localizedDescription: "These are numbers used by Azure resources." + }, + { + phonePlanGroupId: "sanitized", + phoneNumberType: "Geographic", + localizedName: "Azure - Geographic", + localizedDescription: "These are numbers used by Azure resources." + }, + { + phonePlanGroupId: "sanitized", + phoneNumberType: "TollFree", + localizedName: "Azure - Toll Free", + localizedDescription: "These are toll free numbers used by Azure resources." + } + ], + nextLink: null + }, + [ + "Transfer-Encoding", + "chunked", + "Content-Type", + "application/json; charset=utf-8", + "Request-Context", + "appId=", + "MS-CV", + "HKu6PbrTEUejg1blYguRIQ.0", + "X-Processing-Time", + "412ms", + "X-Azure-Ref", + "0g+UFYAAAAACy/DlzIxHLTZt8jT1W98YqRVdSMzBFREdFMDUyMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Date", + "Mon, 18 Jan 2021 19:46:11 GMT" + ] + ); -nock('https://endpoint', {"encodedQueryParams":false}) - .get('/administration/phonenumbers/countries/US/phoneplangroups/sanitized/phoneplans') +nock("https://endpoint", { encodedQueryParams: false }) + .get("/administration/phonenumbers/countries/US/phoneplangroups/sanitized/phoneplans") .query(true) - .reply(200, {"phonePlans":[{"phonePlanId":"sanitized","localizedName":"Outbound Only PSTN For User - Geographic","locationType":"Selection","areaCodes":[],"capabilities":["OutboundCalling","UserAssignment","Geographic"],"maximumSearchSize":20},{"phonePlanId":"sanitized","localizedName":"Inbound Only PSTN For User - Geographic","locationType":"Selection","areaCodes":[],"capabilities":["InboundCalling","UserAssignment","Geographic"],"maximumSearchSize":20}],"nextLink":null}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Request-Context', - 'appId=', - 'MS-CV', - 'cUbpVknoqUepQ45Iwbpkkw.0', - 'X-Processing-Time', - '419ms', - 'X-Azure-Ref', - '0g+UFYAAAAAC++oZC+qGwSrPnaiOrkJ7YRVdSMzBFREdFMDYxMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', - 'Date', - 'Mon, 18 Jan 2021 19:46:11 GMT' -]); + .reply( + 200, + { + phonePlans: [ + { + phonePlanId: "sanitized", + localizedName: "Outbound Only PSTN For User - Geographic", + locationType: "Selection", + areaCodes: [], + capabilities: ["OutboundCalling", "UserAssignment", "Geographic"], + maximumSearchSize: 20 + }, + { + phonePlanId: "sanitized", + localizedName: "Inbound Only PSTN For User - Geographic", + locationType: "Selection", + areaCodes: [], + capabilities: ["InboundCalling", "UserAssignment", "Geographic"], + maximumSearchSize: 20 + } + ], + nextLink: null + }, + [ + "Transfer-Encoding", + "chunked", + "Content-Type", + "application/json; charset=utf-8", + "Request-Context", + "appId=", + "MS-CV", + "cUbpVknoqUepQ45Iwbpkkw.0", + "X-Processing-Time", + "419ms", + "X-Azure-Ref", + "0g+UFYAAAAAC++oZC+qGwSrPnaiOrkJ7YRVdSMzBFREdFMDYxMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Date", + "Mon, 18 Jan 2021 19:46:11 GMT" + ] + ); diff --git a/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclientwithtoken_playbacklive/recording_successfully_gets_phoneplangroupid.js b/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclientwithtoken_playbacklive/recording_successfully_gets_phoneplangroupid.js index b004c723c099..882021c2a3a6 100644 --- a/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclientwithtoken_playbacklive/recording_successfully_gets_phoneplangroupid.js +++ b/sdk/communication/communication-administration/recordings/node/phonenumberadministrationclientwithtoken_playbacklive/recording_successfully_gets_phoneplangroupid.js @@ -1,58 +1,97 @@ -let nock = require('nock'); +let nock = require("nock"); module.exports.hash = "327f8adc568814406df75b5dba40ca9d"; -module.exports.testInfo = {"uniqueName":{},"newDate":{}} +module.exports.testInfo = { uniqueName: {}, newDate: {} }; -nock('https://endpoint', {"encodedQueryParams":false}) - .post('/SomeTenantId/oauth2/v2.0/token', "response_type=token&grant_type=client_credentials&client_id=SomeClientId&client_secret=SomeClientSecret&scope=https%3A%2F%2Fcommunication.azure.com%2F%2F.default") - .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyIsImtpZCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyJ9.eyJhdWQiOiJodHRwczovL2NvbW11bmljYXRpb24uYXp1cmUuY29tLyIsImlzcyI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0LzcyZjk4OGJmLTg2ZjEtNDFhZi05MWFiLTJkN2NkMDExZGI0Ny8iLCJpYXQiOjE2MTExODcxNzIsIm5iZiI6MTYxMTE4NzE3MiwiZXhwIjoxNjExMjczODcyLCJhaW8iOiJFMkpnWVBpY2x1dy9UVDk5ejIrQlAvcmhrbnYzQXdBPSIsImFwcGlkIjoiNmM4MTgxYzctOTFhNi00ZTJlLTg0ODAtZDU0MDIxYWM0YzRiIiwiYXBwaWRhY3IiOiIxIiwiaWRwIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvNzJmOTg4YmYtODZmMS00MWFmLTkxYWItMmQ3Y2QwMTFkYjQ3LyIsIm9pZCI6IjNlMGM3MTRmLTk3YWMtNGQ2My1hZWFmLTE0YmFhNWUwNjRjYiIsInJoIjoiMC5BUm9BdjRqNWN2R0dyMEdScXkxODBCSGJSOGVCZ1d5bWtTNU9oSURWUUNHc1RFc2FBQUEuIiwic3ViIjoiM2UwYzcxNGYtOTdhYy00ZDYzLWFlYWYtMTRiYWE1ZTA2NGNiIiwidGlkIjoiNzJmOTg4YmYtODZmMS00MWFmLTkxYWItMmQ3Y2QwMTFkYjQ3IiwidXRpIjoiQXRCbmszWWV5a21mckQ3UTRQOFVBQSIsInZlciI6IjEuMCJ9.TiQUDCVYNuJQVmqloZ4u0gP4rS4XaV7HwcpgCbTn994QoIBGGUMKOK-KR8e8U_gifiWGsatnVq9-LTvLq0OjCCuO9UFe-d4UNljyJtSZ2WF_DuchwA4vIzBY1-9CmmXkCpTUfFUsghKEf3UrVXRaDsdnoSKV_exYKMxrkzNNcVAjlgcwvTap5TuUVLmPNv9BWmnf-SfkKNklMdO03jJ9j46BacWf5lToH8gQJ0Q5pAehJQ9hsRDRRB-KZXn4e2CHtzpyxMtnnmbNlD3fIyTI_NMC29qjpWZINJCmSwvxNe_pM0dHwy6VE5P3Mt4fq2t4T0ehSJmmz8HH0Ra7eKBj_Q"}, [ - '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', - 'sanitized', - 'x-ms-ests-server', - '2.1.11419.13 - NCUS ProdSlices', - 'Set-Cookie', - 'fpc=AtQYQhtVXGxAl2HRYGEM9KBWyo4SAwAAAAu8mtcOAAAA; expires=Sat, 20-Feb-2021 00:04: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', - 'Thu, 21 Jan 2021 00:04:32 GMT', - 'Content-Length', - '1327' -]); +nock("https://endpoint", { encodedQueryParams: false }) + .post( + "/SomeTenantId/oauth2/v2.0/token", + "response_type=token&grant_type=client_credentials&client_id=SomeClientId&client_secret=SomeClientSecret&scope=https%3A%2F%2Fcommunication.azure.com%2F%2F.default" + ) + .reply( + 200, + { + token_type: "Bearer", + expires_in: 86399, + ext_expires_in: 86399, + access_token: + "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyIsImtpZCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyJ9.eyJhdWQiOiJodHRwczovL2NvbW11bmljYXRpb24uYXp1cmUuY29tLyIsImlzcyI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0LzcyZjk4OGJmLTg2ZjEtNDFhZi05MWFiLTJkN2NkMDExZGI0Ny8iLCJpYXQiOjE2MTExODcxNzIsIm5iZiI6MTYxMTE4NzE3MiwiZXhwIjoxNjExMjczODcyLCJhaW8iOiJFMkpnWVBpY2x1dy9UVDk5ejIrQlAvcmhrbnYzQXdBPSIsImFwcGlkIjoiNmM4MTgxYzctOTFhNi00ZTJlLTg0ODAtZDU0MDIxYWM0YzRiIiwiYXBwaWRhY3IiOiIxIiwiaWRwIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvNzJmOTg4YmYtODZmMS00MWFmLTkxYWItMmQ3Y2QwMTFkYjQ3LyIsIm9pZCI6IjNlMGM3MTRmLTk3YWMtNGQ2My1hZWFmLTE0YmFhNWUwNjRjYiIsInJoIjoiMC5BUm9BdjRqNWN2R0dyMEdScXkxODBCSGJSOGVCZ1d5bWtTNU9oSURWUUNHc1RFc2FBQUEuIiwic3ViIjoiM2UwYzcxNGYtOTdhYy00ZDYzLWFlYWYtMTRiYWE1ZTA2NGNiIiwidGlkIjoiNzJmOTg4YmYtODZmMS00MWFmLTkxYWItMmQ3Y2QwMTFkYjQ3IiwidXRpIjoiQXRCbmszWWV5a21mckQ3UTRQOFVBQSIsInZlciI6IjEuMCJ9.TiQUDCVYNuJQVmqloZ4u0gP4rS4XaV7HwcpgCbTn994QoIBGGUMKOK-KR8e8U_gifiWGsatnVq9-LTvLq0OjCCuO9UFe-d4UNljyJtSZ2WF_DuchwA4vIzBY1-9CmmXkCpTUfFUsghKEf3UrVXRaDsdnoSKV_exYKMxrkzNNcVAjlgcwvTap5TuUVLmPNv9BWmnf-SfkKNklMdO03jJ9j46BacWf5lToH8gQJ0Q5pAehJQ9hsRDRRB-KZXn4e2CHtzpyxMtnnmbNlD3fIyTI_NMC29qjpWZINJCmSwvxNe_pM0dHwy6VE5P3Mt4fq2t4T0ehSJmmz8HH0Ra7eKBj_Q" + }, + [ + "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", + "sanitized", + "x-ms-ests-server", + "2.1.11419.13 - NCUS ProdSlices", + "Set-Cookie", + "fpc=AtQYQhtVXGxAl2HRYGEM9KBWyo4SAwAAAAu8mtcOAAAA; expires=Sat, 20-Feb-2021 00:04: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", + "Thu, 21 Jan 2021 00:04:32 GMT", + "Content-Length", + "1327" + ] + ); -nock('https://endpoint', {"encodedQueryParams":false}) - .get('/administration/phonenumbers/countries/US/phoneplangroups') +nock("https://endpoint", { encodedQueryParams: false }) + .get("/administration/phonenumbers/countries/US/phoneplangroups") .query(true) - .reply(200, {"phonePlanGroups":[{"phonePlanGroupId":"sanitized","phoneNumberType":"Geographic","localizedName":"Azure- User - Geographic","localizedDescription":"These are numbers used by Azure resources."},{"phonePlanGroupId":"sanitized","phoneNumberType":"Geographic","localizedName":"Azure - Geographic","localizedDescription":"These are numbers used by Azure resources."},{"phonePlanGroupId":"sanitized","phoneNumberType":"TollFree","localizedName":"Azure - Toll Free","localizedDescription":"These are toll free numbers used by Azure resources."}],"nextLink":null}, [ - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Request-Context', - 'appId=', - 'MS-CV', - '+4uJIAe1x0OvPbKUJMtlUA.0', - 'X-Processing-Time', - '623ms', - 'X-Azure-Ref', - '0EMUIYAAAAAC0o6cAdVC/TbazsMk2AVIfRVdSMzBFREdFMDUyMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', - 'Date', - 'Thu, 21 Jan 2021 00:04:32 GMT' -]); + .reply( + 200, + { + phonePlanGroups: [ + { + phonePlanGroupId: "sanitized", + phoneNumberType: "Geographic", + localizedName: "Azure- User - Geographic", + localizedDescription: "These are numbers used by Azure resources." + }, + { + phonePlanGroupId: "sanitized", + phoneNumberType: "Geographic", + localizedName: "Azure - Geographic", + localizedDescription: "These are numbers used by Azure resources." + }, + { + phonePlanGroupId: "sanitized", + phoneNumberType: "TollFree", + localizedName: "Azure - Toll Free", + localizedDescription: "These are toll free numbers used by Azure resources." + } + ], + nextLink: null + }, + [ + "Transfer-Encoding", + "chunked", + "Content-Type", + "application/json; charset=utf-8", + "Request-Context", + "appId=", + "MS-CV", + "+4uJIAe1x0OvPbKUJMtlUA.0", + "X-Processing-Time", + "623ms", + "X-Azure-Ref", + "0EMUIYAAAAAC0o6cAdVC/TbazsMk2AVIfRVdSMzBFREdFMDUyMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Date", + "Thu, 21 Jan 2021 00:04:32 GMT" + ] + ); diff --git a/sdk/communication/communication-administration/review/communication-administration.api.md b/sdk/communication/communication-administration/review/communication-administration.api.md index 3d54438cd56f..986d4606b016 100644 --- a/sdk/communication/communication-administration/review/communication-administration.api.md +++ b/sdk/communication/communication-administration/review/communication-administration.api.md @@ -4,7 +4,6 @@ ```ts -import { CommunicationUserIdentifier } from '@azure/communication-common'; import * as coreHttp from '@azure/core-http'; import { HttpResponse } from '@azure/core-http'; import { KeyCredential } from '@azure/core-auth'; @@ -75,33 +74,6 @@ export interface CarrierDetails { name?: string; } -// @public -export interface CommunicationIdentityAccessToken { - expiresOn: Date; - token: string; -} - -// @public -export class CommunicationIdentityClient { - constructor(connectionString: string, options?: CommunicationIdentityOptions); - constructor(url: string, credential: KeyCredential, options?: CommunicationIdentityOptions); - constructor(url: string, credential: TokenCredential, options?: CommunicationIdentityOptions); - createUser(options?: OperationOptions): Promise; - createUserWithToken(scopes: TokenScope[], options?: OperationOptions): Promise; - deleteUser(user: CommunicationUserIdentifier, options?: OperationOptions): Promise; - issueToken(user: CommunicationUserIdentifier, scopes: TokenScope[], options?: OperationOptions): Promise; - revokeTokens(user: CommunicationUserIdentifier, options?: OperationOptions): Promise; -} - -// @public -export interface CommunicationIdentityOptions extends PipelineOptions { -} - -// @public -export interface CommunicationUserToken extends CommunicationIdentityAccessToken { - user: CommunicationUserIdentifier; -} - // @public export interface ConfigurePhoneNumberOptions extends OperationOptions { applicationId?: string; @@ -137,12 +109,6 @@ export interface CreateReservationResponse { reservationId: string; } -// @public -export type CreateUserResponse = WithResponse; - -// @public -export type CreateUserWithTokenResponse = WithResponse; - // @public export type GetAreaCodesOptions = OperationOptions; @@ -194,9 +160,6 @@ export type GetReservationOptions = OperationOptions; // @public export type GetReservationResponse = WithResponse; -// @public -export type IssueTokenResponse = WithResponse; - // @public export type ListPhoneNumbersOptions = PageableLocalizationOptions; @@ -504,9 +467,6 @@ export type ReleaseStatus = "Pending" | "InProgress" | "Complete" | "Failed" | " // @public export type SearchStatus = "Pending" | "InProgress" | "Reserved" | "Expired" | "Expiring" | "Completing" | "Refreshing" | "Success" | "Manual" | "Cancelled" | "Cancelling" | "Error" | "PurchasePending"; -// @public -export type TokenScope = "chat" | "voip"; - // @public export type UnconfigurePhoneNumberOptions = OperationOptions; diff --git a/sdk/communication/communication-administration/samples/javascript/README.md b/sdk/communication/communication-administration/samples/javascript/README.md index 3d8dc152534f..28ff6bd0636e 100644 --- a/sdk/communication/communication-administration/samples/javascript/README.md +++ b/sdk/communication/communication-administration/samples/javascript/README.md @@ -7,16 +7,14 @@ products: urlFragment: communication-administration-identity-javascript --- -# Azure Communication Service Administration Identity client library sample for JavaScript +# Azure Communication Service Administration client library sample for JavaScript -These sample programs show how to use the JavaScript client libraries for Azure Communication Service Administration Identity to issue and refresh tokens. +These sample programs show how to use the JavaScript client libraries for Azure Communication Service Administration. -| **File Name** | **Description** | -| --------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| [issueToken.js][issuetoken] | uses the CommunicationIdentityClient to create a user and issue a token for this user | -| [revokeTokens.js][revoketokens] | uses the CommunicationIdentityClient to create a user, issue tokens for this user, and revoke these tokens | -| [purchasePhoneNumber.js][purchasephonenumber] | uses the PhoneNumberAdministrationClient to purchase a phone number | -| [releasePhoneNumbers.js][releasephonenumbers] | uses the PhoneNumberAdministrationClient to release phone numbers | +| **File Name** | **Description** | +| --------------------------------------------- | ------------------------------------------------------------------- | +| [purchasePhoneNumber.js][purchasephonenumber] | uses the PhoneNumberAdministrationClient to purchase a phone number | +| [releasePhoneNumbers.js][releasephonenumbers] | uses the PhoneNumberAdministrationClient to release phone numbers | ## Prerequisites @@ -41,21 +39,19 @@ npm install 3. Run whichever samples you like (note that some samples may require additional setup, see the table above): ```bash -node issueToken.js +node purchasePhoneNumber.js ``` Alternatively, run a single sample with the correct environment variables set (step 3 is not required if you do this), for example (cross-platform): ```bash -npx cross-env COMMUNICATION_CONNECTION_STRING="" node issueToken.js +npx cross-env COMMUNICATION_CONNECTION_STRING="" node purchasePhoneNumber.js ``` ## Next Steps Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. -[issuetoken]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/javascript/issueToken.js -[revoketokens]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/javascript/revokeTokens.js [purchasephonenumber]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/javascript/purchasePhoneNumber.js [releasephonenumbers]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/javascript/releasePhoneNumbers.js [apiref]: https://docs.microsoft.com/javascript/api/@azure/communication-administration diff --git a/sdk/communication/communication-administration/samples/typescript/README.md b/sdk/communication/communication-administration/samples/typescript/README.md index e4acfe67bc9a..95ed2d551be6 100644 --- a/sdk/communication/communication-administration/samples/typescript/README.md +++ b/sdk/communication/communication-administration/samples/typescript/README.md @@ -7,16 +7,14 @@ products: urlFragment: communication-administration-identity-typescript --- -# Azure Communication Service Communication Identity client library sample for TypeScript +# Azure Communication Service Communication Administration client library sample for TypeScript -These sample programs show how to use the TypeScript client libraries for Azure Communication Service Communication Identity to issue and refresh tokens. +These sample programs show how to use the TypeScript client libraries for Azure Communication Service Administration. -| **File Name** | **Description** | -| --------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| [issueToken.ts][issuetoken] | uses the CommunicationIdentityClient to create a user and issue a token for this user | -| [revokeTokens.ts][revoketokens] | uses the CommunicationIdentityClient to create a user, issue tokens for this user, and revoke these tokens | -| [purchasePhoneNumber.ts][purchasephonenumber] | uses the PhoneNumberAdministrationClient to purchase a phone number | -| [releasePhoneNumbers.ts][releasephonenumbers] | uses the PhoneNumberAdministrationClient to release phone numbers. | +| **File Name** | **Description** | +| --------------------------------------------- | ------------------------------------------------------------------- | +| [purchasePhoneNumber.ts][purchasephonenumber] | uses the PhoneNumberAdministrationClient to purchase a phone number | +| [releasePhoneNumbers.ts][releasephonenumbers] | uses the PhoneNumberAdministrationClient to release phone numbers. | ## Prerequisites @@ -47,21 +45,19 @@ npm run build 4. Run whichever samples you like (note that some samples may require additional setup, see the table above): ```bash -node dist/issueToken.js +node dist/purchasePhoneNumber.js ``` Alternatively, run a single sample with the correct environment variables set (step 3 is not required if you do this), for example (cross-platform): ```bash -npx cross-env COMMUNICATION_CONNECTION_STRING="" node dist/issueToken.js +npx cross-env COMMUNICATION_CONNECTION_STRING="" node dist/purchasePhoneNumber.js ``` ## Next Steps Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. -[issuetoken]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/typescript/src/issueToken.ts -[revoketokens]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/typescript/src/revokeTokens.ts [purchasephonenumber]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/typescript/src/purchasePhoneNumber.ts [releasephonenumbers]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/typescript/src/releasePhoneNumbers.ts [apiref]: https://docs.microsoft.com/javascript/api/@azure/communication-administration diff --git a/sdk/communication/communication-administration/src/index.ts b/sdk/communication/communication-administration/src/index.ts index 47b5b0763e30..2a309ff0a9c1 100644 --- a/sdk/communication/communication-administration/src/index.ts +++ b/sdk/communication/communication-administration/src/index.ts @@ -2,8 +2,6 @@ // Licensed under the MIT license. export * from "./common/models"; -export * from "./communicationIdentity/communicationIdentityClient"; -export * from "./communicationIdentity/models"; export * from "./phoneNumber/phoneNumberAdministrationClient"; export * from "./phoneNumber/models"; export { diff --git a/sdk/communication/communication-administration/test/utils/mockHttpClients.ts b/sdk/communication/communication-administration/test/utils/mockHttpClients.ts index 0661cc064689..718576397a30 100644 --- a/sdk/communication/communication-administration/test/utils/mockHttpClients.ts +++ b/sdk/communication/communication-administration/test/utils/mockHttpClients.ts @@ -6,7 +6,6 @@ import { AcquiredPhoneNumber, AcquiredPhoneNumbers, AreaCodes, - CommunicationIdentityAccessToken, PhoneNumberCountries, PhoneNumberCountry, PhoneNumberEntities, @@ -17,7 +16,6 @@ import { PhonePlansResponse, UpdateNumberCapabilitiesResponse } from "../../src"; -import { CommunicationIdentityAccessTokenResult } from "../../src/communicationIdentity/generated/src/models"; export const createMockHttpClient = (status: number = 200, parsedBody?: T): HttpClient => { return { @@ -36,23 +34,6 @@ export const baseHttpClient: HttpClient = createMockHttpClient(); export const base202HttpClient: HttpClient = createMockHttpClient(202); -const tokenResponse = { - id: "identity", - token: "token", - expiresOn: new Date("2011/11/30") -}; - -export const issueTokenHttpClient: HttpClient = createMockHttpClient< - CommunicationIdentityAccessToken ->(200, tokenResponse); -export const revokeTokensHttpClient: HttpClient = createMockHttpClient(204); - -export const createUserHttpClient: HttpClient = createMockHttpClient< - CommunicationIdentityAccessTokenResult ->(201, { - identity: { id: "identity" } -}); - const phoneNumbers: AcquiredPhoneNumber[] = [ { phoneNumber: "+18005551234", diff --git a/sdk/communication/communication-administration/test/utils/recordedClient.ts b/sdk/communication/communication-administration/test/utils/recordedClient.ts index 95115953eafe..53bd5369c68f 100644 --- a/sdk/communication/communication-administration/test/utils/recordedClient.ts +++ b/sdk/communication/communication-administration/test/utils/recordedClient.ts @@ -12,7 +12,7 @@ import { isPlaybackMode } from "@azure/test-utils-recorder"; import { isNode, TokenCredential } from "@azure/core-http"; -import { CommunicationIdentityClient, PhoneNumberAdministrationClient } from "../../src"; +import { PhoneNumberAdministrationClient } from "../../src"; import { DefaultAzureCredential } from "@azure/identity"; import { parseConnectionString } from "@azure/communication-common"; @@ -55,48 +55,6 @@ export const environmentSetup: RecorderEnvironmentSetup = { queryParametersToSkip: [] }; -export function createRecordedCommunicationIdentityClient( - context: Context -): RecordedClient { - const recorder = record(context, environmentSetup); - - return { - client: new CommunicationIdentityClient(env.COMMUNICATION_CONNECTION_STRING), - recorder - }; -} - -export function createRecordedCommunicationIdentityClientWithToken( - context: Context -): RecordedClient | undefined { - const recorder = record(context, environmentSetup); - let credential: TokenCredential; - const endpoint = parseConnectionString(env.COMMUNICATION_CONNECTION_STRING).endpoint; - if (isPlaybackMode()) { - credential = { - getToken: async (_scopes) => { - return { token: "testToken", expiresOnTimestamp: 11111 }; - } - }; - - return { - client: new CommunicationIdentityClient(endpoint, credential), - recorder - }; - } - - try { - credential = new DefaultAzureCredential(); - } catch { - return undefined; - } - - return { - client: new CommunicationIdentityClient(endpoint, credential), - recorder - }; -} - export function createRecordedPhoneNumberAdministrationClient( context: Context ): RecordedClient & { diff --git a/sdk/communication/communication-identity/.gitignore b/sdk/communication/communication-identity/.gitignore new file mode 100644 index 000000000000..5480375639b4 --- /dev/null +++ b/sdk/communication/communication-identity/.gitignore @@ -0,0 +1,2 @@ +/**/code-model-v* +/docGen \ No newline at end of file diff --git a/sdk/communication/communication-identity/.nycrc b/sdk/communication/communication-identity/.nycrc new file mode 100644 index 000000000000..29174b423579 --- /dev/null +++ b/sdk/communication/communication-identity/.nycrc @@ -0,0 +1,10 @@ +{ + "include": ["dist-esm/src/**/*.js"], + "exclude": ["**/*.d.ts", "dist-esm/src/generated/*"], + "reporter": ["text-summary", "html", "cobertura"], + "exclude-after-remap": false, + "sourceMap": true, + "produce-source-map": true, + "instrument": true, + "all": true +} diff --git a/sdk/communication/communication-identity/.vscode/launch.json b/sdk/communication/communication-identity/.vscode/launch.json new file mode 100644 index 000000000000..0838e97b6317 --- /dev/null +++ b/sdk/communication/communication-identity/.vscode/launch.json @@ -0,0 +1,42 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Debug Mocha Test [Without Rollup]", + "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", + "args": [ + "-r", + "ts-node/register", + "--timeout", + "999999", + "--colors", + "${workspaceFolder}/test/*.spec.ts" + ], + "env": { "TS_NODE_COMPILER_OPTIONS": "{\"module\": \"commonjs\"}" }, + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen", + "protocol": "inspector" + }, + { + "type": "node", + "request": "launch", + "name": "Debug Unit Tests", + "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", + "args": [ + "-u", + "tdd", + "--timeout", + "999999", + "--colors", + "${workspaceFolder}/dist-test/index.node.js" + ], + "internalConsoleOptions": "openOnSessionStart", + "preLaunchTask": "npm: build:test" + } + ] +} diff --git a/sdk/communication/communication-identity/CHANGELOG.md b/sdk/communication/communication-identity/CHANGELOG.md new file mode 100644 index 000000000000..576d455d7e26 --- /dev/null +++ b/sdk/communication/communication-identity/CHANGELOG.md @@ -0,0 +1,57 @@ +# Release History + +## 1.0.0-beta.4 (Unreleased) + +### Breaking Changes + +- Replaced `CommunicationUser` with `CommunicationUserIdentifier`. +- `CommunicationIdentityClient` method `revokeTokens` no longer accepts `tokensValidFrom` as an argument. + +### Key bug fixes + +- Fixed a bug where poller options were ignored for `beginReleasePhoneNumbers`, `beginReservePhoneNumbers` and `beginPurchaseReservation`. +- Fixed paging for `listPhoneNumbers`, `listPhonePlanGroups`, `listPhonePlans`, `listReleases`, `listSearches`, `listSupportedCountries`. + +### Added + +- `CommunicationIdentityClient` added a constructor that supports `TokenCredential`. +- `CommunicationIdentityClient` added a new method `createUserWithToken`. + +## 1.0.0-beta.3 (2020-11-16) + +### Added + +- Added support for long-running operations. See details under Breaking Changes. + +### Breaking Changes + +#### Model types + +- Renamed `CancelSearchOptions` to `CancelReservationOptions`. +- Removed `GetReleaseOptions`. +- Removed `GetSearchOptions`. +- Replaced `CreateSearchOptions` with `BeginReservePhoneNumbersOptions`. +- Replaced `PurchaseSearchOptions` with `BeginPurchaseReservationOptions`. +- Replaced `ReleasePhoneNumbersOptions` with `BeginReleasePhoneNumbersOptions`. +- Renamed `PhoneNumberSearch` to `PhoneNumberReservation`. + +#### `PhoneNumberReservation` + +- Renamed `searchId` property to `reservationId`. + +#### `PhoneNumberAdministrationClient` + +- Renamed `cancelSearch` to `cancelReservation`. +- Removed `getRelease` and `GetReleaseOptions`. +- Removed `getSearch` and `GetSearchOptions`. +- Replaced `createSearch` with `beginReservePhoneNumbers` which returns a poller for the long-running operation. +- Replaced `purchaseSearch` with `beginPurchaseReservation` which returns a poller for the long-running operation. +- Replaced `releasePhoneNumbers` with `beginReleasePhoneNumbers` which returns a poller for the long-running operation. + +## 1.0.0-beta.2 (2020-10-06) + +Added support for phone number administration. + +## 1.0.0-beta.1 (2020-09-22) + +The Azure Communication Administration Client library contains code which facilitates user token administration. diff --git a/sdk/communication/communication-identity/LICENSE b/sdk/communication/communication-identity/LICENSE new file mode 100644 index 000000000000..ea8fb1516028 --- /dev/null +++ b/sdk/communication/communication-identity/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2020 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/sdk/communication/communication-identity/README.md b/sdk/communication/communication-identity/README.md new file mode 100644 index 000000000000..97121849a200 --- /dev/null +++ b/sdk/communication/communication-identity/README.md @@ -0,0 +1,136 @@ +# Azure Communication Identity client library for JavaScript + +The administration library is used for managing users and tokens for Azure Communication Services. + +## Getting started + +### Prerequisites + +- An [Azure subscription][azure_sub]. +- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli]. + +### Installing + +```bash +npm install @azure/communication-identity +``` + +## Key concepts + +### Clients + +The `CommunicationIdentityClient` provides methods to manage users and their tokens. + +## Examples + +## Authentication + +You can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` with any of the following methods: + +### Create `KeyCredential` with `AzureKeyCredential` before initializing the client + +```typescript +import { AzureKeyCredential } from "@azure/core-auth"; +import { CommunicationIdentityClient } from "@azure/communication-identity"; + +const credential = new AzureKeyCredential(KEY); +const client = new CommunicationIdentityClient(HOST, credential); +``` + +### Using a connection string + +```typescript +import { CommunicationIdentityClient } from "@azure/communication-identity"; + +const connectionString = `endpoint=HOST;accessKey=KEY`; +const client = new CommunicationIdentityClient(connectionString); +``` + +### Using a `TokenCredential` + +```typescript +import { CommunicationIdentityClient } from "@azure/communication-identity"; + +let credential = new DefaultAzureCredential(); +const client = new CommunicationIdentityClient(HOST, credential); +``` + +If you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal]. + +## Usage + +### CommunicationIdentityClient + +### Creating an instance of CommunicationIdentityClient + +```typescript +import { CommunicationIdentityClient } from "@azure/communication-identity"; + +const client = new CommunicationIdentityClient(CONNECTION_STRING); +``` + +#### Creating a new user + +Use the `createUser` method to create a new user. + +```typescript +const user = await client.createUser(); +``` + +#### Creating and refreshing a user token + +Use the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include: + +- `chat` (Chat) +- `voip` (Voice over IP) + +```typescript +let { token } = await client.issueToken(user, ["chat"]); +``` + +To refresh the user token, issue another token with the same user. + +```typescript +{ token } = await client.issueToken(user, ["chat"]); +``` + +#### Revoking tokens for a user + +Use the `revokeTokens` method to revoke all the issued tokens of a user. + +```typescript +await client.revokeTokens(user); +``` + +`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked. + +#### Deleting a user + +Use the `deleteUser` method to delete a user. + +```typescript +await client.deleteUser(user); +``` + +## Troubleshooting + +## Next steps + +Please take a look at the +[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-identity/samples) +directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code. + +## Related projects + +- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) + +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-identity%2FREADME.png) diff --git a/sdk/communication/communication-identity/api-extractor.json b/sdk/communication/communication-identity/api-extractor.json new file mode 100644 index 000000000000..373e39769308 --- /dev/null +++ b/sdk/communication/communication-identity/api-extractor.json @@ -0,0 +1,35 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "types/src/index.d.ts", + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/communication-identity.d.ts" + }, + "messages": { + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, + "extractorMessageReporting": { + "ae-forgotten-export": { + "logLevel": "error", + "addToApiReportFile": false + }, + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "error" + } + } + } +} diff --git a/sdk/communication/communication-identity/karma.conf.js b/sdk/communication/communication-identity/karma.conf.js new file mode 100644 index 000000000000..c40964460d03 --- /dev/null +++ b/sdk/communication/communication-identity/karma.conf.js @@ -0,0 +1,152 @@ +// https://github.com/karma-runner/karma-chrome-launcher +process.env.CHROME_BIN = require("puppeteer").executablePath(); +require("dotenv").config(); +const { + jsonRecordingFilterFunction, + isPlaybackMode, + isSoftRecordMode, + isRecordMode +} = require("@azure/test-utils-recorder"); + +module.exports = function(config) { + config.set({ + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: "./", + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ["mocha"], + + plugins: [ + "karma-mocha", + "karma-mocha-reporter", + "karma-chrome-launcher", + "karma-edge-launcher", + "karma-firefox-launcher", + "karma-ie-launcher", + "karma-env-preprocessor", + "karma-coverage", + "karma-remap-istanbul", + "karma-junit-reporter", + "karma-json-to-file-reporter", + "karma-json-preprocessor" + ], + + // list of files / patterns to load in the browser + files: [ + // Uncomment the cdn link below for the polyfill service to support IE11 missing features + // Promise,String.prototype.startsWith,String.prototype.endsWith,String.prototype.repeat,String.prototype.includes,Array.prototype.includes,Object.keys + // "https://cdn.polyfill.io/v2/polyfill.js?features=Symbol,Promise,String.prototype.startsWith,String.prototype.endsWith,String.prototype.repeat,String.prototype.includes,Array.prototype.includes,Object.keys|always", + "dist-test/index.browser.js" + ].concat(isPlaybackMode() || isSoftRecordMode() ? ["recordings/browsers/**/*.json"] : []), + + // list of files / patterns to exclude + exclude: [], + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + "**/*.js": ["env"], + "recordings/browsers/**/*.json": ["json"] + // IMPORTANT: COMMENT following line if you want to debug in your browsers!! + // Preprocess source file to calculate code coverage, however this will make source file unreadable + //"test-browser/index.js": ["coverage"] + }, + + // inject following environment values into browser testing with window.__env__ + // environment values MUST be exported or set with same console running "karma start" + // https://www.npmjs.com/package/karma-env-preprocessor + envPreprocessor: [ + "TEST_MODE", + "COMMUNICATION_CONNECTION_STRING", + "INCLUDE_PHONENUMBER_TESTS", + "COMMUNICATION_ENDPOINT", + "AZURE_CLIENT_ID", + "AZURE_CLIENT_SECRET", + "AZURE_TENANT_ID" + ], + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ["mocha", "coverage", "karma-remap-istanbul", "junit", "json-to-file"], + + coverageReporter: { + // specify a common output directory + dir: "coverage-browser/", + reporters: [ + { + type: "json", + subdir: ".", + file: "coverage.json" + } + ] + }, + + remapIstanbulReporter: { + src: "coverage-browser/coverage.json", + reports: { + lcovonly: "coverage-browser/lcov.info", + html: "coverage-browser/html/report", + "text-summary": null, + cobertura: "./coverage-browser/cobertura-coverage.xml" + } + }, + + junitReporter: { + outputDir: "", // results will be saved as $outputDir/$browserName.xml + outputFile: "test-results.browser.xml", // if included, results will be saved as $outputDir/$browserName/$outputFile + suite: "", // suite will become the package name attribute in xml testsuite element + useBrowserName: false, // add browser name to report and classes names + nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element + classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element + properties: {} // key value pair of properties to add to the section of the report + }, + + jsonToFileReporter: { + filter: jsonRecordingFilterFunction, + outputPath: "." + }, + + // web server port + port: 9876, + + // enable / disable colors in the output (reporters and logs) + colors: true, + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: false, + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + // 'ChromeHeadless', 'Chrome', 'Firefox', 'Edge', 'IE' + browsers: ["ChromeHeadless"], + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: true, + + // Concurrency level + // how many browser should be started simultaneous + concurrency: 1, + + browserNoActivityTimeout: 600000, + browserDisconnectTimeout: 10000, + browserDisconnectTolerance: 3, + browserConsoleLogOptions: { + terminal: !isRecordMode() + }, + + client: { + mocha: { + // change Karma's debug.html to the mocha web reporter + reporter: "html", + timeout: "600000" + } + } + }); +}; diff --git a/sdk/communication/communication-identity/package.json b/sdk/communication/communication-identity/package.json new file mode 100644 index 000000000000..6ac540b830bd --- /dev/null +++ b/sdk/communication/communication-identity/package.json @@ -0,0 +1,129 @@ +{ + "name": "@azure/communication-identity", + "version": "1.0.0-beta.4", + "description": "SDK for Azure Communication service which facilitates user token administration.", + "sdk-type": "client", + "main": "dist/index.js", + "module": "dist-esm/src/index.js", + "types": "types/communication-identity.d.ts", + "scripts": { + "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", + "build": "tsc -p . && rollup -c 2>&1 && api-extractor run --local", + "build:autorest": "autorest --typescript --version=3.0.6267 --v3 ./swagger/swagger.md && rushx format", + "build:clean": "rush update --recheck && rush rebuild && npm run build", + "build:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1", + "build:node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1", + "build:samples": "dev-tool samples prep && cd dist-samples && tsc -p .", + "build:test": "tsc -p . && rollup -c rollup.test.config.js 2>&1", + "check-format": "prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", + "clean": "rimraf dist dist-* types *.tgz *.log", + "execute:samples": "npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples", + "execute:js-samples": "dev-tool samples run dist-samples/javascript", + "execute:ts-samples": "dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/", + "extract-api": "tsc -p . && api-extractor run --local", + "format": "prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", + "generate-doc": "api-documenter markdown -i temp -o docGen", + "integration-test:browser": "karma start --single-run", + "integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000 dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "lint:fix": "eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", + "lint": "eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-identity-lintReport.html || exit 0", + "pack": "npm pack 2>&1", + "prebuild": "npm run clean", + "test": "npm run build:test && npm run unit-test && npm run integration-test", + "test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser", + "test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node", + "test:watch": "npm run test -- --watch --reporter min", + "unit-test:browser": "karma start --single-run", + "unit-test:node": "mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "docs": "typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src" + }, + "files": [ + "dist/", + "dist-browser/", + "dist-esm/src/", + "types/communication-identity.d.ts", + "README.md", + "LICENSE" + ], + "keywords": [ + "azure", + "cloud", + "communication" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "engines": { + "node": ">=8.0.0" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-identity/", + "repository": "github:Azure/azure-sdk-for-js", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "sideEffects": false, + "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", + "dependencies": { + "@azure/abort-controller": "^1.0.0", + "@azure/communication-common": "1.0.0-beta.4", + "@azure/core-auth": "^1.1.3", + "@azure/core-http": "^1.2.0", + "@azure/core-lro": "^1.0.2", + "@azure/core-paging": "^1.1.1", + "@azure/logger": "^1.0.0", + "@azure/core-tracing": "1.0.0-preview.9", + "@opentelemetry/api": "^0.10.2", + "events": "^3.0.0", + "tslib": "^2.0.0" + }, + "devDependencies": { + "@azure/dev-tool": "^1.0.0", + "@azure/eslint-plugin-azure-sdk": "^3.0.0", + "@azure/test-utils-recorder": "^1.0.0", + "@azure/identity": "^1.1.0", + "@microsoft/api-documenter": "~7.8.17", + "@microsoft/api-extractor": "7.7.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "@rollup/plugin-replace": "^2.2.0", + "@types/chai": "^4.1.6", + "@types/mocha": "^7.0.2", + "@types/sinon": "^9.0.4", + "@types/node": "^8.0.0", + "assert": "^1.4.1", + "chai": "^4.2.0", + "cross-env": "^7.0.2", + "dotenv": "^8.2.0", + "eslint": "^7.15.0", + "inherits": "^2.0.3", + "karma-chrome-launcher": "^3.0.0", + "karma-coverage": "^2.0.0", + "karma-edge-launcher": "^0.4.2", + "karma-env-preprocessor": "^0.1.1", + "karma-firefox-launcher": "^1.1.0", + "karma-ie-launcher": "^1.0.0", + "karma-json-preprocessor": "^0.3.3", + "karma-json-to-file-reporter": "^1.0.1", + "karma-junit-reporter": "^2.0.1", + "karma-mocha-reporter": "^2.2.5", + "karma-mocha": "^2.0.1", + "karma-remap-istanbul": "^0.6.0", + "karma": "^5.1.0", + "mocha-junit-reporter": "^1.18.0", + "mocha": "^7.1.1", + "nyc": "^14.0.0", + "prettier": "^1.16.4", + "rimraf": "^3.0.0", + "rollup-plugin-sourcemaps": "^0.4.2", + "rollup-plugin-terser": "^5.1.1", + "rollup-plugin-visualizer": "^4.0.4", + "rollup-plugin-shim": "^1.0.0", + "rollup": "^1.16.3", + "sinon": "^9.0.2", + "typescript": "4.1.2", + "typedoc": "0.15.2" + } +} diff --git a/sdk/communication/communication-administration/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_creates_a_user.json b/sdk/communication/communication-identity/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_creates_a_user.json similarity index 100% rename from sdk/communication/communication-administration/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_creates_a_user.json rename to sdk/communication/communication-identity/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_creates_a_user.json diff --git a/sdk/communication/communication-administration/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_creates_a_user_and_token.json b/sdk/communication/communication-identity/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_creates_a_user_and_token.json similarity index 100% rename from sdk/communication/communication-administration/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_creates_a_user_and_token.json rename to sdk/communication/communication-identity/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_creates_a_user_and_token.json diff --git a/sdk/communication/communication-administration/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_deletes_a_user.json b/sdk/communication/communication-identity/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_deletes_a_user.json similarity index 100% rename from sdk/communication/communication-administration/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_deletes_a_user.json rename to sdk/communication/communication-identity/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_deletes_a_user.json diff --git a/sdk/communication/communication-administration/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.json b/sdk/communication/communication-identity/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.json similarity index 100% rename from sdk/communication/communication-administration/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.json rename to sdk/communication/communication-identity/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.json diff --git a/sdk/communication/communication-administration/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.json b/sdk/communication/communication-identity/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.json similarity index 100% rename from sdk/communication/communication-administration/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.json rename to sdk/communication/communication-identity/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.json diff --git a/sdk/communication/communication-administration/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_revokes_tokens_issued_for_a_user.json b/sdk/communication/communication-identity/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_revokes_tokens_issued_for_a_user.json similarity index 100% rename from sdk/communication/communication-administration/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_revokes_tokens_issued_for_a_user.json rename to sdk/communication/communication-identity/recordings/browsers/communicationidentityclient_playbacklive/recording_successfully_revokes_tokens_issued_for_a_user.json diff --git a/sdk/communication/communication-administration/recordings/browsers/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.json b/sdk/communication/communication-identity/recordings/browsers/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.json similarity index 100% rename from sdk/communication/communication-administration/recordings/browsers/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.json rename to sdk/communication/communication-identity/recordings/browsers/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.json diff --git a/sdk/communication/communication-administration/recordings/browsers/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.json b/sdk/communication/communication-identity/recordings/browsers/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.json similarity index 100% rename from sdk/communication/communication-administration/recordings/browsers/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.json rename to sdk/communication/communication-identity/recordings/browsers/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.json diff --git a/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_creates_a_user.js b/sdk/communication/communication-identity/recordings/node/communicationidentityclient_playbacklive/recording_successfully_creates_a_user.js similarity index 79% rename from sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_creates_a_user.js rename to sdk/communication/communication-identity/recordings/node/communicationidentityclient_playbacklive/recording_successfully_creates_a_user.js index 0717af478618..bd73041e01df 100644 --- a/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_creates_a_user.js +++ b/sdk/communication/communication-identity/recordings/node/communicationidentityclient_playbacklive/recording_successfully_creates_a_user.js @@ -1,11 +1,11 @@ -let nock = require('nock'); +let nock = require("nock"); module.exports.hash = "c114910037975ecd99c548006650f0e8"; -module.exports.testInfo = {"uniqueName":{},"newDate":{}} +module.exports.testInfo = { uniqueName: {}, newDate: {} }; -nock('https://endpoint', {"encodedQueryParams":false}) - .post('/identities') +nock("https://endpoint", { encodedQueryParams: true }) + .post("/identities") .query(true) .reply(201, { identity: { id: "sanitized" } }, [ "Transfer-Encoding", diff --git a/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_creates_a_user_and_token.js b/sdk/communication/communication-identity/recordings/node/communicationidentityclient_playbacklive/recording_successfully_creates_a_user_and_token.js similarity index 100% rename from sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_creates_a_user_and_token.js rename to sdk/communication/communication-identity/recordings/node/communicationidentityclient_playbacklive/recording_successfully_creates_a_user_and_token.js diff --git a/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_deletes_a_user.js b/sdk/communication/communication-identity/recordings/node/communicationidentityclient_playbacklive/recording_successfully_deletes_a_user.js similarity index 74% rename from sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_deletes_a_user.js rename to sdk/communication/communication-identity/recordings/node/communicationidentityclient_playbacklive/recording_successfully_deletes_a_user.js index cae7082de052..929371c4b0f5 100644 --- a/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_deletes_a_user.js +++ b/sdk/communication/communication-identity/recordings/node/communicationidentityclient_playbacklive/recording_successfully_deletes_a_user.js @@ -1,11 +1,11 @@ -let nock = require('nock'); +let nock = require("nock"); module.exports.hash = "5f3b4220446ac81ca7796c4e29d977c5"; -module.exports.testInfo = {"uniqueName":{},"newDate":{}} +module.exports.testInfo = { uniqueName: {}, newDate: {} }; -nock('https://endpoint', {"encodedQueryParams":false}) - .delete('/identities/sanitized') +nock("https://endpoint", { encodedQueryParams: true }) + .delete("/identities/sanitized") .query(true) .reply(204, "", [ "MS-CV", diff --git a/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.js b/sdk/communication/communication-identity/recordings/node/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.js similarity index 90% rename from sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.js rename to sdk/communication/communication-identity/recordings/node/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.js index 02683485321d..4595ccf7bc5b 100644 --- a/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.js +++ b/sdk/communication/communication-identity/recordings/node/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.js @@ -1,8 +1,8 @@ -let nock = require('nock'); +let nock = require("nock"); module.exports.hash = "4a6aa78ff3e608a0c86d94e8211ad5bc"; -module.exports.testInfo = {"uniqueName":{},"newDate":{}} +module.exports.testInfo = { uniqueName: {}, newDate: {} }; nock("https://endpoint", { encodedQueryParams: true }) .post("/identities/sanitized/:issueAccessToken", { scopes: ["chat", "voip"] }) diff --git a/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.js b/sdk/communication/communication-identity/recordings/node/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.js similarity index 90% rename from sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.js rename to sdk/communication/communication-identity/recordings/node/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.js index ecf0f55d89fd..78ced62d2907 100644 --- a/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.js +++ b/sdk/communication/communication-identity/recordings/node/communicationidentityclient_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.js @@ -1,8 +1,8 @@ -let nock = require('nock'); +let nock = require("nock"); module.exports.hash = "c6f3ddd7c26e3db3fdb740807d8806c6"; -module.exports.testInfo = {"uniqueName":{},"newDate":{}} +module.exports.testInfo = { uniqueName: {}, newDate: {} }; nock("https://endpoint", { encodedQueryParams: true }) .post("/identities/sanitized/:issueAccessToken", { scopes: ["chat"] }) diff --git a/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_revokes_tokens_issued_for_a_user.js b/sdk/communication/communication-identity/recordings/node/communicationidentityclient_playbacklive/recording_successfully_revokes_tokens_issued_for_a_user.js similarity index 87% rename from sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_revokes_tokens_issued_for_a_user.js rename to sdk/communication/communication-identity/recordings/node/communicationidentityclient_playbacklive/recording_successfully_revokes_tokens_issued_for_a_user.js index 8058630df851..e2565eae8852 100644 --- a/sdk/communication/communication-administration/recordings/node/communicationidentityclient_playbacklive/recording_successfully_revokes_tokens_issued_for_a_user.js +++ b/sdk/communication/communication-identity/recordings/node/communicationidentityclient_playbacklive/recording_successfully_revokes_tokens_issued_for_a_user.js @@ -1,8 +1,8 @@ -let nock = require('nock'); +let nock = require("nock"); module.exports.hash = "91da5c774930c99e1394770f0f7c5842"; -module.exports.testInfo = {"uniqueName":{},"newDate":{}} +module.exports.testInfo = { uniqueName: {}, newDate: {} }; nock("https://endpoint", { encodedQueryParams: true }) .post("/identities/sanitized/:revokeAccessTokens") diff --git a/sdk/communication/communication-identity/recordings/node/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.js b/sdk/communication/communication-identity/recordings/node/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.js new file mode 100644 index 000000000000..d3acf733a0b3 --- /dev/null +++ b/sdk/communication/communication-identity/recordings/node/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_multiple_scopes.js @@ -0,0 +1,99 @@ +let nock = require("nock"); + +module.exports.hash = "95d4fe335e315e75dac78e9070647d6a"; + +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=SomeClientSecret&scope=https%3A%2F%2Fcommunication.azure.com%2F%2F.default" + ) + .reply( + 200, + { + token_type: "Bearer", + expires_in: 86399, + ext_expires_in: 86399, + access_token: + "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyIsImtpZCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyJ9.eyJhdWQiOiJodHRwczovL2NvbW11bmljYXRpb24uYXp1cmUuY29tLyIsImlzcyI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0LzcyZjk4OGJmLTg2ZjEtNDFhZi05MWFiLTJkN2NkMDExZGI0Ny8iLCJpYXQiOjE2MTEyNjIzNjUsIm5iZiI6MTYxMTI2MjM2NSwiZXhwIjoxNjExMzQ5MDY1LCJhaW8iOiJFMkpnWUZpNmFPN2Z3ek1jYTM2dHVDUEJYVkVpRFFBPSIsImFwcGlkIjoiNmM4MTgxYzctOTFhNi00ZTJlLTg0ODAtZDU0MDIxYWM0YzRiIiwiYXBwaWRhY3IiOiIxIiwiaWRwIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvNzJmOTg4YmYtODZmMS00MWFmLTkxYWItMmQ3Y2QwMTFkYjQ3LyIsIm9pZCI6IjNlMGM3MTRmLTk3YWMtNGQ2My1hZWFmLTE0YmFhNWUwNjRjYiIsInJoIjoiMC5BUm9BdjRqNWN2R0dyMEdScXkxODBCSGJSOGVCZ1d5bWtTNU9oSURWUUNHc1RFc2FBQUEuIiwic3ViIjoiM2UwYzcxNGYtOTdhYy00ZDYzLWFlYWYtMTRiYWE1ZTA2NGNiIiwidGlkIjoiNzJmOTg4YmYtODZmMS00MWFmLTkxYWItMmQ3Y2QwMTFkYjQ3IiwidXRpIjoiRFVLSWpaQjl5RWV4d1hkTTNZaDVBQSIsInZlciI6IjEuMCJ9.JFGFdPsTMELbqaBARXr3rjOTRbLxZYqNBp2wsp4mBPXFf8O5ufzrsyVpeWEiHH0iJovO9WmzTw7sRPpi13pDdwNKmhzvBP6E8xj97xqP1qZomCkrkcA2AtaljTrQNAFHlmBMVKO1M991dIgohzj2q1P3hq7rMdrEzyliSGisEOS_ZwfsjsdM4H1dOj0SKpparzYjlxGGJmQXq2x7iaWtR8QjWALw89vLLFRcclU_g7GKyjaX4dKglw5ZrAXI0sL11h7p0mD7g8jrROVBHMNvcwTDKGhiLd_JE4x3lUZbTK28lY-iMy3WEAl8zit7LI-LgANxlsoUlJBBgtzhW9ZZ_g" + }, + [ + "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", + "sanitized", + "x-ms-ests-server", + "2.1.11419.13 - WUS2 ProdSlices", + "Set-Cookie", + "fpc=Als6EcbA-MhChtTVqw6cUoRWyo4SAgAAAMjhm9cOAAAA; expires=Sat, 20-Feb-2021 20:57:45 GMT; path=/; secure; HttpOnly; SameSite=None", + "Set-Cookie", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "Set-Cookie", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly", + "Date", + "Thu, 21 Jan 2021 20:57:44 GMT", + "Content-Length", + "1327" + ] + ); + +nock("https://endpoint", { encodedQueryParams: true }) + .post("/identities") + .query(true) + .reply(201, { identity: { id: "sanitized" } }, [ + "Transfer-Encoding", + "chunked", + "Content-Type", + "application/json; charset=utf-8", + "MS-CV", + "V4TLz8KrFEeylfMNcYQ+VA.0", + "Strict-Transport-Security", + "max-age=2592000", + "x-ms-client-request-id", + "sanitized", + "api-supported-versions", + "2020-07-20-preview2, 2021-03-07", + "X-Processing-Time", + "168ms", + "X-Azure-Ref", + "0yeoJYAAAAACzSdMcCjsUSq72sh5fe2s2V1NURURHRTA4MjEAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "Date", + "Thu, 21 Jan 2021 20:57:45 GMT" + ]); + +nock("https://endpoint", { encodedQueryParams: true }) + .post("/identities/sanitized/:issueAccessToken", { scopes: ["chat", "voip"] }) + .query(true) + .reply(200, { token: "sanitized", expiresOn: "2021-01-22T20:57:44.6176611+00:00" }, [ + "Transfer-Encoding", + "chunked", + "Content-Type", + "application/json; charset=utf-8", + "MS-CV", + "gpfTcujLuUKCwZjdhAkYeQ.0", + "Strict-Transport-Security", + "max-age=2592000", + "x-ms-client-request-id", + "sanitized", + "api-supported-versions", + "2020-07-20-preview2, 2021-03-07", + "X-Processing-Time", + "27ms", + "X-Azure-Ref", + "0yeoJYAAAAAABE3T5bcgNTKrj+ZEgsWi3V1NURURHRTA4MjEAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "Date", + "Thu, 21 Jan 2021 20:57:45 GMT" + ]); diff --git a/sdk/communication/communication-identity/recordings/node/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.js b/sdk/communication/communication-identity/recordings/node/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.js new file mode 100644 index 000000000000..0ad89f060e7b --- /dev/null +++ b/sdk/communication/communication-identity/recordings/node/communicationidentityclientwithtoken_playbacklive/recording_successfully_issues_a_token_for_a_user_single_scope.js @@ -0,0 +1,99 @@ +let nock = require("nock"); + +module.exports.hash = "aedb306f8b207ace647b71fce293ba76"; + +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=SomeClientSecret&scope=https%3A%2F%2Fcommunication.azure.com%2F%2F.default" + ) + .reply( + 200, + { + token_type: "Bearer", + expires_in: 86399, + ext_expires_in: 86399, + access_token: + "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyIsImtpZCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyJ9.eyJhdWQiOiJodHRwczovL2NvbW11bmljYXRpb24uYXp1cmUuY29tLyIsImlzcyI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0LzcyZjk4OGJmLTg2ZjEtNDFhZi05MWFiLTJkN2NkMDExZGI0Ny8iLCJpYXQiOjE2MTEyNjIzNjQsIm5iZiI6MTYxMTI2MjM2NCwiZXhwIjoxNjExMzQ5MDY0LCJhaW8iOiJFMkpnWURnUWt1cG91TWorOHlXbjEwZFhSUDFZQ2dBPSIsImFwcGlkIjoiNmM4MTgxYzctOTFhNi00ZTJlLTg0ODAtZDU0MDIxYWM0YzRiIiwiYXBwaWRhY3IiOiIxIiwiaWRwIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvNzJmOTg4YmYtODZmMS00MWFmLTkxYWItMmQ3Y2QwMTFkYjQ3LyIsIm9pZCI6IjNlMGM3MTRmLTk3YWMtNGQ2My1hZWFmLTE0YmFhNWUwNjRjYiIsInJoIjoiMC5BUm9BdjRqNWN2R0dyMEdScXkxODBCSGJSOGVCZ1d5bWtTNU9oSURWUUNHc1RFc2FBQUEuIiwic3ViIjoiM2UwYzcxNGYtOTdhYy00ZDYzLWFlYWYtMTRiYWE1ZTA2NGNiIiwidGlkIjoiNzJmOTg4YmYtODZmMS00MWFmLTkxYWItMmQ3Y2QwMTFkYjQ3IiwidXRpIjoiTjBKZ1dWclpWa1diTnRVbHlHeEhBQSIsInZlciI6IjEuMCJ9.dhiqSaZCTqiMKehO-QcGLg0sx7KTI4U6fPvUsNT_z5T7L3dLyxbHkI4pAZDSX8iJ7jSdiR_400D0vaoGIqGiWl_quQRwv3hsrpu3aCmyjPgu_c6Nr5BZbmAAj7pGBUi20nkJOEFROBmWtfNja20SbvDs4-8psy6TiMYwDmTaEnCljACIN2zp88uH6JZ1atXLOVCGWBdWcouqmGFWfy5bQKqG9K77Ff5MTj-NYU4dCM0mr2Shb34eOla0f_6FoxLGvJHCja1ZgYJYOvcjX0CSxnwBjh4PWe5wAqhDCfvruSu28WEycMsGyobvllxpBaNhSpKFCGWUCHBIKMQI5KHxVg" + }, + [ + "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", + "sanitized", + "x-ms-ests-server", + "2.1.11419.13 - SCUS ProdSlices", + "Set-Cookie", + "fpc=Als6EcbA-MhChtTVqw6cUoRWyo4SAQAAAMjhm9cOAAAA; expires=Sat, 20-Feb-2021 20:57:44 GMT; path=/; secure; HttpOnly; SameSite=None", + "Set-Cookie", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "Set-Cookie", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly", + "Date", + "Thu, 21 Jan 2021 20:57:44 GMT", + "Content-Length", + "1327" + ] + ); + +nock("https://endpoint", { encodedQueryParams: true }) + .post("/identities") + .query(true) + .reply(201, { identity: { id: "sanitized" } }, [ + "Transfer-Encoding", + "chunked", + "Content-Type", + "application/json; charset=utf-8", + "MS-CV", + "0es/Sq8wF0iEnxKIRQkv6w.0", + "Strict-Transport-Security", + "max-age=2592000", + "x-ms-client-request-id", + "sanitized", + "api-supported-versions", + "2020-07-20-preview2, 2021-03-07", + "X-Processing-Time", + "213ms", + "X-Azure-Ref", + "0yOoJYAAAAAATCHaXNXC4RJncsdzEr3NhV1NURURHRTA4MjEAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "Date", + "Thu, 21 Jan 2021 20:57:44 GMT" + ]); + +nock("https://endpoint", { encodedQueryParams: true }) + .post("/identities/sanitized/:issueAccessToken", { scopes: ["chat"] }) + .query(true) + .reply(200, { token: "sanitized", expiresOn: "2021-01-22T20:57:44.1854858+00:00" }, [ + "Transfer-Encoding", + "chunked", + "Content-Type", + "application/json; charset=utf-8", + "MS-CV", + "Q7lsVPlt20OUgp5kYqRlyQ.0", + "Strict-Transport-Security", + "max-age=2592000", + "x-ms-client-request-id", + "sanitized", + "api-supported-versions", + "2020-07-20-preview2, 2021-03-07", + "X-Processing-Time", + "279ms", + "X-Azure-Ref", + "0yOoJYAAAAABZA22O5iLWR52OkBmGLsOqV1NURURHRTA4MjEAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "Date", + "Thu, 21 Jan 2021 20:57:44 GMT" + ]); diff --git a/sdk/communication/communication-identity/review/communication-identity.api.md b/sdk/communication/communication-identity/review/communication-identity.api.md new file mode 100644 index 000000000000..fee180bb3c85 --- /dev/null +++ b/sdk/communication/communication-identity/review/communication-identity.api.md @@ -0,0 +1,64 @@ +## API Report File for "@azure/communication-identity" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { CommunicationUserIdentifier } from '@azure/communication-common'; +import { HttpResponse } from '@azure/core-http'; +import { KeyCredential } from '@azure/core-auth'; +import { OperationOptions } from '@azure/core-http'; +import { PipelineOptions } from '@azure/core-http'; +import { TokenCredential } from '@azure/core-auth'; + +// @public +export interface CommunicationIdentityAccessToken { + expiresOn: Date; + token: string; +} + +// @public +export class CommunicationIdentityClient { + constructor(connectionString: string, options?: CommunicationIdentityOptions); + constructor(url: string, credential: KeyCredential, options?: CommunicationIdentityOptions); + constructor(url: string, credential: TokenCredential, options?: CommunicationIdentityOptions); + createUser(options?: OperationOptions): Promise; + createUserWithToken(scopes: TokenScope[], options?: OperationOptions): Promise; + deleteUser(user: CommunicationUserIdentifier, options?: OperationOptions): Promise; + issueToken(user: CommunicationUserIdentifier, scopes: TokenScope[], options?: OperationOptions): Promise; + revokeTokens(user: CommunicationUserIdentifier, options?: OperationOptions): Promise; +} + +// @public +export interface CommunicationIdentityOptions extends PipelineOptions { +} + +// @public +export interface CommunicationUserToken extends CommunicationIdentityAccessToken { + user: CommunicationUserIdentifier; +} + +// @public +export type CreateUserResponse = WithResponse; + +// @public +export type CreateUserWithTokenResponse = WithResponse; + +// @public +export type IssueTokenResponse = WithResponse; + +// @public +export type TokenScope = "chat" | "voip"; + +// @public +export type VoidResponse = WithResponse<{}>; + +// @public +export type WithResponse = T & { + _response: HttpResponse; +}; + + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/communication/communication-identity/rollup.base.config.js b/sdk/communication/communication-identity/rollup.base.config.js new file mode 100644 index 000000000000..f46768edc6de --- /dev/null +++ b/sdk/communication/communication-identity/rollup.base.config.js @@ -0,0 +1,131 @@ +import path from "path"; +import nodeResolve from "@rollup/plugin-node-resolve"; +import multiEntry from "@rollup/plugin-multi-entry"; +import cjs from "@rollup/plugin-commonjs"; +import replace from "@rollup/plugin-replace"; +import { terser } from "rollup-plugin-terser"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import viz from "rollup-plugin-visualizer"; +import shim from "rollup-plugin-shim"; + +const pkg = require("./package.json"); +const depNames = Object.keys(pkg.dependencies); +const devDepNames = Object.keys(pkg.devDependencies); +const input = "dist-esm/src/index.js"; +const production = process.env.NODE_ENV === "production"; + +export function nodeConfig(test = false) { + const externalNodeBuiltins = ["events", "crypto"]; + const baseConfig = { + input: input, + external: depNames.concat(externalNodeBuiltins), + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [ + sourcemaps(), + replace({ + delimiters: ["", ""], + values: { + // replace dynamic checks with if (true) since this is for node only. + // Allows rollup's dead code elimination to be more aggressive. + "if (isNode)": "if (true)" + } + }), + nodeResolve({ preferBuiltins: true }), + cjs() + ] + }; + + if (test) { + // Entry points - test files under the `test` folder(common for both browser and node), node specific test files + baseConfig.input = ["dist-esm/test/*.spec.js", "dist-esm/test/node/*.spec.js"]; + baseConfig.plugins.unshift(multiEntry({ exports: false })); + + // different output file + baseConfig.output.file = "dist-test/index.node.js"; + + // mark assert as external + baseConfig.external.push("assert", ...devDepNames); + + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, rollup started respecting + // the "sideEffects" field in package.json. Since our package.json sets "sideEffects=false", this also + // applies to test code, which causes all tests to be removed by tree-shaking. + baseConfig.treeshake = false; + } else if (production) { + baseConfig.plugins.push(terser()); + } + + return baseConfig; +} + +export function browserConfig(test = false) { + const baseConfig = { + input: input, + external: ["crypto", "fs-extra"], + output: { + file: "dist-browser/azure-communication-identity.js", + format: "umd", + name: "Azure.Communication.Identity", + sourcemap: true, + globals: { "@azure/core-http": "Azure.Core.HTTP" } + }, + preserveSymlinks: false, + plugins: [ + sourcemaps(), + replace({ + delimiters: ["", ""], + values: { + // replace dynamic checks with if (false) since this is for + // browser only. Rollup's dead code elimination will remove + // any code guarded by if (isNode) { ... } + "if (isNode)": "if (false)" + } + }), + shim({ + constants: `export default {}`, + fs: `export default {}`, + os: `export default {}`, + dotenv: `export function config() { }`, + path: `export default {}` + }), + nodeResolve({ + mainFields: ["module", "browser"], + preferBuiltins: false + }), + cjs({ + namedExports: { + chai: ["assert"], + events: ["EventEmitter"], + "@opentelemetry/api": ["CanonicalCode", "SpanKind", "TraceFlags"] + } + }), + viz({ filename: "dist-browser/browser-stats.html", sourcemap: false }) + ] + }; + + if (test) { + // Entry points - test files under the `test` folder(common for both browser and node), browser specific test files + baseConfig.input = ["dist-esm/test/*.spec.js", "dist-esm/test/browser/*.spec.js"]; + baseConfig.plugins.unshift(multiEntry({ exports: false })); + baseConfig.output.file = "dist-test/index.browser.js"; + + baseConfig.onwarn = (warning) => { + if ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer.indexOf(path.normalize("node_modules/chai/lib") === 0) + ) { + // Chai contains circular references, but they are not fatal and can be ignored. + return; + } + + console.error(`(!) ${warning.message}`); + }; + + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, rollup started respecting + // the "sideEffects" field in package.json. Since our package.json sets "sideEffects=false", this also + // applies to test code, which causes all tests to be removed by tree-shaking. + baseConfig.treeshake = false; + } + + return baseConfig; +} diff --git a/sdk/communication/communication-identity/rollup.config.js b/sdk/communication/communication-identity/rollup.config.js new file mode 100644 index 000000000000..14652aa67ed8 --- /dev/null +++ b/sdk/communication/communication-identity/rollup.config.js @@ -0,0 +1,13 @@ +import * as base from "./rollup.base.config"; + +const inputs = []; + +if (!process.env.ONLY_BROWSER) { + inputs.push(base.nodeConfig()); +} + +if (!process.env.ONLY_NODE) { + inputs.push(base.browserConfig()); +} + +export default inputs; diff --git a/sdk/communication/communication-identity/rollup.test.config.js b/sdk/communication/communication-identity/rollup.test.config.js new file mode 100644 index 000000000000..925a4421a53e --- /dev/null +++ b/sdk/communication/communication-identity/rollup.test.config.js @@ -0,0 +1,3 @@ +import * as base from "./rollup.base.config"; + +export default [base.nodeConfig(true), base.browserConfig(true)]; diff --git a/sdk/communication/communication-identity/sample.env b/sdk/communication/communication-identity/sample.env new file mode 100644 index 000000000000..5d6b667d81f6 --- /dev/null +++ b/sdk/communication/communication-identity/sample.env @@ -0,0 +1,10 @@ +# Used in most samples. Retrieve these values from a Communication Services resource +# in the Azure Portal. +COMMUNICATION_CONNECTION_STRING="endpoint=;accessKey=" + +# Our tests assume that TEST_MODE is "playback" by default. You can +# change it to "record" to generate new recordings, or "live" to bypass the recorder entirely. +# TEST_MODE=playback + +# Uncomment to run reserve, purchase and release operations with real phone numbers. +# INCLUDE_PHONENUMBER_LIVE_TESTS=true diff --git a/sdk/communication/communication-identity/samples/.gitignore b/sdk/communication/communication-identity/samples/.gitignore new file mode 100644 index 000000000000..0c348f50aebf --- /dev/null +++ b/sdk/communication/communication-identity/samples/.gitignore @@ -0,0 +1 @@ +.npmrc \ No newline at end of file diff --git a/sdk/communication/communication-identity/samples/javascript/README.md b/sdk/communication/communication-identity/samples/javascript/README.md new file mode 100644 index 000000000000..3d8dc152534f --- /dev/null +++ b/sdk/communication/communication-identity/samples/javascript/README.md @@ -0,0 +1,64 @@ +--- +page_type: sample +languages: + - javascript +products: + - azure +urlFragment: communication-administration-identity-javascript +--- + +# Azure Communication Service Administration Identity client library sample for JavaScript + +These sample programs show how to use the JavaScript client libraries for Azure Communication Service Administration Identity to issue and refresh tokens. + +| **File Name** | **Description** | +| --------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| [issueToken.js][issuetoken] | uses the CommunicationIdentityClient to create a user and issue a token for this user | +| [revokeTokens.js][revoketokens] | uses the CommunicationIdentityClient to create a user, issue tokens for this user, and revoke these tokens | +| [purchasePhoneNumber.js][purchasephonenumber] | uses the PhoneNumberAdministrationClient to purchase a phone number | +| [releasePhoneNumbers.js][releasephonenumbers] | uses the PhoneNumberAdministrationClient to release phone numbers | + +## Prerequisites + +The sample is compatible with Node.js >= 8.0.0. + +You need [an Azure subscription][freesub] and [an Azure Communication Service Instance][azcomsvc] to run these sample program. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the sample using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node issueToken.js +``` + +Alternatively, run a single sample with the correct environment variables set (step 3 is not required if you do this), for example (cross-platform): + +```bash +npx cross-env COMMUNICATION_CONNECTION_STRING="" node issueToken.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[issuetoken]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/javascript/issueToken.js +[revoketokens]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/javascript/revokeTokens.js +[purchasephonenumber]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/javascript/purchasePhoneNumber.js +[releasephonenumbers]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/javascript/releasePhoneNumbers.js +[apiref]: https://docs.microsoft.com/javascript/api/@azure/communication-administration +[azcomsvc]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/README.md diff --git a/sdk/communication/communication-administration/samples/javascript/issueToken.js b/sdk/communication/communication-identity/samples/javascript/issueToken.js similarity index 98% rename from sdk/communication/communication-administration/samples/javascript/issueToken.js rename to sdk/communication/communication-identity/samples/javascript/issueToken.js index 8290106071e4..f3ac05688f8a 100644 --- a/sdk/communication/communication-administration/samples/javascript/issueToken.js +++ b/sdk/communication/communication-identity/samples/javascript/issueToken.js @@ -6,7 +6,7 @@ * issue a user token. */ -const { CommunicationIdentityClient } = require("@azure/communication-administration"); +const { CommunicationIdentityClient } = require("@azure/communication-identity"); // Load the .env file if it exists const dotenv = require("dotenv"); diff --git a/sdk/communication/communication-identity/samples/javascript/package.json b/sdk/communication/communication-identity/samples/javascript/package.json new file mode 100644 index 000000000000..cc15b6c32a8d --- /dev/null +++ b/sdk/communication/communication-identity/samples/javascript/package.json @@ -0,0 +1,29 @@ +{ + "name": "azure-communication-configuration-user-token-samples-js", + "version": "0.1.0", + "description": "Azure Communication Service User Token Management client library samples for JavaScript", + "engine": { + "node": ">=8.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git" + }, + "keywords": [ + "Azure", + "Communication", + "Node.js", + "JavaScript" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-identity", + "sideEffects": false, + "dependencies": { + "@azure/communication-identity": "latest", + "dotenv": "^8.2.0" + } +} diff --git a/sdk/communication/communication-administration/samples/javascript/revokeTokens.js b/sdk/communication/communication-identity/samples/javascript/revokeTokens.js similarity index 98% rename from sdk/communication/communication-administration/samples/javascript/revokeTokens.js rename to sdk/communication/communication-identity/samples/javascript/revokeTokens.js index dadeed652f3b..a93a8fccfa38 100644 --- a/sdk/communication/communication-administration/samples/javascript/revokeTokens.js +++ b/sdk/communication/communication-identity/samples/javascript/revokeTokens.js @@ -6,7 +6,7 @@ * revoke a user's tokens. */ -const { CommunicationIdentityClient } = require("@azure/communication-administration"); +const { CommunicationIdentityClient } = require("@azure/communication-identity"); // Load the .env file if it exists const dotenv = require("dotenv"); diff --git a/sdk/communication/communication-identity/samples/javascript/sample.env b/sdk/communication/communication-identity/samples/javascript/sample.env new file mode 100644 index 000000000000..87b7cca169c9 --- /dev/null +++ b/sdk/communication/communication-identity/samples/javascript/sample.env @@ -0,0 +1,3 @@ +# Used in most samples. Retrieve these values from a Communication Service instance +# in the Azure Portal. +COMMUNICATION_CONNECTION_STRING="endpoint=https://.communication.azure.net/;accessKey=" diff --git a/sdk/communication/communication-identity/samples/tsconfig.json b/sdk/communication/communication-identity/samples/tsconfig.json new file mode 100644 index 000000000000..8c89eac7173a --- /dev/null +++ b/sdk/communication/communication-identity/samples/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "outDir": "typescript/dist", + "lib": ["DOM", "ES6"] + }, + "include": ["typescript/src/**.ts"], + "exclude": ["typescript/*.json", "**/node_modules/", "../node_modules", "../typings"] +} diff --git a/sdk/communication/communication-identity/samples/typescript/README.md b/sdk/communication/communication-identity/samples/typescript/README.md new file mode 100644 index 000000000000..e4acfe67bc9a --- /dev/null +++ b/sdk/communication/communication-identity/samples/typescript/README.md @@ -0,0 +1,70 @@ +--- +page_type: sample +languages: + - typescript +products: + - azure +urlFragment: communication-administration-identity-typescript +--- + +# Azure Communication Service Communication Identity client library sample for TypeScript + +These sample programs show how to use the TypeScript client libraries for Azure Communication Service Communication Identity to issue and refresh tokens. + +| **File Name** | **Description** | +| --------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| [issueToken.ts][issuetoken] | uses the CommunicationIdentityClient to create a user and issue a token for this user | +| [revokeTokens.ts][revoketokens] | uses the CommunicationIdentityClient to create a user, issue tokens for this user, and revoke these tokens | +| [purchasePhoneNumber.ts][purchasephonenumber] | uses the PhoneNumberAdministrationClient to purchase a phone number | +| [releasePhoneNumbers.ts][releasephonenumbers] | uses the PhoneNumberAdministrationClient to release phone numbers. | + +## Prerequisites + +The sample is compatible with Node.js >= 8.0.0. + +You need [an Azure subscription][freesub] and [an Azure Communication Service Instance][azcomsvc] to run these sample program. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the sample using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the sample + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/issueToken.js +``` + +Alternatively, run a single sample with the correct environment variables set (step 3 is not required if you do this), for example (cross-platform): + +```bash +npx cross-env COMMUNICATION_CONNECTION_STRING="" node dist/issueToken.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[issuetoken]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/typescript/src/issueToken.ts +[revoketokens]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/typescript/src/revokeTokens.ts +[purchasephonenumber]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/typescript/src/purchasePhoneNumber.ts +[releasephonenumbers]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/typescript/src/releasePhoneNumbers.ts +[apiref]: https://docs.microsoft.com/javascript/api/@azure/communication-administration +[azcomsvc]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/README.md diff --git a/sdk/communication/communication-identity/samples/typescript/package.json b/sdk/communication/communication-identity/samples/typescript/package.json new file mode 100644 index 000000000000..486b52feeb3e --- /dev/null +++ b/sdk/communication/communication-identity/samples/typescript/package.json @@ -0,0 +1,38 @@ +{ + "name": "azure-communication-configuration-user-token-samples-ts", + "version": "0.1.0", + "description": "Azure Communication Service User Token Management client library samples for TypeScript", + "engine": { + "node": ">=8.0.0" + }, + "scripts": { + "build": "tsc", + "prebuild": "rimraf dist/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git" + }, + "keywords": [ + "Azure", + "Communication", + "Node.js", + "JavaScript" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-identity", + "sideEffects": false, + "dependencies": { + "@azure/communication-identity": "latest", + "dotenv": "^8.2.0" + }, + "devDependencies": { + "@types/node": "^8.0.0", + "rimraf": "^3.0.0", + "typescript": "~3.6.4" + } +} diff --git a/sdk/communication/communication-identity/samples/typescript/sample.env b/sdk/communication/communication-identity/samples/typescript/sample.env new file mode 100644 index 000000000000..87b7cca169c9 --- /dev/null +++ b/sdk/communication/communication-identity/samples/typescript/sample.env @@ -0,0 +1,3 @@ +# Used in most samples. Retrieve these values from a Communication Service instance +# in the Azure Portal. +COMMUNICATION_CONNECTION_STRING="endpoint=https://.communication.azure.net/;accessKey=" diff --git a/sdk/communication/communication-administration/samples/typescript/src/issueToken.ts b/sdk/communication/communication-identity/samples/typescript/src/issueToken.ts similarity index 97% rename from sdk/communication/communication-administration/samples/typescript/src/issueToken.ts rename to sdk/communication/communication-identity/samples/typescript/src/issueToken.ts index 6451cec41af8..74ac7dc5d7fe 100644 --- a/sdk/communication/communication-administration/samples/typescript/src/issueToken.ts +++ b/sdk/communication/communication-identity/samples/typescript/src/issueToken.ts @@ -6,7 +6,7 @@ * issue a new user token. */ -import { CommunicationIdentityClient, TokenScope } from "@azure/communication-administration"; +import { CommunicationIdentityClient, TokenScope } from "@azure/communication-identity"; // Load the .env file if it exists import * as dotenv from "dotenv"; diff --git a/sdk/communication/communication-administration/samples/typescript/src/revokeTokens.ts b/sdk/communication/communication-identity/samples/typescript/src/revokeTokens.ts similarity index 100% rename from sdk/communication/communication-administration/samples/typescript/src/revokeTokens.ts rename to sdk/communication/communication-identity/samples/typescript/src/revokeTokens.ts diff --git a/sdk/communication/communication-identity/samples/typescript/tsconfig.json b/sdk/communication/communication-identity/samples/typescript/tsconfig.json new file mode 100644 index 000000000000..9e7ca6c9974b --- /dev/null +++ b/sdk/communication/communication-identity/samples/typescript/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "module": "commonjs", + "moduleResolution": "node", + "allowSyntheticDefaultImports": true, + "strict": true, + "alwaysStrict": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src/**.ts"], + "exclude": ["node_modules"] +} diff --git a/sdk/communication/communication-identity/src/common/logger.ts b/sdk/communication/communication-identity/src/common/logger.ts new file mode 100644 index 000000000000..cd9e59d4b79f --- /dev/null +++ b/sdk/communication/communication-identity/src/common/logger.ts @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { createClientLogger } from "@azure/logger"; + +/** + * The @azure/logger configuration for this package. + */ +export const logger = createClientLogger("communication-identity"); diff --git a/sdk/communication/communication-identity/src/common/mappers.ts b/sdk/communication/communication-identity/src/common/mappers.ts new file mode 100644 index 000000000000..52c5be668df3 --- /dev/null +++ b/sdk/communication/communication-identity/src/common/mappers.ts @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { HttpOperationResponse, HttpResponse } from "@azure/core-http"; +import { WithResponse } from ".."; + +/** + * Attach http response to a model + */ +export const attachHttpResponse = ( + model: T, + httpResponse: (HttpResponse & { bodyAsText: string; parsedBody: any }) | HttpOperationResponse +): WithResponse => { + const { parsedBody, bodyAsText, ...r } = httpResponse; + return Object.defineProperty(model, "_response", { + value: r + }); +}; diff --git a/sdk/communication/communication-identity/src/common/models.ts b/sdk/communication/communication-identity/src/common/models.ts new file mode 100644 index 000000000000..539ef1bc6083 --- /dev/null +++ b/sdk/communication/communication-identity/src/common/models.ts @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { HttpResponse } from "@azure/core-http"; + +/** + * Represents an object with a non-enumerable _response property which provides + * information about the HTTP response. + */ +export type WithResponse = T & { _response: HttpResponse }; + +/** + * Represents a generic HTTP response + */ +export type VoidResponse = WithResponse<{}>; diff --git a/sdk/communication/communication-identity/src/common/tracing.ts b/sdk/communication/communication-identity/src/common/tracing.ts new file mode 100644 index 000000000000..bd42a3471fb5 --- /dev/null +++ b/sdk/communication/communication-identity/src/common/tracing.ts @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { OperationOptions } from "@azure/core-http"; +import { getTracer } from "@azure/core-tracing"; +import { Span, SpanOptions, SpanKind } from "@opentelemetry/api"; + +type OperationTracingOptions = OperationOptions["tracingOptions"]; + +/** + * Creates a span using the global tracer. + * @ignore + * @param name The name of the operation being performed. + * @param tracingOptions The options for the underlying http request. + */ +export function createSpan( + operationName: string, + operationOptions: T +): { span: Span; updatedOptions: T } { + const tracer = getTracer(); + const tracingOptions = operationOptions.tracingOptions || {}; + const spanOptions: SpanOptions = { + ...tracingOptions.spanOptions, + kind: SpanKind.INTERNAL + }; + + const span = tracer.startSpan(`Azure.Communication.${operationName}`, spanOptions); + + span.setAttribute("az.namespace", "Microsoft.Communication"); + + let newSpanOptions = tracingOptions.spanOptions || {}; + if (span.isRecording()) { + newSpanOptions = { + ...tracingOptions.spanOptions, + parent: span.context(), + attributes: { + ...spanOptions.attributes, + "az.namespace": "Microsoft.Communication" + } + }; + } + + const newTracingOptions: OperationTracingOptions = { + ...tracingOptions, + spanOptions: newSpanOptions + }; + + const newOperationOptions: T = { + ...operationOptions, + tracingOptions: newTracingOptions + }; + + return { + span, + updatedOptions: newOperationOptions + }; +} diff --git a/sdk/communication/communication-administration/src/communicationIdentity/communicationIdentityClient.ts b/sdk/communication/communication-identity/src/communicationIdentityClient.ts similarity index 97% rename from sdk/communication/communication-administration/src/communicationIdentity/communicationIdentityClient.ts rename to sdk/communication/communication-identity/src/communicationIdentityClient.ts index 6ad7c294d8ab..2d8aa0981cbc 100644 --- a/sdk/communication/communication-administration/src/communicationIdentity/communicationIdentityClient.ts +++ b/sdk/communication/communication-identity/src/communicationIdentityClient.ts @@ -17,8 +17,8 @@ import { import { CanonicalCode } from "@opentelemetry/api"; import { CommunicationIdentity, IdentityRestClient } from "./generated/src/identityRestClient"; import { SDK_VERSION } from "./constants"; -import { logger } from "../common/logger"; -import { createSpan } from "../common/tracing"; +import { logger } from "./common/logger"; +import { createSpan } from "./common/tracing"; import { CommunicationIdentityOptions, TokenScope, @@ -27,8 +27,8 @@ import { CommunicationUserToken, CreateUserWithTokenResponse } from "./models"; -import { VoidResponse } from "../common/models"; -import { attachHttpResponse } from "../common/mappers"; +import { VoidResponse } from "./common/models"; +import { attachHttpResponse } from "./common/mappers"; const isCommunicationIdentityOptions = (options: any): options is CommunicationIdentityOptions => options && !isTokenCredential(options) && !isKeyCredential(options); diff --git a/sdk/communication/communication-administration/src/communicationIdentity/constants.ts b/sdk/communication/communication-identity/src/constants.ts similarity index 100% rename from sdk/communication/communication-administration/src/communicationIdentity/constants.ts rename to sdk/communication/communication-identity/src/constants.ts diff --git a/sdk/communication/communication-administration/src/communicationIdentity/generated/src/identityRestClient.ts b/sdk/communication/communication-identity/src/generated/src/identityRestClient.ts similarity index 100% rename from sdk/communication/communication-administration/src/communicationIdentity/generated/src/identityRestClient.ts rename to sdk/communication/communication-identity/src/generated/src/identityRestClient.ts diff --git a/sdk/communication/communication-administration/src/communicationIdentity/generated/src/identityRestClientContext.ts b/sdk/communication/communication-identity/src/generated/src/identityRestClientContext.ts similarity index 100% rename from sdk/communication/communication-administration/src/communicationIdentity/generated/src/identityRestClientContext.ts rename to sdk/communication/communication-identity/src/generated/src/identityRestClientContext.ts diff --git a/sdk/communication/communication-administration/src/communicationIdentity/generated/src/models/index.ts b/sdk/communication/communication-identity/src/generated/src/models/index.ts similarity index 100% rename from sdk/communication/communication-administration/src/communicationIdentity/generated/src/models/index.ts rename to sdk/communication/communication-identity/src/generated/src/models/index.ts diff --git a/sdk/communication/communication-administration/src/communicationIdentity/generated/src/models/mappers.ts b/sdk/communication/communication-identity/src/generated/src/models/mappers.ts similarity index 100% rename from sdk/communication/communication-administration/src/communicationIdentity/generated/src/models/mappers.ts rename to sdk/communication/communication-identity/src/generated/src/models/mappers.ts diff --git a/sdk/communication/communication-administration/src/communicationIdentity/generated/src/models/parameters.ts b/sdk/communication/communication-identity/src/generated/src/models/parameters.ts similarity index 100% rename from sdk/communication/communication-administration/src/communicationIdentity/generated/src/models/parameters.ts rename to sdk/communication/communication-identity/src/generated/src/models/parameters.ts diff --git a/sdk/communication/communication-administration/src/communicationIdentity/generated/src/operations/communicationIdentity.ts b/sdk/communication/communication-identity/src/generated/src/operations/communicationIdentity.ts similarity index 100% rename from sdk/communication/communication-administration/src/communicationIdentity/generated/src/operations/communicationIdentity.ts rename to sdk/communication/communication-identity/src/generated/src/operations/communicationIdentity.ts diff --git a/sdk/communication/communication-administration/src/communicationIdentity/generated/src/operations/index.ts b/sdk/communication/communication-identity/src/generated/src/operations/index.ts similarity index 100% rename from sdk/communication/communication-administration/src/communicationIdentity/generated/src/operations/index.ts rename to sdk/communication/communication-identity/src/generated/src/operations/index.ts diff --git a/sdk/communication/communication-identity/src/index.ts b/sdk/communication/communication-identity/src/index.ts new file mode 100644 index 000000000000..a452b611ad29 --- /dev/null +++ b/sdk/communication/communication-identity/src/index.ts @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +export * from "./common/models"; +export * from "./communicationIdentityClient"; +export * from "./models"; diff --git a/sdk/communication/communication-administration/src/communicationIdentity/models.ts b/sdk/communication/communication-identity/src/models.ts similarity index 96% rename from sdk/communication/communication-administration/src/communicationIdentity/models.ts rename to sdk/communication/communication-identity/src/models.ts index 1324a046feb3..868b7150ce6d 100644 --- a/sdk/communication/communication-administration/src/communicationIdentity/models.ts +++ b/sdk/communication/communication-identity/src/models.ts @@ -4,7 +4,7 @@ import { PipelineOptions } from "@azure/core-http"; import { CommunicationUserIdentifier } from "@azure/communication-common"; import { CommunicationIdentityAccessToken } from "./generated/src/models"; -import { WithResponse } from "../common/models"; +import { WithResponse } from "./common/models"; /** * Represents the scope of the token. diff --git a/sdk/communication/communication-administration/swagger/CommunicationIdentity.md b/sdk/communication/communication-identity/swagger/swagger.md similarity index 93% rename from sdk/communication/communication-administration/swagger/CommunicationIdentity.md rename to sdk/communication/communication-identity/swagger/swagger.md index 3782ce5bb8b4..fecdc0c731e5 100644 --- a/sdk/communication/communication-administration/swagger/CommunicationIdentity.md +++ b/sdk/communication/communication-identity/swagger/swagger.md @@ -11,7 +11,7 @@ description: Communication identity client package-version: 1.0.0-beta.4 generate-metadata: false license-header: MICROSOFT_MIT_NO_VERSION -output-folder: ../src/communicationIdentity/generated +output-folder: ../src/generated input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/14bfbf5d0ff8f0dc1358e6e60362e99d0a649ba7/specification/communication/data-plane/Microsoft.CommunicationServicesIdentity/stable/2021-03-07/CommunicationIdentity.json model-date-time-as-string: false optional-response-headers: true diff --git a/sdk/communication/communication-identity/test/README.md b/sdk/communication/communication-identity/test/README.md new file mode 100644 index 000000000000..219d112a3086 --- /dev/null +++ b/sdk/communication/communication-identity/test/README.md @@ -0,0 +1,19 @@ +# Testing + +To test this project, make sure to build it by following our [building instructions](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md#building), then follow the [testing instructions](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md#testing). + +You can use existing Azure resources for the live tests, or generate new ones by using our [New-TestResources.ps1](https://github.com/Azure/azure-sdk-for-js/blob/master/eng/common/TestResources/New-TestResources.ps1) script, which will use an [ARM template](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/textanalytics/test-resources.json) that already has all of the the necessary configurations. + +The Azure resource that is used by the tests in this project is: + +- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal] or [Azure CLI][azure_cli]. + +To run the live tests, you will need to set the below environment variables: + +- `TEST_MODE`: Should have `live` assigned if you want to run live without recording. Assign `record` to run live with recording. +- `COMMUNICATION_CONNECTION_STRING`: The primary connection string of the Communication Services resource in your account. + +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png) diff --git a/sdk/communication/communication-administration/test/communicationIdentityClient.mocked.spec.ts b/sdk/communication/communication-identity/test/communicationIdentityClient.mocked.spec.ts similarity index 100% rename from sdk/communication/communication-administration/test/communicationIdentityClient.mocked.spec.ts rename to sdk/communication/communication-identity/test/communicationIdentityClient.mocked.spec.ts diff --git a/sdk/communication/communication-administration/test/communicationIdentityClient.spec.ts b/sdk/communication/communication-identity/test/communicationIdentityClient.spec.ts similarity index 100% rename from sdk/communication/communication-administration/test/communicationIdentityClient.spec.ts rename to sdk/communication/communication-identity/test/communicationIdentityClient.spec.ts diff --git a/sdk/communication/communication-administration/test/communicationIdentityClientWithToken.spec.ts b/sdk/communication/communication-identity/test/communicationIdentityClientWithToken.spec.ts similarity index 100% rename from sdk/communication/communication-administration/test/communicationIdentityClientWithToken.spec.ts rename to sdk/communication/communication-identity/test/communicationIdentityClientWithToken.spec.ts diff --git a/sdk/communication/communication-identity/test/utils/mockHttpClients.ts b/sdk/communication/communication-identity/test/utils/mockHttpClients.ts new file mode 100644 index 000000000000..d103ab1365e6 --- /dev/null +++ b/sdk/communication/communication-identity/test/utils/mockHttpClients.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { HttpClient, WebResourceLike, HttpOperationResponse, HttpHeaders } from "@azure/core-http"; +import { CommunicationIdentityAccessToken } from "../../src"; +import { CommunicationIdentityAccessTokenResult } from "../../src/generated/src/models"; + +export const createMockHttpClient = (status: number = 200, parsedBody?: T): HttpClient => { + return { + async sendRequest(httpRequest: WebResourceLike): Promise { + return { + status, + headers: new HttpHeaders(), + request: httpRequest, + parsedBody + }; + } + }; +}; + +export const baseHttpClient: HttpClient = createMockHttpClient(); + +export const base202HttpClient: HttpClient = createMockHttpClient(202); + +const tokenResponse = { + id: "identity", + token: "token", + expiresOn: new Date("2011/11/30") +}; + +export const issueTokenHttpClient: HttpClient = createMockHttpClient< + CommunicationIdentityAccessToken +>(200, tokenResponse); +export const revokeTokensHttpClient: HttpClient = createMockHttpClient(204); + +export const createUserHttpClient: HttpClient = createMockHttpClient< + CommunicationIdentityAccessTokenResult +>(201, { + identity: { id: "identity" } +}); diff --git a/sdk/communication/communication-identity/test/utils/recordedClient.ts b/sdk/communication/communication-identity/test/utils/recordedClient.ts new file mode 100644 index 000000000000..7e7f5a8b57f9 --- /dev/null +++ b/sdk/communication/communication-identity/test/utils/recordedClient.ts @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { Context } from "mocha"; +import * as dotenv from "dotenv"; + +import { + env, + Recorder, + record, + RecorderEnvironmentSetup, + isPlaybackMode +} from "@azure/test-utils-recorder"; +import { isNode, TokenCredential } from "@azure/core-http"; +import { CommunicationIdentityClient } from "../../src"; +import { DefaultAzureCredential } from "@azure/identity"; +import { parseConnectionString } from "@azure/communication-common"; + +if (isNode) { + dotenv.config(); +} + +export interface RecordedClient { + client: T; + recorder: Recorder; +} + +const replaceableVariables: { [k: string]: string } = { + COMMUNICATION_CONNECTION_STRING: "endpoint=https://endpoint/;accesskey=banana", + INCLUDE_PHONENUMBER_LIVE_TESTS: "false", + COMMUNICATION_ENDPOINT: "https://endpoint/", + AZURE_CLIENT_ID: "SomeClientId", + AZURE_CLIENT_SECRET: "SomeClientSecret", + AZURE_TENANT_ID: "SomeTenantId" +}; + +export const environmentSetup: RecorderEnvironmentSetup = { + replaceableVariables, + customizationsOnRecordings: [ + (recording: string): string => + recording.replace(/"token"\s?:\s?"[^"]*"/g, `"token":"sanitized"`), + (recording: string): string => recording.replace(/(https:\/\/)([^\/',]*)/, "$1endpoint"), + (recording: string): string => recording.replace(/"id"\s?:\s?"[^"]*"/g, `"id":"sanitized"`), + (recording: string): string => { + return recording.replace( + /(https:\/\/[^\/',]*\/identities\/)[^\/',]*(\/token)/, + "$1sanitized$2" + ); + }, + (recording: string): string => + recording.replace(/\/identities\/[^\/'",]*/, "/identities/sanitized"), + (recording: string): string => recording.replace(/\+\d{1}\d{3}\d{3}\d{4}/g, "+18005551234"), + (recording: string): string => + recording.replace(/[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}/gi, "sanitized") + ], + queryParametersToSkip: [] +}; + +export function createRecordedCommunicationIdentityClient( + context: Context +): RecordedClient { + const recorder = record(context, environmentSetup); + + return { + client: new CommunicationIdentityClient(env.COMMUNICATION_CONNECTION_STRING), + recorder + }; +} + +export function createRecordedCommunicationIdentityClientWithToken( + context: Context +): RecordedClient | undefined { + const recorder = record(context, environmentSetup); + let credential: TokenCredential; + const endpoint = parseConnectionString(env.COMMUNICATION_CONNECTION_STRING).endpoint; + if (isPlaybackMode()) { + credential = { + getToken: async (_scopes) => { + return { token: "testToken", expiresOnTimestamp: 11111 }; + } + }; + + return { + client: new CommunicationIdentityClient(endpoint, credential), + recorder + }; + } + + try { + credential = new DefaultAzureCredential(); + } catch { + return undefined; + } + + return { + client: new CommunicationIdentityClient(endpoint, credential), + recorder + }; +} diff --git a/sdk/communication/communication-administration/test/utils/testCommunicationIdentityClient.ts b/sdk/communication/communication-identity/test/utils/testCommunicationIdentityClient.ts similarity index 100% rename from sdk/communication/communication-administration/test/utils/testCommunicationIdentityClient.ts rename to sdk/communication/communication-identity/test/utils/testCommunicationIdentityClient.ts diff --git a/sdk/communication/communication-identity/tests.yml b/sdk/communication/communication-identity/tests.yml new file mode 100644 index 000000000000..57ddabd7b645 --- /dev/null +++ b/sdk/communication/communication-identity/tests.yml @@ -0,0 +1,11 @@ +trigger: none + +extends: + template: ../../../eng/pipelines/templates/jobs/archetype-sdk-integration.yml + parameters: + PackageName: "@azure/communication-identity" + ResourceServiceDirectory: communication + EnvVars: + AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) + AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) + AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) diff --git a/sdk/communication/communication-identity/tsconfig.json b/sdk/communication/communication-identity/tsconfig.json new file mode 100644 index 000000000000..01b339f5a963 --- /dev/null +++ b/sdk/communication/communication-identity/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "../../../tsconfig.package", + "compilerOptions": { + "outDir": "./dist-esm", + "declarationDir": "./types" + }, + "exclude": [ + "node_modules", + "types", + "temp", + "browser", + "dist", + "dist-esm", + "dist-samples", + "./samples/**/*.ts" + ] +} From 5bdc1d88b5d3a1c156466212221d1db561a7079d Mon Sep 17 00:00:00 2001 From: Dominik Messinger Date: Fri, 22 Jan 2021 17:56:28 -0800 Subject: [PATCH 2/6] updated pnpm-lock.yaml --- common/config/rush/pnpm-lock.yaml | 100 +++++++++++++++++++++++------- 1 file changed, 79 insertions(+), 21 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 9c46adf36800..6cb7dc4a204a 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -9,6 +9,7 @@ dependencies: '@rush-temp/communication-administration': file:projects/communication-administration.tgz '@rush-temp/communication-chat': file:projects/communication-chat.tgz '@rush-temp/communication-common': file:projects/communication-common.tgz + '@rush-temp/communication-identity': file:projects/communication-identity.tgz '@rush-temp/communication-sms': file:projects/communication-sms.tgz '@rush-temp/core-amqp': file:projects/core-amqp.tgz '@rush-temp/core-asynciterator-polyfill': file:projects/core-asynciterator-polyfill.tgz @@ -773,7 +774,7 @@ packages: /@types/body-parser/1.19.0: dependencies: '@types/connect': 3.4.34 - '@types/node': 8.10.66 + '@types/node': 10.17.51 dev: false resolution: integrity: sha512-W98JrE0j2K78swW4ukqMleo8R7h/pFETjM2DQ90MF6XK2i4LO4W3gQ71Lt4w3bfm2EvVSyWHplECvB5sK22yFQ== @@ -795,14 +796,14 @@ packages: integrity: sha512-G+ITQPXkwTrslfG5L/BksmbLUA0M1iybEsmCWPqzSxsRRhJZimBKJkoMi8fr/CPygPTj4zO5pJH7I2/cm9M7SQ== /@types/chalk/2.2.0: dependencies: - chalk: 3.0.0 + chalk: 4.1.0 deprecated: This is a stub types definition for chalk (https://github.com/chalk/chalk). chalk provides its own type definitions, so you don't need @types/chalk installed! dev: false resolution: integrity: sha512-1zzPV9FDe1I/WHhRkf9SNgqtRJWZqrBWgu7JGveuHmmyR9CnAPCie2N/x+iHrgnpYBIcCJWHBoMRv2TRWktsvw== /@types/connect/3.4.34: dependencies: - '@types/node': 8.10.66 + '@types/node': 10.17.51 dev: false resolution: integrity: sha512-ePPA/JuI+X0vb+gSWlPKOY0NdNAie/rPUqX2GUPpbZwiKTkSPhjXWuee47E4MtE54QVzGCQMQkAL6JhV2E1+cQ== @@ -827,7 +828,7 @@ packages: integrity: sha512-laIjwTQaD+5DukBZaygQ79K1Z0jb1bPEMRrkXSLjtCcZm+abyp5YbrqpSLzD42FwWW6gK/aS4NYpJ804nG2brg== /@types/express-serve-static-core/4.17.18: dependencies: - '@types/node': 8.10.66 + '@types/node': 10.17.51 '@types/qs': 6.9.5 '@types/range-parser': 1.2.3 dev: false @@ -848,20 +849,20 @@ packages: integrity: sha512-mky/O83TXmGY39P1H9YbUpjV6l6voRYlufqfFCvel8l1phuy8HRjdWc1rrPuN53ITBJlbyMSV6z3niOySO5pgQ== /@types/fs-extra/8.1.1: dependencies: - '@types/node': 8.10.66 + '@types/node': 10.17.51 dev: false resolution: integrity: sha512-TcUlBem321DFQzBNuz8p0CLLKp0VvF/XH9E4KHNmgwyp4E3AfgI5cjiIVZWlbfThBop2qxFIh4+LeY6hVWWZ2w== /@types/glob/7.1.3: dependencies: '@types/minimatch': 3.0.3 - '@types/node': 8.10.66 + '@types/node': 10.17.51 dev: false resolution: integrity: sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w== /@types/is-buffer/2.0.0: dependencies: - '@types/node': 8.10.66 + '@types/node': 10.17.51 dev: false resolution: integrity: sha512-0f7N/e3BAz32qDYvgB4d2cqv1DqUwvGxHkXsrucICn8la1Vb6Yl6Eg8mPScGwUiqHJeE7diXlzaK+QMA9m4Gxw== @@ -875,7 +876,7 @@ packages: integrity: sha512-Od34HkZR4DAaNpl6/fGEFVMQ5gWlwfwsbEeBjVDMMh9zlQD7hDwVEs0oUQDiVSfHImb0tlJVgfVGkp1jL9zOkg== /@types/jws/3.2.3: dependencies: - '@types/node': 8.10.66 + '@types/node': 10.17.51 dev: false resolution: integrity: sha512-g54CHxwvaHvyJyeuZqe7VQujV9SfCXwEkboJp355INPL+kjlS3Aq153EHptaeO/Cch/NPJ1i2sHz0sDDizn7LQ== @@ -889,7 +890,7 @@ packages: integrity: sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w== /@types/md5/2.2.1: dependencies: - '@types/node': 8.10.66 + '@types/node': 10.17.51 dev: false resolution: integrity: sha512-bZB0jqBL7JETFqvRKyuDETFceFaVcLm2MBPP5LFEEL/SZuqLnyvzF37tXmMERDncC3oeEj/fOUw88ftJeMpZaw== @@ -911,13 +912,13 @@ packages: integrity: sha512-ZvO2tAcjmMi8V/5Z3JsyofMe3hasRcaw88cto5etSVMwVQfeivGAlEYmaQgceUSVYFofVjT+ioHsATjdWcFt1w== /@types/mock-fs/4.10.0: dependencies: - '@types/node': 8.10.66 + '@types/node': 10.17.51 dev: false resolution: integrity: sha512-FQ5alSzmHMmliqcL36JqIA4Yyn9jyJKvRSGV3mvPh108VFatX7naJDzSG4fnFQNZFq9dIx0Dzoe6ddflMB2Xkg== /@types/mock-require/2.0.0: dependencies: - '@types/node': 8.10.66 + '@types/node': 10.17.51 dev: false resolution: integrity: sha512-nOgjoE5bBiDeiA+z41i95makyHUSMWQMOPocP+J67Pqx/68HAXaeWN1NFtrAYYV6LrISIZZ8vKHm/a50k0f6Sg== @@ -927,7 +928,7 @@ packages: integrity: sha512-DPxmjiDwubsNmguG5X4fEJ+XCyzWM3GXWsqQlvUcjJKa91IOoJUy51meDr0GkzK64qqNcq85ymLlyjoct9tInw== /@types/node-fetch/2.5.8: dependencies: - '@types/node': 8.10.66 + '@types/node': 10.17.51 form-data: 3.0.0 dev: false resolution: @@ -966,7 +967,7 @@ packages: integrity: sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA== /@types/resolve/1.17.1: dependencies: - '@types/node': 8.10.66 + '@types/node': 10.17.51 dev: false resolution: integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw== @@ -977,7 +978,7 @@ packages: /@types/serve-static/1.13.9: dependencies: '@types/mime': 1.3.2 - '@types/node': 8.10.66 + '@types/node': 10.17.51 dev: false resolution: integrity: sha512-ZFqF6qa48XsPdjXV5Gsz0Zqmux2PerNd3a/ktL45mHpa19cuMi/cL8tcxdAx497yRh+QtYPuofjT9oWw9P7nkA== @@ -997,13 +998,13 @@ packages: integrity: sha512-I99sngh224D0M7XgW1s120zxCt3VYQ3IQsuw3P3jbq5GG4yc79+ZjyKznyOGIQrflfylLgcfekeZW/vk0yng6A== /@types/tunnel/0.0.0: dependencies: - '@types/node': 8.10.66 + '@types/node': 10.17.51 dev: false resolution: integrity: sha512-FGDp0iBRiBdPjOgjJmn1NH0KDLN+Z8fRmo+9J7XGBhubq1DPrGrbmG4UTlGzrpbCpesMqD0sWkzi27EYkOMHyg== /@types/tunnel/0.0.1: dependencies: - '@types/node': 8.10.66 + '@types/node': 10.17.51 dev: false resolution: integrity: sha512-AOqu6bQu5MSWwYvehMXLukFHnupHrpZ8nvgae5Ggie9UwzDR1CCwoXgSSWNZJuyOlCdfdsWMA5F2LlmvyoTv8A== @@ -1017,13 +1018,13 @@ packages: integrity: sha512-eQ9qFW/fhfGJF8WKHGEHZEyVWfZxrT+6CLIJGBcZPfxUh/+BnEj+UCGYMlr9qZuX/2AltsvwrGqp0LhEW8D0zQ== /@types/ws/7.4.0: dependencies: - '@types/node': 8.10.66 + '@types/node': 10.17.51 dev: false resolution: integrity: sha512-Y29uQ3Uy+58bZrFLhX36hcI3Np37nqWE7ky5tjiDoy1GDZnIwVxS0CgF+s+1bXMzjKBFy+fqaRfb708iNzdinw== /@types/xml2js/0.4.8: dependencies: - '@types/node': 8.10.66 + '@types/node': 10.17.51 dev: false resolution: integrity: sha512-EyvT83ezOdec7BhDaEcsklWy7RSIdi6CNe95tmOAK0yx/Lm30C9K75snT3fYayK59ApC2oyW+rcHErdG05FHJA== @@ -1039,7 +1040,7 @@ packages: integrity: sha512-f+fD/fQAo3BCbCDlrUpznF1A5Zp9rB0noS5vnoormHSIPFKL0Z2DcUJ3Gxp5ytH4uLRNxy7AwYUC9exZzqGMAw== /@types/yauzl/2.9.1: dependencies: - '@types/node': 8.10.66 + '@types/node': 10.17.51 dev: false optional: true resolution: @@ -2290,7 +2291,7 @@ packages: integrity: sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== /debug/3.2.6: dependencies: - ms: 2.1.1 + ms: 2.1.3 deprecated: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) dev: false resolution: @@ -6486,7 +6487,7 @@ packages: /rollup/1.32.1: dependencies: '@types/estree': 0.0.46 - '@types/node': 8.10.66 + '@types/node': 10.17.51 acorn: 7.4.1 dev: false hasBin: true @@ -8469,6 +8470,61 @@ packages: integrity: sha512-dp85NanIwuYE754MZ+46OIWByFnc187dDCjBPeTQYc4MZlTKOMtf66MPnbrgjXFnY89WRVy+93s/bnhShU4MNw== tarball: file:projects/communication-common.tgz version: 0.0.0 + file:projects/communication-identity.tgz: + dependencies: + '@azure/core-tracing': 1.0.0-preview.9 + '@microsoft/api-documenter': 7.8.56 + '@microsoft/api-extractor': 7.7.11 + '@opentelemetry/api': 0.10.2 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + '@rollup/plugin-replace': 2.3.4_rollup@1.32.1 + '@types/chai': 4.2.14 + '@types/mocha': 7.0.2 + '@types/node': 8.10.66 + '@types/sinon': 9.0.10 + assert: 1.5.0 + chai: 4.2.0 + cross-env: 7.0.3 + dotenv: 8.2.0 + eslint: 7.18.0 + events: 3.2.0 + inherits: 2.0.4 + karma: 5.2.3 + karma-chrome-launcher: 3.1.0 + karma-coverage: 2.0.3 + karma-edge-launcher: 0.4.2_karma@5.2.3 + karma-env-preprocessor: 0.1.1 + karma-firefox-launcher: 1.3.0 + karma-ie-launcher: 1.0.0_karma@5.2.3 + karma-json-preprocessor: 0.3.3_karma@5.2.3 + karma-json-to-file-reporter: 1.0.1 + karma-junit-reporter: 2.0.1_karma@5.2.3 + karma-mocha: 2.0.1 + karma-mocha-reporter: 2.2.5_karma@5.2.3 + karma-remap-istanbul: 0.6.0_karma@5.2.3 + mocha: 7.2.0 + mocha-junit-reporter: 1.23.3_mocha@7.2.0 + nyc: 14.1.1 + prettier: 1.19.1 + rimraf: 3.0.2 + rollup: 1.32.1 + rollup-plugin-shim: 1.0.0 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + rollup-plugin-terser: 5.3.1_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + sinon: 9.2.3 + tslib: 2.1.0 + typedoc: 0.15.2 + typescript: 4.1.2 + dev: false + name: '@rush-temp/communication-identity' + resolution: + integrity: sha512-RCH6dZRYcM/iyx6Dw/6QyEQ4eJXNDZdMFItKtNH9eBSXaEXOk+Gv30gUJDnJWMN40XXVA/D02BKeblgGadShQA== + tarball: file:projects/communication-identity.tgz + version: 0.0.0 file:projects/communication-sms.tgz: dependencies: '@azure/core-tracing': 1.0.0-preview.9 @@ -10684,6 +10740,7 @@ packages: integrity: sha512-o7zYyw6/QJHBg2/e3mbbeOe+ohKdRse2FU1aX4i7AdO+1337l44mWy1DwVWhcFUy5aSzahd194/6nrgp7Sj6JQ== tarball: file:projects/testhub.tgz version: 0.0.0 +registry: '' specifiers: '@rush-temp/abort-controller': file:./projects/abort-controller.tgz '@rush-temp/ai-anomaly-detector': file:./projects/ai-anomaly-detector.tgz @@ -10695,6 +10752,7 @@ specifiers: '@rush-temp/communication-administration': file:./projects/communication-administration.tgz '@rush-temp/communication-chat': file:./projects/communication-chat.tgz '@rush-temp/communication-common': file:./projects/communication-common.tgz + '@rush-temp/communication-identity': file:./projects/communication-identity.tgz '@rush-temp/communication-sms': file:./projects/communication-sms.tgz '@rush-temp/core-amqp': file:./projects/core-amqp.tgz '@rush-temp/core-asynciterator-polyfill': file:./projects/core-asynciterator-polyfill.tgz From d255dc77014247b620e9689a84e1e49ef680662d Mon Sep 17 00:00:00 2001 From: Dominik Messinger Date: Mon, 25 Jan 2021 12:30:48 -0800 Subject: [PATCH 3/6] update dependency in chat and re-record tests --- .../communication-chat/package.json | 2 +- .../recording_successfully_adds_members.json | 18 ++--- ...cording_successfully_creates_a_thread.json | 30 +++---- ...ording_successfully_deletes_a_message.json | 2 +- ...cording_successfully_deletes_a_thread.json | 2 +- .../recording_successfully_lists_members.json | 6 +- ...recording_successfully_lists_messages.json | 6 +- ...ding_successfully_lists_read_receipts.json | 6 +- .../recording_successfully_lists_threads.json | 4 +- ...ecording_successfully_remove_a_member.json | 4 +- ...ding_successfully_retrieves_a_message.json | 4 +- ...rding_successfully_retrieves_a_thread.json | 4 +- ...ecording_successfully_sends_a_message.json | 6 +- ...rding_successfully_sends_read_receipt.json | 4 +- ...uccessfully_sends_typing_notification.json | 2 +- .../recording_successfully_adds_members.js | 46 +++++------ ...recording_successfully_creates_a_thread.js | 78 +++++++++---------- ...ecording_successfully_deletes_a_message.js | 14 ++-- ...recording_successfully_deletes_a_thread.js | 14 ++-- .../recording_successfully_lists_members.js | 14 ++-- .../recording_successfully_lists_messages.js | 16 ++-- ...ording_successfully_lists_read_receipts.js | 16 ++-- .../recording_successfully_lists_threads.js | 14 ++-- .../recording_successfully_remove_a_member.js | 14 ++-- ...ording_successfully_retrieves_a_message.js | 16 ++-- ...cording_successfully_retrieves_a_thread.js | 16 ++-- ..._successfully_retrieves_a_thread_client.js | 2 +- .../recording_successfully_sends_a_message.js | 18 ++--- ...cording_successfully_sends_read_receipt.js | 14 ++-- ..._successfully_sends_typing_notification.js | 14 ++-- .../test/utils/recordedClient.ts | 5 +- 31 files changed, 204 insertions(+), 207 deletions(-) diff --git a/sdk/communication/communication-chat/package.json b/sdk/communication/communication-chat/package.json index ec71fd54c8e6..61da2a571524 100644 --- a/sdk/communication/communication-chat/package.json +++ b/sdk/communication/communication-chat/package.json @@ -78,7 +78,7 @@ "@azure/core-paging": "^1.1.1" }, "devDependencies": { - "@azure/communication-administration": "1.0.0-beta.4", + "@azure/communication-identity": "1.0.0-beta.4", "@azure/eslint-plugin-azure-sdk": "^3.0.0", "@azure/test-utils-recorder": "^1.0.0", "@microsoft/api-extractor": "7.7.11", diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_adds_members.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_adds_members.json index d5183817ed2b..ecd097f4800d 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_adds_members.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_adds_members.json @@ -4,37 +4,37 @@ "method": "POST", "url": "https://endpoint/identities", "query": { - "api-version": "2020-07-20-preview2" + "api-version": "2021-03-07" }, "requestBody": null, - "status": 200, - "response": "{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9e85-ac00-343a0d000044\"}", + "status": 201, + "response": "{\"identity\":{\"id\":\"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1c-0489-6032-3b3a0d0048e7\"}}", "responseHeaders": { "content-type": "application/json; charset=utf-8" } }, { "method": "POST", - "url": "https://endpoint/identities/8%3Aacs%3A8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9e85-ac00-343a0d000044/token", + "url": "https://endpoint/identities/8%3Aacs%3Aec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1c-0489-6032-3b3a0d0048e7/:issueAccessToken", "query": { - "api-version": "2020-07-20-preview2" + "api-version": "2021-03-07" }, "requestBody": "{\"scopes\":[\"chat\"]}", "status": 200, - "response": "{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9e85-ac00-343a0d000044\",\"token\":\"token\",\"expiresOn\":\"2020-09-16T01:15:44.3092617+00:00\"}", + "response": "{\"token\":\"token\",\"expiresOn\":\"2021-01-26T20:26:56.6860692+00:00\"}", "responseHeaders": { "content-type": "application/json; charset=utf-8" } }, { "method": "POST", - "url": "https://endpoint/chat/threads/19%3A4c3fdd89a82d4657a4f6aef1d3fe5d39%40thread.v2/members", + "url": "https://endpoint/chat/threads/19%3Af89f0dd73c0e418fab41e6a68dede24c%40thread.v2/members", "query": { "api-version": "2020-09-21-preview2" }, - "requestBody": "{\"members\":[{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9e85-ac00-343a0d000044\"}]}", + "requestBody": "{\"members\":[{\"id\":\"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1c-0489-6032-3b3a0d0048e7\"}]}", "status": 207, - "response": "{\"multipleStatus\":[{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9e85-ac00-343a0d000044\",\"statusCode\":201,\"type\":\"ThreadMember\"}]}", + "response": "{\"multipleStatus\":[{\"id\":\"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1c-0489-6032-3b3a0d0048e7\",\"statusCode\":201,\"type\":\"ThreadMember\"}]}", "responseHeaders": { "content-type": "application/json; charset=utf-8" } diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_creates_a_thread.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_creates_a_thread.json index ade4ad806855..d07e187295ca 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_creates_a_thread.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_creates_a_thread.json @@ -4,24 +4,24 @@ "method": "POST", "url": "https://endpoint/identities", "query": { - "api-version": "2020-07-20-preview2" + "api-version": "2021-03-07" }, "requestBody": null, - "status": 200, - "response": "{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9058-ac00-343a0d000042\"}", + "status": 201, + "response": "{\"identity\":{\"id\":\"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-dc6c-6032-3b3a0d0048e5\"}}", "responseHeaders": { "content-type": "application/json; charset=utf-8" } }, { "method": "POST", - "url": "https://endpoint/identities/8%3Aacs%3A8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9058-ac00-343a0d000042/token", + "url": "https://endpoint/identities/8%3Aacs%3Aec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-dc6c-6032-3b3a0d0048e5/:issueAccessToken", "query": { - "api-version": "2020-07-20-preview2" + "api-version": "2021-03-07" }, "requestBody": "{\"scopes\":[\"chat\"]}", "status": 200, - "response": "{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9058-ac00-343a0d000042\",\"token\":\"token\",\"expiresOn\":\"2020-09-16T01:15:40.7395873+00:00\"}", + "response": "{\"token\":\"token\",\"expiresOn\":\"2021-01-26T20:26:46.4236026+00:00\"}", "responseHeaders": { "content-type": "application/json; charset=utf-8" } @@ -30,24 +30,24 @@ "method": "POST", "url": "https://endpoint/identities", "query": { - "api-version": "2020-07-20-preview2" + "api-version": "2021-03-07" }, "requestBody": null, - "status": 200, - "response": "{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9170-ac00-343a0d000043\"}", + "status": 201, + "response": "{\"identity\":{\"id\":\"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-e2b3-6032-3b3a0d0048e6\"}}", "responseHeaders": { "content-type": "application/json; charset=utf-8" } }, { "method": "POST", - "url": "https://endpoint/identities/8%3Aacs%3A8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9170-ac00-343a0d000043/token", + "url": "https://endpoint/identities/8%3Aacs%3Aec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-e2b3-6032-3b3a0d0048e6/:issueAccessToken", "query": { - "api-version": "2020-07-20-preview2" + "api-version": "2021-03-07" }, "requestBody": "{\"scopes\":[\"chat\"]}", "status": 200, - "response": "{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9170-ac00-343a0d000043\",\"token\":\"token\",\"expiresOn\":\"2020-09-16T01:15:40.9640672+00:00\"}", + "response": "{\"token\":\"token\",\"expiresOn\":\"2021-01-26T20:26:48.016529+00:00\"}", "responseHeaders": { "content-type": "application/json; charset=utf-8" } @@ -58,12 +58,12 @@ "query": { "api-version": "2020-09-21-preview2" }, - "requestBody": "{\"topic\":\"test topic\",\"members\":[{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9058-ac00-343a0d000042\"},{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9170-ac00-343a0d000043\"}]}", + "requestBody": "{\"topic\":\"test topic\",\"members\":[{\"id\":\"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-dc6c-6032-3b3a0d0048e5\"},{\"id\":\"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-e2b3-6032-3b3a0d0048e6\"}]}", "status": 207, - "response": "{\"multipleStatus\":[{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9058-ac00-343a0d000042\",\"statusCode\":201,\"type\":\"ThreadMember\"},{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9170-ac00-343a0d000043\",\"statusCode\":201,\"type\":\"ThreadMember\"},{\"id\":\"19:4c3fdd89a82d4657a4f6aef1d3fe5d39@thread.v2\",\"statusCode\":201,\"type\":\"Thread\"}]}", + "response": "{\"multipleStatus\":[{\"id\":\"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-dc6c-6032-3b3a0d0048e5\",\"statusCode\":201,\"type\":\"ThreadMember\"},{\"id\":\"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-e2b3-6032-3b3a0d0048e6\",\"statusCode\":201,\"type\":\"ThreadMember\"},{\"id\":\"19:f89f0dd73c0e418fab41e6a68dede24c@thread.v2\",\"statusCode\":201,\"type\":\"Thread\"}]}", "responseHeaders": { "content-type": "application/json; charset=utf-8", - "location": "https://endpoint/chat/threads/19%3A4c3fdd89a82d4657a4f6aef1d3fe5d39@thread.v2" + "location": "https://endpoint/chat/threads/19%3Af89f0dd73c0e418fab41e6a68dede24c@thread.v2" } } ], diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_deletes_a_message.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_deletes_a_message.json index 1dbf48bc6de1..3c6a5b1693ae 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_deletes_a_message.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_deletes_a_message.json @@ -2,7 +2,7 @@ "recordings": [ { "method": "DELETE", - "url": "https://endpoint/chat/threads/19%3A4c3fdd89a82d4657a4f6aef1d3fe5d39%40thread.v2/messages/1600132543672", + "url": "https://endpoint/chat/threads/19%3Af89f0dd73c0e418fab41e6a68dede24c%40thread.v2/messages/1611606412024", "query": { "api-version": "2020-09-21-preview2" }, diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_deletes_a_thread.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_deletes_a_thread.json index fd6642fd3583..d9cd9c715286 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_deletes_a_thread.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_deletes_a_thread.json @@ -2,7 +2,7 @@ "recordings": [ { "method": "DELETE", - "url": "https://endpoint/chat/threads/19%3A4c3fdd89a82d4657a4f6aef1d3fe5d39%40thread.v2", + "url": "https://endpoint/chat/threads/19%3Af89f0dd73c0e418fab41e6a68dede24c%40thread.v2", "query": { "api-version": "2020-09-21-preview2" }, diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_members.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_members.json index c265918d65f2..edd1c84cae52 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_members.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_members.json @@ -2,13 +2,13 @@ "recordings": [ { "method": "GET", - "url": "https://endpoint/chat/threads/19%3A4c3fdd89a82d4657a4f6aef1d3fe5d39%40thread.v2/members", + "url": "https://endpoint/chat/threads/19%3Af89f0dd73c0e418fab41e6a68dede24c%40thread.v2/members", "query": { "api-version": "2020-09-21-preview2" }, "requestBody": null, "status": 200, - "response": "{\"value\":[{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9058-ac00-343a0d000042\",\"shareHistoryTime\":\"1970-01-01T00:00:00Z\"},{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9170-ac00-343a0d000043\",\"shareHistoryTime\":\"1970-01-01T00:00:00Z\"},{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9e85-ac00-343a0d000044\",\"shareHistoryTime\":\"2020-09-15T01:15:45Z\"}]}", + "response": "{\"value\":[{\"id\":\"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-dc6c-6032-3b3a0d0048e5\",\"shareHistoryTime\":\"1970-01-01T00:00:00Z\"},{\"id\":\"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-e2b3-6032-3b3a0d0048e6\",\"shareHistoryTime\":\"1970-01-01T00:00:00Z\"},{\"id\":\"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1c-0489-6032-3b3a0d0048e7\",\"shareHistoryTime\":\"1970-01-01T00:00:00Z\"}]}", "responseHeaders": { "content-type": "application/json; charset=utf-8" } @@ -18,5 +18,5 @@ "uniqueName": {}, "newDate": {} }, - "hash": "b562289d995f7fd91e99f427c298b013" + "hash": "c2e312852b9eea994b269e412cf36770" } \ No newline at end of file diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_messages.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_messages.json index 961ae3f65509..ee2d1d38a2f3 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_messages.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_messages.json @@ -2,13 +2,13 @@ "recordings": [ { "method": "GET", - "url": "https://endpoint/chat/threads/19%3A4c3fdd89a82d4657a4f6aef1d3fe5d39%40thread.v2/messages", + "url": "https://endpoint/chat/threads/19%3Af89f0dd73c0e418fab41e6a68dede24c%40thread.v2/messages", "query": { "api-version": "2020-09-21-preview2" }, "requestBody": null, "status": 200, - "response": "{\"value\":[{\"id\":\"1600132543672\",\"type\":\"Text\",\"priority\":\"Normal\",\"version\":\"1600132543672\",\"content\":\"content\",\"senderDisplayName\":\"\",\"createdOn\":\"2020-09-15T01:15:43Z\",\"senderId\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9058-ac00-343a0d000042\"},{\"id\":\"1600132542863\",\"type\":\"ThreadActivity/TopicUpdate\",\"priority\":\"Normal\",\"version\":\"1600132542863\",\"content\":\"16001325428638:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9058-ac00-343a0d000042test topic\",\"createdOn\":\"2020-09-15T01:15:42Z\",\"senderId\":\"19:4c3fdd89a82d4657a4f6aef1d3fe5d39@thread.v2\"},{\"id\":\"1600132542803\",\"type\":\"ThreadActivity/AddMember\",\"priority\":\"Normal\",\"version\":\"1600132542803\",\"content\":\"16001325428038:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9058-ac00-343a0d00004216001325427138:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9058-ac00-343a0d0000428:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9058-ac00-343a0d0000428:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9170-ac00-343a0d0000438:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9170-ac00-343a0d000043\",\"createdOn\":\"2020-09-15T01:15:42Z\",\"senderId\":\"19:4c3fdd89a82d4657a4f6aef1d3fe5d39@thread.v2\"}]}", + "response": "{\"value\":[{\"id\":\"1611606412024\",\"type\":\"Text\",\"priority\":\"Normal\",\"version\":\"1611606412024\",\"content\":\"content\",\"senderDisplayName\":\"\",\"createdOn\":\"2021-01-25T20:26:52Z\",\"senderId\":\"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-dc6c-6032-3b3a0d0048e5\"},{\"id\":\"1611606409884\",\"type\":\"ThreadActivity/TopicUpdate\",\"priority\":\"Normal\",\"version\":\"1611606409884\",\"content\":\"16116064098848:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-dc6c-6032-3b3a0d0048e5test topic\",\"createdOn\":\"2021-01-25T20:26:49Z\",\"senderId\":\"19:f89f0dd73c0e418fab41e6a68dede24c@thread.v2\"},{\"id\":\"1611606409829\",\"type\":\"ThreadActivity/AddMember\",\"priority\":\"Normal\",\"version\":\"1611606409829\",\"content\":\"16116064098298:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-dc6c-6032-3b3a0d0048e516116064097498:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-dc6c-6032-3b3a0d0048e58:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-dc6c-6032-3b3a0d0048e58:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-e2b3-6032-3b3a0d0048e68:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-e2b3-6032-3b3a0d0048e6\",\"createdOn\":\"2021-01-25T20:26:49Z\",\"senderId\":\"19:f89f0dd73c0e418fab41e6a68dede24c@thread.v2\"}]}", "responseHeaders": { "content-type": "application/json; charset=utf-8" } @@ -18,5 +18,5 @@ "uniqueName": {}, "newDate": {} }, - "hash": "69065afb452d3f2c8e7e7b398c883b69" + "hash": "cba2e4066fd5fb5b8e9ee35ae0d7c87a" } \ No newline at end of file diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_read_receipts.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_read_receipts.json index 73df49ba0c8c..8bb5be3613c0 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_read_receipts.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_read_receipts.json @@ -2,13 +2,13 @@ "recordings": [ { "method": "GET", - "url": "https://endpoint/chat/threads/19%3A4c3fdd89a82d4657a4f6aef1d3fe5d39%40thread.v2/readreceipts", + "url": "https://endpoint/chat/threads/19%3Af89f0dd73c0e418fab41e6a68dede24c%40thread.v2/readreceipts", "query": { "api-version": "2020-09-21-preview2" }, "requestBody": null, "status": 200, - "response": "{\"value\":[{\"senderId\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9058-ac00-343a0d000042\",\"chatMessageId\":\"1600132543672\",\"readOn\":\"2020-09-15T01:15:44Z\"}]}", + "response": "{\"value\":[{\"senderId\":\"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-dc6c-6032-3b3a0d0048e5\",\"chatMessageId\":\"1611606412024\",\"readOn\":\"2021-01-25T20:26:54Z\"}]}", "responseHeaders": { "content-type": "application/json; charset=utf-8" } @@ -18,5 +18,5 @@ "uniqueName": {}, "newDate": {} }, - "hash": "98d27d0624d3b4d36960b0a2b122ceb8" + "hash": "358b84270f60dad292e8171b4a10d550" } \ No newline at end of file diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_threads.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_threads.json index 7ffa1b91a096..1264c232845c 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_threads.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_threads.json @@ -8,7 +8,7 @@ }, "requestBody": null, "status": 200, - "response": "{\"value\":[{\"id\":\"19:4c3fdd89a82d4657a4f6aef1d3fe5d39@thread.v2\",\"topic\":\"test topic\",\"isDeleted\":false,\"lastMessageReceivedOn\":\"2020-09-15T01:15:42Z\"}]}", + "response": "{\"value\":[{\"id\":\"19:f89f0dd73c0e418fab41e6a68dede24c@thread.v2\",\"topic\":\"test topic\",\"isDeleted\":false,\"lastMessageReceivedOn\":\"2021-01-25T20:26:49Z\"}]}", "responseHeaders": { "content-type": "application/json; charset=utf-8" } @@ -18,5 +18,5 @@ "uniqueName": {}, "newDate": {} }, - "hash": "8399a5b8b40d33cd896aa647fc06107d" + "hash": "5e36028cb67bd05020efb59113a8fdbc" } \ No newline at end of file diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_remove_a_member.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_remove_a_member.json index a0842324525c..2a1de75f2957 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_remove_a_member.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_remove_a_member.json @@ -2,7 +2,7 @@ "recordings": [ { "method": "DELETE", - "url": "https://endpoint/chat/threads/19%3A4c3fdd89a82d4657a4f6aef1d3fe5d39%40thread.v2/members/8%3Aacs%3A8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9170-ac00-343a0d000043", + "url": "https://endpoint/chat/threads/19%3Af89f0dd73c0e418fab41e6a68dede24c%40thread.v2/members/8%3Aacs%3Aec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-e2b3-6032-3b3a0d0048e6", "query": { "api-version": "2020-09-21-preview2" }, @@ -16,5 +16,5 @@ "uniqueName": {}, "newDate": {} }, - "hash": "76468385b1060cd4883a8cd7985f4d27" + "hash": "8191d138c3470f24cfa08494ba83e7fe" } \ No newline at end of file diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_retrieves_a_message.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_retrieves_a_message.json index cf550c2607fd..cde83bc5e5ac 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_retrieves_a_message.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_retrieves_a_message.json @@ -2,13 +2,13 @@ "recordings": [ { "method": "GET", - "url": "https://endpoint/chat/threads/19%3A4c3fdd89a82d4657a4f6aef1d3fe5d39%40thread.v2/messages/1600132543672", + "url": "https://endpoint/chat/threads/19%3Af89f0dd73c0e418fab41e6a68dede24c%40thread.v2/messages/1611606412024", "query": { "api-version": "2020-09-21-preview2" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"1600132543672\",\"type\":\"Text\",\"priority\":\"Normal\",\"version\":\"1600132543672\",\"content\":\"content\",\"senderDisplayName\":\"\",\"createdOn\":\"2020-09-15T01:15:43Z\",\"senderId\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9058-ac00-343a0d000042\"}", + "response": "{\"id\":\"1611606412024\",\"type\":\"Text\",\"priority\":\"Normal\",\"version\":\"1611606412024\",\"content\":\"content\",\"senderDisplayName\":\"\",\"createdOn\":\"2021-01-25T20:26:52Z\",\"senderId\":\"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-dc6c-6032-3b3a0d0048e5\"}", "responseHeaders": { "content-type": "application/json; charset=utf-8" } diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_retrieves_a_thread.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_retrieves_a_thread.json index 4c8b2dac0e36..663ec83efca4 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_retrieves_a_thread.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_retrieves_a_thread.json @@ -2,13 +2,13 @@ "recordings": [ { "method": "GET", - "url": "https://endpoint/chat/threads/19%3A4c3fdd89a82d4657a4f6aef1d3fe5d39%40thread.v2", + "url": "https://endpoint/chat/threads/19%3Af89f0dd73c0e418fab41e6a68dede24c%40thread.v2", "query": { "api-version": "2020-09-21-preview2" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"19:4c3fdd89a82d4657a4f6aef1d3fe5d39@thread.v2\",\"topic\":\"test topic\",\"createdOn\":\"2020-09-15T01:15:42Z\",\"createdBy\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9058-ac00-343a0d000042\",\"members\":[{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9058-ac00-343a0d000042\",\"shareHistoryTime\":\"1970-01-01T00:00:00Z\"},{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-9170-ac00-343a0d000043\",\"shareHistoryTime\":\"1970-01-01T00:00:00Z\"}]}", + "response": "{\"id\":\"19:f89f0dd73c0e418fab41e6a68dede24c@thread.v2\",\"topic\":\"test topic\",\"createdOn\":\"2021-01-25T20:26:49Z\",\"createdBy\":\"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-dc6c-6032-3b3a0d0048e5\",\"members\":[{\"id\":\"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-dc6c-6032-3b3a0d0048e5\",\"shareHistoryTime\":\"1970-01-01T00:00:00Z\"},{\"id\":\"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-e2b3-6032-3b3a0d0048e6\",\"shareHistoryTime\":\"1970-01-01T00:00:00Z\"}]}", "responseHeaders": { "content-type": "application/json; charset=utf-8" } diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_sends_a_message.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_sends_a_message.json index 5db31cbe7354..f6049a059c47 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_sends_a_message.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_sends_a_message.json @@ -2,16 +2,16 @@ "recordings": [ { "method": "POST", - "url": "https://endpoint/chat/threads/19%3A4c3fdd89a82d4657a4f6aef1d3fe5d39%40thread.v2/messages", + "url": "https://endpoint/chat/threads/19%3Af89f0dd73c0e418fab41e6a68dede24c%40thread.v2/messages", "query": { "api-version": "2020-09-21-preview2" }, "requestBody": "{\"content\":\"content\"}", "status": 201, - "response": "{\"id\":\"1600132543672\"}", + "response": "{\"id\":\"1611606412024\"}", "responseHeaders": { "content-type": "application/json; charset=utf-8", - "location": "https://endpoint/chat/threads/19%3A4c3fdd89a82d4657a4f6aef1d3fe5d39@thread.v2/messages/1600132543672" + "location": "https://endpoint/chat/threads/19%3Af89f0dd73c0e418fab41e6a68dede24c@thread.v2/messages/1611606412024" } } ], diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_sends_read_receipt.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_sends_read_receipt.json index 32b92a873707..315aa3c83269 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_sends_read_receipt.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_sends_read_receipt.json @@ -2,11 +2,11 @@ "recordings": [ { "method": "POST", - "url": "https://endpoint/chat/threads/19%3A4c3fdd89a82d4657a4f6aef1d3fe5d39%40thread.v2/readreceipts", + "url": "https://endpoint/chat/threads/19%3Af89f0dd73c0e418fab41e6a68dede24c%40thread.v2/readreceipts", "query": { "api-version": "2020-09-21-preview2" }, - "requestBody": "{\"chatMessageId\":\"1600132543672\"}", + "requestBody": "{\"chatMessageId\":\"1611606412024\"}", "status": 201, "response": "", "responseHeaders": { diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_sends_typing_notification.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_sends_typing_notification.json index e0d4aa23975d..7a6d9365ed72 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_sends_typing_notification.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_sends_typing_notification.json @@ -2,7 +2,7 @@ "recordings": [ { "method": "POST", - "url": "https://endpoint/chat/threads/19%3A4c3fdd89a82d4657a4f6aef1d3fe5d39%40thread.v2/typing", + "url": "https://endpoint/chat/threads/19%3Af89f0dd73c0e418fab41e6a68dede24c%40thread.v2/typing", "query": { "api-version": "2020-09-21-preview2" }, diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_adds_members.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_adds_members.js index d37adf964a21..d0e4c91e481a 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_adds_members.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_adds_members.js @@ -1,75 +1,75 @@ let nock = require('nock'); -module.exports.hash = "91f9d3d6bfaa75a9c8ce999c36d74946"; +module.exports.hash = "ecd696a34056369467b8bbb4fadf0a68"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) .post('/identities') .query(true) - .reply(200, {"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-6ea0-6a0b-343a0d00003c"}, [ + .reply(201, {"identity":{"id":"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-b5ce-6032-3b3a0d0048e4"}}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', - 'Tmq1AoOxvEKlnMOgrirqNQ.0', + 'yfrwEbYfY0aZk7o0LXSkGw.0', 'Strict-Transport-Security', 'max-age=2592000', 'x-ms-client-request-id', - '5e24311c-46b8-49af-a343-0ad58557b556', + 'cce60acd-35a3-4611-9e27-e9c5892c00e7', 'api-supported-versions', - '2020-07-20-preview1, 2020-07-20-preview2', + '2020-07-20-preview2, 2021-03-07', 'X-Processing-Time', - '22ms', + '20ms', 'X-Azure-Ref', - '0tBVgXwAAAADpDjrdgDeFQo6EODSovdfYV1NURURHRTA4MTQAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + '0fSkPYAAAAADqUj+jKUABS6g0WEFDSvDMWVZSMzBFREdFMDQxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', 'Date', - 'Tue, 15 Sep 2020 01:15:32 GMT' + 'Mon, 25 Jan 2021 20:26:37 GMT' ]); nock('https://endpoint', {"encodedQueryParams":true}) - .post('/identities/8%3Aacs%3A8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-6ea0-6a0b-343a0d00003c/token', {"scopes":["chat"]}) + .post('/identities/8%3Aacs%3Aec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-b5ce-6032-3b3a0d0048e4/:issueAccessToken', {"scopes":["chat"]}) .query(true) - .reply(200, {"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-6ea0-6a0b-343a0d00003c","token":"token","expiresOn":"2020-09-16T01:15:32.0000282+00:00"}, [ + .reply(200, {"token":"token","expiresOn":"2021-01-26T20:26:36.4842707+00:00"}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', - 'MI71/pp1m0KF+/AVbQeHHQ.0', + '4bYiqS8tf0y6wrjqZ6lVsQ.0', 'Strict-Transport-Security', 'max-age=2592000', 'x-ms-client-request-id', - '314224d0-4905-484f-9d3a-4a28750867c4', + 'c0b3e1b9-89e7-4254-90fc-4189323ff16b', 'api-supported-versions', - '2020-07-20-preview1, 2020-07-20-preview2', + '2020-07-20-preview2, 2021-03-07', 'X-Processing-Time', - '36ms', + '39ms', 'X-Azure-Ref', - '0tBVgXwAAAAAaSuBchlr+SqjZ2GR08gq8V1NURURHRTA4MTQAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + '0fSkPYAAAAAAP9qM4JP67QaVi4MEte2NlWVZSMzBFREdFMDQxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', 'Date', - 'Tue, 15 Sep 2020 01:15:32 GMT' + 'Mon, 25 Jan 2021 20:26:37 GMT' ]); nock('https://endpoint', {"encodedQueryParams":true}) - .post('/chat/threads/19%3A069d3bbafc4840df836c5fe8e232a17f%40thread.v2/members', {"members":[{"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-6ea0-6a0b-343a0d00003c"}]}) + .post('/chat/threads/19%3A14724b43dee94c22a938d44457110b8a%40thread.v2/members', {"members":[{"id":"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-b5ce-6032-3b3a0d0048e4"}]}) .query(true) - .reply(207, {"multipleStatus":[{"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-6ea0-6a0b-343a0d00003c","statusCode":201,"type":"ThreadMember"}]}, [ + .reply(207, {"multipleStatus":[{"id":"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-b5ce-6032-3b3a0d0048e4","statusCode":201,"type":"ThreadMember"}]}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', - 'ZmXY+6RtKkyv2qe6a2TQaw.0', + 'SK9tYUslPEiFRjEIHBkWLQ.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', - '2020-07-20-preview1, 2020-09-21-preview2', + '2020-09-21-preview2', 'X-Processing-Time', - '338ms', + '213ms', 'X-Azure-Ref', - '0tRVgXwAAAACWZwcVxeIpR4jPIEHj/XZSV1NURURHRTA4MDcAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + '0fSkPYAAAAABMh7Q6oKprS7n6eeshI//lWVZSMzBFREdFMDQxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', 'Date', - 'Tue, 15 Sep 2020 01:15:33 GMT' + 'Mon, 25 Jan 2021 20:26:37 GMT' ]); diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_creates_a_thread.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_creates_a_thread.js index 6a371af6d639..fd83c84ec689 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_creates_a_thread.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_creates_a_thread.js @@ -1,125 +1,125 @@ let nock = require('nock'); -module.exports.hash = "a7f6f1f562f12da837c491b0a0ff3124"; +module.exports.hash = "d1eddafa7cd3950c0aef9f6678bb0ddd"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) .post('/identities') .query(true) - .reply(200, {"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-6169-1000-343a0d00002e"}, [ + .reply(201, {"identity":{"id":"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-9433-6032-3b3a0d0048e0"}}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', - 'YoNaeCoS7kCsmoqpHK1bQg.0', + 'ck6wqAzwNE2kDhJOeuZxgQ.0', 'Strict-Transport-Security', 'max-age=2592000', 'x-ms-client-request-id', - '87810f6a-5f77-4903-b20b-d7e5c277842e', + 'f8863746-16d8-4d7a-94ba-65e2965feeb3', 'api-supported-versions', - '2020-07-20-preview1, 2020-07-20-preview2', + '2020-07-20-preview2, 2021-03-07', 'X-Processing-Time', - '64ms', + '18ms', 'X-Azure-Ref', - '0sRVgXwAAAAA5XDjE3WoAQ5NVQGRHrWdXV1NURURHRTA4MDkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + '0dCkPYAAAAAB6C9bW6Xc9R6k0Vs8pg9VbWVZSMzBFREdFMDQxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', 'Date', - 'Tue, 15 Sep 2020 01:15:28 GMT' + 'Mon, 25 Jan 2021 20:26:28 GMT' ]); nock('https://endpoint', {"encodedQueryParams":true}) - .post('/identities/8%3Aacs%3A8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-6169-1000-343a0d00002e/token', {"scopes":["chat"]}) + .post('/identities/8%3Aacs%3Aec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-9433-6032-3b3a0d0048e0/:issueAccessToken', {"scopes":["chat"]}) .query(true) - .reply(200, {"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-6169-1000-343a0d00002e","token":"token","expiresOn":"2020-09-16T01:15:28.6299591+00:00"}, [ + .reply(200, {"token":"token","expiresOn":"2021-01-26T20:26:29.1912255+00:00"}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', - 'kdd5J31KeEenngGz2zNfCg.0', + 'iTfxviDiB0euXVNQ2zxedQ.0', 'Strict-Transport-Security', 'max-age=2592000', 'x-ms-client-request-id', - '55e21de9-c86d-4299-9c58-30d271d9c139', + '8fcdf97b-9e2b-4554-9c76-5fc47b0870f0', 'api-supported-versions', - '2020-07-20-preview1, 2020-07-20-preview2', + '2020-07-20-preview2, 2021-03-07', 'X-Processing-Time', - '48ms', + '27ms', 'X-Azure-Ref', - '0sRVgXwAAAADvqfd5347bSb881wB6GUr7V1NURURHRTA4MDkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + '0dikPYAAAAAAQZqRscdwHQZ1KT8iXdbsQWVZSMzBFREdFMDQxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', 'Date', - 'Tue, 15 Sep 2020 01:15:28 GMT' + 'Mon, 25 Jan 2021 20:26:30 GMT' ]); nock('https://endpoint', {"encodedQueryParams":true}) .post('/identities') .query(true) - .reply(200, {"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-62cc-6a0b-343a0d00003b"}, [ + .reply(201, {"identity":{"id":"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-99e7-6032-3b3a0d0048e1"}}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', - 'uxfODJBOeUCE1Ub4BARqbA.0', + 'pLSsT7/vu0SK6ANUIYDJxw.0', 'Strict-Transport-Security', 'max-age=2592000', 'x-ms-client-request-id', - '8b8d167d-5634-4469-9b40-7fe01525fd2a', + '29733691-d7ea-46b2-89bb-333037fae683', 'api-supported-versions', - '2020-07-20-preview1, 2020-07-20-preview2', + '2020-07-20-preview2, 2021-03-07', 'X-Processing-Time', - '78ms', + '18ms', 'X-Azure-Ref', - '0sRVgXwAAAADoooqJg2qZRp6CBbpI+JV3V1NURURHRTA4MTQAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + '0dikPYAAAAABcCAGqi2AiT5Qmdfp7WYfLWVZSMzBFREdFMDQxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', 'Date', - 'Tue, 15 Sep 2020 01:15:29 GMT' + 'Mon, 25 Jan 2021 20:26:30 GMT' ]); nock('https://endpoint', {"encodedQueryParams":true}) - .post('/identities/8%3Aacs%3A8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-62cc-6a0b-343a0d00003b/token', {"scopes":["chat"]}) + .post('/identities/8%3Aacs%3Aec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-99e7-6032-3b3a0d0048e1/:issueAccessToken', {"scopes":["chat"]}) .query(true) - .reply(200, {"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-62cc-6a0b-343a0d00003b","token":"token","expiresOn":"2020-09-16T01:15:29.0102475+00:00"}, [ + .reply(200, {"token":"token","expiresOn":"2021-01-26T20:26:29.3323233+00:00"}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', - 'IATIeGpE40u5O/OtTUjDcg.0', + 'QYbxmTCypEKDeQr92qA11g.0', 'Strict-Transport-Security', 'max-age=2592000', 'x-ms-client-request-id', - 'e31e3159-6d48-45a0-932d-595c018eb4a2', + '9e363fda-fa67-46ef-acaa-d0e00414fcd5', 'api-supported-versions', - '2020-07-20-preview1, 2020-07-20-preview2', + '2020-07-20-preview2, 2021-03-07', 'X-Processing-Time', - '81ms', + '22ms', 'X-Azure-Ref', - '0sRVgXwAAAADtcCQS8r3VQJ130ehKXCR2V1NURURHRTA4MTQAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + '0dikPYAAAAACsJy5AHvtLT4yeYqHW2nKkWVZSMzBFREdFMDQxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', 'Date', - 'Tue, 15 Sep 2020 01:15:29 GMT' + 'Mon, 25 Jan 2021 20:26:30 GMT' ]); nock('https://endpoint', {"encodedQueryParams":true}) - .post('/chat/threads', {"topic":"test topic","members":[{"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-6169-1000-343a0d00002e"},{"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-62cc-6a0b-343a0d00003b"}]}) + .post('/chat/threads', {"topic":"test topic","members":[{"id":"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-9433-6032-3b3a0d0048e0"},{"id":"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-99e7-6032-3b3a0d0048e1"}]}) .query(true) - .reply(207, {"multipleStatus":[{"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-6169-1000-343a0d00002e","statusCode":201,"type":"ThreadMember"},{"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-62cc-6a0b-343a0d00003b","statusCode":201,"type":"ThreadMember"},{"id":"19:069d3bbafc4840df836c5fe8e232a17f@thread.v2","statusCode":201,"type":"Thread"}]}, [ + .reply(207, {"multipleStatus":[{"id":"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-9433-6032-3b3a0d0048e0","statusCode":201,"type":"ThreadMember"},{"id":"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-99e7-6032-3b3a0d0048e1","statusCode":201,"type":"ThreadMember"},{"id":"19:14724b43dee94c22a938d44457110b8a@thread.v2","statusCode":201,"type":"Thread"}]}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'Location', - 'https://23.100.36.56/chat/threads/19%3A069d3bbafc4840df836c5fe8e232a17f@thread.v2', + 'https://13.64.171.212/chat/threads/19%3A14724b43dee94c22a938d44457110b8a@thread.v2', 'MS-CV', - 'uR7btLOINk+DBjxj067hIg.0', + 'XEEI2MfM3kW8nsrMK+XNrg.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', - '2020-07-20-preview1, 2020-09-21-preview2', + '2020-09-21-preview2, 2020-11-01-preview3', 'X-Processing-Time', - '520ms', + '297ms', 'X-Azure-Ref', - '0shVgXwAAAABufu0hTVnZQpRpx+MX7x4JV1NURURHRTA4MjIAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + '0dikPYAAAAACRBs6LzcxJRKIPoxL1gWwtWVZSMzBFREdFMDQxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', 'Date', - 'Tue, 15 Sep 2020 01:15:29 GMT' + 'Mon, 25 Jan 2021 20:26:30 GMT' ]); diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_deletes_a_message.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_deletes_a_message.js index 06837179dc44..7f43a03964b1 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_deletes_a_message.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_deletes_a_message.js @@ -1,23 +1,23 @@ let nock = require('nock'); -module.exports.hash = "6f90ac401c7903dfc7bd077bcdb108f1"; +module.exports.hash = "99dab1eee1f2015b9c781625ce8891cd"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) - .delete('/chat/threads/19%3A069d3bbafc4840df836c5fe8e232a17f%40thread.v2/messages/1600132531629') + .delete('/chat/threads/19%3A14724b43dee94c22a938d44457110b8a%40thread.v2/messages/1611606392859') .query(true) .reply(204, "", [ 'MS-CV', - 'jbMnCUR1eUOSc8J8O7Sm4A.0', + 'ZVBkJE3bRU607P6nJdHxxA.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', - '2020-07-20-preview1, 2020-09-21-preview2', + '2020-09-21-preview2, 2020-11-01-preview3', 'X-Processing-Time', - '167ms', + '169ms', 'X-Azure-Ref', - '0tBVgXwAAAAAMj4vuKXxzQ6zbG44cHE0gV1NURURHRTA4MDcAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + '0fCkPYAAAAADonPfyOdOfRpIoSg3S+LKDWVZSMzBFREdFMDQxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', 'Date', - 'Tue, 15 Sep 2020 01:15:32 GMT' + 'Mon, 25 Jan 2021 20:26:36 GMT' ]); diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_deletes_a_thread.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_deletes_a_thread.js index 05c0a0737001..46a92215b2b7 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_deletes_a_thread.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_deletes_a_thread.js @@ -1,23 +1,23 @@ let nock = require('nock'); -module.exports.hash = "1111e8e6bad22cbea6c2a2da200160bf"; +module.exports.hash = "cf8b468d221de05cd3880e4f48eec43c"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) - .delete('/chat/threads/19%3A069d3bbafc4840df836c5fe8e232a17f%40thread.v2') + .delete('/chat/threads/19%3A14724b43dee94c22a938d44457110b8a%40thread.v2') .query(true) .reply(204, "", [ 'MS-CV', - 'ICj/BkLgJESsFZjFqQsmmg.0', + 'WVegYVLdPUyZtknJC9fLhQ.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', - '2020-07-20-preview1, 2020-09-21-preview2', + '2020-09-21-preview2, 2020-11-01-preview3', 'X-Processing-Time', - '169ms', + '160ms', 'X-Azure-Ref', - '0tRVgXwAAAADbpSPnq2O9Qpl3/OJjgCznV1NURURHRTA4MjIAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + '0gSkPYAAAAACWmD9jmAyYSZeb2LXeVe1KWVZSMzBFREdFMDQxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', 'Date', - 'Tue, 15 Sep 2020 01:15:33 GMT' + 'Mon, 25 Jan 2021 20:26:40 GMT' ]); diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_members.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_members.js index 6a87fde05265..37eee6b6a4c3 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_members.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_members.js @@ -1,27 +1,27 @@ let nock = require('nock'); -module.exports.hash = "25b03c3f9a319034849992383086fb91"; +module.exports.hash = "22d750de7546d2dcc5887deec259aedb"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) - .get('/chat/threads/19%3A069d3bbafc4840df836c5fe8e232a17f%40thread.v2/members') + .get('/chat/threads/19%3A14724b43dee94c22a938d44457110b8a%40thread.v2/members') .query(true) - .reply(200, {"value":[{"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-6169-1000-343a0d00002e","shareHistoryTime":"1970-01-01T00:00:00Z"},{"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-62cc-6a0b-343a0d00003b","shareHistoryTime":"1970-01-01T00:00:00Z"},{"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-6ea0-6a0b-343a0d00003c","shareHistoryTime":"2020-09-15T01:15:33Z"}]}, [ + .reply(200, {"value":[{"id":"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-9433-6032-3b3a0d0048e0","shareHistoryTime":"1970-01-01T00:00:00Z"},{"id":"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-99e7-6032-3b3a0d0048e1","shareHistoryTime":"1970-01-01T00:00:00Z"},{"id":"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-b5ce-6032-3b3a0d0048e4","shareHistoryTime":"1970-01-01T00:00:00Z"}]}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', - 'eAIcSUyb/Eq+l44y79/wsg.0', + '27Y17ctXIUS+2W+plZXp+Q.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', - '2020-07-20-preview1, 2020-09-21-preview2', + '2020-09-21-preview2', 'X-Processing-Time', '69ms', 'X-Azure-Ref', - '0tRVgXwAAAAAbqHdNstfSTY9AphrVC6woV1NURURHRTA4MDcAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + '0fikPYAAAAAB9qjtp/V9TRZHpvPwdewPfWVZSMzBFREdFMDQxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', 'Date', - 'Tue, 15 Sep 2020 01:15:33 GMT' + 'Mon, 25 Jan 2021 20:26:38 GMT' ]); diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_messages.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_messages.js index 007908bc8b5c..1cfe3a4fe645 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_messages.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_messages.js @@ -1,27 +1,27 @@ let nock = require('nock'); -module.exports.hash = "6c359419b94381d03bad2a9dce0534bc"; +module.exports.hash = "61bde83cf5c0c1bf73fdd3c8c3d79e7f"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) - .get('/chat/threads/19%3A069d3bbafc4840df836c5fe8e232a17f%40thread.v2/messages') + .get('/chat/threads/19%3A14724b43dee94c22a938d44457110b8a%40thread.v2/messages') .query(true) - .reply(200, {"value":[{"id":"1600132531629","type":"Text","priority":"Normal","version":"1600132531629","content":"content","senderDisplayName":"","createdOn":"2020-09-15T01:15:31Z","senderId":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-6169-1000-343a0d00002e"},{"id":"1600132530651","type":"ThreadActivity/TopicUpdate","priority":"Normal","version":"1600132530651","content":"16001325306518:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-6169-1000-343a0d00002etest topic","createdOn":"2020-09-15T01:15:30Z","senderId":"19:069d3bbafc4840df836c5fe8e232a17f@thread.v2"},{"id":"1600132530587","type":"ThreadActivity/AddMember","priority":"Normal","version":"1600132530587","content":"16001325305878:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-6169-1000-343a0d00002e16001325305068:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-6169-1000-343a0d00002e8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-6169-1000-343a0d00002e8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-62cc-6a0b-343a0d00003b8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-62cc-6a0b-343a0d00003b","createdOn":"2020-09-15T01:15:30Z","senderId":"19:069d3bbafc4840df836c5fe8e232a17f@thread.v2"}]}, [ + .reply(200, {"value":[{"id":"1611606392859","type":"Text","priority":"Normal","version":"1611606392859","content":"content","senderDisplayName":"","createdOn":"2021-01-25T20:26:32Z","senderId":"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-9433-6032-3b3a0d0048e0"},{"id":"1611606390614","type":"ThreadActivity/TopicUpdate","priority":"Normal","version":"1611606390614","content":"16116063906148:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-9433-6032-3b3a0d0048e0test topic","createdOn":"2021-01-25T20:26:30Z","senderId":"19:14724b43dee94c22a938d44457110b8a@thread.v2"},{"id":"1611606390544","type":"ThreadActivity/AddMember","priority":"Normal","version":"1611606390544","content":"16116063905448:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-9433-6032-3b3a0d0048e016116063904648:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-9433-6032-3b3a0d0048e08:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-9433-6032-3b3a0d0048e08:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-99e7-6032-3b3a0d0048e18:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-99e7-6032-3b3a0d0048e1","createdOn":"2021-01-25T20:26:30Z","senderId":"19:14724b43dee94c22a938d44457110b8a@thread.v2"}]}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', - 'opexShkLyUCGJLe4FirCAQ.0', + 'G41vUzBR+ke7K1yB5a4jSw.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', - '2020-07-20-preview1, 2020-09-21-preview2', + '2020-09-21-preview2, 2020-11-01-preview3', 'X-Processing-Time', - '88ms', + '97ms', 'X-Azure-Ref', - '0tBVgXwAAAABZ7PVAzCCBS65m4D7nxQCdV1NURURHRTA4MDcAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + '0eykPYAAAAAD095Pav8ZkRbJ9xouSDrZWWVZSMzBFREdFMDQxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', 'Date', - 'Tue, 15 Sep 2020 01:15:32 GMT' + 'Mon, 25 Jan 2021 20:26:35 GMT' ]); diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_read_receipts.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_read_receipts.js index 6e6036f5756a..05c8e66db019 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_read_receipts.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_read_receipts.js @@ -1,27 +1,27 @@ let nock = require('nock'); -module.exports.hash = "d5ac84c6512134066cc2b9a1c527b9a8"; +module.exports.hash = "e351de90db1a935439638e481a932450"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) - .get('/chat/threads/19%3A069d3bbafc4840df836c5fe8e232a17f%40thread.v2/readreceipts') + .get('/chat/threads/19%3A14724b43dee94c22a938d44457110b8a%40thread.v2/readreceipts') .query(true) - .reply(200, {"value":[{"senderId":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-6169-1000-343a0d00002e","chatMessageId":"1600132531629","readOn":"2020-09-15T01:15:31Z"}]}, [ + .reply(200, {"value":[{"senderId":"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-9433-6032-3b3a0d0048e0","chatMessageId":"1611606392859","readOn":"2021-01-25T20:26:33Z"}]}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', - 'uQvxSIW3SEaaqZDeJ+gy0g.0', + '5wEvGyKNaUGSOCui8okG6Q.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', - '2020-07-20-preview1, 2020-09-21-preview2', + '2020-09-21-preview2, 2020-11-01-preview3', 'X-Processing-Time', - '78ms', + '60ms', 'X-Azure-Ref', - '0tRVgXwAAAACzJBDsDsJGR7neoafbRrWeV1NURURHRTA4MDcAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + '0fykPYAAAAAB649PQel6VRZrzCcGh3PF1WVZSMzBFREdFMDQxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', 'Date', - 'Tue, 15 Sep 2020 01:15:33 GMT' + 'Mon, 25 Jan 2021 20:26:39 GMT' ]); diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_threads.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_threads.js index 0237849e2546..00a3153fcf67 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_threads.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_threads.js @@ -1,27 +1,27 @@ let nock = require('nock'); -module.exports.hash = "56e6418e4edb192b7cf3ed51a0477e41"; +module.exports.hash = "6645e10e1b9f1da9eda440773d0537f4"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) .get('/chat/threads') .query(true) - .reply(200, {"value":[{"id":"19:069d3bbafc4840df836c5fe8e232a17f@thread.v2","topic":"test topic","isDeleted":false,"lastMessageReceivedOn":"2020-09-15T01:15:30Z"}]}, [ + .reply(200, {"value":[{"id":"19:14724b43dee94c22a938d44457110b8a@thread.v2","topic":"test topic","isDeleted":false,"lastMessageReceivedOn":"2021-01-25T20:26:30Z"}]}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', - 'MTtLJlz4f0C6wl/NutdDmg.0', + 'NQeimjFklkOI9XnZ4E09/Q.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', - '2020-07-20-preview1, 2020-09-21-preview2', + '2020-09-21-preview2, 2020-11-01-preview3', 'X-Processing-Time', - '92ms', + '86ms', 'X-Azure-Ref', - '0shVgXwAAAAAyxrushZzwS4ScuDHInDYLV1NURURHRTA4MjIAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + '0eCkPYAAAAADFFRD1y/xRTKuk39loBMGHWVZSMzBFREdFMDQxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', 'Date', - 'Tue, 15 Sep 2020 01:15:30 GMT' + 'Mon, 25 Jan 2021 20:26:32 GMT' ]); diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_remove_a_member.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_remove_a_member.js index 2f0a2f5c3226..5d32f3ea46f5 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_remove_a_member.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_remove_a_member.js @@ -1,23 +1,23 @@ let nock = require('nock'); -module.exports.hash = "4d337cb69527a689c6671b70c86910a7"; +module.exports.hash = "3c2d74fce1b4b9ed192351f1b149fe3d"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) - .delete('/chat/threads/19%3A069d3bbafc4840df836c5fe8e232a17f%40thread.v2/members/8%3Aacs%3A8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-62cc-6a0b-343a0d00003b') + .delete('/chat/threads/19%3A14724b43dee94c22a938d44457110b8a%40thread.v2/members/8%3Aacs%3Aec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-99e7-6032-3b3a0d0048e1') .query(true) .reply(204, "", [ 'MS-CV', - 'TTtZ8Kdwm0e+VrtUDntjMw.0', + '5EEV/yyQiUOzvnaBAZYUEw.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', - '2020-07-20-preview1, 2020-09-21-preview2', + '2020-09-21-preview2', 'X-Processing-Time', - '210ms', + '197ms', 'X-Azure-Ref', - '0tRVgXwAAAAAjjswrztmIQ7XDmToPbDUZV1NURURHRTA4MDcAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + '0fykPYAAAAACfHA97HrnsTpvZ1aUYq0O/WVZSMzBFREdFMDQxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', 'Date', - 'Tue, 15 Sep 2020 01:15:33 GMT' + 'Mon, 25 Jan 2021 20:26:39 GMT' ]); diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_retrieves_a_message.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_retrieves_a_message.js index 9503581c1e71..52233c44868e 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_retrieves_a_message.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_retrieves_a_message.js @@ -1,27 +1,27 @@ let nock = require('nock'); -module.exports.hash = "fb5e8197d261ca82151def1448387286"; +module.exports.hash = "351e07a6e84a7c1868189a472027db0c"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) - .get('/chat/threads/19%3A069d3bbafc4840df836c5fe8e232a17f%40thread.v2/messages/1600132531629') + .get('/chat/threads/19%3A14724b43dee94c22a938d44457110b8a%40thread.v2/messages/1611606392859') .query(true) - .reply(200, {"id":"1600132531629","type":"Text","priority":"Normal","version":"1600132531629","content":"content","senderDisplayName":"","createdOn":"2020-09-15T01:15:31Z","senderId":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-6169-1000-343a0d00002e"}, [ + .reply(200, {"id":"1611606392859","type":"Text","priority":"Normal","version":"1611606392859","content":"content","senderDisplayName":"","createdOn":"2021-01-25T20:26:32Z","senderId":"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-9433-6032-3b3a0d0048e0"}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', - 'pk99aJmf+UGBZucPu7I4IA.0', + '/yVKMuN2u0aXpxWK53l+mg.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', - '2020-07-20-preview1, 2020-09-21-preview2', + '2020-09-21-preview2, 2020-11-01-preview3', 'X-Processing-Time', - '81ms', + '62ms', 'X-Azure-Ref', - '0tBVgXwAAAADYcNiBWXSsS6Mlrzo8kRy3V1NURURHRTA4MDcAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + '0eikPYAAAAACRWCu8JurNS4xsQOftgvpbWVZSMzBFREdFMDQxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', 'Date', - 'Tue, 15 Sep 2020 01:15:32 GMT' + 'Mon, 25 Jan 2021 20:26:34 GMT' ]); diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_retrieves_a_thread.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_retrieves_a_thread.js index 5187e3bead09..e3158908d9d1 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_retrieves_a_thread.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_retrieves_a_thread.js @@ -1,27 +1,27 @@ let nock = require('nock'); -module.exports.hash = "53fcb8011d3ec2a23568f7adea0f9bcf"; +module.exports.hash = "4c98a9f5ec62a0dd8db7cf60afdac286"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) - .get('/chat/threads/19%3A069d3bbafc4840df836c5fe8e232a17f%40thread.v2') + .get('/chat/threads/19%3A14724b43dee94c22a938d44457110b8a%40thread.v2') .query(true) - .reply(200, {"id":"19:069d3bbafc4840df836c5fe8e232a17f@thread.v2","topic":"test topic","createdOn":"2020-09-15T01:15:30Z","createdBy":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-6169-1000-343a0d00002e","members":[{"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-6169-1000-343a0d00002e","shareHistoryTime":"1970-01-01T00:00:00Z"},{"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-62cc-6a0b-343a0d00003b","shareHistoryTime":"1970-01-01T00:00:00Z"}]}, [ + .reply(200, {"id":"19:14724b43dee94c22a938d44457110b8a@thread.v2","topic":"test topic","createdOn":"2021-01-25T20:26:30Z","createdBy":"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-9433-6032-3b3a0d0048e0","members":[{"id":"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-9433-6032-3b3a0d0048e0","shareHistoryTime":"1970-01-01T00:00:00Z"},{"id":"8:acs:ec403bbc-89a0-4037-a140-7ed471abd0e5_00000007-db1b-99e7-6032-3b3a0d0048e1","shareHistoryTime":"1970-01-01T00:00:00Z"}]}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', - 'v5/ksnGKT0KMGLIVRfXWqg.0', + 'r9c1nQHX/0WVzbDt8XemBw.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', - '2020-07-20-preview1, 2020-09-21-preview2', + '2020-09-21-preview2, 2020-11-01-preview3', 'X-Processing-Time', - '74ms', + '75ms', 'X-Azure-Ref', - '0shVgXwAAAACR3pxSiyK0RpqSNdkp9QmrV1NURURHRTA4MjIAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + '0dykPYAAAAACVcVj4PswvT4lS0OlKZDQFWVZSMzBFREdFMDQxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', 'Date', - 'Tue, 15 Sep 2020 01:15:30 GMT' + 'Mon, 25 Jan 2021 20:26:31 GMT' ]); diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_retrieves_a_thread_client.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_retrieves_a_thread_client.js index d9f3f19e2ca3..8a27d407e7e1 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_retrieves_a_thread_client.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_retrieves_a_thread_client.js @@ -1,5 +1,5 @@ let nock = require('nock'); -module.exports.hash = "8aa3b1a25da709558cd49c9570e3b886"; +module.exports.hash = "29db6d2d6cd038a02393480b1be6fcd2"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_sends_a_message.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_sends_a_message.js index 387189e19822..bfa4f15112fa 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_sends_a_message.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_sends_a_message.js @@ -1,29 +1,29 @@ let nock = require('nock'); -module.exports.hash = "44a1a3fb76689a98de0cbdfbe9b12da6"; +module.exports.hash = "397e36863f23efcd229d410a33dcc37f"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) - .post('/chat/threads/19%3A069d3bbafc4840df836c5fe8e232a17f%40thread.v2/messages', {"content":"content"}) + .post('/chat/threads/19%3A14724b43dee94c22a938d44457110b8a%40thread.v2/messages', {"content":"content"}) .query(true) - .reply(201, {"id":"1600132531629"}, [ + .reply(201, {"id":"1611606392859"}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'Location', - 'https://23.100.36.56/chat/threads/19%3A069d3bbafc4840df836c5fe8e232a17f@thread.v2/messages/1600132531629', + 'https://13.64.171.212/chat/threads/19%3A14724b43dee94c22a938d44457110b8a@thread.v2/messages/1611606392859', 'MS-CV', - 'FIg3LxgblEGJIxYzt0fwOA.0', + 'JC8ltbis102p7mCNbHjZxA.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', - '2020-07-20-preview1, 2020-09-21-preview2', + '2020-09-21-preview2, 2020-11-01-preview3', 'X-Processing-Time', - '385ms', + '122ms', 'X-Azure-Ref', - '0sxVgXwAAAACkhkEcouZ3T6w5FninU+PvV1NURURHRTA4MDcAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + '0eCkPYAAAAACcIYKmFVVmQ6IsniroLx2nWVZSMzBFREdFMDQxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', 'Date', - 'Tue, 15 Sep 2020 01:15:31 GMT' + 'Mon, 25 Jan 2021 20:26:32 GMT' ]); diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_sends_read_receipt.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_sends_read_receipt.js index d41a170b0928..e77ca2384030 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_sends_read_receipt.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_sends_read_receipt.js @@ -1,25 +1,25 @@ let nock = require('nock'); -module.exports.hash = "7bfeb93c91b865922918888b4e2a5ba3"; +module.exports.hash = "d4d886db28d5a84c886e4fb6e8961f29"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) - .post('/chat/threads/19%3A069d3bbafc4840df836c5fe8e232a17f%40thread.v2/readreceipts', {"chatMessageId":"1600132531629"}) + .post('/chat/threads/19%3A14724b43dee94c22a938d44457110b8a%40thread.v2/readreceipts', {"chatMessageId":"1611606392859"}) .query(true) .reply(201, "", [ 'MS-CV', - 'lvrG4RtFV0ugSXnDA9cAIA.0', + 'IbaoficFIUOxdqO3GPHMPw.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', - '2020-07-20-preview1, 2020-09-21-preview2', + '2020-09-21-preview2, 2020-11-01-preview3', 'X-Processing-Time', - '153ms', + '168ms', 'X-Azure-Ref', - '0sxVgXwAAAACKAzlLpSbQQb0oZ8zdLbZVV1NURURHRTA4MDcAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + '0eSkPYAAAAAAGZkSfGEScR4C7S3oDCvlqWVZSMzBFREdFMDQxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', 'Date', - 'Tue, 15 Sep 2020 01:15:32 GMT', + 'Mon, 25 Jan 2021 20:26:33 GMT', 'Content-Length', '0' ]); diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_sends_typing_notification.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_sends_typing_notification.js index 62ebd7b3147c..21028e729c2a 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_sends_typing_notification.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_sends_typing_notification.js @@ -1,25 +1,25 @@ let nock = require('nock'); -module.exports.hash = "dbe5b264c11dbef1d4f15779defd44e9"; +module.exports.hash = "33d8e6bf8697a18bf09f6892ba52451b"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) - .post('/chat/threads/19%3A069d3bbafc4840df836c5fe8e232a17f%40thread.v2/typing') + .post('/chat/threads/19%3A14724b43dee94c22a938d44457110b8a%40thread.v2/typing') .query(true) .reply(200, "", [ 'MS-CV', - '+gsZgiLhfUKis3Rqgrgkkg.0', + '6S96apxn7UmgpzhTecbbag.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', - '2020-07-20-preview1, 2020-09-21-preview2', + '2020-09-21-preview2, 2020-11-01-preview3', 'X-Processing-Time', - '116ms', + '104ms', 'X-Azure-Ref', - '0sxVgXwAAAAAbE4iW4VC8SbRG3BlrXKoSV1NURURHRTA4MDcAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + '0eCkPYAAAAAD+i8TyVfbuRquUnNz/GxPWWVZSMzBFREdFMDQxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', 'Date', - 'Tue, 15 Sep 2020 01:15:31 GMT', + 'Mon, 25 Jan 2021 20:26:33 GMT', 'Content-Length', '0' ]); diff --git a/sdk/communication/communication-chat/test/utils/recordedClient.ts b/sdk/communication/communication-chat/test/utils/recordedClient.ts index 8c29b054c0f3..5cd38a54e141 100644 --- a/sdk/communication/communication-chat/test/utils/recordedClient.ts +++ b/sdk/communication/communication-chat/test/utils/recordedClient.ts @@ -12,10 +12,7 @@ import { AzureCommunicationTokenCredential, parseClientArguments } from "@azure/communication-common"; -import { - CommunicationIdentityClient, - CommunicationUserToken -} from "@azure/communication-administration"; +import { CommunicationIdentityClient, CommunicationUserToken } from "@azure/communication-identity"; import { generateToken } from "./connectionUtils"; if (isNode) { From 1df171d8be00fc81c57f4c38cebad12620b3871c Mon Sep 17 00:00:00 2001 From: Dominik Messinger Date: Mon, 25 Jan 2021 13:59:56 -0800 Subject: [PATCH 4/6] fixed samples, fixes in changelog, readme and package.json --- .../communication-administration/CHANGELOG.md | 13 ++--- .../communication-identity/CHANGELOG.md | 50 ++----------------- .../communication-identity/README.md | 8 ++- .../communication-identity/sample.env | 3 -- .../samples/javascript/README.md | 12 ++--- .../samples/javascript/package.json | 4 +- .../samples/typescript/README.md | 12 ++--- .../samples/typescript/package.json | 4 +- .../samples/typescript/src/revokeTokens.ts | 2 +- .../communication-identity/test/README.md | 4 +- 10 files changed, 27 insertions(+), 85 deletions(-) diff --git a/sdk/communication/communication-administration/CHANGELOG.md b/sdk/communication/communication-administration/CHANGELOG.md index 622ca6d54ffe..05f838955f9d 100644 --- a/sdk/communication/communication-administration/CHANGELOG.md +++ b/sdk/communication/communication-administration/CHANGELOG.md @@ -2,22 +2,19 @@ ## 1.0.0-beta.4 (Unreleased) +### Added + +- `PhoneNumberAdministrationClient` added a constructor that supports `TokenCredential`. + ### Breaking Changes -- Replaced `CommunicationUser` with `CommunicationUserIdentifier`. -- `CommunicationIdentityClient` method `revokeTokens` no longer accepts `tokensValidFrom` as an argument. +- `CommunicationIdentityClient` moved to the new `@azure/communication-identity` package. ### Key bug fixes - Fixed a bug where poller options were ignored for `beginReleasePhoneNumbers`, `beginReservePhoneNumbers` and `beginPurchaseReservation`. - Fixed paging for `listPhoneNumbers`, `listPhonePlanGroups`, `listPhonePlans`, `listReleases`, `listSearches`, `listSupportedCountries`. -### Added - -- `CommunicationIdentityClient` added a constructor that supports `TokenCredential`. -- `PhoneNumberAdministrationClient` added a constructor that supports `TokenCredential`. -- `CommunicationIdentityClient` added a new method `createUserWithToken`. - ## 1.0.0-beta.3 (2020-11-16) ### Added diff --git a/sdk/communication/communication-identity/CHANGELOG.md b/sdk/communication/communication-identity/CHANGELOG.md index 576d455d7e26..1004d9b90584 100644 --- a/sdk/communication/communication-identity/CHANGELOG.md +++ b/sdk/communication/communication-identity/CHANGELOG.md @@ -2,56 +2,14 @@ ## 1.0.0-beta.4 (Unreleased) -### Breaking Changes - -- Replaced `CommunicationUser` with `CommunicationUserIdentifier`. -- `CommunicationIdentityClient` method `revokeTokens` no longer accepts `tokensValidFrom` as an argument. - -### Key bug fixes - -- Fixed a bug where poller options were ignored for `beginReleasePhoneNumbers`, `beginReservePhoneNumbers` and `beginPurchaseReservation`. -- Fixed paging for `listPhoneNumbers`, `listPhonePlanGroups`, `listPhonePlans`, `listReleases`, `listSearches`, `listSupportedCountries`. - ### Added +- Added `CommunicationIdentityClient` (originally part of the `@azure/communication-administration` package). - `CommunicationIdentityClient` added a constructor that supports `TokenCredential`. - `CommunicationIdentityClient` added a new method `createUserWithToken`. -## 1.0.0-beta.3 (2020-11-16) - -### Added - -- Added support for long-running operations. See details under Breaking Changes. - ### Breaking Changes -#### Model types - -- Renamed `CancelSearchOptions` to `CancelReservationOptions`. -- Removed `GetReleaseOptions`. -- Removed `GetSearchOptions`. -- Replaced `CreateSearchOptions` with `BeginReservePhoneNumbersOptions`. -- Replaced `PurchaseSearchOptions` with `BeginPurchaseReservationOptions`. -- Replaced `ReleasePhoneNumbersOptions` with `BeginReleasePhoneNumbersOptions`. -- Renamed `PhoneNumberSearch` to `PhoneNumberReservation`. - -#### `PhoneNumberReservation` - -- Renamed `searchId` property to `reservationId`. - -#### `PhoneNumberAdministrationClient` - -- Renamed `cancelSearch` to `cancelReservation`. -- Removed `getRelease` and `GetReleaseOptions`. -- Removed `getSearch` and `GetSearchOptions`. -- Replaced `createSearch` with `beginReservePhoneNumbers` which returns a poller for the long-running operation. -- Replaced `purchaseSearch` with `beginPurchaseReservation` which returns a poller for the long-running operation. -- Replaced `releasePhoneNumbers` with `beginReleasePhoneNumbers` which returns a poller for the long-running operation. - -## 1.0.0-beta.2 (2020-10-06) - -Added support for phone number administration. - -## 1.0.0-beta.1 (2020-09-22) - -The Azure Communication Administration Client library contains code which facilitates user token administration. +- Replaced `CommunicationUser` with `CommunicationUserIdentifier`. +- `CommunicationIdentityClient` method `revokeTokens` no longer accepts `tokensValidFrom` as an argument. +- `pstn` is removed from `TokenScope` diff --git a/sdk/communication/communication-identity/README.md b/sdk/communication/communication-identity/README.md index 97121849a200..01261853c982 100644 --- a/sdk/communication/communication-identity/README.md +++ b/sdk/communication/communication-identity/README.md @@ -1,6 +1,6 @@ # Azure Communication Identity client library for JavaScript -The administration library is used for managing users and tokens for Azure Communication Services. +The identity library is used for managing users and tokens for Azure Communication Services. ## Getting started @@ -51,7 +51,7 @@ const client = new CommunicationIdentityClient(connectionString); ```typescript import { CommunicationIdentityClient } from "@azure/communication-identity"; -let credential = new DefaultAzureCredential(); +const credential = new DefaultAzureCredential(); const client = new CommunicationIdentityClient(HOST, credential); ``` @@ -96,14 +96,12 @@ To refresh the user token, issue another token with the same user. #### Revoking tokens for a user -Use the `revokeTokens` method to revoke all the issued tokens of a user. +Use the `revokeTokens` method to revoke all issued tokens for a user. ```typescript await client.revokeTokens(user); ``` -`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked. - #### Deleting a user Use the `deleteUser` method to delete a user. diff --git a/sdk/communication/communication-identity/sample.env b/sdk/communication/communication-identity/sample.env index 5d6b667d81f6..587c69bb3fdf 100644 --- a/sdk/communication/communication-identity/sample.env +++ b/sdk/communication/communication-identity/sample.env @@ -5,6 +5,3 @@ COMMUNICATION_CONNECTION_STRING="endpoint=;accessKey=" # Our tests assume that TEST_MODE is "playback" by default. You can # change it to "record" to generate new recordings, or "live" to bypass the recorder entirely. # TEST_MODE=playback - -# Uncomment to run reserve, purchase and release operations with real phone numbers. -# INCLUDE_PHONENUMBER_LIVE_TESTS=true diff --git a/sdk/communication/communication-identity/samples/javascript/README.md b/sdk/communication/communication-identity/samples/javascript/README.md index 3d8dc152534f..3365dbc3d5a5 100644 --- a/sdk/communication/communication-identity/samples/javascript/README.md +++ b/sdk/communication/communication-identity/samples/javascript/README.md @@ -11,12 +11,10 @@ urlFragment: communication-administration-identity-javascript These sample programs show how to use the JavaScript client libraries for Azure Communication Service Administration Identity to issue and refresh tokens. -| **File Name** | **Description** | -| --------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| [issueToken.js][issuetoken] | uses the CommunicationIdentityClient to create a user and issue a token for this user | -| [revokeTokens.js][revoketokens] | uses the CommunicationIdentityClient to create a user, issue tokens for this user, and revoke these tokens | -| [purchasePhoneNumber.js][purchasephonenumber] | uses the PhoneNumberAdministrationClient to purchase a phone number | -| [releasePhoneNumbers.js][releasephonenumbers] | uses the PhoneNumberAdministrationClient to release phone numbers | +| **File Name** | **Description** | +| ------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| [issueToken.js][issuetoken] | uses the CommunicationIdentityClient to create a user and issue a token for this user | +| [revokeTokens.js][revoketokens] | uses the CommunicationIdentityClient to create a user, issue tokens for this user, and revoke these tokens | ## Prerequisites @@ -56,8 +54,6 @@ Take a look at our [API Documentation][apiref] for more information about the AP [issuetoken]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/javascript/issueToken.js [revoketokens]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/javascript/revokeTokens.js -[purchasephonenumber]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/javascript/purchasePhoneNumber.js -[releasephonenumbers]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/javascript/releasePhoneNumbers.js [apiref]: https://docs.microsoft.com/javascript/api/@azure/communication-administration [azcomsvc]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp [freesub]: https://azure.microsoft.com/free/ diff --git a/sdk/communication/communication-identity/samples/javascript/package.json b/sdk/communication/communication-identity/samples/javascript/package.json index cc15b6c32a8d..6880635ea8a3 100644 --- a/sdk/communication/communication-identity/samples/javascript/package.json +++ b/sdk/communication/communication-identity/samples/javascript/package.json @@ -1,7 +1,7 @@ { - "name": "azure-communication-configuration-user-token-samples-js", + "name": "azure-communication-identity-user-token-samples-js", "version": "0.1.0", - "description": "Azure Communication Service User Token Management client library samples for JavaScript", + "description": "Azure Communication Identity client library samples for JavaScript", "engine": { "node": ">=8.0.0" }, diff --git a/sdk/communication/communication-identity/samples/typescript/README.md b/sdk/communication/communication-identity/samples/typescript/README.md index e4acfe67bc9a..7511acc1d82e 100644 --- a/sdk/communication/communication-identity/samples/typescript/README.md +++ b/sdk/communication/communication-identity/samples/typescript/README.md @@ -11,12 +11,10 @@ urlFragment: communication-administration-identity-typescript These sample programs show how to use the TypeScript client libraries for Azure Communication Service Communication Identity to issue and refresh tokens. -| **File Name** | **Description** | -| --------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| [issueToken.ts][issuetoken] | uses the CommunicationIdentityClient to create a user and issue a token for this user | -| [revokeTokens.ts][revoketokens] | uses the CommunicationIdentityClient to create a user, issue tokens for this user, and revoke these tokens | -| [purchasePhoneNumber.ts][purchasephonenumber] | uses the PhoneNumberAdministrationClient to purchase a phone number | -| [releasePhoneNumbers.ts][releasephonenumbers] | uses the PhoneNumberAdministrationClient to release phone numbers. | +| **File Name** | **Description** | +| ------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| [issueToken.ts][issuetoken] | uses the CommunicationIdentityClient to create a user and issue a token for this user | +| [revokeTokens.ts][revoketokens] | uses the CommunicationIdentityClient to create a user, issue tokens for this user, and revoke these tokens | ## Prerequisites @@ -62,8 +60,6 @@ Take a look at our [API Documentation][apiref] for more information about the AP [issuetoken]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/typescript/src/issueToken.ts [revoketokens]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/typescript/src/revokeTokens.ts -[purchasephonenumber]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/typescript/src/purchasePhoneNumber.ts -[releasephonenumbers]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/typescript/src/releasePhoneNumbers.ts [apiref]: https://docs.microsoft.com/javascript/api/@azure/communication-administration [azcomsvc]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp [freesub]: https://azure.microsoft.com/free/ diff --git a/sdk/communication/communication-identity/samples/typescript/package.json b/sdk/communication/communication-identity/samples/typescript/package.json index 486b52feeb3e..8a3b706ada62 100644 --- a/sdk/communication/communication-identity/samples/typescript/package.json +++ b/sdk/communication/communication-identity/samples/typescript/package.json @@ -1,7 +1,7 @@ { - "name": "azure-communication-configuration-user-token-samples-ts", + "name": "azure-communication-identity-user-token-samples-ts", "version": "0.1.0", - "description": "Azure Communication Service User Token Management client library samples for TypeScript", + "description": "Azure Communication Identity client library samples for TypeScript", "engine": { "node": ">=8.0.0" }, diff --git a/sdk/communication/communication-identity/samples/typescript/src/revokeTokens.ts b/sdk/communication/communication-identity/samples/typescript/src/revokeTokens.ts index 00789bde3892..cba7b1b93c85 100644 --- a/sdk/communication/communication-identity/samples/typescript/src/revokeTokens.ts +++ b/sdk/communication/communication-identity/samples/typescript/src/revokeTokens.ts @@ -6,7 +6,7 @@ * issue a new user token. */ -import { CommunicationIdentityClient } from "@azure/communication-administration"; +import { CommunicationIdentityClient } from "@azure/communication-identity"; // Load the .env file if it exists import * as dotenv from "dotenv"; diff --git a/sdk/communication/communication-identity/test/README.md b/sdk/communication/communication-identity/test/README.md index 219d112a3086..7c69973190f7 100644 --- a/sdk/communication/communication-identity/test/README.md +++ b/sdk/communication/communication-identity/test/README.md @@ -2,7 +2,7 @@ To test this project, make sure to build it by following our [building instructions](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md#building), then follow the [testing instructions](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md#testing). -You can use existing Azure resources for the live tests, or generate new ones by using our [New-TestResources.ps1](https://github.com/Azure/azure-sdk-for-js/blob/master/eng/common/TestResources/New-TestResources.ps1) script, which will use an [ARM template](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/textanalytics/test-resources.json) that already has all of the the necessary configurations. +You can use existing Azure resources for the live tests, or generate new ones by using our [New-TestResources.ps1](https://github.com/Azure/azure-sdk-for-js/blob/master/eng/common/TestResources/New-TestResources.ps1) script, which will use an [ARM template](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/test-resources.json) that already has all of the the necessary configurations. The Azure resource that is used by the tests in this project is: @@ -16,4 +16,4 @@ To run the live tests, you will need to set the below environment variables: [azure_sub]: https://azure.microsoft.com/free/ [azure_portal]: https://portal.azure.com -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-identity%2FREADME.png) From 335a14fd724dd401fa9d264447faa038bfa91e0e Mon Sep 17 00:00:00 2001 From: Dominik Messinger Date: Mon, 25 Jan 2021 14:28:41 -0800 Subject: [PATCH 5/6] more changes from 'administration' to 'identity' --- sdk/communication/communication-identity/package.json | 2 +- .../samples/javascript/README.md | 10 +++++----- .../samples/typescript/README.md | 10 +++++----- .../src/communicationIdentityClient.ts | 2 +- .../src/generated/src/identityRestClientContext.ts | 2 +- .../swagger/{swagger.md => README.md} | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) rename sdk/communication/communication-identity/swagger/{swagger.md => README.md} (92%) diff --git a/sdk/communication/communication-identity/package.json b/sdk/communication/communication-identity/package.json index 6ac540b830bd..9f0517e1b3fc 100644 --- a/sdk/communication/communication-identity/package.json +++ b/sdk/communication/communication-identity/package.json @@ -9,7 +9,7 @@ "scripts": { "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", "build": "tsc -p . && rollup -c 2>&1 && api-extractor run --local", - "build:autorest": "autorest --typescript --version=3.0.6267 --v3 ./swagger/swagger.md && rushx format", + "build:autorest": "autorest --typescript --version=3.0.6267 --v3 ./swagger/README.md && rushx format", "build:clean": "rush update --recheck && rush rebuild && npm run build", "build:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1", "build:node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1", diff --git a/sdk/communication/communication-identity/samples/javascript/README.md b/sdk/communication/communication-identity/samples/javascript/README.md index 3365dbc3d5a5..c3ba526a09df 100644 --- a/sdk/communication/communication-identity/samples/javascript/README.md +++ b/sdk/communication/communication-identity/samples/javascript/README.md @@ -4,7 +4,7 @@ languages: - javascript products: - azure -urlFragment: communication-administration-identity-javascript +urlFragment: communication-identity-javascript --- # Azure Communication Service Administration Identity client library sample for JavaScript @@ -52,9 +52,9 @@ npx cross-env COMMUNICATION_CONNECTION_STRING="" node issueTo Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. -[issuetoken]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/javascript/issueToken.js -[revoketokens]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/javascript/revokeTokens.js -[apiref]: https://docs.microsoft.com/javascript/api/@azure/communication-administration +[issuetoken]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-identity/samples/javascript/issueToken.js +[revoketokens]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-identity/samples/javascript/revokeTokens.js +[apiref]: https://docs.microsoft.com/javascript/api/@azure/communication-identity [azcomsvc]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp [freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/README.md +[package]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-identity/README.md diff --git a/sdk/communication/communication-identity/samples/typescript/README.md b/sdk/communication/communication-identity/samples/typescript/README.md index 7511acc1d82e..f9e7363c82e1 100644 --- a/sdk/communication/communication-identity/samples/typescript/README.md +++ b/sdk/communication/communication-identity/samples/typescript/README.md @@ -4,7 +4,7 @@ languages: - typescript products: - azure -urlFragment: communication-administration-identity-typescript +urlFragment: communication-identity-typescript --- # Azure Communication Service Communication Identity client library sample for TypeScript @@ -58,9 +58,9 @@ npx cross-env COMMUNICATION_CONNECTION_STRING="" node dist/is Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. -[issuetoken]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/typescript/src/issueToken.ts -[revoketokens]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples/typescript/src/revokeTokens.ts -[apiref]: https://docs.microsoft.com/javascript/api/@azure/communication-administration +[issuetoken]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-identity/samples/typescript/src/issueToken.ts +[revoketokens]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-identity/samples/typescript/src/revokeTokens.ts +[apiref]: https://docs.microsoft.com/javascript/api/@azure/communication-identity [azcomsvc]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp [freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/README.md +[package]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-identity/README.md diff --git a/sdk/communication/communication-identity/src/communicationIdentityClient.ts b/sdk/communication/communication-identity/src/communicationIdentityClient.ts index 2d8aa0981cbc..5711547d54a7 100644 --- a/sdk/communication/communication-identity/src/communicationIdentityClient.ts +++ b/sdk/communication/communication-identity/src/communicationIdentityClient.ts @@ -88,7 +88,7 @@ export class CommunicationIdentityClient { const options = isCommunicationIdentityOptions(credentialOrOptions) ? credentialOrOptions : maybeOptions; - const libInfo = `azsdk-js-communication-administration/${SDK_VERSION}`; + const libInfo = `azsdk-js-communication-identity/${SDK_VERSION}`; if (!options.userAgentOptions) { options.userAgentOptions = {}; diff --git a/sdk/communication/communication-identity/src/generated/src/identityRestClientContext.ts b/sdk/communication/communication-identity/src/generated/src/identityRestClientContext.ts index 3707490a0f14..dc57616cbf23 100644 --- a/sdk/communication/communication-identity/src/generated/src/identityRestClientContext.ts +++ b/sdk/communication/communication-identity/src/generated/src/identityRestClientContext.ts @@ -9,7 +9,7 @@ import * as coreHttp from "@azure/core-http"; import { IdentityRestClientOptionalParams } from "./models"; -const packageName = "azure-communication-administration-identity"; +const packageName = "azure-communication-identity"; const packageVersion = "1.0.0-beta.4"; export class IdentityRestClientContext extends coreHttp.ServiceClient { diff --git a/sdk/communication/communication-identity/swagger/swagger.md b/sdk/communication/communication-identity/swagger/README.md similarity index 92% rename from sdk/communication/communication-identity/swagger/swagger.md rename to sdk/communication/communication-identity/swagger/README.md index fecdc0c731e5..ab66fec413d4 100644 --- a/sdk/communication/communication-identity/swagger/swagger.md +++ b/sdk/communication/communication-identity/swagger/README.md @@ -5,7 +5,7 @@ ## Configuration ```yaml -package-name: azure-communication-administration-identity +package-name: azure-communication-identity override-client-name: IdentityRestClient description: Communication identity client package-version: 1.0.0-beta.4 From 98a696b8610f232fad3cab650967234833857b84 Mon Sep 17 00:00:00 2001 From: Dominik Messinger Date: Mon, 25 Jan 2021 15:19:47 -0800 Subject: [PATCH 6/6] comment broken links --- .../communication-identity/samples/javascript/README.md | 2 +- .../communication-identity/samples/typescript/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/communication/communication-identity/samples/javascript/README.md b/sdk/communication/communication-identity/samples/javascript/README.md index c3ba526a09df..03672d5200de 100644 --- a/sdk/communication/communication-identity/samples/javascript/README.md +++ b/sdk/communication/communication-identity/samples/javascript/README.md @@ -50,7 +50,7 @@ npx cross-env COMMUNICATION_CONNECTION_STRING="" node issueTo ## Next Steps -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. +Take a look at our API Documentation for more information about the APIs that are available in the clients. [issuetoken]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-identity/samples/javascript/issueToken.js [revoketokens]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-identity/samples/javascript/revokeTokens.js diff --git a/sdk/communication/communication-identity/samples/typescript/README.md b/sdk/communication/communication-identity/samples/typescript/README.md index f9e7363c82e1..4c0339e4858b 100644 --- a/sdk/communication/communication-identity/samples/typescript/README.md +++ b/sdk/communication/communication-identity/samples/typescript/README.md @@ -56,7 +56,7 @@ npx cross-env COMMUNICATION_CONNECTION_STRING="" node dist/is ## Next Steps -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. +Take a look at our API Documentation for more information about the APIs that are available in the clients. [issuetoken]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-identity/samples/typescript/src/issueToken.ts [revoketokens]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-identity/samples/typescript/src/revokeTokens.ts