@azure/arm-templatespecs 1.0.0 → 2.0.0

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 (115) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/{LICENSE.txt → LICENSE} +1 -1
  3. package/README.md +70 -84
  4. package/dist/index.js +1285 -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/dist-esm/src/index.d.ts +5 -0
  9. package/dist-esm/src/index.d.ts.map +1 -0
  10. package/dist-esm/src/index.js +12 -0
  11. package/dist-esm/src/index.js.map +1 -0
  12. package/dist-esm/src/models/index.d.ts +306 -0
  13. package/dist-esm/src/models/index.d.ts.map +1 -0
  14. package/dist-esm/src/models/index.js +22 -0
  15. package/dist-esm/src/models/index.js.map +1 -0
  16. package/dist-esm/src/models/mappers.d.ts +15 -0
  17. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  18. package/{esm → dist-esm/src}/models/mappers.js +196 -227
  19. package/dist-esm/src/models/mappers.js.map +1 -0
  20. package/dist-esm/src/models/parameters.d.ts +16 -0
  21. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  22. package/dist-esm/src/models/parameters.js +144 -0
  23. package/dist-esm/src/models/parameters.js.map +1 -0
  24. package/{esm → dist-esm/src}/operations/index.d.ts +0 -0
  25. package/dist-esm/src/operations/index.d.ts.map +1 -0
  26. package/{esm → dist-esm/src}/operations/index.js +1 -2
  27. package/dist-esm/src/operations/index.js.map +1 -0
  28. package/dist-esm/src/operations/templateSpecVersions.d.ts +72 -0
  29. package/dist-esm/src/operations/templateSpecVersions.d.ts.map +1 -0
  30. package/dist-esm/src/operations/templateSpecVersions.js +279 -0
  31. package/dist-esm/src/operations/templateSpecVersions.js.map +1 -0
  32. package/dist-esm/src/operations/templateSpecs.d.ts +82 -0
  33. package/dist-esm/src/operations/templateSpecs.d.ts.map +1 -0
  34. package/dist-esm/src/operations/templateSpecs.js +358 -0
  35. package/dist-esm/src/operations/templateSpecs.js.map +1 -0
  36. package/dist-esm/src/operationsInterfaces/index.d.ts +3 -0
  37. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  38. package/dist-esm/src/operationsInterfaces/index.js +10 -0
  39. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  40. package/dist-esm/src/operationsInterfaces/templateSpecVersions.d.ts +47 -0
  41. package/dist-esm/src/operationsInterfaces/templateSpecVersions.d.ts.map +1 -0
  42. package/dist-esm/src/operationsInterfaces/templateSpecVersions.js +9 -0
  43. package/dist-esm/src/operationsInterfaces/templateSpecVersions.js.map +1 -0
  44. package/dist-esm/src/operationsInterfaces/templateSpecs.d.ts +46 -0
  45. package/dist-esm/src/operationsInterfaces/templateSpecs.d.ts.map +1 -0
  46. package/{esm/models/index.js → dist-esm/src/operationsInterfaces/templateSpecs.js} +2 -1
  47. package/dist-esm/src/operationsInterfaces/templateSpecs.js.map +1 -0
  48. package/dist-esm/src/templateSpecsClient.d.ts +19 -0
  49. package/dist-esm/src/templateSpecsClient.d.ts.map +1 -0
  50. package/dist-esm/src/templateSpecsClient.js +52 -0
  51. package/dist-esm/src/templateSpecsClient.js.map +1 -0
  52. package/dist-esm/test/sampleTest.d.ts +2 -0
  53. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  54. package/dist-esm/test/sampleTest.js +40 -0
  55. package/dist-esm/test/sampleTest.js.map +1 -0
  56. package/package.json +63 -32
  57. package/review/arm-templatespecs.api.md +280 -0
  58. package/rollup.config.js +181 -30
  59. package/src/index.ts +12 -0
  60. package/src/models/index.ts +233 -494
  61. package/src/models/mappers.ts +208 -239
  62. package/src/models/parameters.ts +104 -45
  63. package/src/operations/index.ts +1 -2
  64. package/src/operations/templateSpecVersions.ts +222 -254
  65. package/src/operations/templateSpecs.ts +276 -315
  66. package/src/operationsInterfaces/index.ts +10 -0
  67. package/src/operationsInterfaces/templateSpecVersions.ts +91 -0
  68. package/src/operationsInterfaces/templateSpecs.ts +88 -0
  69. package/src/templateSpecsClient.ts +62 -34
  70. package/tsconfig.json +3 -3
  71. package/types/arm-templatespecs.d.ts +457 -0
  72. package/types/tsdoc-metadata.json +11 -0
  73. package/dist/arm-templatespecs.js +0 -1294
  74. package/dist/arm-templatespecs.js.map +0 -1
  75. package/dist/arm-templatespecs.min.js +0 -1
  76. package/dist/arm-templatespecs.min.js.map +0 -1
  77. package/esm/models/index.d.ts +0 -571
  78. package/esm/models/index.d.ts.map +0 -1
  79. package/esm/models/index.js.map +0 -1
  80. package/esm/models/mappers.d.ts +0 -17
  81. package/esm/models/mappers.d.ts.map +0 -1
  82. package/esm/models/mappers.js.map +0 -1
  83. package/esm/models/parameters.d.ts +0 -10
  84. package/esm/models/parameters.d.ts.map +0 -1
  85. package/esm/models/parameters.js +0 -107
  86. package/esm/models/parameters.js.map +0 -1
  87. package/esm/models/templateSpecVersionsMappers.d.ts +0 -2
  88. package/esm/models/templateSpecVersionsMappers.d.ts.map +0 -1
  89. package/esm/models/templateSpecVersionsMappers.js +0 -9
  90. package/esm/models/templateSpecVersionsMappers.js.map +0 -1
  91. package/esm/models/templateSpecsMappers.d.ts +0 -2
  92. package/esm/models/templateSpecsMappers.d.ts.map +0 -1
  93. package/esm/models/templateSpecsMappers.js +0 -9
  94. package/esm/models/templateSpecsMappers.js.map +0 -1
  95. package/esm/operations/index.d.ts.map +0 -1
  96. package/esm/operations/index.js.map +0 -1
  97. package/esm/operations/templateSpecVersions.d.ts +0 -152
  98. package/esm/operations/templateSpecVersions.d.ts.map +0 -1
  99. package/esm/operations/templateSpecVersions.js +0 -233
  100. package/esm/operations/templateSpecVersions.js.map +0 -1
  101. package/esm/operations/templateSpecs.d.ts +0 -170
  102. package/esm/operations/templateSpecs.d.ts.map +0 -1
  103. package/esm/operations/templateSpecs.js +0 -284
  104. package/esm/operations/templateSpecs.js.map +0 -1
  105. package/esm/templateSpecsClient.d.ts +0 -25
  106. package/esm/templateSpecsClient.d.ts.map +0 -1
  107. package/esm/templateSpecsClient.js +0 -38
  108. package/esm/templateSpecsClient.js.map +0 -1
  109. package/esm/templateSpecsClientContext.d.ts +0 -22
  110. package/esm/templateSpecsClientContext.d.ts.map +0 -1
  111. package/esm/templateSpecsClientContext.js +0 -60
  112. package/esm/templateSpecsClientContext.js.map +0 -1
  113. package/src/models/templateSpecVersionsMappers.ts +0 -23
  114. package/src/models/templateSpecsMappers.ts +0 -23
  115. package/src/templateSpecsClientContext.ts +0 -67
