@azure/arm-features 3.0.0-beta.1 → 3.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 (94) hide show
  1. package/CHANGELOG.md +6 -11
  2. package/README.md +15 -9
  3. package/dist/index.js +37 -57
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.js +1 -1
  6. package/dist/index.min.js.map +1 -1
  7. package/{esm → dist-esm/src}/featureClient.d.ts +7 -5
  8. package/dist-esm/src/featureClient.d.ts.map +1 -0
  9. package/{esm → dist-esm/src}/featureClient.js +31 -4
  10. package/dist-esm/src/featureClient.js.map +1 -0
  11. package/dist-esm/src/index.d.ts +5 -0
  12. package/dist-esm/src/index.d.ts.map +1 -0
  13. package/{esm → dist-esm/src}/index.js +0 -1
  14. package/dist-esm/src/index.js.map +1 -0
  15. package/{esm → dist-esm/src}/models/index.d.ts +22 -22
  16. package/dist-esm/src/models/index.d.ts.map +1 -0
  17. package/{esm → dist-esm/src}/models/index.js +0 -0
  18. package/dist-esm/src/models/index.js.map +1 -0
  19. package/{esm → dist-esm/src}/models/mappers.d.ts +1 -1
  20. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  21. package/{esm → dist-esm/src}/models/mappers.js +30 -29
  22. package/dist-esm/src/models/mappers.js.map +1 -0
  23. package/{esm → dist-esm/src}/models/parameters.d.ts +0 -0
  24. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  25. package/{esm → dist-esm/src}/models/parameters.js +0 -0
  26. package/dist-esm/src/models/parameters.js.map +1 -0
  27. package/{esm → dist-esm/src}/operations/features.d.ts +3 -4
  28. package/dist-esm/src/operations/features.d.ts.map +1 -0
  29. package/{esm → dist-esm/src}/operations/features.js +1 -2
  30. package/dist-esm/src/operations/features.js.map +1 -0
  31. package/{esm → dist-esm/src}/operations/index.d.ts +0 -0
  32. package/dist-esm/src/operations/index.d.ts.map +1 -0
  33. package/{esm → dist-esm/src}/operations/index.js +0 -0
  34. package/dist-esm/src/operations/index.js.map +1 -0
  35. package/{esm → dist-esm/src}/operations/subscriptionFeatureRegistrations.d.ts +3 -4
  36. package/dist-esm/src/operations/subscriptionFeatureRegistrations.d.ts.map +1 -0
  37. package/{esm → dist-esm/src}/operations/subscriptionFeatureRegistrations.js +1 -2
  38. package/dist-esm/src/operations/subscriptionFeatureRegistrations.js.map +1 -0
  39. package/{esm → dist-esm/src}/operationsInterfaces/features.d.ts +0 -1
  40. package/dist-esm/src/operationsInterfaces/features.d.ts.map +1 -0
  41. package/{esm → dist-esm/src}/operationsInterfaces/features.js +1 -1
  42. package/dist-esm/src/operationsInterfaces/features.js.map +1 -0
  43. package/{esm → dist-esm/src}/operationsInterfaces/index.d.ts +0 -0
  44. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  45. package/{esm → dist-esm/src}/operationsInterfaces/index.js +0 -0
  46. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  47. package/{esm → dist-esm/src}/operationsInterfaces/subscriptionFeatureRegistrations.d.ts +0 -1
  48. package/dist-esm/src/operationsInterfaces/subscriptionFeatureRegistrations.d.ts.map +1 -0
  49. package/{esm → dist-esm/src}/operationsInterfaces/subscriptionFeatureRegistrations.js +1 -1
  50. package/dist-esm/src/operationsInterfaces/subscriptionFeatureRegistrations.js.map +1 -0
  51. package/dist-esm/test/sampleTest.d.ts +4 -0
  52. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  53. package/dist-esm/test/sampleTest.js +113 -0
  54. package/dist-esm/test/sampleTest.js.map +1 -0
  55. package/package.json +26 -32
  56. package/review/arm-features.api.md +20 -26
  57. package/src/featureClient.ts +56 -15
  58. package/src/index.ts +0 -1
  59. package/src/models/index.ts +23 -23
  60. package/src/models/mappers.ts +31 -30
  61. package/src/operations/features.ts +4 -5
  62. package/src/operations/subscriptionFeatureRegistrations.ts +4 -5
  63. package/src/operationsInterfaces/features.ts +0 -1
  64. package/src/operationsInterfaces/subscriptionFeatureRegistrations.ts +0 -1
  65. package/tsconfig.json +2 -2
  66. package/{esm/index.d.ts → types/arm-features.d.ts} +19 -29
  67. package/types/tsdoc-metadata.json +11 -0
  68. package/esm/featureClient.d.ts.map +0 -1
  69. package/esm/featureClient.js.map +0 -1
  70. package/esm/featureClientContext.d.ts +0 -16
  71. package/esm/featureClientContext.d.ts.map +0 -1
  72. package/esm/featureClientContext.js +0 -49
  73. package/esm/featureClientContext.js.map +0 -1
  74. package/esm/index.d.ts.map +0 -1
  75. package/esm/index.js.map +0 -1
  76. package/esm/models/index.d.ts.map +0 -1
  77. package/esm/models/index.js.map +0 -1
  78. package/esm/models/mappers.d.ts.map +0 -1
  79. package/esm/models/mappers.js.map +0 -1
  80. package/esm/models/parameters.d.ts.map +0 -1
  81. package/esm/models/parameters.js.map +0 -1
  82. package/esm/operations/features.d.ts.map +0 -1
  83. package/esm/operations/features.js.map +0 -1
  84. package/esm/operations/index.d.ts.map +0 -1
  85. package/esm/operations/index.js.map +0 -1
  86. package/esm/operations/subscriptionFeatureRegistrations.d.ts.map +0 -1
  87. package/esm/operations/subscriptionFeatureRegistrations.js.map +0 -1
  88. package/esm/operationsInterfaces/features.d.ts.map +0 -1
  89. package/esm/operationsInterfaces/features.js.map +0 -1
  90. package/esm/operationsInterfaces/index.d.ts.map +0 -1
  91. package/esm/operationsInterfaces/index.js.map +0 -1
  92. package/esm/operationsInterfaces/subscriptionFeatureRegistrations.d.ts.map +0 -1
  93. package/esm/operationsInterfaces/subscriptionFeatureRegistrations.js.map +0 -1
  94. package/src/featureClientContext.ts +0 -70
