@azure/synapse-monitoring 1.0.0-alpha.20221201.1 → 1.0.0-alpha.20230106.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.
package/dist/index.js CHANGED
@@ -2159,7 +2159,7 @@ function setPlatformSpecificData(map) {
2159
2159
 
2160
2160
  // Copyright (c) Microsoft Corporation.
2161
2161
  // Licensed under the MIT license.
2162
- const SDK_VERSION = "1.10.1";
2162
+ const SDK_VERSION = "1.10.2";
2163
2163
  const DEFAULT_RETRY_POLICY_COUNT = 3;
2164
2164
 
2165
2165
  // Copyright (c) Microsoft Corporation.
@@ -17382,7 +17382,9 @@ class NodeHttpClient {
17382
17382
  // Responses to HEAD must not have a body.
17383
17383
  // If they do return a body, that body must be ignored.
17384
17384
  if (request.method === "HEAD") {
17385
- res.destroy();
17385
+ // call resume() and not destroy() to avoid closing the socket
17386
+ // and losing keep alive
17387
+ res.resume();
17386
17388
  return response;
17387
17389
  }
17388
17390
  responseStream = shouldDecompress ? getDecodedResponseStream(res, headers) : res;
@@ -18463,7 +18465,14 @@ function getPropertyFromParameterPath(parent, parameterPath) {
18463
18465
  return result;
18464
18466
  }
18465
18467
  const operationRequestMap = new WeakMap();
18468
+ const originalRequestSymbol = Symbol.for("@azure/core-client original request");
18469
+ function hasOriginalRequest(request) {
18470
+ return originalRequestSymbol in request;
18471
+ }
18466
18472
  function getOperationRequestInfo(request) {
18473
+ if (hasOriginalRequest(request)) {
18474
+ return getOperationRequestInfo(request[originalRequestSymbol]);
18475
+ }
18467
18476
  let info = operationRequestMap.get(request);
18468
18477
  if (!info) {
18469
18478
  info = {};
@@ -18545,7 +18554,7 @@ async function deserializeResponseBody(jsonContentTypes, xmlContentTypes, respon
18545
18554
  return parsedResponse;
18546
18555
  }
18547
18556
  const responseSpec = getOperationResponseMap(parsedResponse);
18548
- const { error, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec);
18557
+ const { error, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec, options);
18549
18558
  if (error) {
18550
18559
  throw error;
18551
18560
  }
@@ -18564,7 +18573,7 @@ async function deserializeResponseBody(jsonContentTypes, xmlContentTypes, respon
18564
18573
  : [];
18565
18574
  }
18566
18575
  try {
18567
- parsedResponse.parsedBody = operationSpec.serializer.deserialize(responseSpec.bodyMapper, valueToDeserialize, "operationRes.parsedBody");
18576
+ parsedResponse.parsedBody = operationSpec.serializer.deserialize(responseSpec.bodyMapper, valueToDeserialize, "operationRes.parsedBody", options);
18568
18577
  }
18569
18578
  catch (deserializeError) {
18570
18579
  const restError = new RestError(`Error ${deserializeError} occurred in deserializing the responseBody - ${parsedResponse.bodyAsText}`, {
@@ -18590,7 +18599,7 @@ function isOperationSpecEmpty(operationSpec) {
18590
18599
  return (expectedStatusCodes.length === 0 ||
18591
18600
  (expectedStatusCodes.length === 1 && expectedStatusCodes[0] === "default"));
18592
18601
  }
18593
- function handleErrorResponse(parsedResponse, operationSpec, responseSpec) {
18602
+ function handleErrorResponse(parsedResponse, operationSpec, responseSpec, options) {
18594
18603
  var _a;
18595
18604
  const isSuccessByStatus = 200 <= parsedResponse.status && parsedResponse.status < 300;
18596
18605
  const isExpectedStatusCode = isOperationSpecEmpty(operationSpec)
@@ -18637,7 +18646,7 @@ function handleErrorResponse(parsedResponse, operationSpec, responseSpec) {
18637
18646
  valueToDeserialize = parsedBody[elementName];
18638
18647
  }
18639
18648
  }
18640
- deserializedError = operationSpec.serializer.deserialize(defaultBodyMapper, valueToDeserialize, "error.response.parsedBody");
18649
+ deserializedError = operationSpec.serializer.deserialize(defaultBodyMapper, valueToDeserialize, "error.response.parsedBody", options);
18641
18650
  }
18642
18651
  const internalError = parsedBody.error || deserializedError || parsedBody;
18643
18652
  error.code = internalError.code;