@jhzhu89/m2r 0.1.8 → 0.1.10

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 (2) hide show
  1. package/dist/index.js +503 -469
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5,25 +5,43 @@ var __getProtoOf = Object.getPrototypeOf;
5
5
  var __defProp = Object.defineProperty;
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ function __accessProp(key) {
9
+ return this[key];
10
+ }
11
+ var __toESMCache_node;
12
+ var __toESMCache_esm;
8
13
  var __toESM = (mod, isNodeMode, target) => {
14
+ var canCache = mod != null && typeof mod === "object";
15
+ if (canCache) {
16
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
17
+ var cached = cache.get(mod);
18
+ if (cached)
19
+ return cached;
20
+ }
9
21
  target = mod != null ? __create(__getProtoOf(mod)) : {};
10
22
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
11
23
  for (let key of __getOwnPropNames(mod))
12
24
  if (!__hasOwnProp.call(to, key))
13
25
  __defProp(to, key, {
14
- get: () => mod[key],
26
+ get: __accessProp.bind(mod, key),
15
27
  enumerable: true
16
28
  });
29
+ if (canCache)
30
+ cache.set(mod, to);
17
31
  return to;
18
32
  };
19
33
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
34
+ var __returnValue = (v) => v;
35
+ function __exportSetter(name, newValue) {
36
+ this[name] = __returnValue.bind(null, newValue);
37
+ }
20
38
  var __export = (target, all) => {
21
39
  for (var name in all)
22
40
  __defProp(target, name, {
23
41
  get: all[name],
24
42
  enumerable: true,
25
43
  configurable: true,
26
- set: (newValue) => all[name] = () => newValue
44
+ set: __exportSetter.bind(all, name)
27
45
  });
28
46
  };
29
47
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
@@ -16080,8 +16098,8 @@ var init_validate = __esm(() => {
16080
16098
  exports_external.object({ type: exports_external.literal("tool"), name: exports_external.string() })
16081
16099
  ]);
16082
16100
  thinking = exports_external.object({
16083
- type: exports_external.literal("enabled"),
16084
- budget_tokens: exports_external.number()
16101
+ type: exports_external.string(),
16102
+ budget_tokens: exports_external.number().optional()
16085
16103
  });
