diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 3d649a2e213e..1b483993ee46 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -13937,13 +13937,13 @@ packages: dev: false file:projects/arm-rediscache.tgz: - resolution: {integrity: sha512-8EOibryY/z0WQ40ePcLYEmr/nOuNKKEdwFpZvAhMnYVqbsqlvqg0iP+e6b3zXUfyQYLdC7+UyfFihOoz7pH2kA==, tarball: file:projects/arm-rediscache.tgz} + resolution: {integrity: sha512-4fZJC1azU/zg8ZZrlfcSgqPpIQJ6ypLI60rC7fu21RP5RSAqMB/zikOh4S7mgGOuXRHIfd3wI6biCJK32R85yQ==, tarball: file:projects/arm-rediscache.tgz} name: '@rush-temp/arm-rediscache' version: 0.0.0 dependencies: '@azure/arm-network': 26.0.0 '@azure/identity': 2.1.0 - '@microsoft/api-extractor': 7.31.2 + '@microsoft/api-extractor': 7.18.11 '@rollup/plugin-commonjs': 21.1.0_rollup@2.79.1 '@rollup/plugin-json': 4.1.0_rollup@2.79.1 '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 @@ -13957,7 +13957,7 @@ packages: rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1 tslib: 2.4.0 - typescript: 4.6.4 + typescript: 4.2.4 uglify-js: 3.17.2 transitivePeerDependencies: - '@types/node' diff --git a/sdk/redis/arm-rediscache/CHANGELOG.md b/sdk/redis/arm-rediscache/CHANGELOG.md index 7e06a0601582..4a4030f38824 100644 --- a/sdk/redis/arm-rediscache/CHANGELOG.md +++ b/sdk/redis/arm-rediscache/CHANGELOG.md @@ -1,15 +1,21 @@ # Release History + +## 8.0.0 (2022-09-29) + +**Features** -## 7.0.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed + - Interface RedisLinkedServerCreateParameters has a new optional parameter geoReplicatedPrimaryHostName + - Interface RedisLinkedServerCreateParameters has a new optional parameter primaryHostName + - Interface RedisLinkedServerCreateProperties has a new optional parameter geoReplicatedPrimaryHostName + - Interface RedisLinkedServerCreateProperties has a new optional parameter primaryHostName + - Interface RedisLinkedServerWithProperties has a new optional parameter geoReplicatedPrimaryHostName + - Interface RedisLinkedServerWithProperties has a new optional parameter primaryHostName -### Other Changes +**Breaking Changes** + - Operation PatchSchedules.createOrUpdate has a new signature + + ## 7.0.0 (2022-09-05) **Features** diff --git a/sdk/redis/arm-rediscache/README.md b/sdk/redis/arm-rediscache/README.md index a0656d63c13b..dff158c18e56 100644 --- a/sdk/redis/arm-rediscache/README.md +++ b/sdk/redis/arm-rediscache/README.md @@ -13,7 +13,7 @@ REST API for Azure Redis Cache Service. ### Currently supported environments -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) +- [LTS versions of Node.js](https://nodejs.org/about/releases/) - Latest versions of Safari, Chrome, Edge and Firefox. See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. diff --git a/sdk/redis/arm-rediscache/_meta.json b/sdk/redis/arm-rediscache/_meta.json index f938984cb268..8292c367ff1d 100644 --- a/sdk/redis/arm-rediscache/_meta.json +++ b/sdk/redis/arm-rediscache/_meta.json @@ -1,8 +1,8 @@ { - "commit": "fbe1a37cc8f1e8d2dc31f781fffdbaef4c370fa6", + "commit": "c78626c17427b397a6bb774cb1347455e7c2af78", "readme": "specification/redis/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=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\redis\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.1.20220727.1 --generate-sample=true", + "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/redis/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.1.20220727.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.3", + "use": "@autorest/typescript@6.0.0-rc.1" } \ No newline at end of file diff --git a/sdk/redis/arm-rediscache/package.json b/sdk/redis/arm-rediscache/package.json index 085674e886c7..8f969f0a9208 100644 --- a/sdk/redis/arm-rediscache/package.json +++ b/sdk/redis/arm-rediscache/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for RedisManagementClient.", - "version": "7.0.1", + "version": "8.0.0", "engines": { "node": ">=12.0.0" }, @@ -28,7 +28,7 @@ "module": "./dist-esm/src/index.js", "types": "./types/arm-rediscache.d.ts", "devDependencies": { - "@microsoft/api-extractor": "^7.31.1", + "@microsoft/api-extractor": "7.18.11", "@rollup/plugin-commonjs": "^21.0.1", "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-multi-entry": "^4.1.0", @@ -36,7 +36,7 @@ "mkdirp": "^1.0.4", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", - "typescript": "~4.6.0", + "typescript": "~4.2.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", @@ -46,8 +46,7 @@ "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", - "@azure/dev-tool": "^1.0.0", - "@azure/arm-network": "^26.0.0" + "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/redis/arm-rediscache", "repository": { @@ -110,13 +109,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-rediscache?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/redis/arm-rediscache/review/arm-rediscache.api.md b/sdk/redis/arm-rediscache/review/arm-rediscache.api.md index eac4557505bd..4ee21d5e14eb 100644 --- a/sdk/redis/arm-rediscache/review/arm-rediscache.api.md +++ b/sdk/redis/arm-rediscache/review/arm-rediscache.api.md @@ -322,7 +322,7 @@ export interface OperationStatusResult { // @public export interface PatchSchedules { - createOrUpdate(resourceGroupName: string, name: string, defaultParam: DefaultName, parameters: RedisPatchSchedule, options?: PatchSchedulesCreateOrUpdateOptionalParams): Promise; + createOrUpdate(resourceGroupName: string, name: string, parameters: RedisPatchSchedule, defaultParam: DefaultName, options?: PatchSchedulesCreateOrUpdateOptionalParams): Promise; delete(resourceGroupName: string, name: string, defaultParam: DefaultName, options?: PatchSchedulesDeleteOptionalParams): Promise; get(resourceGroupName: string, name: string, defaultParam: DefaultName, options?: PatchSchedulesGetOptionalParams): Promise; listByRedisResource(resourceGroupName: string, cacheName: string, options?: PatchSchedulesListByRedisResourceOptionalParams): PagedAsyncIterableIterator; @@ -644,15 +644,19 @@ export interface RedisLinkedServer { // @public export interface RedisLinkedServerCreateParameters { + readonly geoReplicatedPrimaryHostName?: string; linkedRedisCacheId: string; linkedRedisCacheLocation: string; + readonly primaryHostName?: string; serverRole: ReplicationRole; } // @public export interface RedisLinkedServerCreateProperties { + readonly geoReplicatedPrimaryHostName?: string; linkedRedisCacheId: string; linkedRedisCacheLocation: string; + readonly primaryHostName?: string; serverRole: ReplicationRole; } @@ -663,8 +667,10 @@ export interface RedisLinkedServerProperties extends RedisLinkedServerCreateProp // @public export interface RedisLinkedServerWithProperties extends ProxyResource { + readonly geoReplicatedPrimaryHostName?: string; linkedRedisCacheId?: string; linkedRedisCacheLocation?: string; + readonly primaryHostName?: string; readonly provisioningState?: string; serverRole?: ReplicationRole; } diff --git a/sdk/redis/arm-rediscache/src/models/index.ts b/sdk/redis/arm-rediscache/src/models/index.ts index fbb5b9582259..b807d03817ff 100644 --- a/sdk/redis/arm-rediscache/src/models/index.ts +++ b/sdk/redis/arm-rediscache/src/models/index.ts @@ -200,7 +200,7 @@ export interface RedisCommonPropertiesRedisConfiguration { [property: string]: any; /** Specifies whether the rdb backup is enabled */ rdbBackupEnabled?: string; - /** Specifies the frequency for creating rdb backup */ + /** Specifies the frequency for creating rdb backup in minutes. Valid values: (15, 30, 60, 360, 720, 1440) */ rdbBackupFrequency?: string; /** Specifies the maximum number of snapshots for rdb backup */ rdbBackupMaxSnapshotCount?: string; @@ -494,6 +494,16 @@ export interface RedisLinkedServerCreateParameters { linkedRedisCacheLocation: string; /** Role of the linked server. */ serverRole: ReplicationRole; + /** + * The unchanging DNS name which will always point to current geo-primary cache among the linked redis caches for seamless Geo Failover experience. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly geoReplicatedPrimaryHostName?: string; + /** + * The changing DNS name that resolves to the current geo-primary cache among the linked redis caches before or after the Geo Failover. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly primaryHostName?: string; } /** Create properties for a linked server */ @@ -504,6 +514,16 @@ export interface RedisLinkedServerCreateProperties { linkedRedisCacheLocation: string; /** Role of the linked server. */ serverRole: ReplicationRole; + /** + * The unchanging DNS name which will always point to current geo-primary cache among the linked redis caches for seamless Geo Failover experience. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly geoReplicatedPrimaryHostName?: string; + /** + * The changing DNS name that resolves to the current geo-primary cache among the linked redis caches before or after the Geo Failover. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly primaryHostName?: string; } /** List of linked servers (with properties) of a Redis cache. */ @@ -793,6 +813,16 @@ export interface RedisLinkedServerWithProperties extends ProxyResource { linkedRedisCacheLocation?: string; /** Role of the linked server. */ serverRole?: ReplicationRole; + /** + * The unchanging DNS name which will always point to current geo-primary cache among the linked redis caches for seamless Geo Failover experience. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly geoReplicatedPrimaryHostName?: string; + /** + * The changing DNS name that resolves to the current geo-primary cache among the linked redis caches before or after the Geo Failover. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly primaryHostName?: string; /** * Terminal state of the link between primary and secondary redis cache. * NOTE: This property will not be serialized. It can only be populated by the server. diff --git a/sdk/redis/arm-rediscache/src/models/mappers.ts b/sdk/redis/arm-rediscache/src/models/mappers.ts index 3be55e0910f8..b04c78078cc7 100644 --- a/sdk/redis/arm-rediscache/src/models/mappers.ts +++ b/sdk/redis/arm-rediscache/src/models/mappers.ts @@ -1197,6 +1197,20 @@ export const RedisLinkedServerCreateParameters: coreClient.CompositeMapper = { name: "Enum", allowedValues: ["Primary", "Secondary"] } + }, + geoReplicatedPrimaryHostName: { + serializedName: "properties.geoReplicatedPrimaryHostName", + readOnly: true, + type: { + name: "String" + } + }, + primaryHostName: { + serializedName: "properties.primaryHostName", + readOnly: true, + type: { + name: "String" + } } } } @@ -1228,6 +1242,20 @@ export const RedisLinkedServerCreateProperties: coreClient.CompositeMapper = { name: "Enum", allowedValues: ["Primary", "Secondary"] } + }, + geoReplicatedPrimaryHostName: { + serializedName: "geoReplicatedPrimaryHostName", + readOnly: true, + type: { + name: "String" + } + }, + primaryHostName: { + serializedName: "primaryHostName", + readOnly: true, + type: { + name: "String" + } } } } @@ -1971,6 +1999,20 @@ export const RedisLinkedServerWithProperties: coreClient.CompositeMapper = { allowedValues: ["Primary", "Secondary"] } }, + geoReplicatedPrimaryHostName: { + serializedName: "properties.geoReplicatedPrimaryHostName", + readOnly: true, + type: { + name: "String" + } + }, + primaryHostName: { + serializedName: "properties.primaryHostName", + readOnly: true, + type: { + name: "String" + } + }, provisioningState: { serializedName: "properties.provisioningState", readOnly: true, diff --git a/sdk/redis/arm-rediscache/src/models/parameters.ts b/sdk/redis/arm-rediscache/src/models/parameters.ts index e280784f86a5..752b54f2cd84 100644 --- a/sdk/redis/arm-rediscache/src/models/parameters.ts +++ b/sdk/redis/arm-rediscache/src/models/parameters.ts @@ -52,7 +52,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-05-01", + defaultValue: "2022-06-01", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/redis/arm-rediscache/src/operations/patchSchedules.ts b/sdk/redis/arm-rediscache/src/operations/patchSchedules.ts index 86c6190c979a..06b495431399 100644 --- a/sdk/redis/arm-rediscache/src/operations/patchSchedules.ts +++ b/sdk/redis/arm-rediscache/src/operations/patchSchedules.ts @@ -131,15 +131,15 @@ export class PatchSchedulesImpl implements PatchSchedules { * Create or replace the patching schedule for Redis cache. * @param resourceGroupName The name of the resource group. * @param name The name of the Redis cache. - * @param defaultParam Default string modeled as parameter for auto generation to work correctly. * @param parameters Parameters to set the patching schedule for Redis cache. + * @param defaultParam Default string modeled as parameter for auto generation to work correctly. * @param options The options parameters. */ createOrUpdate( resourceGroupName: string, name: string, - defaultParam: DefaultName, parameters: RedisPatchSchedule, + defaultParam: DefaultName, options?: PatchSchedulesCreateOrUpdateOptionalParams ): Promise { return this.client.sendOperationRequest( diff --git a/sdk/redis/arm-rediscache/src/operationsInterfaces/patchSchedules.ts b/sdk/redis/arm-rediscache/src/operationsInterfaces/patchSchedules.ts index fa0cc7719bb1..ccf3d7fad2fb 100644 --- a/sdk/redis/arm-rediscache/src/operationsInterfaces/patchSchedules.ts +++ b/sdk/redis/arm-rediscache/src/operationsInterfaces/patchSchedules.ts @@ -36,15 +36,15 @@ export interface PatchSchedules { * Create or replace the patching schedule for Redis cache. * @param resourceGroupName The name of the resource group. * @param name The name of the Redis cache. - * @param defaultParam Default string modeled as parameter for auto generation to work correctly. * @param parameters Parameters to set the patching schedule for Redis cache. + * @param defaultParam Default string modeled as parameter for auto generation to work correctly. * @param options The options parameters. */ createOrUpdate( resourceGroupName: string, name: string, - defaultParam: DefaultName, parameters: RedisPatchSchedule, + defaultParam: DefaultName, options?: PatchSchedulesCreateOrUpdateOptionalParams ): Promise; /** diff --git a/sdk/redis/arm-rediscache/src/redisManagementClient.ts b/sdk/redis/arm-rediscache/src/redisManagementClient.ts index 049439f6fad7..0372424be51b 100644 --- a/sdk/redis/arm-rediscache/src/redisManagementClient.ts +++ b/sdk/redis/arm-rediscache/src/redisManagementClient.ts @@ -69,7 +69,7 @@ export class RedisManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-rediscache/7.0.1`; + const packageDetails = `azsdk-js-arm-rediscache/8.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -89,41 +89,34 @@ export class RedisManagementClient extends coreClient.ServiceClient { }; super(optionsWithDefaults); - let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); - bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName ); - } - 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 - } - }) - ); + if (!bearerTokenAuthenticationPolicyFound) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + scopes: `${optionsWithDefaults.baseUri}/.default`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge + } + }) + ); + } } // Parameter assignments this.subscriptionId = subscriptionId; // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-05-01"; + this.apiVersion = options.apiVersion || "2022-06-01"; this.operations = new OperationsImpl(this); this.redis = new RedisImpl(this); this.firewallRules = new FirewallRulesImpl(this); diff --git a/sdk/redis/arm-rediscache/test/sampleTest.ts b/sdk/redis/arm-rediscache/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/redis/arm-rediscache/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +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(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/redis/arm-rediscache/tsconfig.json b/sdk/redis/arm-rediscache/tsconfig.json index a52528a33769..3e6ae96443f3 100644 --- a/sdk/redis/arm-rediscache/tsconfig.json +++ b/sdk/redis/arm-rediscache/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-rediscache": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"