@azure/arm-appconfiguration 3.0.0-beta.2 → 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 (54) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/README.md +1 -1
  3. package/dist/index.js +73 -12
  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/dist-esm/samples-dev/configurationStoresCreateSample.js +3 -3
  8. package/dist-esm/samples-dev/configurationStoresDeleteSample.js +1 -1
  9. package/dist-esm/samples-dev/configurationStoresGetDeletedSample.js +1 -1
  10. package/dist-esm/samples-dev/configurationStoresGetSample.js +1 -1
  11. package/dist-esm/samples-dev/configurationStoresListByResourceGroupSample.js +1 -1
  12. package/dist-esm/samples-dev/configurationStoresListDeletedSample.js +1 -1
  13. package/dist-esm/samples-dev/configurationStoresListKeysSample.js +1 -1
  14. package/dist-esm/samples-dev/configurationStoresListSample.js +1 -1
  15. package/dist-esm/samples-dev/configurationStoresPurgeDeletedSample.js +1 -1
  16. package/dist-esm/samples-dev/configurationStoresRegenerateKeySample.js +1 -1
  17. package/dist-esm/samples-dev/configurationStoresUpdateSample.js +3 -3
  18. package/dist-esm/samples-dev/keyValuesCreateOrUpdateSample.js +1 -1
  19. package/dist-esm/samples-dev/keyValuesDeleteSample.js +1 -1
  20. package/dist-esm/samples-dev/keyValuesGetSample.js +1 -1
  21. package/dist-esm/samples-dev/keyValuesListByConfigurationStoreSample.js +1 -1
  22. package/dist-esm/samples-dev/operationsCheckNameAvailabilitySample.js +2 -2
  23. package/dist-esm/samples-dev/operationsRegionalCheckNameAvailabilitySample.js +2 -2
  24. package/dist-esm/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.js +1 -1
  25. package/dist-esm/samples-dev/privateEndpointConnectionsDeleteSample.js +1 -1
  26. package/dist-esm/samples-dev/privateEndpointConnectionsGetSample.js +1 -1
  27. package/dist-esm/samples-dev/privateEndpointConnectionsListByConfigurationStoreSample.js +1 -1
  28. package/dist-esm/samples-dev/privateLinkResourcesGetSample.js +1 -1
  29. package/dist-esm/samples-dev/privateLinkResourcesListByConfigurationStoreSample.js +1 -1
  30. package/dist-esm/src/appConfigurationManagementClient.d.ts +2 -0
  31. package/dist-esm/src/appConfigurationManagementClient.d.ts.map +1 -1
  32. package/dist-esm/src/appConfigurationManagementClient.js +50 -3
  33. package/dist-esm/src/appConfigurationManagementClient.js.map +1 -1
  34. package/dist-esm/src/models/parameters.js +1 -1
  35. package/dist-esm/src/models/parameters.js.map +1 -1
  36. package/dist-esm/src/operations/configurationStores.d.ts.map +1 -1
  37. package/dist-esm/src/operations/configurationStores.js +12 -4
  38. package/dist-esm/src/operations/configurationStores.js.map +1 -1
  39. package/dist-esm/src/operations/keyValues.d.ts.map +1 -1
  40. package/dist-esm/src/operations/keyValues.js +3 -1
  41. package/dist-esm/src/operations/keyValues.js.map +1 -1
  42. package/dist-esm/src/operations/privateEndpointConnections.d.ts.map +1 -1
  43. package/dist-esm/src/operations/privateEndpointConnections.js +6 -2
  44. package/dist-esm/src/operations/privateEndpointConnections.js.map +1 -1
  45. package/dist-esm/test/sampleTest.js +11 -13
  46. package/dist-esm/test/sampleTest.js.map +1 -1
  47. package/package.json +12 -8
  48. package/src/appConfigurationManagementClient.ts +62 -3
  49. package/src/models/parameters.ts +1 -1
  50. package/src/operations/configurationStores.ts +12 -4
  51. package/src/operations/keyValues.ts +3 -1
  52. package/src/operations/privateEndpointConnections.ts +6 -2
  53. package/types/arm-appconfiguration.d.ts +2 -0
  54. package/types/tsdoc-metadata.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Release History
2
2
 
3
- ## 3.0.0-beta.2 (2022-03-01)
3
+ ## 3.0.0 (2022-06-10)
4
4
 
5
- The package of @azure/arm-appconfiguration is using our next generation design principles since version 3.0.0-beta.2, which contains breaking changes.
5
+ The package of @azure/arm-appconfiguration is using our next generation design principles since version 3.0.0, which contains breaking changes.
6
6
 
