@azure/arm-resourcehealth 3.0.1-alpha.20220421.1 → 3.0.2-alpha.20220506.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/LICENSE +1 -1
  3. package/README.md +11 -0
  4. package/dist/index.js +21 -2
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.js +1 -1
  7. package/dist/index.min.js.map +1 -1
  8. package/dist-esm/samples-dev/availabilityStatusesGetByResourceSample.d.ts +2 -0
  9. package/dist-esm/samples-dev/availabilityStatusesGetByResourceSample.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/availabilityStatusesGetByResourceSample.js +32 -0
  11. package/dist-esm/samples-dev/availabilityStatusesGetByResourceSample.js.map +1 -0
  12. package/dist-esm/samples-dev/availabilityStatusesListByResourceGroupSample.d.ts +2 -0
  13. package/dist-esm/samples-dev/availabilityStatusesListByResourceGroupSample.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/availabilityStatusesListByResourceGroupSample.js +48 -0
  15. package/dist-esm/samples-dev/availabilityStatusesListByResourceGroupSample.js.map +1 -0
  16. package/dist-esm/samples-dev/availabilityStatusesListBySubscriptionIdSample.d.ts +2 -0
  17. package/dist-esm/samples-dev/availabilityStatusesListBySubscriptionIdSample.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/availabilityStatusesListBySubscriptionIdSample.js +47 -0
  19. package/dist-esm/samples-dev/availabilityStatusesListBySubscriptionIdSample.js.map +1 -0
  20. package/dist-esm/samples-dev/availabilityStatusesListSample.d.ts +2 -0
  21. package/dist-esm/samples-dev/availabilityStatusesListSample.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/availabilityStatusesListSample.js +44 -0
  23. package/dist-esm/samples-dev/availabilityStatusesListSample.js.map +1 -0
  24. package/dist-esm/samples-dev/childAvailabilityStatusesGetByResourceSample.d.ts +2 -0
  25. package/dist-esm/samples-dev/childAvailabilityStatusesGetByResourceSample.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/childAvailabilityStatusesGetByResourceSample.js +34 -0
  27. package/dist-esm/samples-dev/childAvailabilityStatusesGetByResourceSample.js.map +1 -0
  28. package/dist-esm/samples-dev/childAvailabilityStatusesListSample.d.ts +2 -0
  29. package/dist-esm/samples-dev/childAvailabilityStatusesListSample.d.ts.map +1 -0
  30. package/dist-esm/samples-dev/childAvailabilityStatusesListSample.js +44 -0
  31. package/dist-esm/samples-dev/childAvailabilityStatusesListSample.js.map +1 -0
  32. package/dist-esm/samples-dev/childResourcesListSample.d.ts +2 -0
  33. package/dist-esm/samples-dev/childResourcesListSample.d.ts.map +1 -0
  34. package/dist-esm/samples-dev/childResourcesListSample.js +44 -0
  35. package/dist-esm/samples-dev/childResourcesListSample.js.map +1 -0
  36. package/dist-esm/samples-dev/emergingIssuesGetSample.d.ts +2 -0
  37. package/dist-esm/samples-dev/emergingIssuesGetSample.d.ts.map +1 -0
  38. package/dist-esm/samples-dev/emergingIssuesGetSample.js +29 -0
  39. package/dist-esm/samples-dev/emergingIssuesGetSample.js.map +1 -0
  40. package/dist-esm/samples-dev/emergingIssuesListSample.d.ts +2 -0
  41. package/dist-esm/samples-dev/emergingIssuesListSample.d.ts.map +1 -0
  42. package/dist-esm/samples-dev/emergingIssuesListSample.js +43 -0
  43. package/dist-esm/samples-dev/emergingIssuesListSample.js.map +1 -0
  44. package/dist-esm/src/microsoftResourceHealth.d.ts.map +1 -1
  45. package/dist-esm/src/microsoftResourceHealth.js +20 -2
  46. package/dist-esm/src/microsoftResourceHealth.js.map +1 -1
  47. package/package.json +25 -9
  48. package/rollup.config.js +6 -72
  49. package/src/microsoftResourceHealth.ts +27 -2
  50. package/tsconfig.json +19 -5
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Release History
2
2
 
3
- ## 3.0.1 (Unreleased)
3
+ ## 3.0.2 (Unreleased)
4
4
 
5
5
  ### Features Added
6
6
 
@@ -10,6 +10,12 @@
10
10
 
11
11
  ### Other Changes
12
12
 
13
+ ## 3.0.1 (2022-04-29)
14
+
15
+ **Features**
16
+
17
+ - Bug fix
18
+
13
19
  ## 3.0.0 (2021-12-22)
14
20
 
15
21
  The package of @azure/arm-resourcehealth is using our next generation design principles since version 3.0.0, which contains breaking changes.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2021 Microsoft
3
+ Copyright (c) 2022 Microsoft
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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/1.0.0-beta.1`;
1792
+ const packageDetails = `azsdk-js-arm-resourcehealth/3.0.2`;
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 || "https://management.azure.com" });
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