@azure/arm-resourcehealth 3.0.1-alpha.20220421.1 → 3.0.1-alpha.20220505.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +3 -7
- package/LICENSE +1 -1
- package/README.md +11 -0
- package/dist/index.js +21 -2
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist-esm/samples-dev/availabilityStatusesGetByResourceSample.d.ts +2 -0
- package/dist-esm/samples-dev/availabilityStatusesGetByResourceSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/availabilityStatusesGetByResourceSample.js +32 -0
- package/dist-esm/samples-dev/availabilityStatusesGetByResourceSample.js.map +1 -0
- package/dist-esm/samples-dev/availabilityStatusesListByResourceGroupSample.d.ts +2 -0
- package/dist-esm/samples-dev/availabilityStatusesListByResourceGroupSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/availabilityStatusesListByResourceGroupSample.js +48 -0
- package/dist-esm/samples-dev/availabilityStatusesListByResourceGroupSample.js.map +1 -0
- package/dist-esm/samples-dev/availabilityStatusesListBySubscriptionIdSample.d.ts +2 -0
- package/dist-esm/samples-dev/availabilityStatusesListBySubscriptionIdSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/availabilityStatusesListBySubscriptionIdSample.js +47 -0
- package/dist-esm/samples-dev/availabilityStatusesListBySubscriptionIdSample.js.map +1 -0
- package/dist-esm/samples-dev/availabilityStatusesListSample.d.ts +2 -0
- package/dist-esm/samples-dev/availabilityStatusesListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/availabilityStatusesListSample.js +44 -0
- package/dist-esm/samples-dev/availabilityStatusesListSample.js.map +1 -0
- package/dist-esm/samples-dev/childAvailabilityStatusesGetByResourceSample.d.ts +2 -0
- package/dist-esm/samples-dev/childAvailabilityStatusesGetByResourceSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/childAvailabilityStatusesGetByResourceSample.js +34 -0
- package/dist-esm/samples-dev/childAvailabilityStatusesGetByResourceSample.js.map +1 -0
- package/dist-esm/samples-dev/childAvailabilityStatusesListSample.d.ts +2 -0
- package/dist-esm/samples-dev/childAvailabilityStatusesListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/childAvailabilityStatusesListSample.js +44 -0
- package/dist-esm/samples-dev/childAvailabilityStatusesListSample.js.map +1 -0
- package/dist-esm/samples-dev/childResourcesListSample.d.ts +2 -0
- package/dist-esm/samples-dev/childResourcesListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/childResourcesListSample.js +44 -0
- package/dist-esm/samples-dev/childResourcesListSample.js.map +1 -0
- package/dist-esm/samples-dev/emergingIssuesGetSample.d.ts +2 -0
- package/dist-esm/samples-dev/emergingIssuesGetSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/emergingIssuesGetSample.js +29 -0
- package/dist-esm/samples-dev/emergingIssuesGetSample.js.map +1 -0
- package/dist-esm/samples-dev/emergingIssuesListSample.d.ts +2 -0
- package/dist-esm/samples-dev/emergingIssuesListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/emergingIssuesListSample.js +43 -0
- package/dist-esm/samples-dev/emergingIssuesListSample.js.map +1 -0
- package/dist-esm/src/microsoftResourceHealth.d.ts.map +1 -1
- package/dist-esm/src/microsoftResourceHealth.js +20 -2
- package/dist-esm/src/microsoftResourceHealth.js.map +1 -1
- package/package.json +25 -9
- package/rollup.config.js +6 -72
- package/src/microsoftResourceHealth.ts +27 -2
- package/tsconfig.json +19 -5
package/CHANGELOG.md
CHANGED
package/LICENSE
CHANGED
package/README.md
CHANGED
@@ -16,6 +16,8 @@ The Resource Health Client.
|
|
16
16
|
- [LTS versions of Node.js](https://nodejs.org/about/releases/)
|
17
17
|
- Latest versions of Safari, Chrome, Edge and Firefox.
|
18
18
|
|
19
|
+
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
|
20
|
+
|
19
21
|
### Prerequisites
|
20
22
|
|
21
23
|
- An [Azure subscription][azure_sub].
|
@@ -49,8 +51,17 @@ For more information about how to create an Azure AD Application check out [this
|
|
49
51
|
```javascript
|
50
52
|
const { MicrosoftResourceHealth } = require("@azure/arm-resourcehealth");
|
51
53
|
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
|
+
|
52
56
|
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
53
57
|
const client = new MicrosoftResourceHealth(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 MicrosoftResourceHealth(credential, subscriptionId);
|
54
65
|
```
|
55
66
|
|
56
67
|
|
package/dist/index.js
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
5
|
var coreClient = require('@azure/core-client');
|
6
|
+
var coreRestPipeline = require('@azure/core-rest-pipeline');
|
6
7
|
var tslib = require('tslib');
|
7
8
|
|
8
9
|
function _interopNamespace(e) {
|
@@ -24,6 +25,7 @@ function _interopNamespace(e) {
|
|
24
25
|
}
|
25
26
|
|
26
27
|
var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
|
28
|
+
var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipeline);
|
27
29
|
|
28
30
|
/*
|
29
31
|
* Copyright (c) Microsoft Corporation.
|
@@ -1772,6 +1774,7 @@ class MicrosoftResourceHealth extends coreClient__namespace.ServiceClient {
|
|
1772
1774
|
* @param options The parameter options
|
1773
1775
|
*/
|
1774
1776
|
constructor(credentials, subscriptionId, options) {
|
1777
|
+
var _a, _b;
|
1775
1778
|
if (credentials === undefined) {
|
1776
1779
|
throw new Error("'credentials' cannot be null");
|
1777
1780
|
}
|
@@ -1786,7 +1789,7 @@ class MicrosoftResourceHealth extends coreClient__namespace.ServiceClient {
|
|
1786
1789
|
requestContentType: "application/json; charset=utf-8",
|
1787
1790
|
credential: credentials
|
1788
1791
|
};
|
1789
|
-
const packageDetails = `azsdk-js-arm-resourcehealth/
|
1792
|
+
const packageDetails = `azsdk-js-arm-resourcehealth/3.0.1`;
|
1790
1793
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
1791
1794
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
1792
1795
|
: `${packageDetails}`;
|
@@ -1795,8 +1798,24 @@ class MicrosoftResourceHealth extends coreClient__namespace.ServiceClient {
|
|
1795
1798
|
}
|
1796
1799
|
const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
|
1797
1800
|
userAgentPrefix
|
1798
|
-
}, baseUri: options.endpoint
|
1801
|
+
}, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
|
1799
1802
|
super(optionsWithDefaults);
|
1803
|
+
if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
|
1804
|
+
const pipelinePolicies = options.pipeline.getOrderedPolicies();
|
1805
|
+
const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
|
1806
|
+
coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
|
1807
|
+
if (!bearerTokenAuthenticationPolicyFound) {
|
1808
|
+
this.pipeline.removePolicy({
|
1809
|
+
name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
|
1810
|
+
});
|
1811
|
+
this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
|
1812
|
+
scopes: `${optionsWithDefaults.baseUri}/.default`,
|
1813
|
+
challengeCallbacks: {
|
1814
|
+
authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
|
1815
|
+
}
|
1816
|
+
}));
|
1817
|
+
}
|
1818
|
+
}
|
1800
1819
|
// Parameter assignments
|
1801
1820
|
this.subscriptionId = subscriptionId;
|
1802
1821
|
// Assigning values to Constant parameters
|