package/CHANGELOG.md CHANGED
@@ -1,16 +1,11 @@
1
1
  # Release History
2
+
3
+ ## 3.0.0 (2021-12-07)
2
4
 
3
- ## 3.0.0-beta.1 (2021-10-09)
5
+ The package of @azure/arm-features is using our next generation design principles since version 3.0.0, which contains breaking changes.
4
6
 
5
- This is the first preview for the new version of the `@azure/arm-features` package that follows the new [guidelines for TypeScript SDKs](https://azure.github.io/azure-sdk/typescript_introduction.html) for Azure services.
7
+ To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog).
6
8
 
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/).
9
+ To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide).
8
10
 
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.
11
+ To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart).
package/README.md CHANGED
@@ -4,7 +4,7 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) f
4
4
 
5
5
  Azure Feature Exposure Control (AFEC) provides a mechanism for the resource providers to control feature exposure to users. Resource providers typically use this mechanism to provide public/private preview for new features prior to making them generally available. Users need to explicitly register for AFEC features to get access to such functionality.
6
6
 
7
- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/features/arm-features) |
7
+ [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/features/arm-features) |
8
8
  [Package (NPM)](https://www.npmjs.com/package/@azure/arm-features) |
9
9
  [API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-features) |
10
10
  [Samples](https://github.com/Azure-Samples/azure-samples-js-management)
@@ -33,17 +33,19 @@ npm install @azure/arm-features
33
33
  To create a client object to access the Azure Feature API, you will need the `endpoint` of your Azure Feature resource and a `credential`. The Azure Feature client can use Azure Active Directory credentials to authenticate.
34
34
  You can find the endpoint for your Azure Feature resource in the [Azure Portal][azure_portal].
35
35
 
36
- #### Using an Azure Active Directory Credential
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).
37
37
 
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:
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
39
 
40
40
  ```bash
41
41
  npm install @azure/identity
42
42
  ```
43
43
 
44
- You will also need to register a new AAD application and grant access to Azure Feature by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
44
+ You will also need to **register a new AAD application and grant access to Azure Feature** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
45
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
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).
48
+
47
49
  ```javascript
48
50
  const { FeatureClient } = require("@azure/arm-features");
49
51
  const { DefaultAzureCredential } = require("@azure/identity");
@@ -51,6 +53,10 @@ const subscriptionId = "00000000-0000-0000-0000-000000000000";
51
53
  const client = new FeatureClient(new DefaultAzureCredential(), subscriptionId);
52
54
  ```
