@azure/arm-locks 1.2.0 → 2.0.0-alpha.20211015.3

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.
Files changed (84) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/{LICENSE.txt → LICENSE} +2 -2
  3. package/README.md +63 -80
  4. package/dist/index.js +1796 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.min.js +1 -0
  7. package/dist/index.min.js.map +1 -0
  8. package/esm/index.d.ts +534 -0
  9. package/esm/index.d.ts.map +1 -0
  10. package/esm/index.js +13 -0
  11. package/esm/index.js.map +1 -0
  12. package/esm/managementLockClient.d.ts +9 -18
  13. package/esm/managementLockClient.d.ts.map +1 -1
  14. package/esm/managementLockClient.js +12 -28
  15. package/esm/managementLockClient.js.map +1 -1
  16. package/esm/managementLockClientContext.d.ts +10 -16
  17. package/esm/managementLockClientContext.d.ts.map +1 -1
  18. package/esm/managementLockClientContext.js +34 -46
  19. package/esm/managementLockClientContext.js.map +1 -1
  20. package/esm/models/index.d.ts +208 -445
  21. package/esm/models/index.d.ts.map +1 -1
  22. package/esm/models/index.js +9 -2
  23. package/esm/models/index.js.map +1 -1
  24. package/esm/models/mappers.d.ts +7 -9
  25. package/esm/models/mappers.d.ts.map +1 -1
  26. package/esm/models/mappers.js +69 -78
  27. package/esm/models/mappers.js.map +1 -1
  28. package/esm/models/parameters.d.ts +16 -13
  29. package/esm/models/parameters.d.ts.map +1 -1
  30. package/esm/models/parameters.js +78 -54
  31. package/esm/models/parameters.js.map +1 -1
  32. package/esm/operations/authorizationOperations.d.ts +27 -26
  33. package/esm/operations/authorizationOperations.d.ts.map +1 -1
  34. package/esm/operations/authorizationOperations.js +158 -50
  35. package/esm/operations/authorizationOperations.js.map +1 -1
  36. package/esm/operations/index.d.ts.map +1 -1
  37. package/esm/operations/index.js +3 -5
  38. package/esm/operations/index.js.map +1 -1
  39. package/esm/operations/managementLocks.d.ts +203 -393
  40. package/esm/operations/managementLocks.d.ts.map +1 -1
  41. package/esm/operations/managementLocks.js +993 -485
  42. package/esm/operations/managementLocks.js.map +1 -1
  43. package/esm/operationsInterfaces/authorizationOperations.d.ts +18 -0
  44. package/esm/operationsInterfaces/authorizationOperations.d.ts.map +1 -0
  45. package/esm/operationsInterfaces/authorizationOperations.js +9 -0
  46. package/esm/operationsInterfaces/authorizationOperations.js.map +1 -0
  47. package/esm/operationsInterfaces/index.d.ts +3 -0
  48. package/esm/operationsInterfaces/index.d.ts.map +1 -0
  49. package/esm/operationsInterfaces/index.js +10 -0
  50. package/esm/operationsInterfaces/index.js.map +1 -0
  51. package/esm/operationsInterfaces/managementLocks.d.ts +198 -0
  52. package/esm/operationsInterfaces/managementLocks.d.ts.map +1 -0
  53. package/esm/operationsInterfaces/managementLocks.js +9 -0
  54. package/esm/operationsInterfaces/managementLocks.js.map +1 -0
  55. package/package.json +53 -16
  56. package/review/arm-locks.api.md +313 -0
  57. package/rollup.config.js +181 -30
  58. package/src/index.ts +13 -0
  59. package/src/managementLockClient.ts +23 -36
  60. package/src/managementLockClientContext.ts +47 -45
  61. package/src/models/index.ts +256 -470
  62. package/src/models/mappers.ts +72 -82
  63. package/src/models/parameters.ts +97 -55
  64. package/src/operations/authorizationOperations.ts +155 -70
  65. package/src/operations/index.ts +3 -5
  66. package/src/operations/managementLocks.ts +1165 -869
  67. package/src/operationsInterfaces/authorizationOperations.ts +36 -0
  68. package/src/operationsInterfaces/index.ts +10 -0
  69. package/src/operationsInterfaces/managementLocks.ts +332 -0
  70. package/tsconfig.json +3 -2
  71. package/dist/arm-locks.js +0 -1280
  72. package/dist/arm-locks.js.map +0 -1
  73. package/dist/arm-locks.min.js +0 -1
  74. package/dist/arm-locks.min.js.map +0 -1
  75. package/esm/models/authorizationOperationsMappers.d.ts +0 -2
  76. package/esm/models/authorizationOperationsMappers.d.ts.map +0 -1
  77. package/esm/models/authorizationOperationsMappers.js +0 -9
  78. package/esm/models/authorizationOperationsMappers.js.map +0 -1
  79. package/esm/models/managementLocksMappers.d.ts +0 -2
  80. package/esm/models/managementLocksMappers.d.ts.map +0 -1
  81. package/esm/models/managementLocksMappers.js +0 -9
  82. package/esm/models/managementLocksMappers.js.map +0 -1
  83. package/src/models/authorizationOperationsMappers.ts +0 -14
  84. package/src/models/managementLocksMappers.ts +0 -15
