diff --git a/Changelog.md b/Changelog.md index 570996d..70209a3 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,6 +1,6 @@ # Changelog -## 2.5.4 - (2021-07-29) +## 2.6.0 - (2021-07-29) - Added a new property `baseUri` on the `ServiceClientOptions`, so that when a `TokenCredential` is sent to `ServiceClient`, it now automatically sets the scope of future token requests based on the `options.baseUri` property. diff --git a/lib/serializer.ts b/lib/serializer.ts index 48ba201..9ea94fc 100644 --- a/lib/serializer.ts +++ b/lib/serializer.ts @@ -735,7 +735,11 @@ function deserializeCompositeType( // paging if (Array.isArray(responseBody[key]) && modelProps[key].serializedName === "") { propertyInstance = responseBody[key]; - const arrayInstance = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName); + const arrayInstance = serializer.deserialize( + propertyMapper, + propertyInstance, + propertyObjectName + ); // Copy over any properties that have already been added into the instance, where they do // not exist on the newly de-serialized array for (const [key, value] of Object.entries(instance)) { diff --git a/lib/serviceClient.ts b/lib/serviceClient.ts index f5f14ba..c6ddbe5 100644 --- a/lib/serviceClient.ts +++ b/lib/serviceClient.ts @@ -144,8 +144,13 @@ export interface ServiceClientOptions { */ agentSettings?: AgentSettings; /** - * If specified, this is the base URI that requests will be made against for this ServiceClient. - * If it is not specified, then all OperationSpecs must contain a baseUrl property. + * If specified: + * - This `baseUri` becomes the base URI that requests will be made against for this ServiceClient. + * - If a `TokenCredential` was passed through the constructor, this `baseUri` defines the `getToken` scope to be `${options.baseUri}/.default`. + * + * If it is not specified: + * - All OperationSpecs must contain a baseUrl property. + * - If a `TokenCredential` was passed through the constructor, the `getToken` scope is set to be "https://management.azure.com/.default". */ baseUri?: string; } @@ -156,8 +161,13 @@ export interface ServiceClientOptions { */ export class ServiceClient { /** - * If specified, this is the base URI that requests will be made against for this ServiceClient. - * If it is not specified, then all OperationSpecs must contain a baseUrl property. + * If specified: + * - This `baseUri` becomes the base URI that requests will be made against for this ServiceClient. + * - If a `TokenCredential` was passed through the constructor, this `baseUri` defines the `getToken` scope to be `${options.baseUri}/.default`. + * + * If it is not specified: + * - All OperationSpecs must contain a baseUrl property. + * - If a `TokenCredential` was passed through the constructor, the `getToken` scope is set to be "https://management.azure.com/.default". */ protected baseUri?: string; diff --git a/lib/util/constants.ts b/lib/util/constants.ts index ccad69d..44a4f25 100644 --- a/lib/util/constants.ts +++ b/lib/util/constants.ts @@ -7,7 +7,7 @@ export const Constants = { * @const * @type {string} */ - msRestVersion: "2.5.4", + msRestVersion: "2.6.0", /** * Specifies HTTP. diff --git a/package.json b/package.json index 45d9b11..c6c9187 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "email": "azsdkteam@microsoft.com", "url": "https://github.com/Azure/ms-rest-js" }, - "version": "2.5.4", + "version": "2.6.0", "description": "Isomorphic client Runtime for Typescript/node.js/browser javascript client libraries generated using AutoRest", "tags": [ "isomorphic",