@azure/arm-managedapplications 1.0.2 → 2.0.0-alpha.20211011.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.
Files changed (160) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/{LICENSE.txt → LICENSE} +2 -2
  3. package/README.md +66 -72
  4. package/dist/index.js +2896 -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/applicationClient.d.ts +50 -0
  9. package/esm/applicationClient.d.ts.map +1 -0
  10. package/esm/applicationClient.js +190 -0
  11. package/esm/applicationClient.js.map +1 -0
  12. package/esm/applicationClientContext.d.ts +16 -0
  13. package/esm/applicationClientContext.d.ts.map +1 -0
  14. package/esm/applicationClientContext.js +49 -0
  15. package/esm/applicationClientContext.js.map +1 -0
  16. package/esm/coreClientLro.d.ts +26 -0
  17. package/esm/coreClientLro.d.ts.map +1 -0
  18. package/esm/coreClientLro.js +186 -0
  19. package/esm/coreClientLro.js.map +1 -0
  20. package/esm/index.d.ts +770 -0
  21. package/esm/index.d.ts.map +1 -0
  22. package/esm/index.js +13 -0
  23. package/esm/index.js.map +1 -0
  24. package/esm/lro/azureAsyncPolling.d.ts +3 -0
  25. package/esm/lro/azureAsyncPolling.d.ts.map +1 -0
  26. package/esm/lro/azureAsyncPolling.js +67 -0
  27. package/esm/lro/azureAsyncPolling.js.map +1 -0
  28. package/esm/lro/bodyPolling.d.ts +8 -0
  29. package/esm/lro/bodyPolling.d.ts.map +1 -0
  30. package/esm/lro/bodyPolling.js +37 -0
  31. package/esm/lro/bodyPolling.js.map +1 -0
  32. package/esm/lro/index.d.ts +4 -0
  33. package/esm/lro/index.d.ts.map +1 -0
  34. package/esm/lro/index.js +12 -0
  35. package/esm/lro/index.js.map +1 -0
  36. package/esm/lro/locationPolling.d.ts +3 -0
  37. package/esm/lro/locationPolling.d.ts.map +1 -0
  38. package/esm/lro/locationPolling.js +19 -0
  39. package/esm/lro/locationPolling.js.map +1 -0
  40. package/esm/lro/lroEngine.d.ts +14 -0
  41. package/esm/lro/lroEngine.d.ts.map +1 -0
  42. package/esm/lro/lroEngine.js +41 -0
  43. package/esm/lro/lroEngine.js.map +1 -0
  44. package/esm/lro/models.d.ts +138 -0
  45. package/esm/lro/models.d.ts.map +1 -0
  46. package/esm/lro/models.js +14 -0
  47. package/esm/lro/models.js.map +1 -0
  48. package/esm/lro/operation.d.ts +36 -0
  49. package/esm/lro/operation.d.ts.map +1 -0
  50. package/esm/lro/operation.js +82 -0
  51. package/esm/lro/operation.js.map +1 -0
  52. package/esm/lro/passthrough.d.ts +3 -0
  53. package/esm/lro/passthrough.d.ts.map +1 -0
  54. package/esm/lro/passthrough.js +15 -0
  55. package/esm/lro/passthrough.js.map +1 -0
  56. package/esm/lro/requestUtils.d.ts +16 -0
  57. package/esm/lro/requestUtils.d.ts.map +1 -0
  58. package/esm/lro/requestUtils.js +73 -0
  59. package/esm/lro/requestUtils.js.map +1 -0
  60. package/esm/lro/stateMachine.d.ts +18 -0
  61. package/esm/lro/stateMachine.d.ts.map +1 -0
  62. package/esm/lro/stateMachine.js +84 -0
  63. package/esm/lro/stateMachine.js.map +1 -0
  64. package/esm/models/index.d.ts +360 -762
  65. package/esm/models/index.d.ts.map +1 -1
  66. package/esm/models/index.js +17 -2
  67. package/esm/models/index.js.map +1 -1
  68. package/esm/models/mappers.d.ts +18 -20
  69. package/esm/models/mappers.d.ts.map +1 -1
  70. package/esm/models/mappers.js +296 -318
  71. package/esm/models/mappers.js.map +1 -1
  72. package/esm/models/parameters.d.ts +15 -10
  73. package/esm/models/parameters.d.ts.map +1 -1
  74. package/esm/models/parameters.js +77 -49
  75. package/esm/models/parameters.js.map +1 -1
  76. package/esm/operations/applicationDefinitions.d.ts +128 -0
  77. package/esm/operations/applicationDefinitions.d.ts.map +1 -0
  78. package/esm/operations/applicationDefinitions.js +574 -0
  79. package/esm/operations/applicationDefinitions.js.map +1 -0
  80. package/esm/operations/applications.d.ts +182 -0
  81. package/esm/operations/applications.d.ts.map +1 -0
  82. package/esm/operations/applications.js +802 -0
  83. package/esm/operations/applications.js.map +1 -0
  84. package/esm/operations/index.d.ts +2 -2
  85. package/esm/operations/index.d.ts.map +1 -1
  86. package/esm/operations/index.js +5 -7
  87. package/esm/operations/index.js.map +1 -1
  88. package/esm/operationsInterfaces/applicationDefinitions.d.ts +95 -0
  89. package/esm/operationsInterfaces/applicationDefinitions.d.ts.map +1 -0
  90. package/esm/operationsInterfaces/applicationDefinitions.js +9 -0
  91. package/esm/operationsInterfaces/applicationDefinitions.js.map +1 -0
  92. package/esm/operationsInterfaces/applications.d.ts +128 -0
  93. package/esm/operationsInterfaces/applications.d.ts.map +1 -0
  94. package/esm/operationsInterfaces/applications.js +9 -0
  95. package/esm/operationsInterfaces/applications.js.map +1 -0
  96. package/esm/operationsInterfaces/index.d.ts +3 -0
  97. package/esm/operationsInterfaces/index.d.ts.map +1 -0
  98. package/esm/operationsInterfaces/index.js +10 -0
  99. package/esm/operationsInterfaces/index.js.map +1 -0
  100. package/package.json +56 -16
  101. package/review/arm-managedapplications.api.md +443 -0
  102. package/rollup.config.js +181 -30
  103. package/src/applicationClient.ts +222 -0
  104. package/src/applicationClientContext.ts +70 -0
  105. package/src/coreClientLro.ts +323 -0
  106. package/src/index.ts +13 -0
  107. package/src/lro/azureAsyncPolling.ts +96 -0
  108. package/src/lro/bodyPolling.ts +54 -0
  109. package/src/lro/index.ts +26 -0
  110. package/src/lro/locationPolling.ts +30 -0
  111. package/src/lro/lroEngine.ts +61 -0
  112. package/src/lro/models.ts +173 -0
  113. package/src/lro/operation.ts +120 -0
  114. package/src/lro/passthrough.ts +23 -0
  115. package/src/lro/requestUtils.ts +105 -0
  116. package/src/lro/stateMachine.ts +138 -0
  117. package/src/models/index.ts +402 -794
  118. package/src/models/mappers.ts +290 -311
  119. package/src/models/parameters.ts +99 -50
  120. package/src/operations/applicationDefinitions.ts +810 -0
  121. package/src/operations/applications.ts +1069 -0
  122. package/src/operations/index.ts +5 -7
  123. package/src/operationsInterfaces/applicationDefinitions.ts +179 -0
  124. package/src/operationsInterfaces/applications.ts +225 -0
  125. package/src/operationsInterfaces/index.ts +10 -0
  126. package/tsconfig.json +3 -2
  127. package/dist/arm-managedapplications.js +0 -1855
  128. package/dist/arm-managedapplications.js.map +0 -1
  129. package/dist/arm-managedapplications.min.js +0 -1
  130. package/dist/arm-managedapplications.min.js.map +0 -1
  131. package/esm/managedApplicationClient.d.ts +0 -52
  132. package/esm/managedApplicationClient.d.ts.map +0 -1
  133. package/esm/managedApplicationClient.js +0 -87
  134. package/esm/managedApplicationClient.js.map +0 -1
  135. package/esm/managedApplicationClientContext.d.ts +0 -16
  136. package/esm/managedApplicationClientContext.d.ts.map +0 -1
  137. package/esm/managedApplicationClientContext.js +0 -56
  138. package/esm/managedApplicationClientContext.js.map +0 -1
  139. package/esm/models/applianceDefinitionsMappers.d.ts +0 -2
  140. package/esm/models/applianceDefinitionsMappers.d.ts.map +0 -1
  141. package/esm/models/applianceDefinitionsMappers.js +0 -9
  142. package/esm/models/applianceDefinitionsMappers.js.map +0 -1
  143. package/esm/models/appliancesMappers.d.ts +0 -2
  144. package/esm/models/appliancesMappers.d.ts.map +0 -1
  145. package/esm/models/appliancesMappers.js +0 -9
  146. package/esm/models/appliancesMappers.js.map +0 -1
  147. package/esm/operations/applianceDefinitions.d.ts +0 -167
  148. package/esm/operations/applianceDefinitions.d.ts.map +0 -1
  149. package/esm/operations/applianceDefinitions.js +0 -358
  150. package/esm/operations/applianceDefinitions.js.map +0 -1
  151. package/esm/operations/appliances.d.ts +0 -247
  152. package/esm/operations/appliances.d.ts.map +0 -1
  153. package/esm/operations/appliances.js +0 -482
  154. package/esm/operations/appliances.js.map +0 -1
  155. package/src/managedApplicationClient.ts +0 -138
  156. package/src/managedApplicationClientContext.ts +0 -62
  157. package/src/models/applianceDefinitionsMappers.ts +0 -24
  158. package/src/models/appliancesMappers.ts +0 -24
  159. package/src/operations/applianceDefinitions.ts +0 -492
  160. package/src/operations/appliances.ts +0 -716