package/CHANGELOG.md ADDED
@@ -0,0 +1,26 @@
1
+ # Release History
2
+
3
+ ## 2.0.0-beta.2 (Unreleased)
4
+
5
+ ### Features Added
6
+
7
+ ### Breaking Changes
8
+
9
+ ### Bugs Fixed
10
+
11
+ ### Other Changes
12
+
13
+ ## 2.0.0-beta.1 (2021-10-09)
14
+
15
+ This is the first preview for the new version of the `@azure/arm-locks` package that follows the new [guidelines for TypeScript SDKs](https://azure.github.io/azure-sdk/typescript_introduction.html) for Azure services.
16
+
17
+ While this package remains auto generated, the SDK generator itself has undergone changes to comply with the above guidelines in order to generate packages that are idiomatic to the JavaScript/TypeScript ecosystem and consistent with other packages for Azure services. For more on this, please see [State of the Azure SDK 2021](https://devblogs.microsoft.com/azure-sdk/state-of-the-azure-sdk-2021/).
18
+
19
+ Please note that this version has breaking changes, all of which were made after careful consideration during the authoring of the guidelines and user studies.
20
+
21
+ **Noteworthy changes and features**
22
+ - Authentication: The packages `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` are no longer supported. Use package [@azure/identity](https://www.npmjs.com/package/@azure/identity) instead. Select a credential from Azure Identity examples based on the authentication method of your choice.
23
+ - Callbacks: Method overloads that used callbacks have been removed and the use of promises is encouraged instead.
24
+ - List operations now return an iterable result that follows the `PagedAsyncIterableIterator` interface as opposed to the previous model where you had to make a new request using the link to the next page.
25
+ - Long running operations i.e. the Lro related object returned by methods whose names started with `begin`, now uses `pollUntilDone` to check whether the request is finished, instead of `pollUntilFinished`. To get the final result, use the corresponding method that will have the suffix `AndWait`.
26
+ - The SDK only supports ECMAScript 2015 (ES6) and beyond, all projects that referenced this SDK should be upgraded to use ES6.
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2019 Microsoft
3
+ Copyright (c) 2021 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
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,109 +1,92 @@
1
- ## Azure ManagementLockClient SDK for JavaScript
1
+ # Azure ManagementLock client library for JavaScript
2
2
 
3
- This package contains an isomorphic SDK (runs both in Node.js and in browsers) for ManagementLockClient.
3
+ This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ManagementLock client.
4
+
5
+ Azure resources can be locked to prevent other users in your organization from deleting or modifying resources.
6
+
7
+ [Source code](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/locks/arm-locks) |
8
+ [Package (NPM)](https://www.npmjs.com/package/@azure/arm-locks) |
9
+ [API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-locks) |
10
+ [Samples](https://github.com/Azure-Samples/azure-samples-js-management)
11
+
12
+ ## Getting started
4
13
 
5
14
  ### Currently supported environments
6
15
 
7
16
  - [LTS versions of Node.js](https://nodejs.org/about/releases/)
8
- - Latest versions of Safari, Chrome, Edge, and Firefox.
17
+ - Latest versions of Safari, Chrome, Edge and Firefox.
9
18
 
10
19
  ### Prerequisites
11
20
 
12
- You must have an [Azure subscription](https://azure.microsoft.com/free/).
21
+ - An [Azure subscription][azure_sub].
13
22
 
14
- ### How to install
23
+ ### Install the `@azure/arm-locks` package
15
24
 
16
- To use this SDK in your project, you will need to install two packages.
17
- - `@azure/arm-locks` that contains the client.
18
- - `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory.
25
+ Install the Azure ManagementLock client library for JavaScript with `npm`:
19
26
 
20
- Install both packages using the below command:
21
27
  ```bash
22
- npm install --save @azure/arm-locks @azure/identity
28
+ npm install @azure/arm-locks
23
29
  ```
24
30
 
25
- > **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features.
26
- If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options.
31
+ ### Create and authenticate a `ManagementLockClient`
27
32
 
28
- ### How to use
33
+ To create a client object to access the Azure ManagementLock API, you will need the `endpoint` of your Azure ManagementLock resource and a `credential`. The Azure ManagementLock client can use Azure Active Directory credentials to authenticate.
34
+ You can find the endpoint for your Azure ManagementLock resource in the [Azure Portal][azure_portal].
29
35
 
30
- - If you are writing a client side browser application,
31
- - Follow the instructions in the section on Authenticating client side browser applications in [Azure Identity examples](https://aka.ms/azsdk/js/identity/examples) to register your application in the Microsoft identity platform and set the right permissions.
32
- - Copy the client ID and tenant ID from the Overview section of your app registration in Azure portal and use it in the browser sample below.
33
- - If you are writing a server side application,
34
- - [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples)
35
- - Complete the set up steps required by the credential if any.
36
- - Use the credential you picked in the place of `DefaultAzureCredential` in the Node.js sample below.
36
+ #### Using an Azure Active Directory Credential
37
37
 
38
- In the below samples, we pass the credential and the Azure subscription id to instantiate the client.
39
- Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started.
38
+ You can authenticate with Azure Active Directory using the [Azure Identity library][azure_identity]. To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package:
40
39
 
41
- #### nodejs - Authentication, client creation, and list authorizationOperations as an example written in JavaScript.
40
+ ```bash
41
+ npm install @azure/identity
42
+ ```
42
43
 
43
- ##### Sample code
44
+ You will also need to register a new AAD application and grant access to Azure ManagementLock by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
45
+ 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`.
44
46
 
45
47
  ```javascript
46
- const { DefaultAzureCredential } = require("@azure/identity");
47
48
  const { ManagementLockClient } = require("@azure/arm-locks");
48
- const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
49
-
50
- // Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples
51
- // Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead.
52
- const creds = new DefaultAzureCredential();
53
- const client = new ManagementLockClient(creds, subscriptionId);
54
-
55
- client.authorizationOperations.list().then((result) => {
56
- console.log("The result is:");
57
- console.log(result);
58
- }).catch((err) => {
59
- console.log("An error occurred:");
60
- console.error(err);
61
- });
49
+ const { DefaultAzureCredential } = require("@azure/identity");
50
+ const subscriptionId = "00000000-0000-0000-0000-000000000000";
51
+ const client = new ManagementLockClient(new DefaultAzureCredential(), subscriptionId);
62
52
  ```
63
53
 
64
- #### browser - Authentication, client creation, and list authorizationOperations as an example written in JavaScript.
65
-
66
- In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser.
67
- - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser.
68
- - Note down the client Id from the previous step and use it in the browser sample below.
69
-
70
- ##### Sample code
71
-
72
- - index.html
73
-
74
- ```html
75
- <!DOCTYPE html>
76
- <html lang="en">
77
- <head>
78
- <title>@azure/arm-locks sample</title>
79
- <script src="node_modules/@azure/ms-rest-azure-js/dist/msRestAzure.js"></script>
80
- <script src="node_modules/@azure/identity/dist/index.js"></script>
81
- <script src="node_modules/@azure/arm-locks/dist/arm-locks.js"></script>
82
- <script type="text/javascript">
83
- const subscriptionId = "<Subscription_Id>";
84
- // Create credentials using the `@azure/identity` package.
85
- // Please note that you can also use credentials from the `@azure/ms-rest-browserauth` package instead.
86
- const credential = new InteractiveBrowserCredential(
87
- {
88
- clientId: "<client id for your Azure AD app>",
89
- tenantId: "<optional tenant for your organization>"
90
- });
91
- const client = new Azure.ArmLocks.ManagementLockClient(creds, subscriptionId);
92
- client.authorizationOperations.list().then((result) => {
93
- console.log("The result is:");
94
- console.log(result);
95
- }).catch((err) => {
96
- console.log("An error occurred:");
97
- console.error(err);
98
- });
99
- </script>
100
- </head>
101
- <body></body>
102
- </html>
54
+ ## Key concepts
55
+
56
+ ### ManagementLockClient
57
+
58
+ `ManagementLockClient` is the primary interface for developers using the Azure ManagementLock client library. Explore the methods on this client object to understand the different features of the Azure ManagementLock service that you can access.
59
+
60
+ ## Troubleshooting
61
+
62
+ ### Logging
63
+
64
+ Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
65
+
66
+ ```javascript
67
+ import { setLogLevel } from "@azure/logger";
68
+ setLogLevel("info");
103
69
  ```
104
70
 
71
+ For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).
72
+
73
+ ## Next steps
74
+
75
+ Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library.
76
+
77
+ ## Contributing
78
+
79
+ If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.
80
+
105
81
  ## Related projects
106
82
 
107
- - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
83
+ - [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js)
84
+
85
+ ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Flocks%2Farm-locks%2FREADME.png)
108
86
 
109
- ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/locks/arm-locks/README.png)
87
+ [azure_cli]: https://docs.microsoft.com/cli/azure
88
+ [azure_sub]: https://azure.microsoft.com/free/
89
+ [azure_sub]: https://azure.microsoft.com/free/
90
+ [azure_portal]: https://portal.azure.com
91
+ [azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity
92
+ [defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity#defaultazurecredential