@ezeep/ezeep-js 1.0.252 → 1.0.253

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.
@@ -1,4 +1,5 @@
1
1
  import { g as getRenderingRef, f as forceUpdate, r as registerInstance, c as createEvent, h, H as Host, a as getElement, d as getAssetPath, F as Fragment } from './index-3ac1b749.js';
2
+ import '@typespec/ts-http-runtime/internal/util';
2
3
 
3
4
  const appendToMap = (map, propName, value) => {
4
5
  const items = map.get(propName);
@@ -176,185 +177,104 @@ const createStore = (defaultState, shouldUpdate) => {
176
177
  return map;
177
178
  };
178
179
 
179
- function _typeof$1(obj) {
180
+ function _typeof(o) {
180
181
  "@babel/helpers - typeof";
181
182
 
182
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
183
- _typeof$1 = function _typeof(obj) {
184
- return typeof obj;
185
- };
186
- } else {
187
- _typeof$1 = function _typeof(obj) {
188
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
189
- };
190
- }
191
-
192
- return _typeof$1(obj);
183
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
184
+ return typeof o;
185
+ } : function (o) {
186
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
187
+ }, _typeof(o);
193
188
  }
194
189
 
195
- function _defineProperty(obj, key, value) {
196
- if (key in obj) {
197
- Object.defineProperty(obj, key, {
198
- value: value,
199
- enumerable: true,
200
- configurable: true,
201
- writable: true
202
- });
203
- } else {
204
- obj[key] = value;
190
+ function toPrimitive(t, r) {
191
+ if ("object" != _typeof(t) || !t) return t;
192
+ var e = t[Symbol.toPrimitive];
193
+ if (void 0 !== e) {
194
+ var i = e.call(t, r || "default");
195
+ if ("object" != _typeof(i)) return i;
196
+ throw new TypeError("@@toPrimitive must return a primitive value.");
205
197
  }
206
-
207
- return obj;
198
+ return ("string" === r ? String : Number)(t);
208
199
  }
209
200
 
210
- function _objectSpread(target) {
211
- for (var i = 1; i < arguments.length; i++) {
212
- var source = arguments[i] != null ? Object(arguments[i]) : {};
213
- var ownKeys = Object.keys(source);
214
-
215
- if (typeof Object.getOwnPropertySymbols === 'function') {
216
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
217
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
218
- }));
219
- }
220
-
221
- ownKeys.forEach(function (key) {
222
- _defineProperty(target, key, source[key]);
223
- });
224
- }
225
-
226
- return target;
201
+ function toPropertyKey(t) {
202
+ var i = toPrimitive(t, "string");
203
+ return "symbol" == _typeof(i) ? i : i + "";
227
204
  }
228
205
 
229
- function _classCallCheck(instance, Constructor) {
230
- if (!(instance instanceof Constructor)) {
231
- throw new TypeError("Cannot call a class as a function");
232
- }
206
+ function _defineProperty(e, r, t) {
207
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
208
+ value: t,
209
+ enumerable: !0,
210
+ configurable: !0,
211
+ writable: !0
212
+ }) : e[r] = t, e;
233
213
  }
234
214
 