16086
16104
  schema = exports_external.object({
16087
16105
  model: exports_external.string(),
@@ -16096,6 +16114,7 @@ var init_validate = __esm(() => {
16096
16114
  stop_sequences: exports_external.array(exports_external.string()).optional(),
16097
16115
  tool_choice: toolChoice.optional(),
16098
16116
  thinking: thinking.optional(),
16117
+ output_config: exports_external.object({ effort: exports_external.enum(["low", "medium", "high", "max"]).optional() }).optional(),
16099
16118
  metadata: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
16100
16119
  });
16101
16120
  countTokensSchema = exports_external.object({
@@ -16127,11 +16146,26 @@ function parseToolChoice(tc) {
16127
16146
  }
16128
16147
  return;
16129
16148
  }
16130
- function parseThinking(t) {
16149
+ function budgetToEffort(budget) {
16150
+ if (budget <= 4000)
16151
+ return "low";
16152
+ if (budget <= 16000)
16153
+ return "medium";
16154
+ return "high";
16155
+ }
16156
+ function parseThinking(t, outputEffort) {
16157
+ const effort = outputEffort === "max" ? "high" : outputEffort;
16131
16158
  if (!isRecord(t))
16132
16159
  return;
16133
16160
  if (t.type === "enabled" && typeof t.budget_tokens === "number") {
16134
- return { type: "enabled", budgetTokens: t.budget_tokens };
16161
+ return {
16162
+ type: "enabled",
16163
+ budgetTokens: t.budget_tokens,
16164
+ effort: effort ?? budgetToEffort(t.budget_tokens)
16165
+ };
16166
+ }
16167
+ if (t.type === "adaptive") {
16168
+ return { type: "enabled", budgetTokens: 0, effort };
16135
16169
  }
16136
16170
  return;
16137
16171
  }
@@ -16205,7 +16239,7 @@ function fromRequest(body) {
16205
16239
  topP: body.top_p,
16206
16240
  stopSequences: body.stop_sequences,
16207
16241
  toolChoice: parseToolChoice(body.tool_choice),
16208
- thinking: parseThinking(body.thinking)
16242
+ thinking: parseThinking(body.thinking, body.output_config?.effort)
16209
16243
  };
16210
16244
  }
16211
16245
 
@@ -17952,7 +17986,7 @@ var EMPTY, createPathTagFunction = (pathEncoder = encodeURIPath) => function pat
17952
17986
  return statics[0];
17953
17987
  let postPath = false;
17954
17988
  const invalidSegments = [];
17955
- const path = statics.reduce((previousValue, currentValue, index) => {
17989
+ const path2 = statics.reduce((previousValue, currentValue, index) => {
17956
17990
  if (/[?#]/.test(currentValue)) {
17957
17991
  postPath = true;
17958
17992
  }
@@ -17968,7 +18002,7 @@ var EMPTY, createPathTagFunction = (pathEncoder = encodeURIPath) => function pat
17968
18002
  }
17969
18003
  return previousValue + currentValue + (index === params.length ? "" : encoded);
17970
18004
  }, "");
17971
- const pathOnly = path.split(/[?#]/, 1)[0];
18005
+ const pathOnly = path2.split(/[?#]/, 1)[0];
17972
18006
  const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
17973
18007
  let match2;
17974
18008
  while ((match2 = invalidSegmentPattern.exec(pathOnly)) !== null) {
@@ -17990,10 +18024,10 @@ var EMPTY, createPathTagFunction = (pathEncoder = encodeURIPath) => function pat
17990
18024
  throw new OpenAIError(`Path parameters result in path with invalid segments:
17991
18025
  ${invalidSegments.map((e) => e.error).join(`
17992
18026
  `)}
17993
- ${path}
18027
+ ${path2}
17994
18028
  ${underline}`);
17995
18029
  }
17996
- return path;
18030
+ return path2;
17997
18031
  }, path;
17998
18032
  var init_path = __esm(() => {
17999
18033
  init_error();
@@ -18934,11 +18968,11 @@ var init_ChatCompletionStream = __esm(() => {
18934
18968
  }
18935
18969
  return this._addChatCompletion(__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this));
18936
18970
  }
18937
- [(_ChatCompletionStream_params = new WeakMap, _ChatCompletionStream_choiceEventStates = new WeakMap, _ChatCompletionStream_currentChatCompletionSnapshot = new WeakMap, _ChatCompletionStream_instances = new WeakSet, _ChatCompletionStream_beginRequest = function _ChatCompletionStream_beginRequest() {
18971
+ [(_ChatCompletionStream_params = new WeakMap, _ChatCompletionStream_choiceEventStates = new WeakMap, _ChatCompletionStream_currentChatCompletionSnapshot = new WeakMap, _ChatCompletionStream_instances = new WeakSet, _ChatCompletionStream_beginRequest = function _ChatCompletionStream_beginRequest2() {
18938
18972
  if (this.ended)
18939
18973
  return;
18940
18974
  __classPrivateFieldSet(this, _ChatCompletionStream_currentChatCompletionSnapshot, undefined, "f");
18941
- }, _ChatCompletionStream_getChoiceEventState = function _ChatCompletionStream_getChoiceEventState(choice) {
18975
+ }, _ChatCompletionStream_getChoiceEventState = function _ChatCompletionStream_getChoiceEventState2(choice) {
18942
18976
  let state = __classPrivateFieldGet(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index];
18943
18977
  if (state) {
18944
18978
  return state;
@@ -18953,7 +18987,7 @@ var init_ChatCompletionStream = __esm(() => {
18953
18987
  };
18954
18988
  __classPrivateFieldGet(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index] = state;
18955
18989
  return state;
18956
- }, _ChatCompletionStream_addChunk = function _ChatCompletionStream_addChunk(chunk) {
18990
+ }, _ChatCompletionStream_addChunk = function _ChatCompletionStream_addChunk2(chunk) {
18957
18991
  if (this.ended)
18958
18992
  return;
18959
18993
  const completion = __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_accumulateChatCompletion).call(this, chunk);
@@ -19020,7 +19054,7 @@ var init_ChatCompletionStream = __esm(() => {
19020
19054
  }
19021
19055
  }
19022
19056
  }
19023
- }, _ChatCompletionStream_emitToolCallDoneEvent = function _ChatCompletionStream_emitToolCallDoneEvent(choiceSnapshot, toolCallIndex) {
19057
+ }, _ChatCompletionStream_emitToolCallDoneEvent = function _ChatCompletionStream_emitToolCallDoneEvent2(choiceSnapshot, toolCallIndex) {
19024
19058
  const state = __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot);
19025
19059
  if (state.done_tool_calls.has(toolCallIndex)) {
19026
19060
  return;
@@ -19043,7 +19077,7 @@ var init_ChatCompletionStream = __esm(() => {
19043
19077
  } else {
19044
19078
  assertNever2(toolCallSnapshot.type);
19045
19079
  }
19046
- }, _ChatCompletionStream_emitContentDoneEvents = function _ChatCompletionStream_emitContentDoneEvents(choiceSnapshot) {
19080
+ }, _ChatCompletionStream_emitContentDoneEvents = function _ChatCompletionStream_emitContentDoneEvents2(choiceSnapshot) {
19047
19081
  const state = __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot);
19048
19082
  if (choiceSnapshot.message.content && !state.content_done) {
19049
19083
  state.content_done = true;
@@ -19065,7 +19099,7 @@ var init_ChatCompletionStream = __esm(() => {
19065
19099
  state.logprobs_refusal_done = true;
19066
19100
  this._emit("logprobs.refusal.done", { refusal: choiceSnapshot.logprobs.refusal });
19067
19101
  }
19068
- }, _ChatCompletionStream_endRequest = function _ChatCompletionStream_endRequest() {
19102
+ }, _ChatCompletionStream_endRequest = function _ChatCompletionStream_endRequest2() {
19069
19103
  if (this.ended) {
19070
19104
  throw new OpenAIError(`stream has ended, this shouldn't happen`);
19071
19105
  }
@@ -19076,13 +19110,13 @@ var init_ChatCompletionStream = __esm(() => {
19076
19110
  __classPrivateFieldSet(this, _ChatCompletionStream_currentChatCompletionSnapshot, undefined, "f");
19077
19111
  __classPrivateFieldSet(this, _ChatCompletionStream_choiceEventStates, [], "f");
19078
19112
  return finalizeChatCompletion(snapshot, __classPrivateFieldGet(this, _ChatCompletionStream_params, "f"));
19079
- }, _ChatCompletionStream_getAutoParseableResponseFormat = function _ChatCompletionStream_getAutoParseableResponseFormat() {
19113
+ }, _ChatCompletionStream_getAutoParseableResponseFormat = function _ChatCompletionStream_getAutoParseableResponseFormat2() {
19080
19114
  const responseFormat = __classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.response_format;
19081
19115
  if (isAutoParsableResponseFormat(responseFormat)) {
19082
19116
  return responseFormat;
19083
19117
  }
19084
19118
  return null;
19085
- }, _ChatCompletionStream_accumulateChatCompletion = function _ChatCompletionStream_accumulateChatCompletion(chunk) {
19119
+ }, _ChatCompletionStream_accumulateChatCompletion = function _ChatCompletionStream_accumulateChatCompletion2(chunk) {
19086
19120
  var _a2, _b, _c, _d;
19087
19121
  let snapshot = __classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f");
19088
19122
  const { choices, ...rest } = chunk;
@@ -21275,11 +21309,11 @@ var init_ResponseStream = __esm(() => {
21275
21309
  }
21276
21310
  return __classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_endRequest).call(this);
21277
21311
  }
21278
- [(_ResponseStream_params = new WeakMap, _ResponseStream_currentResponseSnapshot = new WeakMap, _ResponseStream_finalResponse = new WeakMap, _ResponseStream_instances = new WeakSet, _ResponseStream_beginRequest = function _ResponseStream_beginRequest() {
21312
+ [(_ResponseStream_params = new WeakMap, _ResponseStream_currentResponseSnapshot = new WeakMap, _ResponseStream_finalResponse = new WeakMap, _ResponseStream_instances = new WeakSet, _ResponseStream_beginRequest = function _ResponseStream_beginRequest2() {
21279
21313
  if (this.ended)
21280
21314
  return;
21281
21315
  __classPrivateFieldSet(this, _ResponseStream_currentResponseSnapshot, undefined, "f");
21282
- }, _ResponseStream_addEvent = function _ResponseStream_addEvent(event, starting_after) {
21316
+ }, _ResponseStream_addEvent = function _ResponseStream_addEvent2(event, starting_after) {
21283
21317
  if (this.ended)
21284
21318
  return;
21285
21319
  const maybeEmit = (name, event2) => {
@@ -21327,7 +21361,7 @@ var init_ResponseStream = __esm(() => {
21327
21361
  maybeEmit(event.type, event);
21328
21362
  break;
21329
21363
  }
21330
- }, _ResponseStream_endRequest = function _ResponseStream_endRequest() {
21364
+ }, _ResponseStream_endRequest = function _ResponseStream_endRequest2() {
21331
21365
  if (this.ended) {
21332
21366
  throw new OpenAIError(`stream has ended, this shouldn't happen`);
21333
21367
  }
@@ -21339,7 +21373,7 @@ var init_ResponseStream = __esm(() => {
21339
21373
  const parsedResponse = finalizeResponse(snapshot, __classPrivateFieldGet(this, _ResponseStream_params, "f"));
21340
21374
  __classPrivateFieldSet(this, _ResponseStream_finalResponse, parsedResponse, "f");
21341
21375
  return parsedResponse;
21342
- }, _ResponseStream_accumulateResponse = function _ResponseStream_accumulateResponse(event) {
21376
+ }, _ResponseStream_accumulateResponse = function _ResponseStream_accumulateResponse2(event) {
21343
21377
  let snapshot = __classPrivateFieldGet(this, _ResponseStream_currentResponseSnapshot, "f");
21344
21378
  if (!snapshot) {
21345
21379
  if (event.type !== "response.created") {
@@ -38897,7 +38931,7 @@ var init_NetworkUtils = __esm(() => {
38897
38931
  });
38898
38932
 
38899
38933
  // node_modules/@azure/msal-node/dist/packageMetadata.mjs
38900
- var name2 = "@azure/msal-node", version3 = "3.8.4";
38934
+ var name2 = "@azure/msal-node", version4 = "3.8.4";
38901
38935
  var init_packageMetadata2 = __esm(() => {
38902
38936
  /*! @azure/msal-node v3.8.4 2025-12-04 */
38903
38937
  });
@@ -39122,7 +39156,7 @@ Headers: ${JSON.stringify(headers)}`
39122
39156
  };
39123
39157
  this.proxyUrl = proxyUrl || "";
39124
39158
  this.customAgentOptions = customAgentOptions || {};
39125
- this.logger = new Logger(loggerOptions || {}, name2, version3);
39159
+ this.logger = new Logger(loggerOptions || {}, name2, version4);
39126
39160
  this.isPiiEnabled = this.logger.isPiiLoggingEnabled();
39127
39161
  }
39128
39162
  async sendGetRequestAsync(url2, options, timeout) {
@@ -39330,7 +39364,7 @@ var init_NodeAuthError = __esm(() => {
39330
39364
  // node_modules/@azure/msal-node/dist/config/Configuration.mjs
39331
39365
  function buildAppConfiguration({ auth, broker, cache, system, telemetry }) {
39332
39366
  const systemOptions = {
39333
- ...DEFAULT_SYSTEM_OPTIONS2,
39367
+ ...DEFAULT_SYSTEM_OPTIONS3,
39334
39368
  networkClient: new HttpClient(system?.proxyUrl, system?.customAgentOptions),
39335
39369
  loggerOptions: system?.loggerOptions || DEFAULT_LOGGER_OPTIONS,
39336
39370
  disableInternalRetries: system?.disableInternalRetries || false
@@ -39365,7 +39399,7 @@ function buildManagedIdentityConfiguration({ clientCapabilities, managedIdentity
39365
39399
  disableInternalRetries: system?.disableInternalRetries || false
39366
39400
  };
39367
39401
  }
39368
- var DEFAULT_AUTH_OPTIONS, DEFAULT_CACHE_OPTIONS2, DEFAULT_LOGGER_OPTIONS, DEFAULT_SYSTEM_OPTIONS2, DEFAULT_TELEMETRY_OPTIONS2;
39402
+ var DEFAULT_AUTH_OPTIONS, DEFAULT_CACHE_OPTIONS2, DEFAULT_LOGGER_OPTIONS, DEFAULT_SYSTEM_OPTIONS3, DEFAULT_TELEMETRY_OPTIONS2;
39369
39403
  var init_Configuration = __esm(() => {
39370
39404
  init_index_node();
39371
39405
  init_HttpClient();
@@ -39403,7 +39437,7 @@ var init_Configuration = __esm(() => {
39403
39437
  piiLoggingEnabled: false,
39404
39438
  logLevel: LogLevel.Info
39405
39439
  };
39406
- DEFAULT_SYSTEM_OPTIONS2 = {
39440
+ DEFAULT_SYSTEM_OPTIONS3 = {
39407
39441
  loggerOptions: DEFAULT_LOGGER_OPTIONS,
39408
39442
  networkClient: new HttpClient,
39409
39443
  proxyUrl: Constants.EMPTY_STRING,
@@ -39620,7 +39654,7 @@ var require_v35 = __commonJS((exports) => {
39620
39654
  exports.DNS = DNS;
39621
39655
  var URL2 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
39622
39656
  exports.URL = URL2;
39623
- function _default3(name3, version4, hashfunc) {
39657
+ function _default3(name3, version5, hashfunc) {
39624
39658
  function generateUUID(value, namespace, buf, offset) {
39625
39659
  if (typeof value === "string") {
39626
39660
  value = stringToBytes(value);
@@ -39635,7 +39669,7 @@ var require_v35 = __commonJS((exports) => {
39635
39669
  bytes.set(namespace);
39636
39670
  bytes.set(value, namespace.length);
39637
39671
  bytes = hashfunc(bytes);
39638
- bytes[6] = bytes[6] & 15 | version4;
39672
+ bytes[6] = bytes[6] & 15 | version5;
39639
39673
  bytes[8] = bytes[8] & 63 | 128;
39640
39674
  if (buf) {
39641
39675
  offset = offset || 0;
@@ -39780,13 +39814,13 @@ var require_version = __commonJS((exports) => {
39780
39814
  function _interopRequireDefault(obj) {
39781
39815
  return obj && obj.__esModule ? obj : { default: obj };
39782
39816
  }
39783
- function version4(uuid5) {
39817
+ function version5(uuid5) {
39784
39818
  if (!(0, _validate.default)(uuid5)) {
39785
39819
  throw TypeError("Invalid UUID");
39786
39820
  }
39787
39821
  return parseInt(uuid5.substr(14, 1), 16);
39788
39822
  }
39789
- var _default3 = version4;
39823
+ var _default3 = version5;
39790
39824
  exports.default = _default3;
39791
39825
  });
39792
39826
 
@@ -39864,7 +39898,7 @@ var require_dist = __commonJS((exports) => {
39864
39898
  });
39865
39899
 
39866
39900
  // node_modules/uuid/wrapper.mjs
39867
- var import_dist, v1, v3, v4, v5, NIL, version4, validate2, stringify2, parse5;
39901
+ var import_dist, v1, v3, v4, v5, NIL, version5, validate2, stringify2, parse5;
39868
39902
  var init_wrapper = __esm(() => {
39869
39903
  import_dist = __toESM(require_dist(), 1);
39870
39904
  v1 = import_dist.default.v1;
@@ -39872,7 +39906,7 @@ var init_wrapper = __esm(() => {
39872
39906
  v4 = import_dist.default.v4;
39873
39907
  v5 = import_dist.default.v5;
39874
39908
  NIL = import_dist.default.NIL;
39875
- version4 = import_dist.default.version;
39909
+ version5 = import_dist.default.version;
39876
39910
  validate2 = import_dist.default.validate;
39877
39911
  stringify2 = import_dist.default.stringify;
39878
39912
  parse5 = import_dist.default.parse;
@@ -40915,12 +40949,12 @@ var require_jwa = __commonJS((exports, module) => {
40915
40949
  };
40916
40950
  }
40917
40951
  var bufferEqual;
40918
- var timingSafeEqual = "timingSafeEqual" in crypto4 ? function timingSafeEqual(a, b) {
40952
+ var timingSafeEqual = "timingSafeEqual" in crypto4 ? function timingSafeEqual2(a, b) {
40919
40953
  if (a.byteLength !== b.byteLength) {
40920
40954
  return false;
40921
40955
  }
40922
40956
  return crypto4.timingSafeEqual(a, b);
40923
- } : function timingSafeEqual(a, b) {
40957
+ } : function timingSafeEqual2(a, b) {
40924
40958
  if (!bufferEqual) {
40925
40959
  bufferEqual = require_buffer_equal_constant_time();
40926
40960
  }
@@ -41627,29 +41661,29 @@ var require_semver = __commonJS((exports, module) => {
41627
41661
  var { compareIdentifiers } = require_identifiers();
41628
41662
 
41629
41663
  class SemVer {
41630
- constructor(version5, options) {
41664
+ constructor(version7, options) {
41631
41665
  options = parseOptions(options);
41632
- if (version5 instanceof SemVer) {
41633
- if (version5.loose === !!options.loose && version5.includePrerelease === !!options.includePrerelease) {
41634
- return version5;
41666
+ if (version7 instanceof SemVer) {
41667
+ if (version7.loose === !!options.loose && version7.includePrerelease === !!options.includePrerelease) {
41668
+ return version7;
41635
41669
  } else {
41636
- version5 = version5.version;
41670
+ version7 = version7.version;
41637
41671
  }
41638
- } else if (typeof version5 !== "string") {
41639
- throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version5}".`);
41672
+ } else if (typeof version7 !== "string") {
41673
+ throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version7}".`);
41640
41674
  }
41641
- if (version5.length > MAX_LENGTH) {
41675
+ if (version7.length > MAX_LENGTH) {
41642
41676
  throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
41643
41677
  }
41644
- debug("SemVer", version5, options);
41678
+ debug("SemVer", version7, options);
41645
41679
  this.options = options;
41646
41680
  this.loose = !!options.loose;
41647
41681
  this.includePrerelease = !!options.includePrerelease;
41648
- const m = version5.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
41682
+ const m = version7.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
41649
41683
  if (!m) {
41650
- throw new TypeError(`Invalid Version: ${version5}`);
41684
+ throw new TypeError(`Invalid Version: ${version7}`);
41651
41685
  }
41652
- this.raw = version5;
41686
+ this.raw = version7;
41653
41687
  this.major = +m[1];
41654
41688
  this.minor = +m[2];
41655
41689
  this.patch = +m[3];
@@ -41890,12 +41924,12 @@ var require_semver = __commonJS((exports, module) => {
41890
41924
  // node_modules/semver/functions/parse.js
41891
41925
  var require_parse2 = __commonJS((exports, module) => {
41892
41926
  var SemVer = require_semver();
41893
- var parse6 = (version5, options, throwErrors = false) => {
41894
- if (version5 instanceof SemVer) {
41895
- return version5;
41927
+ var parse6 = (version7, options, throwErrors = false) => {
41928
+ if (version7 instanceof SemVer) {
41929
+ return version7;
41896
41930
  }
41897
41931
  try {
41898
- return new SemVer(version5, options);
41932
+ return new SemVer(version7, options);
41899
41933
  } catch (er) {
41900
41934
  if (!throwErrors) {
41901
41935
  return null;
@@ -41909,8 +41943,8 @@ var require_parse2 = __commonJS((exports, module) => {
41909
41943
  // node_modules/semver/functions/valid.js
41910
41944
  var require_valid = __commonJS((exports, module) => {
41911
41945
  var parse6 = require_parse2();
41912
- var valid = (version5, options) => {
41913
- const v = parse6(version5, options);
41946
+ var valid = (version7, options) => {
41947
+ const v = parse6(version7, options);
41914
41948
  return v ? v.version : null;
41915
41949
  };
41916
41950
  module.exports = valid;
@@ -41919,8 +41953,8 @@ var require_valid = __commonJS((exports, module) => {
41919
41953
  // node_modules/semver/functions/clean.js
41920
41954
  var require_clean = __commonJS((exports, module) => {
41921
41955
  var parse6 = require_parse2();
41922
- var clean = (version5, options) => {
41923
- const s = parse6(version5.trim().replace(/^[=v]+/, ""), options);
41956
+ var clean = (version7, options) => {
41957
+ const s = parse6(version7.trim().replace(/^[=v]+/, ""), options);
41924
41958
  return s ? s.version : null;
41925
41959
  };
41926
41960
  module.exports = clean;
@@ -41929,14 +41963,14 @@ var require_clean = __commonJS((exports, module) => {
41929
41963
  // node_modules/semver/functions/inc.js
41930
41964
  var require_inc = __commonJS((exports, module) => {
41931
41965
  var SemVer = require_semver();
41932
- var inc = (version5, release, options, identifier, identifierBase) => {
41966
+ var inc = (version7, release, options, identifier, identifierBase) => {
41933
41967
  if (typeof options === "string") {
41934
41968
  identifierBase = identifier;
41935
41969
  identifier = options;
41936
41970
  options = undefined;
41937
41971
  }
41938
41972
  try {
41939
- return new SemVer(version5 instanceof SemVer ? version5.version : version5, options).inc(release, identifier, identifierBase).version;
41973
+ return new SemVer(version7 instanceof SemVer ? version7.version : version7, options).inc(release, identifier, identifierBase).version;
41940
41974
  } catch (er) {
41941
41975
  return null;
41942
41976
  }
@@ -42009,8 +42043,8 @@ var require_patch = __commonJS((exports, module) => {
42009
42043
  // node_modules/semver/functions/prerelease.js
42010
42044
  var require_prerelease = __commonJS((exports, module) => {
42011
42045
  var parse6 = require_parse2();
42012
- var prerelease = (version5, options) => {
42013
- const parsed = parse6(version5, options);
42046
+ var prerelease = (version7, options) => {
42047
+ const parsed = parse6(version7, options);
42014
42048
  return parsed && parsed.prerelease.length ? parsed.prerelease : null;
42015
42049
  };
42016
42050
  module.exports = prerelease;
@@ -42156,24 +42190,24 @@ var require_coerce = __commonJS((exports, module) => {
42156
42190
  var SemVer = require_semver();
42157
42191
  var parse6 = require_parse2();
42158
42192
  var { safeRe: re, t } = require_re();
42159
- var coerce = (version5, options) => {
42160
- if (version5 instanceof SemVer) {
42161
- return version5;
42193
+ var coerce = (version7, options) => {
42194
+ if (version7 instanceof SemVer) {
42195
+ return version7;
42162
42196
  }
42163
- if (typeof version5 === "number") {
42164
- version5 = String(version5);
42197
+ if (typeof version7 === "number") {
42198
+ version7 = String(version7);
42165
42199
  }
42166
- if (typeof version5 !== "string") {
42200
+ if (typeof version7 !== "string") {
42167
42201
  return null;
42168
42202
  }
42169
42203
  options = options || {};
42170
42204
  let match2 = null;
42171
42205
  if (!options.rtl) {
42172
- match2 = version5.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
42206
+ match2 = version7.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
42173
42207
  } else {
42174
42208
  const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
42175
42209
  let next;
42176
- while ((next = coerceRtlRegex.exec(version5)) && (!match2 || match2.index + match2[0].length !== version5.length)) {
42210
+ while ((next = coerceRtlRegex.exec(version7)) && (!match2 || match2.index + match2[0].length !== version7.length)) {
42177
42211
  if (!match2 || next.index + next[0].length !== match2.index + match2[0].length) {
42178
42212
  match2 = next;
42179
42213
  }
@@ -42351,19 +42385,19 @@ var require_range = __commonJS((exports, module) => {
42351
42385
  });
42352
42386
  });
42353
42387
  }
42354
- test(version5) {
42355
- if (!version5) {
42388
+ test(version7) {
42389
+ if (!version7) {
42356
42390
  return false;
42357
42391
  }
42358
- if (typeof version5 === "string") {
42392
+ if (typeof version7 === "string") {
42359
42393
  try {
42360
- version5 = new SemVer(version5, this.options);
42394
+ version7 = new SemVer(version7, this.options);
42361
42395
  } catch (er) {
42362
42396
  return false;
42363
42397
  }
42364
42398
  }
42365
42399
  for (let i = 0;i < this.set.length; i++) {
42366
- if (testSet(this.set[i], version5, this.options)) {
42400
+ if (testSet(this.set[i], version7, this.options)) {
42367
42401
  return true;
42368
42402
  }
42369
42403
  }
@@ -42578,13 +42612,13 @@ var require_range = __commonJS((exports, module) => {
42578
42612
  }
42579
42613
  return `${from} ${to}`.trim();
42580
42614
  };
42581
- var testSet = (set2, version5, options) => {
42615
+ var testSet = (set2, version7, options) => {
42582
42616
  for (let i = 0;i < set2.length; i++) {
42583
- if (!set2[i].test(version5)) {
42617
+ if (!set2[i].test(version7)) {
42584
42618
  return false;
42585
42619
  }
42586
42620
  }
42587
- if (version5.prerelease.length && !options.includePrerelease) {
42621
+ if (version7.prerelease.length && !options.includePrerelease) {
42588
42622
  for (let i = 0;i < set2.length; i++) {
42589
42623
  debug(set2[i].semver);
42590
42624
  if (set2[i].semver === Comparator.ANY) {
@@ -42592,7 +42626,7 @@ var require_range = __commonJS((exports, module) => {
42592
42626
  }
42593
42627
  if (set2[i].semver.prerelease.length > 0) {
42594
42628
  const allowed = set2[i].semver;
42595
- if (allowed.major === version5.major && allowed.minor === version5.minor && allowed.patch === version5.patch) {
42629
+ if (allowed.major === version7.major && allowed.minor === version7.minor && allowed.patch === version7.patch) {
42596
42630
  return true;
42597
42631
  }
42598
42632
  }
@@ -42651,19 +42685,19 @@ var require_comparator = __commonJS((exports, module) => {
42651
42685
  toString() {
42652
42686
  return this.value;
42653
42687
  }
42654
- test(version5) {
42655
- debug("Comparator.test", version5, this.options.loose);
42656
- if (this.semver === ANY || version5 === ANY) {
42688
+ test(version7) {
42689
+ debug("Comparator.test", version7, this.options.loose);
42690
+ if (this.semver === ANY || version7 === ANY) {
42657
42691
  return true;
42658
42692
  }
42659
- if (typeof version5 === "string") {
42693
+ if (typeof version7 === "string") {
42660
42694
  try {
42661
- version5 = new SemVer(version5, this.options);
42695
+ version7 = new SemVer(version7, this.options);
42662
42696
  } catch (er) {
42663
42697
  return false;
42664
42698
  }
42665
42699
  }
42666
- return cmp(version5, this.operator, this.semver, this.options);
42700
+ return cmp(version7, this.operator, this.semver, this.options);
42667
42701
  }
42668
42702
  intersects(comp, options) {
42669
42703
  if (!(comp instanceof Comparator)) {
@@ -42717,13 +42751,13 @@ var require_comparator = __commonJS((exports, module) => {
42717
42751
  // node_modules/semver/functions/satisfies.js
42718
42752
  var require_satisfies = __commonJS((exports, module) => {
42719
42753
  var Range = require_range();
42720
- var satisfies = (version5, range, options) => {
42754
+ var satisfies = (version7, range, options) => {
42721
42755
  try {
42722
42756
  range = new Range(range, options);
42723
42757
  } catch (er) {
42724
42758
  return false;
42725
42759
  }
42726
- return range.test(version5);
42760
+ return range.test(version7);
42727
42761
  };
42728
42762
  module.exports = satisfies;
42729
42763
  });
@@ -42865,8 +42899,8 @@ var require_outside = __commonJS((exports, module) => {
42865
42899
  var lt = require_lt();
42866
42900
  var lte = require_lte();
42867
42901
  var gte = require_gte();
42868
- var outside = (version5, range, hilo, options) => {
42869
- version5 = new SemVer(version5, options);
42902
+ var outside = (version7, range, hilo, options) => {
42903
+ version7 = new SemVer(version7, options);
42870
42904
  range = new Range(range, options);
42871
42905
  let gtfn, ltefn, ltfn, comp, ecomp;
42872
42906
  switch (hilo) {
@@ -42887,7 +42921,7 @@ var require_outside = __commonJS((exports, module) => {
42887
42921
  default:
42888
42922
  throw new TypeError('Must provide a hilo val of "<" or ">"');
42889
42923
  }
42890
- if (satisfies(version5, range, options)) {
42924
+ if (satisfies(version7, range, options)) {
42891
42925
  return false;
42892
42926
  }
42893
42927
  for (let i = 0;i < range.set.length; ++i) {
@@ -42909,9 +42943,9 @@ var require_outside = __commonJS((exports, module) => {
42909
42943
  if (high.operator === comp || high.operator === ecomp) {
42910
42944
  return false;
42911
42945
  }
42912
- if ((!low.operator || low.operator === comp) && ltefn(version5, low.semver)) {
42946
+ if ((!low.operator || low.operator === comp) && ltefn(version7, low.semver)) {
42913
42947
  return false;
42914
- } else if (low.operator === ecomp && ltfn(version5, low.semver)) {
42948
+ } else if (low.operator === ecomp && ltfn(version7, low.semver)) {
42915
42949
  return false;
42916
42950
  }
42917
42951
  }
@@ -42923,14 +42957,14 @@ var require_outside = __commonJS((exports, module) => {
42923
42957
  // node_modules/semver/ranges/gtr.js
42924
42958
  var require_gtr = __commonJS((exports, module) => {
42925
42959
  var outside = require_outside();
42926
- var gtr = (version5, range, options) => outside(version5, range, ">", options);
42960
+ var gtr = (version7, range, options) => outside(version7, range, ">", options);
42927
42961
  module.exports = gtr;
42928
42962
  });
42929
42963
 
42930
42964
  // node_modules/semver/ranges/ltr.js
42931
42965
  var require_ltr = __commonJS((exports, module) => {
42932
42966
  var outside = require_outside();
42933
- var ltr = (version5, range, options) => outside(version5, range, "<", options);
42967
+ var ltr = (version7, range, options) => outside(version7, range, "<", options);
42934
42968
  module.exports = ltr;
42935
42969
  });
42936
42970
 
@@ -42954,12 +42988,12 @@ var require_simplify = __commonJS((exports, module) => {
42954
42988
  let first = null;
42955
42989
  let prev = null;
42956
42990
  const v = versions2.sort((a, b) => compare(a, b, options));
42957
- for (const version5 of v) {
42958
- const included = satisfies(version5, range, options);
42991
+ for (const version7 of v) {
42992
+ const included = satisfies(version7, range, options);
42959
42993
  if (included) {
42960
- prev = version5;
42994
+ prev = version7;
42961
42995
  if (!first) {
42962
- first = version5;
42996
+ first = version7;
42963
42997
  }
42964
42998
  } else {
42965
42999
  if (prev) {
@@ -44344,7 +44378,7 @@ function getAuthCodeRequestUrl(config3, authority, request, logger4) {
44344
44378
  }, request, logger4);
44345
44379
  exports_RequestParameterBuilder.addLibraryInfo(parameters, {
44346
44380
  sku: Constants2.MSAL_SKU,
44347
- version: version3,
44381
+ version: version4,
44348
44382
  cpu: process.arch || "",
44349
44383
  os: process.platform || ""
44350
44384
  });
@@ -44370,7 +44404,7 @@ class ClientApplication {
44370
44404
  constructor(configuration) {
44371
44405
  this.config = buildAppConfiguration(configuration);
44372
44406
  this.cryptoProvider = new CryptoProvider;
44373
- this.logger = new Logger(this.config.system.loggerOptions, name2, version3);
44407
+ this.logger = new Logger(this.config.system.loggerOptions, name2, version4);
44374
44408
  this.storage = new NodeStorage(this.logger, this.config.auth.clientId, this.cryptoProvider, buildStaticAuthorityOptions(this.config.auth));
44375
44409
  this.tokenCache = new TokenCache(this.storage, this.logger, this.config.cache.cachePlugin);
44376
44410
  }
@@ -44549,7 +44583,7 @@ class ClientApplication {
44549
44583
  },
44550
44584
  libraryInfo: {
44551
44585
  sku: Constants2.MSAL_SKU,
44552
- version: version3,
44586
+ version: version4,
44553
44587
  cpu: process.arch || Constants.EMPTY_STRING,
44554
44588
  os: process.platform || Constants.EMPTY_STRING
44555
44589
  },
@@ -44863,7 +44897,7 @@ var init_PublicClientApplication = __esm(() => {
44863
44897
  }
44864
44898
  this.skus = ServerTelemetryManager.makeExtraSkuString({
44865
44899
  libraryName: Constants2.MSAL_SKU,
44866
- libraryVersion: version3
44900
+ libraryVersion: version4
44867
44901
  });
44868
44902
  }
44869
44903
  async acquireTokenByDeviceCode(request) {
@@ -46149,7 +46183,7 @@ var init_ManagedIdentityClient = __esm(() => {
46149
46183
  class ManagedIdentityApplication {
46150
46184
  constructor(configuration) {
46151
46185
  this.config = buildManagedIdentityConfiguration(configuration || {});
46152
- this.logger = new Logger(this.config.system.loggerOptions, name2, version3);
46186
+ this.logger = new Logger(this.config.system.loggerOptions, name2, version4);
46153
46187
  const fakeStatusAuthorityOptions = {
46154
46188
  canonicalAuthority: Constants.DEFAULT_AUTHORITY
46155
46189
  };
@@ -46268,7 +46302,7 @@ var init_DistributedCachePlugin = __esm(() => {
46268
46302
  // node_modules/@azure/msal-node/dist/index.mjs
46269
46303
  var exports_dist = {};
46270
46304
  __export(exports_dist, {
46271
- version: () => version3,
46305
+ version: () => version4,
46272
46306
  internals: () => exports_internals,
46273
46307
  UsernamePasswordClient: () => UsernamePasswordClient,
46274
46308
  TokenCacheContext: () => TokenCacheContext,
@@ -46770,104 +46804,6 @@ var init_utils4 = __esm(() => {
46770
46804
  logger4 = credentialLogger("IdentityUtils");
46771
46805
  });
46772
46806
 
46773
- // node_modules/@azure/core-client/dist/esm/interfaces.js
46774
- var XML_ATTRKEY = "$", XML_CHARKEY = "_";
46775
-
46776
- // node_modules/@azure/core-client/dist/esm/utils.js
46777
- function isPrimitiveBody(value, mapperTypeName) {
46778
- return mapperTypeName !== "Composite" && mapperTypeName !== "Dictionary" && (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || mapperTypeName?.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i) !== null || value === undefined || value === null);
46779
- }
46780
- function handleNullableResponseAndWrappableBody(responseObject) {
46781
- const combinedHeadersAndBody = {
46782
- ...responseObject.headers,
46783
- ...responseObject.body
46784
- };
46785
- if (responseObject.hasNullableType && Object.getOwnPropertyNames(combinedHeadersAndBody).length === 0) {
46786
- return responseObject.shouldWrapBody ? { body: null } : null;
46787
- } else {
46788
- return responseObject.shouldWrapBody ? {
46789
- ...responseObject.headers,
46790
- body: responseObject.body
46791
- } : combinedHeadersAndBody;
46792
- }
46793
- }
46794
- function flattenResponse(fullResponse, responseSpec) {
46795
- const parsedHeaders = fullResponse.parsedHeaders;
46796
- if (fullResponse.request.method === "HEAD") {
46797
- return {
46798
- ...parsedHeaders,
46799
- body: fullResponse.parsedBody
46800
- };
46801
- }
46802
- const bodyMapper = responseSpec && responseSpec.bodyMapper;
46803
- const isNullable = Boolean(bodyMapper?.nullable);
46804
- const expectedBodyTypeName = bodyMapper?.type.name;
46805
- if (expectedBodyTypeName === "Stream") {
46806
- return {
46807
- ...parsedHeaders,
46808
- blobBody: fullResponse.blobBody,
46809
- readableStreamBody: fullResponse.readableStreamBody
46810
- };
46811
- }
46812
- const modelProperties = expectedBodyTypeName === "Composite" && bodyMapper.type.modelProperties || {};
46813
- const isPageableResponse = Object.keys(modelProperties).some((k) => modelProperties[k].serializedName === "");
46814
- if (expectedBodyTypeName === "Sequence" || isPageableResponse) {
46815
- const arrayResponse = fullResponse.parsedBody ?? [];
46816
- for (const key of Object.keys(modelProperties)) {
46817
- if (modelProperties[key].serializedName) {
46818
- arrayResponse[key] = fullResponse.parsedBody?.[key];
46819
- }
46820
- }
46821
- if (parsedHeaders) {
46822
- for (const key of Object.keys(parsedHeaders)) {
46823
- arrayResponse[key] = parsedHeaders[key];
46824
- }
46825
- }
46826
- return isNullable && !fullResponse.parsedBody && !parsedHeaders && Object.getOwnPropertyNames(modelProperties).length === 0 ? null : arrayResponse;
46827
- }
46828
- return handleNullableResponseAndWrappableBody({
46829
- body: fullResponse.parsedBody,
46830
- headers: parsedHeaders,
46831
- hasNullableType: isNullable,
46832
- shouldWrapBody: isPrimitiveBody(fullResponse.parsedBody, expectedBodyTypeName)
46833
- });
46834
- }
46835
- var init_utils5 = () => {};
46836
-
46837
- // node_modules/@azure/core-client/dist/esm/serializer.js
46838
- var MapperTypeNames;
46839
- var init_serializer = __esm(() => {
46840
- MapperTypeNames = {
46841
- Base64Url: "Base64Url",
46842
- Boolean: "Boolean",
46843
- ByteArray: "ByteArray",
46844
- Composite: "Composite",
46845
- Date: "Date",
46846
- DateTime: "DateTime",
46847
- DateTimeRfc1123: "DateTimeRfc1123",
46848
- Dictionary: "Dictionary",
46849
- Enum: "Enum",
46850
- Number: "Number",
46851
- Object: "Object",
46852
- Sequence: "Sequence",
46853
- String: "String",
46854
- Stream: "Stream",
46855
- TimeSpan: "TimeSpan",
46856
- UnixTime: "UnixTime"
46857
- };
46858
- });
46859
-
46860
- // node_modules/@typespec/ts-http-runtime/dist/esm/abort-controller/AbortError.js
46861
- var AbortError2;
46862
- var init_AbortError2 = __esm(() => {
46863
- AbortError2 = class AbortError2 extends Error {
46864
- constructor(message2) {
46865
- super(message2);
46866
- this.name = "AbortError";
46867
- }
46868
- };
46869
- });
46870
-
46871
46807
  // node_modules/@typespec/ts-http-runtime/dist/esm/httpHeaders.js
46872
46808
  function normalizeName(name3) {
46873
46809
  return name3.toLowerCase();
@@ -47221,6 +47157,17 @@ var init_restError = __esm(() => {
47221
47157
  };
47222
47158
  });
47223
47159
 
47160
+ // node_modules/@typespec/ts-http-runtime/dist/esm/abort-controller/AbortError.js
47161
+ var AbortError2;
47162
+ var init_AbortError2 = __esm(() => {
47163
+ AbortError2 = class AbortError2 extends Error {
47164
+ constructor(message2) {
47165
+ super(message2);
47166
+ this.name = "AbortError";
47167
+ }
47168
+ };
47169
+ });
47170
+
47224
47171
  // node_modules/@typespec/ts-http-runtime/dist/esm/log.js
47225
47172
  var logger5;
47226
47173
  var init_log3 = __esm(() => {
@@ -47532,68 +47479,45 @@ var init_defaultHttpClient = __esm(() => {
47532
47479
  init_nodeHttpClient();
47533
47480
  });
47534
47481
 
47535
- // node_modules/@typespec/ts-http-runtime/dist/esm/policies/logPolicy.js
47536
- function logPolicy(options = {}) {
47537
- const logger6 = options.logger ?? logger5.info;
47538
- const sanitizer = new Sanitizer({
47539
- additionalAllowedHeaderNames: options.additionalAllowedHeaderNames,
47540
- additionalAllowedQueryParameters: options.additionalAllowedQueryParameters
47541
- });
47542
- return {
47543
- name: logPolicyName,
47544
- async sendRequest(request, next) {
47545
- if (!logger6.enabled) {
47546
- return next(request);
47547
- }
47548
- logger6(`Request: ${sanitizer.sanitize(request)}`);
47549
- const response = await next(request);
47550
- logger6(`Response status code: ${response.status}`);
47551
- logger6(`Headers: ${sanitizer.sanitize(response.headers)}`);
47552
- return response;
47553
- }
47554
- };
47482
+ // node_modules/@typespec/ts-http-runtime/dist/esm/index.js
47483
+ var init_esm5 = __esm(() => {
47484
+ init_httpHeaders();
47485
+ init_pipelineRequest();
47486
+ init_pipeline();
47487
+ init_restError();
47488
+ init_defaultHttpClient();
47489
+ init_schemes();
47490
+ init_oauth2Flows();
47491
+ });
47492
+
47493
+ // node_modules/@azure/core-rest-pipeline/dist/esm/pipeline.js
47494
+ function createEmptyPipeline2() {
47495
+ return createEmptyPipeline();
47555
47496
  }
47556
- var logPolicyName = "logPolicy";
47557
- var init_logPolicy = __esm(() => {
47558
- init_log3();
47559
- init_sanitizer();
47497
+ var init_pipeline2 = __esm(() => {
47498
+ init_esm5();
47560
47499
  });
47561
47500
 
47562
- // node_modules/@typespec/ts-http-runtime/dist/esm/policies/redirectPolicy.js
47563
- function redirectPolicy(options = {}) {
47564
- const { maxRetries = 20 } = options;
47501
+ // node_modules/@azure/core-rest-pipeline/dist/esm/log.js
47502
+ var logger6;
47503
+ var init_log4 = __esm(() => {
47504
+ init_esm();
47505
+ logger6 = createClientLogger2("core-rest-pipeline");
47506
+ });
47507
+
47508
+ // node_modules/@typespec/ts-http-runtime/dist/esm/policies/agentPolicy.js
47509
+ function agentPolicy(agent) {
47565
47510
  return {
47566
- name: redirectPolicyName,
47567
- async sendRequest(request, next) {
47568
- const response = await next(request);
47569
- return handleRedirect(next, response, maxRetries);
47511
+ name: agentPolicyName,
47512
+ sendRequest: async (req, next) => {
47513
+ if (!req.agent) {
47514
+ req.agent = agent;
47515
+ }
47516
+ return next(req);
47570
47517
  }
47571
47518
  };
47572
47519
  }
47573
- async function handleRedirect(next, response, maxRetries, currentRetries = 0) {
47574
- const { request, status, headers } = response;
47575
- const locationHeader = headers.get("location");
47576
- if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) {
47577
- const url2 = new URL(locationHeader, request.url);
47578
- request.url = url2.toString();
47579
- if (status === 303) {
47580
- request.method = "GET";
47581
- request.headers.delete("Content-Length");
47582
- delete request.body;
47583
- }
47584
- request.headers.delete("Authorization");
47585
- const res = await next(request);
47586
- return handleRedirect(next, res, maxRetries, currentRetries + 1);
47587
- }
47588
- return response;
47589
- }
47590
- var redirectPolicyName = "redirectPolicy", allowedRedirect;
47591
- var init_redirectPolicy = __esm(() => {
47592
- allowedRedirect = ["GET", "HEAD"];
47593
- });
47594
-
47595
- // node_modules/@typespec/ts-http-runtime/dist/esm/constants.js
47596
- var DEFAULT_RETRY_POLICY_COUNT = 3;
47520
+ var agentPolicyName = "agentPolicy";
47597
47521
 
47598
47522
  // node_modules/@typespec/ts-http-runtime/dist/esm/policies/decompressResponsePolicy.js
47599
47523
  function decompressResponsePolicy() {
@@ -47741,9 +47665,12 @@ var init_exponentialRetryStrategy = __esm(() => {
47741
47665
  DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1000 * 64;
47742
47666
  });
47743
47667
 
47668
+ // node_modules/@typespec/ts-http-runtime/dist/esm/constants.js
47669
+ var DEFAULT_RETRY_POLICY_COUNT = 3;
47670
+
47744
47671
  // node_modules/@typespec/ts-http-runtime/dist/esm/policies/retryPolicy.js
47745
47672
  function retryPolicy(strategies, options = { maxRetries: DEFAULT_RETRY_POLICY_COUNT }) {
47746
- const logger6 = options.logger || retryPolicyLogger;
47673
+ const logger7 = options.logger || retryPolicyLogger;
47747
47674
  return {
47748
47675
  name: retryPolicyName,
47749
47676
  async sendRequest(request, next) {
@@ -47756,11 +47683,11 @@ function retryPolicy(strategies, options = { maxRetries: DEFAULT_RETRY_POLICY_CO
47756
47683
  response = undefined;
47757
47684
  responseError = undefined;
47758
47685
  try {
47759
- logger6.info(`Retry ${retryCount}: Attempting to send request`, request.requestId);
47686
+ logger7.info(`Retry ${retryCount}: Attempting to send request`, request.requestId);
47760
47687
  response = await next(request);
47761
- logger6.info(`Retry ${retryCount}: Received a response from request`, request.requestId);
47688
+ logger7.info(`Retry ${retryCount}: Received a response from request`, request.requestId);
47762
47689
  } catch (e) {
47763
- logger6.error(`Retry ${retryCount}: Received an error from request`, request.requestId);
47690
+ logger7.error(`Retry ${retryCount}: Received an error from request`, request.requestId);
47764
47691
  responseError = e;
47765
47692
  if (!e || responseError.name !== "RestError") {
47766
47693
  throw e;
@@ -47768,12 +47695,12 @@ function retryPolicy(strategies, options = { maxRetries: DEFAULT_RETRY_POLICY_CO
47768
47695
  response = responseError.response;
47769
47696
  }
47770
47697
  if (request.abortSignal?.aborted) {
47771
- logger6.error(`Retry ${retryCount}: Request aborted.`);
47698
+ logger7.error(`Retry ${retryCount}: Request aborted.`);
47772
47699
  const abortError = new AbortError2;
47773
47700
  throw abortError;
47774
47701
  }
47775
47702
  if (retryCount >= (options.maxRetries ?? DEFAULT_RETRY_POLICY_COUNT)) {
47776
- logger6.info(`Retry ${retryCount}: Maximum retries reached. Returning the last received response, or throwing the last received error.`);
47703
+ logger7.info(`Retry ${retryCount}: Maximum retries reached. Returning the last received response, or throwing the last received error.`);
47777
47704
  if (responseError) {
47778
47705
  throw responseError;
47779
47706
  } else if (response) {
@@ -47782,10 +47709,10 @@ function retryPolicy(strategies, options = { maxRetries: DEFAULT_RETRY_POLICY_CO
47782
47709
  throw new Error("Maximum retries reached with no response or error to throw");
47783
47710
  }
47784
47711
  }
47785
- logger6.info(`Retry ${retryCount}: Processing ${strategies.length} retry strategies.`);
47712
+ logger7.info(`Retry ${retryCount}: Processing ${strategies.length} retry strategies.`);
47786
47713
  strategiesLoop:
47787
47714
  for (const strategy of strategies) {
47788
- const strategyLogger = strategy.logger || logger6;
47715
+ const strategyLogger = strategy.logger || logger7;
47789
47716
  strategyLogger.info(`Retry ${retryCount}: Processing retry strategy ${strategy.name}.`);
47790
47717
  const modifiers = strategy.retry({
47791
47718
  retryCount,
@@ -47813,11 +47740,11 @@ function retryPolicy(strategies, options = { maxRetries: DEFAULT_RETRY_POLICY_CO
47813
47740
  }
47814
47741
  }
47815
47742
  if (responseError) {
47816
- logger6.info(`None of the retry strategies could work with the received error. Throwing it.`);
47743
+ logger7.info(`None of the retry strategies could work with the received error. Throwing it.`);
47817
47744
  throw responseError;
47818
47745
  }
47819
47746
  if (response) {
47820
- logger6.info(`None of the retry strategies could work with the received response. Returning it.`);
47747
+ logger7.info(`None of the retry strategies could work with the received response. Returning it.`);
47821
47748
  return response;
47822
47749
  }
47823
47750
  }
@@ -47929,6 +47856,196 @@ var init_formDataPolicy = __esm(() => {
47929
47856
  init_httpHeaders();
47930
47857
  });
47931
47858
 
47859
+ // node_modules/@typespec/ts-http-runtime/dist/esm/policies/logPolicy.js
47860
+ function logPolicy(options = {}) {
47861
+ const logger7 = options.logger ?? logger5.info;
47862
+ const sanitizer = new Sanitizer({
47863
+ additionalAllowedHeaderNames: options.additionalAllowedHeaderNames,
47864
+ additionalAllowedQueryParameters: options.additionalAllowedQueryParameters
47865
+ });
47866
+ return {
47867
+ name: logPolicyName,
47868
+ async sendRequest(request, next) {
47869
+ if (!logger7.enabled) {
47870
+ return next(request);
47871
+ }
47872
+ logger7(`Request: ${sanitizer.sanitize(request)}`);
47873
+ const response = await next(request);
47874
+ logger7(`Response status code: ${response.status}`);
47875
+ logger7(`Headers: ${sanitizer.sanitize(response.headers)}`);
47876
+ return response;
47877
+ }
47878
+ };
47879
+ }
47880
+ var logPolicyName = "logPolicy";
47881
+ var init_logPolicy = __esm(() => {
47882
+ init_log3();
47883
+ init_sanitizer();
47884
+ });
47885
+
47886
+ // node_modules/@typespec/ts-http-runtime/dist/esm/util/typeGuards.js
47887
+ function isBlob(x) {
47888
+ return typeof x.stream === "function";
47889
+ }
47890
+
47891
+ // node_modules/@typespec/ts-http-runtime/dist/esm/util/concat.js
47892
+ import { Readable } from "stream";
47893
+ async function* streamAsyncIterator() {
47894
+ const reader = this.getReader();
47895
+ try {
47896
+ while (true) {
47897
+ const { done, value } = await reader.read();
47898
+ if (done) {
47899
+ return;
47900
+ }
47901
+ yield value;
47902
+ }
47903
+ } finally {
47904
+ reader.releaseLock();
47905
+ }
47906
+ }
47907
+ function makeAsyncIterable(webStream) {
47908
+ if (!webStream[Symbol.asyncIterator]) {
47909
+ webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream);
47910
+ }
47911
+ if (!webStream.values) {
47912
+ webStream.values = streamAsyncIterator.bind(webStream);
47913
+ }
47914
+ }
47915
+ function ensureNodeStream(stream2) {
47916
+ if (stream2 instanceof ReadableStream) {
47917
+ makeAsyncIterable(stream2);
47918
+ return Readable.fromWeb(stream2);
47919
+ } else {
47920
+ return stream2;
47921
+ }
47922
+ }
47923
+ function toStream(source) {
47924
+ if (source instanceof Uint8Array) {
47925
+ return Readable.from(Buffer.from(source));
47926
+ } else if (isBlob(source)) {
47927
+ return ensureNodeStream(source.stream());
47928
+ } else {
47929
+ return ensureNodeStream(source);
47930
+ }
47931
+ }
47932
+ async function concat(sources) {
47933
+ return function() {
47934
+ const streams = sources.map((x) => typeof x === "function" ? x() : x).map(toStream);
47935
+ return Readable.from(async function* () {
47936
+ for (const stream2 of streams) {
47937
+ for await (const chunk of stream2) {
47938
+ yield chunk;
47939
+ }
47940
+ }
47941
+ }());
47942
+ };
47943
+ }
47944
+ var init_concat = () => {};
47945
+
47946
+ // node_modules/@typespec/ts-http-runtime/dist/esm/policies/multipartPolicy.js
47947
+ function generateBoundary() {
47948
+ return `----AzSDKFormBoundary${randomUUID()}`;
47949
+ }
47950
+ function encodeHeaders(headers) {
47951
+ let result = "";
47952
+ for (const [key, value] of headers) {
47953
+ result += `${key}: ${value}\r
47954
+ `;
47955
+ }
47956
+ return result;
47957
+ }
47958
+ function getLength(source) {
47959
+ if (source instanceof Uint8Array) {
47960
+ return source.byteLength;
47961
+ } else if (isBlob(source)) {
47962
+ return source.size === -1 ? undefined : source.size;
47963
+ } else {
47964
+ return;
47965
+ }
47966
+ }
47967
+ function getTotalLength(sources) {
47968
+ let total = 0;
47969
+ for (const source of sources) {
47970
+ const partLength = getLength(source);
47971
+ if (partLength === undefined) {
47972
+ return;
47973
+ } else {
47974
+ total += partLength;
47975
+ }
47976
+ }
47977
+ return total;
47978
+ }
47979
+ async function buildRequestBody(request, parts, boundary) {
47980
+ const sources = [
47981
+ stringToUint8Array(`--${boundary}`, "utf-8"),
47982
+ ...parts.flatMap((part) => [
47983
+ stringToUint8Array(`\r
47984
+ `, "utf-8"),
47985
+ stringToUint8Array(encodeHeaders(part.headers), "utf-8"),
47986
+ stringToUint8Array(`\r
47987
+ `, "utf-8"),
47988
+ part.body,
47989
+ stringToUint8Array(`\r
47990
+ --${boundary}`, "utf-8")
47991
+ ]),
47992
+ stringToUint8Array(`--\r
47993
+ \r
47994
+ `, "utf-8")
47995
+ ];
47996
+ const contentLength = getTotalLength(sources);
47997
+ if (contentLength) {
47998
+ request.headers.set("Content-Length", contentLength);
47999
+ }
48000
+ request.body = await concat(sources);
48001
+ }
48002
+ function assertValidBoundary(boundary) {
48003
+ if (boundary.length > maxBoundaryLength) {
48004
+ throw new Error(`Multipart boundary "${boundary}" exceeds maximum length of 70 characters`);
48005
+ }
48006
+ if (Array.from(boundary).some((x) => !validBoundaryCharacters.has(x))) {
48007
+ throw new Error(`Multipart boundary "${boundary}" contains invalid characters`);
48008
+ }
48009
+ }
48010
+ function multipartPolicy() {
48011
+ return {
48012
+ name: multipartPolicyName,
48013
+ async sendRequest(request, next) {
48014
+ if (!request.multipartBody) {
48015
+ return next(request);
48016
+ }
48017
+ if (request.body) {
48018
+ throw new Error("multipartBody and regular body cannot be set at the same time");
48019
+ }
48020
+ let boundary = request.multipartBody.boundary;
48021
+ const contentTypeHeader = request.headers.get("Content-Type") ?? "multipart/mixed";
48022
+ const parsedHeader = contentTypeHeader.match(/^(multipart\/[^ ;]+)(?:; *boundary=(.+))?$/);
48023
+ if (!parsedHeader) {
48024
+ throw new Error(`Got multipart request body, but content-type header was not multipart: ${contentTypeHeader}`);
48025
+ }
48026
+ const [, contentType, parsedBoundary] = parsedHeader;
48027
+ if (parsedBoundary && boundary && parsedBoundary !== boundary) {
48028
+ throw new Error(`Multipart boundary was specified as ${parsedBoundary} in the header, but got ${boundary} in the request body`);
48029
+ }
48030
+ boundary ??= parsedBoundary;
48031
+ if (boundary) {
48032
+ assertValidBoundary(boundary);
48033
+ } else {
48034
+ boundary = generateBoundary();
48035
+ }
48036
+ request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`);
48037
+ await buildRequestBody(request, request.multipartBody.parts, boundary);
48038
+ request.multipartBody = undefined;
48039
+ return next(request);
48040
+ }
48041
+ };
48042
+ }
48043
+ var multipartPolicyName = "multipartPolicy", maxBoundaryLength = 70, validBoundaryCharacters;
48044
+ var init_multipartPolicy = __esm(() => {
48045
+ init_concat();
48046
+ validBoundaryCharacters = new Set(`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?`);
48047
+ });
48048
+
47932
48049
  // node_modules/debug/src/common.js
47933
48050
  var require_common = __commonJS((exports, module) => {
47934
48051
  function setup(env2) {
@@ -48343,10 +48460,10 @@ var require_supports_color = __commonJS((exports, module) => {
48343
48460
  return 3;
48344
48461
  }
48345
48462
  if ("TERM_PROGRAM" in env2) {
48346
- const version5 = parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
48463
+ const version7 = parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
48347
48464
  switch (env2.TERM_PROGRAM) {
48348
48465
  case "iTerm.app":
48349
- return version5 >= 3 ? 3 : 2;
48466
+ return version7 >= 3 ? 3 : 2;
48350
48467
  case "Apple_Terminal":
48351
48468
  return 2;
48352
48469
  }
@@ -49277,19 +49394,38 @@ var init_proxyPolicy = __esm(() => {
49277
49394
  globalBypassedMap = new Map;
49278
49395
  });
49279
49396
 
49280
- // node_modules/@typespec/ts-http-runtime/dist/esm/policies/agentPolicy.js
49281
- function agentPolicy(agent) {
49397
+ // node_modules/@typespec/ts-http-runtime/dist/esm/policies/redirectPolicy.js
49398
+ function redirectPolicy(options = {}) {
49399
+ const { maxRetries = 20 } = options;
49282
49400
  return {
49283
- name: agentPolicyName,
49284
- sendRequest: async (req, next) => {
49285
- if (!req.agent) {
49286
- req.agent = agent;
49287
- }
49288
- return next(req);
49401
+ name: redirectPolicyName,
49402
+ async sendRequest(request, next) {
49403
+ const response = await next(request);
49404
+ return handleRedirect(next, response, maxRetries);
49289
49405
  }
49290
49406
  };
49291
49407
  }
49292
- var agentPolicyName = "agentPolicy";
49408
+ async function handleRedirect(next, response, maxRetries, currentRetries = 0) {
49409
+ const { request, status, headers } = response;
49410
+ const locationHeader = headers.get("location");
49411
+ if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) {
49412
+ const url2 = new URL(locationHeader, request.url);
49413
+ request.url = url2.toString();
49414
+ if (status === 303) {
49415
+ request.method = "GET";
49416
+ request.headers.delete("Content-Length");
49417
+ delete request.body;
49418
+ }
49419
+ request.headers.delete("Authorization");
49420
+ const res = await next(request);
49421
+ return handleRedirect(next, res, maxRetries, currentRetries + 1);
49422
+ }
49423
+ return response;
49424
+ }
49425
+ var redirectPolicyName = "redirectPolicy", allowedRedirect;
49426
+ var init_redirectPolicy = __esm(() => {
49427
+ allowedRedirect = ["GET", "HEAD"];
49428
+ });
49293
49429
 
49294
49430
  // node_modules/@typespec/ts-http-runtime/dist/esm/policies/tlsPolicy.js
49295
49431
  function tlsPolicy(tlsSettings) {
@@ -49305,195 +49441,6 @@ function tlsPolicy(tlsSettings) {
49305
49441
  }
49306
49442
  var tlsPolicyName = "tlsPolicy";
49307
49443
 
49308
- // node_modules/@typespec/ts-http-runtime/dist/esm/util/typeGuards.js
49309
- function isBlob(x) {
49310
- return typeof x.stream === "function";
49311
- }
49312
-
49313
- // node_modules/@typespec/ts-http-runtime/dist/esm/util/concat.js
49314
- import { Readable } from "stream";
49315
- async function* streamAsyncIterator() {
49316
- const reader = this.getReader();
49317
- try {
49318
- while (true) {
49319
- const { done, value } = await reader.read();
49320
- if (done) {
49321
- return;
49322
- }
49323
- yield value;
49324
- }
49325
- } finally {
49326
- reader.releaseLock();
49327
- }
49328
- }
49329
- function makeAsyncIterable(webStream) {
49330
- if (!webStream[Symbol.asyncIterator]) {
49331
- webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream);
49332
- }
49333
- if (!webStream.values) {
49334
- webStream.values = streamAsyncIterator.bind(webStream);
49335
- }
49336
- }
49337
- function ensureNodeStream(stream2) {
49338
- if (stream2 instanceof ReadableStream) {
49339
- makeAsyncIterable(stream2);
49340
- return Readable.fromWeb(stream2);
49341
- } else {
49342
- return stream2;
49343
- }
49344
- }
49345
- function toStream(source) {
49346
- if (source instanceof Uint8Array) {
49347
- return Readable.from(Buffer.from(source));
49348
- } else if (isBlob(source)) {
49349
- return ensureNodeStream(source.stream());
49350
- } else {
49351
- return ensureNodeStream(source);
49352
- }
49353
- }
49354
- async function concat(sources) {
49355
- return function() {
49356
- const streams = sources.map((x) => typeof x === "function" ? x() : x).map(toStream);
49357
- return Readable.from(async function* () {
49358
- for (const stream2 of streams) {
49359
- for await (const chunk of stream2) {
49360
- yield chunk;
49361
- }
49362
- }
49363
- }());
49364
- };
49365
- }
49366
- var init_concat = () => {};
49367
-
49368
- // node_modules/@typespec/ts-http-runtime/dist/esm/policies/multipartPolicy.js
49369
- function generateBoundary() {
49370
- return `----AzSDKFormBoundary${randomUUID()}`;
49371
- }
49372
- function encodeHeaders(headers) {
49373
- let result = "";
49374
- for (const [key, value] of headers) {
49375
- result += `${key}: ${value}\r
49376
- `;
49377
- }
49378
- return result;
49379
- }
49380
- function getLength(source) {
49381
- if (source instanceof Uint8Array) {
49382
- return source.byteLength;
49383
- } else if (isBlob(source)) {
49384
- return source.size === -1 ? undefined : source.size;
49385
- } else {
49386
- return;
49387
- }
49388
- }
49389
- function getTotalLength(sources) {
49390
- let total = 0;
49391
- for (const source of sources) {
49392
- const partLength = getLength(source);
49393
- if (partLength === undefined) {
49394
- return;
49395
- } else {
49396
- total += partLength;
49397
- }
49398
- }
49399
- return total;
49400
- }
49401
- async function buildRequestBody(request, parts, boundary) {
49402
- const sources = [
49403
- stringToUint8Array(`--${boundary}`, "utf-8"),
49404
- ...parts.flatMap((part) => [
49405
- stringToUint8Array(`\r
49406
- `, "utf-8"),
49407
- stringToUint8Array(encodeHeaders(part.headers), "utf-8"),
49408
- stringToUint8Array(`\r
49409
- `, "utf-8"),
49410
- part.body,
49411
- stringToUint8Array(`\r
49412
- --${boundary}`, "utf-8")
49413
- ]),
49414
- stringToUint8Array(`--\r
49415
- \r
49416
- `, "utf-8")
49417
- ];
49418
- const contentLength = getTotalLength(sources);
49419
- if (contentLength) {
49420
- request.headers.set("Content-Length", contentLength);
49421
- }
49422
- request.body = await concat(sources);
49423
- }
49424
- function assertValidBoundary(boundary) {
49425
- if (boundary.length > maxBoundaryLength) {
49426
- throw new Error(`Multipart boundary "${boundary}" exceeds maximum length of 70 characters`);
49427
- }
49428
- if (Array.from(boundary).some((x) => !validBoundaryCharacters.has(x))) {
49429
- throw new Error(`Multipart boundary "${boundary}" contains invalid characters`);
49430
- }
49431
- }
49432
- function multipartPolicy() {
49433
- return {
49434
- name: multipartPolicyName,
49435
- async sendRequest(request, next) {
49436
- if (!request.multipartBody) {
49437
- return next(request);
49438
- }
49439
- if (request.body) {
49440
- throw new Error("multipartBody and regular body cannot be set at the same time");
49441
- }
49442
- let boundary = request.multipartBody.boundary;
49443
- const contentTypeHeader = request.headers.get("Content-Type") ?? "multipart/mixed";
49444
- const parsedHeader = contentTypeHeader.match(/^(multipart\/[^ ;]+)(?:; *boundary=(.+))?$/);
49445
- if (!parsedHeader) {
49446
- throw new Error(`Got multipart request body, but content-type header was not multipart: ${contentTypeHeader}`);
49447
- }
49448
- const [, contentType, parsedBoundary] = parsedHeader;
49449
- if (parsedBoundary && boundary && parsedBoundary !== boundary) {
49450
- throw new Error(`Multipart boundary was specified as ${parsedBoundary} in the header, but got ${boundary} in the request body`);
49451
- }
49452
- boundary ??= parsedBoundary;
49453
- if (boundary) {
49454
- assertValidBoundary(boundary);
49455
- } else {
49456
- boundary = generateBoundary();
49457
- }
49458
- request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`);
49459
- await buildRequestBody(request, request.multipartBody.parts, boundary);
49460
- request.multipartBody = undefined;
49461
- return next(request);
49462
- }
49463
- };
49464
- }
49465
- var multipartPolicyName = "multipartPolicy", maxBoundaryLength = 70, validBoundaryCharacters;
49466
- var init_multipartPolicy = __esm(() => {
49467
- init_concat();
49468
- validBoundaryCharacters = new Set(`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?`);
49469
- });
49470
-
49471
- // node_modules/@typespec/ts-http-runtime/dist/esm/index.js
49472
- var init_esm5 = __esm(() => {
49473
- init_httpHeaders();
49474
- init_pipelineRequest();
49475
- init_pipeline();
49476
- init_restError();
49477
- init_defaultHttpClient();
49478
- init_schemes();
49479
- init_oauth2Flows();
49480
- });
49481
-
49482
- // node_modules/@azure/core-rest-pipeline/dist/esm/pipeline.js
49483
- function createEmptyPipeline2() {
49484
- return createEmptyPipeline();
49485
- }
49486
- var init_pipeline2 = __esm(() => {
49487
- init_esm5();
49488
- });
49489
-
49490
- // node_modules/@azure/core-rest-pipeline/dist/esm/log.js
49491
- var logger6;
49492
- var init_log4 = __esm(() => {
49493
- init_esm();
49494
- logger6 = createClientLogger2("core-rest-pipeline");
49495
- });
49496
-
49497
49444
  // node_modules/@typespec/ts-http-runtime/dist/esm/policies/internal.js
49498
49445
  var init_internal3 = __esm(() => {
49499
49446
  init_defaultRetryPolicy();
@@ -49574,10 +49521,10 @@ var init_userAgent = __esm(() => {
49574
49521
  });
49575
49522
 
49576
49523
  // node_modules/@azure/core-rest-pipeline/dist/esm/policies/userAgentPolicy.js
49577
- function userAgentPolicy(options = {}) {
49524
+ function userAgentPolicy2(options = {}) {
49578
49525
  const userAgentValue = getUserAgentValue(options.userAgentPrefix);
49579
49526
  return {
49580
- name: userAgentPolicyName,
49527
+ name: userAgentPolicyName2,
49581
49528
  async sendRequest(request, next) {
49582
49529
  if (!request.headers.has(UserAgentHeaderName)) {
49583
49530
  request.headers.set(UserAgentHeaderName, await userAgentValue);
@@ -49586,7 +49533,7 @@ function userAgentPolicy(options = {}) {
49586
49533
  }
49587
49534
  };
49588
49535
  }
49589
- var UserAgentHeaderName, userAgentPolicyName = "userAgentPolicy";
49536
+ var UserAgentHeaderName, userAgentPolicyName2 = "userAgentPolicy";
49590
49537
  var init_userAgentPolicy = __esm(() => {
49591
49538
  init_userAgent();
49592
49539
  UserAgentHeaderName = getUserAgentHeaderName();
@@ -49875,7 +49822,7 @@ function createPipelineFromOptions(options) {
49875
49822
  }
49876
49823
  pipeline.addPolicy(wrapAbortSignalLikePolicy());
49877
49824
  pipeline.addPolicy(formDataPolicy2(), { beforePolicies: [multipartPolicyName2] });
49878
- pipeline.addPolicy(userAgentPolicy(options.userAgentOptions));
49825
+ pipeline.addPolicy(userAgentPolicy2(options.userAgentOptions));
49879
49826
  pipeline.addPolicy(setClientRequestIdPolicy(options.telemetryOptions?.clientRequestIdHeaderName));
49880
49827
  pipeline.addPolicy(multipartPolicy2(), { afterPhase: "Deserialize" });
49881
49828
  pipeline.addPolicy(defaultRetryPolicy2(options.retryOptions), { phase: "Retry" });
@@ -50215,6 +50162,93 @@ var init_esm6 = __esm(() => {
50215
50162
  init_bearerTokenAuthenticationPolicy();
50216
50163
  });
50217
50164
 
50165
+ // node_modules/@azure/core-client/dist/esm/interfaces.js
50166
+ var XML_ATTRKEY = "$", XML_CHARKEY = "_";
50167
+
50168
+ // node_modules/@azure/core-client/dist/esm/utils.js
50169
+ function isPrimitiveBody(value, mapperTypeName) {
50170
+ return mapperTypeName !== "Composite" && mapperTypeName !== "Dictionary" && (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || mapperTypeName?.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i) !== null || value === undefined || value === null);
50171
+ }
50172
+ function handleNullableResponseAndWrappableBody(responseObject) {
50173
+ const combinedHeadersAndBody = {
50174
+ ...responseObject.headers,
50175
+ ...responseObject.body
50176
+ };
50177
+ if (responseObject.hasNullableType && Object.getOwnPropertyNames(combinedHeadersAndBody).length === 0) {
50178
+ return responseObject.shouldWrapBody ? { body: null } : null;
50179
+ } else {
50180
+ return responseObject.shouldWrapBody ? {
50181
+ ...responseObject.headers,
50182
+ body: responseObject.body
50183
+ } : combinedHeadersAndBody;
50184
+ }
50185
+ }
50186
+ function flattenResponse(fullResponse, responseSpec) {
50187
+ const parsedHeaders = fullResponse.parsedHeaders;
50188
+ if (fullResponse.request.method === "HEAD") {
50189
+ return {
50190
+ ...parsedHeaders,
50191
+ body: fullResponse.parsedBody
50192
+ };
50193
+ }
50194
+ const bodyMapper = responseSpec && responseSpec.bodyMapper;
50195
+ const isNullable = Boolean(bodyMapper?.nullable);
50196
+ const expectedBodyTypeName = bodyMapper?.type.name;
50197
+ if (expectedBodyTypeName === "Stream") {
50198
+ return {
50199
+ ...parsedHeaders,
50200
+ blobBody: fullResponse.blobBody,
50201
+ readableStreamBody: fullResponse.readableStreamBody
50202
+ };
50203
+ }
50204
+ const modelProperties = expectedBodyTypeName === "Composite" && bodyMapper.type.modelProperties || {};
50205
+ const isPageableResponse = Object.keys(modelProperties).some((k) => modelProperties[k].serializedName === "");
50206
+ if (expectedBodyTypeName === "Sequence" || isPageableResponse) {
50207
+ const arrayResponse = fullResponse.parsedBody ?? [];
50208
+ for (const key of Object.keys(modelProperties)) {
50209
+ if (modelProperties[key].serializedName) {
50210
+ arrayResponse[key] = fullResponse.parsedBody?.[key];
50211
+ }
50212
+ }
50213
+ if (parsedHeaders) {
50214
+ for (const key of Object.keys(parsedHeaders)) {
50215
+ arrayResponse[key] = parsedHeaders[key];
50216
+ }
50217
+ }
50218
+ return isNullable && !fullResponse.parsedBody && !parsedHeaders && Object.getOwnPropertyNames(modelProperties).length === 0 ? null : arrayResponse;
50219
+ }
50220
+ return handleNullableResponseAndWrappableBody({
50221
+ body: fullResponse.parsedBody,
50222
+ headers: parsedHeaders,
50223
+ hasNullableType: isNullable,
50224
+ shouldWrapBody: isPrimitiveBody(fullResponse.parsedBody, expectedBodyTypeName)
50225
+ });
50226
+ }
50227
+ var init_utils5 = () => {};
50228
+
50229
+ // node_modules/@azure/core-client/dist/esm/serializer.js
50230
+ var MapperTypeNames;
50231
+ var init_serializer = __esm(() => {
50232
+ MapperTypeNames = {
50233
+ Base64Url: "Base64Url",
50234
+ Boolean: "Boolean",
50235
+ ByteArray: "ByteArray",
50236
+ Composite: "Composite",
50237
+ Date: "Date",
50238
+ DateTime: "DateTime",
50239
+ DateTimeRfc1123: "DateTimeRfc1123",
50240
+ Dictionary: "Dictionary",
50241
+ Enum: "Enum",
50242
+ Number: "Number",
50243
+ Object: "Object",
50244
+ Sequence: "Sequence",
50245
+ String: "String",
50246
+ Stream: "Stream",
50247
+ TimeSpan: "TimeSpan",
50248
+ UnixTime: "UnixTime"
50249
+ };
50250
+ });
50251
+
50218
50252
  // node_modules/@azure/core-client/dist/commonjs/state.js
50219
50253
  var require_state2 = __commonJS((exports) => {
50220
50254
  Object.defineProperty(exports, "__esModule", { value: true });