Skip to content

Commit

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

* update files

* update files

* update files
  • Loading branch information
kazrael2119 committed Nov 23, 2022
1 parent 6e008cc commit 4240453
Show file tree
Hide file tree
Showing 60 changed files with 3,696 additions and 6,375 deletions.
33 changes: 18 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.

16 changes: 6 additions & 10 deletions sdk/dns/arm-dns/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# Release History

## 5.1.0 (2022-11-22)

**Features**

## 5.0.2 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes

- Added Interface Zone

## 5.0.1 (2022-04-18)

**features**
Expand Down
10 changes: 5 additions & 5 deletions sdk/dns/arm-dns/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "1f1d5b0b9ce6cc94605b2fd619dce374fb6e033a",
"readme": "specification\\dns\\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\\dns\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1 --generate-sample=true",
"commit": "20df2424a278ca19437e437a7dbf3a7857a0dd9d",
"readme": "specification/dns/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\\dns\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-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.6",
"use": "@autorest/typescript@6.0.0-alpha.19.20220408.1"
"release_tool": "@azure-tools/js-sdk-release-tools@2.4.2",
"use": "@autorest/typescript@6.0.0-rc.3.20221108.1"
}
22 changes: 13 additions & 9 deletions sdk/dns/arm-dns/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 DnsManagementClient.",
"version": "5.0.2",
"version": "5.1.0",
"engines": {
"node": ">=14.0.0"
},
"dependencies": {
"@azure/core-lro": "^2.2.0",
"@azure/abort-controller": "^1.0.0",
"@azure/core-paging": "^1.2.0",
"@azure/core-client": "^1.5.0",
"@azure/core-client": "^1.6.1",
"@azure/core-auth": "^1.3.0",
"@azure/core-rest-pipeline": "^1.8.0",
"tslib": "^2.2.0"
Expand All @@ -36,13 +36,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/dns/arm-dns",
"repository": {
Expand Down Expand Up @@ -93,9 +98,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 @@ -115,4 +119,4 @@
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-dns?view=azure-node-preview"
}
}
}

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

11 changes: 7 additions & 4 deletions sdk/dns/arm-dns/review/arm-dns.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ export interface DnsResourceReferenceResult {
dnsResourceReferences?: DnsResourceReference[];
}

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

// @public
export interface MxRecord {
exchange?: string;
Expand Down Expand Up @@ -287,16 +290,16 @@ export interface TxtRecord {
}

// @public
export type Zone = Resource & {
export interface Zone extends Resource {
etag?: string;
readonly maxNumberOfRecordSets?: number;
readonly maxNumberOfRecordsPerRecordSet?: number;
readonly numberOfRecordSets?: number;
readonly nameServers?: string[];
zoneType?: ZoneType;
readonly numberOfRecordSets?: number;
registrationVirtualNetworks?: SubResource[];
resolutionVirtualNetworks?: SubResource[];
};
zoneType?: ZoneType;
}

// @public
export interface ZoneListResult {
Expand Down
2 changes: 1 addition & 1 deletion sdk/dns/arm-dns/samples/v5/typescript/package.json
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"
}
}
80 changes: 60 additions & 20 deletions sdk/dns/arm-dns/src/dnsManagementClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
RecordSetsImpl,
Expand Down Expand Up @@ -54,47 +59,53 @@ export class DnsManagementClient extends coreClient.ServiceClient {
credential: credentials
};

const packageDetails = `azsdk-js-arm-dns/5.0.2`;
const packageDetails = `azsdk-js-arm-dns/5.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();
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 ??
`${optionsWithDefaults.endpoint}/.default`,
challengeCallbacks: {
authorizeRequestOnChallenge:
coreClient.authorizeRequestOnClaimChallenge
}
})
);
}
// Parameter assignments
this.subscriptionId = subscriptionId;
Expand All @@ -107,6 +118,35 @@ export class DnsManagementClient extends coreClient.ServiceClient {
this.dnsResourceReferenceOperations = new DnsResourceReferenceOperationsImpl(
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);
}

recordSets: RecordSets;
Expand Down
1 change: 1 addition & 0 deletions sdk/dns/arm-dns/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 { DnsManagementClient } from "./dnsManagementClient";
export * from "./operationsInterfaces";
5 changes: 3 additions & 2 deletions sdk/dns/arm-dns/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ export interface RecordSetUpdateParameters {
}

/** Describes a DNS zone. */
export type Zone = Resource & {
export interface Zone extends Resource {
/** The etag of the zone. */
etag?: string;
/**
Expand Down Expand Up @@ -280,7 +280,8 @@ export type Zone = Resource & {
registrationVirtualNetworks?: SubResource[];
/** A list of references to virtual networks that resolve records in this DNS zone. This is a only when ZoneType is Private. */
resolutionVirtualNetworks?: SubResource[];
};
}

/** Defines values for RecordType. */
export type RecordType =
| "A"
Expand Down

0 comments on commit 4240453

Please sign in to comment.