7
7
  To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog).
8
8
 
package/README.md CHANGED
@@ -6,7 +6,7 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) f
6
6
 
7
7
  [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appconfiguration/arm-appconfiguration) |
8
8
  [Package (NPM)](https://www.npmjs.com/package/@azure/arm-appconfiguration) |
9
- [API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-appconfiguration?view=azure-node-preview) |
9
+ [API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-appconfiguration) |
10
10
  [Samples](https://github.com/Azure-Samples/azure-samples-js-management)
11
11
 
12
12
  ## Getting started
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
  var coreLro = require('@azure/core-lro');
8
9
 
9
10
  function _interopNamespace(e) {
@@ -25,6 +26,7 @@ function _interopNamespace(e) {
25
26
  }
26
27
 
27
28
  var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
29
+ var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipeline);
28
30
 
29
31
  /*
30
32
  * Copyright (c) Microsoft Corporation.
@@ -1480,7 +1482,7 @@ const subscriptionId = {
1480
1482
  const apiVersion = {
1481
1483
  parameterPath: "apiVersion",
1482
1484
  mapper: {
1483
- defaultValue: "2021-10-01-preview",
1485
+ defaultValue: "2022-05-01",
1484
1486
  isConstant: true,
1485
1487
  serializedName: "api-version",
1486
1488
  type: {
@@ -1910,10 +1912,12 @@ class ConfigurationStoresImpl {
1910
1912
  configStoreCreationParameters,
1911
1913
  options
1912
1914
  }, createOperationSpec);
1913
- return new coreLro.LroEngine(lro, {
1915
+ const poller = new coreLro.LroEngine(lro, {
1914
1916
  resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1915
1917
  intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
1916
1918
  });
1919
+ yield poller.poll();
1920
+ return poller;
1917
1921
  });
1918
1922
  }
1919
1923
  /**
@@ -1960,10 +1964,12 @@ class ConfigurationStoresImpl {
1960
1964
  };
1961
1965
  });
1962
1966
  const lro = new LroImpl(sendOperation, { resourceGroupName, configStoreName, options }, deleteOperationSpec$2);
1963
- return new coreLro.LroEngine(lro, {
1967
+ const poller = new coreLro.LroEngine(lro, {
1964
1968
  resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1965
1969
  intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
1966
1970
  });
1971
+ yield poller.poll();
1972
+ return poller;
1967
1973
  });
1968
1974
  }
1969
1975
  /**
@@ -2015,10 +2021,12 @@ class ConfigurationStoresImpl {
2015
2021
  configStoreUpdateParameters,
2016
2022
  options
2017
2023
  }, updateOperationSpec);
2018
- return new coreLro.LroEngine(lro, {
2024
+ const poller = new coreLro.LroEngine(lro, {
2019
2025
  resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
2020
2026
  intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
2021
2027
  });
2028
+ yield poller.poll();
2029
+ return poller;
2022
2030
  });
2023
2031
  }
2024
2032
  /**
@@ -2100,10 +2108,12 @@ class ConfigurationStoresImpl {
2100
2108
  };
2101
2109
  });
2102
2110
  const lro = new LroImpl(sendOperation, { location, configStoreName, options }, purgeDeletedOperationSpec);
2103
- return new coreLro.LroEngine(lro, {
2111
+ const poller = new coreLro.LroEngine(lro, {
2104
2112
  resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
2105
2113
  intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
2106
2114
  });
2115
+ yield poller.poll();
2116
+ return poller;
2107
2117
  });
2108
2118
  }
2109
2119
  /**
@@ -2792,10 +2802,12 @@ class PrivateEndpointConnectionsImpl {
2792
2802
  privateEndpointConnection,
2793
2803
  options
2794
2804
  }, createOrUpdateOperationSpec$1);
2795
- return new coreLro.LroEngine(lro, {
2805
+ const poller = new coreLro.LroEngine(lro, {
2796
2806
  resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
2797
2807
  intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
2798
2808
  });
2809
+ yield poller.poll();
2810
+ return poller;
2799
2811
  });
2800
2812
  }
2801
2813
  /**
@@ -2850,10 +2862,12 @@ class PrivateEndpointConnectionsImpl {
2850
2862
  privateEndpointConnectionName,
2851
2863
  options
2852
2864
  }, deleteOperationSpec$1);
2853
- return new coreLro.LroEngine(lro, {
2865
+ const poller = new coreLro.LroEngine(lro, {
2854
2866
  resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
2855
2867
  intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
2856
2868
  });
2869
+ yield poller.poll();
2870
+ return poller;
2857
2871
  });
2858
2872
  }
2859
2873
  /**
@@ -3302,10 +3316,12 @@ class KeyValuesImpl {
3302
3316
  };
3303
3317
  });
3304
3318
  const lro = new LroImpl(sendOperation, { resourceGroupName, configStoreName, keyValueName, options }, deleteOperationSpec);
3305
- return new coreLro.LroEngine(lro, {
3319
+ const poller = new coreLro.LroEngine(lro, {
3306
3320
  resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
3307
3321
  intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
3308
3322
  });
3323
+ yield poller.poll();
3324
+ return poller;
3309
3325
  });
3310
3326
  }
3311
3327
  /**
@@ -3464,6 +3480,7 @@ class AppConfigurationManagementClient extends coreClient__namespace.ServiceClie
3464
3480
  * @param options The parameter options
3465
3481
  */
3466
3482
  constructor(credentials, subscriptionId, options) {
3483
+ var _a, _b;
3467
3484
  if (credentials === undefined) {
3468
3485
  throw new Error("'credentials' cannot be null");
3469
3486
  }
@@ -3478,7 +3495,7 @@ class AppConfigurationManagementClient extends coreClient__namespace.ServiceClie
3478
3495
  requestContentType: "application/json; charset=utf-8",
3479
3496
  credential: credentials
3480
3497
  };
3481
- const packageDetails = `azsdk-js-arm-appconfiguration/3.0.0-beta.2`;
3498
+ const packageDetails = `azsdk-js-arm-appconfiguration/3.0.0`;
3482
3499
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
3483
3500
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
3484
3501
  : `${packageDetails}`;
@@ -3487,18 +3504,62 @@ class AppConfigurationManagementClient extends coreClient__namespace.ServiceClie
3487
3504
  }
3488
3505
  const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
3489
3506
  userAgentPrefix
3490
- }, baseUri: options.endpoint || "https://management.azure.com" });
3507
+ }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
3491
3508
  super(optionsWithDefaults);
