@nice2dev/ui-api 1.4.31 → 1.4.33

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
1
  var en = Object.defineProperty;
2
2
  var tn = (e, t, n) => t in e ? en(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var $e = (e, t, n) => tn(e, typeof t != "symbol" ? t + "" : t, n);
4
- const Cs = [
4
+ const Us = [
5
5
  "GET",
6
6
  "POST",
7
7
  "PUT",
@@ -10,7 +10,7 @@ const Cs = [
10
10
  "HEAD",
11
11
  "OPTIONS",
12
12
  "TRACE"
13
- ], Us = [
13
+ ], Es = [
14
14
  "inherit",
15
15
  "none",
16
16
  "apiKey",
@@ -27,7 +27,7 @@ let Me = 0;
27
27
  function Ne(e = "r") {
28
28
  return Me = (Me + 1) % 1e6, `${e}${Date.now().toString(36)}${Me.toString(36)}${Math.random().toString(36).slice(2, 6)}`;
29
29
  }
30
- function ye(e = {}) {
30
+ function ge(e = {}) {
31
31
  return {
32
32
  ...e,
33
33
  kind: "request",
@@ -48,7 +48,7 @@ function Te(e = {}) {
48
48
  items: e.items ?? []
49
49
  };
50
50
  }
51
- function ge(e = {}) {
51
+ function be(e = {}) {
52
52
  return {
53
53
  ...e,
54
54
  id: e.id ?? Ne("c"),
@@ -57,18 +57,18 @@ function ge(e = {}) {
57
57
  variables: e.variables ?? []
58
58
  };
59
59
  }
60
- function be(e, t = []) {
60
+ function le(e, t = []) {
61
61
  const n = [];
62
62
  for (const s of e)
63
- s.kind === "folder" ? n.push(...be(s.items, [...t, s])) : n.push({ request: s, folders: [...t] });
63
+ s.kind === "folder" ? n.push(...le(s.items, [...t, s])) : n.push({ request: s, folders: [...t] });
64
64
  return n;
65
65
  }
66
- const dt = "#/components/schemas/";
67
- function Es(e, t, n) {
66
+ const mt = "#/components/schemas/";
67
+ function _s(e, t, n) {
68
68
  var a;
69
69
  if (!n || t === n || !((a = e.schemas) != null && a[t]) || e.schemas[n])
70
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(
71
+ const s = mt + t, r = mt + n, o = (c) => Array.isArray(c) ? c.map(o) : c && typeof c == "object" ? Object.fromEntries(
72
72
  Object.entries(c).map(([p, u]) => [
73
73
  p,
74
74
  p === "$ref" && u === s ? r : o(u)
@@ -101,7 +101,7 @@ function sn(e, t, n) {
101
101
  function L(e) {
102
102
  return e.enabled !== !1;
103
103
  }
104
- function _s(e) {
104
+ function qs(e) {
105
105
  const t = {};
106
106
  for (const n of e)
107
107
  L(n) && (t[n.key] = n.value);
@@ -110,7 +110,7 @@ function _s(e) {
110
110
  function rn(e, t) {
111
111
  return e.params.filter((n) => n.in === t && L(n));
112
112
  }
113
- function qs(e, t) {
113
+ function Is(e, t) {
114
114
  var s;
115
115
  const n = t.toLowerCase();
116
116
  return (s = rn(e, "header").find((r) => r.key.toLowerCase() === n)) == null ? void 0 : s.value;
@@ -168,11 +168,11 @@ function oe(e) {
168
168
  return;
169
169
  }
170
170
  }
171
- function St(e, t) {
171
+ function jt(e, t) {
172
172
  const n = (t ?? "").toLowerCase();
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 };
173
+ return n.includes("x-www-form-urlencoded") ? { kind: "form", fields: Ot(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 };
174
174
  }
175
- function jt(e) {
175
+ function Ot(e) {
176
176
  return e ? e.split("&").map((t) => {
177
177
  const n = t.indexOf("="), s = (r) => {
178
178
  try {
@@ -198,10 +198,10 @@ function an(e) {
198
198
  }
199
199
  return null;
200
200
  }
201
- const Ot = /\{\{\s*([^{}]+?)\s*\}\}/g;
202
- function Nt(e) {
201
+ const Nt = /\{\{\s*([^{}]+?)\s*\}\}/g;
202
+ function Ct(e) {
203
203
  const t = /* @__PURE__ */ new Set();
204
- for (const n of e.matchAll(Ot))
204
+ for (const n of e.matchAll(Nt))
205
205
  t.add(n[1]);
206
206
  return [...t];
207
207
  }
@@ -209,7 +209,7 @@ function cn(e) {
209
209
  const t = (s) => Array.from({ length: s }, () => Math.floor(e() * 16).toString(16)).join(""), n = (8 + Math.floor(e() * 4)).toString(16);
210
210
  return `${t(8)}-${t(4)}-4${t(3)}-${n}${t(3)}-${t(12)}`;
211
211
  }
212
- function Ct(e, t, n = {}) {
212
+ function Ut(e, t, n = {}) {
213
213
  const s = typeof t == "function" ? t : (c) => t[c], r = n.random ?? Math.random, o = n.now ?? (() => /* @__PURE__ */ new Date()), i = (c) => {
214
214
  var p;
215
215
  if (c.startsWith("secret:"))
@@ -230,17 +230,17 @@ function Ct(e, t, n = {}) {
230
230
  };
231
231
  let a = e;
232
232
  for (let c = 0; c < 5 && a.includes("{{"); c++) {
233
- const p = a.replace(Ot, (u, f) => i(f) ?? u);
233
+ const p = a.replace(Nt, (u, d) => i(d) ?? u);
234
234
  if (p === a)
235
235
  break;
236
236
  a = p;
237
237
  }
238
238
  return a;
239
239
  }
240
- function Is(e, t, n = {}) {
241
- return Nt(Ct(e, t, n));
240
+ function Ls(e, t, n = {}) {
241
+ return Ct(Ut(e, t, n));
242
242
  }
243
- function Ls(e, t) {
243
+ function Ps(e, t) {
244
244
  const n = [];
245
245
  for (const s of e)
246
246
  for (const r of (s == null ? void 0 : s.variableSets) ?? []) {
@@ -249,7 +249,7 @@ function Ls(e, t) {
249
249
  }
250
250
  return n;
251
251
  }
252
- function Ps(e, t, n, s) {
252
+ function Rs(e, t, n, s) {
253
253
  const r = {}, o = (i) => {
254
254
  for (const a of i ?? [])
255
255
  L(a) && a.key && (r[a.key] = a.value);
@@ -264,7 +264,7 @@ function pe(e) {
264
264
  const s = t.indexOf("#");
265
265
  s >= 0 && (n = t.slice(s), t = t.slice(0, s));
266
266
  const r = t.indexOf("?");
267
- return r < 0 ? { base: t, query: [], hash: n } : { base: t.slice(0, r), query: jt(t.slice(r + 1)), hash: n };
267
+ return r < 0 ? { base: t, query: [], hash: n } : { base: t.slice(0, r), query: Ot(t.slice(r + 1)), hash: n };
268
268
  }
269
269
  function pn(e) {
270
270
  const t = pe(e).base, n = [], s = t.replace(/^[a-z][\w+.-]*:\/\/[^/]*/i, "").replace(/^\{\{[^}]+\}\}/, "");
@@ -301,7 +301,7 @@ function un(e, t) {
301
301
  function fn(e) {
302
302
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
303
303
  }
304
- function mt(e) {
304
+ function ht(e) {
305
305
  return encodeURIComponent(e).replace(
306
306
  /[!'()*]/g,
307
307
  (t) => `%${t.charCodeAt(0).toString(16).toUpperCase()}`
@@ -314,17 +314,17 @@ function Ue(e, t = (n) => n) {
314
314
  if (a.in !== "path" || !L(a))
315
315
  continue;
316
316
  const c = encodeURIComponent(t(a.value)), p = new RegExp(`(^|/):${fn(a.key)}(?=/|$)`);
317
- o = o.split(`{${a.key}}`).join(c).replace(p, (u, f) => f + c);
317
+ o = o.split(`{${a.key}}`).join(c).replace(p, (u, d) => d + c);
318
318
  }
319
319
  const i = [...s, ...e.params.filter((a) => a.in === "query" && L(a))].map(
320
320
  (a) => {
321
- const c = mt(t(a.key)), p = t(a.value);
322
- return p === "" && !("in" in a) ? c : `${c}=${mt(p)}`;
321
+ const c = ht(t(a.key)), p = t(a.value);
322
+ return p === "" && !("in" in a) ? c : `${c}=${ht(p)}`;
323
323
  }
324
324
  );
325
325
  return o + (i.length ? `?${i.join("&")}` : "") + t(r);
326
326
  }
327
- function Rs(e, t) {
327
+ function Ms(e, t) {
328
328
  return e ? t ? `${e.replace(/\/+$/, "")}/${t.replace(/^\/+/, "")}` : e : t;
329
329
  }
330
330
  function dn(e) {
@@ -373,7 +373,7 @@ function hn(e, t = mn(e)) {
373
373
  if (p === "$" && n[i + 1] === "'" && t === "bash") {
374
374
  for (i += 2; i < n.length && n[i] !== "'"; ) {
375
375
  if (n[i] === "\\" && i + 1 < n.length) {
376
- const u = n[i + 1], f = {
376
+ const u = n[i + 1], d = {
377
377
  n: `
378
378
  `,
379
379
  t: " ",
@@ -384,11 +384,11 @@ function hn(e, t = mn(e)) {
384
384
  0: "\0"
385
385
  };
386
386
  if (u === "x") {
387
- const d = ((c = /^[0-9a-fA-F]{1,2}/.exec(n.slice(i + 2))) == null ? void 0 : c[0]) ?? "";
388
- r += String.fromCharCode(parseInt(d || "0", 16)), i += 2 + d.length;
387
+ const f = ((c = /^[0-9a-fA-F]{1,2}/.exec(n.slice(i + 2))) == null ? void 0 : c[0]) ?? "";
388
+ r += String.fromCharCode(parseInt(f || "0", 16)), i += 2 + f.length;
389
389
  continue;
390
390
  }
391
- r += f[u] ?? `\\${u}`, i += 2;
391
+ r += d[u] ?? `\\${u}`, i += 2;
392
392
  continue;
393
393
  }
394
394
  r += n[i++];
@@ -498,7 +498,7 @@ const yn = new Set("XHdFubAemoxwTEKrUzCcDYyQt".split("")), gn = /* @__PURE__ */
498
498
  "login-options",
499
499
  "sasl-authzid",
500
500
  "tls-max"
501
- ]), ht = {
501
+ ]), yt = {
502
502
  X: "request",
503
503
  H: "header",
504
504
  d: "data",
@@ -515,7 +515,7 @@ const yn = new Set("XHdFubAemoxwTEKrUzCcDYyQt".split("")), gn = /* @__PURE__ */
515
515
  T: "upload-file",
516
516
  E: "cert"
517
517
  };
518
- function Ut(e) {
518
+ function Et(e) {
519
519
  try {
520
520
  const t = Uint8Array.from(atob(e.trim()), (n) => n.charCodeAt(0));
521
521
  return new TextDecoder().decode(t);
@@ -567,7 +567,7 @@ function $n(e) {
567
567
  const r = [], o = [], i = [], a = [];
568
568
  let c;
569
569
  const p = [];
570
- let u, f = !1, d, l, m = !1, k = !1, y = !1;
570
+ let u, d = !1, f, l, m = !1, k = !1, y = !1;
571
571
  const v = {}, $ = (j, x) => {
572
572
  switch (j) {
573
573
  case "request":
@@ -577,7 +577,7 @@ function $n(e) {
577
577
  s = x ?? s;
578
578
  break;
579
579
  case "url-query":
580
- x && i.push(...yt(x));
580
+ x && i.push(...gt(x));
581
581
  break;
582
582
  case "header": {
583
583
  if (!x)
@@ -621,13 +621,13 @@ function $n(e) {
621
621
  u = x;
622
622
  break;
623
623
  case "oauth2-bearer":
624
- d = x;
624
+ f = x;
625
625
  break;
626
626
  case "aws-sigv4":
627
627
  l = x;
628
628
  break;
629
629
  case "digest":
630
- f = !0;
630
+ d = !0;
631
631
  break;
632
632
  case "get":
633
633
  m = !0;
@@ -659,10 +659,10 @@ function $n(e) {
659
659
  const M = x[_];
660
660
  if (yn.has(M)) {
661
661
  const g = x.slice(_ + 1) || t[++j];
662
- $(ht[M] ?? M, g);
662
+ $(yt[M] ?? M, g);
663
663
  break;
664
664
  }
665
- $(ht[M] ?? M, void 0);
665
+ $(yt[M] ?? M, void 0);
666
666
  }
667
667
  else s || (s = x);
668
668
  }
@@ -673,7 +673,7 @@ function $n(e) {
673
673
  if (x)
674
674
  T = { type: "bearer", token: x[1].trim() }, r.splice(b, 1);
675
675
  else if (_) {
676
- const M = Ut(_[1]), h = M.indexOf(":");
676
+ const M = Et(_[1]), h = M.indexOf(":");
677
677
  h >= 0 && (T = {
678
678
  type: "basic",
679
679
  username: M.slice(0, h),
@@ -693,19 +693,19 @@ function $n(e) {
693
693
  service: h
694
694
  };
695
695
  } else
696
- T = f ? { type: "digest", username: x, password: _ } : { type: "basic", username: x, password: _ };
696
+ T = d ? { type: "digest", username: x, password: _ } : { type: "basic", username: x, password: _ };
697
697
  }
698
- d !== void 0 && (T = { type: "bearer", token: d });
698
+ f !== void 0 && (T = { type: "bearer", token: f });
699
699
  const S = r.findIndex((j) => j.key.toLowerCase() === "content-type"), w = S >= 0 ? r[S].value : void 0;
700
700
  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" }));
701
701
  let O = { kind: "none" };
702
702
  if (m && a.length)
703
- i.push(...yt(a.join("&")));
703
+ i.push(...gt(a.join("&")));
704
704
  else if (p.length)
705
705
  O = { kind: "multipart", parts: p };
706
706
  else if (a.length) {
707
707
  const j = a.join(y ? "" : "&"), x = /^\s*[[{]/.test(j);
708
- O = St(
708
+ O = jt(
709
709
  j,
710
710
  w ?? (y || x ? "application/json" : "application/x-www-form-urlencoded")
711
711
  );
@@ -714,8 +714,8 @@ function $n(e) {
714
714
  ...r.map((j) => ({ ...j, in: "header" })),
715
715
  ...o.map((j) => ({ ...j, in: "cookie" }))
716
716
  ];
717
- let H = ye({
718
- name: Et(P, s),
717
+ let H = ge({
718
+ name: _t(P, s),
719
719
  method: P,
720
720
  params: R,
721
721
  body: O,
@@ -727,7 +727,7 @@ function $n(e) {
727
727
  params: [...H.params, ...i.map((j) => ({ ...j, in: "query" }))]
728
728
  }), H;
729
729
  }
730
- function yt(e) {
730
+ function gt(e) {
731
731
  return e.split("&").filter(Boolean).map((t) => {
732
732
  const n = t.indexOf("="), s = (r) => {
733
733
  try {
@@ -739,7 +739,7 @@ function yt(e) {
739
739
  return n < 0 ? { key: s(t), value: "" } : { key: s(t.slice(0, n)), value: s(t.slice(n + 1)) };
740
740
  });
741
741
  }
742
- function Et(e, t) {
742
+ function _t(e, t) {
743
743
  const n = t.replace(/^[a-z][\w+.-]*:\/\/[^/]*/i, "").replace(/^\{\{[^}]+\}\}/, "").split("?")[0];
744
744
  return `${e} ${n || "/"}`;
745
745
  }
@@ -787,11 +787,11 @@ function De(e, t = {}) {
787
787
  params: [...e.params, ...o.query.map((w) => ({ ...w, in: "query" }))]
788
788
  }, a = Ue(i, s), c = [], p = e.method.toUpperCase(), u = e.body.kind !== "none";
789
789
  p === "HEAD" ? c.push(["-I"]) : !(p === "GET" && !u) && !(p === "POST" && u) && c.push(["-X", p]);
790
- const f = e.params.filter((w) => w.in === "header" && L(w));
791
- for (const w of f)
790
+ const d = e.params.filter((w) => w.in === "header" && L(w));
791
+ for (const w of d)
792
792
  c.push(["-H", `${s(w.key)}: ${s(w.value)}`]);
793
793
  c.push(...o.options);
794
- const d = Ce(e.body), l = f.some((w) => w.key.toLowerCase() === "content-type"), m = [
794
+ const f = Ce(e.body), l = d.some((w) => w.key.toLowerCase() === "content-type"), m = [
795
795
  ...e.params.filter((w) => w.in === "cookie" && L(w)),
796
796
  ...o.cookies
797
797
  ];
@@ -815,10 +815,10 @@ function De(e, t = {}) {
815
815
  ]);
816
816
  break;
817
817
  case "binary":
818
- !l && d && c.push(["-H", `Content-Type: ${d}`]), c.push(["--data-binary", `@${k.fileName ?? "file"}`]);
818
+ !l && f && c.push(["-H", `Content-Type: ${f}`]), c.push(["--data-binary", `@${k.fileName ?? "file"}`]);
819
819
  break;
820
820
  default: {
821
- !l && d && c.push(["-H", `Content-Type: ${d}`]), k.kind === "soap" && k.version === "1.1" && k.action !== void 0 && (f.some((w) => w.key.toLowerCase() === "soapaction") || c.push(["-H", `SOAPAction: "${s(k.action)}"`])), c.push(["--data-raw", s(oe(k) ?? "")]);
821
+ !l && f && c.push(["-H", `Content-Type: ${f}`]), k.kind === "soap" && k.version === "1.1" && k.action !== void 0 && (d.some((w) => w.key.toLowerCase() === "soapaction") || c.push(["-H", `SOAPAction: "${s(k.action)}"`])), c.push(["--data-raw", s(oe(k) ?? "")]);
822
822
  break;
823
823
  }
824
824
  }
@@ -844,7 +844,7 @@ const An = [
844
844
  { id: "python", label: "Python requests", syntax: "python" }
845
845
  ];
846
846
  function _e(e, t) {
847
- var d;
847
+ var f;
848
848
  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)}`);
849
849
  let a;
850
850
  switch (s == null ? void 0 : s.type) {
@@ -881,14 +881,14 @@ function _e(e, t) {
881
881
  break;
882
882
  }
883
883
  i.length && r.push(["Cookie", i.join("; ")]);
884
- 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);
884
+ const c = Ue({ ...e, params: [...e.params, ...o] }, n), p = e.body, u = ((f = r.find(([l]) => l.toLowerCase() === "content-type")) == null ? void 0 : f[1]) ?? Ce(p);
885
885
  p.kind === "soap" && p.version === "1.1" && p.action !== void 0 && (r.some(([l]) => l.toLowerCase() === "soapaction") || r.push(["SOAPAction", `"${n(p.action)}"`]));
886
- const f = xn(p, n);
886
+ const d = xn(p, n);
887
887
  return {
888
888
  method: e.method.toUpperCase(),
889
889
  url: c,
890
890
  headers: r,
891
- body: f,
891
+ body: d,
892
892
  contentType: u,
893
893
  note: a
894
894
  };
@@ -923,12 +923,12 @@ function xn(e, t) {
923
923
  }
924
924
  }
925
925
  const se = (e) => JSON.stringify(e), F = (e) => `@"${e.replace(/"/g, '""')}"`, te = (e) => `'${e.replace(/'/g, "''")}'`, Y = (e) => JSON.stringify(e);
926
- function _t(e, t) {
926
+ function qt(e, t) {
927
927
  return e.split(`
928
928
  `).map((n, s) => s === 0 ? n : t + n).join(`
929
929
  `);
930
930
  }
931
- function qt(e) {
931
+ function It(e) {
932
932
  try {
933
933
  return JSON.stringify(JSON.parse(e), null, 2);
934
934
  } catch {
@@ -942,8 +942,8 @@ function Tn(e) {
942
942
  const r = [...e.headers], o = r.some(([a]) => a.toLowerCase() === "content-type");
943
943
  switch (e.body.kind) {
944
944
  case "json": {
945
- const a = qt(e.body.text);
946
- s = a ? `JSON.stringify(${_t(a, " ")})` : se(e.body.text), o || r.push(["Content-Type", "application/json"]);
945
+ const a = It(e.body.text);
946
+ s = a ? `JSON.stringify(${qt(a, " ")})` : se(e.body.text), o || r.push(["Content-Type", "application/json"]);
947
947
  break;
948
948
  }
949
949
  case "form":
@@ -1079,10 +1079,10 @@ function Nn(e) {
1079
1079
  case "none":
1080
1080
  break;
1081
1081
  case "json": {
1082
- const r = qt(e.body.text);
1082
+ const r = It(e.body.text);
1083
1083
  if (r) {
1084
1084
  const o = r.replace(/\btrue\b/g, "True").replace(/\bfalse\b/g, "False").replace(/\bnull\b/g, "None");
1085
- n.push(` json=${_t(o, " ")},`);
1085
+ n.push(` json=${qt(o, " ")},`);
1086
1086
  for (let i = s.length - 1; i >= 0; i--)
1087
1087
  s[i][0].toLowerCase() === "content-type" && s.splice(i, 1);
1088
1088
  } else
@@ -1150,7 +1150,7 @@ class Z extends Error {
1150
1150
  super(`${t} (line ${n})`), this.line = n, this.name = "NiceYamlError";
1151
1151
  }
1152
1152
  }
1153
- function gt(e) {
1153
+ function bt(e) {
1154
1154
  let t = null;
1155
1155
  for (let n = 0; n < e.length; n++) {
1156
1156
  const s = e[n];
@@ -1246,7 +1246,7 @@ class En {
1246
1246
  const r = n.length - n.replace(/^ +/, "").length, o = n.slice(r);
1247
1247
  if (o.startsWith(" "))
1248
1248
  throw new Z("Tabs cannot indent YAML", s + 1);
1249
- return { indent: r, raw: o, text: gt(o), num: s + 1 };
1249
+ return { indent: r, raw: o, text: bt(o), num: s + 1 };
1250
1250
  });
1251
1251
  }
1252
1252
  skipBlank() {
@@ -1402,35 +1402,35 @@ class En {
1402
1402
  const o = r[1] === ">", i = r[3] ?? "", a = Number(r[2] ?? r[4] ?? 0), c = [];
1403
1403
  let p = a ? n + a : -1;
1404
1404
  for (; this.i < this.lines.length; ) {
1405
- const d = this.lines[this.i], l = d.raw.trim() === "";
1405
+ const f = this.lines[this.i], l = f.raw.trim() === "";
1406
1406
  if (!l) {
1407
1407
  if (p < 0) {
1408
- if (d.indent <= n)
1408
+ if (f.indent <= n)
1409
1409
  break;
1410
- p = d.indent;
1410
+ p = f.indent;
1411
1411
  }
1412
- if (d.indent < p)
1412
+ if (f.indent < p)
1413
1413
  break;
1414
1414
  }
1415
- c.push(l ? "" : " ".repeat(d.indent - p) + d.raw), this.i++;
1415
+ c.push(l ? "" : " ".repeat(f.indent - p) + f.raw), this.i++;
1416
1416
  }
1417
1417
  let u = 0;
1418
1418
  for (; c.length && c[c.length - 1] === ""; )
1419
1419
  c.pop(), u++;
1420
- let f;
1421
- return o ? (f = "", c.forEach((d, l) => {
1420
+ let d;
1421
+ return o ? (d = "", c.forEach((f, l) => {
1422
1422
  if (l === 0) {
1423
- f = d;
1423
+ d = f;
1424
1424
  return;
1425
1425
  }
1426
- const m = c[l - 1], k = d.startsWith(" ") || m.startsWith(" ");
1427
- d === "" ? f += `
1428
- ` : m === "" || k ? f += (m === "" ? "" : `
1429
- `) + d : f += ` ${d}`;
1430
- })) : f = c.join(`
1431
- `), c.length ? i === "-" ? f : i === "+" ? `${f}
1426
+ const m = c[l - 1], k = f.startsWith(" ") || m.startsWith(" ");
1427
+ f === "" ? d += `
1428
+ ` : m === "" || k ? d += (m === "" ? "" : `
1429
+ `) + f : d += ` ${f}`;
1430
+ })) : d = c.join(`
1431
+ `), c.length ? i === "-" ? d : i === "+" ? `${d}
1432
1432
  ${`
1433
- `.repeat(u)}` : `${f}
1433
+ `.repeat(u)}` : `${d}
1434
1434
  ` : i === "+" ? `
1435
1435
  `.repeat(u) : "";
1436
1436
  }
@@ -1442,7 +1442,7 @@ ${`
1442
1442
  const a = this.findClosingQuote(o, s);
1443
1443
  if (a >= 0) {
1444
1444
  r.push(o.slice(0, a));
1445
- const p = gt(o.slice(a + 1)).trim();
1445
+ const p = bt(o.slice(a + 1)).trim();
1446
1446
  if (p)
1447
1447
  throw new Z(`Text after a quoted scalar: ${p.slice(0, 20)}`, i);
1448
1448
  break;
@@ -1610,7 +1610,7 @@ class qn {
1610
1610
  function In(e) {
1611
1611
  return new En(e).parseDocument();
1612
1612
  }
1613
- function It(e) {
1613
+ function Lt(e) {
1614
1614
  for (let t = 0; t < e.length; t++) {
1615
1615
  const n = e.charCodeAt(t);
1616
1616
  if (n < 32 && n !== 9 && n !== 10 && n !== 13)
@@ -1619,8 +1619,8 @@ function It(e) {
1619
1619
  return !1;
1620
1620
  }
1621
1621
  const Ln = /^[-?:,[\]{}#&*!|>'"%@`]/;
1622
- function Lt(e) {
1623
- return e === "" || e !== e.trim() || Ln.test(e) || /: |:$| #|[\t\n\r]/.test(e) || It(e) || typeof ct(e) != "string";
1622
+ function Pt(e) {
1623
+ return e === "" || e !== e.trim() || Ln.test(e) || /: |:$| #|[\t\n\r]/.test(e) || Lt(e) || typeof ct(e) != "string";
1624
1624
  }
1625
1625
  function Pn(e) {
1626
1626
  if (e == null)
@@ -1630,12 +1630,12 @@ function Pn(e) {
1630
1630
  if (typeof e == "boolean")
1631
1631
  return String(e);
1632
1632
  const t = String(e);
1633
- return Lt(t) ? JSON.stringify(t) : t;
1633
+ return Pt(t) ? JSON.stringify(t) : t;
1634
1634
  }
1635
1635
  function Rn(e) {
1636
- return Lt(e) ? JSON.stringify(e) : e;
1636
+ return Pt(e) ? JSON.stringify(e) : e;
1637
1637
  }
1638
- function bt(e) {
1638
+ function kt(e) {
1639
1639
  return Array.isArray(e) ? e.length > 0 : !!e && typeof e == "object" && Object.keys(e).length > 0;
1640
1640
  }
1641
1641
  function Qe(e, t, n, s) {
@@ -1647,7 +1647,7 @@ function Qe(e, t, n, s) {
1647
1647
  }
1648
1648
  s && n.push(s.trimEnd());
1649
1649
  for (const o of e)
1650
- if (bt(o)) {
1650
+ if (kt(o)) {
1651
1651
  const i = [];
1652
1652
  Qe(o, t + 2, i, ""), n.push(`${r}- ${i[0].trimStart()}`, ...i.slice(1));
1653
1653
  } else
@@ -1663,7 +1663,7 @@ function Qe(e, t, n, s) {
1663
1663
  s && n.push(s.trimEnd());
1664
1664
  for (const [i, a] of o) {
1665
1665
  const c = `${r}${Rn(i)}:`;
1666
- bt(a) ? Qe(a, Array.isArray(a) ? t : t + 2, n, c) : ze(a, t, n, `${c} `);
1666
+ kt(a) ? Qe(a, Array.isArray(a) ? t : t + 2, n, c) : ze(a, t, n, `${c} `);
1667
1667
  }
1668
1668
  return;
1669
1669
  }
@@ -1679,7 +1679,7 @@ function ze(e, t, n, s) {
1679
1679
  return;
1680
1680
  }
1681
1681
  if (typeof e == "string" && e.includes(`
1682
- `) && !It(e)) {
1682
+ `) && !Lt(e)) {
1683
1683
  const r = e.endsWith(`
1684
1684
  `), o = (r ? e.slice(0, -1) : e).split(`
1685
1685
  `), i = o[0].startsWith(" "), a = " ".repeat(t + 2), c = r ? e.endsWith(`
@@ -1707,7 +1707,7 @@ function Ge(e, t = In) {
1707
1707
  }
1708
1708
  return t(e);
1709
1709
  }
1710
- function Pt(e) {
1710
+ function pt(e) {
1711
1711
  return (t) => {
1712
1712
  var s;
1713
1713
  const n = (s = /^#\/(?:components\/schemas|definitions)\/(.+)$/.exec(t)) == null ? void 0 : s[1];
@@ -1759,7 +1759,7 @@ function Hn(e, t) {
1759
1759
  }
1760
1760
  function Rt(e, t = {}) {
1761
1761
  const n = t.maxDepth ?? 6, s = t.arrayItems ?? 1, r = t.now ?? (() => /* @__PURE__ */ new Date()), o = (i, a, c) => {
1762
- var u, f, d, l, m, k;
1762
+ var u, d, f, l, m, k;
1763
1763
  if (!i)
1764
1764
  return null;
1765
1765
  if (i.$ref) {
@@ -1770,13 +1770,13 @@ function Rt(e, t = {}) {
1770
1770
  }
1771
1771
  if (i.example !== void 0)
1772
1772
  return i.example;
1773
- if ((f = i.examples) != null && f.length)
1773
+ if ((d = i.examples) != null && d.length)
1774
1774
  return i.examples[0];
1775
1775
  if (i.const !== void 0)
1776
1776
  return i.const;
1777
1777
  if (i.default !== void 0)
1778
1778
  return i.default;
1779
- if ((d = i.enum) != null && d.length)
1779
+ if ((f = i.enum) != null && f.length)
1780
1780
  return i.enum[0];
1781
1781
  if ((l = i.allOf) != null && l.length) {
1782
1782
  const y = {};
@@ -1839,13 +1839,13 @@ function Ye(e) {
1839
1839
  return {};
1840
1840
  }
1841
1841
  }
1842
- function Ms(e, t) {
1842
+ function Ds(e, t) {
1843
1843
  var p;
1844
1844
  const n = (p = e.examples) == null ? void 0 : p[0];
1845
1845
  if (n) {
1846
1846
  const u = {};
1847
- for (const f of n.headers ?? [])
1848
- u[f.key] = f.value;
1847
+ for (const d of n.headers ?? [])
1848
+ u[d.key] = d.value;
1849
1849
  return { status: n.status, headers: u, body: n.body ?? "" };
1850
1850
  }
1851
1851
  const s = Object.entries(e.responses ?? {}), [r, o] = s.find(([u]) => /^2\d\d$/.test(u)) ?? s.find(([u]) => u === "default") ?? ["200", void 0], i = /^\d{3}$/.test(r) ? Number(r) : 200;
@@ -1855,7 +1855,7 @@ function Ms(e, t) {
1855
1855
  let c = o.example ?? "";
1856
1856
  if (!c && o.schema) {
1857
1857
  const u = Rt(o.schema, {
1858
- resolveRef: Pt(t == null ? void 0 : t.schemas),
1858
+ resolveRef: pt(t == null ? void 0 : t.schemas),
1859
1859
  usage: "response"
1860
1860
  });
1861
1861
  c = typeof u == "string" ? u : JSON.stringify(u, null, 2);
@@ -1863,7 +1863,7 @@ function Ms(e, t) {
1863
1863
  return { status: i, headers: { "Content-Type": a }, body: c };
1864
1864
  }
1865
1865
  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"];
1866
- function kt(e, t) {
1866
+ function $t(e, t) {
1867
1867
  const n = t.indexOf("#"), s = n >= 0 ? t.slice(n + 1) : "";
1868
1868
  if (!s || s === "/")
1869
1869
  return e;
@@ -1879,10 +1879,10 @@ function kt(e, t) {
1879
1879
  }
1880
1880
  return r;
1881
1881
  }
1882
- function ue(e) {
1882
+ function fe(e) {
1883
1883
  return e == null ? "" : typeof e == "string" ? e : typeof e == "number" || typeof e == "boolean" ? String(e) : JSON.stringify(e);
1884
1884
  }
1885
- function We(e) {
1885
+ function Be(e) {
1886
1886
  const t = Object.keys(e), n = [
1887
1887
  (s) => s === "application/json",
1888
1888
  (s) => /\+json$|\/json/.test(s),
@@ -1898,19 +1898,19 @@ function We(e) {
1898
1898
  return [r, N(e[r]) ? e[r] : {}];
1899
1899
  }
1900
1900
  }
1901
- function Wn(e, t = {}) {
1901
+ function Bn(e, t = {}) {
1902
1902
  var x, _, M;
1903
1903
  let n = typeof e == "string" ? Ge(e, t.parseYaml) : e;
1904
1904
  if (!N(n))
1905
1905
  throw new Error("Not an OpenAPI document");
1906
1906
  if (typeof n.swagger == "string")
1907
- n = Bn(n);
1907
+ n = Wn(n);
1908
1908
  else if (typeof n.openapi != "string")
1909
1909
  throw new Error('Not an OpenAPI document: no "openapi" or "swagger" version');
1910
1910
  const s = n, r = t.baseUrlVariable ?? "baseUrl", o = /* @__PURE__ */ new Map(), i = (h) => {
1911
1911
  var A;
1912
1912
  if (h.startsWith("#"))
1913
- return kt(s, h);
1913
+ return $t(s, h);
1914
1914
  const g = h.split("#")[0];
1915
1915
  if (!o.has(g)) {
1916
1916
  const U = (A = t.resolveRef) == null ? void 0 : A.call(t, g);
@@ -1919,7 +1919,7 @@ function Wn(e, t = {}) {
1919
1919
  typeof U == "string" ? Ge(U, t.parseYaml) : U
1920
1920
  );
1921
1921
  }
1922
- return kt(o.get(g), h);
1922
+ return $t(o.get(g), h);
1923
1923
  }, a = (h) => {
1924
1924
  let g = h;
1925
1925
  for (let A = 0; A < 20 && N(g) && typeof g.$ref == "string"; A++)
@@ -1946,7 +1946,7 @@ function Wn(e, t = {}) {
1946
1946
  if (N(p.schemas))
1947
1947
  for (const [h, g] of Object.entries(p.schemas))
1948
1948
  u[h] = c(g) ?? {};
1949
- const f = Pt(u), d = (h) => {
1949
+ const d = pt(u), f = (h) => {
1950
1950
  if (!N(h))
1951
1951
  return;
1952
1952
  const g = Object.values(h)[0], A = a(g);
@@ -1987,7 +1987,7 @@ function Wn(e, t = {}) {
1987
1987
  };
1988
1988
  }
1989
1989
  case "oauth2": {
1990
- 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;
1990
+ const C = N(A.flows) ? A.flows : {}, I = ["authorizationCode", "clientCredentials", "password", "implicit"].find((re) => N(C[re])) ?? "clientCredentials", D = C[I] ?? {}, W = Array.isArray(g) && g.length ? g.join(" ") : void 0;
1991
1991
  return {
1992
1992
  type: "oauth2",
1993
1993
  grant: I,
@@ -1995,7 +1995,7 @@ function Wn(e, t = {}) {
1995
1995
  authUrl: z(D.authorizationUrl),
1996
1996
  clientId: m("clientId"),
1997
1997
  clientSecret: I === "implicit" ? void 0 : m("clientSecret", !0),
1998
- scope: B,
1998
+ scope: W,
1999
1999
  usePkce: I === "authorizationCode" || void 0,
2000
2000
  username: I === "password" ? m("username") : void 0,
2001
2001
  password: I === "password" ? m("password", !0) : void 0
@@ -2031,43 +2031,43 @@ function Wn(e, t = {}) {
2031
2031
  }
2032
2032
  }
2033
2033
  }, $ = (h) => {
2034
- var B, re;
2034
+ var W, re;
2035
2035
  const g = a(h);
2036
2036
  if (!N(g) || typeof g.name != "string")
2037
2037
  return null;
2038
2038
  const A = zn.find((ie) => ie === g.in);
2039
2039
  if (!A || A === "header" && /^(accept|content-type|authorization)$/i.test(g.name))
2040
2040
  return null;
2041
- 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 };
2041
+ const U = c(g.schema) ?? (N(g.content) ? c((W = Be(g.content)) == null ? void 0 : W[1].schema) : void 0), C = U != null && U.$ref ? d(U.$ref) : U, q = g.example ?? f(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: fe(q), in: A };
2042
2042
  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;
2043
2043
  }, T = (h, g) => {
2044
- const A = c(g.schema), U = g.example ?? d(g.examples), C = U !== void 0 ? U : Rt(A, { resolveRef: f, usage: "request" }), q = (I) => {
2045
- const D = I != null && I.$ref ? f(I.$ref) : I;
2044
+ const A = c(g.schema), U = g.example ?? f(g.examples), C = U !== void 0 ? U : Rt(A, { resolveRef: d, usage: "request" }), q = (I) => {
2045
+ const D = I != null && I.$ref ? d(I.$ref) : I;
2046
2046
  return (D == null ? void 0 : D.properties) ?? {};
2047
2047
  };
2048
2048
  if (h === "application/x-www-form-urlencoded") {
2049
2049
  const I = N(C) ? C : {};
2050
2050
  return {
2051
2051
  kind: "form",
2052
- fields: (Object.keys(I).length ? Object.keys(I) : Object.keys(q(A))).map((B) => ({ key: B, value: ue(I[B]) }))
2052
+ fields: (Object.keys(I).length ? Object.keys(I) : Object.keys(q(A))).map((W) => ({ key: W, value: fe(I[W]) }))
2053
2053
  };
2054
2054
  }
2055
2055
  if (h.startsWith("multipart/")) {
2056
2056
  const I = N(C) ? C : {};
2057
2057
  return {
2058
2058
  kind: "multipart",
2059
- parts: Object.entries(q(A)).map(([D, B]) => {
2059
+ parts: Object.entries(q(A)).map(([D, W]) => {
2060
2060
  var ie;
2061
- return B.format === "binary" || B.format === "base64" || B.contentMediaType !== void 0 || B.type === "array" && ((ie = B.items) == null ? void 0 : ie.format) === "binary" ? { key: D, value: "", type: "file" } : { key: D, value: ue(I[D]), type: "text" };
2061
+ return W.format === "binary" || W.format === "base64" || W.contentMediaType !== void 0 || W.type === "array" && ((ie = W.items) == null ? void 0 : ie.format) === "binary" ? { key: D, value: "", type: "file" } : { key: D, value: fe(I[D]), type: "text" };
2062
2062
  })
2063
2063
  };
2064
2064
  }
2065
2065
  return /json/.test(h) ? {
2066
2066
  kind: "json",
2067
2067
  text: typeof C == "string" ? C : JSON.stringify(C ?? {}, null, 2)
2068
- } : h === "application/graphql" ? { kind: "graphql", query: ue(C) } : /xml/.test(h) ? { kind: "xml", text: typeof C == "string" ? C : "" } : h.startsWith("text/") ? {
2068
+ } : h === "application/graphql" ? { kind: "graphql", query: fe(C) } : /xml/.test(h) ? { kind: "xml", text: typeof C == "string" ? C : "" } : h.startsWith("text/") ? {
2069
2069
  kind: "text",
2070
- text: ue(C),
2070
+ text: fe(C),
2071
2071
  contentType: h === "text/plain" ? void 0 : h
2072
2072
  } : { kind: "binary", contentType: h };
2073
2073
  }, b = (h) => {
@@ -2076,13 +2076,13 @@ function Wn(e, t = {}) {
2076
2076
  return {};
2077
2077
  const A = {};
2078
2078
  typeof g.description == "string" && (A.description = g.description);
2079
- const U = N(g.content) ? We(g.content) : void 0;
2079
+ const U = N(g.content) ? Be(g.content) : void 0;
2080
2080
  if (U) {
2081
2081
  const [C, q] = U;
2082
2082
  A.contentType = C;
2083
2083
  const I = c(q.schema);
2084
2084
  I && (A.schema = I);
2085
- const D = q.example ?? d(q.examples);
2085
+ const D = q.example ?? f(q.examples);
2086
2086
  D !== void 0 && (A.example = typeof D == "string" ? D : JSON.stringify(D, null, 2));
2087
2087
  }
2088
2088
  return N(g.headers) && (A.headers = Object.entries(g.headers).map(([C, q]) => {
@@ -2104,13 +2104,13 @@ function Wn(e, t = {}) {
2104
2104
  const ce = $(G);
2105
2105
  if (!ce)
2106
2106
  continue;
2107
- const ut = I.findIndex((ft) => ft.key === ce.key && ft.in === ce.in);
2108
- ut >= 0 ? I[ut] = ce : I.push(ce);
2107
+ const ft = I.findIndex((dt) => dt.key === ce.key && dt.in === ce.in);
2108
+ ft >= 0 ? I[ft] = ce : I.push(ce);
2109
2109
  }
2110
2110
  let D = { kind: "none" };
2111
- const B = a(q.requestBody);
2112
- if (N(B) && N(B.content)) {
2113
- const G = We(B.content);
2111
+ const W = a(q.requestBody);
2112
+ if (N(W) && N(W.content)) {
2113
+ const G = Be(W.content);
2114
2114
  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" }));
2115
2115
  }
2116
2116
  const re = {};
@@ -2121,7 +2121,7 @@ function Wn(e, t = {}) {
2121
2121
  ie != null && ie.contentType && ie.contentType !== "*/*" && I.push({ key: "Accept", value: ie.contentType, in: "header" });
2122
2122
  let Ee = v(q.security);
2123
2123
  Ee && S && JSON.stringify(Ee) === JSON.stringify(S) && (Ee = void 0);
2124
- const le = Array.isArray(q.tags) ? q.tags.filter((G) => typeof G == "string") : void 0, Zt = ye({
2124
+ const ue = Array.isArray(q.tags) ? q.tags.filter((G) => typeof G == "string") : void 0, Zt = ge({
2125
2125
  name: z(q.summary) ?? z(q.operationId) ?? `${C.toUpperCase()} ${h}`,
2126
2126
  method: C.toUpperCase(),
2127
2127
  url: `{{${r}}}${h}`,
@@ -2130,11 +2130,11 @@ function Wn(e, t = {}) {
2130
2130
  auth: Ee,
2131
2131
  description: z(q.description),
2132
2132
  operationId: z(q.operationId),
2133
- tags: le != null && le.length ? le : void 0,
2133
+ tags: ue != null && ue.length ? ue : void 0,
2134
2134
  deprecated: q.deprecated === !0 || void 0,
2135
2135
  responses: Object.keys(re).length ? re : void 0
2136
2136
  });
2137
- w.push({ request: Zt, tag: le == null ? void 0 : le[0], segment: h.split("/").filter(Boolean)[0] });
2137
+ w.push({ request: Zt, tag: ue == null ? void 0 : ue[0], segment: h.split("/").filter(Boolean)[0] });
2138
2138
  }
2139
2139
  }
2140
2140
  const P = [], R = t.groupBy ?? "tag";
@@ -2159,13 +2159,13 @@ function Wn(e, t = {}) {
2159
2159
  let g = z(h.url) ?? "";
2160
2160
  if (N(h.variables))
2161
2161
  for (const [A, U] of Object.entries(h.variables))
2162
- N(U) && (g = g.split(`{${A}}`).join(ue(U.default)));
2162
+ N(U) && (g = g.split(`{${A}}`).join(fe(U.default)));
2163
2163
  return { url: g, description: z(h.description) };
2164
2164
  }), j = N(s.info) ? s.info : {};
2165
- return ge({
2165
+ return be({
2166
2166
  name: z(j.title) ?? "API",
2167
2167
  description: z(j.description),
2168
- version: j.version === void 0 ? void 0 : ue(j.version),
2168
+ version: j.version === void 0 ? void 0 : fe(j.version),
2169
2169
  items: P,
2170
2170
  variables: [{ key: r, value: ((M = H[0]) == null ? void 0 : M.url) ?? "" }, ...l.values()],
2171
2171
  auth: S,
@@ -2173,7 +2173,7 @@ function Wn(e, t = {}) {
2173
2173
  schemas: Object.keys(u).length ? u : void 0
2174
2174
  });
2175
2175
  }
2176
- function Bn(e) {
2176
+ function Wn(e) {
2177
2177
  const t = (y) => {
2178
2178
  if (Array.isArray(y))
2179
2179
  return y.map(t);
@@ -2288,7 +2288,7 @@ function Bn(e) {
2288
2288
  Mt.includes(b) && N(S) ? T[b] = p(S, $) : b !== "parameters" && (T[b] = S);
2289
2289
  u[y] = T;
2290
2290
  }
2291
- const f = {};
2291
+ const d = {};
2292
2292
  if (N(n.securityDefinitions)) {
2293
2293
  const y = {
2294
2294
  implicit: "implicit",
@@ -2297,12 +2297,12 @@ function Bn(e) {
2297
2297
  accessCode: "authorizationCode"
2298
2298
  };
2299
2299
  for (const [v, $] of Object.entries(n.securityDefinitions))
2300
- N($) && ($.type === "basic" ? f[v] = { type: "http", scheme: "basic", description: $.description } : $.type === "apiKey" ? f[v] = {
2300
+ N($) && ($.type === "basic" ? d[v] = { type: "http", scheme: "basic", description: $.description } : $.type === "apiKey" ? d[v] = {
2301
2301
  type: "apiKey",
2302
2302
  name: $.name,
2303
2303
  in: $.in,
2304
2304
  description: $.description
2305
- } : $.type === "oauth2" && (f[v] = {
2305
+ } : $.type === "oauth2" && (d[v] = {
2306
2306
  type: "oauth2",
2307
2307
  description: $.description,
2308
2308
  flows: {
@@ -2314,10 +2314,10 @@ function Bn(e) {
2314
2314
  }
2315
2315
  }));
2316
2316
  }
2317
- const d = {};
2317
+ const f = {};
2318
2318
  if (N(n.responses))
2319
2319
  for (const [y, v] of Object.entries(n.responses))
2320
- d[y] = c(v, r);
2320
+ f[y] = c(v, r);
2321
2321
  const l = z(n.host), m = z(n.basePath) ?? "", k = Array.isArray(n.schemes) && typeof n.schemes[0] == "string" ? n.schemes[0] : "https";
2322
2322
  return {
2323
2323
  openapi: "3.0.3",
@@ -2328,12 +2328,12 @@ function Bn(e) {
2328
2328
  paths: u,
2329
2329
  components: {
2330
2330
  schemas: n.definitions,
2331
- responses: d,
2332
- securitySchemes: f
2331
+ responses: f,
2332
+ securitySchemes: d
2333
2333
  }
2334
2334
  };
2335
2335
  }
2336
- function Ds(e) {
2336
+ function Hs(e) {
2337
2337
  const t = /* @__PURE__ */ new Map(), n = (s, r) => {
2338
2338
  if (!s || s.type === "none" || s.type === "inherit")
2339
2339
  return;
@@ -2350,7 +2350,7 @@ function Ds(e) {
2350
2350
  r ? i.requestIds.push(r) : i.collectionDefault = !0, t.set(o.name, i);
2351
2351
  };
2352
2352
  n(e.auth);
2353
- for (const { request: s, folders: r } of be(e.items)) {
2353
+ for (const { request: s, folders: r } of le(e.items)) {
2354
2354
  let o = s.auth;
2355
2355
  for (let i = r.length - 1; (!o || o.type === "inherit") && i >= 0; i--)
2356
2356
  o = r[i].auth;
@@ -2523,7 +2523,7 @@ function Kn(e, t = {}) {
2523
2523
  if (S)
2524
2524
  return i[S.name] = S.scheme, [{ [S.name]: S.scopes }];
2525
2525
  }, c = a(e.auth), p = {}, u = /* @__PURE__ */ new Map();
2526
- for (const { request: b, folders: S } of be(e.items)) {
2526
+ for (const { request: b, folders: S } of le(e.items)) {
2527
2527
  const w = Fn(b.url, o), O = b.method.toLowerCase();
2528
2528
  if (p[w] ?? (p[w] = {}), p[w][O])
2529
2529
  continue;
@@ -2561,7 +2561,7 @@ function Kn(e, t = {}) {
2561
2561
  const M = a(b.auth);
2562
2562
  M && (j.security = M), p[w][O] = j;
2563
2563
  }
2564
- const f = {
2564
+ const d = {
2565
2565
  openapi: "3.1.0",
2566
2566
  info: {
2567
2567
  title: e.name,
@@ -2569,41 +2569,41 @@ function Kn(e, t = {}) {
2569
2569
  ...e.description ? { description: e.description } : {}
2570
2570
  }
2571
2571
  };
2572
- r && (f.servers = r.map((b) => b.description ? b : { url: b.url })), u.size && (f.tags = [...u].map(
2572
+ r && (d.servers = r.map((b) => b.description ? b : { url: b.url })), u.size && (d.tags = [...u].map(
2573
2573
  ([b, S]) => S ? { name: b, description: S } : { name: b }
2574
- )), c && (f.security = c), f.paths = p;
2575
- const d = {};
2576
- 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;
2574
+ )), c && (d.security = c), d.paths = p;
2575
+ const f = {};
2576
+ return e.schemas && Object.keys(e.schemas).length && (f.schemas = e.schemas), Object.keys(i).length && (f.securitySchemes = i), Object.keys(f).length && (d.components = f), d;
2577
2577
  }
2578
- function Hs(e, t = {}) {
2578
+ function zs(e, t = {}) {
2579
2579
  return Mn(Kn(e, t));
2580
2580
  }
2581
- 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";
2581
+ const B = (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(B) : [], Jn = "https://schema.getpostman.com/json/collection/v2.1.0/collection.json";
2582
2582
  function Ht(e) {
2583
- return W(e) && W(e.info) && Array.isArray(e.item);
2583
+ return B(e) && B(e.info) && Array.isArray(e.item);
2584
2584
  }
2585
- function he(e) {
2585
+ function ye(e) {
2586
2586
  if (typeof e == "string")
2587
2587
  return e || void 0;
2588
- if (W(e))
2588
+ if (B(e))
2589
2589
  return E(e.content);
2590
2590
  }
2591
2591
  function Se(e) {
2592
2592
  return ke(e).map((t) => {
2593
2593
  const n = { key: E(t.key) ?? "", value: E(t.value) ?? "" };
2594
2594
  t.disabled === !0 && (n.enabled = !1);
2595
- const s = he(t.description);
2595
+ const s = ye(t.description);
2596
2596
  return s && (n.description = s), n;
2597
2597
  });
2598
2598
  }
2599
- function pt(e) {
2600
- if (!W(e) || typeof e.type != "string")
2599
+ function lt(e) {
2600
+ if (!B(e) || typeof e.type != "string")
2601
2601
  return;
2602
2602
  const t = e[e.type], n = (s) => {
2603
2603
  var r;
2604
2604
  if (Array.isArray(t))
2605
- return E((r = t.filter(W).find((o) => o.key === s)) == null ? void 0 : r.value);
2606
- if (W(t))
2605
+ return E((r = t.filter(B).find((o) => o.key === s)) == null ? void 0 : r.value);
2606
+ if (B(t))
2607
2607
  return E(t[s]);
2608
2608
  };
2609
2609
  switch (e.type) {
@@ -2670,14 +2670,14 @@ function Qn(e) {
2670
2670
  const { base: o, query: i, hash: a } = pe(e);
2671
2671
  return { url: o + a, params: i.map((c) => ({ ...c, in: "query" })) };
2672
2672
  }
2673
- if (!W(e))
2673
+ if (!B(e))
2674
2674
  return { url: "", params: [] };
2675
2675
  const t = E(e.raw);
2676
2676
  let n;
2677
2677
  if (t !== void 0)
2678
2678
  n = pe(t).base;
2679
2679
  else {
2680
- 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) ?? "";
2680
+ 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) => (B(p) ? E(p.value) : E(p)) ?? "").join("/") : E(e.path) ?? "";
2681
2681
  n = `${o ? `${o}://` : ""}${i}${a ? `:${a}` : ""}${c ? `/${c.replace(/^\//, "")}` : ""}`;
2682
2682
  }
2683
2683
  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) => ({
@@ -2688,11 +2688,11 @@ function Qn(e) {
2688
2688
  return { url: n, params: [...r, ...s] };
2689
2689
  }
2690
2690
  function Gn(e) {
2691
- if (!W(e))
2691
+ if (!B(e))
2692
2692
  return { kind: "none" };
2693
2693
  switch (e.mode) {
2694
2694
  case "raw": {
2695
- const t = E(e.raw) ?? "", n = W(e.options) && W(e.options.raw) ? E(e.options.raw.language) : void 0;
2695
+ const t = E(e.raw) ?? "", n = B(e.options) && B(e.options.raw) ? E(e.options.raw.language) : void 0;
2696
2696
  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 };
2697
2697
  }
2698
2698
  case "urlencoded":
@@ -2712,9 +2712,9 @@ function Gn(e) {
2712
2712
  })
2713
2713
  };
2714
2714
  case "file":
2715
- return { kind: "binary", fileName: W(e.file) ? E(e.file.src) : void 0 };
2715
+ return { kind: "binary", fileName: B(e.file) ? E(e.file.src) : void 0 };
2716
2716
  case "graphql": {
2717
- const t = W(e.graphql) ? e.graphql : {};
2717
+ const t = B(e.graphql) ? e.graphql : {};
2718
2718
  return { kind: "graphql", query: E(t.query) ?? "", variables: E(t.variables) };
2719
2719
  }
2720
2720
  default:
@@ -2724,48 +2724,48 @@ function Gn(e) {
2724
2724
  function zt(e) {
2725
2725
  const t = {};
2726
2726
  for (const n of ke(e)) {
2727
- const s = W(n.script) ? n.script : {}, r = Array.isArray(s.exec) ? s.exec.map((o) => E(o) ?? "").join(`
2727
+ const s = B(n.script) ? n.script : {}, r = Array.isArray(s.exec) ? s.exec.map((o) => E(o) ?? "").join(`
2728
2728
  `) : E(s.exec) ?? "";
2729
2729
  r.trim() && (n.listen === "prerequest" && (t.preRequest = r), n.listen === "test" && (t.test = r));
2730
2730
  }
2731
2731
  return t.preRequest || t.test ? t : void 0;
2732
2732
  }
2733
2733
  function Yn(e) {
2734
- 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) => ({
2734
+ const t = B(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) => ({
2735
2735
  name: E(i.name) ?? "Example",
2736
2736
  status: Number(i.code ?? 200) || 200,
2737
2737
  headers: Se(i.header),
2738
2738
  body: E(i.body)
2739
2739
  }));
2740
- return ye({
2740
+ return ge({
2741
2741
  id: E(e.id) ?? void 0,
2742
2742
  name: E(e.name) ?? "Request",
2743
2743
  method: (E(t.method) ?? "GET").toUpperCase(),
2744
2744
  url: n,
2745
2745
  params: [...s, ...r],
2746
2746
  body: Gn(t.body),
2747
- auth: pt(t.auth),
2748
- description: he(t.description) ?? he(e.description),
2747
+ auth: lt(t.auth),
2748
+ description: ye(t.description) ?? ye(e.description),
2749
2749
  scripts: zt(e.event),
2750
2750
  examples: o.length ? o : void 0
2751
2751
  });
2752
2752
  }
2753
- function Wt(e) {
2753
+ function Bt(e) {
2754
2754
  return ke(e).map(
2755
2755
  (t) => Array.isArray(t.item) ? Te({
2756
2756
  id: E(t.id) ?? void 0,
2757
2757
  name: E(t.name) ?? "Folder",
2758
- description: he(t.description),
2759
- items: Wt(t.item),
2760
- auth: pt(t.auth)
2758
+ description: ye(t.description),
2759
+ items: Bt(t.item),
2760
+ auth: lt(t.auth)
2761
2761
  }) : Yn(t)
2762
2762
  );
2763
2763
  }
2764
- function Bt(e) {
2764
+ function Wt(e) {
2765
2765
  return ke(e).map((t) => {
2766
2766
  const n = { key: E(t.key) ?? "", value: E(t.value) ?? "" };
2767
2767
  t.type === "secret" && (n.secret = !0), (t.disabled === !0 || t.enabled === !1) && (n.enabled = !1);
2768
- const s = he(t.description);
2768
+ const s = ye(t.description);
2769
2769
  return s && (n.description = s), n;
2770
2770
  });
2771
2771
  }
@@ -2773,14 +2773,14 @@ function Xn(e) {
2773
2773
  const t = typeof e == "string" ? JSON.parse(e) : e;
2774
2774
  if (!Ht(t))
2775
2775
  throw new Error("Not a Postman collection");
2776
- const n = t, s = n.info, r = zt(n.event), o = ge({
2776
+ const n = t, s = n.info, r = zt(n.event), o = be({
2777
2777
  id: E(s._postman_id) ?? void 0,
2778
2778
  name: E(s.name) ?? "Postman collection",
2779
- description: he(s.description),
2780
- version: W(s.version) ? E(s.version.raw) : E(s.version),
2781
- items: Wt(n.item),
2782
- variables: Bt(n.variable),
2783
- auth: pt(n.auth)
2779
+ description: ye(s.description),
2780
+ version: B(s.version) ? E(s.version.raw) : E(s.version),
2781
+ items: Bt(n.item),
2782
+ variables: Wt(n.variable),
2783
+ auth: lt(n.auth)
2784
2784
  });
2785
2785
  if (r) {
2786
2786
  const i = (a) => a.map(
@@ -2792,12 +2792,12 @@ function Xn(e) {
2792
2792
  }
2793
2793
  function Zn(e) {
2794
2794
  const t = typeof e == "string" ? JSON.parse(e) : e;
2795
- if (!W(t) || !Array.isArray(t.values))
2795
+ if (!B(t) || !Array.isArray(t.values))
2796
2796
  throw new Error("Not a Postman environment");
2797
2797
  return {
2798
2798
  id: E(t.id) ?? Ne("e"),
2799
2799
  name: E(t.name) ?? "Environment",
2800
- values: Bt(t.values)
2800
+ values: Wt(t.values)
2801
2801
  };
2802
2802
  }
2803
2803
  const V = (e, t) => ({
@@ -2875,16 +2875,16 @@ const je = (e) => {
2875
2875
  return L(e) || (t.disabled = !0), e.description && (t.description = e.description), t;
2876
2876
  };
2877
2877
  function es(e) {
2878
- const t = e.params.filter((f) => f.in === "query"), n = Ue({
2878
+ const t = e.params.filter((d) => d.in === "query"), n = Ue({
2879
2879
  ...e,
2880
- params: e.params.filter((f) => f.in === "query" && L(f))
2880
+ params: e.params.filter((d) => d.in === "query" && L(d))
2881
2881
  }).replace(/%7B%7B(.*?)%7D%7D/g, "{{$1}}").replace(new RegExp("(?<!\\{)\\{([A-Za-z_][\\w.-]*)\\}(?!\\})", "g"), ":$1"), s = pe(e.url).base, r = /^([a-z][\w+.-]*):\/\//i.exec(s), o = r ? s.slice(r[0].length) : s, i = o.indexOf("/"), a = i < 0 ? o : o.slice(0, i), c = i < 0 ? [] : o.slice(i + 1).split("/"), p = {
2882
2882
  raw: n,
2883
2883
  host: a ? a.startsWith("{{") ? [a] : a.split(".") : [],
2884
- path: c.map((f) => f.replace(/^\{([A-Za-z_][\w.-]*)\}$/, ":$1"))
2884
+ path: c.map((d) => d.replace(/^\{([A-Za-z_][\w.-]*)\}$/, ":$1"))
2885
2885
  };
2886
2886
  r && (p.protocol = r[1]), t.length && (p.query = t.map(je));
2887
- const u = e.params.filter((f) => f.in === "path");
2887
+ const u = e.params.filter((d) => d.in === "path");
2888
2888
  return u.length && (p.variable = u.map(je)), p;
2889
2889
  }
2890
2890
  function ts(e) {
@@ -2961,7 +2961,7 @@ function Ft(e) {
2961
2961
  body: a.body ?? ""
2962
2962
  })), o;
2963
2963
  }
2964
- function zs(e) {
2964
+ function Bs(e) {
2965
2965
  const t = {
2966
2966
  info: {
2967
2967
  _postman_id: e.id,
@@ -2991,12 +2991,12 @@ function Ws(e) {
2991
2991
  _postman_variable_scope: "environment"
2992
2992
  };
2993
2993
  }
2994
- 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/;
2994
+ const de = (e) => !!e && typeof e == "object" && !Array.isArray(e), K = (e) => typeof e == "string" ? e : void 0, Ze = (e) => Array.isArray(e) ? e.filter(de) : [], ss = /^(image|font|audio|video)\/|^text\/css|javascript|^application\/(x-)?font|wasm/;
2995
2995
  function we(e) {
2996
2996
  return Ze(e).map((t) => ({ key: K(t.name) ?? "", value: K(t.value) ?? "" }));
2997
2997
  }
2998
2998
  function Vt(e) {
2999
- return fe(e) && fe(e.log) && Array.isArray(e.log.entries);
2999
+ return de(e) && de(e.log) && Array.isArray(e.log.entries);
3000
3000
  }
3001
3001
  function rs(e, t = {}) {
3002
3002
  const n = typeof e == "string" ? JSON.parse(e) : e;
@@ -3006,10 +3006,10 @@ function rs(e, t = {}) {
3006
3006
  for (const i of s) {
3007
3007
  if (t.filter && !t.filter(i))
3008
3008
  continue;
3009
- const a = fe(i.request) ? i.request : {}, c = fe(i.response) ? i.response : {}, p = fe(c.content) ? c.content : {}, u = (K(p.mimeType) ?? "").toLowerCase();
3009
+ const a = de(i.request) ? i.request : {}, c = de(i.response) ? i.response : {}, p = de(c.content) ? c.content : {}, u = (K(p.mimeType) ?? "").toLowerCase();
3010
3010
  if (r && ss.test(u))
3011
3011
  continue;
3012
- 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(
3012
+ const { base: d, query: f } = pe(K(a.url) ?? ""), l = Array.isArray(a.queryString) ? we(a.queryString) : f, m = we(a.cookies), k = we(a.headers).filter(
3013
3013
  (w) => !w.key.startsWith(":") && !/^(content-length|host|connection)$/i.test(w.key) && !(m.length && /^cookie$/i.test(w.key))
3014
3014
  ), y = [
3015
3015
  ...l.map((w) => ({ ...w, in: "query" })),
@@ -3017,7 +3017,7 @@ function rs(e, t = {}) {
3017
3017
  ...m.map((w) => ({ ...w, in: "cookie" }))
3018
3018
  ];
3019
3019
  let v = { kind: "none" };
3020
- const $ = fe(a.postData) ? a.postData : void 0;
3020
+ const $ = de(a.postData) ? a.postData : void 0;
3021
3021
  if ($) {
3022
3022
  const w = K($.mimeType) ?? "", O = Ze($.params);
3023
3023
  O.length && w.includes("multipart") ? v = {
@@ -3031,12 +3031,12 @@ function rs(e, t = {}) {
3031
3031
  contentType: K(P.contentType)
3032
3032
  } : { key: K(P.name) ?? "", value: K(P.value) ?? "", type: "text" }
3033
3033
  )
3034
- } : O.length ? v = { kind: "form", fields: we(O) } : K($.text) !== void 0 && (v = St(K($.text) ?? "", w || void 0));
3034
+ } : O.length ? v = { kind: "form", fields: we(O) } : K($.text) !== void 0 && (v = jt(K($.text) ?? "", w || void 0));
3035
3035
  }
3036
3036
  const T = (K(a.method) ?? "GET").toUpperCase(), b = [], S = Number(c.status);
3037
3037
  if (Number.isFinite(S) && S > 0) {
3038
3038
  let w = K(p.text);
3039
- w !== void 0 && p.encoding === "base64" && /json|xml|text|javascript/.test(u) && (w = Ut(w)), b.push({
3039
+ w !== void 0 && p.encoding === "base64" && /json|xml|text|javascript/.test(u) && (w = Et(w)), b.push({
3040
3040
  name: `${S} ${K(c.statusText) ?? ""}`.trim(),
3041
3041
  status: S,
3042
3042
  headers: we(c.headers).filter((O) => !O.key.startsWith(":")),
@@ -3044,53 +3044,53 @@ function rs(e, t = {}) {
3044
3044
  });
3045
3045
  }
3046
3046
  o.push(
3047
- ye({
3048
- name: Et(T, f),
3047
+ ge({
3048
+ name: _t(T, d),
3049
3049
  method: T,
3050
- url: f,
3050
+ url: d,
3051
3051
  params: y,
3052
3052
  body: v,
3053
3053
  examples: b.length ? b : void 0
3054
3054
  })
3055
3055
  );
3056
3056
  }
3057
- return ge({ name: t.name ?? "HAR import", items: o });
3057
+ return be({ name: t.name ?? "HAR import", items: o });
3058
3058
  }
3059
- const Be = (e) => ({ name: e.key, value: e.value });
3060
- function Bs(e, t = {}) {
3061
- 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) => {
3059
+ const We = (e) => ({ name: e.key, value: e.value });
3060
+ function Fs(e, t = {}) {
3061
+ const n = Array.isArray(e) ? e : le(e.items).map((i) => i.request), s = t.transform ?? ((i) => i), r = (t.now ?? (() => /* @__PURE__ */ new Date()))().toISOString(), o = n.map((i) => {
3062
3062
  var k, y, v, $, T;
3063
- 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 = {
3063
+ 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), d = {
3064
3064
  method: i.method.toUpperCase(),
3065
3065
  url: a,
3066
3066
  httpVersion: "HTTP/1.1",
3067
- headers: c.map(Be),
3067
+ headers: c.map(We),
3068
3068
  queryString: i.params.filter((b) => b.in === "query" && L(b)).map((b) => ({ name: s(b.key), value: s(b.value) })),
3069
- cookies: p.map(Be),
3069
+ cookies: p.map(We),
3070
3070
  headersSize: -1,
3071
3071
  bodySize: -1
3072
- }, d = i.body;
3073
- d.kind === "form" ? f.postData = {
3072
+ }, f = i.body;
3073
+ f.kind === "form" ? d.postData = {
3074
3074
  mimeType: u,
3075
- params: d.fields.filter(L).map((b) => ({ name: s(b.key), value: s(b.value) })),
3076
- text: s(oe(d) ?? "")
3077
- } : d.kind === "multipart" ? f.postData = {
3075
+ params: f.fields.filter(L).map((b) => ({ name: s(b.key), value: s(b.value) })),
3076
+ text: s(oe(f) ?? "")
3077
+ } : f.kind === "multipart" ? d.postData = {
3078
3078
  mimeType: u,
3079
- params: d.parts.filter(L).map(
3079
+ params: f.parts.filter(L).map(
3080
3080
  (b) => b.type === "file" ? { name: s(b.key), fileName: b.fileName ?? "", contentType: b.contentType } : { name: s(b.key), value: s(b.value) }
3081
3081
  )
3082
- } : d.kind !== "none" && d.kind !== "binary" && (f.postData = { mimeType: u, text: s(oe(d) ?? "") });
3082
+ } : f.kind !== "none" && f.kind !== "binary" && (d.postData = { mimeType: u, text: s(oe(f) ?? "") });
3083
3083
  const l = (y = i.examples) == null ? void 0 : y[0], m = (($ = (v = l == null ? void 0 : l.headers) == null ? void 0 : v.find((b) => /^content-type$/i.test(b.key))) == null ? void 0 : $.value) ?? "";
3084
3084
  return {
3085
3085
  startedDateTime: r,
3086
3086
  time: 0,
3087
- request: f,
3087
+ request: d,
3088
3088
  response: {
3089
3089
  status: (l == null ? void 0 : l.status) ?? 0,
3090
3090
  // the example's name is "201 Created" when it came from a HAR
3091
3091
  statusText: l ? l.name.replace(new RegExp(`^${l.status}\\s*`), "") : "",
3092
3092
  httpVersion: "HTTP/1.1",
3093
- headers: ((l == null ? void 0 : l.headers) ?? []).map(Be),
3093
+ headers: ((l == null ? void 0 : l.headers) ?? []).map(We),
3094
3094
  cookies: [],
3095
3095
  content: {
3096
3096
  size: ((T = l == null ? void 0 : l.body) == null ? void 0 : T.length) ?? 0,
@@ -3113,7 +3113,7 @@ function Bs(e, t = {}) {
3113
3113
  }
3114
3114
  };
3115
3115
  }
3116
- const Fs = `query IntrospectionQuery {
3116
+ const Vs = `query IntrospectionQuery {
3117
3117
  __schema {
3118
3118
  queryType { name }
3119
3119
  mutationType { name }
@@ -3259,12 +3259,12 @@ function cs(e) {
3259
3259
  return e.charAt(0).toUpperCase() + e.slice(1);
3260
3260
  }
3261
3261
  function ps(e, t, n = {}) {
3262
- 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} {
3262
+ 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, " ")}`, d = `${s} ${i}${c} {
3263
3263
  ${r.name}${p}${u}
3264
- }`, d = {};
3264
+ }`, f = {};
3265
3265
  for (const l of a)
3266
- l.defaultValue == null && (d[l.name] = qe(e, l.type));
3267
- return { query: f, variables: d, operationName: i };
3266
+ l.defaultValue == null && (f[l.name] = qe(e, l.type));
3267
+ return { query: d, variables: f, operationName: i };
3268
3268
  }
3269
3269
  function ls(e, t = {}) {
3270
3270
  const n = typeof e == "object" && e && "types" in e && !Array.isArray(e.types) ? e : is(e), s = {
@@ -3274,7 +3274,7 @@ function ls(e, t = {}) {
3274
3274
  ...t.folderNames
3275
3275
  }, r = /* @__PURE__ */ new Map();
3276
3276
  for (const o of os(n)) {
3277
- const i = ps(n, o, { depth: t.depth }), a = ye({
3277
+ const i = ps(n, o, { depth: t.depth }), a = ge({
3278
3278
  name: o.field.name,
3279
3279
  method: "POST",
3280
3280
  url: "{{graphqlUrl}}",
@@ -3289,13 +3289,13 @@ function ls(e, t = {}) {
3289
3289
  });
3290
3290
  r.has(o.kind) || r.set(o.kind, []), r.get(o.kind).push(a);
3291
3291
  }
3292
- return ge({
3292
+ return be({
3293
3293
  name: t.name ?? "GraphQL API",
3294
3294
  items: [...r].map(([o, i]) => Te({ name: s[o], items: i })),
3295
3295
  variables: [{ key: "graphqlUrl", value: t.endpoint ?? "" }]
3296
3296
  });
3297
3297
  }
3298
- 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}`;
3298
+ const Q = "http://schemas.xmlsoap.org/wsdl/", Fe = "http://schemas.xmlsoap.org/wsdl/soap/", Ve = "http://schemas.xmlsoap.org/wsdl/soap12/", me = "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}`;
3299
3299
  function X(e, t, n) {
3300
3300
  return Array.from(e.childNodes).filter(
3301
3301
  (s) => s.nodeType === 1 && s.localName === n && (t === null || s.namespaceURI === t)
@@ -3310,7 +3310,7 @@ function ae(e, t) {
3310
3310
  const n = t.indexOf(":"), s = n < 0 ? null : t.slice(0, n), r = n < 0 ? t : t.slice(n + 1);
3311
3311
  return { namespace: e.lookupNamespaceURI(s) ?? void 0, name: r };
3312
3312
  }
3313
- function $t(e) {
3313
+ function wt(e) {
3314
3314
  var s;
3315
3315
  const t = ne(e, Q, "documentation");
3316
3316
  return ((s = t == null ? void 0 : t.textContent) == null ? void 0 : s.trim()) || void 0;
@@ -3326,48 +3326,48 @@ function ms(e, t = ds()) {
3326
3326
  if (!s || s.localName !== "definitions" || s.namespaceURI !== Q)
3327
3327
  throw new Error("Not a WSDL 1.1 document");
3328
3328
  const r = s.getAttribute("targetNamespace") ?? void 0, o = { elements: /* @__PURE__ */ new Map(), types: /* @__PURE__ */ new Map(), qualified: /* @__PURE__ */ new Map() }, i = ne(s, Q, "types");
3329
- for (const f of i ? X(i, de, "schema") : []) {
3330
- const d = f.getAttribute("targetNamespace") ?? void 0;
3331
- o.qualified.set(d ?? "", f.getAttribute("elementFormDefault") === "qualified");
3332
- for (const l of X(f, de, "element")) {
3329
+ for (const d of i ? X(i, me, "schema") : []) {
3330
+ const f = d.getAttribute("targetNamespace") ?? void 0;
3331
+ o.qualified.set(f ?? "", d.getAttribute("elementFormDefault") === "qualified");
3332
+ for (const l of X(d, me, "element")) {
3333
3333
  const m = l.getAttribute("name");
3334
- m && o.elements.set(ee(d, m), l);
3334
+ m && o.elements.set(ee(f, m), l);
3335
3335
  }
3336
- for (const l of [...X(f, de, "complexType"), ...X(f, de, "simpleType")]) {
3336
+ for (const l of [...X(d, me, "complexType"), ...X(d, me, "simpleType")]) {
3337
3337
  const m = l.getAttribute("name");
3338
- m && o.types.set(ee(d, m), l);
3338
+ m && o.types.set(ee(f, m), l);
3339
3339
  }
3340
3340
  }
3341
3341
  const a = /* @__PURE__ */ new Map();
3342
- for (const f of X(s, Q, "message")) {
3343
- const d = X(f, Q, "part").map((l) => ({
3342
+ for (const d of X(s, Q, "message")) {
3343
+ const f = X(d, Q, "part").map((l) => ({
3344
3344
  name: l.getAttribute("name") ?? "",
3345
3345
  element: ae(l, l.getAttribute("element")),
3346
3346
  type: ae(l, l.getAttribute("type"))
3347
3347
  }));
3348
- a.set(ee(r, f.getAttribute("name") ?? ""), d);
3348
+ a.set(ee(r, d.getAttribute("name") ?? ""), f);
3349
3349
  }
3350
3350
  const c = /* @__PURE__ */ new Map();
3351
- for (const f of X(s, Q, "portType")) {
3352
- const d = /* @__PURE__ */ new Map();
3353
- for (const l of X(f, Q, "operation")) {
3351
+ for (const d of X(s, Q, "portType")) {
3352
+ const f = /* @__PURE__ */ new Map();
3353
+ for (const l of X(d, Q, "operation")) {
3354
3354
  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;
3355
- d.set(l.getAttribute("name") ?? "", {
3356
- doc: $t(l),
3355
+ f.set(l.getAttribute("name") ?? "", {
3356
+ doc: wt(l),
3357
3357
  input: y ? ee(y.namespace, y.name) : void 0,
3358
3358
  output: v ? ee(v.namespace, v.name) : void 0
3359
3359
  });
3360
3360
  }
3361
- c.set(ee(r, f.getAttribute("name") ?? ""), d);
3361
+ c.set(ee(r, d.getAttribute("name") ?? ""), f);
3362
3362
  }
3363
3363
  const p = /* @__PURE__ */ new Map();
3364
- for (const f of X(s, Q, "binding")) {
3365
- const d = ne(f, Fe, "binding"), l = ne(f, Ve, "binding"), m = d ?? l, k = ee(r, f.getAttribute("name") ?? "");
3364
+ for (const d of X(s, Q, "binding")) {
3365
+ const f = ne(d, Fe, "binding"), l = ne(d, Ve, "binding"), m = f ?? l, k = ee(r, d.getAttribute("name") ?? "");
3366
3366
  if (!m) {
3367
3367
  p.set(k, null);
3368
3368
  continue;
3369
3369
  }
3370
- 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) => {
3370
+ const y = f ? Fe : Ve, v = ae(d, d.getAttribute("type")), $ = v ? c.get(ee(v.namespace, v.name)) : void 0, T = m.getAttribute("style") === "rpc" ? "rpc" : "document", b = X(d, Q, "operation").map((S) => {
3371
3371
  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 = {
3372
3372
  name: w,
3373
3373
  soapAction: (O == null ? void 0 : O.getAttribute("soapAction")) ?? void 0,
@@ -3386,19 +3386,19 @@ function ms(e, t = ds()) {
3386
3386
  const h = j == null ? void 0 : j.find((g) => g.element);
3387
3387
  return h != null && h.element && (M.outputElement = h.element), M;
3388
3388
  });
3389
- p.set(k, { version: d ? "1.1" : "1.2", operations: b });
3389
+ p.set(k, { version: f ? "1.1" : "1.2", operations: b });
3390
3390
  }
3391
- const u = X(s, Q, "service").map((f) => ({
3392
- name: f.getAttribute("name") ?? "Service",
3393
- documentation: $t(f),
3394
- ports: X(f, Q, "port").flatMap((d) => {
3395
- const l = ae(d, d.getAttribute("binding")), m = l ? p.get(ee(l.namespace, l.name)) : void 0;
3391
+ const u = X(s, Q, "service").map((d) => ({
3392
+ name: d.getAttribute("name") ?? "Service",
3393
+ documentation: wt(d),
3394
+ ports: X(d, Q, "port").flatMap((f) => {
3395
+ const l = ae(f, f.getAttribute("binding")), m = l ? p.get(ee(l.namespace, l.name)) : void 0;
3396
3396
  if (!m)
3397
3397
  return [];
3398
- const k = ne(d, Fe, "address") ?? ne(d, Ve, "address");
3398
+ const k = ne(f, Fe, "address") ?? ne(f, Ve, "address");
3399
3399
  return [
3400
3400
  {
3401
- name: d.getAttribute("name") ?? "",
3401
+ name: f.getAttribute("name") ?? "",
3402
3402
  binding: (l == null ? void 0 : l.name) ?? "",
3403
3403
  version: m.version,
3404
3404
  address: (k == null ? void 0 : k.getAttribute("location")) ?? "",
@@ -3416,36 +3416,36 @@ function Qt(e, t, n, s, r, o, i) {
3416
3416
  const $ = ae(t, t.getAttribute("ref")), T = $ ? e.schema.elements.get(ee($.namespace, $.name)) : void 0;
3417
3417
  T && (c = T, p = $ == null ? void 0 : $.namespace);
3418
3418
  }
3419
- const u = c.getAttribute("name") ?? a.split(":").pop() ?? a, f = r && p ? nt(p, s) : "", d = f ? `${f}:${u}` : u, m = c.getAttribute("minOccurs") === "0" || t.getAttribute("minOccurs") === "0" ? `${o}<!--Optional:-->
3419
+ const u = c.getAttribute("name") ?? a.split(":").pop() ?? a, d = r && p ? nt(p, s) : "", f = d ? `${d}:${u}` : u, m = c.getAttribute("minOccurs") === "0" || t.getAttribute("minOccurs") === "0" ? `${o}<!--Optional:-->
3420
3420
  ` : "";
3421
- let k = ne(c, de, "complexType");
3421
+ let k = ne(c, me, "complexType");
3422
3422
  const y = ae(c, c.getAttribute("type"));
3423
- if (!k && y && y.namespace !== de) {
3423
+ if (!k && y && y.namespace !== me) {
3424
3424
  const $ = e.schema.types.get(ee(y.namespace, y.name));
3425
3425
  ($ == null ? void 0 : $.localName) === "complexType" && (k = $);
3426
3426
  }
3427
3427
  if (!k || i > 6)
3428
- return `${m}${o}<${d}>?</${d}>`;
3428
+ return `${m}${o}<${f}>?</${f}>`;
3429
3429
  const v = hs(e, k, p, s, o, i);
3430
- return v ? `${m}${o}<${d}>
3430
+ return v ? `${m}${o}<${f}>
3431
3431
  ${v}
3432
- ${o}</${d}>` : `${m}${o}<${d}/>`;
3432
+ ${o}</${f}>` : `${m}${o}<${f}/>`;
3433
3433
  }
3434
3434
  function hs(e, t, n, s, r, o) {
3435
3435
  const i = e.schema.qualified.get(n ?? "") ?? !1, a = [], c = (p) => {
3436
3436
  for (const u of Array.from(p.childNodes)) {
3437
3437
  if (u.nodeType !== 1)
3438
3438
  continue;
3439
- const f = u;
3440
- if (f.namespaceURI === de) {
3441
- if (f.localName === "element")
3442
- a.push(Qt(e, f, n, s, i, `${r} `, o + 1));
3443
- else if (["sequence", "all", "choice", "complexContent", "extension"].includes(f.localName)) {
3444
- if (f.localName === "extension") {
3445
- const d = ae(f, f.getAttribute("base")), l = d ? e.schema.types.get(ee(d.namespace, d.name)) : void 0;
3439
+ const d = u;
3440
+ if (d.namespaceURI === me) {
3441
+ if (d.localName === "element")
3442
+ a.push(Qt(e, d, n, s, i, `${r} `, o + 1));
3443
+ else if (["sequence", "all", "choice", "complexContent", "extension"].includes(d.localName)) {
3444
+ if (d.localName === "extension") {
3445
+ const f = ae(d, d.getAttribute("base")), l = f ? e.schema.types.get(ee(f.namespace, f.name)) : void 0;
3446
3446
  l && c(l);
3447
3447
  }
3448
- c(f);
3448
+ c(d);
3449
3449
  }
3450
3450
  }
3451
3451
  }
@@ -3461,18 +3461,18 @@ function ys(e, t, n = "1.1") {
3461
3461
  let o;
3462
3462
  const i = t.inputElement;
3463
3463
  if (t.style === "rpc") {
3464
- const p = i == null ? void 0 : i.namespace, u = p ? nt(p, s) : "", f = u ? `${u}:${t.name}` : t.name, d = (t.inputParts ?? []).map((l) => ` <${l.name}>?</${l.name}>`);
3465
- o = d.length ? ` <${f}>
3466
- ${d.join(`
3464
+ const p = i == null ? void 0 : i.namespace, u = p ? nt(p, s) : "", d = u ? `${u}:${t.name}` : t.name, f = (t.inputParts ?? []).map((l) => ` <${l.name}>?</${l.name}>`);
3465
+ o = f.length ? ` <${d}>
3466
+ ${f.join(`
3467
3467
  `)}
3468
- </${f}>` : ` <${f}/>`;
3468
+ </${d}>` : ` <${d}/>`;
3469
3469
  } else if (i) {
3470
3470
  const p = e.schema.elements.get(ee(i.namespace, i.name));
3471
3471
  if (p)
3472
3472
  o = Qt(e, p, i.namespace, s, !0, " ", 0);
3473
3473
  else {
3474
- const u = i.namespace ? nt(i.namespace, s) : "", f = u ? `${u}:${i.name}` : i.name;
3475
- o = ` <${f}>?</${f}>`;
3474
+ const u = i.namespace ? nt(i.namespace, s) : "", d = u ? `${u}:${i.name}` : i.name;
3475
+ o = ` <${d}>?</${d}>`;
3476
3476
  }
3477
3477
  } else
3478
3478
  o = "";
@@ -3498,7 +3498,7 @@ function gs(e, t = {}) {
3498
3498
  name: n.services.length > 1 || o.ports.length > 1 ? `${o.name} — ${i.name}` : o.name,
3499
3499
  description: o.documentation,
3500
3500
  items: i.operations.map(
3501
- (a) => ye({
3501
+ (a) => ge({
3502
3502
  name: a.name,
3503
3503
  method: "POST",
3504
3504
  url: i.address,
@@ -3514,12 +3514,12 @@ function gs(e, t = {}) {
3514
3514
  })
3515
3515
  )
3516
3516
  );
3517
- return ge({
3517
+ return be({
3518
3518
  name: t.name ?? ((r = n.services[0]) == null ? void 0 : r.name) ?? "SOAP service",
3519
3519
  items: s.length === 1 ? s[0].items : s
3520
3520
  });
3521
3521
  }
3522
- const wt = [
3522
+ const vt = [
3523
3523
  7,
3524
3524
  12,
3525
3525
  17,
@@ -3595,20 +3595,20 @@ function Gt(e) {
3595
3595
  r.setUint32(s.length - 8, n >>> 0, !0), r.setUint32(s.length - 4, Math.floor(n / 2 ** 32), !0);
3596
3596
  let o = 1732584193, i = 4023233417, a = 2562383102, c = 271733878;
3597
3597
  const p = new Uint32Array(16);
3598
- for (let f = 0; f < s.length; f += 64) {
3598
+ for (let d = 0; d < s.length; d += 64) {
3599
3599
  for (let y = 0; y < 16; y++)
3600
- p[y] = r.getUint32(f + y * 4, !0);
3601
- let d = o, l = i, m = a, k = c;
3600
+ p[y] = r.getUint32(d + y * 4, !0);
3601
+ let f = o, l = i, m = a, k = c;
3602
3602
  for (let y = 0; y < 64; y++) {
3603
3603
  let v, $;
3604
3604
  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);
3605
- const T = d + v + bs[y] + p[$] >>> 0;
3606
- d = k, k = m, m = l, l = l + (T << wt[y] | T >>> 32 - wt[y]) >>> 0;
3605
+ const T = f + v + bs[y] + p[$] >>> 0;
3606
+ f = k, k = m, m = l, l = l + (T << vt[y] | T >>> 32 - vt[y]) >>> 0;
3607
3607
  }
3608
- o = o + d >>> 0, i = i + l >>> 0, a = a + m >>> 0, c = c + k >>> 0;
3608
+ o = o + f >>> 0, i = i + l >>> 0, a = a + m >>> 0, c = c + k >>> 0;
3609
3609
  }
3610
3610
  const u = new DataView(new ArrayBuffer(16));
3611
- return [o, i, a, c].forEach((f, d) => u.setUint32(d * 4, f, !0)), Array.from(new Uint8Array(u.buffer), (f) => f.toString(16).padStart(2, "0")).join(
3611
+ return [o, i, a, c].forEach((d, f) => u.setUint32(f * 4, d, !0)), Array.from(new Uint8Array(u.buffer), (d) => d.toString(16).padStart(2, "0")).join(
3612
3612
  ""
3613
3613
  );
3614
3614
  }
@@ -3635,7 +3635,7 @@ function rt() {
3635
3635
  function xe(e) {
3636
3636
  return Array.from(new Uint8Array(e), (t) => t.toString(16).padStart(2, "0")).join("");
3637
3637
  }
3638
- function lt(e) {
3638
+ function ut(e) {
3639
3639
  let t = "";
3640
3640
  for (const n of e instanceof Uint8Array ? e : new Uint8Array(e))
3641
3641
  t += String.fromCharCode(n);
@@ -3648,7 +3648,7 @@ function Ie(e) {
3648
3648
  async function Re(e, t) {
3649
3649
  return rt().digest(e, Ie(t));
3650
3650
  }
3651
- async function me(e, t, n) {
3651
+ async function he(e, t, n) {
3652
3652
  const s = t instanceof ArrayBuffer ? new Uint8Array(t) : Ie(t), r = await rt().importKey(
3653
3653
  "raw",
3654
3654
  Ie(s),
@@ -3692,15 +3692,15 @@ async function ws(e, t, n, s = {}) {
3692
3692
  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");
3693
3693
  let p = await ve(r, `${e.username}:${e.realm}:${e.password}`);
3694
3694
  /-sess$/i.test(r) && (p = await ve(r, `${p}:${e.nonce}:${a}`));
3695
- 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 = [
3695
+ const u = await ve(r, `${t}:${o}`), d = i ? await ve(r, `${p}:${e.nonce}:${c}:${a}:${i}:${u}`) : await ve(r, `${p}:${e.nonce}:${u}`), f = [
3696
3696
  `username="${e.username}"`,
3697
3697
  `realm="${e.realm}"`,
3698
3698
  `nonce="${e.nonce}"`,
3699
3699
  `uri="${o}"`,
3700
3700
  `algorithm=${r}`,
3701
- `response="${f}"`
3701
+ `response="${d}"`
3702
3702
  ];
3703
- return i && d.push(`qop=${i}`, `nc=${c}`, `cnonce="${a}"`), e.opaque && d.push(`opaque="${e.opaque}"`), `Digest ${d.join(", ")}`;
3703
+ return i && f.push(`qop=${i}`, `nc=${c}`, `cnonce="${a}"`), e.opaque && f.push(`opaque="${e.opaque}"`), `Digest ${f.join(", ")}`;
3704
3704
  }
3705
3705
  async function vs(e, t, n = /* @__PURE__ */ new Date()) {
3706
3706
  var b;
@@ -3709,13 +3709,13 @@ async function vs(e, t, n = /* @__PURE__ */ new Date()) {
3709
3709
  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)));
3710
3710
  const a = e.body && typeof e.body != "string" && e.body.kind === "multipart" ? "UNSIGNED-PAYLOAD" : xe(await Re("SHA-256", i)), c = t.service === "s3";
3711
3711
  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);
3712
- 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]]);
3712
+ 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("&"), d = /* @__PURE__ */ new Map([["host", s.host]]);
3713
3713
  for (const [S, w] of e.headers) {
3714
3714
  const O = S.toLowerCase();
3715
- (O.startsWith("x-amz-") || O === "content-type") && f.set(O, w.trim().replace(/\s+/g, " "));
3715
+ (O.startsWith("x-amz-") || O === "content-type") && d.set(O, w.trim().replace(/\s+/g, " "));
3716
3716
  }
3717
- const d = [...f.keys()].sort(), l = d.map((S) => `${S}:${f.get(S)}
3718
- `).join(""), m = d.join(";"), k = [
3717
+ const f = [...d.keys()].sort(), l = f.map((S) => `${S}:${d.get(S)}
3718
+ `).join(""), m = f.join(";"), k = [
3719
3719
  e.method.toUpperCase(),
3720
3720
  p,
3721
3721
  u,
@@ -3727,9 +3727,9 @@ async function vs(e, t, n = /* @__PURE__ */ new Date()) {
3727
3727
  `
3728
3728
  `
3729
3729
  );
3730
- let $ = await me("SHA-256", `AWS4${t.secretAccessKey}`, o);
3731
- $ = await me("SHA-256", $, t.region), $ = await me("SHA-256", $, t.service), $ = await me("SHA-256", $, "aws4_request");
3732
- const T = xe(await me("SHA-256", $, v));
3730
+ let $ = await he("SHA-256", `AWS4${t.secretAccessKey}`, o);
3731
+ $ = await he("SHA-256", $, t.region), $ = await he("SHA-256", $, t.service), $ = await he("SHA-256", $, "aws4_request");
3732
+ const T = xe(await he("SHA-256", $, v));
3733
3733
  J(
3734
3734
  e.headers,
3735
3735
  "Authorization",
@@ -3741,12 +3741,12 @@ async function As(e, t, n = /* @__PURE__ */ new Date()) {
3741
3741
  {path}
3742
3742
  {timestamp}
3743
3743
  {body}`, o = String(Math.floor(n.getTime() / 1e3)), i = r.replace(/\\n/g, `
3744
- `).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);
3744
+ `).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 he(t.algorithm, t.secret, i), c = t.encoding === "base64" ? ut(a) : xe(a);
3745
3745
  J(e.headers, t.header, `${t.prefix ?? ""}${c}`), r.includes("{timestamp}") && J(e.headers, t.timestampHeader ?? "X-Timestamp", o);
3746
3746
  }
3747
- async function vt(e, t = {}) {
3747
+ async function At(e, t = {}) {
3748
3748
  var m;
3749
- 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)}`);
3749
+ const n = (k) => Ut(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)}`);
3750
3750
  switch (r.type) {
3751
3751
  case "basic":
3752
3752
  J(i, "Authorization", `Basic ${at(`${r.username}:${r.password}`)}`);
@@ -3777,9 +3777,9 @@ async function vt(e, t = {}) {
3777
3777
  kind: "multipart",
3778
3778
  parts: u.parts.filter(L).map((k) => ({ ...k, key: n(k.key), value: n(k.value) }))
3779
3779
  } : u.kind === "binary" ? p = { kind: "binary", fileName: u.fileName, contentType: u.contentType, data: u.data } : u.kind !== "none" && (p = n(oe(u) ?? ""));
3780
- const f = Ce(u);
3781
- f && u.kind !== "multipart" && !Le(i, "Content-Type") && J(i, "Content-Type", f), u.kind === "soap" && u.version === "1.1" && u.action !== void 0 && !Le(i, "SOAPAction") && J(i, "SOAPAction", `"${n(u.action)}"`);
3782
- const d = {
3780
+ const d = Ce(u);
3781
+ d && u.kind !== "multipart" && !Le(i, "Content-Type") && J(i, "Content-Type", d), u.kind === "soap" && u.version === "1.1" && u.action !== void 0 && !Le(i, "SOAPAction") && J(i, "SOAPAction", `"${n(u.action)}"`);
3782
+ const f = {
3783
3783
  method: e.method.toUpperCase(),
3784
3784
  url: c,
3785
3785
  headers: i,
@@ -3787,13 +3787,13 @@ async function vt(e, t = {}) {
3787
3787
  settings: { ...e.settings }
3788
3788
  }, l = ((m = t.now) == null ? void 0 : m.call(t)) ?? /* @__PURE__ */ new Date();
3789
3789
  if (r.type === "digest") {
3790
- const k = await ws(r, d.method, c);
3791
- k && J(d.headers, "Authorization", k);
3792
- } else r.type === "awsSigV4" ? await vs(d, r, l) : r.type === "hmac" && await As(d, r, l);
3793
- return d;
3790
+ const k = await ws(r, f.method, c);
3791
+ k && J(f.headers, "Authorization", k);
3792
+ } else r.type === "awsSigV4" ? await vs(f, r, l) : r.type === "hmac" && await As(f, r, l);
3793
+ return f;
3794
3794
  }
3795
- async function Vs(e, t, n = {}, s) {
3796
- let r = await vt(e, n), o = await t(r, s);
3795
+ async function Ks(e, t, n = {}, s) {
3796
+ let r = await At(e, n), o = await t(r, s);
3797
3797
  const i = n.auth ?? e.auth;
3798
3798
  if (o.status === 401 && (i == null ? void 0 : i.type) === "digest" && !i.nonce) {
3799
3799
  const a = $s(Le(o.headers, "WWW-Authenticate") ?? "");
@@ -3806,75 +3806,75 @@ async function Vs(e, t, n = {}, s) {
3806
3806
  algorithm: a.algorithm,
3807
3807
  opaque: a.opaque
3808
3808
  };
3809
- return r = await vt(e, { ...n, auth: c }), o = await t(r, s), { response: o, sent: r, auth: c };
3809
+ return r = await At(e, { ...n, auth: c }), o = await t(r, s), { response: o, sent: r, auth: c };
3810
3810
  }
3811
3811
  }
3812
3812
  return { response: o, sent: r, auth: i };
3813
3813
  }
3814
3814
  const xs = /^text\/|json|xml|javascript|ecmascript|x-www-form-urlencoded|graphql|yaml|csv|html/i;
3815
- function At(e, t) {
3815
+ function xt(e, t) {
3816
3816
  const n = Uint8Array.from(atob(e), (s) => s.charCodeAt(0));
3817
3817
  return new Blob([n], t ? { type: t } : void 0);
3818
3818
  }
3819
- function Ks(e = (...t) => fetch(...t)) {
3819
+ function Js(e = (...t) => fetch(...t)) {
3820
3820
  return async (t, n) => {
3821
- var p, u, f;
3821
+ var p, u, d;
3822
3822
  const s = new Headers();
3823
- for (const [d, l] of t.headers)
3824
- s.append(d, l);
3823
+ for (const [f, l] of t.headers)
3824
+ s.append(f, l);
3825
3825
  let r;
3826
3826
  if (typeof t.body == "string")
3827
3827
  r = t.body;
3828
3828
  else if (((p = t.body) == null ? void 0 : p.kind) === "multipart") {
3829
- const d = new FormData();
3829
+ const f = new FormData();
3830
3830
  for (const l of t.body.parts)
3831
3831
  if (l.type === "file") {
3832
3832
  const m = (u = t.body.files) == null ? void 0 : u[l.key];
3833
- d.append(
3833
+ f.append(
3834
3834
  l.key,
3835
- m ? At(m, l.contentType) : new Blob([]),
3835
+ m ? xt(m, l.contentType) : new Blob([]),
3836
3836
  l.fileName ?? l.key
3837
3837
  );
3838
3838
  } else
3839
- d.append(l.key, l.value);
3840
- r = d, s.delete("Content-Type");
3841
- } else ((f = t.body) == null ? void 0 : f.kind) === "binary" && t.body.data && (r = At(t.body.data, t.body.contentType));
3839
+ f.append(l.key, l.value);
3840
+ r = f, s.delete("Content-Type");
3841
+ } else ((d = t.body) == null ? void 0 : d.kind) === "binary" && t.body.data && (r = xt(t.body.data, t.body.contentType));
3842
3842
  const o = new AbortController(), i = () => o.abort();
3843
3843
  n == null || n.addEventListener("abort", i);
3844
3844
  const a = t.settings.timeoutMs ? setTimeout(i, t.settings.timeoutMs) : void 0, c = Date.now();
3845
3845
  try {
3846
- const d = await e(t.url, {
3846
+ const f = await e(t.url, {
3847
3847
  method: t.method,
3848
3848
  headers: s,
3849
3849
  body: t.method === "GET" || t.method === "HEAD" ? void 0 : r,
3850
3850
  redirect: t.settings.followRedirects === !1 ? "manual" : "follow",
3851
3851
  signal: o.signal
3852
- }), l = await d.arrayBuffer(), m = d.headers.get("content-type") ?? "", k = !m || xs.test(m), y = [];
3853
- return d.headers.forEach((v, $) => y.push([$, v])), {
3854
- status: d.status,
3855
- statusText: d.statusText,
3852
+ }), l = await f.arrayBuffer(), m = f.headers.get("content-type") ?? "", k = !m || xs.test(m), y = [];
3853
+ return f.headers.forEach((v, $) => y.push([$, v])), {
3854
+ status: f.status,
3855
+ statusText: f.statusText,
3856
3856
  headers: y,
3857
3857
  body: k ? new TextDecoder().decode(l) : "",
3858
- bodyBase64: k ? void 0 : lt(l),
3858
+ bodyBase64: k ? void 0 : ut(l),
3859
3859
  timeMs: Date.now() - c,
3860
3860
  size: l.byteLength,
3861
- url: d.url || t.url
3861
+ url: f.url || t.url
3862
3862
  };
3863
3863
  } finally {
3864
3864
  a && clearTimeout(a), n == null || n.removeEventListener("abort", i);
3865
3865
  }
3866
3866
  };
3867
3867
  }
3868
- function xt(e) {
3869
- return lt(e).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
3868
+ function Tt(e) {
3869
+ return ut(e).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
3870
3870
  }
3871
- async function Js() {
3871
+ async function Qs() {
3872
3872
  const e = new Uint8Array(32);
3873
3873
  globalThis.crypto.getRandomValues(e);
3874
- const t = xt(e), n = xt(await Re("SHA-256", t));
3874
+ const t = Tt(e), n = Tt(await Re("SHA-256", t));
3875
3875
  return { verifier: t, challenge: n };
3876
3876
  }
3877
- function Qs(e, t = {}) {
3877
+ function Gs(e, t = {}) {
3878
3878
  const n = new URLSearchParams();
3879
3879
  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"));
3880
3880
  const s = e.authUrl ?? "";
@@ -3918,7 +3918,7 @@ async function Oe(e, t, n) {
3918
3918
  idToken: typeof i.id_token == "string" ? i.id_token : void 0
3919
3919
  };
3920
3920
  }
3921
- async function Gs(e, t) {
3921
+ async function Ys(e, t) {
3922
3922
  if (e.grant === "clientCredentials")
3923
3923
  return Oe(e, { grant_type: "client_credentials" }, t);
3924
3924
  if (e.grant === "password")
@@ -3931,14 +3931,14 @@ async function Gs(e, t) {
3931
3931
  `OAuth 2: the ${e.grant} grant needs the user — use buildAuthorizationUrl / startDeviceAuthorization`
3932
3932
  );
3933
3933
  }
3934
- async function Ys(e, t, n, s) {
3934
+ async function Xs(e, t, n, s) {
3935
3935
  const r = { grant_type: "authorization_code", code: t };
3936
3936
  return e.redirectUri && (r.redirect_uri = e.redirectUri), s && (r.code_verifier = s), Oe(e, r, n);
3937
3937
  }
3938
- async function Xs(e, t, n) {
3938
+ async function Zs(e, t, n) {
3939
3939
  return Oe(e, { grant_type: "refresh_token", refresh_token: t }, n);
3940
3940
  }
3941
- async function Zs(e, t) {
3941
+ async function er(e, t) {
3942
3942
  if (!e.deviceUrl)
3943
3943
  throw new Error("OAuth 2: no device authorization URL");
3944
3944
  const n = new URLSearchParams({ client_id: e.clientId });
@@ -3963,7 +3963,7 @@ async function Zs(e, t) {
3963
3963
  expiresIn: r.expires_in === void 0 ? void 0 : Number(r.expires_in)
3964
3964
  };
3965
3965
  }
3966
- async function er(e, t, n) {
3966
+ async function tr(e, t, n) {
3967
3967
  try {
3968
3968
  return await Oe(
3969
3969
  e,
@@ -4033,14 +4033,14 @@ function Ss(e, t) {
4033
4033
  return "";
4034
4034
  }
4035
4035
  }
4036
- function Tt(e, t) {
4036
+ function St(e, t) {
4037
4037
  const n = e.includes("```") ? "````" : "```";
4038
4038
  return `${n}${t}
4039
4039
  ${e}
4040
4040
  ${n}`;
4041
4041
  }
4042
4042
  function js(e, t, n, s, r, o) {
4043
- var d;
4043
+ var f;
4044
4044
  const i = "#".repeat(o), a = [], c = e.url.replace(/^\{\{[^}]+\}\}/, "") || "/";
4045
4045
  a.push(
4046
4046
  `${i} \`${e.method}\` ${c}${e.name && e.name !== `${e.method} ${c}` ? ` — ${e.name}` : ""}`,
@@ -4074,15 +4074,15 @@ function js(e, t, n, s, r, o) {
4074
4074
  );
4075
4075
  else {
4076
4076
  const l = u.kind === "json" || u.kind === "graphql" ? "json" : u.kind === "text" ? "" : "xml";
4077
- a.push(Tt(oe(u) ?? "", l), "");
4077
+ a.push(St(oe(u) ?? "", l), "");
4078
4078
  }
4079
- const f = Object.entries(e.responses ?? {});
4080
- if (f.length && a.push(
4079
+ const d = Object.entries(e.responses ?? {});
4080
+ if (d.length && a.push(
4081
4081
  `${i}# ${s.responses}`,
4082
4082
  "",
4083
4083
  `| ${s.status} | ${s.description} | ${s.type} |`,
4084
4084
  "|---|---|---|",
4085
- ...f.map(
4085
+ ...d.map(
4086
4086
  ([l, m]) => `| ${l} | ${Ae(m.description)} | ${Ae(m.schema ? it(m.schema) : m.contentType)} |`
4087
4087
  ),
4088
4088
  ""
@@ -4091,12 +4091,12 @@ function js(e, t, n, s, r, o) {
4091
4091
  (v) => v.kind === "folder"
4092
4092
  ), m = r.codeLanguage ?? "curl", k = Cn(e, m, {
4093
4093
  auth: on(e, l, t)
4094
- }), y = ((d = An.find((v) => v.id === m)) == null ? void 0 : d.syntax) ?? "shell";
4095
- a.push(`${i}# ${s.example}`, "", Tt(k, y), "");
4094
+ }), y = ((f = An.find((v) => v.id === m)) == null ? void 0 : f.syntax) ?? "shell";
4095
+ a.push(`${i}# ${s.example}`, "", St(k, y), "");
4096
4096
  }
4097
4097
  return a;
4098
4098
  }
4099
- function tr(e, t = {}) {
4099
+ function nr(e, t = {}) {
4100
4100
  var o;
4101
4101
  const n = { ...Ts, ...t.labels }, s = [`# ${e.name}`, ""];
4102
4102
  e.description && s.push(e.description, ""), e.version && s.push(`**${n.version}:** ${e.version}`, ""), (o = e.servers) != null && o.length && s.push(
@@ -4148,13 +4148,13 @@ function Os(e, t = {}) {
4148
4148
  if (r.__schema || o != null && o.__schema)
4149
4149
  return "graphql";
4150
4150
  }
4151
- function nr(e, t = {}) {
4151
+ function sr(e, t = {}) {
4152
4152
  const n = Os(e, t), s = () => Yt(e.trim(), t.parseYaml);
4153
4153
  switch (n) {
4154
4154
  case "curl":
4155
4155
  return { kind: n, request: $n(e) };
4156
4156
  case "openapi":
4157
- return { kind: n, collection: Wn(s(), t) };
4157
+ return { kind: n, collection: Bn(s(), t) };
4158
4158
  case "postman":
4159
4159
  return { kind: n, collection: Xn(s()) };
4160
4160
  case "postman-environment":
@@ -4171,7 +4171,7 @@ function nr(e, t = {}) {
4171
4171
  );
4172
4172
  }
4173
4173
  }
4174
- const sr = [
4174
+ const rr = [
4175
4175
  "rest",
4176
4176
  "graphql",
4177
4177
  "soap",
@@ -4183,14 +4183,14 @@ const sr = [
4183
4183
  "database",
4184
4184
  "sftp"
4185
4185
  ];
4186
- function rr(e = {}) {
4186
+ function ir(e = {}) {
4187
4187
  return {
4188
4188
  ...e,
4189
4189
  key: e.key ?? Ne("i"),
4190
4190
  name: e.name ?? "New integration",
4191
4191
  direction: e.direction ?? "outbound",
4192
4192
  connection: e.connection ?? { protocol: "rest", baseUrl: "" },
4193
- endpoints: e.endpoints ?? ge({ name: e.name ?? "API" })
4193
+ endpoints: e.endpoints ?? be({ name: e.name ?? "API" })
4194
4194
  };
4195
4195
  }
4196
4196
  function Xt(e, t) {
@@ -4207,7 +4207,7 @@ function Xt(e, t) {
4207
4207
  i.secret && o[i.key] === void 0 && (o[i.key] = `{{secret:${i.key}}}`);
4208
4208
  return o;
4209
4209
  }
4210
- function ir(e, t, n) {
4210
+ function or(e, t, n) {
4211
4211
  const s = /* @__PURE__ */ new Set();
4212
4212
  let r = e.sets.find((a) => a.id === t), o = !0;
4213
4213
  for (; r && !s.has(r.id); ) {
@@ -4218,7 +4218,7 @@ function ir(e, t, n) {
4218
4218
  const i = e.variables.find((a) => a.key === n);
4219
4219
  return (i == null ? void 0 : i.defaultValue) !== void 0 ? { value: i.defaultValue, from: "default" } : { from: "none" };
4220
4220
  }
4221
- function or(e) {
4221
+ function ar(e) {
4222
4222
  return e.sets.map((t) => ({
4223
4223
  id: t.id,
4224
4224
  name: t.name,
@@ -4232,7 +4232,7 @@ function or(e) {
4232
4232
  })
4233
4233
  }));
4234
4234
  }
4235
- function ar(e, t) {
4235
+ function cr(e, t) {
4236
4236
  return (t ? e.sets.find((n) => {
4237
4237
  var s;
4238
4238
  return ((s = n.appliesTo) == null ? void 0 : s.database) === t;
@@ -4252,7 +4252,7 @@ function ot(e, t = []) {
4252
4252
  ot(n, t);
4253
4253
  return t;
4254
4254
  }
4255
- function cr(e, t = { variables: [], sets: [] }, n = {}) {
4255
+ function pr(e, t = { variables: [], sets: [] }, n = {}) {
4256
4256
  var a, c;
4257
4257
  const s = [], r = new Set(t.variables.map((p) => p.key)), o = /* @__PURE__ */ new Set();
4258
4258
  for (const p of e.integrations) {
@@ -4268,21 +4268,21 @@ function cr(e, t = { variables: [], sets: [] }, n = {}) {
4268
4268
  code: "baseUrlMissing",
4269
4269
  message: `${u}: no base URL`
4270
4270
  });
4271
- const f = new Set(
4272
- ot([p.connection, p.endpoints]).flatMap(Nt).filter((m) => !m.startsWith("$") && !m.startsWith("secret:"))
4271
+ const d = new Set(
4272
+ ot([p.connection, p.endpoints]).flatMap(Ct).filter((m) => !m.startsWith("$") && !m.startsWith("secret:"))
4273
4273
  );
4274
- for (const m of f)
4274
+ for (const m of d)
4275
4275
  !r.has(m) && !p.endpoints.variables.some((k) => k.key === m) && s.push({
4276
4276
  severity: "warning",
4277
4277
  integration: u,
4278
4278
  code: "variableUndeclared",
4279
4279
  message: `${u}: {{${m}}} is not declared in the environment variables`
4280
4280
  });
4281
- const d = new Set(
4282
- be(p.endpoints.items).map(({ request: m }) => m.id)
4281
+ const f = new Set(
4282
+ le(p.endpoints.items).map(({ request: m }) => m.id)
4283
4283
  ), l = new Set((p.expose ?? []).map((m) => m.key));
4284
4284
  for (const m of p.operations ?? [])
4285
- m.endpoint && !d.has(m.endpoint) && !l.has(m.endpoint) && s.push({
4285
+ m.endpoint && !f.has(m.endpoint) && !l.has(m.endpoint) && s.push({
4286
4286
  severity: "error",
4287
4287
  integration: u,
4288
4288
  code: "endpointMissing",
@@ -4310,25 +4310,78 @@ function cr(e, t = { variables: [], sets: [] }, n = {}) {
4310
4310
  code: "extendsMissing",
4311
4311
  message: `${p.id} extends ${p.extends}, which does not exist`
4312
4312
  });
4313
- for (const f of t.variables) {
4314
- const d = p.values[f.key];
4315
- f.secret && d !== void 0 && d !== "" && !/^\{\{\s*secret:/.test(d) && s.push({
4313
+ for (const d of t.variables) {
4314
+ const f = p.values[d.key];
4315
+ d.secret && f !== void 0 && f !== "" && !/^\{\{\s*secret:/.test(f) && s.push({
4316
4316
  severity: "error",
4317
4317
  code: "secretInSeed",
4318
- message: `${p.id}: ${f.key} is a secret — write {{secret:${f.key}}}, not the value`
4318
+ message: `${p.id}: ${d.key} is a secret — write {{secret:${d.key}}}, not the value`
4319
4319
  });
4320
4320
  }
4321
4321
  const u = Xt(t, p.id);
4322
- for (const f of t.variables)
4323
- f.required && !u[f.key] && s.push({
4322
+ for (const d of t.variables)
4323
+ d.required && !u[d.key] && s.push({
4324
4324
  severity: "warning",
4325
4325
  code: "requiredUnset",
4326
- message: `${p.id}: ${f.key} has no value`
4326
+ message: `${p.id}: ${d.key} has no value`
4327
4327
  });
4328
4328
  }
4329
4329
  return s;
4330
4330
  }
4331
- function pr(e) {
4331
+ function lr(e, t) {
4332
+ var p, u, d;
4333
+ if (!e || !t)
4334
+ return [];
4335
+ const n = (p = le(e.items).find(
4336
+ (f) => f.request.id === t
4337
+ )) == null ? void 0 : p.request, s = ((u = n == null ? void 0 : n.responses) == null ? void 0 : u["200"]) ?? ((d = n == null ? void 0 : n.responses) == null ? void 0 : d["201"]), r = pt(e.schemas), o = (f, l = 0) => {
4338
+ if (!f || l > 8)
4339
+ return {};
4340
+ if (f.$ref)
4341
+ return o(r(f.$ref), l + 1);
4342
+ const m = { ...f.properties ?? {} };
4343
+ for (const k of f.allOf ?? [])
4344
+ Object.assign(m, o(k, l + 1));
4345
+ return m;
4346
+ }, i = (f) => f != null && f.$ref ? r(f.$ref) : f, a = [], c = i(s == null ? void 0 : s.schema);
4347
+ if (!c)
4348
+ return a;
4349
+ if (c.type === "array" || c.items) {
4350
+ for (const f of Object.keys(o(c.items)))
4351
+ a.push(`$[*].${f}`);
4352
+ return a;
4353
+ }
4354
+ for (const [f, l] of Object.entries(o(c))) {
4355
+ const m = i(l);
4356
+ if (m && (m.type === "array" || m.items)) {
4357
+ const k = Object.keys(o(m.items));
4358
+ if (k.length) {
4359
+ k.forEach((y) => a.push(`$.${f}[*].${y}`));
4360
+ continue;
4361
+ }
4362
+ }
4363
+ a.push(`$.${f}`);
4364
+ }
4365
+ return a;
4366
+ }
4367
+ function Ns(e) {
4368
+ return e.split(/[^A-Za-z0-9]+/).filter(Boolean).map((n, s) => (s === 0 ? n.charAt(0).toLowerCase() : n.charAt(0).toUpperCase()) + n.slice(1)).join("") || "call";
4369
+ }
4370
+ function ur(e) {
4371
+ var n;
4372
+ const t = [];
4373
+ for (const s of e.integrations)
4374
+ for (const { request: r } of le(((n = s.endpoints) == null ? void 0 : n.items) ?? []))
4375
+ t.push({
4376
+ path: `integrations/${s.key}/${r.operationId || Ns(r.name)}`,
4377
+ name: r.name,
4378
+ kind: "endpoint",
4379
+ group: s.name,
4380
+ description: `${r.method.toUpperCase()} ${r.url}`
4381
+ });
4382
+ return t;
4383
+ }
4384
+ function fr(e) {
4332
4385
  const t = /* @__PURE__ */ new Map();
4333
4386
  for (const s of e) {
4334
4387
  const r = s.package ?? "";
@@ -4342,8 +4395,8 @@ function pr(e) {
4342
4395
  directions: n.filter((o) => r.has(o)).map((o) => ({ direction: o, integrations: r.get(o) }))
4343
4396
  }));
4344
4397
  }
4345
- function lr(e) {
4346
- const t = be(e.endpoints.items).map(
4398
+ function dr(e) {
4399
+ const t = le(e.endpoints.items).map(
4347
4400
  ({ request: s }) => ({
4348
4401
  id: s.id,
4349
4402
  label: `${s.method} ${s.name}`,
@@ -4357,108 +4410,110 @@ function lr(e) {
4357
4410
  return [...t, ...n];
4358
4411
  }
4359
4412
  export {
4360
- Fs as GRAPHQL_INTROSPECTION_QUERY,
4361
- Us as NICE_API_AUTH_TYPES,
4413
+ Vs as GRAPHQL_INTROSPECTION_QUERY,
4414
+ Es as NICE_API_AUTH_TYPES,
4362
4415
  An as NICE_API_CODE_LANGUAGES,
4363
4416
  Ts as NICE_API_MARKDOWN_LABELS,
4364
- Cs as NICE_API_METHODS,
4365
- sr as NICE_CONNECTION_PROTOCOLS,
4417
+ Us as NICE_API_METHODS,
4418
+ rr as NICE_CONNECTION_PROTOCOLS,
4366
4419
  Z as NiceYamlError,
4367
4420
  Jn as POSTMAN_SCHEMA_V21,
4368
- Ds as apiSecuritySchemes,
4369
- Ls as assignedVariableSets,
4421
+ Hs as apiSecuritySchemes,
4422
+ Ps as assignedVariableSets,
4370
4423
  Ce as bodyContentType,
4371
- St as bodyFromText,
4424
+ jt as bodyFromText,
4372
4425
  oe as bodyText,
4373
- Qs as buildAuthorizationUrl,
4426
+ Gs as buildAuthorizationUrl,
4374
4427
  ps as buildGraphqlOperation,
4375
4428
  Ue as buildRequestUrl,
4376
4429
  ys as buildSoapEnvelope,
4377
- tr as collectionToMarkdown,
4378
- Js as createPkcePair,
4430
+ nr as collectionToMarkdown,
4431
+ Qs as createPkcePair,
4379
4432
  Os as detectApiDocument,
4380
4433
  Re as digest,
4381
4434
  ws as digestAuthorization,
4382
4435
  on as effectiveAuth,
4383
- ar as environmentSetFor,
4384
- Ys as exchangeAuthorizationCode,
4385
- Bs as exportHar,
4436
+ cr as environmentSetFor,
4437
+ Xs as exchangeAuthorizationCode,
4438
+ Fs as exportHar,
4386
4439
  Kn as exportOpenApi,
4387
- Hs as exportOpenApiYaml,
4388
- zs as exportPostman,
4440
+ zs as exportOpenApiYaml,
4441
+ Bs as exportPostman,
4389
4442
  Ws as exportPostmanEnvironment,
4390
- Gs as fetchOAuth2Token,
4391
- Ks as fetchTransport,
4443
+ Ys as fetchOAuth2Token,
4444
+ Js as fetchTransport,
4392
4445
  nn as findApiItem,
4393
- Nt as findVariables,
4394
- be as flattenApiRequests,
4395
- Ut as fromBase64,
4446
+ Ct as findVariables,
4447
+ le as flattenApiRequests,
4448
+ Et as fromBase64,
4396
4449
  Cn as generateCode,
4397
4450
  qe as graphqlExampleValue,
4398
4451
  os as graphqlOperations,
4399
4452
  et as graphqlTypeName,
4400
- pr as groupIntegrations,
4401
- qs as headerValue,
4402
- me as hmac,
4403
- nr as importApiDocument,
4453
+ fr as groupIntegrations,
4454
+ Is as headerValue,
4455
+ he as hmac,
4456
+ sr as importApiDocument,
4404
4457
  ls as importGraphqlIntrospection,
4405
4458
  rs as importHar,
4406
- Wn as importOpenApi,
4459
+ Bn as importOpenApi,
4407
4460
  Xn as importPostman,
4408
4461
  Zn as importPostmanEnvironment,
4409
4462
  gs as importWsdl,
4410
4463
  Ye as inferSchema,
4411
- lr as integrationEndpoints,
4412
- Ct as interpolate,
4464
+ dr as integrationEndpoints,
4465
+ ur as integrationFunctions,
4466
+ Ut as interpolate,
4413
4467
  dn as isCurlCommand,
4414
4468
  L as isEnabled,
4415
4469
  Vt as isHar,
4416
4470
  Ht as isPostmanCollection,
4417
- Rs as joinUrl,
4418
- kt as jsonPointer,
4471
+ Ms as joinUrl,
4472
+ $t as jsonPointer,
4419
4473
  Gt as md5Hex,
4420
4474
  Rt as mockFromSchema,
4421
- Ms as mockResponse,
4475
+ Ds as mockResponse,
4422
4476
  Kt as namedType,
4423
- ge as newApiCollection,
4477
+ be as newApiCollection,
4424
4478
  Te as newApiFolder,
4425
4479
  Ne as newApiId,
4426
- ye as newApiRequest,
4427
- rr as newIntegration,
4480
+ ge as newApiRequest,
4481
+ ir as newIntegration,
4428
4482
  rn as paramsIn,
4429
4483
  $n as parseCurl,
4430
4484
  $s as parseDigestChallenge,
4431
- jt as parseFormEncoded,
4485
+ Ot as parseFormEncoded,
4432
4486
  is as parseGraphqlIntrospection,
4433
4487
  Ge as parseJsonOrYaml,
4434
4488
  ms as parseWsdl,
4435
4489
  In as parseYaml,
4436
4490
  pn as pathParamNames,
4437
- er as pollDeviceToken,
4438
- Xs as refreshOAuth2Token,
4439
- Es as renameApiSchema,
4440
- Et as requestName,
4491
+ tr as pollDeviceToken,
4492
+ Zs as refreshOAuth2Token,
4493
+ _s as renameApiSchema,
4494
+ _t as requestName,
4441
4495
  Xt as resolveEnvironmentSet,
4442
4496
  ct as resolvePlainScalar,
4443
- vt as resolveRequest,
4444
- _s as rowsToRecord,
4445
- Pt as schemaResolver,
4446
- Vs as sendApiRequest,
4497
+ At as resolveRequest,
4498
+ lr as responseFieldPaths,
4499
+ qs as rowsToRecord,
4500
+ pt as schemaResolver,
4501
+ Ks as sendApiRequest,
4447
4502
  un as setRequestUrl,
4448
4503
  vs as signAwsV4,
4449
4504
  As as signHmac,
4450
4505
  pe as splitUrl,
4451
- Zs as startDeviceAuthorization,
4506
+ er as startDeviceAuthorization,
4452
4507
  Mn as stringifyYaml,
4453
- Bn as swagger2ToOpenApi3,
4508
+ Wn as swagger2ToOpenApi3,
4454
4509
  ln as syncPathParams,
4455
- or as toApiEnvironments,
4510
+ ar as toApiEnvironments,
4456
4511
  at as toBase64,
4457
4512
  De as toCurl,
4458
4513
  hn as tokenizeCommand,
4459
- Is as unresolvedVariables,
4514
+ Ls as unresolvedVariables,
4460
4515
  sn as updateApiItem,
4461
- cr as validateIntegrations,
4462
- ir as valueOrigin,
4463
- Ps as variableScope
4516
+ pr as validateIntegrations,
4517
+ or as valueOrigin,
4518
+ Rs as variableScope
4464
4519
  };