Skip to content

Commit

Permalink
recording refresh 3 (#23888)
Browse files Browse the repository at this point in the history
* recording refresh 3

* update files

* update files

* update files

* update files
  • Loading branch information
kazrael2119 authored Nov 18, 2022
1 parent e192741 commit 6737306
Show file tree
Hide file tree
Showing 29 changed files with 476 additions and 216 deletions.
35 changes: 20 additions & 15 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 8 additions & 11 deletions sdk/changeanalysis/arm-changeanalysis/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
# Release History

## 2.0.2 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes


## 2.1.0 (2022-11-17)

**Features**

- Added Interface Change
- Added Interface ProxyResource

## 2.0.1 (2022-04-11)

- Bug fix
Expand Down
8 changes: 4 additions & 4 deletions sdk/changeanalysis/arm-changeanalysis/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "d29e6eb4894005c52e67cb4b5ac3faf031113e7d",
"readme": "specification\\changeanalysis\\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\\commerce\\resource-manager\\readme.md --use=@autorest/[email protected]alpha.18.20220329.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=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\changeanalysis\\resource-manager\\readme.md --use=@autorest/[email protected]rc.3.20221108.1 --generate-sample=true",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/js-sdk-release-tools@2.2.1",
"use": "@autorest/[email protected]alpha.18.20220329.1"
}
"release_tool": "@azure-tools/js-sdk-release-tools@2.4.2",
"use": "@autorest/[email protected]rc.3.20221108.1"
}
24 changes: 14 additions & 10 deletions sdk/changeanalysis/arm-changeanalysis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for AzureChangeAnalysisManagementClient.",
"version": "2.0.2",
"version": "2.1.0",
"engines": {
"node": ">=14.0.0"
},
"dependencies": {
"@azure/core-paging": "^1.2.0",
"@azure/core-client": "^1.0.0",
"@azure/core-client": "^1.6.1",
"@azure/core-auth": "^1.3.0",
"@azure/core-rest-pipeline": "^1.1.0",
"@azure/core-rest-pipeline": "^1.8.0",
"tslib": "^2.2.0"
},
"keywords": [
Expand All @@ -34,13 +34,18 @@
"mkdirp": "^1.0.4",
"rollup": "^2.66.1",
"rollup-plugin-sourcemaps": "^0.6.3",
"typescript": "~4.2.0",
"typescript": "~4.8.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",
"@types/node": "^14.0.0",
"@azure/dev-tool": "^1.0.0"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/changeanalysis/arm-changeanalysis",
"repository": {
Expand Down Expand Up @@ -91,9 +96,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": {
Expand All @@ -113,4 +117,4 @@
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-changeanalysis?view=azure-node-preview"
}
}
}

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ export interface AzureChangeAnalysisManagementClientOptionalParams extends coreC
}

// @public
export type Change = ProxyResource & {
export interface Change extends ProxyResource {
properties?: ChangeProperties;
};
}

// @public
export type ChangeCategory = "User" | "System";
Expand Down Expand Up @@ -116,23 +116,20 @@ export interface ErrorResponse {
error?: ErrorDetail;
}

// @public
export function getContinuationToken(page: unknown): string | undefined;

// @public
export enum KnownChangeType {
// (undocumented)
Add = "Add",
// (undocumented)
Remove = "Remove",
// (undocumented)
Update = "Update"
}

// @public
export enum KnownLevel {
// (undocumented)
Important = "Important",
// (undocumented)
Noisy = "Noisy",
// (undocumented)
Normal = "Normal"
}

Expand Down Expand Up @@ -175,7 +172,8 @@ export interface PropertyChange {
}

// @public
export type ProxyResource = Resource & {};
export interface ProxyResource extends Resource {
}

// @public
export interface Resource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"devDependencies": {
"@types/node": "^14.0.0",
"typescript": "~4.4.0",
"typescript": "~4.8.0",
"rimraf": "latest"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
*/

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 { OperationsImpl, ResourceChangesImpl, ChangesImpl } from "./operations";
import { Operations, ResourceChanges, Changes } from "./operationsInterfaces";
Expand Down Expand Up @@ -44,25 +50,54 @@ export class AzureChangeAnalysisManagementClient extends coreClient.ServiceClien
credential: credentials
};

const packageDetails = `azsdk-js-arm-changeanalysis/2.0.2`;
const packageDetails = `azsdk-js-arm-changeanalysis/2.1.0`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
: `${packageDetails}`;

if (!options.credentialScopes) {
options.credentialScopes = ["https://management.azure.com/.default"];
}
const optionsWithDefaults = {
...defaults,
...options,
userAgentOptions: {
userAgentPrefix
},
baseUri:
endpoint:
options.endpoint ?? options.baseUri ?? "https://management.azure.com"
};
super(optionsWithDefaults);

let bearerTokenAuthenticationPolicyFound: boolean = false;
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
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 ??
`${optionsWithDefaults.endpoint}/.default`,
challengeCallbacks: {
authorizeRequestOnChallenge:
coreClient.authorizeRequestOnClaimChallenge
}
})
);
}
// Parameter assignments
this.subscriptionId = subscriptionId;

Expand All @@ -72,6 +107,35 @@ export class AzureChangeAnalysisManagementClient extends coreClient.ServiceClien
this.operations = new OperationsImpl(this);
this.resourceChanges = new ResourceChangesImpl(this);
this.changes = new ChangesImpl(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<PipelineResponse> {
const param = request.url.split("?");
if (param.length > 1) {
const newParams = param[1].split("&").map((item) => {
if (item.indexOf("api-version") > -1) {
return "api-version=" + apiVersion;
} else {
return item;
}
});
request.url = param[0] + "?" + newParams.join("&");
}
return next(request);
}
};
this.pipeline.addPolicy(apiVersionPolicy);
}

operations: Operations;
Expand Down
1 change: 1 addition & 0 deletions sdk/changeanalysis/arm-changeanalysis/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

/// <reference lib="esnext.asynciterable" />
export { getContinuationToken } from "./pagingHelper";
export * from "./models";
export { AzureChangeAnalysisManagementClient } from "./azureChangeAnalysisManagementClient";
export * from "./operationsInterfaces";
Loading

0 comments on commit 6737306

Please sign in to comment.