@nice2dev/ui-api 1.4.23 → 1.4.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.mjs CHANGED
@@ -1,7 +1,7 @@
1
- var Xt = Object.defineProperty;
2
- var Zt = (e, t, n) => t in e ? Xt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var ke = (e, t, n) => Zt(e, typeof t != "symbol" ? t + "" : t, n);
4
- const Os = [
1
+ var en = Object.defineProperty;
2
+ var tn = (e, t, n) => t in e ? en(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var $e = (e, t, n) => tn(e, typeof t != "symbol" ? t + "" : t, n);
4
+ const Cs = [
5
5
  "GET",
6
6
  "POST",
7
7
  "PUT",
@@ -10,7 +10,7 @@ const Os = [
10
10
  "HEAD",
11
11
  "OPTIONS",
12
12
  "TRACE"
13
- ], Cs = [
13
+ ], Us = [
14
14
  "inherit",
15
15
  "none",
16
16
  "apiKey",
@@ -39,7 +39,7 @@ function ye(e = {}) {
39
39
  body: e.body ?? { kind: "none" }
40
40
  };
41
41
  }
42
- function xe(e = {}) {
42
+ function Te(e = {}) {
43
43
  return {
44
44
  ...e,
45
45
  kind: "folder",
@@ -57,50 +57,65 @@ function ge(e = {}) {
57
57
  variables: e.variables ?? []
58
58
  };
59
59
  }
60
- function Oe(e, t = []) {
60
+ function be(e, t = []) {
61
61
  const n = [];
62
62
  for (const s of e)
63
- s.kind === "folder" ? n.push(...Oe(s.items, [...t, s])) : n.push({ request: s, folders: [...t] });
63
+ s.kind === "folder" ? n.push(...be(s.items, [...t, s])) : n.push({ request: s, folders: [...t] });
64
64
  return n;
65
65
  }
66
- function en(e, t) {
66
+ const dt = "#/components/schemas/";
67
+ function Es(e, t, n) {
68
+ var a;
69
+ if (!n || t === n || !((a = e.schemas) != null && a[t]) || e.schemas[n])
70
+ return e;
71
+ const s = dt + t, r = dt + n, o = (c) => Array.isArray(c) ? c.map(o) : c && typeof c == "object" ? Object.fromEntries(
72
+ Object.entries(c).map(([p, u]) => [
73
+ p,
74
+ p === "$ref" && u === s ? r : o(u)
75
+ ])
76
+ ) : c, i = Object.fromEntries(
77
+ Object.entries(e.schemas).map(([c, p]) => [c === t ? n : c, p])
78
+ );
79
+ return o({ ...e, schemas: i });
80
+ }
81
+ function nn(e, t) {
67
82
  for (const n of e) {
68
83
  if (n.id === t)
69
84
  return n;
70
85
  if (n.kind === "folder") {
71
- const s = en(n.items, t);
86
+ const s = nn(n.items, t);
72
87
  if (s)
73
88
  return s;
74
89
  }
75
90
  }
76
91
  }
77
- function tn(e, t, n) {
92
+ function sn(e, t, n) {
78
93
  const s = [];
79
94
  for (const r of e)
80
95
  if (r.id === t) {
81
96
  const o = n(r);
82
97
  o && s.push(o);
83
- } else r.kind === "folder" ? s.push({ ...r, items: tn(r.items, t, n) }) : s.push(r);
98
+ } else r.kind === "folder" ? s.push({ ...r, items: sn(r.items, t, n) }) : s.push(r);
84
99
  return s;
85
100
  }
86
101
  function L(e) {
87
102
  return e.enabled !== !1;
88
103
  }
89
- function Us(e) {
104
+ function _s(e) {
90
105
  const t = {};
91
106
  for (const n of e)
92
107
  L(n) && (t[n.key] = n.value);
93
108
  return t;
94
109
  }
95
- function nn(e, t) {
110
+ function rn(e, t) {
96
111
  return e.params.filter((n) => n.in === t && L(n));
97
112
  }
98
- function _s(e, t) {
113
+ function qs(e, t) {
99
114
  var s;
100
115
  const n = t.toLowerCase();
101
- return (s = nn(e, "header").find((r) => r.key.toLowerCase() === n)) == null ? void 0 : s.value;
116
+ return (s = rn(e, "header").find((r) => r.key.toLowerCase() === n)) == null ? void 0 : s.value;
102
117
  }
103
- function sn(e, t = [], n) {
118
+ function on(e, t = [], n) {
104
119
  const s = [e.auth, ...[...t].reverse().map((r) => r.auth), n == null ? void 0 : n.auth];
105
120
  for (const r of s)
106
121
  if (r && r.type !== "inherit")
@@ -153,11 +168,11 @@ function oe(e) {
153
168
  return;
154
169
  }
155
170
  }
156
- function Tt(e, t) {
171
+ function St(e, t) {
157
172
  const n = (t ?? "").toLowerCase();
158
- return n.includes("x-www-form-urlencoded") ? { kind: "form", fields: St(e) } : n.includes("soap+xml") ? { kind: "soap", envelope: e, version: "1.2" } : n.includes("xml") ? /<(\w+:)?Envelope[\s>]/.test(e) ? { kind: "soap", envelope: e, version: "1.1" } : { kind: "xml", text: e } : n.includes("json") || !n && /^\s*[[{]/.test(e) ? rn(e) ?? { kind: "json", text: e } : { kind: "text", text: e, contentType: t || void 0 };
173
+ return n.includes("x-www-form-urlencoded") ? { kind: "form", fields: jt(e) } : n.includes("soap+xml") ? { kind: "soap", envelope: e, version: "1.2" } : n.includes("xml") ? /<(\w+:)?Envelope[\s>]/.test(e) ? { kind: "soap", envelope: e, version: "1.1" } : { kind: "xml", text: e } : n.includes("json") || !n && /^\s*[[{]/.test(e) ? an(e) ?? { kind: "json", text: e } : { kind: "text", text: e, contentType: t || void 0 };
159
174
  }
160
- function St(e) {
175
+ function jt(e) {
161
176
  return e ? e.split("&").map((t) => {
162
177
  const n = t.indexOf("="), s = (r) => {
163
178
  try {
@@ -169,7 +184,7 @@ function St(e) {
169
184
  return n < 0 ? { key: s(t), value: "" } : { key: s(t.slice(0, n)), value: s(t.slice(n + 1)) };
170
185
  }) : [];
171
186
  }
172
- function rn(e) {
187
+ function an(e) {
173
188
  try {
174
189
  const t = JSON.parse(e);
175
190
  if (t && typeof t == "object" && typeof t.query == "string" && /^\s*(query|mutation|subscription|\{|fragment)/.test(t.query))
@@ -183,18 +198,18 @@ function rn(e) {
183
198
  }
184
199
  return null;
185
200
  }
186
- const jt = /\{\{\s*([^{}]+?)\s*\}\}/g;
201
+ const Ot = /\{\{\s*([^{}]+?)\s*\}\}/g;
187
202
  function Nt(e) {
188
203
  const t = /* @__PURE__ */ new Set();
189
- for (const n of e.matchAll(jt))
204
+ for (const n of e.matchAll(Ot))
190
205
  t.add(n[1]);
191
206
  return [...t];
192
207
  }
193
- function on(e) {
208
+ function cn(e) {
194
209
  const t = (s) => Array.from({ length: s }, () => Math.floor(e() * 16).toString(16)).join(""), n = (8 + Math.floor(e() * 4)).toString(16);
195
210
  return `${t(8)}-${t(4)}-4${t(3)}-${n}${t(3)}-${t(12)}`;
196
211
  }
197
- function Ot(e, t, n = {}) {
212
+ function Ct(e, t, n = {}) {
198
213
  const s = typeof t == "function" ? t : (c) => t[c], r = n.random ?? Math.random, o = n.now ?? (() => /* @__PURE__ */ new Date()), i = (c) => {
199
214
  var p;
200
215
  if (c.startsWith("secret:"))
@@ -202,7 +217,7 @@ function Ot(e, t, n = {}) {
202
217
  switch (c) {
203
218
  case "$guid":
204
219
  case "$randomUUID":
205
- return on(r);
220
+ return cn(r);
206
221
  case "$timestamp":
207
222
  return String(Math.floor(o().getTime() / 1e3));
208
223
  case "$isoTimestamp":
@@ -215,17 +230,17 @@ function Ot(e, t, n = {}) {
215
230
  };
216
231
  let a = e;
217
232
  for (let c = 0; c < 5 && a.includes("{{"); c++) {
218
- const p = a.replace(jt, (u, f) => i(f) ?? u);
233
+ const p = a.replace(Ot, (u, f) => i(f) ?? u);
219
234
  if (p === a)
220
235
  break;
221
236
  a = p;
222
237
  }
223
238
  return a;
224
239
  }
225
- function Es(e, t, n = {}) {
226
- return Nt(Ot(e, t, n));
240
+ function Is(e, t, n = {}) {
241
+ return Nt(Ct(e, t, n));
227
242
  }
228
- function qs(e, t, n) {
243
+ function Ls(e, t, n) {
229
244
  const s = {}, r = (o) => {
230
245
  for (const i of o ?? [])
231
246
  L(i) && i.key && (s[i.key] = i.value);
@@ -237,9 +252,9 @@ function pe(e) {
237
252
  const s = t.indexOf("#");
238
253
  s >= 0 && (n = t.slice(s), t = t.slice(0, s));
239
254
  const r = t.indexOf("?");
240
- return r < 0 ? { base: t, query: [], hash: n } : { base: t.slice(0, r), query: St(t.slice(r + 1)), hash: n };
255
+ return r < 0 ? { base: t, query: [], hash: n } : { base: t.slice(0, r), query: jt(t.slice(r + 1)), hash: n };
241
256
  }
242
- function an(e) {
257
+ function pn(e) {
243
258
  const t = pe(e).base, n = [], s = t.replace(/^[a-z][\w+.-]*:\/\/[^/]*/i, "").replace(/^\{\{[^}]+\}\}/, "");
244
259
  for (const r of s.matchAll(
245
260
  new RegExp("(?<!\\{)\\{([A-Za-z_][\\w.-]*)\\}(?!\\})|(?:^|\\/):([A-Za-z_][\\w-]*)", "g")
@@ -249,8 +264,8 @@ function an(e) {
249
264
  }
250
265
  return n;
251
266
  }
252
- function cn(e) {
253
- const t = an(e.url), n = e.params.filter((r) => r.in !== "path");
267
+ function ln(e) {
268
+ const t = pn(e.url), n = e.params.filter((r) => r.in !== "path");
254
269
  return [...t.map(
255
270
  (r) => e.params.find((o) => o.in === "path" && o.key === r) ?? {
256
271
  key: r,
@@ -260,7 +275,7 @@ function cn(e) {
260
275
  }
261
276
  ), ...n];
262
277
  }
263
- function pn(e, t) {
278
+ function un(e, t) {
264
279
  const { base: n, query: s, hash: r } = pe(t), o = {
265
280
  ...e,
266
281
  url: n + r,
@@ -269,12 +284,12 @@ function pn(e, t) {
269
284
  ...s.map((i) => ({ ...i, in: "query" }))
270
285
  ]
271
286
  };
272
- return { ...o, params: cn(o) };
287
+ return { ...o, params: ln(o) };
273
288
  }
274
- function ln(e) {
289
+ function fn(e) {
275
290
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
276
291
  }
277
- function dt(e) {
292
+ function mt(e) {
278
293
  return encodeURIComponent(e).replace(
279
294
  /[!'()*]/g,
280
295
  (t) => `%${t.charCodeAt(0).toString(16).toUpperCase()}`
@@ -286,27 +301,27 @@ function Ue(e, t = (n) => n) {
286
301
  for (const a of e.params) {
287
302
  if (a.in !== "path" || !L(a))
288
303
  continue;
289
- const c = encodeURIComponent(t(a.value)), p = new RegExp(`(^|/):${ln(a.key)}(?=/|$)`);
304
+ const c = encodeURIComponent(t(a.value)), p = new RegExp(`(^|/):${fn(a.key)}(?=/|$)`);
290
305
  o = o.split(`{${a.key}}`).join(c).replace(p, (u, f) => f + c);
291
306
  }
292
307
  const i = [...s, ...e.params.filter((a) => a.in === "query" && L(a))].map(
293
308
  (a) => {
294
- const c = dt(t(a.key)), p = t(a.value);
295
- return p === "" && !("in" in a) ? c : `${c}=${dt(p)}`;
309
+ const c = mt(t(a.key)), p = t(a.value);
310
+ return p === "" && !("in" in a) ? c : `${c}=${mt(p)}`;
296
311
  }
297
312
  );
298
313
  return o + (i.length ? `?${i.join("&")}` : "") + t(r);
299
314
  }
300
- function Is(e, t) {
315
+ function Ps(e, t) {
301
316
  return e ? t ? `${e.replace(/\/+$/, "")}/${t.replace(/^\/+/, "")}` : e : t;
302
317
  }
303
- function un(e) {
318
+ function dn(e) {
304
319
  return /^\s*(?:\$\s*)?curl(?:\.exe)?(?:\s|$)/i.test(e);
305
320
  }
306
- function fn(e) {
321
+ function mn(e) {
307
322
  return /\^\r?\n/.test(e) || /\^"/.test(e) ? "cmd" : /`\r?\n/.test(e) || /^\s*curl\.exe\b/i.test(e) ? "powershell" : "bash";
308
323
  }
309
- function dn(e, t = fn(e)) {
324
+ function hn(e, t = mn(e)) {
310
325
  var c;
311
326
  let n = e.replace(/\r\n?/g, `
312
327
  `);
@@ -401,7 +416,7 @@ function dn(e, t = fn(e)) {
401
416
  }
402
417
  return a(), s;
403
418
  }
404
- const mn = new Set("XHdFubAemoxwTEKrUzCcDYyQt".split("")), hn = /* @__PURE__ */ new Set([
419
+ const yn = new Set("XHdFubAemoxwTEKrUzCcDYyQt".split("")), gn = /* @__PURE__ */ new Set([
405
420
  "request",
406
421
  "header",
407
422
  "data",
@@ -471,7 +486,7 @@ const mn = new Set("XHdFubAemoxwTEKrUzCcDYyQt".split("")), hn = /* @__PURE__ */
471
486
  "login-options",
472
487
  "sasl-authzid",
473
488
  "tls-max"
474
- ]), mt = {
489
+ ]), ht = {
475
490
  X: "request",
476
491
  H: "header",
477
492
  d: "data",
@@ -488,7 +503,7 @@ const mn = new Set("XHdFubAemoxwTEKrUzCcDYyQt".split("")), hn = /* @__PURE__ */
488
503
  T: "upload-file",
489
504
  E: "cert"
490
505
  };
491
- function Ct(e) {
506
+ function Ut(e) {
492
507
  try {
493
508
  const t = Uint8Array.from(atob(e.trim()), (n) => n.charCodeAt(0));
494
509
  return new TextDecoder().decode(t);
@@ -503,7 +518,7 @@ function at(e) {
503
518
  n += String.fromCharCode(s);
504
519
  return btoa(n);
505
520
  }
506
- function yn(e) {
521
+ function bn(e) {
507
522
  const t = e.indexOf("@"), n = e.indexOf("=");
508
523
  if (t >= 0 && (n < 0 || t < n))
509
524
  return e;
@@ -512,7 +527,7 @@ function yn(e) {
512
527
  const s = e.slice(0, n), r = encodeURIComponent(e.slice(n + 1));
513
528
  return s ? `${s}=${r}` : r;
514
529
  }
515
- function gn(e, t) {
530
+ function kn(e, t) {
516
531
  const n = e.indexOf("="), s = n < 0 ? e : e.slice(0, n);
517
532
  let r = n < 0 ? "" : e.slice(n + 1);
518
533
  if (!t && (r.startsWith("@") || r.startsWith("<"))) {
@@ -532,8 +547,8 @@ function gn(e, t) {
532
547
  }
533
548
  return r = r.replace(/^"(.*)"$/, "$1"), { key: s, value: r, type: "text" };
534
549
  }
535
- function bn(e) {
536
- const t = dn(e.trim());
550
+ function $n(e) {
551
+ const t = hn(e.trim());
537
552
  if (t[0] === "$" && t.shift(), !t.length || !/^curl(\.exe)?$/i.test(t[0]))
538
553
  throw new Error("Not a curl command");
539
554
  let n, s = "";
@@ -550,13 +565,13 @@ function bn(e) {
550
565
  s = x ?? s;
551
566
  break;
552
567
  case "url-query":
553
- x && i.push(...ht(x));
568
+ x && i.push(...yt(x));
554
569
  break;
555
570
  case "header": {
556
571
  if (!x)
557
572
  break;
558
- const E = x.indexOf(":");
559
- E > 0 ? r.push({ key: x.slice(0, E).trim(), value: x.slice(E + 1).trim() }) : x.endsWith(";") && r.push({ key: x.slice(0, -1).trim(), value: "" });
573
+ const _ = x.indexOf(":");
574
+ _ > 0 ? r.push({ key: x.slice(0, _).trim(), value: x.slice(_ + 1).trim() }) : x.endsWith(";") && r.push({ key: x.slice(0, -1).trim(), value: "" });
560
575
  break;
561
576
  }
562
577
  case "user-agent":
@@ -567,9 +582,9 @@ function bn(e) {
567
582
  break;
568
583
  case "cookie":
569
584
  if (x != null && x.includes("="))
570
- for (const E of x.split(";")) {
571
- const M = E.indexOf("=");
572
- M > 0 && o.push({ key: E.slice(0, M).trim(), value: E.slice(M + 1).trim() });
585
+ for (const _ of x.split(";")) {
586
+ const M = _.indexOf("=");
587
+ M > 0 && o.push({ key: _.slice(0, M).trim(), value: _.slice(M + 1).trim() });
573
588
  }
574
589
  break;
575
590
  case "data":
@@ -584,11 +599,11 @@ function bn(e) {
584
599
  );
585
600
  break;
586
601
  case "data-urlencode":
587
- x !== void 0 && a.push(yn(x));
602
+ x !== void 0 && a.push(bn(x));
588
603
  break;
589
604
  case "form":
590
605
  case "form-string":
591
- x !== void 0 && p.push(gn(x, j === "form-string"));
606
+ x !== void 0 && p.push(kn(x, j === "form-string"));
592
607
  break;
593
608
  case "user":
594
609
  u = x;
@@ -625,28 +640,28 @@ function bn(e) {
625
640
  for (let j = 1; j < t.length; j++) {
626
641
  const x = t[j];
627
642
  if (x.startsWith("--") && x.length > 2) {
628
- const E = x.slice(2), M = hn.has(E) ? t[++j] : void 0;
629
- $(E, M);
643
+ const _ = x.slice(2), M = gn.has(_) ? t[++j] : void 0;
644
+ $(_, M);
630
645
  } else if (x.startsWith("-") && x.length > 1)
631
- for (let E = 1; E < x.length; E++) {
632
- const M = x[E];
633
- if (mn.has(M)) {
634
- const g = x.slice(E + 1) || t[++j];
635
- $(mt[M] ?? M, g);
646
+ for (let _ = 1; _ < x.length; _++) {
647
+ const M = x[_];
648
+ if (yn.has(M)) {
649
+ const g = x.slice(_ + 1) || t[++j];
650
+ $(ht[M] ?? M, g);
636
651
  break;
637
652
  }
638
- $(mt[M] ?? M, void 0);
653
+ $(ht[M] ?? M, void 0);
639
654
  }
640
655
  else s || (s = x);
641
656
  }
642
657
  let T;
643
658
  const b = r.findIndex((j) => j.key.toLowerCase() === "authorization");
644
659
  if (b >= 0) {
645
- const j = r[b].value, x = /^Bearer\s+(.+)$/i.exec(j), E = /^Basic\s+(.+)$/i.exec(j);
660
+ const j = r[b].value, x = /^Bearer\s+(.+)$/i.exec(j), _ = /^Basic\s+(.+)$/i.exec(j);
646
661
  if (x)
647
662
  T = { type: "bearer", token: x[1].trim() }, r.splice(b, 1);
648
- else if (E) {
649
- const M = Ct(E[1]), h = M.indexOf(":");
663
+ else if (_) {
664
+ const M = Ut(_[1]), h = M.indexOf(":");
650
665
  h >= 0 && (T = {
651
666
  type: "basic",
652
667
  username: M.slice(0, h),
@@ -655,52 +670,52 @@ function bn(e) {
655
670
  }
656
671
  }
657
672
  if (u !== void 0) {
658
- const j = u.indexOf(":"), x = j < 0 ? u : u.slice(0, j), E = j < 0 ? "" : u.slice(j + 1);
673
+ const j = u.indexOf(":"), x = j < 0 ? u : u.slice(0, j), _ = j < 0 ? "" : u.slice(j + 1);
659
674
  if (l) {
660
675
  const [, , M = "", h = ""] = l.split(":");
661
676
  T = {
662
677
  type: "awsSigV4",
663
678
  accessKeyId: x,
664
- secretAccessKey: E,
679
+ secretAccessKey: _,
665
680
  region: M,
666
681
  service: h
667
682
  };
668
683
  } else
669
- T = f ? { type: "digest", username: x, password: E } : { type: "basic", username: x, password: E };
684
+ T = f ? { type: "digest", username: x, password: _ } : { type: "basic", username: x, password: _ };
670
685
  }
671
686
  d !== void 0 && (T = { type: "bearer", token: d });
672
687
  const S = r.findIndex((j) => j.key.toLowerCase() === "content-type"), w = S >= 0 ? r[S].value : void 0;
673
688
  y && (S < 0 && r.push({ key: "Content-Type", value: "application/json" }), r.some((j) => j.key.toLowerCase() === "accept") || r.push({ key: "Accept", value: "application/json" }));
674
- let N = { kind: "none" };
689
+ let O = { kind: "none" };
675
690
  if (m && a.length)
676
- i.push(...ht(a.join("&")));
691
+ i.push(...yt(a.join("&")));
677
692
  else if (p.length)
678
- N = { kind: "multipart", parts: p };
693
+ O = { kind: "multipart", parts: p };
679
694
  else if (a.length) {
680
695
  const j = a.join(y ? "" : "&"), x = /^\s*[[{]/.test(j);
681
- N = Tt(
696
+ O = St(
682
697
  j,
683
698
  w ?? (y || x ? "application/json" : "application/x-www-form-urlencoded")
684
699
  );
685
- } else c !== void 0 && (N = { kind: "binary", fileName: c, contentType: w });
686
- const P = n ?? (k ? "HEAD" : m ? "GET" : N.kind !== "none" ? "POST" : "GET"), R = [
700
+ } else c !== void 0 && (O = { kind: "binary", fileName: c, contentType: w });
701
+ const P = n ?? (k ? "HEAD" : m ? "GET" : O.kind !== "none" ? "POST" : "GET"), R = [
687
702
  ...r.map((j) => ({ ...j, in: "header" })),
688
703
  ...o.map((j) => ({ ...j, in: "cookie" }))
689
704
  ];
690
705
  let H = ye({
691
- name: Ut(P, s),
706
+ name: Et(P, s),
692
707
  method: P,
693
708
  params: R,
694
- body: N,
709
+ body: O,
695
710
  auth: T,
696
711
  settings: Object.keys(v).length ? v : void 0
697
712
  });
698
- return H = pn(H, s), i.length && (H = {
713
+ return H = un(H, s), i.length && (H = {
699
714
  ...H,
700
715
  params: [...H.params, ...i.map((j) => ({ ...j, in: "query" }))]
701
716
  }), H;
702
717
  }
703
- function ht(e) {
718
+ function yt(e) {
704
719
  return e.split("&").filter(Boolean).map((t) => {
705
720
  const n = t.indexOf("="), s = (r) => {
706
721
  try {
@@ -712,14 +727,14 @@ function ht(e) {
712
727
  return n < 0 ? { key: s(t), value: "" } : { key: s(t.slice(0, n)), value: s(t.slice(n + 1)) };
713
728
  });
714
729
  }
715
- function Ut(e, t) {
730
+ function Et(e, t) {
716
731
  const n = t.replace(/^[a-z][\w+.-]*:\/\/[^/]*/i, "").replace(/^\{\{[^}]+\}\}/, "").split("?")[0];
717
732
  return `${e} ${n || "/"}`;
718
733
  }
719
- function kn(e) {
734
+ function wn(e) {
720
735
  return e === "powershell" ? (t) => `'${t.replace(/'/g, "''")}'` : e === "cmd" ? (t) => `"${t.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"` : (t) => /^[\w./:@%+=,-]+$/.test(t) ? t : `'${t.replace(/'/g, "'\\''")}'`;
721
736
  }
722
- function $n(e, t) {
737
+ function vn(e, t) {
723
738
  const n = [], s = [], r = [];
724
739
  switch (e == null ? void 0 : e.type) {
725
740
  case "basic":
@@ -755,7 +770,7 @@ function $n(e, t) {
755
770
  }
756
771
  function De(e, t = {}) {
757
772
  var T, b, S;
758
- const n = t.shell ?? "bash", s = t.transform ?? ((w) => w), r = kn(n), o = $n(t.auth ?? e.auth, s), i = {
773
+ const n = t.shell ?? "bash", s = t.transform ?? ((w) => w), r = wn(n), o = vn(t.auth ?? e.auth, s), i = {
759
774
  ...e,
760
775
  params: [...e.params, ...o.query.map((w) => ({ ...w, in: "query" }))]
761
776
  }, a = Ue(i, s), c = [], p = e.method.toUpperCase(), u = e.body.kind !== "none";
@@ -798,7 +813,7 @@ function De(e, t = {}) {
798
813
  (T = e.settings) != null && T.followRedirects && c.push(["-L"]), (b = e.settings) != null && b.insecure && c.push(["-k"]), (S = e.settings) != null && S.timeoutMs && c.push(["-m", String(e.settings.timeoutMs / 1e3)]);
799
814
  const v = [
800
815
  `${n === "powershell" ? "curl.exe" : "curl"} ${r(a)}`,
801
- ...c.map(([w, N]) => N === void 0 ? w : `${w} ${r(N)}`)
816
+ ...c.map(([w, O]) => O === void 0 ? w : `${w} ${r(O)}`)
802
817
  ];
803
818
  if (t.multiline === !1)
804
819
  return v.join(" ");
@@ -807,7 +822,7 @@ function De(e, t = {}) {
807
822
  `;
808
823
  return v.join($);
809
824
  }
810
- const wn = [
825
+ const An = [
811
826
  { id: "curl", label: "cURL (bash)", syntax: "shell" },
812
827
  { id: "curl-cmd", label: "cURL (cmd)", syntax: "bat" },
813
828
  { id: "curl-powershell", label: "cURL (PowerShell)", syntax: "powershell" },
@@ -816,7 +831,7 @@ const wn = [
816
831
  { id: "powershell", label: "PowerShell", syntax: "powershell" },
817
832
  { id: "python", label: "Python requests", syntax: "python" }
818
833
  ];
819
- function Ee(e, t) {
834
+ function _e(e, t) {
820
835
  var d;
821
836
  const n = t.transform ?? ((l) => l), s = t.auth ?? e.auth, r = e.params.filter((l) => l.in === "header" && L(l)).map((l) => [n(l.key), n(l.value)]), o = [], i = e.params.filter((l) => l.in === "cookie" && L(l)).map((l) => `${n(l.key)}=${n(l.value)}`);
822
837
  let a;
@@ -856,7 +871,7 @@ function Ee(e, t) {
856
871
  i.length && r.push(["Cookie", i.join("; ")]);
857
872
  const c = Ue({ ...e, params: [...e.params, ...o] }, n), p = e.body, u = ((d = r.find(([l]) => l.toLowerCase() === "content-type")) == null ? void 0 : d[1]) ?? Ce(p);
858
873
  p.kind === "soap" && p.version === "1.1" && p.action !== void 0 && (r.some(([l]) => l.toLowerCase() === "soapaction") || r.push(["SOAPAction", `"${n(p.action)}"`]));
859
- const f = vn(p, n);
874
+ const f = xn(p, n);
860
875
  return {
861
876
  method: e.method.toUpperCase(),
862
877
  url: c,
@@ -866,7 +881,7 @@ function Ee(e, t) {
866
881
  note: a
867
882
  };
868
883
  }
869
- function vn(e, t) {
884
+ function xn(e, t) {
870
885
  switch (e.kind) {
871
886
  case "json":
872
887
  case "xml":
@@ -901,21 +916,21 @@ function _t(e, t) {
901
916
  `).map((n, s) => s === 0 ? n : t + n).join(`
902
917
  `);
903
918
  }
904
- function Et(e) {
919
+ function qt(e) {
905
920
  try {
906
921
  return JSON.stringify(JSON.parse(e), null, 2);
907
922
  } catch {
908
923
  return;
909
924
  }
910
925
  }
911
- function An(e) {
926
+ function Tn(e) {
912
927
  const t = [];
913
928
  e.note && t.push(`// ${e.note}`);
914
929
  let n = "", s;
915
930
  const r = [...e.headers], o = r.some(([a]) => a.toLowerCase() === "content-type");
916
931
  switch (e.body.kind) {
917
932
  case "json": {
918
- const a = Et(e.body.text);
933
+ const a = qt(e.body.text);
919
934
  s = a ? `JSON.stringify(${_t(a, " ")})` : se(e.body.text), o || r.push(["Content-Type", "application/json"]);
920
935
  break;
921
936
  }
@@ -958,20 +973,20 @@ ${i.join(`
958
973
  });`), t.push("const data = await response.text();"), t.join(`
959
974
  `);
960
975
  }
961
- const xn = /* @__PURE__ */ new Set([
976
+ const Sn = /* @__PURE__ */ new Set([
962
977
  "content-type",
963
978
  "content-length",
964
979
  "content-encoding",
965
980
  "content-language",
966
981
  "content-disposition"
967
982
  ]);
968
- function Tn(e) {
983
+ function jn(e) {
969
984
  const t = [];
970
985
  e.note && t.push(`// ${e.note}`), t.push("using System.Net.Http;", "using System.Text;", ""), t.push("using var client = new HttpClient();");
971
986
  const s = ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "TRACE"].includes(e.method) ? `HttpMethod.${e.method[0]}${e.method.slice(1).toLowerCase()}` : `new HttpMethod(${F(e.method)})`;
972
987
  t.push(`using var request = new HttpRequestMessage(${s}, ${F(e.url)});`);
973
988
  for (const [o, i] of e.headers)
974
- xn.has(o.toLowerCase()) || t.push(`request.Headers.TryAddWithoutValidation(${F(o)}, ${F(i)});`);
989
+ Sn.has(o.toLowerCase()) || t.push(`request.Headers.TryAddWithoutValidation(${F(o)}, ${F(i)});`);
975
990
  const r = (e.contentType ?? "text/plain").split(";")[0].trim();
976
991
  switch (e.body.kind) {
977
992
  case "none":
@@ -1012,7 +1027,7 @@ function Tn(e) {
1012
1027
  ), t.join(`
1013
1028
  `);
1014
1029
  }
1015
- function Sn(e) {
1030
+ function On(e) {
1016
1031
  const t = [];
1017
1032
  e.note && t.push(`# ${e.note}`);
1018
1033
  const n = e.headers.filter(([r]) => r.toLowerCase() !== "content-type");
@@ -1044,7 +1059,7 @@ ${oe(e.body) ?? ""}
1044
1059
  return t.push(`$response = Invoke-RestMethod ${s.join(" ")}`), t.join(`
1045
1060
  `);
1046
1061
  }
1047
- function jn(e) {
1062
+ function Nn(e) {
1048
1063
  const t = [];
1049
1064
  e.note && t.push(`# ${e.note}`), t.push("import requests", "");
1050
1065
  const n = [` ${Y(e.method)},`, ` ${Y(e.url)},`], s = [...e.headers];
@@ -1052,7 +1067,7 @@ function jn(e) {
1052
1067
  case "none":
1053
1068
  break;
1054
1069
  case "json": {
1055
- const r = Et(e.body.text);
1070
+ const r = qt(e.body.text);
1056
1071
  if (r) {
1057
1072
  const o = r.replace(/\btrue\b/g, "True").replace(/\bfalse\b/g, "False").replace(/\bnull\b/g, "None");
1058
1073
  n.push(` json=${_t(o, " ")},`);
@@ -1098,7 +1113,7 @@ ${n.join(`
1098
1113
  ), t.join(`
1099
1114
  `);
1100
1115
  }
1101
- function Nn(e, t, n = {}) {
1116
+ function Cn(e, t, n = {}) {
1102
1117
  switch (t) {
1103
1118
  case "curl":
1104
1119
  return De(e, { ...n, shell: "bash" });
@@ -1107,13 +1122,13 @@ function Nn(e, t, n = {}) {
1107
1122
  case "curl-powershell":
1108
1123
  return De(e, { ...n, shell: "powershell" });
1109
1124
  case "fetch":
1110
- return An(Ee(e, n));
1125
+ return Tn(_e(e, n));
1111
1126
  case "csharp":
1112
- return Tn(Ee(e, n));
1127
+ return jn(_e(e, n));
1113
1128
  case "powershell":
1114
- return Sn(Ee(e, n));
1129
+ return On(_e(e, n));
1115
1130
  case "python":
1116
- return jn(Ee(e, n));
1131
+ return Nn(_e(e, n));
1117
1132
  default:
1118
1133
  return "";
1119
1134
  }
@@ -1123,7 +1138,7 @@ class Z extends Error {
1123
1138
  super(`${t} (line ${n})`), this.line = n, this.name = "NiceYamlError";
1124
1139
  }
1125
1140
  }
1126
- function yt(e) {
1141
+ function gt(e) {
1127
1142
  let t = null;
1128
1143
  for (let n = 0; n < e.length; n++) {
1129
1144
  const s = e[n];
@@ -1144,9 +1159,9 @@ function yt(e) {
1144
1159
  }
1145
1160
  return e.trimEnd();
1146
1161
  }
1147
- const On = /* @__PURE__ */ new Set(["", "~", "null", "Null", "NULL"]);
1162
+ const Un = /* @__PURE__ */ new Set(["", "~", "null", "Null", "NULL"]);
1148
1163
  function ct(e) {
1149
- if (On.has(e))
1164
+ if (Un.has(e))
1150
1165
  return null;
1151
1166
  if (/^(true|True|TRUE)$/.test(e))
1152
1167
  return !0;
@@ -1208,18 +1223,18 @@ function He(e) {
1208
1223
  `.repeat(n) : " "), n = 0, t += o;
1209
1224
  }), t;
1210
1225
  }
1211
- class Cn {
1226
+ class En {
1212
1227
  constructor(t) {
1213
- ke(this, "lines");
1214
- ke(this, "i", 0);
1215
- ke(this, "anchors", /* @__PURE__ */ new Map());
1228
+ $e(this, "lines");
1229
+ $e(this, "i", 0);
1230
+ $e(this, "anchors", /* @__PURE__ */ new Map());
1216
1231
  this.lines = t.replace(/^\uFEFF/, "").replace(/\r\n?/g, `
1217
1232
  `).split(`
1218
1233
  `).map((n, s) => {
1219
1234
  const r = n.length - n.replace(/^ +/, "").length, o = n.slice(r);
1220
1235
  if (o.startsWith(" "))
1221
1236
  throw new Z("Tabs cannot indent YAML", s + 1);
1222
- return { indent: r, raw: o, text: yt(o), num: s + 1 };
1237
+ return { indent: r, raw: o, text: gt(o), num: s + 1 };
1223
1238
  });
1224
1239
  }
1225
1240
  skipBlank() {
@@ -1415,7 +1430,7 @@ ${`
1415
1430
  const a = this.findClosingQuote(o, s);
1416
1431
  if (a >= 0) {
1417
1432
  r.push(o.slice(0, a));
1418
- const p = yt(o.slice(a + 1)).trim();
1433
+ const p = gt(o.slice(a + 1)).trim();
1419
1434
  if (p)
1420
1435
  throw new Z(`Text after a quoted scalar: ${p.slice(0, 20)}`, i);
1421
1436
  break;
@@ -1474,18 +1489,18 @@ ${`
1474
1489
  /** A flow collection, gathering lines until its brackets close. */
1475
1490
  parseFlowLines(t, n) {
1476
1491
  let s = t;
1477
- for (; !Un(s); ) {
1492
+ for (; !_n(s); ) {
1478
1493
  if (this.i >= this.lines.length)
1479
1494
  throw new Z("Unclosed flow collection", n.num);
1480
1495
  s += ` ${this.lines[this.i++].text}`;
1481
1496
  }
1482
- const r = new _n(s, n.num, this.anchors), o = r.parseValue();
1497
+ const r = new qn(s, n.num, this.anchors), o = r.parseValue();
1483
1498
  if (r.skipSpace(), !r.atEnd())
1484
1499
  throw new Z("Text after a flow collection", n.num);
1485
1500
  return o;
1486
1501
  }
1487
1502
  }
1488
- function Un(e) {
1503
+ function _n(e) {
1489
1504
  let t = 0, n = null;
1490
1505
  for (let s = 0; s < e.length; s++) {
1491
1506
  const r = e[s];
@@ -1497,9 +1512,9 @@ function Un(e) {
1497
1512
  }
1498
1513
  return t <= 0 && !n;
1499
1514
  }
1500
- class _n {
1515
+ class qn {
1501
1516
  constructor(t, n, s) {
1502
- ke(this, "pos", 0);
1517
+ $e(this, "pos", 0);
1503
1518
  this.text = t, this.line = n, this.anchors = s;
1504
1519
  }
1505
1520
  atEnd() {
@@ -1580,10 +1595,10 @@ class _n {
1580
1595
  }
1581
1596
  }
1582
1597
  }
1583
- function En(e) {
1584
- return new Cn(e).parseDocument();
1598
+ function In(e) {
1599
+ return new En(e).parseDocument();
1585
1600
  }
1586
- function qt(e) {
1601
+ function It(e) {
1587
1602
  for (let t = 0; t < e.length; t++) {
1588
1603
  const n = e.charCodeAt(t);
1589
1604
  if (n < 32 && n !== 9 && n !== 10 && n !== 13)
@@ -1591,11 +1606,11 @@ function qt(e) {
1591
1606
  }
1592
1607
  return !1;
1593
1608
  }
1594
- const qn = /^[-?:,[\]{}#&*!|>'"%@`]/;
1595
- function It(e) {
1596
- return e === "" || e !== e.trim() || qn.test(e) || /: |:$| #|[\t\n\r]/.test(e) || qt(e) || typeof ct(e) != "string";
1609
+ const Ln = /^[-?:,[\]{}#&*!|>'"%@`]/;
1610
+ function Lt(e) {
1611
+ return e === "" || e !== e.trim() || Ln.test(e) || /: |:$| #|[\t\n\r]/.test(e) || It(e) || typeof ct(e) != "string";
1597
1612
  }
1598
- function In(e) {
1613
+ function Pn(e) {
1599
1614
  if (e == null)
1600
1615
  return "null";
1601
1616
  if (typeof e == "number")
@@ -1603,12 +1618,12 @@ function In(e) {
1603
1618
  if (typeof e == "boolean")
1604
1619
  return String(e);
1605
1620
  const t = String(e);
1606
- return It(t) ? JSON.stringify(t) : t;
1621
+ return Lt(t) ? JSON.stringify(t) : t;
1607
1622
  }
1608
- function Ln(e) {
1609
- return It(e) ? JSON.stringify(e) : e;
1623
+ function Rn(e) {
1624
+ return Lt(e) ? JSON.stringify(e) : e;
1610
1625
  }
1611
- function gt(e) {
1626
+ function bt(e) {
1612
1627
  return Array.isArray(e) ? e.length > 0 : !!e && typeof e == "object" && Object.keys(e).length > 0;
1613
1628
  }
1614
1629
  function Qe(e, t, n, s) {
@@ -1620,7 +1635,7 @@ function Qe(e, t, n, s) {
1620
1635
  }
1621
1636
  s && n.push(s.trimEnd());
1622
1637
  for (const o of e)
1623
- if (gt(o)) {
1638
+ if (bt(o)) {
1624
1639
  const i = [];
1625
1640
  Qe(o, t + 2, i, ""), n.push(`${r}- ${i[0].trimStart()}`, ...i.slice(1));
1626
1641
  } else
@@ -1635,8 +1650,8 @@ function Qe(e, t, n, s) {
1635
1650
  }
1636
1651
  s && n.push(s.trimEnd());
1637
1652
  for (const [i, a] of o) {
1638
- const c = `${r}${Ln(i)}:`;
1639
- gt(a) ? Qe(a, Array.isArray(a) ? t : t + 2, n, c) : ze(a, t, n, `${c} `);
1653
+ const c = `${r}${Rn(i)}:`;
1654
+ bt(a) ? Qe(a, Array.isArray(a) ? t : t + 2, n, c) : ze(a, t, n, `${c} `);
1640
1655
  }
1641
1656
  return;
1642
1657
  }
@@ -1652,7 +1667,7 @@ function ze(e, t, n, s) {
1652
1667
  return;
1653
1668
  }
1654
1669
  if (typeof e == "string" && e.includes(`
1655
- `) && !qt(e)) {
1670
+ `) && !It(e)) {
1656
1671
  const r = e.endsWith(`
1657
1672
  `), o = (r ? e.slice(0, -1) : e).split(`
1658
1673
  `), i = o[0].startsWith(" "), a = " ".repeat(t + 2), c = r ? e.endsWith(`
@@ -1663,15 +1678,15 @@ function ze(e, t, n, s) {
1663
1678
  n.push(p ? a + p : "");
1664
1679
  return;
1665
1680
  }
1666
- n.push(s + In(e));
1681
+ n.push(s + Pn(e));
1667
1682
  }
1668
- function Pn(e) {
1683
+ function Mn(e) {
1669
1684
  const t = [];
1670
1685
  return Qe(e, 0, t, ""), `${t.join(`
1671
1686
  `)}
1672
1687
  `;
1673
1688
  }
1674
- function Ge(e, t = En) {
1689
+ function Ge(e, t = In) {
1675
1690
  const n = e.trimStart();
1676
1691
  if (n.startsWith("{") || n.startsWith("["))
1677
1692
  try {
@@ -1680,14 +1695,14 @@ function Ge(e, t = En) {
1680
1695
  }
1681
1696
  return t(e);
1682
1697
  }
1683
- function Lt(e) {
1698
+ function Pt(e) {
1684
1699
  return (t) => {
1685
1700
  var s;
1686
1701
  const n = (s = /^#\/(?:components\/schemas|definitions)\/(.+)$/.exec(t)) == null ? void 0 : s[1];
1687
1702
  return n ? e == null ? void 0 : e[decodeURIComponent(n.replace(/~1/g, "/").replace(/~0/g, "~"))] : void 0;
1688
1703
  };
1689
1704
  }
1690
- function Rn(e) {
1705
+ function Dn(e) {
1691
1706
  if (Array.isArray(e.type))
1692
1707
  return e.type.find((t) => t !== "null") ?? e.type[0];
1693
1708
  if (e.type)
@@ -1697,7 +1712,7 @@ function Rn(e) {
1697
1712
  if (e.items)
1698
1713
  return "array";
1699
1714
  }
1700
- function Mn(e, t) {
1715
+ function Hn(e, t) {
1701
1716
  switch (e.format) {
1702
1717
  case "email":
1703
1718
  return "user@example.com";
@@ -1730,7 +1745,7 @@ function Mn(e, t) {
1730
1745
  }
1731
1746
  }
1732
1747
  }
1733
- function Pt(e, t = {}) {
1748
+ function Rt(e, t = {}) {
1734
1749
  const n = t.maxDepth ?? 6, s = t.arrayItems ?? 1, r = t.now ?? (() => /* @__PURE__ */ new Date()), o = (i, a, c) => {
1735
1750
  var u, f, d, l, m, k;
1736
1751
  if (!i)
@@ -1763,9 +1778,9 @@ function Pt(e, t = {}) {
1763
1778
  const p = ((m = i.oneOf) == null ? void 0 : m[0]) ?? ((k = i.anyOf) == null ? void 0 : k[0]);
1764
1779
  if (p)
1765
1780
  return o(p, a, c);
1766
- switch (Rn(i)) {
1781
+ switch (Dn(i)) {
1767
1782
  case "string":
1768
- return Mn(i, r);
1783
+ return Hn(i, r);
1769
1784
  case "integer":
1770
1785
  return i.minimum ?? 0;
1771
1786
  case "number":
@@ -1812,7 +1827,7 @@ function Ye(e) {
1812
1827
  return {};
1813
1828
  }
1814
1829
  }
1815
- function Ls(e, t) {
1830
+ function Rs(e, t) {
1816
1831
  var p;
1817
1832
  const n = (p = e.examples) == null ? void 0 : p[0];
1818
1833
  if (n) {
@@ -1827,23 +1842,23 @@ function Ls(e, t) {
1827
1842
  const a = o.contentType ?? "application/json";
1828
1843
  let c = o.example ?? "";
1829
1844
  if (!c && o.schema) {
1830
- const u = Pt(o.schema, {
1831
- resolveRef: Lt(t == null ? void 0 : t.schemas),
1845
+ const u = Rt(o.schema, {
1846
+ resolveRef: Pt(t == null ? void 0 : t.schemas),
1832
1847
  usage: "response"
1833
1848
  });
1834
1849
  c = typeof u == "string" ? u : JSON.stringify(u, null, 2);
1835
1850
  }
1836
1851
  return { status: i, headers: { "Content-Type": a }, body: c };
1837
1852
  }
1838
- const O = (e) => !!e && typeof e == "object" && !Array.isArray(e), z = (e) => typeof e == "string" ? e : void 0, Rt = ["get", "put", "post", "delete", "options", "head", "patch", "trace"], Dn = ["query", "path", "header", "cookie"];
1839
- function bt(e, t) {
1853
+ const N = (e) => !!e && typeof e == "object" && !Array.isArray(e), z = (e) => typeof e == "string" ? e : void 0, Mt = ["get", "put", "post", "delete", "options", "head", "patch", "trace"], zn = ["query", "path", "header", "cookie"];
1854
+ function kt(e, t) {
1840
1855
  const n = t.indexOf("#"), s = n >= 0 ? t.slice(n + 1) : "";
1841
1856
  if (!s || s === "/")
1842
1857
  return e;
1843
1858
  let r = e;
1844
1859
  for (const o of s.split("/").slice(1)) {
1845
1860
  const i = decodeURIComponent(o).replace(/~1/g, "/").replace(/~0/g, "~");
1846
- if (O(r))
1861
+ if (N(r))
1847
1862
  r = r[i];
1848
1863
  else if (Array.isArray(r))
1849
1864
  r = r[Number(i)];
@@ -1868,22 +1883,22 @@ function We(e) {
1868
1883
  for (const s of n) {
1869
1884
  const r = t.find(s);
1870
1885
  if (r)
1871
- return [r, O(e[r]) ? e[r] : {}];
1886
+ return [r, N(e[r]) ? e[r] : {}];
1872
1887
  }
1873
1888
  }
1874
- function Hn(e, t = {}) {
1875
- var x, E, M;
1889
+ function Wn(e, t = {}) {
1890
+ var x, _, M;
1876
1891
  let n = typeof e == "string" ? Ge(e, t.parseYaml) : e;
1877
- if (!O(n))
1892
+ if (!N(n))
1878
1893
  throw new Error("Not an OpenAPI document");
1879
1894
  if (typeof n.swagger == "string")
1880
- n = zn(n);
1895
+ n = Bn(n);
1881
1896
  else if (typeof n.openapi != "string")
1882
1897
  throw new Error('Not an OpenAPI document: no "openapi" or "swagger" version');
1883
1898
  const s = n, r = t.baseUrlVariable ?? "baseUrl", o = /* @__PURE__ */ new Map(), i = (h) => {
1884
1899
  var A;
1885
1900
  if (h.startsWith("#"))
1886
- return bt(s, h);
1901
+ return kt(s, h);
1887
1902
  const g = h.split("#")[0];
1888
1903
  if (!o.has(g)) {
1889
1904
  const U = (A = t.resolveRef) == null ? void 0 : A.call(t, g);
@@ -1892,41 +1907,41 @@ function Hn(e, t = {}) {
1892
1907
  typeof U == "string" ? Ge(U, t.parseYaml) : U
1893
1908
  );
1894
1909
  }
1895
- return bt(o.get(g), h);
1910
+ return kt(o.get(g), h);
1896
1911
  }, a = (h) => {
1897
1912
  let g = h;
1898
- for (let A = 0; A < 20 && O(g) && typeof g.$ref == "string"; A++)
1913
+ for (let A = 0; A < 20 && N(g) && typeof g.$ref == "string"; A++)
1899
1914
  g = i(g.$ref);
1900
1915
  return g;
1901
1916
  }, c = (h, g = 0) => {
1902
- if (!O(h))
1917
+ if (!N(h))
1903
1918
  return;
1904
1919
  if (typeof h.$ref == "string")
1905
1920
  return /^#\/components\/schemas\//.test(h.$ref) ? { $ref: h.$ref } : g > 12 ? {} : c(i(h.$ref), g + 1);
1906
1921
  const A = { ...h };
1907
- if (O(h.properties)) {
1922
+ if (N(h.properties)) {
1908
1923
  A.properties = {};
1909
1924
  for (const [U, C] of Object.entries(h.properties))
1910
1925
  A.properties[U] = c(C, g + 1) ?? {};
1911
1926
  }
1912
- h.items !== void 0 && (A.items = c(h.items, g + 1)), O(h.additionalProperties) && (A.additionalProperties = c(h.additionalProperties, g + 1));
1927
+ h.items !== void 0 && (A.items = c(h.items, g + 1)), N(h.additionalProperties) && (A.additionalProperties = c(h.additionalProperties, g + 1));
1913
1928
  for (const U of ["allOf", "oneOf", "anyOf"]) {
1914
1929
  const C = h[U];
1915
1930
  Array.isArray(C) && (A[U] = C.map((q) => c(q, g + 1) ?? {}));
1916
1931
  }
1917
1932
  return A;
1918
- }, p = O(s.components) ? s.components : {}, u = {};
1919
- if (O(p.schemas))
1933
+ }, p = N(s.components) ? s.components : {}, u = {};
1934
+ if (N(p.schemas))
1920
1935
  for (const [h, g] of Object.entries(p.schemas))
1921
1936
  u[h] = c(g) ?? {};
1922
- const f = Lt(u), d = (h) => {
1923
- if (!O(h))
1937
+ const f = Pt(u), d = (h) => {
1938
+ if (!N(h))
1924
1939
  return;
1925
1940
  const g = Object.values(h)[0], A = a(g);
1926
- return O(A) ? A.value : void 0;
1927
- }, l = /* @__PURE__ */ new Map(), m = (h, g = !1) => (l.has(h) || l.set(h, { key: h, value: "", secret: g || void 0 }), `{{${h}}}`), k = O(p.securitySchemes) ? p.securitySchemes : {}, y = (h, g) => {
1941
+ return N(A) ? A.value : void 0;
1942
+ }, l = /* @__PURE__ */ new Map(), m = (h, g = !1) => (l.has(h) || l.set(h, { key: h, value: "", secret: g || void 0 }), `{{${h}}}`), k = N(p.securitySchemes) ? p.securitySchemes : {}, y = (h, g) => {
1928
1943
  const A = a(k[h]);
1929
- if (!O(A))
1944
+ if (!N(A))
1930
1945
  return;
1931
1946
  const U = h.replace(/[^\w.-]/g, "_");
1932
1947
  switch (A.type) {
@@ -1960,7 +1975,7 @@ function Hn(e, t = {}) {
1960
1975
  };
1961
1976
  }
1962
1977
  case "oauth2": {
1963
- const C = O(A.flows) ? A.flows : {}, I = ["authorizationCode", "clientCredentials", "password", "implicit"].find((re) => O(C[re])) ?? "clientCredentials", D = C[I] ?? {}, B = Array.isArray(g) && g.length ? g.join(" ") : void 0;
1978
+ const C = N(A.flows) ? A.flows : {}, I = ["authorizationCode", "clientCredentials", "password", "implicit"].find((re) => N(C[re])) ?? "clientCredentials", D = C[I] ?? {}, B = Array.isArray(g) && g.length ? g.join(" ") : void 0;
1964
1979
  return {
1965
1980
  type: "oauth2",
1966
1981
  grant: I,
@@ -1993,7 +2008,7 @@ function Hn(e, t = {}) {
1993
2008
  if (!h.length)
1994
2009
  return { type: "none" };
1995
2010
  for (const g of h) {
1996
- if (!O(g))
2011
+ if (!N(g))
1997
2012
  continue;
1998
2013
  const A = Object.keys(g);
1999
2014
  if (!A.length)
@@ -2006,27 +2021,27 @@ function Hn(e, t = {}) {
2006
2021
  }, $ = (h) => {
2007
2022
  var B, re;
2008
2023
  const g = a(h);
2009
- if (!O(g) || typeof g.name != "string")
2024
+ if (!N(g) || typeof g.name != "string")
2010
2025
  return null;
2011
- const A = Dn.find((ie) => ie === g.in);
2026
+ const A = zn.find((ie) => ie === g.in);
2012
2027
  if (!A || A === "header" && /^(accept|content-type|authorization)$/i.test(g.name))
2013
2028
  return null;
2014
- const U = c(g.schema) ?? (O(g.content) ? c((B = We(g.content)) == null ? void 0 : B[1].schema) : void 0), C = U != null && U.$ref ? f(U.$ref) : U, q = g.example ?? d(g.examples) ?? (C == null ? void 0 : C.example) ?? (C == null ? void 0 : C.default) ?? ((re = C == null ? void 0 : C.enum) == null ? void 0 : re[0]), I = A === "path" || g.required === !0, D = { key: g.name, value: ue(q), in: A };
2029
+ const U = c(g.schema) ?? (N(g.content) ? c((B = We(g.content)) == null ? void 0 : B[1].schema) : void 0), C = U != null && U.$ref ? f(U.$ref) : U, q = g.example ?? d(g.examples) ?? (C == null ? void 0 : C.example) ?? (C == null ? void 0 : C.default) ?? ((re = C == null ? void 0 : C.enum) == null ? void 0 : re[0]), I = A === "path" || g.required === !0, D = { key: g.name, value: ue(q), in: A };
2015
2030
  return I && (D.required = !0), !I && q === void 0 && (D.enabled = !1), typeof g.description == "string" && (D.description = g.description), U && (D.schema = U), typeof g.style == "string" && (D.style = g.style), typeof g.explode == "boolean" && (D.explode = g.explode), D;
2016
2031
  }, T = (h, g) => {
2017
- const A = c(g.schema), U = g.example ?? d(g.examples), C = U !== void 0 ? U : Pt(A, { resolveRef: f, usage: "request" }), q = (I) => {
2032
+ const A = c(g.schema), U = g.example ?? d(g.examples), C = U !== void 0 ? U : Rt(A, { resolveRef: f, usage: "request" }), q = (I) => {
2018
2033
  const D = I != null && I.$ref ? f(I.$ref) : I;
2019
2034
  return (D == null ? void 0 : D.properties) ?? {};
2020
2035
  };
2021
2036
  if (h === "application/x-www-form-urlencoded") {
2022
- const I = O(C) ? C : {};
2037
+ const I = N(C) ? C : {};
2023
2038
  return {
2024
2039
  kind: "form",
2025
2040
  fields: (Object.keys(I).length ? Object.keys(I) : Object.keys(q(A))).map((B) => ({ key: B, value: ue(I[B]) }))
2026
2041
  };
2027
2042
  }
2028
2043
  if (h.startsWith("multipart/")) {
2029
- const I = O(C) ? C : {};
2044
+ const I = N(C) ? C : {};
2030
2045
  return {
2031
2046
  kind: "multipart",
2032
2047
  parts: Object.entries(q(A)).map(([D, B]) => {
@@ -2045,11 +2060,11 @@ function Hn(e, t = {}) {
2045
2060
  } : { kind: "binary", contentType: h };
2046
2061
  }, b = (h) => {
2047
2062
  const g = a(h);
2048
- if (!O(g))
2063
+ if (!N(g))
2049
2064
  return {};
2050
2065
  const A = {};
2051
2066
  typeof g.description == "string" && (A.description = g.description);
2052
- const U = O(g.content) ? We(g.content) : void 0;
2067
+ const U = N(g.content) ? We(g.content) : void 0;
2053
2068
  if (U) {
2054
2069
  const [C, q] = U;
2055
2070
  A.contentType = C;
@@ -2058,19 +2073,19 @@ function Hn(e, t = {}) {
2058
2073
  const D = q.example ?? d(q.examples);
2059
2074
  D !== void 0 && (A.example = typeof D == "string" ? D : JSON.stringify(D, null, 2));
2060
2075
  }
2061
- return O(g.headers) && (A.headers = Object.entries(g.headers).map(([C, q]) => {
2076
+ return N(g.headers) && (A.headers = Object.entries(g.headers).map(([C, q]) => {
2062
2077
  const I = a(q);
2063
- return { key: C, value: "", description: O(I) ? z(I.description) : void 0 };
2078
+ return { key: C, value: "", description: N(I) ? z(I.description) : void 0 };
2064
2079
  })), A;
2065
- }, S = v(s.security), w = [], N = O(s.paths) ? s.paths : {};
2066
- for (const [h, g] of Object.entries(N)) {
2080
+ }, S = v(s.security), w = [], O = N(s.paths) ? s.paths : {};
2081
+ for (const [h, g] of Object.entries(O)) {
2067
2082
  const A = a(g);
2068
- if (!O(A))
2083
+ if (!N(A))
2069
2084
  continue;
2070
2085
  const U = Array.isArray(A.parameters) ? A.parameters : [];
2071
- for (const C of Rt) {
2086
+ for (const C of Mt) {
2072
2087
  const q = A[C];
2073
- if (!O(q))
2088
+ if (!N(q))
2074
2089
  continue;
2075
2090
  const I = [];
2076
2091
  for (const G of [...U, ...Array.isArray(q.parameters) ? q.parameters : []]) {
@@ -2082,59 +2097,59 @@ function Hn(e, t = {}) {
2082
2097
  }
2083
2098
  let D = { kind: "none" };
2084
2099
  const B = a(q.requestBody);
2085
- if (O(B) && O(B.content)) {
2100
+ if (N(B) && N(B.content)) {
2086
2101
  const G = We(B.content);
2087
2102
  G && (D = T(G[0], G[1]), ((x = Ce(D)) == null ? void 0 : x.split(";")[0]) !== G[0] && D.kind !== "multipart" && I.push({ key: "Content-Type", value: G[0], in: "header" }));
2088
2103
  }
2089
2104
  const re = {};
2090
- if (O(q.responses))
2105
+ if (N(q.responses))
2091
2106
  for (const [G, ce] of Object.entries(q.responses))
2092
2107
  re[G] = b(ce);
2093
- const ie = (E = Object.entries(re).find(([G]) => /^2/.test(G))) == null ? void 0 : E[1];
2108
+ const ie = (_ = Object.entries(re).find(([G]) => /^2/.test(G))) == null ? void 0 : _[1];
2094
2109
  ie != null && ie.contentType && ie.contentType !== "*/*" && I.push({ key: "Accept", value: ie.contentType, in: "header" });
2095
- let _e = v(q.security);
2096
- _e && S && JSON.stringify(_e) === JSON.stringify(S) && (_e = void 0);
2097
- const le = Array.isArray(q.tags) ? q.tags.filter((G) => typeof G == "string") : void 0, Yt = ye({
2110
+ let Ee = v(q.security);
2111
+ Ee && S && JSON.stringify(Ee) === JSON.stringify(S) && (Ee = void 0);
2112
+ const le = Array.isArray(q.tags) ? q.tags.filter((G) => typeof G == "string") : void 0, Zt = ye({
2098
2113
  name: z(q.summary) ?? z(q.operationId) ?? `${C.toUpperCase()} ${h}`,
2099
2114
  method: C.toUpperCase(),
2100
2115
  url: `{{${r}}}${h}`,
2101
2116
  params: I,
2102
2117
  body: D,
2103
- auth: _e,
2118
+ auth: Ee,
2104
2119
  description: z(q.description),
2105
2120
  operationId: z(q.operationId),
2106
2121
  tags: le != null && le.length ? le : void 0,
2107
2122
  deprecated: q.deprecated === !0 || void 0,
2108
2123
  responses: Object.keys(re).length ? re : void 0
2109
2124
  });
2110
- w.push({ request: Yt, tag: le == null ? void 0 : le[0], segment: h.split("/").filter(Boolean)[0] });
2125
+ w.push({ request: Zt, tag: le == null ? void 0 : le[0], segment: h.split("/").filter(Boolean)[0] });
2111
2126
  }
2112
2127
  }
2113
2128
  const P = [], R = t.groupBy ?? "tag";
2114
2129
  if (R === "none")
2115
2130
  P.push(...w.map((h) => h.request));
2116
2131
  else {
2117
- const h = /* @__PURE__ */ new Map(), g = Array.isArray(s.tags) ? s.tags.filter(O) : [];
2132
+ const h = /* @__PURE__ */ new Map(), g = Array.isArray(s.tags) ? s.tags.filter(N) : [];
2118
2133
  if (R === "tag")
2119
2134
  for (const A of g)
2120
- typeof A.name == "string" && h.set(A.name, xe({ name: A.name, description: z(A.description) }));
2135
+ typeof A.name == "string" && h.set(A.name, Te({ name: A.name, description: z(A.description) }));
2121
2136
  for (const { request: A, tag: U, segment: C } of w) {
2122
2137
  const q = R === "tag" ? U : C;
2123
2138
  if (!q) {
2124
2139
  P.push(A);
2125
2140
  continue;
2126
2141
  }
2127
- h.has(q) || h.set(q, xe({ name: q })), h.get(q).items.push(A);
2142
+ h.has(q) || h.set(q, Te({ name: q })), h.get(q).items.push(A);
2128
2143
  }
2129
2144
  P.unshift(...[...h.values()].filter((A) => A.items.length));
2130
2145
  }
2131
- const H = (Array.isArray(s.servers) ? s.servers.filter(O) : []).map((h) => {
2146
+ const H = (Array.isArray(s.servers) ? s.servers.filter(N) : []).map((h) => {
2132
2147
  let g = z(h.url) ?? "";
2133
- if (O(h.variables))
2148
+ if (N(h.variables))
2134
2149
  for (const [A, U] of Object.entries(h.variables))
2135
- O(U) && (g = g.split(`{${A}}`).join(ue(U.default)));
2150
+ N(U) && (g = g.split(`{${A}}`).join(ue(U.default)));
2136
2151
  return { url: g, description: z(h.description) };
2137
- }), j = O(s.info) ? s.info : {};
2152
+ }), j = N(s.info) ? s.info : {};
2138
2153
  return ge({
2139
2154
  name: z(j.title) ?? "API",
2140
2155
  description: z(j.description),
@@ -2146,21 +2161,21 @@ function Hn(e, t = {}) {
2146
2161
  schemas: Object.keys(u).length ? u : void 0
2147
2162
  });
2148
2163
  }
2149
- function zn(e) {
2164
+ function Bn(e) {
2150
2165
  const t = (y) => {
2151
2166
  if (Array.isArray(y))
2152
2167
  return y.map(t);
2153
- if (!O(y))
2168
+ if (!N(y))
2154
2169
  return y;
2155
2170
  const v = {};
2156
2171
  for (const [$, T] of Object.entries(y))
2157
2172
  v[$] = $ === "$ref" && typeof T == "string" ? T.replace("#/definitions/", "#/components/schemas/").replace("#/responses/", "#/components/responses/") : t(T);
2158
2173
  return v;
2159
- }, n = t(e), s = Array.isArray(n.consumes) ? n.consumes : ["application/json"], r = Array.isArray(n.produces) ? n.produces : ["application/json"], o = O(n.parameters) ? n.parameters : {}, i = (y) => {
2160
- if (O(y)) {
2174
+ }, n = t(e), s = Array.isArray(n.consumes) ? n.consumes : ["application/json"], r = Array.isArray(n.produces) ? n.produces : ["application/json"], o = N(n.parameters) ? n.parameters : {}, i = (y) => {
2175
+ if (N(y)) {
2161
2176
  if (typeof y.$ref == "string" && y.$ref.startsWith("#/parameters/")) {
2162
2177
  const v = o[y.$ref.slice(13)];
2163
- return O(v) ? v : void 0;
2178
+ return N(v) ? v : void 0;
2164
2179
  }
2165
2180
  return y;
2166
2181
  }
@@ -2181,11 +2196,11 @@ function zn(e) {
2181
2196
  y[$] !== void 0 && (v[$] = y[$]);
2182
2197
  return v.type === "file" && (v.type = "string", v.format = "binary"), v;
2183
2198
  }, c = (y, v) => {
2184
- if (!O(y) || typeof y.$ref == "string")
2199
+ if (!N(y) || typeof y.$ref == "string")
2185
2200
  return y;
2186
2201
  const $ = { description: y.description ?? "" };
2187
2202
  if (y.schema !== void 0) {
2188
- const T = O(y.examples) ? y.examples : {};
2203
+ const T = N(y.examples) ? y.examples : {};
2189
2204
  $.content = Object.fromEntries(
2190
2205
  v.map((b) => [
2191
2206
  b,
@@ -2193,10 +2208,10 @@ function zn(e) {
2193
2208
  ])
2194
2209
  );
2195
2210
  }
2196
- return O(y.headers) && ($.headers = Object.fromEntries(
2211
+ return N(y.headers) && ($.headers = Object.fromEntries(
2197
2212
  Object.entries(y.headers).map(([T, b]) => [
2198
2213
  T,
2199
- O(b) ? { description: b.description, schema: a(b) } : b
2214
+ N(b) ? { description: b.description, schema: a(b) } : b
2200
2215
  ])
2201
2216
  )), $;
2202
2217
  }, p = (y, v) => {
@@ -2204,32 +2219,32 @@ function zn(e) {
2204
2219
  delete T.consumes, delete T.produces, delete T.schemes;
2205
2220
  const b = [], S = [];
2206
2221
  for (const w of [...v, ...Array.isArray(y.parameters) ? y.parameters : []]) {
2207
- const N = i(w);
2208
- if (N)
2209
- if (N.in === "body")
2222
+ const O = i(w);
2223
+ if (O)
2224
+ if (O.in === "body")
2210
2225
  T.requestBody = {
2211
- description: N.description,
2212
- required: N.required,
2213
- content: Object.fromEntries($.map((P) => [P, { schema: N.schema }]))
2226
+ description: O.description,
2227
+ required: O.required,
2228
+ content: Object.fromEntries($.map((P) => [P, { schema: O.schema }]))
2214
2229
  };
2215
- else if (N.in === "formData")
2216
- S.push(N);
2230
+ else if (O.in === "formData")
2231
+ S.push(O);
2217
2232
  else {
2218
2233
  const P = {
2219
- name: N.name,
2220
- in: N.in,
2221
- description: N.description,
2222
- required: N.required,
2223
- schema: a(N)
2234
+ name: O.name,
2235
+ in: O.in,
2236
+ description: O.description,
2237
+ required: O.required,
2238
+ schema: a(O)
2224
2239
  };
2225
- N["x-example"] !== void 0 && (P.example = N["x-example"]), b.push(P);
2240
+ O["x-example"] !== void 0 && (P.example = O["x-example"]), b.push(P);
2226
2241
  }
2227
2242
  }
2228
2243
  if (S.length) {
2229
- const N = $.includes("multipart/form-data") || S.some((R) => R.type === "file") ? "multipart/form-data" : "application/x-www-form-urlencoded", P = S.filter((R) => R.required).map((R) => String(R.name));
2244
+ const O = $.includes("multipart/form-data") || S.some((R) => R.type === "file") ? "multipart/form-data" : "application/x-www-form-urlencoded", P = S.filter((R) => R.required).map((R) => String(R.name));
2230
2245
  T.requestBody = {
2231
2246
  content: {
2232
- [N]: {
2247
+ [O]: {
2233
2248
  schema: {
2234
2249
  type: "object",
2235
2250
  properties: Object.fromEntries(
@@ -2244,25 +2259,25 @@ function zn(e) {
2244
2259
  }
2245
2260
  };
2246
2261
  }
2247
- if (T.parameters = b, O(y.responses)) {
2262
+ if (T.parameters = b, N(y.responses)) {
2248
2263
  const w = Array.isArray(y.produces) ? y.produces : r;
2249
2264
  T.responses = Object.fromEntries(
2250
- Object.entries(y.responses).map(([N, P]) => [N, c(P, w)])
2265
+ Object.entries(y.responses).map(([O, P]) => [O, c(P, w)])
2251
2266
  );
2252
2267
  }
2253
2268
  return T;
2254
2269
  }, u = {};
2255
- if (O(n.paths))
2270
+ if (N(n.paths))
2256
2271
  for (const [y, v] of Object.entries(n.paths)) {
2257
- if (!O(v))
2272
+ if (!N(v))
2258
2273
  continue;
2259
2274
  const $ = Array.isArray(v.parameters) ? v.parameters : [], T = {};
2260
2275
  for (const [b, S] of Object.entries(v))
2261
- Rt.includes(b) && O(S) ? T[b] = p(S, $) : b !== "parameters" && (T[b] = S);
2276
+ Mt.includes(b) && N(S) ? T[b] = p(S, $) : b !== "parameters" && (T[b] = S);
2262
2277
  u[y] = T;
2263
2278
  }
2264
2279
  const f = {};
2265
- if (O(n.securityDefinitions)) {
2280
+ if (N(n.securityDefinitions)) {
2266
2281
  const y = {
2267
2282
  implicit: "implicit",
2268
2283
  password: "password",
@@ -2270,7 +2285,7 @@ function zn(e) {
2270
2285
  accessCode: "authorizationCode"
2271
2286
  };
2272
2287
  for (const [v, $] of Object.entries(n.securityDefinitions))
2273
- O($) && ($.type === "basic" ? f[v] = { type: "http", scheme: "basic", description: $.description } : $.type === "apiKey" ? f[v] = {
2288
+ N($) && ($.type === "basic" ? f[v] = { type: "http", scheme: "basic", description: $.description } : $.type === "apiKey" ? f[v] = {
2274
2289
  type: "apiKey",
2275
2290
  name: $.name,
2276
2291
  in: $.in,
@@ -2288,7 +2303,7 @@ function zn(e) {
2288
2303
  }));
2289
2304
  }
2290
2305
  const d = {};
2291
- if (O(n.responses))
2306
+ if (N(n.responses))
2292
2307
  for (const [y, v] of Object.entries(n.responses))
2293
2308
  d[y] = c(v, r);
2294
2309
  const l = z(n.host), m = z(n.basePath) ?? "", k = Array.isArray(n.schemes) && typeof n.schemes[0] == "string" ? n.schemes[0] : "https";
@@ -2306,7 +2321,32 @@ function zn(e) {
2306
2321
  }
2307
2322
  };
2308
2323
  }
2309
- function Wn(e) {
2324
+ function Ms(e) {
2325
+ const t = /* @__PURE__ */ new Map(), n = (s, r) => {
2326
+ if (!s || s.type === "none" || s.type === "inherit")
2327
+ return;
2328
+ const o = Dt(s);
2329
+ if (!o)
2330
+ return;
2331
+ const i = t.get(o.name) ?? {
2332
+ name: o.name,
2333
+ scheme: o.scheme,
2334
+ scopes: o.scopes,
2335
+ collectionDefault: !1,
2336
+ requestIds: []
2337
+ };
2338
+ r ? i.requestIds.push(r) : i.collectionDefault = !0, t.set(o.name, i);
2339
+ };
2340
+ n(e.auth);
2341
+ for (const { request: s, folders: r } of be(e.items)) {
2342
+ let o = s.auth;
2343
+ for (let i = r.length - 1; (!o || o.type === "inherit") && i >= 0; i--)
2344
+ o = r[i].auth;
2345
+ n(!o || o.type === "inherit" ? e.auth : o, s.id);
2346
+ }
2347
+ return [...t.values()];
2348
+ }
2349
+ function Dt(e) {
2310
2350
  switch (e.type) {
2311
2351
  case "bearer":
2312
2352
  return { name: "bearerAuth", scheme: { type: "http", scheme: "bearer" }, scopes: [] };
@@ -2363,7 +2403,7 @@ function Pe(e) {
2363
2403
  return e;
2364
2404
  }
2365
2405
  }
2366
- function Bn(e, t) {
2406
+ function Fn(e, t) {
2367
2407
  let n = e.split("?")[0].split("#")[0];
2368
2408
  for (const s of t)
2369
2409
  if (s && n.startsWith(s)) {
@@ -2372,7 +2412,7 @@ function Bn(e, t) {
2372
2412
  }
2373
2413
  return n = n.replace(/^[a-z][\w+.-]*:\/\/[^/]*/i, "").replace(/^\{\{[^}]+\}\}/, ""), n = n.replace(/(^|\/):([A-Za-z_][\w-]*)/g, "$1{$2}"), n.startsWith("/") ? n : `/${n}`;
2374
2414
  }
2375
- function Fn(e, t) {
2415
+ function Vn(e, t) {
2376
2416
  const n = t == null ? void 0 : t.split(";")[0].trim();
2377
2417
  switch (e.kind) {
2378
2418
  case "none":
@@ -2460,20 +2500,20 @@ function Fn(e, t) {
2460
2500
  return;
2461
2501
  }
2462
2502
  }
2463
- function Vn(e, t = {}) {
2503
+ function Kn(e, t = {}) {
2464
2504
  var l, m, k, y, v, $, T;
2465
2505
  const n = t.baseUrlVariable ?? "baseUrl", s = (l = e.variables.find((b) => b.key === n)) == null ? void 0 : l.value, r = (m = e.servers) != null && m.length ? e.servers : s ? [{ url: s }] : void 0, o = [`{{${n}}}`, ...(r ?? []).map((b) => b.url)], i = {}, a = (b) => {
2466
2506
  if (!b || b.type === "inherit")
2467
2507
  return;
2468
2508
  if (b.type === "none")
2469
2509
  return e.auth && e.auth.type !== "none" ? [] : void 0;
2470
- const S = Wn(b);
2510
+ const S = Dt(b);
2471
2511
  if (S)
2472
2512
  return i[S.name] = S.scheme, [{ [S.name]: S.scopes }];
2473
2513
  }, c = a(e.auth), p = {}, u = /* @__PURE__ */ new Map();
2474
- for (const { request: b, folders: S } of Oe(e.items)) {
2475
- const w = Bn(b.url, o), N = b.method.toLowerCase();
2476
- if (p[w] ?? (p[w] = {}), p[w][N])
2514
+ for (const { request: b, folders: S } of be(e.items)) {
2515
+ const w = Fn(b.url, o), O = b.method.toLowerCase();
2516
+ if (p[w] ?? (p[w] = {}), p[w][O])
2477
2517
  continue;
2478
2518
  for (const h of S)
2479
2519
  u.set(h.name, h.description);
@@ -2484,30 +2524,30 @@ function Vn(e, t = {}) {
2484
2524
  (h) => h.in === "header" && /^content-type$/i.test(h.key)
2485
2525
  )) == null ? void 0 : y.value, j = { summary: b.name };
2486
2526
  b.operationId && (j.operationId = b.operationId), b.description && (j.description = b.description), P && (j.tags = P), b.deprecated && (j.deprecated = !0), R.length && (j.parameters = R);
2487
- const x = Fn(b.body, H);
2527
+ const x = Vn(b.body, H);
2488
2528
  x && (j.requestBody = x);
2489
- const E = {};
2529
+ const _ = {};
2490
2530
  for (const [h, g] of Object.entries(b.responses ?? {})) {
2491
2531
  const A = { description: g.description ?? "" };
2492
2532
  if (g.contentType) {
2493
2533
  const U = {};
2494
2534
  g.schema && (U.schema = g.schema), g.example !== void 0 && (U.example = /json/.test(g.contentType) ? Pe(g.example) : g.example), A.content = { [g.contentType]: U };
2495
2535
  }
2496
- E[h] = A;
2536
+ _[h] = A;
2497
2537
  }
2498
2538
  for (const h of b.examples ?? []) {
2499
2539
  const g = String(h.status);
2500
- if (E[g])
2540
+ if (_[g])
2501
2541
  continue;
2502
2542
  const A = ((T = ($ = (v = h.headers) == null ? void 0 : v.find((U) => /^content-type$/i.test(U.key))) == null ? void 0 : $.value) == null ? void 0 : T.split(";")[0]) ?? "application/json";
2503
- E[g] = {
2543
+ _[g] = {
2504
2544
  description: h.name,
2505
2545
  content: { [A]: { example: /json/.test(A) ? Pe(h.body) : h.body } }
2506
2546
  };
2507
2547
  }
2508
- j.responses = Object.keys(E).length ? E : { 200: { description: "OK" } };
2548
+ j.responses = Object.keys(_).length ? _ : { 200: { description: "OK" } };
2509
2549
  const M = a(b.auth);
2510
- M && (j.security = M), p[w][N] = j;
2550
+ M && (j.security = M), p[w][O] = j;
2511
2551
  }
2512
2552
  const f = {
2513
2553
  openapi: "3.1.0",
@@ -2523,22 +2563,22 @@ function Vn(e, t = {}) {
2523
2563
  const d = {};
2524
2564
  return e.schemas && Object.keys(e.schemas).length && (d.schemas = e.schemas), Object.keys(i).length && (d.securitySchemes = i), Object.keys(d).length && (f.components = d), f;
2525
2565
  }
2526
- function Ps(e, t = {}) {
2527
- return Pn(Vn(e, t));
2566
+ function Ds(e, t = {}) {
2567
+ return Mn(Kn(e, t));
2528
2568
  }
2529
- const W = (e) => !!e && typeof e == "object" && !Array.isArray(e), _ = (e) => typeof e == "string" ? e : typeof e == "number" || typeof e == "boolean" ? String(e) : void 0, be = (e) => Array.isArray(e) ? e.filter(W) : [], Kn = "https://schema.getpostman.com/json/collection/v2.1.0/collection.json";
2530
- function Mt(e) {
2569
+ const W = (e) => !!e && typeof e == "object" && !Array.isArray(e), E = (e) => typeof e == "string" ? e : typeof e == "number" || typeof e == "boolean" ? String(e) : void 0, ke = (e) => Array.isArray(e) ? e.filter(W) : [], Jn = "https://schema.getpostman.com/json/collection/v2.1.0/collection.json";
2570
+ function Ht(e) {
2531
2571
  return W(e) && W(e.info) && Array.isArray(e.item);
2532
2572
  }
2533
2573
  function he(e) {
2534
2574
  if (typeof e == "string")
2535
2575
  return e || void 0;
2536
2576
  if (W(e))
2537
- return _(e.content);
2577
+ return E(e.content);
2538
2578
  }
2539
- function Te(e) {
2540
- return be(e).map((t) => {
2541
- const n = { key: _(t.key) ?? "", value: _(t.value) ?? "" };
2579
+ function Se(e) {
2580
+ return ke(e).map((t) => {
2581
+ const n = { key: E(t.key) ?? "", value: E(t.value) ?? "" };
2542
2582
  t.disabled === !0 && (n.enabled = !1);
2543
2583
  const s = he(t.description);
2544
2584
  return s && (n.description = s), n;
@@ -2550,9 +2590,9 @@ function pt(e) {
2550
2590
  const t = e[e.type], n = (s) => {
2551
2591
  var r;
2552
2592
  if (Array.isArray(t))
2553
- return _((r = t.filter(W).find((o) => o.key === s)) == null ? void 0 : r.value);
2593
+ return E((r = t.filter(W).find((o) => o.key === s)) == null ? void 0 : r.value);
2554
2594
  if (W(t))
2555
- return _(t[s]);
2595
+ return E(t[s]);
2556
2596
  };
2557
2597
  switch (e.type) {
2558
2598
  case "noauth":
@@ -2613,121 +2653,121 @@ function pt(e) {
2613
2653
  return;
2614
2654
  }
2615
2655
  }
2616
- function Jn(e) {
2656
+ function Qn(e) {
2617
2657
  if (typeof e == "string") {
2618
2658
  const { base: o, query: i, hash: a } = pe(e);
2619
2659
  return { url: o + a, params: i.map((c) => ({ ...c, in: "query" })) };
2620
2660
  }
2621
2661
  if (!W(e))
2622
2662
  return { url: "", params: [] };
2623
- const t = _(e.raw);
2663
+ const t = E(e.raw);
2624
2664
  let n;
2625
2665
  if (t !== void 0)
2626
2666
  n = pe(t).base;
2627
2667
  else {
2628
- const o = _(e.protocol), i = Array.isArray(e.host) ? e.host.join(".") : _(e.host) ?? "", a = _(e.port), c = Array.isArray(e.path) ? e.path.map((p) => (W(p) ? _(p.value) : _(p)) ?? "").join("/") : _(e.path) ?? "";
2668
+ const o = E(e.protocol), i = Array.isArray(e.host) ? e.host.join(".") : E(e.host) ?? "", a = E(e.port), c = Array.isArray(e.path) ? e.path.map((p) => (W(p) ? E(p.value) : E(p)) ?? "").join("/") : E(e.path) ?? "";
2629
2669
  n = `${o ? `${o}://` : ""}${i}${a ? `:${a}` : ""}${c ? `/${c.replace(/^\//, "")}` : ""}`;
2630
2670
  }
2631
- const s = Array.isArray(e.query) ? Te(e.query).map((o) => ({ ...o, in: "query" })) : t !== void 0 ? pe(t).query.map((o) => ({ ...o, in: "query" })) : [], r = Te(e.variable).map((o) => ({
2671
+ const s = Array.isArray(e.query) ? Se(e.query).map((o) => ({ ...o, in: "query" })) : t !== void 0 ? pe(t).query.map((o) => ({ ...o, in: "query" })) : [], r = Se(e.variable).map((o) => ({
2632
2672
  ...o,
2633
2673
  in: "path",
2634
2674
  required: !0
2635
2675
  }));
2636
2676
  return { url: n, params: [...r, ...s] };
2637
2677
  }
2638
- function Qn(e) {
2678
+ function Gn(e) {
2639
2679
  if (!W(e))
2640
2680
  return { kind: "none" };
2641
2681
  switch (e.mode) {
2642
2682
  case "raw": {
2643
- const t = _(e.raw) ?? "", n = W(e.options) && W(e.options.raw) ? _(e.options.raw.language) : void 0;
2683
+ const t = E(e.raw) ?? "", n = W(e.options) && W(e.options.raw) ? E(e.options.raw.language) : void 0;
2644
2684
  return n === "json" ? { kind: "json", text: t } : n === "xml" ? /<(\w+:)?Envelope[\s>]/.test(t) ? { kind: "soap", envelope: t, version: "1.1" } : { kind: "xml", text: t } : n === "html" ? { kind: "text", text: t, contentType: "text/html" } : n === "javascript" ? { kind: "text", text: t, contentType: "application/javascript" } : !n && /^\s*[[{]/.test(t) ? { kind: "json", text: t } : { kind: "text", text: t };
2645
2685
  }
2646
2686
  case "urlencoded":
2647
- return { kind: "form", fields: Te(e.urlencoded) };
2687
+ return { kind: "form", fields: Se(e.urlencoded) };
2648
2688
  case "formdata":
2649
2689
  return {
2650
2690
  kind: "multipart",
2651
- parts: be(e.formdata).map((t) => {
2652
- const n = t.type === "file", s = Array.isArray(t.src) ? _(t.src[0]) : _(t.src), r = {
2653
- key: _(t.key) ?? "",
2654
- value: n ? "" : _(t.value) ?? "",
2691
+ parts: ke(e.formdata).map((t) => {
2692
+ const n = t.type === "file", s = Array.isArray(t.src) ? E(t.src[0]) : E(t.src), r = {
2693
+ key: E(t.key) ?? "",
2694
+ value: n ? "" : E(t.value) ?? "",
2655
2695
  type: n ? "file" : "text",
2656
2696
  ...n && s ? { fileName: s } : {},
2657
- ..._(t.contentType) ? { contentType: _(t.contentType) } : {}
2697
+ ...E(t.contentType) ? { contentType: E(t.contentType) } : {}
2658
2698
  };
2659
2699
  return t.disabled === !0 ? { ...r, enabled: !1 } : r;
2660
2700
  })
2661
2701
  };
2662
2702
  case "file":
2663
- return { kind: "binary", fileName: W(e.file) ? _(e.file.src) : void 0 };
2703
+ return { kind: "binary", fileName: W(e.file) ? E(e.file.src) : void 0 };
2664
2704
  case "graphql": {
2665
2705
  const t = W(e.graphql) ? e.graphql : {};
2666
- return { kind: "graphql", query: _(t.query) ?? "", variables: _(t.variables) };
2706
+ return { kind: "graphql", query: E(t.query) ?? "", variables: E(t.variables) };
2667
2707
  }
2668
2708
  default:
2669
2709
  return { kind: "none" };
2670
2710
  }
2671
2711
  }
2672
- function Dt(e) {
2712
+ function zt(e) {
2673
2713
  const t = {};
2674
- for (const n of be(e)) {
2675
- const s = W(n.script) ? n.script : {}, r = Array.isArray(s.exec) ? s.exec.map((o) => _(o) ?? "").join(`
2676
- `) : _(s.exec) ?? "";
2714
+ for (const n of ke(e)) {
2715
+ const s = W(n.script) ? n.script : {}, r = Array.isArray(s.exec) ? s.exec.map((o) => E(o) ?? "").join(`
2716
+ `) : E(s.exec) ?? "";
2677
2717
  r.trim() && (n.listen === "prerequest" && (t.preRequest = r), n.listen === "test" && (t.test = r));
2678
2718
  }
2679
2719
  return t.preRequest || t.test ? t : void 0;
2680
2720
  }
2681
- function Gn(e) {
2682
- const t = W(e.request) ? e.request : typeof e.request == "string" ? { url: e.request } : {}, { url: n, params: s } = Jn(t.url), r = Te(t.header).map((i) => ({ ...i, in: "header" })), o = be(e.response).map((i) => ({
2683
- name: _(i.name) ?? "Example",
2721
+ function Yn(e) {
2722
+ const t = W(e.request) ? e.request : typeof e.request == "string" ? { url: e.request } : {}, { url: n, params: s } = Qn(t.url), r = Se(t.header).map((i) => ({ ...i, in: "header" })), o = ke(e.response).map((i) => ({
2723
+ name: E(i.name) ?? "Example",
2684
2724
  status: Number(i.code ?? 200) || 200,
2685
- headers: Te(i.header),
2686
- body: _(i.body)
2725
+ headers: Se(i.header),
2726
+ body: E(i.body)
2687
2727
  }));
2688
2728
  return ye({
2689
- id: _(e.id) ?? void 0,
2690
- name: _(e.name) ?? "Request",
2691
- method: (_(t.method) ?? "GET").toUpperCase(),
2729
+ id: E(e.id) ?? void 0,
2730
+ name: E(e.name) ?? "Request",
2731
+ method: (E(t.method) ?? "GET").toUpperCase(),
2692
2732
  url: n,
2693
2733
  params: [...s, ...r],
2694
- body: Qn(t.body),
2734
+ body: Gn(t.body),
2695
2735
  auth: pt(t.auth),
2696
2736
  description: he(t.description) ?? he(e.description),
2697
- scripts: Dt(e.event),
2737
+ scripts: zt(e.event),
2698
2738
  examples: o.length ? o : void 0
2699
2739
  });
2700
2740
  }
2701
- function Ht(e) {
2702
- return be(e).map(
2703
- (t) => Array.isArray(t.item) ? xe({
2704
- id: _(t.id) ?? void 0,
2705
- name: _(t.name) ?? "Folder",
2741
+ function Wt(e) {
2742
+ return ke(e).map(
2743
+ (t) => Array.isArray(t.item) ? Te({
2744
+ id: E(t.id) ?? void 0,
2745
+ name: E(t.name) ?? "Folder",
2706
2746
  description: he(t.description),
2707
- items: Ht(t.item),
2747
+ items: Wt(t.item),
2708
2748
  auth: pt(t.auth)
2709
- }) : Gn(t)
2749
+ }) : Yn(t)
2710
2750
  );
2711
2751
  }
2712
- function zt(e) {
2713
- return be(e).map((t) => {
2714
- const n = { key: _(t.key) ?? "", value: _(t.value) ?? "" };
2752
+ function Bt(e) {
2753
+ return ke(e).map((t) => {
2754
+ const n = { key: E(t.key) ?? "", value: E(t.value) ?? "" };
2715
2755
  t.type === "secret" && (n.secret = !0), (t.disabled === !0 || t.enabled === !1) && (n.enabled = !1);
2716
2756
  const s = he(t.description);
2717
2757
  return s && (n.description = s), n;
2718
2758
  });
2719
2759
  }
2720
- function Yn(e) {
2760
+ function Xn(e) {
2721
2761
  const t = typeof e == "string" ? JSON.parse(e) : e;
2722
- if (!Mt(t))
2762
+ if (!Ht(t))
2723
2763
  throw new Error("Not a Postman collection");
2724
- const n = t, s = n.info, r = Dt(n.event), o = ge({
2725
- id: _(s._postman_id) ?? void 0,
2726
- name: _(s.name) ?? "Postman collection",
2764
+ const n = t, s = n.info, r = zt(n.event), o = ge({
2765
+ id: E(s._postman_id) ?? void 0,
2766
+ name: E(s.name) ?? "Postman collection",
2727
2767
  description: he(s.description),
2728
- version: W(s.version) ? _(s.version.raw) : _(s.version),
2729
- items: Ht(n.item),
2730
- variables: zt(n.variable),
2768
+ version: W(s.version) ? E(s.version.raw) : E(s.version),
2769
+ items: Wt(n.item),
2770
+ variables: Bt(n.variable),
2731
2771
  auth: pt(n.auth)
2732
2772
  });
2733
2773
  if (r) {
@@ -2738,14 +2778,14 @@ function Yn(e) {
2738
2778
  }
2739
2779
  return o;
2740
2780
  }
2741
- function Xn(e) {
2781
+ function Zn(e) {
2742
2782
  const t = typeof e == "string" ? JSON.parse(e) : e;
2743
2783
  if (!W(t) || !Array.isArray(t.values))
2744
2784
  throw new Error("Not a Postman environment");
2745
2785
  return {
2746
- id: _(t.id) ?? Ne("e"),
2747
- name: _(t.name) ?? "Environment",
2748
- values: zt(t.values)
2786
+ id: E(t.id) ?? Ne("e"),
2787
+ name: E(t.name) ?? "Environment",
2788
+ values: Bt(t.values)
2749
2789
  };
2750
2790
  }
2751
2791
  const V = (e, t) => ({
@@ -2818,11 +2858,11 @@ function Xe(e) {
2818
2858
  return;
2819
2859
  }
2820
2860
  }
2821
- const Se = (e) => {
2861
+ const je = (e) => {
2822
2862
  const t = { key: e.key, value: e.value };
2823
2863
  return L(e) || (t.disabled = !0), e.description && (t.description = e.description), t;
2824
2864
  };
2825
- function Zn(e) {
2865
+ function es(e) {
2826
2866
  const t = e.params.filter((f) => f.in === "query"), n = Ue({
2827
2867
  ...e,
2828
2868
  params: e.params.filter((f) => f.in === "query" && L(f))
@@ -2831,11 +2871,11 @@ function Zn(e) {
2831
2871
  host: a ? a.startsWith("{{") ? [a] : a.split(".") : [],
2832
2872
  path: c.map((f) => f.replace(/^\{([A-Za-z_][\w.-]*)\}$/, ":$1"))
2833
2873
  };
2834
- r && (p.protocol = r[1]), t.length && (p.query = t.map(Se));
2874
+ r && (p.protocol = r[1]), t.length && (p.query = t.map(je));
2835
2875
  const u = e.params.filter((f) => f.in === "path");
2836
- return u.length && (p.variable = u.map(Se)), p;
2876
+ return u.length && (p.variable = u.map(je)), p;
2837
2877
  }
2838
- function es(e) {
2878
+ function ts(e) {
2839
2879
  switch (e.kind) {
2840
2880
  case "none":
2841
2881
  return;
@@ -2852,7 +2892,7 @@ function es(e) {
2852
2892
  options: { raw: { language: e.contentType === "text/html" ? "html" : "text" } }
2853
2893
  };
2854
2894
  case "form":
2855
- return { mode: "urlencoded", urlencoded: e.fields.map(Se) };
2895
+ return { mode: "urlencoded", urlencoded: e.fields.map(je) };
2856
2896
  case "multipart":
2857
2897
  return {
2858
2898
  mode: "formdata",
@@ -2869,7 +2909,7 @@ function es(e) {
2869
2909
  return;
2870
2910
  }
2871
2911
  }
2872
- function ts(e) {
2912
+ function ns(e) {
2873
2913
  const t = [];
2874
2914
  return e != null && e.preRequest && t.push({
2875
2915
  listen: "prerequest",
@@ -2881,18 +2921,18 @@ function ts(e) {
2881
2921
  `) }
2882
2922
  }), t.length ? t : void 0;
2883
2923
  }
2884
- function Wt(e) {
2924
+ function Ft(e) {
2885
2925
  if (e.kind === "folder") {
2886
- const a = { name: e.name, item: e.items.map(Wt) };
2926
+ const a = { name: e.name, item: e.items.map(Ft) };
2887
2927
  e.description && (a.description = e.description);
2888
2928
  const c = Xe(e.auth);
2889
2929
  return c && (a.auth = c), a;
2890
2930
  }
2891
2931
  const t = {
2892
2932
  method: e.method,
2893
- header: e.params.filter((a) => a.in === "header").map(Se),
2894
- url: Zn(e)
2895
- }, n = es(e.body);
2933
+ header: e.params.filter((a) => a.in === "header").map(je),
2934
+ url: es(e)
2935
+ }, n = ts(e.body);
2896
2936
  n && (t.body = n);
2897
2937
  const s = Xe(e.auth);
2898
2938
  s && (t.auth = s), e.description && (t.description = e.description);
@@ -2901,23 +2941,23 @@ function Wt(e) {
2901
2941
  key: "Cookie",
2902
2942
  value: r.map((a) => `${a.key}=${a.value}`).join("; ")
2903
2943
  });
2904
- const o = { name: e.name, request: t }, i = ts(e.scripts);
2944
+ const o = { name: e.name, request: t }, i = ns(e.scripts);
2905
2945
  return i && (o.event = i), o.response = (e.examples ?? []).map((a) => ({
2906
2946
  name: a.name,
2907
2947
  code: a.status,
2908
- header: (a.headers ?? []).map(Se),
2948
+ header: (a.headers ?? []).map(je),
2909
2949
  body: a.body ?? ""
2910
2950
  })), o;
2911
2951
  }
2912
- function Rs(e) {
2952
+ function Hs(e) {
2913
2953
  const t = {
2914
2954
  info: {
2915
2955
  _postman_id: e.id,
2916
2956
  name: e.name,
2917
2957
  ...e.description ? { description: e.description } : {},
2918
- schema: Kn
2958
+ schema: Jn
2919
2959
  },
2920
- item: e.items.map(Wt)
2960
+ item: e.items.map(Ft)
2921
2961
  };
2922
2962
  e.variables.length && (t.variable = e.variables.map((s) => {
2923
2963
  const r = { key: s.key, value: s.value, type: s.secret ? "secret" : "string" };
@@ -2926,7 +2966,7 @@ function Rs(e) {
2926
2966
  const n = Xe(e.auth);
2927
2967
  return n && (t.auth = n), t;
2928
2968
  }
2929
- function Ms(e) {
2969
+ function zs(e) {
2930
2970
  return {
2931
2971
  id: e.id,
2932
2972
  name: e.name,
@@ -2939,25 +2979,25 @@ function Ms(e) {
2939
2979
  _postman_variable_scope: "environment"
2940
2980
  };
2941
2981
  }
2942
- const fe = (e) => !!e && typeof e == "object" && !Array.isArray(e), K = (e) => typeof e == "string" ? e : void 0, Ze = (e) => Array.isArray(e) ? e.filter(fe) : [], ns = /^(image|font|audio|video)\/|^text\/css|javascript|^application\/(x-)?font|wasm/;
2943
- function $e(e) {
2982
+ const fe = (e) => !!e && typeof e == "object" && !Array.isArray(e), K = (e) => typeof e == "string" ? e : void 0, Ze = (e) => Array.isArray(e) ? e.filter(fe) : [], ss = /^(image|font|audio|video)\/|^text\/css|javascript|^application\/(x-)?font|wasm/;
2983
+ function we(e) {
2944
2984
  return Ze(e).map((t) => ({ key: K(t.name) ?? "", value: K(t.value) ?? "" }));
2945
2985
  }
2946
- function Bt(e) {
2986
+ function Vt(e) {
2947
2987
  return fe(e) && fe(e.log) && Array.isArray(e.log.entries);
2948
2988
  }
2949
- function ss(e, t = {}) {
2989
+ function rs(e, t = {}) {
2950
2990
  const n = typeof e == "string" ? JSON.parse(e) : e;
2951
- if (!Bt(n))
2991
+ if (!Vt(n))
2952
2992
  throw new Error("Not a HAR log");
2953
2993
  const s = Ze(n.log.entries), r = t.skipStatic ?? !0, o = [];
2954
2994
  for (const i of s) {
2955
2995
  if (t.filter && !t.filter(i))
2956
2996
  continue;
2957
2997
  const a = fe(i.request) ? i.request : {}, c = fe(i.response) ? i.response : {}, p = fe(c.content) ? c.content : {}, u = (K(p.mimeType) ?? "").toLowerCase();
2958
- if (r && ns.test(u))
2998
+ if (r && ss.test(u))
2959
2999
  continue;
2960
- const { base: f, query: d } = pe(K(a.url) ?? ""), l = Array.isArray(a.queryString) ? $e(a.queryString) : d, m = $e(a.cookies), k = $e(a.headers).filter(
3000
+ const { base: f, query: d } = pe(K(a.url) ?? ""), l = Array.isArray(a.queryString) ? we(a.queryString) : d, m = we(a.cookies), k = we(a.headers).filter(
2961
3001
  (w) => !w.key.startsWith(":") && !/^(content-length|host|connection)$/i.test(w.key) && !(m.length && /^cookie$/i.test(w.key))
2962
3002
  ), y = [
2963
3003
  ...l.map((w) => ({ ...w, in: "query" })),
@@ -2967,10 +3007,10 @@ function ss(e, t = {}) {
2967
3007
  let v = { kind: "none" };
2968
3008
  const $ = fe(a.postData) ? a.postData : void 0;
2969
3009
  if ($) {
2970
- const w = K($.mimeType) ?? "", N = Ze($.params);
2971
- N.length && w.includes("multipart") ? v = {
3010
+ const w = K($.mimeType) ?? "", O = Ze($.params);
3011
+ O.length && w.includes("multipart") ? v = {
2972
3012
  kind: "multipart",
2973
- parts: N.map(
3013
+ parts: O.map(
2974
3014
  (P) => P.fileName !== void 0 ? {
2975
3015
  key: K(P.name) ?? "",
2976
3016
  value: "",
@@ -2979,21 +3019,21 @@ function ss(e, t = {}) {
2979
3019
  contentType: K(P.contentType)
2980
3020
  } : { key: K(P.name) ?? "", value: K(P.value) ?? "", type: "text" }
2981
3021
  )
2982
- } : N.length ? v = { kind: "form", fields: $e(N) } : K($.text) !== void 0 && (v = Tt(K($.text) ?? "", w || void 0));
3022
+ } : O.length ? v = { kind: "form", fields: we(O) } : K($.text) !== void 0 && (v = St(K($.text) ?? "", w || void 0));
2983
3023
  }
2984
3024
  const T = (K(a.method) ?? "GET").toUpperCase(), b = [], S = Number(c.status);
2985
3025
  if (Number.isFinite(S) && S > 0) {
2986
3026
  let w = K(p.text);
2987
- w !== void 0 && p.encoding === "base64" && /json|xml|text|javascript/.test(u) && (w = Ct(w)), b.push({
3027
+ w !== void 0 && p.encoding === "base64" && /json|xml|text|javascript/.test(u) && (w = Ut(w)), b.push({
2988
3028
  name: `${S} ${K(c.statusText) ?? ""}`.trim(),
2989
3029
  status: S,
2990
- headers: $e(c.headers).filter((N) => !N.key.startsWith(":")),
3030
+ headers: we(c.headers).filter((O) => !O.key.startsWith(":")),
2991
3031
  body: w
2992
3032
  });
2993
3033
  }
2994
3034
  o.push(
2995
3035
  ye({
2996
- name: Ut(T, f),
3036
+ name: Et(T, f),
2997
3037
  method: T,
2998
3038
  url: f,
2999
3039
  params: y,
@@ -3005,8 +3045,8 @@ function ss(e, t = {}) {
3005
3045
  return ge({ name: t.name ?? "HAR import", items: o });
3006
3046
  }
3007
3047
  const Be = (e) => ({ name: e.key, value: e.value });
3008
- function Ds(e, t = {}) {
3009
- const n = Array.isArray(e) ? e : Oe(e.items).map((i) => i.request), s = t.transform ?? ((i) => i), r = (t.now ?? (() => /* @__PURE__ */ new Date()))().toISOString(), o = n.map((i) => {
3048
+ function Ws(e, t = {}) {
3049
+ const n = Array.isArray(e) ? e : be(e.items).map((i) => i.request), s = t.transform ?? ((i) => i), r = (t.now ?? (() => /* @__PURE__ */ new Date()))().toISOString(), o = n.map((i) => {
3010
3050
  var k, y, v, $, T;
3011
3051
  const a = Ue(i, s), c = i.params.filter((b) => b.in === "header" && L(b)).map((b) => ({ key: s(b.key), value: s(b.value) })), p = i.params.filter((b) => b.in === "cookie" && L(b)).map((b) => ({ key: s(b.key), value: s(b.value) })), u = ((k = c.find((b) => /^content-type$/i.test(b.key))) == null ? void 0 : k.value) ?? Ce(i.body), f = {
3012
3052
  method: i.method.toUpperCase(),
@@ -3061,7 +3101,7 @@ function Ds(e, t = {}) {
3061
3101
  }
3062
3102
  };
3063
3103
  }
3064
- const Hs = `query IntrospectionQuery {
3104
+ const Bs = `query IntrospectionQuery {
3065
3105
  __schema {
3066
3106
  queryType { name }
3067
3107
  mutationType { name }
@@ -3097,7 +3137,7 @@ fragment TypeRef on __Type {
3097
3137
  name
3098
3138
  ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name } } } } } }
3099
3139
  }`;
3100
- function rs(e) {
3140
+ function is(e) {
3101
3141
  var o, i, a, c;
3102
3142
  const n = typeof e == "string" ? JSON.parse(e) : e, s = ((o = n == null ? void 0 : n.data) == null ? void 0 : o.__schema) ?? (n == null ? void 0 : n.__schema) ?? (Array.isArray(n == null ? void 0 : n.types) ? n : void 0);
3103
3143
  if (!s || !Array.isArray(s.types))
@@ -3115,13 +3155,13 @@ function rs(e) {
3115
3155
  function et(e) {
3116
3156
  return e ? e.kind === "NON_NULL" ? `${et(e.ofType)}!` : e.kind === "LIST" ? `[${et(e.ofType)}]` : e.name ?? "" : "";
3117
3157
  }
3118
- function Ft(e) {
3158
+ function Kt(e) {
3119
3159
  let t = e;
3120
3160
  for (; t && (t.kind === "NON_NULL" || t.kind === "LIST"); )
3121
3161
  t = t.ofType;
3122
3162
  return (t == null ? void 0 : t.name) ?? void 0;
3123
3163
  }
3124
- function is(e) {
3164
+ function os(e) {
3125
3165
  const t = [], n = [
3126
3166
  ["query", e.queryType],
3127
3167
  ["mutation", e.mutationType],
@@ -3134,17 +3174,17 @@ function is(e) {
3134
3174
  }
3135
3175
  return t;
3136
3176
  }
3137
- function Vt(e, t) {
3177
+ function Jt(e, t) {
3138
3178
  var s;
3139
- const n = (s = e.types[Ft(t) ?? ""]) == null ? void 0 : s.kind;
3179
+ const n = (s = e.types[Kt(t) ?? ""]) == null ? void 0 : s.kind;
3140
3180
  return n === "SCALAR" || n === "ENUM" || n === void 0;
3141
3181
  }
3142
- function os(e) {
3182
+ function as(e) {
3143
3183
  var t;
3144
3184
  return ((t = e.args) == null ? void 0 : t.some((n) => n.type.kind === "NON_NULL" && n.defaultValue == null)) ?? !1;
3145
3185
  }
3146
3186
  function tt(e, t, n, s) {
3147
- const r = e.types[Ft(t) ?? ""];
3187
+ const r = e.types[Kt(t) ?? ""];
3148
3188
  if (!r || r.kind === "SCALAR" || r.kind === "ENUM")
3149
3189
  return "";
3150
3190
  const o = [];
@@ -3160,8 +3200,8 @@ ${o.join(`
3160
3200
  ${s}}`;
3161
3201
  }
3162
3202
  for (const i of r.fields ?? [])
3163
- if (!(i.isDeprecated || os(i))) {
3164
- if (Vt(e, i.type))
3203
+ if (!(i.isDeprecated || as(i))) {
3204
+ if (Jt(e, i.type))
3165
3205
  o.push(`${s} ${i.name}`);
3166
3206
  else if (n > 0) {
3167
3207
  const a = tt(e, i.type, n - 1, `${s} `);
@@ -3203,26 +3243,26 @@ function qe(e, t, n = 0) {
3203
3243
  }
3204
3244
  }
3205
3245
  }
3206
- function as(e) {
3246
+ function cs(e) {
3207
3247
  return e.charAt(0).toUpperCase() + e.slice(1);
3208
3248
  }
3209
- function cs(e, t, n = {}) {
3210
- const { kind: s, field: r } = t, o = n.depth ?? 2, i = as(r.name), a = r.args ?? [], c = a.length ? `(${a.map((l) => `$${l.name}: ${et(l.type)}`).join(", ")})` : "", p = a.length ? `(${a.map((l) => `${l.name}: $${l.name}`).join(", ")})` : "", u = Vt(e, r.type) ? "" : ` ${tt(e, r.type, o - 1, " ")}`, f = `${s} ${i}${c} {
3249
+ function ps(e, t, n = {}) {
3250
+ const { kind: s, field: r } = t, o = n.depth ?? 2, i = cs(r.name), a = r.args ?? [], c = a.length ? `(${a.map((l) => `$${l.name}: ${et(l.type)}`).join(", ")})` : "", p = a.length ? `(${a.map((l) => `${l.name}: $${l.name}`).join(", ")})` : "", u = Jt(e, r.type) ? "" : ` ${tt(e, r.type, o - 1, " ")}`, f = `${s} ${i}${c} {
3211
3251
  ${r.name}${p}${u}
3212
3252
  }`, d = {};
3213
3253
  for (const l of a)
3214
3254
  l.defaultValue == null && (d[l.name] = qe(e, l.type));
3215
3255
  return { query: f, variables: d, operationName: i };
3216
3256
  }
3217
- function ps(e, t = {}) {
3218
- const n = typeof e == "object" && e && "types" in e && !Array.isArray(e.types) ? e : rs(e), s = {
3257
+ function ls(e, t = {}) {
3258
+ const n = typeof e == "object" && e && "types" in e && !Array.isArray(e.types) ? e : is(e), s = {
3219
3259
  query: "Queries",
3220
3260
  mutation: "Mutations",
3221
3261
  subscription: "Subscriptions",
3222
3262
  ...t.folderNames
3223
3263
  }, r = /* @__PURE__ */ new Map();
3224
- for (const o of is(n)) {
3225
- const i = cs(n, o, { depth: t.depth }), a = ye({
3264
+ for (const o of os(n)) {
3265
+ const i = ps(n, o, { depth: t.depth }), a = ye({
3226
3266
  name: o.field.name,
3227
3267
  method: "POST",
3228
3268
  url: "{{graphqlUrl}}",
@@ -3239,11 +3279,11 @@ function ps(e, t = {}) {
3239
3279
  }
3240
3280
  return ge({
3241
3281
  name: t.name ?? "GraphQL API",
3242
- items: [...r].map(([o, i]) => xe({ name: s[o], items: i })),
3282
+ items: [...r].map(([o, i]) => Te({ name: s[o], items: i })),
3243
3283
  variables: [{ key: "graphqlUrl", value: t.endpoint ?? "" }]
3244
3284
  });
3245
3285
  }
3246
- const Q = "http://schemas.xmlsoap.org/wsdl/", Fe = "http://schemas.xmlsoap.org/wsdl/soap/", Ve = "http://schemas.xmlsoap.org/wsdl/soap12/", de = "http://www.w3.org/2001/XMLSchema", ls = "http://schemas.xmlsoap.org/soap/envelope/", us = "http://www.w3.org/2003/05/soap-envelope", ee = (e, t) => `{${e ?? ""}}${t}`;
3286
+ const Q = "http://schemas.xmlsoap.org/wsdl/", Fe = "http://schemas.xmlsoap.org/wsdl/soap/", Ve = "http://schemas.xmlsoap.org/wsdl/soap12/", de = "http://www.w3.org/2001/XMLSchema", us = "http://schemas.xmlsoap.org/soap/envelope/", fs = "http://www.w3.org/2003/05/soap-envelope", ee = (e, t) => `{${e ?? ""}}${t}`;
3247
3287
  function X(e, t, n) {
3248
3288
  return Array.from(e.childNodes).filter(
3249
3289
  (s) => s.nodeType === 1 && s.localName === n && (t === null || s.namespaceURI === t)
@@ -3258,18 +3298,18 @@ function ae(e, t) {
3258
3298
  const n = t.indexOf(":"), s = n < 0 ? null : t.slice(0, n), r = n < 0 ? t : t.slice(n + 1);
3259
3299
  return { namespace: e.lookupNamespaceURI(s) ?? void 0, name: r };
3260
3300
  }
3261
- function kt(e) {
3301
+ function $t(e) {
3262
3302
  var s;
3263
3303
  const t = ne(e, Q, "documentation");
3264
3304
  return ((s = t == null ? void 0 : t.textContent) == null ? void 0 : s.trim()) || void 0;
3265
3305
  }
3266
- function fs() {
3306
+ function ds() {
3267
3307
  const e = globalThis.DOMParser;
3268
3308
  if (!e)
3269
3309
  throw new Error("No DOMParser: pass one (xmldom, jsdom) in Node");
3270
3310
  return new e();
3271
3311
  }
3272
- function ds(e, t = fs()) {
3312
+ function ms(e, t = ds()) {
3273
3313
  const s = t.parseFromString(e, "text/xml").documentElement;
3274
3314
  if (!s || s.localName !== "definitions" || s.namespaceURI !== Q)
3275
3315
  throw new Error("Not a WSDL 1.1 document");
@@ -3301,7 +3341,7 @@ function ds(e, t = fs()) {
3301
3341
  for (const l of X(f, Q, "operation")) {
3302
3342
  const m = ne(l, Q, "input"), k = ne(l, Q, "output"), y = m ? ae(m, m.getAttribute("message")) : void 0, v = k ? ae(k, k.getAttribute("message")) : void 0;
3303
3343
  d.set(l.getAttribute("name") ?? "", {
3304
- doc: kt(l),
3344
+ doc: $t(l),
3305
3345
  input: y ? ee(y.namespace, y.name) : void 0,
3306
3346
  output: v ? ee(v.namespace, v.name) : void 0
3307
3347
  });
@@ -3316,15 +3356,15 @@ function ds(e, t = fs()) {
3316
3356
  continue;
3317
3357
  }
3318
3358
  const y = d ? Fe : Ve, v = ae(f, f.getAttribute("type")), $ = v ? c.get(ee(v.namespace, v.name)) : void 0, T = m.getAttribute("style") === "rpc" ? "rpc" : "document", b = X(f, Q, "operation").map((S) => {
3319
- const w = S.getAttribute("name") ?? "", N = ne(S, y, "operation"), P = ((N == null ? void 0 : N.getAttribute("style")) ?? T) === "rpc" ? "rpc" : "document", R = $ == null ? void 0 : $.get(w), H = R != null && R.input ? a.get(R.input) : void 0, j = R != null && R.output ? a.get(R.output) : void 0, x = ne(S, Q, "input"), E = x ? ne(x, y, "body") : void 0, M = {
3359
+ const w = S.getAttribute("name") ?? "", O = ne(S, y, "operation"), P = ((O == null ? void 0 : O.getAttribute("style")) ?? T) === "rpc" ? "rpc" : "document", R = $ == null ? void 0 : $.get(w), H = R != null && R.input ? a.get(R.input) : void 0, j = R != null && R.output ? a.get(R.output) : void 0, x = ne(S, Q, "input"), _ = x ? ne(x, y, "body") : void 0, M = {
3320
3360
  name: w,
3321
- soapAction: (N == null ? void 0 : N.getAttribute("soapAction")) ?? void 0,
3361
+ soapAction: (O == null ? void 0 : O.getAttribute("soapAction")) ?? void 0,
3322
3362
  style: P,
3323
3363
  documentation: R == null ? void 0 : R.doc
3324
3364
  };
3325
3365
  if (P === "rpc")
3326
3366
  M.inputElement = {
3327
- namespace: (E == null ? void 0 : E.getAttribute("namespace")) ?? r,
3367
+ namespace: (_ == null ? void 0 : _.getAttribute("namespace")) ?? r,
3328
3368
  name: w
3329
3369
  }, M.inputParts = (H ?? []).map((g) => ({ name: g.name, type: g.type }));
3330
3370
  else {
@@ -3338,7 +3378,7 @@ function ds(e, t = fs()) {
3338
3378
  }
3339
3379
  const u = X(s, Q, "service").map((f) => ({
3340
3380
  name: f.getAttribute("name") ?? "Service",
3341
- documentation: kt(f),
3381
+ documentation: $t(f),
3342
3382
  ports: X(f, Q, "port").flatMap((d) => {
3343
3383
  const l = ae(d, d.getAttribute("binding")), m = l ? p.get(ee(l.namespace, l.name)) : void 0;
3344
3384
  if (!m)
@@ -3357,7 +3397,7 @@ function ds(e, t = fs()) {
3357
3397
  }));
3358
3398
  return { targetNamespace: r, services: u, schema: o };
3359
3399
  }
3360
- function Kt(e, t, n, s, r, o, i) {
3400
+ function Qt(e, t, n, s, r, o, i) {
3361
3401
  const a = t.getAttribute("name") ?? t.getAttribute("ref") ?? "element";
3362
3402
  let c = t, p = n;
3363
3403
  if (t.getAttribute("ref")) {
@@ -3374,12 +3414,12 @@ function Kt(e, t, n, s, r, o, i) {
3374
3414
  }
3375
3415
  if (!k || i > 6)
3376
3416
  return `${m}${o}<${d}>?</${d}>`;
3377
- const v = ms(e, k, p, s, o, i);
3417
+ const v = hs(e, k, p, s, o, i);
3378
3418
  return v ? `${m}${o}<${d}>
3379
3419
  ${v}
3380
3420
  ${o}</${d}>` : `${m}${o}<${d}/>`;
3381
3421
  }
3382
- function ms(e, t, n, s, r, o) {
3422
+ function hs(e, t, n, s, r, o) {
3383
3423
  const i = e.schema.qualified.get(n ?? "") ?? !1, a = [], c = (p) => {
3384
3424
  for (const u of Array.from(p.childNodes)) {
3385
3425
  if (u.nodeType !== 1)
@@ -3387,7 +3427,7 @@ function ms(e, t, n, s, r, o) {
3387
3427
  const f = u;
3388
3428
  if (f.namespaceURI === de) {
3389
3429
  if (f.localName === "element")
3390
- a.push(Kt(e, f, n, s, i, `${r} `, o + 1));
3430
+ a.push(Qt(e, f, n, s, i, `${r} `, o + 1));
3391
3431
  else if (["sequence", "all", "choice", "complexContent", "extension"].includes(f.localName)) {
3392
3432
  if (f.localName === "extension") {
3393
3433
  const d = ae(f, f.getAttribute("base")), l = d ? e.schema.types.get(ee(d.namespace, d.name)) : void 0;
@@ -3404,7 +3444,7 @@ function ms(e, t, n, s, r, o) {
3404
3444
  function nt(e, t) {
3405
3445
  return t.has(e) || t.set(e, t.size ? `ns${t.size}` : "tns"), t.get(e);
3406
3446
  }
3407
- function hs(e, t, n = "1.1") {
3447
+ function ys(e, t, n = "1.1") {
3408
3448
  const s = /* @__PURE__ */ new Map(), r = n === "1.2" ? "soap" : "soapenv";
3409
3449
  let o;
3410
3450
  const i = t.inputElement;
@@ -3417,7 +3457,7 @@ ${d.join(`
3417
3457
  } else if (i) {
3418
3458
  const p = e.schema.elements.get(ee(i.namespace, i.name));
3419
3459
  if (p)
3420
- o = Kt(e, p, i.namespace, s, !0, " ", 0);
3460
+ o = Qt(e, p, i.namespace, s, !0, " ", 0);
3421
3461
  else {
3422
3462
  const u = i.namespace ? nt(i.namespace, s) : "", f = u ? `${u}:${i.name}` : i.name;
3423
3463
  o = ` <${f}>?</${f}>`;
@@ -3425,7 +3465,7 @@ ${d.join(`
3425
3465
  } else
3426
3466
  o = "";
3427
3467
  const c = [
3428
- `xmlns:${r}="${n === "1.2" ? us : ls}"`,
3468
+ `xmlns:${r}="${n === "1.2" ? fs : us}"`,
3429
3469
  ...[...s].map(([p, u]) => `xmlns:${u}="${p}"`)
3430
3470
  ].join(" ");
3431
3471
  return [
@@ -3438,11 +3478,11 @@ ${d.join(`
3438
3478
  ].join(`
3439
3479
  `);
3440
3480
  }
3441
- function ys(e, t = {}) {
3481
+ function gs(e, t = {}) {
3442
3482
  var r;
3443
- const n = ds(e, t.parser), s = n.services.flatMap(
3483
+ const n = ms(e, t.parser), s = n.services.flatMap(
3444
3484
  (o) => o.ports.map(
3445
- (i) => xe({
3485
+ (i) => Te({
3446
3486
  name: n.services.length > 1 || o.ports.length > 1 ? `${o.name} — ${i.name}` : o.name,
3447
3487
  description: o.documentation,
3448
3488
  items: i.operations.map(
@@ -3452,7 +3492,7 @@ function ys(e, t = {}) {
3452
3492
  url: i.address,
3453
3493
  body: {
3454
3494
  kind: "soap",
3455
- envelope: hs(n, a, i.version),
3495
+ envelope: ys(n, a, i.version),
3456
3496
  action: a.soapAction ?? "",
3457
3497
  version: i.version
3458
3498
  },
@@ -3467,7 +3507,7 @@ function ys(e, t = {}) {
3467
3507
  items: s.length === 1 ? s[0].items : s
3468
3508
  });
3469
3509
  }
3470
- const $t = [
3510
+ const wt = [
3471
3511
  7,
3472
3512
  12,
3473
3513
  17,
@@ -3532,11 +3572,11 @@ const $t = [
3532
3572
  10,
3533
3573
  15,
3534
3574
  21
3535
- ], gs = Array.from(
3575
+ ], bs = Array.from(
3536
3576
  { length: 64 },
3537
3577
  (e, t) => Math.floor(Math.abs(Math.sin(t + 1)) * 2 ** 32) >>> 0
3538
3578
  );
3539
- function Jt(e) {
3579
+ function Gt(e) {
3540
3580
  const t = typeof e == "string" ? new TextEncoder().encode(e) : e, n = t.length * 8, s = new Uint8Array(((t.length + 8 >> 6) + 1) * 64);
3541
3581
  s.set(t), s[t.length] = 128;
3542
3582
  const r = new DataView(s.buffer);
@@ -3550,8 +3590,8 @@ function Jt(e) {
3550
3590
  for (let y = 0; y < 64; y++) {
3551
3591
  let v, $;
3552
3592
  y < 16 ? (v = l & m | ~l & k, $ = y) : y < 32 ? (v = k & l | ~k & m, $ = (5 * y + 1) % 16) : y < 48 ? (v = l ^ m ^ k, $ = (3 * y + 5) % 16) : (v = m ^ (l | ~k), $ = 7 * y % 16);
3553
- const T = d + v + gs[y] + p[$] >>> 0;
3554
- d = k, k = m, m = l, l = l + (T << $t[y] | T >>> 32 - $t[y]) >>> 0;
3593
+ const T = d + v + bs[y] + p[$] >>> 0;
3594
+ d = k, k = m, m = l, l = l + (T << wt[y] | T >>> 32 - wt[y]) >>> 0;
3555
3595
  }
3556
3596
  o = o + d >>> 0, i = i + l >>> 0, a = a + m >>> 0, c = c + k >>> 0;
3557
3597
  }
@@ -3573,14 +3613,14 @@ function st(e, t) {
3573
3613
  }
3574
3614
  return e;
3575
3615
  }
3576
- const bs = new TextEncoder();
3616
+ const ks = new TextEncoder();
3577
3617
  function rt() {
3578
3618
  const e = globalThis.crypto;
3579
3619
  if (!(e != null && e.subtle))
3580
3620
  throw new Error("Web Crypto is not available");
3581
3621
  return e.subtle;
3582
3622
  }
3583
- function Ae(e) {
3623
+ function xe(e) {
3584
3624
  return Array.from(new Uint8Array(e), (t) => t.toString(16).padStart(2, "0")).join("");
3585
3625
  }
3586
3626
  function lt(e) {
@@ -3590,7 +3630,7 @@ function lt(e) {
3590
3630
  return btoa(t);
3591
3631
  }
3592
3632
  function Ie(e) {
3593
- const t = typeof e == "string" ? bs.encode(e) : e;
3633
+ const t = typeof e == "string" ? ks.encode(e) : e;
3594
3634
  return new Uint8Array(t);
3595
3635
  }
3596
3636
  async function Re(e, t) {
@@ -3621,7 +3661,7 @@ function Le(e, t) {
3621
3661
  const n = t.toLowerCase();
3622
3662
  return (s = e.find(([r]) => r.toLowerCase() === n)) == null ? void 0 : s[1];
3623
3663
  }
3624
- function ks(e) {
3664
+ function $s(e) {
3625
3665
  const t = /Digest\s+(.*)$/i.exec(e);
3626
3666
  if (!t)
3627
3667
  return;
@@ -3630,17 +3670,17 @@ function ks(e) {
3630
3670
  n[s[1].toLowerCase()] = s[2] ?? s[3];
3631
3671
  return n;
3632
3672
  }
3633
- async function we(e, t) {
3634
- return /sha-?256/i.test(e) ? Ae(await Re("SHA-256", t)) : Jt(t);
3673
+ async function ve(e, t) {
3674
+ return /sha-?256/i.test(e) ? xe(await Re("SHA-256", t)) : Gt(t);
3635
3675
  }
3636
- async function $s(e, t, n, s = {}) {
3676
+ async function ws(e, t, n, s = {}) {
3637
3677
  var l;
3638
3678
  if (!e.realm || !e.nonce)
3639
3679
  return;
3640
- const r = e.algorithm ?? "MD5", o = n.replace(/^[a-z][\w+.-]*:\/\/[^/]*/i, "") || "/", i = (l = e.qop) != null && l.split(",").map((m) => m.trim()).includes("auth") ? "auth" : e.qop ? e.qop.split(",")[0].trim() : void 0, a = s.cnonce ?? Jt(String(Math.random())).slice(0, 16), c = (s.nc ?? 1).toString(16).padStart(8, "0");
3641
- let p = await we(r, `${e.username}:${e.realm}:${e.password}`);
3642
- /-sess$/i.test(r) && (p = await we(r, `${p}:${e.nonce}:${a}`));
3643
- const u = await we(r, `${t}:${o}`), f = i ? await we(r, `${p}:${e.nonce}:${c}:${a}:${i}:${u}`) : await we(r, `${p}:${e.nonce}:${u}`), d = [
3680
+ const r = e.algorithm ?? "MD5", o = n.replace(/^[a-z][\w+.-]*:\/\/[^/]*/i, "") || "/", i = (l = e.qop) != null && l.split(",").map((m) => m.trim()).includes("auth") ? "auth" : e.qop ? e.qop.split(",")[0].trim() : void 0, a = s.cnonce ?? Gt(String(Math.random())).slice(0, 16), c = (s.nc ?? 1).toString(16).padStart(8, "0");
3681
+ let p = await ve(r, `${e.username}:${e.realm}:${e.password}`);
3682
+ /-sess$/i.test(r) && (p = await ve(r, `${p}:${e.nonce}:${a}`));
3683
+ const u = await ve(r, `${t}:${o}`), f = i ? await ve(r, `${p}:${e.nonce}:${c}:${a}:${i}:${u}`) : await ve(r, `${p}:${e.nonce}:${u}`), d = [
3644
3684
  `username="${e.username}"`,
3645
3685
  `realm="${e.realm}"`,
3646
3686
  `nonce="${e.nonce}"`,
@@ -3650,17 +3690,17 @@ async function $s(e, t, n, s = {}) {
3650
3690
  ];
3651
3691
  return i && d.push(`qop=${i}`, `nc=${c}`, `cnonce="${a}"`), e.opaque && d.push(`opaque="${e.opaque}"`), `Digest ${d.join(", ")}`;
3652
3692
  }
3653
- async function ws(e, t, n = /* @__PURE__ */ new Date()) {
3693
+ async function vs(e, t, n = /* @__PURE__ */ new Date()) {
3654
3694
  var b;
3655
3695
  const s = new URL(e.url), r = n.toISOString().replace(/[:-]|\.\d{3}/g, ""), o = r.slice(0, 8);
3656
3696
  let i = "";
3657
3697
  typeof e.body == "string" ? i = e.body : ((b = e.body) == null ? void 0 : b.kind) === "binary" && e.body.data && (i = Uint8Array.from(atob(e.body.data), (S) => S.charCodeAt(0)));
3658
- const a = e.body && typeof e.body != "string" && e.body.kind === "multipart" ? "UNSIGNED-PAYLOAD" : Ae(await Re("SHA-256", i)), c = t.service === "s3";
3698
+ const a = e.body && typeof e.body != "string" && e.body.kind === "multipart" ? "UNSIGNED-PAYLOAD" : xe(await Re("SHA-256", i)), c = t.service === "s3";
3659
3699
  J(e.headers, "X-Amz-Date", r), c && J(e.headers, "X-Amz-Content-Sha256", a), t.sessionToken && J(e.headers, "X-Amz-Security-Token", t.sessionToken);
3660
- const p = s.pathname.split("/").map((S) => c ? S : Ke(S)).join("/") || "/", u = [...s.searchParams.entries()].map(([S, w]) => [Ke(S), Ke(w)]).sort(([S, w], [N, P]) => S === N ? w < P ? -1 : w > P ? 1 : 0 : S < N ? -1 : 1).map(([S, w]) => `${S}=${w}`).join("&"), f = /* @__PURE__ */ new Map([["host", s.host]]);
3700
+ const p = s.pathname.split("/").map((S) => c ? S : Ke(S)).join("/") || "/", u = [...s.searchParams.entries()].map(([S, w]) => [Ke(S), Ke(w)]).sort(([S, w], [O, P]) => S === O ? w < P ? -1 : w > P ? 1 : 0 : S < O ? -1 : 1).map(([S, w]) => `${S}=${w}`).join("&"), f = /* @__PURE__ */ new Map([["host", s.host]]);
3661
3701
  for (const [S, w] of e.headers) {
3662
- const N = S.toLowerCase();
3663
- (N.startsWith("x-amz-") || N === "content-type") && f.set(N, w.trim().replace(/\s+/g, " "));
3702
+ const O = S.toLowerCase();
3703
+ (O.startsWith("x-amz-") || O === "content-type") && f.set(O, w.trim().replace(/\s+/g, " "));
3664
3704
  }
3665
3705
  const d = [...f.keys()].sort(), l = d.map((S) => `${S}:${f.get(S)}
3666
3706
  `).join(""), m = d.join(";"), k = [
@@ -3671,30 +3711,30 @@ async function ws(e, t, n = /* @__PURE__ */ new Date()) {
3671
3711
  m,
3672
3712
  a
3673
3713
  ].join(`
3674
- `), y = `${o}/${t.region}/${t.service}/aws4_request`, v = ["AWS4-HMAC-SHA256", r, y, Ae(await Re("SHA-256", k))].join(
3714
+ `), y = `${o}/${t.region}/${t.service}/aws4_request`, v = ["AWS4-HMAC-SHA256", r, y, xe(await Re("SHA-256", k))].join(
3675
3715
  `
3676
3716
  `
3677
3717
  );
3678
3718
  let $ = await me("SHA-256", `AWS4${t.secretAccessKey}`, o);
3679
3719
  $ = await me("SHA-256", $, t.region), $ = await me("SHA-256", $, t.service), $ = await me("SHA-256", $, "aws4_request");
3680
- const T = Ae(await me("SHA-256", $, v));
3720
+ const T = xe(await me("SHA-256", $, v));
3681
3721
  J(
3682
3722
  e.headers,
3683
3723
  "Authorization",
3684
3724
  `AWS4-HMAC-SHA256 Credential=${t.accessKeyId}/${y}, SignedHeaders=${m}, Signature=${T}`
3685
3725
  );
3686
3726
  }
3687
- async function vs(e, t, n = /* @__PURE__ */ new Date()) {
3727
+ async function As(e, t, n = /* @__PURE__ */ new Date()) {
3688
3728
  const s = /^[a-z][\w+.-]*:\/\//i.test(e.url) ? new URL(e.url) : new URL(e.url, "http://localhost"), r = t.template ?? `{method}
3689
3729
  {path}
3690
3730
  {timestamp}
3691
3731
  {body}`, o = String(Math.floor(n.getTime() / 1e3)), i = r.replace(/\\n/g, `
3692
- `).replace(/\{method\}/g, e.method.toUpperCase()).replace(/\{path\}/g, s.pathname + s.search).replace(/\{query\}/g, s.search.replace(/^\?/, "")).replace(/\{timestamp\}/g, o).replace(/\{body\}/g, typeof e.body == "string" ? e.body : ""), a = await me(t.algorithm, t.secret, i), c = t.encoding === "base64" ? lt(a) : Ae(a);
3732
+ `).replace(/\{method\}/g, e.method.toUpperCase()).replace(/\{path\}/g, s.pathname + s.search).replace(/\{query\}/g, s.search.replace(/^\?/, "")).replace(/\{timestamp\}/g, o).replace(/\{body\}/g, typeof e.body == "string" ? e.body : ""), a = await me(t.algorithm, t.secret, i), c = t.encoding === "base64" ? lt(a) : xe(a);
3693
3733
  J(e.headers, t.header, `${t.prefix ?? ""}${c}`), r.includes("{timestamp}") && J(e.headers, t.timestampHeader ?? "X-Timestamp", o);
3694
3734
  }
3695
- async function wt(e, t = {}) {
3735
+ async function vt(e, t = {}) {
3696
3736
  var m;
3697
- const n = (k) => Ot(k, t.variables ?? {}, t), s = t.auth ?? e.auth, r = !s || s.type === "inherit" ? { type: "none" } : st(s, n), o = [], i = e.params.filter((k) => k.in === "header" && L(k)).map((k) => [n(k.key), n(k.value)]), a = e.params.filter((k) => k.in === "cookie" && L(k)).map((k) => `${n(k.key)}=${n(k.value)}`);
3737
+ const n = (k) => Ct(k, t.variables ?? {}, t), s = t.auth ?? e.auth, r = !s || s.type === "inherit" ? { type: "none" } : st(s, n), o = [], i = e.params.filter((k) => k.in === "header" && L(k)).map((k) => [n(k.key), n(k.value)]), a = e.params.filter((k) => k.in === "cookie" && L(k)).map((k) => `${n(k.key)}=${n(k.value)}`);
3698
3738
  switch (r.type) {
3699
3739
  case "basic":
3700
3740
  J(i, "Authorization", `Basic ${at(`${r.username}:${r.password}`)}`);
@@ -3735,16 +3775,16 @@ async function wt(e, t = {}) {
3735
3775
  settings: { ...e.settings }
3736
3776
  }, l = ((m = t.now) == null ? void 0 : m.call(t)) ?? /* @__PURE__ */ new Date();
3737
3777
  if (r.type === "digest") {
3738
- const k = await $s(r, d.method, c);
3778
+ const k = await ws(r, d.method, c);
3739
3779
  k && J(d.headers, "Authorization", k);
3740
- } else r.type === "awsSigV4" ? await ws(d, r, l) : r.type === "hmac" && await vs(d, r, l);
3780
+ } else r.type === "awsSigV4" ? await vs(d, r, l) : r.type === "hmac" && await As(d, r, l);
3741
3781
  return d;
3742
3782
  }
3743
- async function zs(e, t, n = {}, s) {
3744
- let r = await wt(e, n), o = await t(r, s);
3783
+ async function Fs(e, t, n = {}, s) {
3784
+ let r = await vt(e, n), o = await t(r, s);
3745
3785
  const i = n.auth ?? e.auth;
3746
3786
  if (o.status === 401 && (i == null ? void 0 : i.type) === "digest" && !i.nonce) {
3747
- const a = ks(Le(o.headers, "WWW-Authenticate") ?? "");
3787
+ const a = $s(Le(o.headers, "WWW-Authenticate") ?? "");
3748
3788
  if (a != null && a.nonce) {
3749
3789
  const c = {
3750
3790
  ...i,
@@ -3754,17 +3794,17 @@ async function zs(e, t, n = {}, s) {
3754
3794
  algorithm: a.algorithm,
3755
3795
  opaque: a.opaque
3756
3796
  };
3757
- return r = await wt(e, { ...n, auth: c }), o = await t(r, s), { response: o, sent: r, auth: c };
3797
+ return r = await vt(e, { ...n, auth: c }), o = await t(r, s), { response: o, sent: r, auth: c };
3758
3798
  }
3759
3799
  }
3760
3800
  return { response: o, sent: r, auth: i };
3761
3801
  }
3762
- const As = /^text\/|json|xml|javascript|ecmascript|x-www-form-urlencoded|graphql|yaml|csv|html/i;
3763
- function vt(e, t) {
3802
+ const xs = /^text\/|json|xml|javascript|ecmascript|x-www-form-urlencoded|graphql|yaml|csv|html/i;
3803
+ function At(e, t) {
3764
3804
  const n = Uint8Array.from(atob(e), (s) => s.charCodeAt(0));
3765
3805
  return new Blob([n], t ? { type: t } : void 0);
3766
3806
  }
3767
- function Ws(e = (...t) => fetch(...t)) {
3807
+ function Vs(e = (...t) => fetch(...t)) {
3768
3808
  return async (t, n) => {
3769
3809
  var p, u, f;
3770
3810
  const s = new Headers();
@@ -3780,13 +3820,13 @@ function Ws(e = (...t) => fetch(...t)) {
3780
3820
  const m = (u = t.body.files) == null ? void 0 : u[l.key];
3781
3821
  d.append(
3782
3822
  l.key,
3783
- m ? vt(m, l.contentType) : new Blob([]),
3823
+ m ? At(m, l.contentType) : new Blob([]),
3784
3824
  l.fileName ?? l.key
3785
3825
  );
3786
3826
  } else
3787
3827
  d.append(l.key, l.value);
3788
3828
  r = d, s.delete("Content-Type");
3789
- } else ((f = t.body) == null ? void 0 : f.kind) === "binary" && t.body.data && (r = vt(t.body.data, t.body.contentType));
3829
+ } else ((f = t.body) == null ? void 0 : f.kind) === "binary" && t.body.data && (r = At(t.body.data, t.body.contentType));
3790
3830
  const o = new AbortController(), i = () => o.abort();
3791
3831
  n == null || n.addEventListener("abort", i);
3792
3832
  const a = t.settings.timeoutMs ? setTimeout(i, t.settings.timeoutMs) : void 0, c = Date.now();
@@ -3797,7 +3837,7 @@ function Ws(e = (...t) => fetch(...t)) {
3797
3837
  body: t.method === "GET" || t.method === "HEAD" ? void 0 : r,
3798
3838
  redirect: t.settings.followRedirects === !1 ? "manual" : "follow",
3799
3839
  signal: o.signal
3800
- }), l = await d.arrayBuffer(), m = d.headers.get("content-type") ?? "", k = !m || As.test(m), y = [];
3840
+ }), l = await d.arrayBuffer(), m = d.headers.get("content-type") ?? "", k = !m || xs.test(m), y = [];
3801
3841
  return d.headers.forEach((v, $) => y.push([$, v])), {
3802
3842
  status: d.status,
3803
3843
  statusText: d.statusText,
@@ -3813,22 +3853,22 @@ function Ws(e = (...t) => fetch(...t)) {
3813
3853
  }
3814
3854
  };
3815
3855
  }
3816
- function At(e) {
3856
+ function xt(e) {
3817
3857
  return lt(e).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
3818
3858
  }
3819
- async function Bs() {
3859
+ async function Ks() {
3820
3860
  const e = new Uint8Array(32);
3821
3861
  globalThis.crypto.getRandomValues(e);
3822
- const t = At(e), n = At(await Re("SHA-256", t));
3862
+ const t = xt(e), n = xt(await Re("SHA-256", t));
3823
3863
  return { verifier: t, challenge: n };
3824
3864
  }
3825
- function Fs(e, t = {}) {
3865
+ function Js(e, t = {}) {
3826
3866
  const n = new URLSearchParams();
3827
3867
  n.set("response_type", e.grant === "implicit" ? "token" : "code"), n.set("client_id", e.clientId), e.redirectUri && n.set("redirect_uri", e.redirectUri), e.scope && n.set("scope", e.scope), e.audience && n.set("audience", e.audience), t.state && n.set("state", t.state), t.challenge && (n.set("code_challenge", t.challenge), n.set("code_challenge_method", "S256"));
3828
3868
  const s = e.authUrl ?? "";
3829
3869
  return `${s}${s.includes("?") ? "&" : "?"}${n.toString()}`;
3830
3870
  }
3831
- async function je(e, t, n) {
3871
+ async function Oe(e, t, n) {
3832
3872
  if (!e.tokenUrl)
3833
3873
  throw new Error("OAuth 2: no token URL");
3834
3874
  const s = [
@@ -3866,11 +3906,11 @@ async function je(e, t, n) {
3866
3906
  idToken: typeof i.id_token == "string" ? i.id_token : void 0
3867
3907
  };
3868
3908
  }
3869
- async function Vs(e, t) {
3909
+ async function Qs(e, t) {
3870
3910
  if (e.grant === "clientCredentials")
3871
- return je(e, { grant_type: "client_credentials" }, t);
3911
+ return Oe(e, { grant_type: "client_credentials" }, t);
3872
3912
  if (e.grant === "password")
3873
- return je(
3913
+ return Oe(
3874
3914
  e,
3875
3915
  { grant_type: "password", username: e.username ?? "", password: e.password ?? "" },
3876
3916
  t
@@ -3879,14 +3919,14 @@ async function Vs(e, t) {
3879
3919
  `OAuth 2: the ${e.grant} grant needs the user — use buildAuthorizationUrl / startDeviceAuthorization`
3880
3920
  );
3881
3921
  }
3882
- async function Ks(e, t, n, s) {
3922
+ async function Gs(e, t, n, s) {
3883
3923
  const r = { grant_type: "authorization_code", code: t };
3884
- return e.redirectUri && (r.redirect_uri = e.redirectUri), s && (r.code_verifier = s), je(e, r, n);
3924
+ return e.redirectUri && (r.redirect_uri = e.redirectUri), s && (r.code_verifier = s), Oe(e, r, n);
3885
3925
  }
3886
- async function Js(e, t, n) {
3887
- return je(e, { grant_type: "refresh_token", refresh_token: t }, n);
3926
+ async function Ys(e, t, n) {
3927
+ return Oe(e, { grant_type: "refresh_token", refresh_token: t }, n);
3888
3928
  }
3889
- async function Qs(e, t) {
3929
+ async function Xs(e, t) {
3890
3930
  if (!e.deviceUrl)
3891
3931
  throw new Error("OAuth 2: no device authorization URL");
3892
3932
  const n = new URLSearchParams({ client_id: e.clientId });
@@ -3911,9 +3951,9 @@ async function Qs(e, t) {
3911
3951
  expiresIn: r.expires_in === void 0 ? void 0 : Number(r.expires_in)
3912
3952
  };
3913
3953
  }
3914
- async function Gs(e, t, n) {
3954
+ async function Zs(e, t, n) {
3915
3955
  try {
3916
- return await je(
3956
+ return await Oe(
3917
3957
  e,
3918
3958
  { grant_type: "urn:ietf:params:oauth:grant-type:device_code", device_code: t },
3919
3959
  n
@@ -3927,7 +3967,7 @@ async function Gs(e, t, n) {
3927
3967
  throw s;
3928
3968
  }
3929
3969
  }
3930
- const xs = {
3970
+ const Ts = {
3931
3971
  version: "Version",
3932
3972
  servers: "Servers",
3933
3973
  authentication: "Authentication",
@@ -3945,7 +3985,7 @@ const xs = {
3945
3985
  example: "Example",
3946
3986
  deprecated: "Deprecated",
3947
3987
  noAuth: "None"
3948
- }, ve = (e) => (e ?? "").replace(/\|/g, "\\|").replace(/\r?\n/g, " ");
3988
+ }, Ae = (e) => (e ?? "").replace(/\|/g, "\\|").replace(/\r?\n/g, " ");
3949
3989
  function it(e) {
3950
3990
  if (!e)
3951
3991
  return "string";
@@ -3954,7 +3994,7 @@ function it(e) {
3954
3994
  const t = Array.isArray(e.type) ? e.type.join(" | ") : e.type;
3955
3995
  return t === "array" ? `${it(e.items)}[]` : [t ?? "object", e.format ? `(${e.format})` : ""].filter(Boolean).join(" ");
3956
3996
  }
3957
- function Ts(e, t) {
3997
+ function Ss(e, t) {
3958
3998
  switch (e.type) {
3959
3999
  case "none":
3960
4000
  case "inherit":
@@ -3981,13 +4021,13 @@ function Ts(e, t) {
3981
4021
  return "";
3982
4022
  }
3983
4023
  }
3984
- function xt(e, t) {
4024
+ function Tt(e, t) {
3985
4025
  const n = e.includes("```") ? "````" : "```";
3986
4026
  return `${n}${t}
3987
4027
  ${e}
3988
4028
  ${n}`;
3989
4029
  }
3990
- function Ss(e, t, n, s, r, o) {
4030
+ function js(e, t, n, s, r, o) {
3991
4031
  var d;
3992
4032
  const i = "#".repeat(o), a = [], c = e.url.replace(/^\{\{[^}]+\}\}/, "") || "/";
3993
4033
  a.push(
@@ -4001,7 +4041,7 @@ function Ss(e, t, n, s, r, o) {
4001
4041
  `| ${s.name} | ${s.location} | ${s.required} | ${s.type} | ${s.description} |`,
4002
4042
  "|---|---|---|---|---|",
4003
4043
  ...p.map(
4004
- (l) => `| \`${ve(l.key)}\` | ${l.in} | ${l.required || l.in === "path" ? s.yes : s.no} | ${ve(it(l.schema))} | ${ve(l.description)} |`
4044
+ (l) => `| \`${Ae(l.key)}\` | ${l.in} | ${l.required || l.in === "path" ? s.yes : s.no} | ${Ae(it(l.schema))} | ${Ae(l.description)} |`
4005
4045
  ),
4006
4046
  ""
4007
4047
  );
@@ -4022,7 +4062,7 @@ function Ss(e, t, n, s, r, o) {
4022
4062
  );
4023
4063
  else {
4024
4064
  const l = u.kind === "json" || u.kind === "graphql" ? "json" : u.kind === "text" ? "" : "xml";
4025
- a.push(xt(oe(u) ?? "", l), "");
4065
+ a.push(Tt(oe(u) ?? "", l), "");
4026
4066
  }
4027
4067
  const f = Object.entries(e.responses ?? {});
4028
4068
  if (f.length && a.push(
@@ -4031,22 +4071,22 @@ function Ss(e, t, n, s, r, o) {
4031
4071
  `| ${s.status} | ${s.description} | ${s.type} |`,
4032
4072
  "|---|---|---|",
4033
4073
  ...f.map(
4034
- ([l, m]) => `| ${l} | ${ve(m.description)} | ${ve(m.schema ? it(m.schema) : m.contentType)} |`
4074
+ ([l, m]) => `| ${l} | ${Ae(m.description)} | ${Ae(m.schema ? it(m.schema) : m.contentType)} |`
4035
4075
  ),
4036
4076
  ""
4037
4077
  ), r.codeLanguage !== !1) {
4038
4078
  const l = n.filter(
4039
4079
  (v) => v.kind === "folder"
4040
- ), m = r.codeLanguage ?? "curl", k = Nn(e, m, {
4041
- auth: sn(e, l, t)
4042
- }), y = ((d = wn.find((v) => v.id === m)) == null ? void 0 : d.syntax) ?? "shell";
4043
- a.push(`${i}# ${s.example}`, "", xt(k, y), "");
4080
+ ), m = r.codeLanguage ?? "curl", k = Cn(e, m, {
4081
+ auth: on(e, l, t)
4082
+ }), y = ((d = An.find((v) => v.id === m)) == null ? void 0 : d.syntax) ?? "shell";
4083
+ a.push(`${i}# ${s.example}`, "", Tt(k, y), "");
4044
4084
  }
4045
4085
  return a;
4046
4086
  }
4047
- function Ys(e, t = {}) {
4087
+ function er(e, t = {}) {
4048
4088
  var o;
4049
- const n = { ...xs, ...t.labels }, s = [`# ${e.name}`, ""];
4089
+ const n = { ...Ts, ...t.labels }, s = [`# ${e.name}`, ""];
4050
4090
  e.description && s.push(e.description, ""), e.version && s.push(`**${n.version}:** ${e.version}`, ""), (o = e.servers) != null && o.length && s.push(
4051
4091
  `## ${n.servers}`,
4052
4092
  "",
@@ -4054,10 +4094,10 @@ function Ys(e, t = {}) {
4054
4094
  (i) => `- \`${i.url}\`${i.description ? ` — ${i.description}` : ""}`
4055
4095
  ),
4056
4096
  ""
4057
- ), e.auth && e.auth.type !== "none" && e.auth.type !== "inherit" && s.push(`## ${n.authentication}`, "", Ts(e.auth, n), "");
4097
+ ), e.auth && e.auth.type !== "none" && e.auth.type !== "inherit" && s.push(`## ${n.authentication}`, "", Ss(e.auth, n), "");
4058
4098
  const r = (i, a, c) => {
4059
4099
  for (const p of i)
4060
- p.kind === "folder" ? (s.push(`${"#".repeat(Math.min(a, 6))} ${p.name}`, ""), p.description && s.push(p.description, ""), r(p.items, a + 1, [...c, p])) : s.push(...Ss(p, e, c, n, t, Math.min(a, 5)));
4100
+ p.kind === "folder" ? (s.push(`${"#".repeat(Math.min(a, 6))} ${p.name}`, ""), p.description && s.push(p.description, ""), r(p.items, a + 1, [...c, p])) : s.push(...js(p, e, c, n, t, Math.min(a, 5)));
4061
4101
  };
4062
4102
  return r(e.items, 2, []), `${s.join(`
4063
4103
  `).replace(/\n{3,}/g, `
@@ -4065,61 +4105,61 @@ function Ys(e, t = {}) {
4065
4105
  `).trimEnd()}
4066
4106
  `;
4067
4107
  }
4068
- function Qt(e, t) {
4108
+ function Yt(e, t) {
4069
4109
  try {
4070
4110
  return Ge(e, t);
4071
4111
  } catch {
4072
4112
  return;
4073
4113
  }
4074
4114
  }
4075
- function js(e, t = {}) {
4115
+ function Os(e, t = {}) {
4076
4116
  const n = e.trim();
4077
4117
  if (!n)
4078
4118
  return;
4079
- if (un(n))
4119
+ if (dn(n))
4080
4120
  return "curl";
4081
4121
  if (n.startsWith("<"))
4082
4122
  return /<(\w+:)?definitions[\s>]/.test(n) && /schemas\.xmlsoap\.org\/wsdl/.test(n) ? "wsdl" : void 0;
4083
- const s = Qt(n, t.parseYaml);
4123
+ const s = Yt(n, t.parseYaml);
4084
4124
  if (!s || typeof s != "object")
4085
4125
  return;
4086
4126
  const r = s;
4087
4127
  if (typeof r.openapi == "string" || typeof r.swagger == "string")
4088
4128
  return "openapi";
4089
- if (Mt(r))
4129
+ if (Ht(r))
4090
4130
  return "postman";
4091
4131
  if (Array.isArray(r.values) && (r._postman_variable_scope !== void 0 || typeof r.name == "string"))
4092
4132
  return "postman-environment";
4093
- if (Bt(r))
4133
+ if (Vt(r))
4094
4134
  return "har";
4095
4135
  const o = r.data;
4096
4136
  if (r.__schema || o != null && o.__schema)
4097
4137
  return "graphql";
4098
4138
  }
4099
- function Xs(e, t = {}) {
4100
- const n = js(e, t), s = () => Qt(e.trim(), t.parseYaml);
4139
+ function tr(e, t = {}) {
4140
+ const n = Os(e, t), s = () => Yt(e.trim(), t.parseYaml);
4101
4141
  switch (n) {
4102
4142
  case "curl":
4103
- return { kind: n, request: bn(e) };
4143
+ return { kind: n, request: $n(e) };
4104
4144
  case "openapi":
4105
- return { kind: n, collection: Hn(s(), t) };
4145
+ return { kind: n, collection: Wn(s(), t) };
4106
4146
  case "postman":
4107
- return { kind: n, collection: Yn(s()) };
4147
+ return { kind: n, collection: Xn(s()) };
4108
4148
  case "postman-environment":
4109
- return { kind: n, environment: Xn(s()) };
4149
+ return { kind: n, environment: Zn(s()) };
4110
4150
  case "har":
4111
- return { kind: n, collection: ss(s()) };
4151
+ return { kind: n, collection: rs(s()) };
4112
4152
  case "graphql":
4113
- return { kind: n, collection: ps(s()) };
4153
+ return { kind: n, collection: ls(s()) };
4114
4154
  case "wsdl":
4115
- return { kind: n, collection: ys(e, { parser: t.xmlParser }) };
4155
+ return { kind: n, collection: gs(e, { parser: t.xmlParser }) };
4116
4156
  default:
4117
4157
  throw new Error(
4118
4158
  "Unknown API document: expected curl, OpenAPI, Swagger, Postman, HAR, GraphQL introspection or WSDL"
4119
4159
  );
4120
4160
  }
4121
4161
  }
4122
- const Zs = [
4162
+ const nr = [
4123
4163
  "rest",
4124
4164
  "graphql",
4125
4165
  "soap",
@@ -4131,7 +4171,7 @@ const Zs = [
4131
4171
  "database",
4132
4172
  "sftp"
4133
4173
  ];
4134
- function er(e = {}) {
4174
+ function sr(e = {}) {
4135
4175
  return {
4136
4176
  ...e,
4137
4177
  key: e.key ?? Ne("i"),
@@ -4141,7 +4181,7 @@ function er(e = {}) {
4141
4181
  endpoints: e.endpoints ?? ge({ name: e.name ?? "API" })
4142
4182
  };
4143
4183
  }
4144
- function Gt(e, t) {
4184
+ function Xt(e, t) {
4145
4185
  const n = [], s = /* @__PURE__ */ new Set();
4146
4186
  let r = e.sets.find((i) => i.id === t);
4147
4187
  for (; r && !s.has(r.id); )
@@ -4155,7 +4195,7 @@ function Gt(e, t) {
4155
4195
  i.secret && o[i.key] === void 0 && (o[i.key] = `{{secret:${i.key}}}`);
4156
4196
  return o;
4157
4197
  }
4158
- function tr(e, t, n) {
4198
+ function rr(e, t, n) {
4159
4199
  const s = /* @__PURE__ */ new Set();
4160
4200
  let r = e.sets.find((a) => a.id === t), o = !0;
4161
4201
  for (; r && !s.has(r.id); ) {
@@ -4166,11 +4206,11 @@ function tr(e, t, n) {
4166
4206
  const i = e.variables.find((a) => a.key === n);
4167
4207
  return (i == null ? void 0 : i.defaultValue) !== void 0 ? { value: i.defaultValue, from: "default" } : { from: "none" };
4168
4208
  }
4169
- function nr(e) {
4209
+ function ir(e) {
4170
4210
  return e.sets.map((t) => ({
4171
4211
  id: t.id,
4172
4212
  name: t.name,
4173
- values: Object.entries(Gt(e, t.id)).map(([n, s]) => {
4213
+ values: Object.entries(Xt(e, t.id)).map(([n, s]) => {
4174
4214
  var r;
4175
4215
  return {
4176
4216
  key: n,
@@ -4180,7 +4220,7 @@ function nr(e) {
4180
4220
  })
4181
4221
  }));
4182
4222
  }
4183
- function sr(e, t) {
4223
+ function or(e, t) {
4184
4224
  return (t ? e.sets.find((n) => {
4185
4225
  var s;
4186
4226
  return ((s = n.appliesTo) == null ? void 0 : s.database) === t;
@@ -4200,7 +4240,7 @@ function ot(e, t = []) {
4200
4240
  ot(n, t);
4201
4241
  return t;
4202
4242
  }
4203
- function rr(e, t = { variables: [], sets: [] }, n = {}) {
4243
+ function ar(e, t = { variables: [], sets: [] }, n = {}) {
4204
4244
  var a, c;
4205
4245
  const s = [], r = new Set(t.variables.map((p) => p.key)), o = /* @__PURE__ */ new Set();
4206
4246
  for (const p of e.integrations) {
@@ -4227,7 +4267,7 @@ function rr(e, t = { variables: [], sets: [] }, n = {}) {
4227
4267
  message: `${u}: {{${m}}} is not declared in the environment variables`
4228
4268
  });
4229
4269
  const d = new Set(
4230
- Oe(p.endpoints.items).map(({ request: m }) => m.id)
4270
+ be(p.endpoints.items).map(({ request: m }) => m.id)
4231
4271
  ), l = new Set((p.expose ?? []).map((m) => m.key));
4232
4272
  for (const m of p.operations ?? [])
4233
4273
  m.endpoint && !d.has(m.endpoint) && !l.has(m.endpoint) && s.push({
@@ -4266,7 +4306,7 @@ function rr(e, t = { variables: [], sets: [] }, n = {}) {
4266
4306
  message: `${p.id}: ${f.key} is a secret — write {{secret:${f.key}}}, not the value`
4267
4307
  });
4268
4308
  }
4269
- const u = Gt(t, p.id);
4309
+ const u = Xt(t, p.id);
4270
4310
  for (const f of t.variables)
4271
4311
  f.required && !u[f.key] && s.push({
4272
4312
  severity: "warning",
@@ -4276,7 +4316,7 @@ function rr(e, t = { variables: [], sets: [] }, n = {}) {
4276
4316
  }
4277
4317
  return s;
4278
4318
  }
4279
- function ir(e) {
4319
+ function cr(e) {
4280
4320
  const t = /* @__PURE__ */ new Map();
4281
4321
  for (const s of e) {
4282
4322
  const r = s.package ?? "";
@@ -4290,8 +4330,8 @@ function ir(e) {
4290
4330
  directions: n.filter((o) => r.has(o)).map((o) => ({ direction: o, integrations: r.get(o) }))
4291
4331
  }));
4292
4332
  }
4293
- function or(e) {
4294
- const t = Oe(e.endpoints.items).map(
4333
+ function pr(e) {
4334
+ const t = be(e.endpoints.items).map(
4295
4335
  ({ request: s }) => ({
4296
4336
  id: s.id,
4297
4337
  label: `${s.method} ${s.name}`,
@@ -4305,105 +4345,107 @@ function or(e) {
4305
4345
  return [...t, ...n];
4306
4346
  }
4307
4347
  export {
4308
- Hs as GRAPHQL_INTROSPECTION_QUERY,
4309
- Cs as NICE_API_AUTH_TYPES,
4310
- wn as NICE_API_CODE_LANGUAGES,
4311
- xs as NICE_API_MARKDOWN_LABELS,
4312
- Os as NICE_API_METHODS,
4313
- Zs as NICE_CONNECTION_PROTOCOLS,
4348
+ Bs as GRAPHQL_INTROSPECTION_QUERY,
4349
+ Us as NICE_API_AUTH_TYPES,
4350
+ An as NICE_API_CODE_LANGUAGES,
4351
+ Ts as NICE_API_MARKDOWN_LABELS,
4352
+ Cs as NICE_API_METHODS,
4353
+ nr as NICE_CONNECTION_PROTOCOLS,
4314
4354
  Z as NiceYamlError,
4315
- Kn as POSTMAN_SCHEMA_V21,
4355
+ Jn as POSTMAN_SCHEMA_V21,
4356
+ Ms as apiSecuritySchemes,
4316
4357
  Ce as bodyContentType,
4317
- Tt as bodyFromText,
4358
+ St as bodyFromText,
4318
4359
  oe as bodyText,
4319
- Fs as buildAuthorizationUrl,
4320
- cs as buildGraphqlOperation,
4360
+ Js as buildAuthorizationUrl,
4361
+ ps as buildGraphqlOperation,
4321
4362
  Ue as buildRequestUrl,
4322
- hs as buildSoapEnvelope,
4323
- Ys as collectionToMarkdown,
4324
- Bs as createPkcePair,
4325
- js as detectApiDocument,
4363
+ ys as buildSoapEnvelope,
4364
+ er as collectionToMarkdown,
4365
+ Ks as createPkcePair,
4366
+ Os as detectApiDocument,
4326
4367
  Re as digest,
4327
- $s as digestAuthorization,
4328
- sn as effectiveAuth,
4329
- sr as environmentSetFor,
4330
- Ks as exchangeAuthorizationCode,
4331
- Ds as exportHar,
4332
- Vn as exportOpenApi,
4333
- Ps as exportOpenApiYaml,
4334
- Rs as exportPostman,
4335
- Ms as exportPostmanEnvironment,
4336
- Vs as fetchOAuth2Token,
4337
- Ws as fetchTransport,
4338
- en as findApiItem,
4368
+ ws as digestAuthorization,
4369
+ on as effectiveAuth,
4370
+ or as environmentSetFor,
4371
+ Gs as exchangeAuthorizationCode,
4372
+ Ws as exportHar,
4373
+ Kn as exportOpenApi,
4374
+ Ds as exportOpenApiYaml,
4375
+ Hs as exportPostman,
4376
+ zs as exportPostmanEnvironment,
4377
+ Qs as fetchOAuth2Token,
4378
+ Vs as fetchTransport,
4379
+ nn as findApiItem,
4339
4380
  Nt as findVariables,
4340
- Oe as flattenApiRequests,
4341
- Ct as fromBase64,
4342
- Nn as generateCode,
4381
+ be as flattenApiRequests,
4382
+ Ut as fromBase64,
4383
+ Cn as generateCode,
4343
4384
  qe as graphqlExampleValue,
4344
- is as graphqlOperations,
4385
+ os as graphqlOperations,
4345
4386
  et as graphqlTypeName,
4346
- ir as groupIntegrations,
4347
- _s as headerValue,
4387
+ cr as groupIntegrations,
4388
+ qs as headerValue,
4348
4389
  me as hmac,
4349
- Xs as importApiDocument,
4350
- ps as importGraphqlIntrospection,
4351
- ss as importHar,
4352
- Hn as importOpenApi,
4353
- Yn as importPostman,
4354
- Xn as importPostmanEnvironment,
4355
- ys as importWsdl,
4390
+ tr as importApiDocument,
4391
+ ls as importGraphqlIntrospection,
4392
+ rs as importHar,
4393
+ Wn as importOpenApi,
4394
+ Xn as importPostman,
4395
+ Zn as importPostmanEnvironment,
4396
+ gs as importWsdl,
4356
4397
  Ye as inferSchema,
4357
- or as integrationEndpoints,
4358
- Ot as interpolate,
4359
- un as isCurlCommand,
4398
+ pr as integrationEndpoints,
4399
+ Ct as interpolate,
4400
+ dn as isCurlCommand,
4360
4401
  L as isEnabled,
4361
- Bt as isHar,
4362
- Mt as isPostmanCollection,
4363
- Is as joinUrl,
4364
- bt as jsonPointer,
4365
- Jt as md5Hex,
4366
- Pt as mockFromSchema,
4367
- Ls as mockResponse,
4368
- Ft as namedType,
4402
+ Vt as isHar,
4403
+ Ht as isPostmanCollection,
4404
+ Ps as joinUrl,
4405
+ kt as jsonPointer,
4406
+ Gt as md5Hex,
4407
+ Rt as mockFromSchema,
4408
+ Rs as mockResponse,
4409
+ Kt as namedType,
4369
4410
  ge as newApiCollection,
4370
- xe as newApiFolder,
4411
+ Te as newApiFolder,
4371
4412
  Ne as newApiId,
4372
4413
  ye as newApiRequest,
4373
- er as newIntegration,
4374
- nn as paramsIn,
4375
- bn as parseCurl,
4376
- ks as parseDigestChallenge,
4377
- St as parseFormEncoded,
4378
- rs as parseGraphqlIntrospection,
4414
+ sr as newIntegration,
4415
+ rn as paramsIn,
4416
+ $n as parseCurl,
4417
+ $s as parseDigestChallenge,
4418
+ jt as parseFormEncoded,
4419
+ is as parseGraphqlIntrospection,
4379
4420
  Ge as parseJsonOrYaml,
4380
- ds as parseWsdl,
4381
- En as parseYaml,
4382
- an as pathParamNames,
4383
- Gs as pollDeviceToken,
4384
- Js as refreshOAuth2Token,
4385
- Ut as requestName,
4386
- Gt as resolveEnvironmentSet,
4421
+ ms as parseWsdl,
4422
+ In as parseYaml,
4423
+ pn as pathParamNames,
4424
+ Zs as pollDeviceToken,
4425
+ Ys as refreshOAuth2Token,
4426
+ Es as renameApiSchema,
4427
+ Et as requestName,
4428
+ Xt as resolveEnvironmentSet,
4387
4429
  ct as resolvePlainScalar,
4388
- wt as resolveRequest,
4389
- Us as rowsToRecord,
4390
- Lt as schemaResolver,
4391
- zs as sendApiRequest,
4392
- pn as setRequestUrl,
4393
- ws as signAwsV4,
4394
- vs as signHmac,
4430
+ vt as resolveRequest,
4431
+ _s as rowsToRecord,
4432
+ Pt as schemaResolver,
4433
+ Fs as sendApiRequest,
4434
+ un as setRequestUrl,
4435
+ vs as signAwsV4,
4436
+ As as signHmac,
4395
4437
  pe as splitUrl,
4396
- Qs as startDeviceAuthorization,
4397
- Pn as stringifyYaml,
4398
- zn as swagger2ToOpenApi3,
4399
- cn as syncPathParams,
4400
- nr as toApiEnvironments,
4438
+ Xs as startDeviceAuthorization,
4439
+ Mn as stringifyYaml,
4440
+ Bn as swagger2ToOpenApi3,
4441
+ ln as syncPathParams,
4442
+ ir as toApiEnvironments,
4401
4443
  at as toBase64,
4402
4444
  De as toCurl,
4403
- dn as tokenizeCommand,
4404
- Es as unresolvedVariables,
4405
- tn as updateApiItem,
4406
- rr as validateIntegrations,
4407
- tr as valueOrigin,
4408
- qs as variableScope
4445
+ hn as tokenizeCommand,
4446
+ Is as unresolvedVariables,
4447
+ sn as updateApiItem,
4448
+ ar as validateIntegrations,
4449
+ rr as valueOrigin,
4450
+ Ls as variableScope
4409
4451
  };