@azure/arm-portal 1.0.0-alpha.20220421.1 → 1.0.0-alpha.20220908.1
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 +21 -7
- package/LICENSE +1 -1
- package/README.md +18 -7
- package/dist/index.js +51 -3
- 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/dashboardsCreateOrUpdateSample.d.ts +2 -0
- package/dist-esm/samples-dev/dashboardsCreateOrUpdateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/dashboardsCreateOrUpdateSample.js +46 -0
- package/dist-esm/samples-dev/dashboardsCreateOrUpdateSample.js.map +1 -0
- package/dist-esm/samples-dev/dashboardsDeleteSample.d.ts +2 -0
- package/dist-esm/samples-dev/dashboardsDeleteSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/dashboardsDeleteSample.js +31 -0
- package/dist-esm/samples-dev/dashboardsDeleteSample.js.map +1 -0
- package/dist-esm/samples-dev/dashboardsGetSample.d.ts +2 -0
- package/dist-esm/samples-dev/dashboardsGetSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/dashboardsGetSample.js +31 -0
- package/dist-esm/samples-dev/dashboardsGetSample.js.map +1 -0
- package/dist-esm/samples-dev/dashboardsListByResourceGroupSample.d.ts +2 -0
- package/dist-esm/samples-dev/dashboardsListByResourceGroupSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/dashboardsListByResourceGroupSample.js +44 -0
- package/dist-esm/samples-dev/dashboardsListByResourceGroupSample.js.map +1 -0
- package/dist-esm/samples-dev/dashboardsListBySubscriptionSample.d.ts +2 -0
- package/dist-esm/samples-dev/dashboardsListBySubscriptionSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/dashboardsListBySubscriptionSample.js +43 -0
- package/dist-esm/samples-dev/dashboardsListBySubscriptionSample.js.map +1 -0
- package/dist-esm/samples-dev/dashboardsUpdateSample.d.ts +2 -0
- package/dist-esm/samples-dev/dashboardsUpdateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/dashboardsUpdateSample.js +34 -0
- package/dist-esm/samples-dev/dashboardsUpdateSample.js.map +1 -0
- package/dist-esm/samples-dev/listTenantConfigurationViolationsListSample.d.ts +2 -0
- package/dist-esm/samples-dev/listTenantConfigurationViolationsListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/listTenantConfigurationViolationsListSample.js +43 -0
- package/dist-esm/samples-dev/listTenantConfigurationViolationsListSample.js.map +1 -0
- package/dist-esm/samples-dev/operationsListSample.d.ts +2 -0
- package/dist-esm/samples-dev/operationsListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/operationsListSample.js +43 -0
- package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
- package/dist-esm/samples-dev/tenantConfigurationsCreateSample.d.ts +2 -0
- package/dist-esm/samples-dev/tenantConfigurationsCreateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/tenantConfigurationsCreateSample.js +33 -0
- package/dist-esm/samples-dev/tenantConfigurationsCreateSample.js.map +1 -0
- package/dist-esm/samples-dev/tenantConfigurationsDeleteSample.d.ts +2 -0
- package/dist-esm/samples-dev/tenantConfigurationsDeleteSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/tenantConfigurationsDeleteSample.js +30 -0
- package/dist-esm/samples-dev/tenantConfigurationsDeleteSample.js.map +1 -0
- package/dist-esm/samples-dev/tenantConfigurationsGetSample.d.ts +2 -0
- package/dist-esm/samples-dev/tenantConfigurationsGetSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/tenantConfigurationsGetSample.js +30 -0
- package/dist-esm/samples-dev/tenantConfigurationsGetSample.js.map +1 -0
- package/dist-esm/samples-dev/tenantConfigurationsListSample.d.ts +2 -0
- package/dist-esm/samples-dev/tenantConfigurationsListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/tenantConfigurationsListSample.js +43 -0
- package/dist-esm/samples-dev/tenantConfigurationsListSample.js.map +1 -0
- package/dist-esm/src/models/index.d.ts +7 -5
- package/dist-esm/src/models/index.d.ts.map +1 -1
- package/dist-esm/src/models/index.js +1 -0
- package/dist-esm/src/models/index.js.map +1 -1
- package/dist-esm/src/portal.d.ts +2 -0
- package/dist-esm/src/portal.d.ts.map +1 -1
- package/dist-esm/src/portal.js +49 -2
- package/dist-esm/src/portal.js.map +1 -1
- package/dist-esm/test/sampleTest.js +11 -13
- package/dist-esm/test/sampleTest.js.map +1 -1
- package/package.json +33 -14
- package/review/arm-portal.api.md +7 -7
- package/rollup.config.js +6 -72
- package/src/models/index.ts +6 -5
- package/src/portal.ts +61 -2
- package/tsconfig.json +19 -5
- package/types/arm-portal.d.ts +9 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,16 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
# Release History
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## 1.0.0-beta.5 (Unreleased)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
### Features Added
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
### Breaking Changes
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### Bugs Fixed
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
### Other Changes
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
## 1.0.0-beta.4 (2022-07-08)
|
|
14
|
+
|
|
15
|
+
**Features**
|
|
16
|
+
|
|
17
|
+
- Added Interface Configuration
|
|
18
|
+
- Added Interface MarkdownPartMetadata
|
|
19
|
+
- Added Interface ProxyResource
|
|
20
|
+
|
|
21
|
+
## 1.0.0-beta.3 (2022-04-28)
|
|
22
|
+
|
|
23
|
+
**Features**
|
|
24
|
+
|
|
25
|
+
- Bug fix
|
|
26
|
+
|
|
27
|
+
## 1.0.0-beta.2 (2021-11-30)
|
|
14
28
|
|
|
15
29
|
The package of @azure/arm-portal is using our next generation design principles since version 1.0.0-beta.2, which contains breaking changes.
|
|
16
30
|
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Azure
|
|
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
|
|
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
|
|
|
@@ -16,13 +16,15 @@ Allows creation and deletion of Azure Shared Dashboards.
|
|
|
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].
|
|
22
24
|
|
|
23
25
|
### Install the `@azure/arm-portal` package
|
|
24
26
|
|
|
25
|
-
Install the Azure
|
|
27
|
+
Install the Azure Portal client library for JavaScript with `npm`:
|
|
26
28
|
|
|
27
29
|
```bash
|
|
28
30
|
npm install @azure/arm-portal
|
|
@@ -30,8 +32,8 @@ npm install @azure/arm-portal
|
|
|
30
32
|
|
|
31
33
|
### Create and authenticate a `Portal`
|
|
32
34
|
|
|
33
|
-
To create a client object to access the Azure
|
|
34
|
-
You can find the endpoint for your Azure
|
|
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].
|
|
35
37
|
|
|
36
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).
|
|
37
39
|
|
|
@@ -41,7 +43,7 @@ To use the [DefaultAzureCredential][defaultazurecredential] provider shown below
|
|
|
41
43
|
npm install @azure/identity
|
|
42
44
|
```
|
|
43
45
|
|
|
44
|
-
You will also need to **register a new AAD application and grant access to Azure
|
|
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).
|
|
45
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`.
|
|
46
48
|
|
|
47
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).
|
|
@@ -49,8 +51,17 @@ For more information about how to create an Azure AD Application check out [this
|
|
|
49
51
|
```javascript
|
|
50
52
|
const { Portal } = require("@azure/arm-portal");
|
|
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 Portal(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 Portal(credential, subscriptionId);
|
|
54
65
|
```
|
|
55
66
|
|
|
56
67
|
|
|
@@ -61,7 +72,7 @@ To use this client library in the browser, first you need to use a bundler. For
|
|
|
61
72
|
|
|
62
73
|
### Portal
|
|
63
74
|
|
|
64
|
-
`Portal` is the primary interface for developers using the Azure
|
|
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.
|
|
65
76
|
|
|
66
77
|
## Troubleshooting
|
|
67
78
|
|
package/dist/index.js
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var coreClient = require('@azure/core-client');
|
|
6
5
|
var tslib = require('tslib');
|
|
6
|
+
var coreClient = require('@azure/core-client');
|
|
7
|
+
var coreRestPipeline = require('@azure/core-rest-pipeline');
|
|
7
8
|
|
|
8
9
|
function _interopNamespace(e) {
|
|
9
10
|
if (e && e.__esModule) return 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.
|
|
@@ -35,6 +37,7 @@ var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
|
|
|
35
37
|
/** Known values of {@link ConfigurationName} that the service accepts. */
|
|
36
38
|
exports.KnownConfigurationName = void 0;
|
|
37
39
|
(function (KnownConfigurationName) {
|
|
40
|
+
/** Default */
|
|
38
41
|
KnownConfigurationName["Default"] = "default";
|
|
39
42
|
})(exports.KnownConfigurationName || (exports.KnownConfigurationName = {}));
|
|
40
43
|
|
|
@@ -1608,6 +1611,7 @@ class Portal extends coreClient__namespace.ServiceClient {
|
|
|
1608
1611
|
* @param options The parameter options
|
|
1609
1612
|
*/
|
|
1610
1613
|
constructor(credentials, subscriptionId, options) {
|
|
1614
|
+
var _a, _b;
|
|
1611
1615
|
if (credentials === undefined) {
|
|
1612
1616
|
throw new Error("'credentials' cannot be null");
|
|
1613
1617
|
}
|
|
@@ -1622,7 +1626,7 @@ class Portal extends coreClient__namespace.ServiceClient {
|
|
|
1622
1626
|
requestContentType: "application/json; charset=utf-8",
|
|
1623
1627
|
credential: credentials
|
|
1624
1628
|
};
|
|
1625
|
-
const packageDetails = `azsdk-js-arm-portal/1.0.0-beta.
|
|
1629
|
+
const packageDetails = `azsdk-js-arm-portal/1.0.0-beta.5`;
|
|
1626
1630
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
1627
1631
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
1628
1632
|
: `${packageDetails}`;
|
|
@@ -1631,8 +1635,24 @@ class Portal extends coreClient__namespace.ServiceClient {
|
|
|
1631
1635
|
}
|
|
1632
1636
|
const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
|
|
1633
1637
|
userAgentPrefix
|
|
1634
|
-
}, baseUri: options.endpoint
|
|
1638
|
+
}, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
|
|
1635
1639
|
super(optionsWithDefaults);
|
|
1640
|
+
if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
|
|
1641
|
+
const pipelinePolicies = options.pipeline.getOrderedPolicies();
|
|
1642
|
+
const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
|
|
1643
|
+
coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
|
|
1644
|
+
if (!bearerTokenAuthenticationPolicyFound) {
|
|
1645
|
+
this.pipeline.removePolicy({
|
|
1646
|
+
name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
|
|
1647
|
+
});
|
|
1648
|
+
this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
|
|
1649
|
+
scopes: `${optionsWithDefaults.baseUri}/.default`,
|
|
1650
|
+
challengeCallbacks: {
|
|
1651
|
+
authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
|
|
1652
|
+
}
|
|
1653
|
+
}));
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1636
1656
|
// Parameter assignments
|
|
1637
1657
|
this.subscriptionId = subscriptionId;
|
|
1638
1658
|
// Assigning values to Constant parameters
|
|
@@ -1642,6 +1662,34 @@ class Portal extends coreClient__namespace.ServiceClient {
|
|
|
1642
1662
|
this.dashboards = new DashboardsImpl(this);
|
|
1643
1663
|
this.tenantConfigurations = new TenantConfigurationsImpl(this);
|
|
1644
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);
|
|
1645
1693
|
}
|
|
1646
1694
|
}
|
|
1647
1695
|
|