235
- function _defineProperties(target, props) {
236
- for (var i = 0; i < props.length; i++) {
237
- var descriptor = props[i];
238
- descriptor.enumerable = descriptor.enumerable || false;
239
- descriptor.configurable = true;
240
- if ("value" in descriptor) descriptor.writable = true;
241
- Object.defineProperty(target, descriptor.key, descriptor);
215
+ function _objectSpread(e) {
216
+ for (var r = 1; r < arguments.length; r++) {
217
+ var t = null != arguments[r] ? Object(arguments[r]) : {},
218
+ o = Object.keys(t);
219
+ "function" == typeof Object.getOwnPropertySymbols && o.push.apply(o, Object.getOwnPropertySymbols(t).filter(function (e) {
220
+ return Object.getOwnPropertyDescriptor(t, e).enumerable;
221
+ })), o.forEach(function (r) {
222
+ _defineProperty(e, r, t[r]);
223
+ });
242
224
  }
225
+ return e;
243
226
  }
244
227
 
245
- function _createClass(Constructor, protoProps, staticProps) {
246
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
247
- if (staticProps) _defineProperties(Constructor, staticProps);
248
- return Constructor;
249
- }
250
-
251
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
252
-
253
- function getDefaultExportFromCjs (x) {
254
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
255
- }
256
-
257
- function createCommonjsModule(fn, basedir, module) {
258
- return module = {
259
- path: basedir,
260
- exports: {},
261
- require: function (path, base) {
262
- return commonjsRequire();
263
- }
264
- }, fn(module, module.exports), module.exports;
265
- }
266
-
267
- function getAugmentedNamespace(n) {
268
- if (n.__esModule) return n;
269
- var a = Object.defineProperty({}, '__esModule', {value: true});
270
- Object.keys(n).forEach(function (k) {
271
- var d = Object.getOwnPropertyDescriptor(n, k);
272
- Object.defineProperty(a, k, d.get ? d : {
273
- enumerable: true,
274
- get: function () {
275
- return n[k];
276
- }
277
- });
278
- });
279
- return a;
280
- }
281
-
282
- function commonjsRequire () {
283
- throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
228
+ function _classCallCheck(a, n) {
229
+ if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
284
230
  }
285
231
 
286
- var _typeof_1 = createCommonjsModule(function (module) {
287
- function _typeof(obj) {
288
- "@babel/helpers - typeof";
289
-
290
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
291
- module.exports = _typeof = function _typeof(obj) {
292
- return typeof obj;
293
- };
294
-
295
- module.exports["default"] = module.exports, module.exports.__esModule = true;
296
- } else {
297
- module.exports = _typeof = function _typeof(obj) {
298
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
299
- };
300
-
301
- module.exports["default"] = module.exports, module.exports.__esModule = true;
232
+ function _defineProperties(e, r) {
233
+ for (var t = 0; t < r.length; t++) {
234
+ var o = r[t];
235
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
302
236
  }
303
-
304
- return _typeof(obj);
305
237
  }
306
-
307
- module.exports = _typeof;
308
- module.exports["default"] = module.exports, module.exports.__esModule = true;
309
- });
310
-
311
- const _typeof = /*@__PURE__*/getDefaultExportFromCjs(_typeof_1);
312
-
313
- function _assertThisInitialized(self) {
314
- if (self === void 0) {
315
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
316
- }
317
-
318
- return self;
238
+ function _createClass(e, r, t) {
239
+ return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
240
+ writable: !1
241
+ }), e;
319
242
  }
320
243
 
321
- function _possibleConstructorReturn(self, call) {
322
- if (call && (_typeof(call) === "object" || typeof call === "function")) {
323
- return call;
324
- }
325
-
326
- return _assertThisInitialized(self);
244
+ function _assertThisInitialized(e) {
245
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
246
+ return e;
327
247
  }
328
248
 
329
- function _getPrototypeOf(o) {
330
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
331
- return o.__proto__ || Object.getPrototypeOf(o);
332
- };
333
- return _getPrototypeOf(o);
249
+ function _possibleConstructorReturn(t, e) {
250
+ if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
251
+ if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
252
+ return _assertThisInitialized(t);
334
253
  }
335
254
 
336
- function _setPrototypeOf(o, p) {
337
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
338
- o.__proto__ = p;
339
- return o;
340
- };
341
-
342
- return _setPrototypeOf(o, p);
255
+ function _getPrototypeOf(t) {
256
+ return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
257
+ return t.__proto__ || Object.getPrototypeOf(t);
258
+ }, _getPrototypeOf(t);
343
259
  }
344
260
 
345
- function _inherits(subClass, superClass) {
346
- if (typeof superClass !== "function" && superClass !== null) {
347
- throw new TypeError("Super expression must either be null or a function");
348
- }
261
+ function _setPrototypeOf(t, e) {
262
+ return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
263
+ return t.__proto__ = e, t;
264
+ }, _setPrototypeOf(t, e);
265
+ }
349
266
 
350
- subClass.prototype = Object.create(superClass && superClass.prototype, {
267
+ function _inherits(t, e) {
268
+ if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
269
+ t.prototype = Object.create(e && e.prototype, {
351
270
  constructor: {
352
- value: subClass,
353
- writable: true,
354
- configurable: true
271
+ value: t,
272
+ writable: !0,
273
+ configurable: !0
355
274
  }
356
- });
357
- if (superClass) _setPrototypeOf(subClass, superClass);
275
+ }), Object.defineProperty(t, "prototype", {
276
+ writable: !1
277
+ }), e && _setPrototypeOf(t, e);
358
278
  }
359
279
 
360
280
  var consoleLogger = {
@@ -973,7 +893,7 @@ var Translator = function (_EventEmitter) {
973
893
  value: function translate(keys, options, lastKey) {
974
894
  var _this2 = this;
975
895
 
976
- if (_typeof$1(options) !== 'object' && this.options.overloadTranslationOptionHandler) {
896
+ if (_typeof(options) !== 'object' && this.options.overloadTranslationOptionHandler) {
977
897
  options = this.options.overloadTranslationOptionHandler(arguments);
978
898
  }
979
899
 
@@ -2229,11 +2149,11 @@ function get() {
2229
2149
  appendNamespaceToCIMode: false,
2230
2150
  overloadTranslationOptionHandler: function handle(args) {
2231
2151
  var ret = {};
2232
- if (_typeof$1(args[1]) === 'object') ret = args[1];
2152
+ if (_typeof(args[1]) === 'object') ret = args[1];
2233
2153
  if (typeof args[1] === 'string') ret.defaultValue = args[1];
2234
2154
  if (typeof args[2] === 'string') ret.tDescription = args[2];
2235
2155
 
2236
- if (_typeof$1(args[2]) === 'object' || _typeof$1(args[3]) === 'object') {
2156
+ if (_typeof(args[2]) === 'object' || _typeof(args[3]) === 'object') {
2237
2157
  var options = args[3] || args[2];
2238
2158
  Object.keys(options).forEach(function (key) {
2239
2159
  ret[key] = options[key];
@@ -2630,7 +2550,7 @@ var I18n = function (_EventEmitter) {
2630
2550
  var fixedT = function fixedT(key, opts) {
2631
2551
  var options;
2632
2552
 
2633
- if (_typeof$1(opts) !== 'object') {
2553
+ if (_typeof(opts) !== 'object') {
2634
2554
  for (var _len3 = arguments.length, rest = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
2635
2555
  rest[_key3 - 2] = arguments[_key3];
2636
2556
  }
@@ -4170,6 +4090,23 @@ const fetch$2 = /*#__PURE__*/Object.freeze({
4170
4090
  fetch: fetch$1
4171
4091
  });
4172
4092
 
4093
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4094
+
4095
+ function getAugmentedNamespace(n) {
4096
+ if (n.__esModule) return n;
4097
+ var a = Object.defineProperty({}, '__esModule', {value: true});
4098
+ Object.keys(n).forEach(function (k) {
4099
+ var d = Object.getOwnPropertyDescriptor(n, k);
4100
+ Object.defineProperty(a, k, d.get ? d : {
4101
+ enumerable: true,
4102
+ get: function () {
4103
+ return n[k];
4104
+ }
4105
+ });
4106
+ });
4107
+ return a;
4108
+ }
4109
+
4173
4110
  const require$$0 = /*@__PURE__*/getAugmentedNamespace(fetch$2);
4174
4111
 
4175
4112
  var browser =
@@ -4516,7 +4453,7 @@ const Constants = {
4516
4453
  /**
4517
4454
  * The core-http version
4518
4455
  */
4519
- coreHttpVersion: "2.2.3",
4456
+ coreHttpVersion: "2.3.2",
4520
4457
  /**
4521
4458
  * Specifies HTTP.
4522
4459
  */
@@ -4767,6 +4704,7 @@ class Serializer {
4767
4704
  * @param mapper - The definition of data models.
4768
4705
  * @param value - The value.
4769
4706
  * @param objectName - Name of the object. Used in the error messages.
4707
+ * @deprecated Removing the constraints validation on client side.
4770
4708
  */
4771
4709
  validateConstraints(mapper, value, objectName) {
4772
4710
  const failValidation = (constraintName, constraintValue) => {
@@ -4865,8 +4803,6 @@ class Serializer {
4865
4803
  payload = object;
4866
4804
  }
4867
4805
  else {
4868
- // Validate Constraints if any
4869
- this.validateConstraints(mapper, object, objectName);
4870
4806
  if (mapperType.match(/^any$/i) !== null) {
4871
4807
  payload = object;
4872
4808
  }
@@ -5384,7 +5320,8 @@ function isSpecialXmlProperty(propertyName, options) {
5384
5320
  return [XML_ATTRKEY, options.xmlCharKey].includes(propertyName);
5385
5321
  }
5386
5322
  function deserializeCompositeType(serializer, mapper, responseBody, objectName, options) {
5387
- var _a;
5323
+ var _a, _b;
5324
+ const xmlCharKey = (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY;
5388
5325
  if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) {
5389
5326
  mapper = getPolymorphicMapper(serializer, mapper, responseBody, "serializedName");
5390
5327
  }
@@ -5415,6 +5352,16 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName,
5415
5352
  if (propertyMapper.xmlIsAttribute && responseBody[XML_ATTRKEY]) {
5416
5353
  instance[key] = serializer.deserialize(propertyMapper, responseBody[XML_ATTRKEY][xmlName], propertyObjectName, options);
5417
5354
  }
5355
+ else if (propertyMapper.xmlIsMsText) {
5356
+ if (responseBody[xmlCharKey] !== undefined) {
5357
+ instance[key] = responseBody[xmlCharKey];
5358
+ }
5359
+ else if (typeof responseBody === "string") {
5360
+ // The special case where xml parser parses "<Name>content</Name>" into JSON of
5361
+ // `{ name: "content"}` instead of `{ name: { "_": "content" }}`
5362
+ instance[key] = responseBody;
5363
+ }
5364
+ }
5418
5365
  else {
5419
5366
  const propertyName = xmlElementName || xmlName || serializedName;
5420
5367
  if (propertyMapper.xmlIsWrapped) {
@@ -5433,7 +5380,7 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName,
5433
5380
  xmlName is "Cors" and xmlElementName is"CorsRule".
5434
5381
  */
5435
5382
  const wrapped = responseBody[xmlName];
5436
- const elementList = (_a = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _a !== void 0 ? _a : [];
5383
+ const elementList = (_b = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _b !== void 0 ? _b : [];
5437
5384
  instance[key] = serializer.deserialize(propertyMapper, elementList, propertyObjectName, options);
5438
5385
  }
5439
5386
  else {
@@ -5873,7 +5820,7 @@ class WebResource {
5873
5820
  }
5874
5821
  }
5875
5822
 
5876
- /*! *****************************************************************************
5823
+ /******************************************************************************
5877
5824
  Copyright (c) Microsoft Corporation.
5878
5825
 
5879
5826
  Permission to use, copy, modify, and/or distribute this software for any
@@ -5887,7 +5834,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
5887
5834
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
5888
5835
  PERFORMANCE OF THIS SOFTWARE.
5889
5836
  ***************************************************************************** */
5890
- /* global Reflect, Promise */
5837
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
5891
5838
 
5892
5839
  var extendStatics = function(d, b) {
5893
5840
  extendStatics = Object.setPrototypeOf ||
@@ -5914,7 +5861,12 @@ function __rest(s, e) {
5914
5861
  t[p[i]] = s[p[i]];
5915
5862
  }
5916
5863
  return t;
5917
- }
5864
+ }
5865
+
5866
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
5867
+ var e = new Error(message);
5868
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
5869
+ };
5918
5870
 
5919
5871
  // Copyright (c) Microsoft Corporation.
5920
5872
  // Licensed under the MIT license.
@@ -6058,7 +6010,7 @@ function abortSignal(signal) {
6058
6010
  * }
6059
6011
  * ```
6060
6012
  */
6061
- var AbortError = /** @class */ (function (_super) {
6013
+ var AbortError$1 = /** @class */ (function (_super) {
6062
6014
  __extends(AbortError, _super);
6063
6015
  function AbortError(message) {
6064
6016
  var _this = _super.call(this, message) || this;
@@ -6165,10 +6117,6 @@ var AbortError = /** @class */ (function (_super) {
6165
6117
  return AbortController;
6166
6118
  })());
6167
6119
 
6168
- // Copyright (c) Microsoft Corporation.
6169
- // Licensed under the MIT license.
6170
- const url$1 = URL;
6171
-
6172
6120
  // Copyright (c) Microsoft Corporation.
6173
6121
  /**
6174
6122
  * A class that handles the query portion of a URLBuilder.
@@ -6805,6 +6753,7 @@ const defaultAllowedHeaderNames = [
6805
6753
  "Server",
6806
6754
  "Transfer-Encoding",
6807
6755
  "User-Agent",
6756
+ "WWW-Authenticate",
6808
6757
  ];
6809
6758
  const defaultAllowedQueryParameters = ["api-version"];
6810
6759
  class Sanitizer {
@@ -6946,7 +6895,7 @@ class XhrHttpClient {
6946
6895
  const abortSignal = request.abortSignal;
6947
6896
  if (abortSignal) {
6948
6897
  if (abortSignal.aborted) {
6949
- return Promise.reject(new AbortError("The operation was aborted."));
6898
+ return Promise.reject(new AbortError$1("The operation was aborted."));
6950
6899
  }
6951
6900
  const listener = () => {
6952
6901
  xhr.abort();
@@ -7099,7 +7048,7 @@ function parseHeaders(xhr) {
7099
7048
  }
7100
7049
  function rejectOnTerminalEvent(request, xhr, reject) {
7101
7050
  xhr.addEventListener("error", () => reject(new RestError(`Failed to send request to ${request.url}`, RestError.REQUEST_SEND_ERROR, undefined, request)));
7102
- const abortError = new AbortError("The operation was aborted.");
7051
+ const abortError = new AbortError$1("The operation was aborted.");
7103
7052
  xhr.addEventListener("abort", () => reject(abortError));
7104
7053
  xhr.addEventListener("timeout", () => reject(abortError));
7105
7054
  }
@@ -7136,7 +7085,6 @@ var HttpPipelineLogLevel;
7136
7085
  * @param opts - OperationOptions object to convert to RequestOptionsBase
7137
7086
  */
7138
7087
  function operationOptionsToRequestOptionsBase(opts) {
7139
- var _a;
7140
7088
  const { requestOptions, tracingOptions } = opts, additionalOptions = __rest(opts, ["requestOptions", "tracingOptions"]);
7141
7089
  let result = additionalOptions;
7142
7090
  if (requestOptions) {
@@ -7145,7 +7093,7 @@ function operationOptionsToRequestOptionsBase(opts) {
7145
7093
  if (tracingOptions) {
7146
7094
  result.tracingContext = tracingOptions.tracingContext;
7147
7095
  // By passing spanOptions if they exist at runtime, we're backwards compatible with @azure/core-tracing@preview.13 and earlier.
7148
- result.spanOptions = (_a = tracingOptions) === null || _a === void 0 ? void 0 : _a.spanOptions;
7096
+ result.spanOptions = tracingOptions === null || tracingOptions === void 0 ? void 0 : tracingOptions.spanOptions;
7149
7097
  }
7150
7098
  return result;
7151
7099
  }
@@ -7222,17 +7170,48 @@ class RequestPolicyOptions {
7222
7170
  if (!self.document || !self.DOMParser || !self.Node || !self.XMLSerializer) {
7223
7171
  throw new Error(`This library depends on the following DOM objects: ["document", "DOMParser", "Node", "XMLSerializer"] to parse XML, but some of these are undefined. You may provide a polyfill to make these globally available in order to support your environment. For more information, please refer to https://aka.ms/azsdk/js/web-workers. `);
7224
7172
  }
7225
- const doc = document.implementation.createDocument(null, null, null);
7226
- const parser = new DOMParser();
7173
+ let cachedDoc;
7174
+ function getDoc() {
7175
+ if (!cachedDoc) {
7176
+ cachedDoc = document.implementation.createDocument(null, null, null);
7177
+ }
7178
+ return cachedDoc;
7179
+ }
7180
+ let cachedParser;
7181
+ function getParser() {
7182
+ if (!cachedParser) {
7183
+ cachedParser = new DOMParser();
7184
+ }
7185
+ return cachedParser;
7186
+ }
7187
+ let cachedSerializer;
7188
+ function getSerializer() {
7189
+ if (!cachedSerializer) {
7190
+ cachedSerializer = new XMLSerializer();
7191
+ }
7192
+ return cachedSerializer;
7193
+ }
7194
+ // Policy to make our code Trusted Types compliant.
7195
+ // https://github.com/w3c/webappsec-trusted-types
7196
+ // We are calling DOMParser.parseFromString() to parse XML payload from Azure services.
7197
+ // The parsed DOM object is not exposed to outside. Scripts are disabled when parsing
7198
+ // according to the spec. There are no HTML/XSS security concerns on the usage of
7199
+ // parseFromString() here.
7200
+ let ttPolicy;
7201
+ if (typeof self.trustedTypes !== "undefined") {
7202
+ ttPolicy = self.trustedTypes.createPolicy("@azure/core-http#xml.browser", {
7203
+ createHTML: (s) => s,
7204
+ });
7205
+ }
7227
7206
  function parseXML(str, opts = {}) {
7228
- var _a, _b, _c;
7207
+ var _a, _b, _c, _d;
7229
7208
  try {
7230
7209
  const updatedOptions = {
7231
7210
  rootName: (_a = opts.rootName) !== null && _a !== void 0 ? _a : "",
7232
7211
  includeRoot: (_b = opts.includeRoot) !== null && _b !== void 0 ? _b : false,
7233
7212
  xmlCharKey: (_c = opts.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY,
7234
7213
  };
7235
- const dom = parser.parseFromString(str, "application/xml");
7214
+ const dom = getParser().parseFromString(((_d = ttPolicy === null || ttPolicy === void 0 ? void 0 : ttPolicy.createHTML(str)) !== null && _d !== void 0 ? _d : str), "application/xml");
7236
7215
  throwIfError(dom);
7237
7216
  let obj;
7238
7217
  if (updatedOptions.includeRoot) {
@@ -7249,12 +7228,13 @@ function parseXML(str, opts = {}) {
7249
7228
  }
7250
7229
  let errorNS;
7251
7230
  function getErrorNamespace() {
7252
- var _a;
7231
+ var _a, _b;
7253
7232
  if (errorNS === undefined) {
7254
7233
  try {
7234
+ const invalidXML = ((_a = ttPolicy === null || ttPolicy === void 0 ? void 0 : ttPolicy.createHTML("INVALID")) !== null && _a !== void 0 ? _a : "INVALID");
7255
7235
  errorNS =
7256
- (_a = parser.parseFromString("INVALID", "text/xml").getElementsByTagName("parsererror")[0]
7257
- .namespaceURI) !== null && _a !== void 0 ? _a : "";
7236
+ (_b = getParser().parseFromString(invalidXML, "text/xml").getElementsByTagName("parsererror")[0]
7237
+ .namespaceURI) !== null && _b !== void 0 ? _b : "";
7258
7238
  }
7259
7239
  catch (ignored) {
7260
7240
  // Most browsers will return a document containing <parsererror>, but IE will throw.
@@ -7329,7 +7309,6 @@ function domToObject(node, options) {
7329
7309
  }
7330
7310
  return result;
7331
7311
  }
7332
- const serializer$3 = new XMLSerializer();
7333
7312
  function stringifyXML(content, opts = {}) {
7334
7313
  var _a, _b, _c;
7335
7314
  const updatedOptions = {
@@ -7338,12 +7317,13 @@ function stringifyXML(content, opts = {}) {
7338
7317
  xmlCharKey: (_c = opts.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY,
7339
7318
  };
7340
7319
  const dom = buildNode(content, updatedOptions.rootName, updatedOptions)[0];
7341
- return ('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' + serializer$3.serializeToString(dom));
7320
+ return ('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' +
7321
+ getSerializer().serializeToString(dom));
7342
7322
  }
7343
7323
  function buildAttributes(attrs) {
7344
7324
  const result = [];
7345
7325
  for (const key of Object.keys(attrs)) {
7346
- const attr = doc.createAttribute(key);
7326
+ const attr = getDoc().createAttribute(key);
7347
7327
  attr.value = attrs[key].toString();
7348
7328
  result.push(attr);
7349
7329
  }
@@ -7355,7 +7335,7 @@ function buildNode(obj, elementName, options) {
7355
7335
  typeof obj === "string" ||
7356
7336
  typeof obj === "number" ||
7357
7337
  typeof obj === "boolean") {
7358
- const elem = doc.createElement(elementName);
7338
+ const elem = getDoc().createElement(elementName);
7359
7339
  elem.textContent = obj === undefined || obj === null ? "" : obj.toString();
7360
7340
  return [elem];
7361
7341
  }
@@ -7369,7 +7349,7 @@ function buildNode(obj, elementName, options) {
7369
7349
  return result;
7370
7350
  }
7371
7351
  else if (typeof obj === "object") {
7372
- const elem = doc.createElement(elementName);
7352
+ const elem = getDoc().createElement(elementName);
7373
7353
  for (const key of Object.keys(obj)) {
7374
7354
  if (key === XML_ATTRKEY) {
7375
7355
  for (const attr of buildAttributes(obj[key])) {
@@ -7510,7 +7490,7 @@ function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, op
7510
7490
  parsedResponse.parsedBody = response.status >= 200 && response.status < 300;
7511
7491
  }
7512
7492
  if (responseSpec.headersMapper) {
7513
- parsedResponse.parsedHeaders = operationSpec.serializer.deserialize(responseSpec.headersMapper, parsedResponse.headers.rawHeaders(), "operationRes.parsedHeaders", options);
7493
+ parsedResponse.parsedHeaders = operationSpec.serializer.deserialize(responseSpec.headersMapper, parsedResponse.headers.toJson(), "operationRes.parsedHeaders", options);
7514
7494
  }
7515
7495
  }
7516
7496
  return parsedResponse;
@@ -7576,7 +7556,7 @@ function handleErrorResponse(parsedResponse, operationSpec, responseSpec) {
7576
7556
  }
7577
7557
  // If error response has headers, try to deserialize it using default header mapper
7578
7558
  if (parsedResponse.headers && defaultHeadersMapper) {
7579
- error.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.rawHeaders(), "operationRes.parsedHeaders");
7559
+ error.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.toJson(), "operationRes.parsedHeaders");
7580
7560
  }
7581
7561
  }
7582
7562
  catch (defaultError) {
@@ -7776,54 +7756,87 @@ function updateRetryData(retryOptions, retryData = { retryCount: 0, retryInterva
7776
7756
  // Copyright (c) Microsoft Corporation.
7777
7757
  // Licensed under the MIT license.
7778
7758
  /**
7779
- * Helper TypeGuard that checks if the value is not null or undefined.
7780
- * @param thing - Anything
7781
- * @internal
7759
+ * This error is thrown when an asynchronous operation has been aborted.
7760
+ * Check for this error by testing the `name` that the name property of the
7761
+ * error matches `"AbortError"`.
7762
+ *
7763
+ * @example
7764
+ * ```ts
7765
+ * const controller = new AbortController();
7766
+ * controller.abort();
7767
+ * try {
7768
+ * doAsyncWork(controller.signal)
7769
+ * } catch (e) {
7770
+ * if (e.name === 'AbortError') {
7771
+ * // handle abort error here.
7772
+ * }
7773
+ * }
7774
+ * ```
7782
7775
  */
7783
- function isDefined(thing) {
7784
- return typeof thing !== "undefined" && thing !== null;
7776
+ class AbortError extends Error {
7777
+ constructor(message) {
7778
+ super(message);
7779
+ this.name = "AbortError";
7780
+ }
7785
7781
  }
7786
7782
 
7787
7783
  // Copyright (c) Microsoft Corporation.
7788
- const StandardAbortMessage$1 = "The operation was aborted.";
7789
7784
  /**
7790
- * A wrapper for setTimeout that resolves a promise after delayInMs milliseconds.
7791
- * @param delayInMs - The number of milliseconds to be delayed.
7792
- * @param value - The value to be resolved with after a timeout of t milliseconds.
7793
- * @param options - The options for delay - currently abort options
7794
- * @param abortSignal - The abortSignal associated with containing operation.
7795
- * @param abortErrorMsg - The abort error message associated with containing operation.
7796
- * @returns - Resolved promise
7785
+ * Creates an abortable promise.
7786
+ * @param buildPromise - A function that takes the resolve and reject functions as parameters.
7787
+ * @param options - The options for the abortable promise.
7788
+ * @returns A promise that can be aborted.
7797
7789
  */
7798
- function delay$1(delayInMs, value, options) {
7790
+ function createAbortablePromise(buildPromise, options) {
7791
+ const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options ?? {};
7799
7792
  return new Promise((resolve, reject) => {
7800
- let timer = undefined;
7801
- let onAborted = undefined;
7802
- const rejectOnAbort = () => {
7803
- return reject(new AbortError((options === null || options === void 0 ? void 0 : options.abortErrorMsg) ? options === null || options === void 0 ? void 0 : options.abortErrorMsg : StandardAbortMessage$1));
7804
- };
7805
- const removeListeners = () => {
7806
- if ((options === null || options === void 0 ? void 0 : options.abortSignal) && onAborted) {
7807
- options.abortSignal.removeEventListener("abort", onAborted);
7808
- }
7809
- };
7810
- onAborted = () => {
7811
- if (isDefined(timer)) {
7812
- clearTimeout(timer);
7813
- }
7793
+ function rejectOnAbort() {
7794
+ reject(new AbortError(abortErrorMsg ?? "The operation was aborted."));
7795
+ }
7796
+ function removeListeners() {
7797
+ abortSignal?.removeEventListener("abort", onAbort);
7798
+ }
7799
+ function onAbort() {
7800
+ cleanupBeforeAbort?.();
7814
7801
  removeListeners();
7815
- return rejectOnAbort();
7816
- };
7817
- if ((options === null || options === void 0 ? void 0 : options.abortSignal) && options.abortSignal.aborted) {
7802
+ rejectOnAbort();
7803
+ }
7804
+ if (abortSignal?.aborted) {
7818
7805
  return rejectOnAbort();
7819
7806
  }
7820
- timer = setTimeout(() => {
7821
- removeListeners();
7822
- resolve(value);
7823
- }, delayInMs);
7824
- if (options === null || options === void 0 ? void 0 : options.abortSignal) {
7825
- options.abortSignal.addEventListener("abort", onAborted);
7807
+ try {
7808
+ buildPromise((x) => {
7809
+ removeListeners();
7810
+ resolve(x);
7811
+ }, (x) => {
7812
+ removeListeners();
7813
+ reject(x);
7814
+ });
7826
7815
  }
7816
+ catch (err) {
7817
+ reject(err);
7818
+ }
7819
+ abortSignal?.addEventListener("abort", onAbort);
7820
+ });
7821
+ }
7822
+
7823
+ // Copyright (c) Microsoft Corporation.
7824
+ const StandardAbortMessage$1 = "The delay was aborted.";
7825
+ /**
7826
+ * A wrapper for setTimeout that resolves a promise after timeInMs milliseconds.
7827
+ * @param timeInMs - The number of milliseconds to be delayed.
7828
+ * @param options - The options for delay - currently abort options
7829
+ * @returns Promise that is resolved after timeInMs
7830
+ */
7831
+ function delay$1(timeInMs, options) {
7832
+ let token;
7833
+ const { abortSignal, abortErrorMsg } = options ?? {};
7834
+ return createAbortablePromise((resolve) => {
7835
+ token = setTimeout(resolve, timeInMs);
7836
+ }, {
7837
+ cleanupBeforeAbort: () => clearTimeout(token),
7838
+ abortSignal,
7839
+ abortErrorMsg: abortErrorMsg ?? StandardAbortMessage$1,
7827
7840
  });
7828
7841
  }
7829
7842
 
@@ -8938,12 +8951,12 @@ class ThrottlingRetryPolicy extends BaseRequestPolicy {
8938
8951
  const delayInMs = ThrottlingRetryPolicy.parseRetryAfterHeader(retryAfterHeader);
8939
8952
  if (delayInMs) {
8940
8953
  this.numberOfRetries += 1;
8941
- await delay$1(delayInMs, undefined, {
8954
+ await delay$1(delayInMs, {
8942
8955
  abortSignal: httpRequest.abortSignal,
8943
8956
  abortErrorMsg: StandardAbortMessage,
8944
8957
  });
8945
8958
  if ((_a = httpRequest.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) {
8946
- throw new AbortError(StandardAbortMessage);
8959
+ throw new AbortError$1(StandardAbortMessage);
8947
8960
  }
8948
8961
  if (this.numberOfRetries < DEFAULT_CLIENT_MAX_RETRY_COUNT) {
8949
8962
  return this.sendRequest(httpRequest);
@@ -10728,10 +10741,9 @@ class TracingPolicy extends BaseRequestPolicy {
10728
10741
  tryCreateSpan(request) {
10729
10742
  var _a;
10730
10743
  try {
10731
- const path = URLBuilder.parse(request.url).getPath() || "/";
10732
10744
  // Passing spanOptions as part of tracingOptions to maintain compatibility @azure/core-tracing@preview.13 and earlier.
10733
10745
  // We can pass this as a separate parameter once we upgrade to the latest core-tracing.
10734
- const { span } = createSpan$1(path, {
10746
+ const { span } = createSpan$1(`HTTP ${request.method}`, {
10735
10747
  tracingOptions: {
10736
10748
  spanOptions: Object.assign(Object.assign({}, request.spanOptions), { kind: SpanKind.CLIENT }),
10737
10749
  tracingContext: request.tracingContext,
@@ -11323,8 +11335,8 @@ function getCredentialScopes(options, baseUri) {
11323
11335
  if (options === null || options === void 0 ? void 0 : options.credentialScopes) {
11324
11336
  const scopes = options.credentialScopes;
11325
11337
  return Array.isArray(scopes)
11326
- ? scopes.map((scope) => new url$1(scope).toString())
11327
- : new url$1(scopes).toString();
11338
+ ? scopes.map((scope) => new URL(scope).toString())
11339
+ : new URL(scopes).toString();
11328
11340
  }
11329
11341
  if (baseUri) {
11330
11342
  return `${baseUri}/.default`;
@@ -26816,7 +26828,7 @@ const DEFAULT_RETRY_OPTIONS = {
26816
26828
  secondaryHost: "",
26817
26829
  tryTimeoutInMs: undefined // Use server side default timeout strategy
26818
26830
  };
26819
- const RETRY_ABORT_ERROR = new AbortError("The operation was aborted.");
26831
+ const RETRY_ABORT_ERROR = new AbortError$1("The operation was aborted.");
26820
26832
  /**
26821
26833
  * Retry policy with exponential retry and linear retry implemented.
26822
26834
  */