diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index b71e08ea50a9..e788b9899a56 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -13033,7 +13033,7 @@ packages: dev: false file:projects/arm-mariadb.tgz: - resolution: {integrity: sha512-HpB8rMa4Yz2EglRfU3Opq/a34+VoTVub6I7O7VYiVFwYUUYFNj+HgUSYhM2idcEvGgiDdBRGajl6HNA59iEHng==, tarball: file:projects/arm-mariadb.tgz} + resolution: {integrity: sha512-auvbnXtCOBf9+kjUdIP+Ib+NVllgt8CG0u7nsvfT75qMOuc/Q5DlOy271Snrmwet91ydQ04Q9sDoNnymWUfUBw==, tarball: file:projects/arm-mariadb.tgz} name: '@rush-temp/arm-mariadb' version: 0.0.0 dependencies: @@ -13044,6 +13044,8 @@ packages: '@rollup/plugin-json': 4.1.0_rollup@2.79.1 '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 + '@types/chai': 4.3.3 + chai: 4.3.6 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 @@ -13051,11 +13053,10 @@ packages: rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1 tslib: 2.4.0 - typescript: 4.2.4 + typescript: 4.6.4 uglify-js: 3.17.4 transitivePeerDependencies: - '@types/node' - - encoding - supports-color dev: false @@ -15551,7 +15552,7 @@ packages: dev: false file:projects/communication-email.tgz: - resolution: {integrity: sha512-RhI+WjqfaBqh0U8veuoa5ZrFNTH/LJzWkOM3Q85xPYbUjbnSRYz4EoAMjHQqVmj9hZvhSbouIUKVsBQ2oQM8jA==, tarball: file:projects/communication-email.tgz} + resolution: {integrity: sha512-JUM2HfVa7yIVOHZ2hdb4QjOe3EA0XgNw+8TTjKDJ4319hEcss0cdw4lSg6kBG/S1EGL+yjS+xY86YWkY68xw+g==, tarball: file:projects/communication-email.tgz} name: '@rush-temp/communication-email' version: 0.0.0 dependencies: @@ -17312,7 +17313,7 @@ packages: dev: false file:projects/keyvault-admin.tgz: - resolution: {integrity: sha512-zt5Iu56m9r0icm/kPw+dSYGCDhXP9YvUODLIlCinUSBZ8/dhcr2ovf57pb/5Ojqjuaxo2Lpj4ON9Q2Moc1pPYw==, tarball: file:projects/keyvault-admin.tgz} + resolution: {integrity: sha512-qegEv0paVx7dHJIGMtm8fTGiVf0AKTLUquBP7seg/SwQ2X1SMJR0O5XOJrIyfX1VBG7L+TSr04adfr/1TIR2YQ==, tarball: file:projects/keyvault-admin.tgz} name: '@rush-temp/keyvault-admin' version: 0.0.0 dependencies: @@ -18129,7 +18130,7 @@ packages: dev: false file:projects/perf-app-configuration.tgz: - resolution: {integrity: sha512-BzR9fvBllxo1pEws5GZiMxuzWLQ7KjDJMfrzlcfwWZIldYlntxGolkUbdVYKsQlxiiq6W+aq/OY8j3AGqI7cwQ==, tarball: file:projects/perf-app-configuration.tgz} + resolution: {integrity: sha512-b33BULpxOX6J9dR9f56lJ7afd7XBXxEQZBtZwG3pq0Slu6LjWh717zNT0t+HV/uNPpDTUySako6JAzVPT5yJWQ==, tarball: file:projects/perf-app-configuration.tgz} name: '@rush-temp/perf-app-configuration' version: 0.0.0 dependencies: @@ -18512,7 +18513,7 @@ packages: dev: false file:projects/perf-template.tgz: - resolution: {integrity: sha512-CR7LZ2mTcTzlarWLzMt5NaXWF8Wqyxkq9XPVS7BXzPMLAUx2sjTkZtDBuNK0UQ+lGJ3uqhpokEQO6A6jw9fwtg==, tarball: file:projects/perf-template.tgz} + resolution: {integrity: sha512-vkGuclIBHH0EYig/IAlJuKXo0FPxnqH3LWulE/Ibe4LUnjHFEv6qTEtps9HpSL/UhkERBiBJo5o7wsNO/ElgwA==, tarball: file:projects/perf-template.tgz} name: '@rush-temp/perf-template' version: 0.0.0 dependencies: diff --git a/sdk/mariadb/arm-mariadb/CHANGELOG.md b/sdk/mariadb/arm-mariadb/CHANGELOG.md index 4a3a41af683f..287922bbf766 100644 --- a/sdk/mariadb/arm-mariadb/CHANGELOG.md +++ b/sdk/mariadb/arm-mariadb/CHANGELOG.md @@ -1,5 +1,31 @@ # Release History + +## 2.1.0 (2022-11-03) + +**Features** + - Added Interface Advisor + - Added Interface Configuration + - Added Interface Database + - Added Interface FirewallRule + - Added Interface LogFile + - Added Interface PrivateEndpointConnection + - Added Interface PrivateLinkResource + - Added Interface ProxyResource + - Added Interface QueryStatistic + - Added Interface QueryText + - Added Interface RecommendationAction + - Added Interface RecoverableServerResource + - Added Interface Server + - Added Interface ServerPropertiesForDefaultCreate + - Added Interface ServerPropertiesForGeoRestore + - Added Interface ServerPropertiesForReplica + - Added Interface ServerPropertiesForRestore + - Added Interface ServerSecurityAlertPolicy + - Added Interface TrackedResource + - Added Interface VirtualNetworkRule + - Added Interface WaitStatistic + ## 2.0.1 (2022-04-25) **Features** diff --git a/sdk/mariadb/arm-mariadb/_meta.json b/sdk/mariadb/arm-mariadb/_meta.json index 975b27ce6725..65262ce84e69 100644 --- a/sdk/mariadb/arm-mariadb/_meta.json +++ b/sdk/mariadb/arm-mariadb/_meta.json @@ -1,8 +1,8 @@ { - "commit": "d967edeee8fd6af6d40bffe53cceed1bd053d7ad", - "readme": "specification\\mariadb\\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\\mariadb\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1 --generate-sample=true", + "commit": "25c54d98c2cedd5906c7a7a334fb17e952df932c", + "readme": "specification/mariadb/resource-manager/readme.md", + "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/mariadb/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.2", "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.5.0", + "use": "@autorest/typescript@6.0.0-rc.2" +} \ No newline at end of file diff --git a/sdk/mariadb/arm-mariadb/package.json b/sdk/mariadb/arm-mariadb/package.json index 158bb91594be..78978d790f33 100644 --- a/sdk/mariadb/arm-mariadb/package.json +++ b/sdk/mariadb/arm-mariadb/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for MariaDBManagementClient.", - "version": "2.0.1", + "version": "2.1.0", "engines": { "node": ">=14.0.0" }, @@ -36,13 +36,17 @@ "mkdirp": "^1.0.4", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", - "typescript": "~4.2.0", + "typescript": "~4.6.0", "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" + "@types/chai": "^4.2.8", + "chai": "^4.2.0", + "cross-env": "^7.0.2", + "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mariadb/arm-mariadb", "repository": { @@ -93,9 +97,8 @@ "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:browser": "echo skipped", - "docs": "echo skipped" + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped" }, "sideEffects": false, "//metadata": { @@ -106,13 +109,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-mariadb?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/mariadb/arm-mariadb/review/arm-mariadb.api.md b/sdk/mariadb/arm-mariadb/review/arm-mariadb.api.md index 46153b33e586..0c4849fc6f74 100644 --- a/sdk/mariadb/arm-mariadb/review/arm-mariadb.api.md +++ b/sdk/mariadb/arm-mariadb/review/arm-mariadb.api.md @@ -11,9 +11,9 @@ import { PollerLike } from '@azure/core-lro'; import { PollOperationState } from '@azure/core-lro'; // @public -export type Advisor = ProxyResource & { +export interface Advisor extends ProxyResource { properties?: Record; -}; +} // @public export interface Advisors { @@ -71,14 +71,14 @@ export interface CloudErrorAutoGenerated { } // @public -export type Configuration = ProxyResource & { - value?: string; - readonly description?: string; - readonly defaultValue?: string; - readonly dataType?: string; +export interface Configuration extends ProxyResource { readonly allowedValues?: string; + readonly dataType?: string; + readonly defaultValue?: string; + readonly description?: string; source?: string; -}; + value?: string; +} // @public export interface ConfigurationListResult { @@ -126,10 +126,10 @@ export interface CreateRecommendedActionSessionOptionalParams extends coreClient } // @public -export type Database = ProxyResource & { +export interface Database extends ProxyResource { charset?: string; collation?: string; -}; +} // @public export interface DatabaseListResult { @@ -191,10 +191,10 @@ export interface ErrorResponse { } // @public -export type FirewallRule = ProxyResource & { - startIpAddress: string; +export interface FirewallRule extends ProxyResource { endIpAddress: string; -}; + startIpAddress: string; +} // @public export interface FirewallRuleListResult { @@ -245,147 +245,104 @@ export type GeoRedundantBackup = string; // @public export enum KnownCreateMode { - // (undocumented) Default = "Default", - // (undocumented) GeoRestore = "GeoRestore", - // (undocumented) PointInTimeRestore = "PointInTimeRestore", - // (undocumented) Replica = "Replica" } // @public export enum KnownGeoRedundantBackup { - // (undocumented) Disabled = "Disabled", - // (undocumented) Enabled = "Enabled" } // @public export enum KnownMinimalTlsVersionEnum { - // (undocumented) TLS10 = "TLS1_0", - // (undocumented) TLS11 = "TLS1_1", - // (undocumented) TLS12 = "TLS1_2", - // (undocumented) TLSEnforcementDisabled = "TLSEnforcementDisabled" } // @public export enum KnownOperationOrigin { - // (undocumented) NotSpecified = "NotSpecified", - // (undocumented) System = "system", - // (undocumented) User = "user" } // @public export enum KnownPrivateEndpointProvisioningState { - // (undocumented) Approving = "Approving", - // (undocumented) Dropping = "Dropping", - // (undocumented) Failed = "Failed", - // (undocumented) Ready = "Ready", - // (undocumented) Rejecting = "Rejecting" } // @public export enum KnownPrivateLinkServiceConnectionStateActionsRequire { - // (undocumented) None = "None" } // @public export enum KnownPrivateLinkServiceConnectionStateStatus { - // (undocumented) Approved = "Approved", - // (undocumented) Disconnected = "Disconnected", - // (undocumented) Pending = "Pending", - // (undocumented) Rejected = "Rejected" } // @public export enum KnownPublicNetworkAccessEnum { - // (undocumented) Disabled = "Disabled", - // (undocumented) Enabled = "Enabled" } // @public export enum KnownQueryPerformanceInsightResetDataResultState { - // (undocumented) Failed = "Failed", - // (undocumented) Succeeded = "Succeeded" } // @public export enum KnownSecurityAlertPolicyName { - // (undocumented) Default = "Default" } // @public export enum KnownServerState { - // (undocumented) Disabled = "Disabled", - // (undocumented) Dropping = "Dropping", - // (undocumented) Ready = "Ready" } // @public export enum KnownServerVersion { - // (undocumented) Ten2 = "10.2", - // (undocumented) Ten3 = "10.3" } // @public export enum KnownSkuTier { - // (undocumented) Basic = "Basic", - // (undocumented) GeneralPurpose = "GeneralPurpose", - // (undocumented) MemoryOptimized = "MemoryOptimized" } // @public export enum KnownStorageAutogrow { - // (undocumented) Disabled = "Disabled", - // (undocumented) Enabled = "Enabled" } // @public export enum KnownVirtualNetworkRuleState { - // (undocumented) Deleting = "Deleting", - // (undocumented) Initializing = "Initializing", - // (undocumented) InProgress = "InProgress", - // (undocumented) Ready = "Ready", - // (undocumented) Unknown = "Unknown" } @@ -433,13 +390,13 @@ export interface LocationBasedRecommendedActionSessionsResultListOptionalParams export type LocationBasedRecommendedActionSessionsResultListResponse = RecommendationActionsResultList; // @public -export type LogFile = ProxyResource & { - sizeInKB?: number; +export interface LogFile extends ProxyResource { readonly createdTime?: Date; readonly lastModifiedTime?: Date; + sizeInKB?: number; typePropertiesType?: string; readonly url?: string; -}; +} // @public export interface LogFileListResult { @@ -606,11 +563,11 @@ export interface PerformanceTierServiceLevelObjectives { } // @public -export type PrivateEndpointConnection = ProxyResource & { +export interface PrivateEndpointConnection extends ProxyResource { privateEndpoint?: PrivateEndpointProperty; privateLinkServiceConnectionState?: PrivateLinkServiceConnectionStateProperty; readonly provisioningState?: string; -}; +} // @public export interface PrivateEndpointConnectionListResult { @@ -684,9 +641,9 @@ export interface PrivateEndpointProperty { export type PrivateEndpointProvisioningState = string; // @public -export type PrivateLinkResource = ProxyResource & { +export interface PrivateLinkResource extends ProxyResource { readonly properties?: PrivateLinkResourceProperties; -}; +} // @public export interface PrivateLinkResourceListResult { @@ -741,7 +698,8 @@ export interface PrivateLinkServiceConnectionStateProperty { export type PrivateLinkServiceConnectionStateStatus = string; // @public -export type ProxyResource = Resource & {}; +export interface ProxyResource extends Resource { +} // @public export type PublicNetworkAccessEnum = string; @@ -756,24 +714,24 @@ export interface QueryPerformanceInsightResetDataResult { export type QueryPerformanceInsightResetDataResultState = string; // @public -export type QueryStatistic = ProxyResource & { - queryId?: string; - startTime?: Date; - endTime?: Date; +export interface QueryStatistic extends ProxyResource { aggregationFunction?: string; databaseNames?: string[]; - queryExecutionCount?: number; - metricName?: string; + endTime?: Date; metricDisplayName?: string; + metricName?: string; metricValue?: number; metricValueUnit?: string; -}; + queryExecutionCount?: number; + queryId?: string; + startTime?: Date; +} // @public -export type QueryText = ProxyResource & { +export interface QueryText extends ProxyResource { queryId?: string; queryText?: string; -}; +} // @public export interface QueryTexts { @@ -809,18 +767,18 @@ export interface QueryTextsResultList { } // @public -export type RecommendationAction = ProxyResource & { - advisorName?: string; - sessionId?: string; +export interface RecommendationAction extends ProxyResource { actionId?: number; + advisorName?: string; createdTime?: Date; - expirationTime?: Date; - reason?: string; - recommendationType?: string; details?: { [propertyName: string]: string; }; -}; + expirationTime?: Date; + reason?: string; + recommendationType?: string; + sessionId?: string; +} // @public export interface RecommendationActionsResultList { @@ -865,14 +823,14 @@ export interface RecommendedActionsListByServerOptionalParams extends coreClient export type RecommendedActionsListByServerResponse = RecommendationActionsResultList; // @public -export type RecoverableServerResource = ProxyResource & { +export interface RecoverableServerResource extends ProxyResource { + readonly edition?: string; + readonly hardwareGeneration?: string; readonly lastAvailableBackupDateTime?: string; readonly serviceLevelObjective?: string; - readonly edition?: string; readonly vCore?: number; - readonly hardwareGeneration?: string; readonly version?: string; -}; +} // @public export interface RecoverableServers { @@ -916,22 +874,22 @@ export interface Resource { export type SecurityAlertPolicyName = string; // @public -export type Server = TrackedResource & { - sku?: Sku; +export interface Server extends TrackedResource { administratorLogin?: string; - version?: ServerVersion; - sslEnforcement?: SslEnforcementEnum; - minimalTlsVersion?: MinimalTlsVersionEnum; - userVisibleState?: ServerState; - fullyQualifiedDomainName?: string; earliestRestoreDate?: Date; - storageProfile?: StorageProfile; - replicationRole?: string; + fullyQualifiedDomainName?: string; masterServerId?: string; - replicaCapacity?: number; - publicNetworkAccess?: PublicNetworkAccessEnum; + minimalTlsVersion?: MinimalTlsVersionEnum; readonly privateEndpointConnections?: ServerPrivateEndpointConnection[]; -}; + publicNetworkAccess?: PublicNetworkAccessEnum; + replicaCapacity?: number; + replicationRole?: string; + sku?: Sku; + sslEnforcement?: SslEnforcementEnum; + storageProfile?: StorageProfile; + userVisibleState?: ServerState; + version?: ServerVersion; +} // @public export interface ServerBasedPerformanceTier { @@ -1009,30 +967,30 @@ export interface ServerPropertiesForCreate { export type ServerPropertiesForCreateUnion = ServerPropertiesForCreate | ServerPropertiesForDefaultCreate | ServerPropertiesForRestore | ServerPropertiesForGeoRestore | ServerPropertiesForReplica; // @public -export type ServerPropertiesForDefaultCreate = ServerPropertiesForCreate & { - createMode: "Default"; +export interface ServerPropertiesForDefaultCreate extends ServerPropertiesForCreate { administratorLogin: string; administratorLoginPassword: string; -}; + createMode: "Default"; +} // @public -export type ServerPropertiesForGeoRestore = ServerPropertiesForCreate & { +export interface ServerPropertiesForGeoRestore extends ServerPropertiesForCreate { createMode: "GeoRestore"; sourceServerId: string; -}; +} // @public -export type ServerPropertiesForReplica = ServerPropertiesForCreate & { +export interface ServerPropertiesForReplica extends ServerPropertiesForCreate { createMode: "Replica"; sourceServerId: string; -}; +} // @public -export type ServerPropertiesForRestore = ServerPropertiesForCreate & { +export interface ServerPropertiesForRestore extends ServerPropertiesForCreate { createMode: "PointInTimeRestore"; - sourceServerId: string; restorePointInTime: Date; -}; + sourceServerId: string; +} // @public export interface Servers { @@ -1107,15 +1065,15 @@ export interface ServerSecurityAlertPoliciesListByServerOptionalParams extends c export type ServerSecurityAlertPoliciesListByServerResponse = ServerSecurityAlertPolicyListResult; // @public -export type ServerSecurityAlertPolicy = ProxyResource & { - state?: ServerSecurityAlertPolicyState; +export interface ServerSecurityAlertPolicy extends ProxyResource { disabledAlerts?: string[]; - emailAddresses?: string[]; emailAccountAdmins?: boolean; - storageEndpoint?: string; - storageAccountAccessKey?: string; + emailAddresses?: string[]; retentionDays?: number; -}; + state?: ServerSecurityAlertPolicyState; + storageAccountAccessKey?: string; + storageEndpoint?: string; +} // @public export interface ServerSecurityAlertPolicyListResult { @@ -1272,19 +1230,19 @@ export interface TopQueryStatisticsResultList { } // @public -export type TrackedResource = Resource & { +export interface TrackedResource extends Resource { + location: string; tags?: { [propertyName: string]: string; }; - location: string; -}; +} // @public -export type VirtualNetworkRule = ProxyResource & { - virtualNetworkSubnetId?: string; +export interface VirtualNetworkRule extends ProxyResource { ignoreMissingVnetServiceEndpoint?: boolean; readonly state?: VirtualNetworkRuleState; -}; + virtualNetworkSubnetId?: string; +} // @public export interface VirtualNetworkRuleListResult { @@ -1342,17 +1300,17 @@ export type VirtualNetworkRulesListByServerResponse = VirtualNetworkRuleListResu export type VirtualNetworkRuleState = string; // @public -export type WaitStatistic = ProxyResource & { - startTime?: Date; +export interface WaitStatistic extends ProxyResource { + count?: number; + databaseName?: string; endTime?: Date; eventName?: string; eventTypeName?: string; queryId?: number; - databaseName?: string; - userId?: number; - count?: number; + startTime?: Date; totalTimeInMs?: number; -}; + userId?: number; +} // @public export interface WaitStatistics { diff --git a/sdk/mariadb/arm-mariadb/src/mariaDBManagementClient.ts b/sdk/mariadb/arm-mariadb/src/mariaDBManagementClient.ts index a879d730fc02..a79b716294e5 100644 --- a/sdk/mariadb/arm-mariadb/src/mariaDBManagementClient.ts +++ b/sdk/mariadb/arm-mariadb/src/mariaDBManagementClient.ts @@ -101,7 +101,7 @@ export class MariaDBManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-mariadb/2.0.1`; + const packageDetails = `azsdk-js-arm-mariadb/2.1.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -121,27 +121,34 @@ export class MariaDBManagementClient extends coreClient.ServiceClient { }; super(optionsWithDefaults); + let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); - const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName ); - if (!bearerTokenAuthenticationPolicyFound) { - this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName - }); - this.pipeline.addPolicy( - coreRestPipeline.bearerTokenAuthenticationPolicy({ - scopes: `${optionsWithDefaults.baseUri}/.default`, - challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) - ); - } + } + if ( + !options || + !options.pipeline || + options.pipeline.getOrderedPolicies().length == 0 || + !bearerTokenAuthenticationPolicyFound + ) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + credential: credentials, + scopes: `${optionsWithDefaults.credentialScopes}`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge + } + }) + ); } // Parameter assignments this.subscriptionId = subscriptionId; diff --git a/sdk/mariadb/arm-mariadb/src/models/index.ts b/sdk/mariadb/arm-mariadb/src/models/index.ts index aaf10b82a0b4..84cf55e4879a 100644 --- a/sdk/mariadb/arm-mariadb/src/models/index.ts +++ b/sdk/mariadb/arm-mariadb/src/models/index.ts @@ -563,7 +563,8 @@ export interface CloudErrorAutoGenerated { } /** The properties used to create a new server. */ -export type ServerPropertiesForDefaultCreate = ServerPropertiesForCreate & { +export interface ServerPropertiesForDefaultCreate + extends ServerPropertiesForCreate { /** Polymorphic discriminator, which specifies the different types this object can be */ createMode: "Default"; /** The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). */ @@ -573,47 +574,48 @@ export type ServerPropertiesForDefaultCreate = ServerPropertiesForCreate & { * This value contains a credential. Consider obscuring before showing to users */ administratorLoginPassword: string; -}; +} /** The properties used to create a new server by restoring from a backup. */ -export type ServerPropertiesForRestore = ServerPropertiesForCreate & { +export interface ServerPropertiesForRestore extends ServerPropertiesForCreate { /** Polymorphic discriminator, which specifies the different types this object can be */ createMode: "PointInTimeRestore"; /** The source server id to restore from. */ sourceServerId: string; /** Restore point creation time (ISO8601 format), specifying the time to restore from. */ restorePointInTime: Date; -}; +} /** The properties used to create a new server by restoring to a different region from a geo replicated backup. */ -export type ServerPropertiesForGeoRestore = ServerPropertiesForCreate & { +export interface ServerPropertiesForGeoRestore + extends ServerPropertiesForCreate { /** Polymorphic discriminator, which specifies the different types this object can be */ createMode: "GeoRestore"; /** The source server id to restore from. */ sourceServerId: string; -}; +} /** The properties to create a new replica. */ -export type ServerPropertiesForReplica = ServerPropertiesForCreate & { +export interface ServerPropertiesForReplica extends ServerPropertiesForCreate { /** Polymorphic discriminator, which specifies the different types this object can be */ createMode: "Replica"; /** The master server id to create replica from. */ sourceServerId: string; -}; +} /** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ -export type TrackedResource = Resource & { +export interface TrackedResource extends Resource { /** Resource tags. */ tags?: { [propertyName: string]: string }; /** The geo-location where the resource lives */ location: string; -}; +} /** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ -export type ProxyResource = Resource & {}; +export interface ProxyResource extends Resource {} /** Represents a server. */ -export type Server = TrackedResource & { +export interface Server extends TrackedResource { /** The SKU (pricing tier) of the server. */ sku?: Sku; /** The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). */ @@ -645,18 +647,18 @@ export type Server = TrackedResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly privateEndpointConnections?: ServerPrivateEndpointConnection[]; -}; +} /** Represents a server firewall rule. */ -export type FirewallRule = ProxyResource & { +export interface FirewallRule extends ProxyResource { /** The start IP address of the server firewall rule. Must be IPv4 format. */ startIpAddress: string; /** The end IP address of the server firewall rule. Must be IPv4 format. */ endIpAddress: string; -}; +} /** A virtual network rule. */ -export type VirtualNetworkRule = ProxyResource & { +export interface VirtualNetworkRule extends ProxyResource { /** The ARM resource id of the virtual network subnet. */ virtualNetworkSubnetId?: string; /** Create firewall rule before the virtual network has vnet service endpoint enabled. */ @@ -666,18 +668,18 @@ export type VirtualNetworkRule = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly state?: VirtualNetworkRuleState; -}; +} /** Represents a Database. */ -export type Database = ProxyResource & { +export interface Database extends ProxyResource { /** The charset of the database. */ charset?: string; /** The collation of the database. */ collation?: string; -}; +} /** Represents a Configuration. */ -export type Configuration = ProxyResource & { +export interface Configuration extends ProxyResource { /** Value of the configuration. */ value?: string; /** @@ -702,10 +704,10 @@ export type Configuration = ProxyResource & { readonly allowedValues?: string; /** Source of the configuration. */ source?: string; -}; +} /** Represents a log file. */ -export type LogFile = ProxyResource & { +export interface LogFile extends ProxyResource { /** Size of the log file. */ sizeInKB?: number; /** @@ -725,10 +727,10 @@ export type LogFile = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly url?: string; -}; +} /** A recoverable server resource. */ -export type RecoverableServerResource = ProxyResource & { +export interface RecoverableServerResource extends ProxyResource { /** * The last available backup date time. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -759,18 +761,18 @@ export type RecoverableServerResource = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly version?: string; -}; +} /** Represents a Query Text. */ -export type QueryText = ProxyResource & { +export interface QueryText extends ProxyResource { /** Query identifier unique to the server. */ queryId?: string; /** Query text. */ queryText?: string; -}; +} /** Represents a Query Statistic. */ -export type QueryStatistic = ProxyResource & { +export interface QueryStatistic extends ProxyResource { /** Database query identifier. */ queryId?: string; /** Observation start time. */ @@ -791,10 +793,10 @@ export type QueryStatistic = ProxyResource & { metricValue?: number; /** Metric value unit. */ metricValueUnit?: string; -}; +} /** Represents a Wait Statistic. */ -export type WaitStatistic = ProxyResource & { +export interface WaitStatistic extends ProxyResource { /** Observation start time. */ startTime?: Date; /** Observation end time. */ @@ -813,16 +815,16 @@ export type WaitStatistic = ProxyResource & { count?: number; /** Total time of wait in milliseconds in this time interval. */ totalTimeInMs?: number; -}; +} /** Represents a recommendation action advisor. */ -export type Advisor = ProxyResource & { +export interface Advisor extends ProxyResource { /** The properties of a recommendation action advisor. */ properties?: Record; -}; +} /** Represents a Recommendation Action. */ -export type RecommendationAction = ProxyResource & { +export interface RecommendationAction extends ProxyResource { /** Advisor name. */ advisorName?: string; /** Recommendation action session identifier. */ @@ -839,10 +841,10 @@ export type RecommendationAction = ProxyResource & { recommendationType?: string; /** Recommendation action details. */ details?: { [propertyName: string]: string }; -}; +} /** A private endpoint connection */ -export type PrivateEndpointConnection = ProxyResource & { +export interface PrivateEndpointConnection extends ProxyResource { /** Private endpoint which the connection belongs to. */ privateEndpoint?: PrivateEndpointProperty; /** Connection state of the private endpoint connection. */ @@ -852,19 +854,19 @@ export type PrivateEndpointConnection = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: string; -}; +} /** A private link resource */ -export type PrivateLinkResource = ProxyResource & { +export interface PrivateLinkResource extends ProxyResource { /** * The private link resource group id. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly properties?: PrivateLinkResourceProperties; -}; +} /** A server security alert policy. */ -export type ServerSecurityAlertPolicy = ProxyResource & { +export interface ServerSecurityAlertPolicy extends ProxyResource { /** Specifies the state of the policy, whether it is enabled or disabled. */ state?: ServerSecurityAlertPolicyState; /** Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly */ @@ -879,12 +881,15 @@ export type ServerSecurityAlertPolicy = ProxyResource & { storageAccountAccessKey?: string; /** Specifies the number of days to keep in the Threat Detection audit logs. */ retentionDays?: number; -}; +} /** Known values of {@link SkuTier} that the service accepts. */ export enum KnownSkuTier { + /** Basic */ Basic = "Basic", + /** GeneralPurpose */ GeneralPurpose = "GeneralPurpose", + /** MemoryOptimized */ MemoryOptimized = "MemoryOptimized" } @@ -901,7 +906,9 @@ export type SkuTier = string; /** Known values of {@link ServerVersion} that the service accepts. */ export enum KnownServerVersion { + /** Ten2 */ Ten2 = "10.2", + /** Ten3 */ Ten3 = "10.3" } @@ -917,9 +924,13 @@ export type ServerVersion = string; /** Known values of {@link MinimalTlsVersionEnum} that the service accepts. */ export enum KnownMinimalTlsVersionEnum { + /** TLS10 */ TLS10 = "TLS1_0", + /** TLS11 */ TLS11 = "TLS1_1", + /** TLS12 */ TLS12 = "TLS1_2", + /** TLSEnforcementDisabled */ TLSEnforcementDisabled = "TLSEnforcementDisabled" } @@ -937,7 +948,9 @@ export type MinimalTlsVersionEnum = string; /** Known values of {@link PublicNetworkAccessEnum} that the service accepts. */ export enum KnownPublicNetworkAccessEnum { + /** Enabled */ Enabled = "Enabled", + /** Disabled */ Disabled = "Disabled" } @@ -953,7 +966,9 @@ export type PublicNetworkAccessEnum = string; /** Known values of {@link GeoRedundantBackup} that the service accepts. */ export enum KnownGeoRedundantBackup { + /** Enabled */ Enabled = "Enabled", + /** Disabled */ Disabled = "Disabled" } @@ -969,7 +984,9 @@ export type GeoRedundantBackup = string; /** Known values of {@link StorageAutogrow} that the service accepts. */ export enum KnownStorageAutogrow { + /** Enabled */ Enabled = "Enabled", + /** Disabled */ Disabled = "Disabled" } @@ -985,9 +1002,13 @@ export type StorageAutogrow = string; /** Known values of {@link CreateMode} that the service accepts. */ export enum KnownCreateMode { + /** Default */ Default = "Default", + /** PointInTimeRestore */ PointInTimeRestore = "PointInTimeRestore", + /** GeoRestore */ GeoRestore = "GeoRestore", + /** Replica */ Replica = "Replica" } @@ -1005,8 +1026,11 @@ export type CreateMode = string; /** Known values of {@link ServerState} that the service accepts. */ export enum KnownServerState { + /** Ready */ Ready = "Ready", + /** Dropping */ Dropping = "Dropping", + /** Disabled */ Disabled = "Disabled" } @@ -1023,9 +1047,13 @@ export type ServerState = string; /** Known values of {@link PrivateLinkServiceConnectionStateStatus} that the service accepts. */ export enum KnownPrivateLinkServiceConnectionStateStatus { + /** Approved */ Approved = "Approved", + /** Pending */ Pending = "Pending", + /** Rejected */ Rejected = "Rejected", + /** Disconnected */ Disconnected = "Disconnected" } @@ -1043,6 +1071,7 @@ export type PrivateLinkServiceConnectionStateStatus = string; /** Known values of {@link PrivateLinkServiceConnectionStateActionsRequire} that the service accepts. */ export enum KnownPrivateLinkServiceConnectionStateActionsRequire { + /** None */ None = "None" } @@ -1057,10 +1086,15 @@ export type PrivateLinkServiceConnectionStateActionsRequire = string; /** Known values of {@link PrivateEndpointProvisioningState} that the service accepts. */ export enum KnownPrivateEndpointProvisioningState { + /** Approving */ Approving = "Approving", + /** Ready */ Ready = "Ready", + /** Dropping */ Dropping = "Dropping", + /** Failed */ Failed = "Failed", + /** Rejecting */ Rejecting = "Rejecting" } @@ -1079,10 +1113,15 @@ export type PrivateEndpointProvisioningState = string; /** Known values of {@link VirtualNetworkRuleState} that the service accepts. */ export enum KnownVirtualNetworkRuleState { + /** Initializing */ Initializing = "Initializing", + /** InProgress */ InProgress = "InProgress", + /** Ready */ Ready = "Ready", + /** Deleting */ Deleting = "Deleting", + /** Unknown */ Unknown = "Unknown" } @@ -1101,8 +1140,11 @@ export type VirtualNetworkRuleState = string; /** Known values of {@link OperationOrigin} that the service accepts. */ export enum KnownOperationOrigin { + /** NotSpecified */ NotSpecified = "NotSpecified", + /** User */ User = "user", + /** System */ System = "system" } @@ -1119,7 +1161,9 @@ export type OperationOrigin = string; /** Known values of {@link QueryPerformanceInsightResetDataResultState} that the service accepts. */ export enum KnownQueryPerformanceInsightResetDataResultState { + /** Succeeded */ Succeeded = "Succeeded", + /** Failed */ Failed = "Failed" } @@ -1135,6 +1179,7 @@ export type QueryPerformanceInsightResetDataResultState = string; /** Known values of {@link SecurityAlertPolicyName} that the service accepts. */ export enum KnownSecurityAlertPolicyName { + /** Default */ Default = "Default" } diff --git a/sdk/mariadb/arm-mariadb/test/sampleTest.ts b/sdk/mariadb/arm-mariadb/test/sampleTest.ts index 7ed89b043e1b..25aeb3ebcc36 100644 --- a/sdk/mariadb/arm-mariadb/test/sampleTest.ts +++ b/sdk/mariadb/arm-mariadb/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/mariadb/arm-mariadb/tsconfig.json b/sdk/mariadb/arm-mariadb/tsconfig.json index 7de83842d746..3e6ae96443f3 100644 --- a/sdk/mariadb/arm-mariadb/tsconfig.json +++ b/sdk/mariadb/arm-mariadb/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-mariadb": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"