3509
+ if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
3510
+ const pipelinePolicies = options.pipeline.getOrderedPolicies();
3511
+ const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
3512
+ coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
3513
+ if (!bearerTokenAuthenticationPolicyFound) {
3514
+ this.pipeline.removePolicy({
3515
+ name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
3516
+ });
3517
+ this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
3518
+ scopes: `${optionsWithDefaults.baseUri}/.default`,
3519
+ challengeCallbacks: {
3520
+ authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
3521
+ }
3522
+ }));
3523
+ }
3524
+ }
3492
3525
  // Parameter assignments
3493
3526
  this.subscriptionId = subscriptionId;
3494
3527
  // Assigning values to Constant parameters
3495
3528
  this.$host = options.$host || "https://management.azure.com";
3496
- this.apiVersion = options.apiVersion || "2021-10-01-preview";
3529
+ this.apiVersion = options.apiVersion || "2022-05-01";
3497
3530
  this.configurationStores = new ConfigurationStoresImpl(this);
3498
3531
  this.operations = new OperationsImpl(this);
3499
3532
  this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this);
3500
3533
  this.privateLinkResources = new PrivateLinkResourcesImpl(this);
3501
3534
  this.keyValues = new KeyValuesImpl(this);
3535
+ this.addCustomApiVersionPolicy(options.apiVersion);
3536
+ }
3537
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
3538
+ addCustomApiVersionPolicy(apiVersion) {
3539
+ if (!apiVersion) {
3540
+ return;
3541
+ }
3542
+ const apiVersionPolicy = {
3543
+ name: "CustomApiVersionPolicy",
3544
+ sendRequest(request, next) {
3545
+ return tslib.__awaiter(this, void 0, void 0, function* () {
3546
+ const param = request.url.split("?");
3547
+ if (param.length > 1) {
3548
+ const newParams = param[1].split("&").map((item) => {
3549
+ if (item.indexOf("api-version") > -1) {
3550
+ return item.replace(/(?<==).*$/, apiVersion);
3551
+ }
3552
+ else {
3553
+ return item;
3554
+ }
3555
+ });
3556
+ request.url = param[0] + "?" + newParams.join("&");
3557
+ }
3558
+ return next(request);
3559
+ });
3560
+ }
3561
+ };
3562
+ this.pipeline.addPolicy(apiVersionPolicy);
3502
3563
  }
3503
3564
  }
3504
3565