package/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ # Release History
2
+
3
+ ## 2.0.0 (2021-12-16)
4
+
5
+ - Initial Release
@@ -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,6 +1,15 @@
1
- ## Azure TemplateSpecsClient SDK for JavaScript
1
+ # Azure TemplateSpecs client library for JavaScript
2
2
 
3
- This package contains an isomorphic SDK (runs both in node.js and in browsers) for TemplateSpecsClient.
3
+ This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure TemplateSpecs client.
4
+
5
+ The APIs listed in this specification can be used to manage Template Spec resources through the Azure Resource Manager.
6
+
7
+ [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/templatespecs/arm-templatespecs) |
8
+ [Package (NPM)](https://www.npmjs.com/package/@azure/arm-templatespecs) |
9
+ [API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-templatespecs) |
10
+ [Samples](https://github.com/Azure-Samples/azure-samples-js-management)
11
+
12
+ ## Getting started
4
13
 
5
14
  ### Currently supported environments
6
15
 
@@ -9,104 +18,81 @@ This package contains an isomorphic SDK (runs both in node.js and in browsers) f
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-templatespecs` package
15
24
 
16
- To use this SDK in your project, you will need to install two packages.
17
- - `@azure/arm-templatespecs` 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 TemplateSpecs 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-templatespecs @azure/identity
28
+ npm install @azure/arm-templatespecs
23
29
  ```
24
- > **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.
25
- 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.
26
30
 
27
- ### How to use
31
+ ### Create and authenticate a `TemplateSpecsClient`
32
+
33
+ To create a client object to access the Azure TemplateSpecs API, you will need the `endpoint` of your Azure TemplateSpecs resource and a `credential`. The Azure TemplateSpecs client can use Azure Active Directory credentials to authenticate.
34
+ You can find the endpoint for your Azure TemplateSpecs resource in the [Azure Portal][azure_portal].
28
35
 
29
- - If you are writing a client side browser application,
30
- - 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.
31
- - 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.
32
- - If you are writing a server side application,
33
- - [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples)
34
- - Complete the set up steps required by the credential if any.
35
- - Use the credential you picked in the place of `DefaultAzureCredential` in the Node.js sample below.
36
+ 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).
36
37
 
37
- In the below samples, we pass the credential and the Azure subscription id to instantiate the client.
38
- 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.
39
- #### nodejs - Authentication, client creation, and get templateSpecs as an example written in JavaScript.
38
+ To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package:
39
+
40
+ ```bash
41
+ npm install @azure/identity
42
+ ```
40
43
 
41
- ##### Sample code
44
+ You will also need to **register a new AAD application and grant access to Azure TemplateSpecs** 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
+ 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).
42
48
 
