diff --git a/sdk/healthcareapis/arm-healthcareapis/CHANGELOG.md b/sdk/healthcareapis/arm-healthcareapis/CHANGELOG.md index 272958ead73b..b686dcc5702a 100644 --- a/sdk/healthcareapis/arm-healthcareapis/CHANGELOG.md +++ b/sdk/healthcareapis/arm-healthcareapis/CHANGELOG.md @@ -1,15 +1,21 @@ # Release History + +## 2.2.0 (2022-07-26) + +**Features** -## 2.1.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added Interface CorsConfiguration + - Added Interface FhirServiceImportConfiguration + - Added Interface ServiceImportConfigurationInfo + - Interface MetricSpecification has a new optional parameter enableRegionalMdmAccount + - Interface MetricSpecification has a new optional parameter isInternal + - Interface MetricSpecification has a new optional parameter metricFilterPattern + - Interface MetricSpecification has a new optional parameter resourceIdDimensionNameOverride + - Interface MetricSpecification has a new optional parameter sourceMdmAccount + - Interface ServicesProperties has a new optional parameter importConfiguration + - Type Alias DicomService has a new parameter corsConfiguration + - Type Alias FhirService has a new parameter importConfiguration + ## 2.1.1 (2022-04-26) **Features** diff --git a/sdk/healthcareapis/arm-healthcareapis/_meta.json b/sdk/healthcareapis/arm-healthcareapis/_meta.json index af960dd6d7d1..e1fd5efebf37 100644 --- a/sdk/healthcareapis/arm-healthcareapis/_meta.json +++ b/sdk/healthcareapis/arm-healthcareapis/_meta.json @@ -1,8 +1,8 @@ { - "commit": "1f1d5b0b9ce6cc94605b2fd619dce374fb6e033a", - "readme": "specification\\healthcareapis\\resource-manager\\readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\healthcareapis\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1 --generate-sample=true", + "commit": "f893d78aca0270108c7683d86a9893bd796cfc19", + "readme": "specification/healthcareapis/resource-manager/readme.md", + "autorest_command": "", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.2.6", - "use": "@autorest/typescript@6.0.0-alpha.19.20220408.1" -} + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.1", + "use": "@autorest/typescript@6.0.0-alpha.19.20220425.1" +} \ No newline at end of file diff --git a/sdk/healthcareapis/arm-healthcareapis/package.json b/sdk/healthcareapis/arm-healthcareapis/package.json index 7c8c5ec5f2d6..5763db17f055 100644 --- a/sdk/healthcareapis/arm-healthcareapis/package.json +++ b/sdk/healthcareapis/arm-healthcareapis/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for HealthcareApisManagementClient.", - "version": "2.1.2", + "version": "2.2.0", "engines": { "node": ">=12.0.0" }, @@ -40,9 +40,11 @@ "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", - "@azure-tools/test-recorder": "^1.0.0", + "@azure-tools/test-recorder": "^2.0.0", + "@azure-tools/test-credential": "^1.0.0", "mocha": "^7.1.1", - "cross-env": "^7.0.2" + "cross-env": "^7.0.2", + "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/healthcareapis/arm-healthcareapis", "repository": { @@ -93,7 +95,7 @@ "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", "unit-test:browser": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", "integration-test:browser": "echo skipped", "docs": "echo skipped" }, @@ -106,13 +108,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-healthcareapis?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/healthcareapis/arm-healthcareapis/review/arm-healthcareapis.api.md b/sdk/healthcareapis/arm-healthcareapis/review/arm-healthcareapis.api.md index ab892a24e425..57aa08ddb244 100644 --- a/sdk/healthcareapis/arm-healthcareapis/review/arm-healthcareapis.api.md +++ b/sdk/healthcareapis/arm-healthcareapis/review/arm-healthcareapis.api.md @@ -19,6 +19,15 @@ export interface CheckNameAvailabilityParameters { type: string; } +// @public +export interface CorsConfiguration { + allowCredentials?: boolean; + headers?: string[]; + maxAge?: number; + methods?: string[]; + origins?: string[]; +} + // @public export type CreatedByType = string; @@ -27,6 +36,7 @@ export type DicomService = TaggedResource & ServiceManagedIdentity & { readonly systemData?: SystemData; readonly provisioningState?: ProvisioningState; authenticationConfiguration?: DicomServiceAuthenticationConfiguration; + corsConfiguration?: CorsConfiguration; readonly serviceUrl?: string; readonly privateEndpointConnections?: PrivateEndpointConnection[]; publicNetworkAccess?: PublicNetworkAccess; @@ -157,6 +167,7 @@ export type FhirService = TaggedResource & ServiceManagedIdentity & { publicNetworkAccess?: PublicNetworkAccess; readonly eventState?: ServiceEventState; resourceVersionPolicyConfiguration?: ResourceVersionPolicyConfiguration; + importConfiguration?: FhirServiceImportConfiguration; }; // @public @@ -197,6 +208,13 @@ export interface FhirServiceExportConfiguration { storageAccountName?: string; } +// @public +export interface FhirServiceImportConfiguration { + enabled?: boolean; + initialImportMode?: boolean; + integrationDataStore?: string; +} + // @public export type FhirServiceKind = string; @@ -637,8 +655,13 @@ export interface MetricSpecification { dimensions?: MetricDimension[]; displayDescription?: string; displayName?: string; + enableRegionalMdmAccount?: boolean; fillGapWithZero?: boolean; + isInternal?: boolean; + metricFilterPattern?: string; name?: string; + resourceIdDimensionNameOverride?: string; + sourceMdmAccount?: string; sourceMdmNamespace?: string; supportedAggregationTypes?: string[]; supportedTimeGrainTypes?: string[]; @@ -905,6 +928,13 @@ export interface ServiceExportConfigurationInfo { storageAccountName?: string; } +// @public +export interface ServiceImportConfigurationInfo { + enabled?: boolean; + initialImportMode?: boolean; + integrationDataStore?: string; +} + // @public export interface ServiceManagedIdentity { identity?: ServiceManagedIdentityIdentity; @@ -1045,6 +1075,7 @@ export interface ServicesProperties { corsConfiguration?: ServiceCorsConfigurationInfo; cosmosDbConfiguration?: ServiceCosmosDbConfigurationInfo; exportConfiguration?: ServiceExportConfigurationInfo; + importConfiguration?: ServiceImportConfigurationInfo; privateEndpointConnections?: PrivateEndpointConnection[]; readonly provisioningState?: ProvisioningState; publicNetworkAccess?: PublicNetworkAccess; diff --git a/sdk/healthcareapis/arm-healthcareapis/src/healthcareApisManagementClient.ts b/sdk/healthcareapis/arm-healthcareapis/src/healthcareApisManagementClient.ts index b00723797cc3..cddf907b819a 100644 --- a/sdk/healthcareapis/arm-healthcareapis/src/healthcareApisManagementClient.ts +++ b/sdk/healthcareapis/arm-healthcareapis/src/healthcareApisManagementClient.ts @@ -8,6 +8,11 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest +} from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { ServicesImpl, @@ -73,7 +78,7 @@ export class HealthcareApisManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-healthcareapis/2.1.2`; + const packageDetails = `azsdk-js-arm-healthcareapis/2.2.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -120,7 +125,7 @@ export class HealthcareApisManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-11-01"; + this.apiVersion = options.apiVersion || "2022-06-01"; this.services = new ServicesImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); this.privateLinkResources = new PrivateLinkResourcesImpl(this); @@ -140,6 +145,35 @@ export class HealthcareApisManagementClient extends coreClient.ServiceClient { ); this.operations = new OperationsImpl(this); this.operationResults = new OperationResultsImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return item.replace(/(?<==).*$/, apiVersion); + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + } + }; + this.pipeline.addPolicy(apiVersionPolicy); } services: Services; diff --git a/sdk/healthcareapis/arm-healthcareapis/src/models/index.ts b/sdk/healthcareapis/arm-healthcareapis/src/models/index.ts index db860e005f4c..c771d4cd03e0 100644 --- a/sdk/healthcareapis/arm-healthcareapis/src/models/index.ts +++ b/sdk/healthcareapis/arm-healthcareapis/src/models/index.ts @@ -31,6 +31,8 @@ export interface ServicesProperties { publicNetworkAccess?: PublicNetworkAccess; /** The azure container registry settings used for convert data operation of the service instance. */ acrConfiguration?: ServiceAcrConfigurationInfo; + /** The settings for the import operation of the service instance. */ + importConfiguration?: ServiceImportConfigurationInfo; } /** An access policy entry. */ @@ -133,6 +135,16 @@ export interface ServiceOciArtifactEntry { digest?: string; } +/** Import operation configuration information */ +export interface ServiceImportConfigurationInfo { + /** The name of the default integration storage account. */ + integrationDataStore?: string; + /** If the FHIR service is in InitialImportMode. */ + initialImportMode?: boolean; + /** If the import operation is enabled. */ + enabled?: boolean; +} + /** Metadata pertaining to creation and last modification of the resource. */ export interface SystemData { /** The identity that created the resource. */ @@ -350,6 +362,20 @@ export interface DicomServiceAuthenticationConfiguration { readonly audiences?: string[]; } +/** The settings for the CORS configuration of the service instance. */ +export interface CorsConfiguration { + /** The origins to be allowed via CORS. */ + origins?: string[]; + /** The headers to be allowed via CORS. */ + headers?: string[]; + /** The methods to be allowed via CORS. */ + methods?: string[]; + /** The max age to be allowed via CORS. */ + maxAge?: number; + /** If credentials are allowed via CORS. */ + allowCredentials?: boolean; +} + /** Managed service identity (system assigned and/or user assigned identities) */ export interface ServiceManagedIdentity { /** Setting indicating whether the service has a managed identity associated with it. */ @@ -489,6 +515,16 @@ export interface ResourceVersionPolicyConfiguration { resourceTypeOverrides?: { [propertyName: string]: FhirResourceVersionPolicy }; } +/** Import operation configuration information */ +export interface FhirServiceImportConfiguration { + /** The name of the default integration storage account. */ + integrationDataStore?: string; + /** If the FHIR service is in InitialImportMode. */ + initialImportMode?: boolean; + /** If the import operation is enabled. */ + enabled?: boolean; +} + /** Available operations of the service */ export interface ListOperations { /** @@ -599,10 +635,20 @@ export interface MetricSpecification { supportedTimeGrainTypes?: string[]; /** Optional. If set to true, then zero will be returned for time duration where no metric is emitted/published. */ fillGapWithZero?: boolean; + /** Pattern for the filter of the metric. */ + metricFilterPattern?: string; /** Dimensions of the metric */ dimensions?: MetricDimension[]; - /** Name of the MDM namespace. Optional. */ + /** Whether the metric is internal. */ + isInternal?: boolean; + /** The source MDM account. */ + sourceMdmAccount?: string; + /** The source MDM namespace. */ sourceMdmNamespace?: string; + /** Whether regional MDM account enabled. */ + enableRegionalMdmAccount?: boolean; + /** The resource Id dimension name override. */ + resourceIdDimensionNameOverride?: string; } /** Specifications of the Dimension of metrics */ @@ -731,6 +777,8 @@ export type DicomService = TaggedResource & readonly provisioningState?: ProvisioningState; /** Dicom Service authentication configuration. */ authenticationConfiguration?: DicomServiceAuthenticationConfiguration; + /** Dicom Service Cors configuration. */ + corsConfiguration?: CorsConfiguration; /** * The url of the Dicom Services. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -803,6 +851,8 @@ export type FhirService = TaggedResource & readonly eventState?: ServiceEventState; /** Determines tracking of history for resources. */ resourceVersionPolicyConfiguration?: ResourceVersionPolicyConfiguration; + /** Fhir Service import configuration. */ + importConfiguration?: FhirServiceImportConfiguration; }; /** IoT Connector destination properties for an Azure FHIR service. */ diff --git a/sdk/healthcareapis/arm-healthcareapis/src/models/mappers.ts b/sdk/healthcareapis/arm-healthcareapis/src/models/mappers.ts index ab8daba5f2cc..d6b33fe0cdfb 100644 --- a/sdk/healthcareapis/arm-healthcareapis/src/models/mappers.ts +++ b/sdk/healthcareapis/arm-healthcareapis/src/models/mappers.ts @@ -84,6 +84,13 @@ export const ServicesProperties: coreClient.CompositeMapper = { name: "Composite", className: "ServiceAcrConfigurationInfo" } + }, + importConfiguration: { + serializedName: "importConfiguration", + type: { + name: "Composite", + className: "ServiceImportConfigurationInfo" + } } } } @@ -372,6 +379,33 @@ export const ServiceOciArtifactEntry: coreClient.CompositeMapper = { } }; +export const ServiceImportConfigurationInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServiceImportConfigurationInfo", + modelProperties: { + integrationDataStore: { + serializedName: "integrationDataStore", + type: { + name: "String" + } + }, + initialImportMode: { + serializedName: "initialImportMode", + type: { + name: "Boolean" + } + }, + enabled: { + serializedName: "enabled", + type: { + name: "Boolean" + } + } + } + } +}; + export const SystemData: coreClient.CompositeMapper = { type: { name: "Composite", @@ -892,6 +926,69 @@ export const DicomServiceAuthenticationConfiguration: coreClient.CompositeMapper } }; +export const CorsConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CorsConfiguration", + modelProperties: { + origins: { + serializedName: "origins", + type: { + name: "Sequence", + element: { + constraints: { + Pattern: new RegExp( + "^(?:(?:(?:[hH][tT][tT][pP](?:[sS]|))\\:\\/\\/(?:[a-zA-Z0-9-]+[.]?)+(?:\\:[0-9]{1,5})?|[*]))$" + ) + }, + type: { + name: "String" + } + } + } + }, + headers: { + serializedName: "headers", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + methods: { + serializedName: "methods", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + maxAge: { + constraints: { + InclusiveMaximum: 99999, + InclusiveMinimum: 0 + }, + serializedName: "maxAge", + type: { + name: "Number" + } + }, + allowCredentials: { + serializedName: "allowCredentials", + type: { + name: "Boolean" + } + } + } + } +}; + export const ServiceManagedIdentity: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1290,6 +1387,33 @@ export const ResourceVersionPolicyConfiguration: coreClient.CompositeMapper = { } }; +export const FhirServiceImportConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FhirServiceImportConfiguration", + modelProperties: { + integrationDataStore: { + serializedName: "integrationDataStore", + type: { + name: "String" + } + }, + initialImportMode: { + serializedName: "initialImportMode", + type: { + name: "Boolean" + } + }, + enabled: { + serializedName: "enabled", + type: { + name: "Boolean" + } + } + } + } +}; + export const ListOperations: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1551,6 +1675,12 @@ export const MetricSpecification: coreClient.CompositeMapper = { name: "Boolean" } }, + metricFilterPattern: { + serializedName: "metricFilterPattern", + type: { + name: "String" + } + }, dimensions: { serializedName: "dimensions", type: { @@ -1563,11 +1693,35 @@ export const MetricSpecification: coreClient.CompositeMapper = { } } }, + isInternal: { + serializedName: "isInternal", + type: { + name: "Boolean" + } + }, + sourceMdmAccount: { + serializedName: "sourceMdmAccount", + type: { + name: "String" + } + }, sourceMdmNamespace: { serializedName: "sourceMdmNamespace", type: { name: "String" } + }, + enableRegionalMdmAccount: { + serializedName: "enableRegionalMdmAccount", + type: { + name: "Boolean" + } + }, + resourceIdDimensionNameOverride: { + serializedName: "resourceIdDimensionNameOverride", + type: { + name: "String" + } } } } @@ -1865,6 +2019,13 @@ export const DicomService: coreClient.CompositeMapper = { className: "DicomServiceAuthenticationConfiguration" } }, + corsConfiguration: { + serializedName: "properties.corsConfiguration", + type: { + name: "Composite", + className: "CorsConfiguration" + } + }, serviceUrl: { serializedName: "properties.serviceUrl", readOnly: true, @@ -2033,6 +2194,13 @@ export const FhirService: coreClient.CompositeMapper = { name: "Composite", className: "ResourceVersionPolicyConfiguration" } + }, + importConfiguration: { + serializedName: "properties.importConfiguration", + type: { + name: "Composite", + className: "FhirServiceImportConfiguration" + } } } } diff --git a/sdk/healthcareapis/arm-healthcareapis/src/models/parameters.ts b/sdk/healthcareapis/arm-healthcareapis/src/models/parameters.ts index a4cc731cb932..51642e394db7 100644 --- a/sdk/healthcareapis/arm-healthcareapis/src/models/parameters.ts +++ b/sdk/healthcareapis/arm-healthcareapis/src/models/parameters.ts @@ -55,7 +55,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-11-01", + defaultValue: "2022-06-01", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/healthcareapis/arm-healthcareapis/test/sampleTest.ts b/sdk/healthcareapis/arm-healthcareapis/test/sampleTest.ts index 7ed89b043e1b..25aeb3ebcc36 100644 --- a/sdk/healthcareapis/arm-healthcareapis/test/sampleTest.ts +++ b/sdk/healthcareapis/arm-healthcareapis/test/sampleTest.ts @@ -7,35 +7,30 @@ */ import { - env, - record, - RecorderEnvironmentSetup, - Recorder + Recorder, + RecorderStartOptions, + env } from "@azure-tools/test-recorder"; -import * as assert from "assert"; +import { assert } from "chai"; +import { Context } from "mocha"; -const recorderEnvSetup: RecorderEnvironmentSetup = { - replaceableVariables: { - AZURE_CLIENT_ID: "azure_client_id", - AZURE_CLIENT_SECRET: "azure_client_secret", - AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", - SUBSCRIPTION_ID: "azure_subscription_id" - }, - customizationsOnRecordings: [ - (recording: any): any => - recording.replace( - /"access_token":"[^"]*"/g, - `"access_token":"access_token"` - ) - ], - queryParametersToSkip: [] +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables }; describe("My test", () => { let recorder: Recorder; - beforeEach(async function() { - recorder = record(this, recorderEnvSetup); + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); }); afterEach(async function() { diff --git a/sdk/healthcareapis/arm-healthcareapis/tsconfig.json b/sdk/healthcareapis/arm-healthcareapis/tsconfig.json index c8e6903ace68..3e6ae96443f3 100644 --- a/sdk/healthcareapis/arm-healthcareapis/tsconfig.json +++ b/sdk/healthcareapis/arm-healthcareapis/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-healthcareapis": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"