53
55
 
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
+
54
60
  ## Key concepts
55
61
 
56
62
  ### FeatureClient
@@ -64,11 +70,11 @@ const client = new FeatureClient(new DefaultAzureCredential(), subscriptionId);
64
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`:
65
71
 
66
72
  ```javascript
67
- import { setLogLevel } from "@azure/logger";
73
+ const { setLogLevel } = require("@azure/logger");
68
74
  setLogLevel("info");
69
75
  ```
70
76
 
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).
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).
72
78
 
73
79
  ## Next steps
74
80
 
@@ -76,7 +82,7 @@ Please take a look at the [samples](https://github.com/Azure-Samples/azure-sampl
76
82
 
77
83
  ## Contributing
78
84
 
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.
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.
80
86
 
81
87
  ## Related projects
82
88
 
@@ -88,5 +94,5 @@ If you'd like to contribute to this library, please read the [contributing guide
88
94
  [azure_sub]: https://azure.microsoft.com/free/
89
95
  [azure_sub]: https://azure.microsoft.com/free/
90
96
  [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
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
package/dist/index.js CHANGED
@@ -4,7 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var tslib = require('tslib');
6
6
  var coreClient = require('@azure/core-client');
7
- require('@azure/core-paging');
8
7
 
9
8
  /*
10
9
  * Copyright (c) Microsoft Corporation.
@@ -230,35 +229,6 @@ const FeatureProperties = {
230
229
  }
231
230
  }
232
231
  };
233
- const ProxyResource = {
234
- type: {
235
- name: "Composite",
236
- className: "ProxyResource",
237
- modelProperties: {
238
- id: {
239
- serializedName: "id",
240
- readOnly: true,
241
- type: {
242
- name: "String"
243
- }
244
- },
245
- name: {
246
- serializedName: "name",
247
- readOnly: true,
248
- type: {
249
- name: "String"
250
- }
251
- },
252
- type: {
253
- serializedName: "type",
254
- readOnly: true,
255
- type: {
256
- name: "String"
257
- }
258
- }
259
- }
260
- }
261
- };
262
232
  const SubscriptionFeatureRegistrationProperties = {
263
233
  type: {
264
234
  name: "Composite",
@@ -351,6 +321,7 @@ const SubscriptionFeatureRegistrationProperties = {
351
321
  }
352
322
  },
353
323
  shouldFeatureDisplayInPortal: {
324
+ defaultValue: false,
354
325
  serializedName: "shouldFeatureDisplayInPortal",
355
326
  type: {
356
327
  name: "Boolean"
@@ -411,6 +382,35 @@ const AuthorizationProfile = {
411
382
  }
412
383
  }
413
384
  };
385
+ const ProxyResource = {
386
+ type: {
387
+ name: "Composite",
388
+ className: "ProxyResource",
389
+ modelProperties: {
390
+ id: {
391
+ serializedName: "id",
392
+ readOnly: true,
393
+ type: {
394
+ name: "String"
395
+ }
396
+ },
397
+ name: {
398
+ serializedName: "name",
399
+ readOnly: true,
400
+ type: {
401
+ name: "String"
402
+ }
403
+ },
404
+ type: {
405
+ serializedName: "type",
406
+ readOnly: true,
407
+ type: {
408
+ name: "String"
409
+ }
410
+ }
411
+ }
412
+ }
413
+ };
414
414
  const SubscriptionFeatureRegistrationList = {
415
415
  type: {
416
416
  name: "Composite",
@@ -461,9 +461,9 @@ var Mappers = /*#__PURE__*/Object.freeze({
461
461
  FeatureOperationsListResult: FeatureOperationsListResult,
462
462
  FeatureResult: FeatureResult,
463
463
  FeatureProperties: FeatureProperties,
464
- ProxyResource: ProxyResource,
465
464
  SubscriptionFeatureRegistrationProperties: SubscriptionFeatureRegistrationProperties,
466
465
  AuthorizationProfile: AuthorizationProfile,
466
+ ProxyResource: ProxyResource,
467
467
  SubscriptionFeatureRegistrationList: SubscriptionFeatureRegistrationList,
468
468
  SubscriptionFeatureRegistration: SubscriptionFeatureRegistration
469
469
  });
@@ -594,7 +594,7 @@ const subscriptionFeatureRegistrationType = {
594
594
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
595
595
  */
596
596
  /// <reference lib="esnext.asynciterable" />
597
- /** Class representing a Features. */
597
+ /** Class containing Features operations. */
598
598
  class FeaturesImpl {
599
599
  /**
600
600
  * Initialize a new instance of the class Features class.
@@ -913,7 +913,7 @@ const listNextOperationSpec = {
913
913
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
914
914
  */
915
915
  /// <reference lib="esnext.asynciterable" />
916
- /** Class representing a SubscriptionFeatureRegistrations. */
916
+ /** Class containing SubscriptionFeatureRegistrations operations. */
917
917
  class SubscriptionFeatureRegistrationsImpl {
918
918
  /**
919
919
  * Initialize a new instance of the class SubscriptionFeatureRegistrations class.
@@ -1230,9 +1230,10 @@ const listAllBySubscriptionNextOperationSpec = {
1230
1230
  * Code generated by Microsoft (R) AutoRest Code Generator.
1231
1231
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1232
1232
  */
1233
- class FeatureClientContext extends coreClient.ServiceClient {
1233
+ /// <reference lib="esnext.asynciterable" />
1234
+ class FeatureClient extends coreClient.ServiceClient {
1234
1235
  /**
1235
- * Initializes a new instance of the FeatureClientContext class.
1236
+ * Initializes a new instance of the FeatureClient class.
1236
1237
  * @param credentials Subscription credentials which uniquely identify client subscription.
1237
1238
  * @param subscriptionId The Azure subscription ID.
1238
1239
  * @param options The parameter options
@@ -1252,7 +1253,7 @@ class FeatureClientContext extends coreClient.ServiceClient {
1252
1253
  requestContentType: "application/json; charset=utf-8",
1253
1254
  credential: credentials
1254
1255
  };
1255
- const packageDetails = `azsdk-js-arm-features/3.0.0-beta.1`;
1256
+ const packageDetails = `azsdk-js-arm-features/3.0.0`;
1256
1257
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
1257
1258
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
1258
1259
  : `${packageDetails}`;
@@ -1268,26 +1269,6 @@ class FeatureClientContext extends coreClient.ServiceClient {
1268
1269
  // Assigning values to Constant parameters
1269
1270
  this.$host = options.$host || "https://management.azure.com";
1270
1271
  this.apiVersion = options.apiVersion || "2021-07-01";
1271
- }
1272
- }
1273
-
1274
- /*
1275
- * Copyright (c) Microsoft Corporation.
1276
- * Licensed under the MIT License.
1277
- *
1278
- * Code generated by Microsoft (R) AutoRest Code Generator.
1279
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1280
- */
1281
- /// <reference lib="esnext.asynciterable" />
1282
- class FeatureClient extends FeatureClientContext {
1283
- /**
1284
- * Initializes a new instance of the FeatureClient class.
1285
- * @param credentials Subscription credentials which uniquely identify client subscription.
1286
- * @param subscriptionId The Azure subscription ID.
1287
- * @param options The parameter options
1288
- */
1289
- constructor(credentials, subscriptionId, options) {
1290
- super(credentials, subscriptionId, options);
1291
1272
  this.features = new FeaturesImpl(this);
1292
1273
  this.subscriptionFeatureRegistrations = new SubscriptionFeatureRegistrationsImpl(this);
1293
1274
  }
@@ -1391,5 +1372,4 @@ const listOperationsNextOperationSpec = {
1391
1372
  };
1392
1373
 
1393
1374
  exports.FeatureClient = FeatureClient;
1394
- exports.FeatureClientContext = FeatureClientContext;
1395
1375
  //# sourceMappingURL=index.js.map