Skip to content

Commit 68a82fb

Browse files
author
SDKAuto
committed
CodeGen from PR 18961 in Azure/azure-rest-api-specs
Merge 417b2ea6821a624fb97052a6536cc10f14fe588c into 228f16c8871629ffe1fcdebfca9a3e8b4d2ce4aa
1 parent 7e07abd commit 68a82fb

File tree

15 files changed

+627
-217
lines changed

15 files changed

+627
-217
lines changed

common/config/rush/pnpm-lock.yaml

Lines changed: 119 additions & 98 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rush.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* This is the main configuration file for Rush.
33
* For full documentation, please see https://rushjs.io
4-
*/ {
4+
*/{
55
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json",
66
/**
77
* (Required) This specifies the version of the Rush engine to be used in this repo.
@@ -1695,6 +1695,11 @@
16951695
"packageName": "@azure/arm-servicelinker",
16961696
"projectFolder": "sdk/servicelinker/arm-servicelinker",
16971697
"versionPolicyName": "management"
1698+
},
1699+
{
1700+
"packageName": "@azure/arm-changes",
1701+
"projectFolder": "sdk/changes/arm-changes",
1702+
"versionPolicyName": "management"
16981703
}
16991704
]
1700-
}
1705+
}

sdk/resources-subscriptions/arm-resources-subscriptions/CHANGELOG.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
# Release History
2-
3-
## 2.0.2 (Unreleased)
4-
5-
### Features Added
6-
7-
### Breaking Changes
8-
9-
### Bugs Fixed
10-
11-
### Other Changes
12-
2+
3+
## 2.1.0 (2022-05-09)
4+
5+
**Features**
6+
7+
- Added operation Subscriptions.checkZonePeers
8+
- Added Interface AvailabilityZonePeers
9+
- Added Interface CheckZonePeersRequest
10+
- Added Interface CheckZonePeersResult
11+
- Added Interface ErrorDetail
12+
- Added Interface ErrorResponseAutoGenerated
13+
- Added Interface Peers
14+
- Added Interface SubscriptionsCheckZonePeersOptionalParams
15+
- Added Type Alias SubscriptionsCheckZonePeersResponse
16+
1317
## 2.0.1 (2022-04-18)
1418

1519
**features**

sdk/resources-subscriptions/arm-resources-subscriptions/README.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ All resource groups and resources exist within subscriptions. These operation en
1616
- [LTS versions of Node.js](https://nodejs.org/about/releases/)
1717
- Latest versions of Safari, Chrome, Edge and Firefox.
1818

19-
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
20-
2119
### Prerequisites
2220

2321
- An [Azure subscription][azure_sub].
@@ -51,17 +49,8 @@ For more information about how to create an Azure AD Application check out [this
5149
```javascript
5250
const { SubscriptionClient } = require("@azure/arm-resources-subscriptions");
5351
const { DefaultAzureCredential } = require("@azure/identity");
54-
// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details.
55-
5652
const subscriptionId = "00000000-0000-0000-0000-000000000000";
5753
const client = new SubscriptionClient(new DefaultAzureCredential(), subscriptionId);
58-
59-
// For client-side applications running in the browser, use this code instead:
60-
// const credential = new InteractiveBrowserCredential({
61-
// tenantId: "<YOUR_TENANT_ID>",
62-
// clientId: "<YOUR_CLIENT_ID>"
63-
// });
64-
// const client = new SubscriptionClient(credential, subscriptionId);
6554
```
6655

6756

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"commit": "a42f1b58607091c4f255ead152a8ef323fa0b280",
3-
"readme": "specification\\resources\\resource-manager\\readme.md",
4-
"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\\resources\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1 --generate-sample=true",
2+
"commit": "d8ea7da67c4e0f3c004662afda82f79abc881f57",
3+
"readme": "specification/resources/resource-manager/readme.md",
4+
"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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220105.1",
55
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
6-
"release_tool": "@azure-tools/js-sdk-release-tools@2.2.6",
7-
"use": "@autorest/typescript@6.0.0-alpha.19.20220408.1"
6+
"release_tool": "@azure-tools/js-sdk-release-tools@2.3.0",
7+
"use": "@autorest/typescript@6.0.0-alpha.16.20220105.1"
88
}

sdk/resources-subscriptions/arm-resources-subscriptions/package.json

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
"sdk-type": "mgmt",
44
"author": "Microsoft Corporation",
55
"description": "A generated SDK for SubscriptionClient.",
6-
"version": "2.0.2",
6+
"version": "2.1.0",
77
"engines": {
88
"node": ">=12.0.0"
99
},
1010
"dependencies": {
1111
"@azure/core-paging": "^1.2.0",
12-
"@azure/core-client": "^1.5.0",
12+
"@azure/core-client": "^1.0.0",
1313
"@azure/core-auth": "^1.3.0",
14-
"@azure/core-rest-pipeline": "^1.8.0",
14+
"@azure/core-rest-pipeline": "^1.1.0",
1515
"tslib": "^2.2.0"
1616
},
1717
"keywords": [
@@ -26,14 +26,14 @@
2626
"module": "./dist-esm/src/index.js",
2727
"types": "./types/arm-resources-subscriptions.d.ts",
2828
"devDependencies": {
29-
"@microsoft/api-extractor": "7.18.11",
30-
"@rollup/plugin-commonjs": "^21.0.1",
31-
"@rollup/plugin-json": "^4.1.0",
32-
"@rollup/plugin-multi-entry": "^4.1.0",
33-
"@rollup/plugin-node-resolve": "^13.1.3",
29+
"@microsoft/api-extractor": "^7.18.11",
30+
"@rollup/plugin-commonjs": "11.0.2",
31+
"@rollup/plugin-json": "^4.0.0",
32+
"@rollup/plugin-multi-entry": "^3.0.0",
33+
"@rollup/plugin-node-resolve": "^8.0.0",
3434
"mkdirp": "^1.0.4",
35-
"rollup": "^2.66.1",
36-
"rollup-plugin-sourcemaps": "^0.6.3",
35+
"rollup": "^1.16.3",
36+
"rollup-plugin-sourcemaps": "^0.4.2",
3737
"typescript": "~4.2.0",
3838
"uglify-js": "^3.4.9",
3939
"rimraf": "^3.0.0",
@@ -96,21 +96,5 @@
9696
"docs": "echo skipped"
9797
},
9898
"sideEffects": false,
99-
"//metadata": {
100-
"constantPaths": [
101-
{
102-
"path": "src/subscriptionClient.ts",
103-
"prefix": "packageDetails"
104-
}
105-
]
106-
},
107-
"autoPublish": true,
108-
"//sampleConfiguration": {
109-
"productName": "",
110-
"productSlugs": [
111-
"azure"
112-
],
113-
"disableDocsMs": true,
114-
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-resources-subscriptions?view=azure-node-preview"
115-
}
116-
}
99+
"autoPublish": true
100+
}

sdk/resources-subscriptions/arm-resources-subscriptions/review/arm-resources-subscriptions.api.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ import * as coreAuth from '@azure/core-auth';
88
import * as coreClient from '@azure/core-client';
99
import { PagedAsyncIterableIterator } from '@azure/core-paging';
1010

11+
// @public
12+
export interface AvailabilityZonePeers {
13+
readonly availabilityZone?: string;
14+
peers?: Peers[];
15+
}
16+
1117
// @public
1218
export interface CheckResourceNameOptionalParams extends coreClient.OperationOptions {
1319
resourceNameDefinition?: ResourceName;
@@ -23,6 +29,19 @@ export interface CheckResourceNameResult {
2329
type?: string;
2430
}
2531

32+
// @public
33+
export interface CheckZonePeersRequest {
34+
location?: string;
35+
subscriptionIds?: string[];
36+
}
37+
38+
// @public
39+
export interface CheckZonePeersResult {
40+
availabilityZonePeers?: AvailabilityZonePeers[];
41+
location?: string;
42+
readonly subscriptionId?: string;
43+
}
44+
2645
// @public
2746
export interface CloudError {
2847
error?: ErrorResponse;
@@ -34,6 +53,15 @@ export interface ErrorAdditionalInfo {
3453
readonly type?: string;
3554
}
3655

56+
// @public
57+
export interface ErrorDetail {
58+
readonly additionalInfo?: ErrorAdditionalInfo[];
59+
readonly code?: string;
60+
readonly details?: ErrorDetail[];
61+
readonly message?: string;
62+
readonly target?: string;
63+
}
64+
3765
// @public
3866
export interface ErrorResponse {
3967
readonly additionalInfo?: ErrorAdditionalInfo[];
@@ -43,6 +71,11 @@ export interface ErrorResponse {
4371
readonly target?: string;
4472
}
4573

74+
// @public
75+
export interface ErrorResponseAutoGenerated {
76+
error?: ErrorDetail;
77+
}
78+
4679
// @public
4780
export enum KnownRegionCategory {
4881
// (undocumented)
@@ -133,6 +166,12 @@ export interface PairedRegion {
133166
readonly subscriptionId?: string;
134167
}
135168

169+
// @public
170+
export interface Peers {
171+
readonly availabilityZone?: string;
172+
readonly subscriptionId?: string;
173+
}
174+
136175
// @public
137176
export type RegionCategory = string;
138177

@@ -202,11 +241,19 @@ export interface SubscriptionPolicies {
202241

203242
// @public
204243
export interface Subscriptions {
244+
checkZonePeers(subscriptionId: string, parameters: CheckZonePeersRequest, options?: SubscriptionsCheckZonePeersOptionalParams): Promise<SubscriptionsCheckZonePeersResponse>;
205245
get(subscriptionId: string, options?: SubscriptionsGetOptionalParams): Promise<SubscriptionsGetResponse>;
206246
list(options?: SubscriptionsListOptionalParams): PagedAsyncIterableIterator<Subscription>;
207247
listLocations(subscriptionId: string, options?: SubscriptionsListLocationsOptionalParams): PagedAsyncIterableIterator<Location_2>;
208248
}
209249

250+
// @public
251+
export interface SubscriptionsCheckZonePeersOptionalParams extends coreClient.OperationOptions {
252+
}
253+
254+
// @public
255+
export type SubscriptionsCheckZonePeersResponse = CheckZonePeersResult;
256+
210257
// @public
211258
export interface SubscriptionsGetOptionalParams extends coreClient.OperationOptions {
212259
}

sdk/resources-subscriptions/arm-resources-subscriptions/rollup.config.js

Lines changed: 72 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,62 @@ import json from "@rollup/plugin-json";
1414

1515
import nodeBuiltins from "builtin-modules";
1616

17+
/**
18+
* Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api.
19+
*
20+
* NOTE: this manual configuration is only needed because OpenTelemetry uses an
21+
* __exportStar downleveled helper function to declare its exports which confuses
22+
* rollup's automatic discovery mechanism.
23+
*
24+
* @returns an object reference that can be `...`'d into your cjs() configuration.
25+
*/
26+
export function openTelemetryCommonJs() {
27+
const namedExports = {};
28+
29+
for (const key of [
30+
"@opentelemetry/api",
31+
"@azure/core-tracing/node_modules/@opentelemetry/api"
32+
]) {
33+
namedExports[key] = [
34+
"SpanKind",
35+
"TraceFlags",
36+
"getSpan",
37+
"setSpan",
38+
"SpanStatusCode",
39+
"getSpanContext",
40+
"setSpanContext"
41+
];
42+
}
43+
44+
const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"];
45+
46+
for (const version of releasedOpenTelemetryVersions) {
47+
namedExports[
48+
// working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path.
49+
`../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js`
50+
] = [
51+
"SpanKind",
52+
"TraceFlags",
53+
"getSpan",
54+
"setSpan",
55+
"StatusCode",
56+
"CanonicalCode",
57+
"getSpanContext",
58+
"setSpanContext"
59+
];
60+
}
61+
62+
return namedExports;
63+
}
64+
1765
// #region Warning Handler
1866

1967
/**
20-
* A function that can determine whether a rollup warning should be ignored. If
68+
* A function that can determine whether a rollupwarning should be ignored. If
2169
* the function returns `true`, then the warning will not be displayed.
2270
*/
2371

24-
function ignoreNiseSinonEval(warning) {
72+
function ignoreNiseSinonEvalWarnings(warning) {
2573
return (
2674
warning.code === "EVAL" &&
2775
warning.id &&
@@ -30,14 +78,17 @@ function ignoreNiseSinonEval(warning) {
3078
);
3179
}
3280

33-
function ignoreChaiCircularDependency(warning) {
81+
function ignoreChaiCircularDependencyWarnings(warning) {
3482
return (
3583
warning.code === "CIRCULAR_DEPENDENCY" &&
3684
warning.importer && warning.importer.includes("node_modules/chai") === true
3785
);
3886
}
3987

40-
const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval];
88+
const warningInhibitors = [
89+
ignoreChaiCircularDependencyWarnings,
90+
ignoreNiseSinonEvalWarnings
91+
];
4192

4293
/**
4394
* Construct a warning handler for the shared rollup configuration
@@ -71,7 +122,22 @@ function makeBrowserTestConfig() {
71122
nodeResolve({
72123
mainFields: ["module", "browser"]
73124
}),
74-
cjs(),
125+
cjs({
126+
namedExports: {
127+
// Chai's strange internal architecture makes it impossible to statically
128+
// analyze its exports.
129+
chai: [
130+
"version",
131+
"use",
132+
"util",
133+
"config",
134+
"expect",
135+
"should",
136+
"assert"
137+
],
138+
...openTelemetryCommonJs()
139+
}
140+
}),
75141
json(),
76142
sourcemaps()
77143
//viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
@@ -107,7 +173,7 @@ export function makeConfig(pkg, options) {
107173
],
108174
output: { file: "dist/index.js", format: "cjs", sourcemap: true },
109175
preserveSymlinks: false,
110-
plugins: [sourcemaps(), nodeResolve()]
176+
plugins: [sourcemaps(), nodeResolve(), cjs()]
111177
};
112178

113179
const config = [baseConfig];

0 commit comments

Comments
 (0)