package/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
1
+ # Release History
2
+
3
+ ## 2.0.0-beta.1 (2021-10-09)
4
+
5
+ This is the first preview for the new version of the `@azure/arm-managedapplications` package that follows the new [guidelines for TypeScript SDKs](https://azure.github.io/azure-sdk/typescript_introduction.html) for Azure services.
6
+
7
+ 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/).
8
+
9
+ 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.
10
+
11
+ **Noteworthy changes and features**
12
+ - 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.
13
+ - Callbacks: Method overloads that used callbacks have been removed and the use of promises is encouraged instead.
14
+ - 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.
15
+ - 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`.
16
+ - 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,98 +1,92 @@
1
- ## Azure ManagedApplicationClient SDK for JavaScript
1
+ # Azure Application client library for JavaScript
2
2
 
3
- This package contains an isomorphic SDK for ManagedApplicationClient.
3
+ This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Application client.
4
+
5
+ ARM applications
6
+
7
+ [Source code](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/managedapplications/arm-managedapplications) |
8
+ [Package (NPM)](https://www.npmjs.com/package/@azure/arm-managedapplications) |
9
+ [API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-managedapplications) |
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
- - Node.js version 6.x.x or higher
8
- - Browser JavaScript
16
+ - [LTS versions of Node.js](https://nodejs.org/about/releases/)
17
+ - Latest versions of Safari, Chrome, Edge and Firefox.
18
+
19
+ ### Prerequisites
20
+
21
+ - An [Azure subscription][azure_sub].
9
22
 
10
- ### How to Install
23
+ ### Install the `@azure/arm-managedapplications` package
24
+
25
+ Install the Azure Application client library for JavaScript with `npm`:
11
26
 
12
27
  ```bash