43
49
  ```javascript
44
- const { DefaultAzureCredential } = require("@azure/identity");
45
50
  const { TemplateSpecsClient } = require("@azure/arm-templatespecs");
46
- const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
47
-
48
- // Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples
49
- // Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead.
50
- const creds = new DefaultAzureCredential();
51
- const client = new TemplateSpecsClient(creds, subscriptionId);
52
- const resourceGroupName = "testresourceGroupName";
53
- const templateSpecName = "testtemplateSpecName";
54
- const expand = "versions";
55
- client.templateSpecs.get(resourceGroupName, templateSpecName, expand).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
- });
51
+ const { DefaultAzureCredential } = require("@azure/identity");
52
+ const subscriptionId = "00000000-0000-0000-0000-000000000000";
53
+ const client = new TemplateSpecsClient(new DefaultAzureCredential(), subscriptionId);
62
54
  ```
63
55
 
64
- #### browser - Authentication, client creation, and get templateSpecs 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-templatespecs 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-templatespecs/dist/arm-templatespecs.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
- tenant: "<optional tenant for your organization>"
90
- });
91
- const client = new Azure.ArmTemplatespecs.TemplateSpecsClient(creds, subscriptionId);
92
- const resourceGroupName = "testresourceGroupName";
93
- const templateSpecName = "testtemplateSpecName";
94
- const expand = "versions";
95
- client.templateSpecs.get(resourceGroupName, templateSpecName, expand).then((result) => {
96
- console.log("The result is:");
97
- console.log(result);
98
- }).catch((err) => {
99
- console.log("An error occurred:");
100
- console.error(err);
101
- });
102
- </script>
103
- </head>
104
- <body></body>
105
- </html>
56
+
57
+ ### JavaScript Bundle
58
+ To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling).
59
+
60
+ ## Key concepts
61
+
62
+ ### TemplateSpecsClient
63
+
64
+ `TemplateSpecsClient` is the primary interface for developers using the Azure TemplateSpecs client library. Explore the methods on this client object to understand the different features of the Azure TemplateSpecs service that you can access.
65
+
66
+ ## Troubleshooting
67
+
68
+ ### Logging
69
+
70
+ 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`:
71
+
72
+ ```javascript
73
+ const { setLogLevel } = require("@azure/logger");
74
+ setLogLevel("info");
106
75
  ```
107
76
 
77
+ 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/main/sdk/core/logger).
78
+
79
+ ## Next steps
80
+
81
+ 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.
82
+
83
+ ## Contributing
84
+
85
+ If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.
86
+
108
87
  ## Related projects
109
88
 
110
- - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
89
+ - [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js)
90
+
91
+ ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Ftemplatespecs%2Farm-templatespecs%2FREADME.png)
111
92
 
112
- ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/templatespecs/arm-templatespecs/README.png)
93
+ [azure_cli]: https://docs.microsoft.com/cli/azure
94
+ [azure_sub]: https://azure.microsoft.com/free/
95
+ [azure_sub]: https://azure.microsoft.com/free/
96
+ [azure_portal]: https://portal.azure.com
97
+ [azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity
98
+ [defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential