@azure/arm-portal 1.0.0-beta.3 → 1.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
- ## Release History
1
+ # Release History
2
+
3
+ ## 1.0.0-beta.4 (2022-07-08)
4
+
5
+ **Features**
2
6
 
7
+ - Added Interface Configuration
8
+ - Added Interface MarkdownPartMetadata
9
+ - Added Interface ProxyResource
10
+
3
11
  ### 1.0.0-beta.3 (2022-04-28)
4
12
 
5
13
  **Features**
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Azure Service client library for JavaScript
1
+ # Azure Portal client library for JavaScript
2
2
 
3
- This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Service client.
3
+ This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Portal client.
4
4
 
5
5
  Allows creation and deletion of Azure Shared Dashboards.
6
6
 
@@ -24,7 +24,7 @@ See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUP
24
24
 
25
25
  ### Install the `@azure/arm-portal` package
26
26
 
27
- Install the Azure Service client library for JavaScript with `npm`:
27
+ Install the Azure Portal client library for JavaScript with `npm`:
28
28
 
29
29
  ```bash
30
30
  npm install @azure/arm-portal
@@ -32,8 +32,8 @@ npm install @azure/arm-portal
32
32
 
33
33
  ### Create and authenticate a `Portal`
34
34
 
35
- To create a client object to access the Azure Service API, you will need the `endpoint` of your Azure Service resource and a `credential`. The Azure Service client can use Azure Active Directory credentials to authenticate.
36
- You can find the endpoint for your Azure Service resource in the [Azure Portal][azure_portal].
35
+ To create a client object to access the Azure Portal API, you will need the `endpoint` of your Azure Portal resource and a `credential`. The Azure Portal client can use Azure Active Directory credentials to authenticate.
36
+ You can find the endpoint for your Azure Portal resource in the [Azure Portal][azure_portal].
37
37
 
38
38
  You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token).
39
39
 
@@ -43,7 +43,7 @@ To use the [DefaultAzureCredential][defaultazurecredential] provider shown below
43
43
  npm install @azure/identity
44
44
  ```
45
45
 
46
- You will also need to **register a new AAD application and grant access to Azure Service** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
46
+ You will also need to **register a new AAD application and grant access to Azure Portal** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
47
47
  Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.
48
48
 
49
49
  For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).
@@ -72,7 +72,7 @@ To use this client library in the browser, first you need to use a bundler. For
72
72
 
73
73
  ### Portal
74
74
 
75
- `Portal` is the primary interface for developers using the Azure Service client library. Explore the methods on this client object to understand the different features of the Azure Service service that you can access.
75
+ `Portal` is the primary interface for developers using the Azure Portal client library. Explore the methods on this client object to understand the different features of the Azure Portal service that you can access.
76
76
 
77
77
  ## Troubleshooting
78
78
 
package/dist/index.js CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var tslib = require('tslib');
5
6
  var coreClient = require('@azure/core-client');
6
7
  var coreRestPipeline = require('@azure/core-rest-pipeline');
7
- var tslib = require('tslib');
8
8
 
9
9
  function _interopNamespace(e) {
10
10
  if (e && e.__esModule) return e;
@@ -37,6 +37,7 @@ var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipelin
37
37
  /** Known values of {@link ConfigurationName} that the service accepts. */
38
38
  exports.KnownConfigurationName = void 0;
39
39
  (function (KnownConfigurationName) {
40
+ /** Default */
40
41
  KnownConfigurationName["Default"] = "default";
41
42
  })(exports.KnownConfigurationName || (exports.KnownConfigurationName = {}));
42
43
 
@@ -1625,7 +1626,7 @@ class Portal extends coreClient__namespace.ServiceClient {
1625
1626
  requestContentType: "application/json; charset=utf-8",
1626
1627
  credential: credentials
1627
1628
  };
1628
- const packageDetails = `azsdk-js-arm-portal/1.0.0-beta.3`;
1629
+ const packageDetails = `azsdk-js-arm-portal/1.0.0-beta.4`;
1629
1630
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
1630
1631
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
1631
1632
  : `${packageDetails}`;
@@ -1661,6 +1662,34 @@ class Portal extends coreClient__namespace.ServiceClient {
1661
1662
  this.dashboards = new DashboardsImpl(this);
1662
1663
  this.tenantConfigurations = new TenantConfigurationsImpl(this);
1663
1664
  this.listTenantConfigurationViolations = new ListTenantConfigurationViolationsImpl(this);
1665
+ this.addCustomApiVersionPolicy(options.apiVersion);
1666
+ }
1667
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
1668
+ addCustomApiVersionPolicy(apiVersion) {
1669
+ if (!apiVersion) {
1670
+ return;
1671
+ }
1672
+ const apiVersionPolicy = {
1673
+ name: "CustomApiVersionPolicy",
1674
+ sendRequest(request, next) {
1675
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1676
+ const param = request.url.split("?");
1677
+ if (param.length > 1) {
1678
+ const newParams = param[1].split("&").map((item) => {
1679
+ if (item.indexOf("api-version") > -1) {
1680
+ return "api-version=" + apiVersion;
1681
+ }
1682
+ else {
1683
+ return item;
1684
+ }
1685
+ });
1686
+ request.url = param[0] + "?" + newParams.join("&");
1687
+ }
1688
+ return next(request);
1689
+ });
1690
+ }
1691
+ };
1692
+ this.pipeline.addPolicy(apiVersionPolicy);
1664
1693
  }
1665
1694
  }
1666
1695