13
28
  npm install @azure/arm-managedapplications
14
29
  ```
15
30
 
16
- ### How to use
31
+ ### Create and authenticate a `ApplicationClient`
32
+
33
+ To create a client object to access the Azure Application API, you will need the `endpoint` of your Azure Application resource and a `credential`. The Azure Application client can use Azure Active Directory credentials to authenticate.
34
+ You can find the endpoint for your Azure Application resource in the [Azure Portal][azure_portal].
17
35
 
18
- #### nodejs - Authentication, client creation and listOperations as an example written in TypeScript.
36
+ #### Using an Azure Active Directory Credential
19
37
 
20
- ##### Install @azure/ms-rest-nodeauth
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:
21
39
 
22
40
  ```bash
23
- npm install @azure/ms-rest-nodeauth
41
+ npm install @azure/identity
24
42
  ```
25
43
 
26
- ##### Sample code
27
-
28
- ```typescript
29
- import * as msRest from "@azure/ms-rest-js";
30
- import * as msRestAzure from "@azure/ms-rest-azure-js";
31
- import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
32
- import { ManagedApplicationClient, ManagedApplicationModels, ManagedApplicationMappers } from "@azure/arm-managedapplications";
33
- const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
34
-
35
- msRestNodeAuth.interactiveLogin().then((creds) => {
36
- const client = new ManagedApplicationClient(creds, subscriptionId);
37
- client.listOperations().then((result) => {
38
- console.log("The result is:");
39
- console.log(result);
40
- });
41
- }).catch((err) => {
42
- console.error(err);
43
- });
44
+ You will also need to register a new AAD application and grant access to Azure Application 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`.
46
+
47
+ ```javascript
48
+ const { ApplicationClient } = require("@azure/arm-managedapplications");
49
+ const { DefaultAzureCredential } = require("@azure/identity");
50
+ const subscriptionId = "00000000-0000-0000-0000-000000000000";
51
+ const client = new ApplicationClient(new DefaultAzureCredential(), subscriptionId);
44
52
  ```
45
53
 
46
- #### browser - Authentication, client creation and listOperations as an example written in JavaScript.
54
+ ## Key concepts
47
55
 
48
- ##### Install @azure/ms-rest-browserauth
56
+ ### ApplicationClient
49
57
 
50
- ```bash
51
- npm install @azure/ms-rest-browserauth
52
- ```
58
+ `ApplicationClient` is the primary interface for developers using the Azure Application client library. Explore the methods on this client object to understand the different features of the Azure Application service that you can access.
53
59
 
54
- ##### Sample code
55
-
56
- See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser.
57
-
58
- - index.html
59
- ```html
60
- <!DOCTYPE html>
61
- <html lang="en">
62
- <head>
63
- <title>@azure/arm-managedapplications sample</title>
64
- <script src="node_modules/@azure/ms-rest-js/dist/msRest.browser.js"></script>
65
- <script src="node_modules/@azure/ms-rest-azure-js/dist/msRestAzure.js"></script>
66
- <script src="node_modules/@azure/ms-rest-browserauth/dist/msAuth.js"></script>
67
- <script src="node_modules/@azure/arm-managedapplications/dist/arm-managedapplications.js"></script>
68
- <script type="text/javascript">
69
- const subscriptionId = "<Subscription_Id>";
70
- const authManager = new msAuth.AuthManager({
71
- clientId: "<client id for your Azure AD app>",
72
- tenant: "<optional tenant for your organization>"
73
- });
74
- authManager.finalizeLogin().then((res) => {
75
- if (!res.isLoggedIn) {
76
- // may cause redirects
77
- authManager.login();
78
- }
79
- const client = new Azure.ArmManagedapplications.ManagedApplicationClient(res.creds, subscriptionId);
80
- client.listOperations().then((result) => {
81
- console.log("The result is:");
82
- console.log(result);
83
- }).catch((err) => {
84
- console.log("An error occurred:");
85
- console.error(err);
86
- });
87
- });
88
- </script>
89
- </head>
90
- <body></body>
91
- </html>
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");
92
69
  ```
93
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
+
94
81
  ## Related projects
95
82
 
96
- - [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%2Fmanagedapplications%2Farm-managedapplications%2FREADME.png)
97
86
 
98
- ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/managedapplications/arm-managedapplications/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