@azure/arm-kusto 7.1.1 → 7.1.2

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Release History
2
-
2
+
3
+ ## 7.1.2 (2022-06-17)
4
+
5
+ **Features**
6
+
7
+ - Bug fix
8
+
3
9
  ## 7.1.1 (2022-04-24)
4
10
 
5
11
  **Features**
package/dist/index.js CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var tslib = require('tslib');
5
6
  var coreClient = require('@azure/core-client');
6
7
  var coreRestPipeline = require('@azure/core-rest-pipeline');
7
- var tslib = require('tslib');
8
8
  var coreLro = require('@azure/core-lro');
9
9
 
10
10
  function _interopNamespace(e) {
@@ -8555,7 +8555,7 @@ class KustoManagementClient extends coreClient__namespace.ServiceClient {
8555
8555
  requestContentType: "application/json; charset=utf-8",
8556
8556
  credential: credentials
8557
8557
  };
8558
- const packageDetails = `azsdk-js-arm-kusto/7.1.1`;
8558
+ const packageDetails = `azsdk-js-arm-kusto/7.1.2`;
8559
8559
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
8560
8560
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
8561
8561
  : `${packageDetails}`;
@@ -8600,6 +8600,34 @@ class KustoManagementClient extends coreClient__namespace.ServiceClient {
8600
8600
  this.operations = new OperationsImpl(this);
8601
8601
  this.operationsResults = new OperationsResultsImpl(this);
8602
8602
  this.operationsResultsLocation = new OperationsResultsLocationImpl(this);
8603
+ this.addCustomApiVersionPolicy(options.apiVersion);
8604
+ }
8605
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
8606
+ addCustomApiVersionPolicy(apiVersion) {
8607
+ if (!apiVersion) {
8608
+ return;
8609
+ }
8610
+ const apiVersionPolicy = {
8611
+ name: "CustomApiVersionPolicy",
8612
+ sendRequest(request, next) {
8613
+ return tslib.__awaiter(this, void 0, void 0, function* () {
8614
+ const param = request.url.split("?");
8615
+ if (param.length > 1) {
8616
+ const newParams = param[1].split("&").map((item) => {
8617
+ if (item.indexOf("api-version") > -1) {
8618
+ return item.replace(/(?<==).*$/, apiVersion);
8619
+ }
8620
+ else {
8621
+ return item;
8622
+ }
8623
+ });
8624
+ request.url = param[0] + "?" + newParams.join("&");
8625
+ }
8626
+ return next(request);
8627
+ });
8628
+ }
8629
+ };
8630
+ this.pipeline.addPolicy(apiVersionPolicy);
8603
8631
  }
8604
8632
  }
8605
8633