@azure/synapse-monitoring 1.0.0-alpha.20221124.1 → 1.0.0-alpha.20221201.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
@@ -585,8 +585,9 @@ function serializeBasicTypes(typeName, objectName, value) {
585
585
  !(value instanceof ArrayBuffer) &&
586
586
  !ArrayBuffer.isView(value) &&
587
587
  // File objects count as a type of Blob, so we want to use instanceof explicitly
588
- !((typeof Blob === "function" || typeof Blob === "object") && value instanceof Blob)) {
589
- throw new Error(`${objectName} must be a string, Blob, ArrayBuffer, ArrayBufferView, or NodeJS.ReadableStream.`);
588
+ !((typeof Blob === "function" || typeof Blob === "object") && value instanceof Blob) &&
589
+ objectType !== "function") {
590
+ throw new Error(`${objectName} must be a string, Blob, ArrayBuffer, ArrayBufferView, NodeJS.ReadableStream, or () => NodeJS.ReadableStream.`);
590
591
  }
591
592
  }
592
593
  }
@@ -889,7 +890,8 @@ function isSpecialXmlProperty(propertyName, options) {
889
890
  return [XML_ATTRKEY, options.xml.xmlCharKey].includes(propertyName);
890
891
  }
891
892
  function deserializeCompositeType(serializer, mapper, responseBody, objectName, options) {
892
- var _a;
893
+ var _a, _b;
894
+ const xmlCharKey = (_a = options.xml.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY;
893
895
  if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) {
894
896
  mapper = getPolymorphicMapper(serializer, mapper, responseBody, "serializedName");
895
897
  }
@@ -920,6 +922,16 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName,
920
922
  if (propertyMapper.xmlIsAttribute && responseBody[XML_ATTRKEY]) {
921
923
  instance[key] = serializer.deserialize(propertyMapper, responseBody[XML_ATTRKEY][xmlName], propertyObjectName, options);
922
924
  }
925
+ else if (propertyMapper.xmlIsMsText) {
926
+ if (responseBody[xmlCharKey] !== undefined) {
927
+ instance[key] = responseBody[xmlCharKey];
928
+ }
929
+ else if (typeof responseBody === "string") {
930
+ // The special case where xml parser parses "<Name>content</Name>" into JSON of
931
+ // `{ name: "content"}` instead of `{ name: { "_": "content" }}`
932
+ instance[key] = responseBody;
933
+ }
934
+ }
923
935
  else {
924
936
  const propertyName = xmlElementName || xmlName || serializedName;
925
937
  if (propertyMapper.xmlIsWrapped) {
@@ -938,12 +950,14 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName,
938
950
  xmlName is "Cors" and xmlElementName is"CorsRule".
939
951
  */
940
952
  const wrapped = responseBody[xmlName];
941
- const elementList = (_a = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _a !== void 0 ? _a : [];
953
+ const elementList = (_b = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _b !== void 0 ? _b : [];
942
954
  instance[key] = serializer.deserialize(propertyMapper, elementList, propertyObjectName, options);
955
+ handledPropertyNames.push(xmlName);
943
956
  }
944
957
  else {
945
958
  const property = responseBody[propertyName];
946
959
  instance[key] = serializer.deserialize(propertyMapper, property, propertyObjectName, options);
960
+ handledPropertyNames.push(propertyName);
947
961
  }
948
962
  }
949
963
  }