@nice2dev/ui-api 1.4.31 → 1.4.32
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/CHANGELOG.md +23 -0
- package/dist/NiceIntegrationsEditor.d.ts +18 -1
- package/dist/core/integration.d.ts +11 -0
- package/dist/core.cjs +33 -33
- package/dist/core.mjs +332 -295
- package/dist/index.cjs +5 -5
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +2395 -2028
- package/dist/ui-api.css +1 -1
- package/package.json +3 -3
package/dist/core.mjs
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
60
|
+
function me(e, t = []) {
|
|
61
61
|
const n = [];
|
|
62
62
|
for (const s of e)
|
|
63
|
-
s.kind === "folder" ? n.push(...
|
|
63
|
+
s.kind === "folder" ? n.push(...me(s.items, [...t, s])) : n.push({ request: s, folders: [...t] });
|
|
64
64
|
return n;
|
|
65
65
|
}
|
|
66
|
-
const
|
|
66
|
+
const mt = "#/components/schemas/";
|
|
67
67
|
function Es(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 =
|
|
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)
|
|
@@ -168,11 +168,11 @@ function oe(e) {
|
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function jt(e, t) {
|
|
172
172
|
const n = (t ?? "").toLowerCase();
|
|
173
|
-
return n.includes("x-www-form-urlencoded") ? { kind: "form", fields:
|
|
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
|
|
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
|
|
202
|
-
function
|
|
201
|
+
const Nt = /\{\{\s*([^{}]+?)\s*\}\}/g;
|
|
202
|
+
function Ct(e) {
|
|
203
203
|
const t = /* @__PURE__ */ new Set();
|
|
204
|
-
for (const n of e.matchAll(
|
|
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
|
|
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,7 +230,7 @@ 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(
|
|
233
|
+
const p = a.replace(Nt, (u, d) => i(d) ?? u);
|
|
234
234
|
if (p === a)
|
|
235
235
|
break;
|
|
236
236
|
a = p;
|
|
@@ -238,7 +238,7 @@ function Ct(e, t, n = {}) {
|
|
|
238
238
|
return a;
|
|
239
239
|
}
|
|
240
240
|
function Is(e, t, n = {}) {
|
|
241
|
-
return
|
|
241
|
+
return Ct(Ut(e, t, n));
|
|
242
242
|
}
|
|
243
243
|
function Ls(e, t) {
|
|
244
244
|
const n = [];
|
|
@@ -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:
|
|
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
|
|
304
|
+
function ht(e) {
|
|
305
305
|
return encodeURIComponent(e).replace(
|
|
306
306
|
/[!'()*]/g,
|
|
307
307
|
(t) => `%${t.charCodeAt(0).toString(16).toUpperCase()}`
|
|
@@ -314,12 +314,12 @@ 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,
|
|
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 =
|
|
322
|
-
return p === "" && !("in" in a) ? c : `${c}=${
|
|
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);
|
|
@@ -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],
|
|
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
|
|
388
|
-
r += String.fromCharCode(parseInt(
|
|
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 +=
|
|
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
|
-
]),
|
|
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
|
|
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,
|
|
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(...
|
|
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
|
-
|
|
624
|
+
f = x;
|
|
625
625
|
break;
|
|
626
626
|
case "aws-sigv4":
|
|
627
627
|
l = x;
|
|
628
628
|
break;
|
|
629
629
|
case "digest":
|
|
630
|
-
|
|
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
|
-
$(
|
|
662
|
+
$(yt[M] ?? M, g);
|
|
663
663
|
break;
|
|
664
664
|
}
|
|
665
|
-
$(
|
|
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 =
|
|
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 =
|
|
696
|
+
T = d ? { type: "digest", username: x, password: _ } : { type: "basic", username: x, password: _ };
|
|
697
697
|
}
|
|
698
|
-
|
|
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(...
|
|
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 =
|
|
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 =
|
|
718
|
-
name:
|
|
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
|
|
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
|
|
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
|
|
791
|
-
for (const w of
|
|
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
|
|
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 &&
|
|
818
|
+
!l && f && c.push(["-H", `Content-Type: ${f}`]), c.push(["--data-binary", `@${k.fileName ?? "file"}`]);
|
|
819
819
|
break;
|
|
820
820
|
default: {
|
|
821
|
-
!l &&
|
|
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
|
|
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 = ((
|
|
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
|
|
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:
|
|
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
|
|
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
|
|
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 =
|
|
946
|
-
s = a ? `JSON.stringify(${
|
|
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 =
|
|
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=${
|
|
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
|
|
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:
|
|
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
|
|
1405
|
+
const f = this.lines[this.i], l = f.raw.trim() === "";
|
|
1406
1406
|
if (!l) {
|
|
1407
1407
|
if (p < 0) {
|
|
1408
|
-
if (
|
|
1408
|
+
if (f.indent <= n)
|
|
1409
1409
|
break;
|
|
1410
|
-
p =
|
|
1410
|
+
p = f.indent;
|
|
1411
1411
|
}
|
|
1412
|
-
if (
|
|
1412
|
+
if (f.indent < p)
|
|
1413
1413
|
break;
|
|
1414
1414
|
}
|
|
1415
|
-
c.push(l ? "" : " ".repeat(
|
|
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
|
|
1421
|
-
return o ? (
|
|
1420
|
+
let d;
|
|
1421
|
+
return o ? (d = "", c.forEach((f, l) => {
|
|
1422
1422
|
if (l === 0) {
|
|
1423
|
-
|
|
1423
|
+
d = f;
|
|
1424
1424
|
return;
|
|
1425
1425
|
}
|
|
1426
|
-
const m = c[l - 1], k =
|
|
1427
|
-
|
|
1428
|
-
` : m === "" || k ?
|
|
1429
|
-
`) +
|
|
1430
|
-
})) :
|
|
1431
|
-
`), c.length ? i === "-" ?
|
|
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)}` : `${
|
|
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 =
|
|
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
|
|
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
|
|
1623
|
-
return e === "" || e !== e.trim() || Ln.test(e) || /: |:$| #|[\t\n\r]/.test(e) ||
|
|
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
|
|
1633
|
+
return Pt(t) ? JSON.stringify(t) : t;
|
|
1634
1634
|
}
|
|
1635
1635
|
function Rn(e) {
|
|
1636
|
-
return
|
|
1636
|
+
return Pt(e) ? JSON.stringify(e) : e;
|
|
1637
1637
|
}
|
|
1638
|
-
function
|
|
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 (
|
|
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
|
-
|
|
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
|
-
`) && !
|
|
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
|
|
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,
|
|
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 ((
|
|
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 ((
|
|
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 = {};
|
|
@@ -1844,8 +1844,8 @@ function Ms(e, t) {
|
|
|
1844
1844
|
const n = (p = e.examples) == null ? void 0 : p[0];
|
|
1845
1845
|
if (n) {
|
|
1846
1846
|
const u = {};
|
|
1847
|
-
for (const
|
|
1848
|
-
u[
|
|
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:
|
|
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
|
|
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;
|
|
@@ -1910,7 +1910,7 @@ function Wn(e, t = {}) {
|
|
|
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
|
|
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
|
|
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
|
|
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);
|
|
@@ -2038,11 +2038,11 @@ function Wn(e, t = {}) {
|
|
|
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 ?
|
|
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 ? 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: ue(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 ??
|
|
2045
|
-
const D = I != null && I.$ref ?
|
|
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") {
|
|
@@ -2082,7 +2082,7 @@ function Wn(e, t = {}) {
|
|
|
2082
2082
|
A.contentType = C;
|
|
2083
2083
|
const I = c(q.schema);
|
|
2084
2084
|
I && (A.schema = I);
|
|
2085
|
-
const D = q.example ??
|
|
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,8 +2104,8 @@ function Wn(e, t = {}) {
|
|
|
2104
2104
|
const ce = $(G);
|
|
2105
2105
|
if (!ce)
|
|
2106
2106
|
continue;
|
|
2107
|
-
const
|
|
2108
|
-
|
|
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
2111
|
const B = a(q.requestBody);
|
|
@@ -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 =
|
|
2124
|
+
const le = 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}`,
|
|
@@ -2162,7 +2162,7 @@ function Wn(e, t = {}) {
|
|
|
2162
2162
|
N(U) && (g = g.split(`{${A}}`).join(ue(U.default)));
|
|
2163
2163
|
return { url: g, description: z(h.description) };
|
|
2164
2164
|
}), j = N(s.info) ? s.info : {};
|
|
2165
|
-
return
|
|
2165
|
+
return be({
|
|
2166
2166
|
name: z(j.title) ?? "API",
|
|
2167
2167
|
description: z(j.description),
|
|
2168
2168
|
version: j.version === void 0 ? void 0 : ue(j.version),
|
|
@@ -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
|
|
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" ?
|
|
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" && (
|
|
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
|
|
2317
|
+
const f = {};
|
|
2318
2318
|
if (N(n.responses))
|
|
2319
2319
|
for (const [y, v] of Object.entries(n.responses))
|
|
2320
|
-
|
|
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,8 +2328,8 @@ function Bn(e) {
|
|
|
2328
2328
|
paths: u,
|
|
2329
2329
|
components: {
|
|
2330
2330
|
schemas: n.definitions,
|
|
2331
|
-
responses:
|
|
2332
|
-
securitySchemes:
|
|
2331
|
+
responses: f,
|
|
2332
|
+
securitySchemes: d
|
|
2333
2333
|
}
|
|
2334
2334
|
};
|
|
2335
2335
|
}
|
|
@@ -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
|
|
2353
|
+
for (const { request: s, folders: r } of me(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
|
|
2526
|
+
for (const { request: b, folders: S } of me(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
|
|
2564
|
+
const d = {
|
|
2565
2565
|
openapi: "3.1.0",
|
|
2566
2566
|
info: {
|
|
2567
2567
|
title: e.name,
|
|
@@ -2569,11 +2569,11 @@ function Kn(e, t = {}) {
|
|
|
2569
2569
|
...e.description ? { description: e.description } : {}
|
|
2570
2570
|
}
|
|
2571
2571
|
};
|
|
2572
|
-
r && (
|
|
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 && (
|
|
2575
|
-
const
|
|
2576
|
-
return e.schemas && Object.keys(e.schemas).length && (
|
|
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
2578
|
function Hs(e, t = {}) {
|
|
2579
2579
|
return Mn(Kn(e, t));
|
|
@@ -2582,7 +2582,7 @@ const W = (e) => !!e && typeof e == "object" && !Array.isArray(e), E = (e) => ty
|
|
|
2582
2582
|
function Ht(e) {
|
|
2583
2583
|
return W(e) && W(e.info) && Array.isArray(e.item);
|
|
2584
2584
|
}
|
|
2585
|
-
function
|
|
2585
|
+
function ye(e) {
|
|
2586
2586
|
if (typeof e == "string")
|
|
2587
2587
|
return e || void 0;
|
|
2588
2588
|
if (W(e))
|
|
@@ -2592,11 +2592,11 @@ 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 =
|
|
2595
|
+
const s = ye(t.description);
|
|
2596
2596
|
return s && (n.description = s), n;
|
|
2597
2597
|
});
|
|
2598
2598
|
}
|
|
2599
|
-
function
|
|
2599
|
+
function lt(e) {
|
|
2600
2600
|
if (!W(e) || typeof e.type != "string")
|
|
2601
2601
|
return;
|
|
2602
2602
|
const t = e[e.type], n = (s) => {
|
|
@@ -2737,15 +2737,15 @@ function Yn(e) {
|
|
|
2737
2737
|
headers: Se(i.header),
|
|
2738
2738
|
body: E(i.body)
|
|
2739
2739
|
}));
|
|
2740
|
-
return
|
|
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:
|
|
2748
|
-
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
|
});
|
|
@@ -2755,9 +2755,9 @@ function Wt(e) {
|
|
|
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:
|
|
2758
|
+
description: ye(t.description),
|
|
2759
2759
|
items: Wt(t.item),
|
|
2760
|
-
auth:
|
|
2760
|
+
auth: lt(t.auth)
|
|
2761
2761
|
}) : Yn(t)
|
|
2762
2762
|
);
|
|
2763
2763
|
}
|
|
@@ -2765,7 +2765,7 @@ function Bt(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 =
|
|
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 =
|
|
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:
|
|
2779
|
+
description: ye(s.description),
|
|
2780
2780
|
version: W(s.version) ? E(s.version.raw) : E(s.version),
|
|
2781
2781
|
items: Wt(n.item),
|
|
2782
2782
|
variables: Bt(n.variable),
|
|
2783
|
-
auth:
|
|
2783
|
+
auth: lt(n.auth)
|
|
2784
2784
|
});
|
|
2785
2785
|
if (r) {
|
|
2786
2786
|
const i = (a) => a.map(
|
|
@@ -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((
|
|
2878
|
+
const t = e.params.filter((d) => d.in === "query"), n = Ue({
|
|
2879
2879
|
...e,
|
|
2880
|
-
params: e.params.filter((
|
|
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((
|
|
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((
|
|
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) {
|
|
@@ -3009,7 +3009,7 @@ function rs(e, t = {}) {
|
|
|
3009
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();
|
|
3010
3010
|
if (r && ss.test(u))
|
|
3011
3011
|
continue;
|
|
3012
|
-
const { base:
|
|
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" })),
|
|
@@ -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 =
|
|
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 =
|
|
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,23 +3044,23 @@ function rs(e, t = {}) {
|
|
|
3044
3044
|
});
|
|
3045
3045
|
}
|
|
3046
3046
|
o.push(
|
|
3047
|
-
|
|
3048
|
-
name:
|
|
3047
|
+
ge({
|
|
3048
|
+
name: _t(T, d),
|
|
3049
3049
|
method: T,
|
|
3050
|
-
url:
|
|
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
|
|
3057
|
+
return be({ name: t.name ?? "HAR import", items: o });
|
|
3058
3058
|
}
|
|
3059
3059
|
const Be = (e) => ({ name: e.key, value: e.value });
|
|
3060
3060
|
function Bs(e, t = {}) {
|
|
3061
|
-
const n = Array.isArray(e) ? e :
|
|
3061
|
+
const n = Array.isArray(e) ? e : me(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),
|
|
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",
|
|
@@ -3069,22 +3069,22 @@ function Bs(e, t = {}) {
|
|
|
3069
3069
|
cookies: p.map(Be),
|
|
3070
3070
|
headersSize: -1,
|
|
3071
3071
|
bodySize: -1
|
|
3072
|
-
},
|
|
3073
|
-
|
|
3072
|
+
}, f = i.body;
|
|
3073
|
+
f.kind === "form" ? d.postData = {
|
|
3074
3074
|
mimeType: u,
|
|
3075
|
-
params:
|
|
3076
|
-
text: s(oe(
|
|
3077
|
-
} :
|
|
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:
|
|
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
|
-
} :
|
|
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:
|
|
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
|
|
@@ -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, " ")}`,
|
|
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
|
-
}`,
|
|
3264
|
+
}`, f = {};
|
|
3265
3265
|
for (const l of a)
|
|
3266
|
-
l.defaultValue == null && (
|
|
3267
|
-
return { query:
|
|
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 =
|
|
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,7 +3289,7 @@ 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
|
|
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 ?? "" }]
|
|
@@ -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
|
|
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
|
|
3330
|
-
const
|
|
3331
|
-
o.qualified.set(
|
|
3332
|
-
for (const l of X(
|
|
3329
|
+
for (const d of i ? X(i, de, "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, de, "element")) {
|
|
3333
3333
|
const m = l.getAttribute("name");
|
|
3334
|
-
m && o.elements.set(ee(
|
|
3334
|
+
m && o.elements.set(ee(f, m), l);
|
|
3335
3335
|
}
|
|
3336
|
-
for (const l of [...X(
|
|
3336
|
+
for (const l of [...X(d, de, "complexType"), ...X(d, de, "simpleType")]) {
|
|
3337
3337
|
const m = l.getAttribute("name");
|
|
3338
|
-
m && o.types.set(ee(
|
|
3338
|
+
m && o.types.set(ee(f, m), l);
|
|
3339
3339
|
}
|
|
3340
3340
|
}
|
|
3341
3341
|
const a = /* @__PURE__ */ new Map();
|
|
3342
|
-
for (const
|
|
3343
|
-
const
|
|
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,
|
|
3348
|
+
a.set(ee(r, d.getAttribute("name") ?? ""), f);
|
|
3349
3349
|
}
|
|
3350
3350
|
const c = /* @__PURE__ */ new Map();
|
|
3351
|
-
for (const
|
|
3352
|
-
const
|
|
3353
|
-
for (const l of X(
|
|
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
|
-
|
|
3356
|
-
doc:
|
|
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,
|
|
3361
|
+
c.set(ee(r, d.getAttribute("name") ?? ""), f);
|
|
3362
3362
|
}
|
|
3363
3363
|
const p = /* @__PURE__ */ new Map();
|
|
3364
|
-
for (const
|
|
3365
|
-
const
|
|
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 =
|
|
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:
|
|
3389
|
+
p.set(k, { version: f ? "1.1" : "1.2", operations: b });
|
|
3390
3390
|
}
|
|
3391
|
-
const u = X(s, Q, "service").map((
|
|
3392
|
-
name:
|
|
3393
|
-
documentation:
|
|
3394
|
-
ports: X(
|
|
3395
|
-
const l = ae(
|
|
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(
|
|
3398
|
+
const k = ne(f, Fe, "address") ?? ne(f, Ve, "address");
|
|
3399
3399
|
return [
|
|
3400
3400
|
{
|
|
3401
|
-
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,7 +3416,7 @@ 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,
|
|
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
3421
|
let k = ne(c, de, "complexType");
|
|
3422
3422
|
const y = ae(c, c.getAttribute("type"));
|
|
@@ -3425,27 +3425,27 @@ function Qt(e, t, n, s, r, o, i) {
|
|
|
3425
3425
|
($ == null ? void 0 : $.localName) === "complexType" && (k = $);
|
|
3426
3426
|
}
|
|
3427
3427
|
if (!k || i > 6)
|
|
3428
|
-
return `${m}${o}<${
|
|
3428
|
+
return `${m}${o}<${f}>?</${f}>`;
|
|
3429
3429
|
const v = hs(e, k, p, s, o, i);
|
|
3430
|
-
return v ? `${m}${o}<${
|
|
3430
|
+
return v ? `${m}${o}<${f}>
|
|
3431
3431
|
${v}
|
|
3432
|
-
${o}</${
|
|
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
|
|
3440
|
-
if (
|
|
3441
|
-
if (
|
|
3442
|
-
a.push(Qt(e,
|
|
3443
|
-
else if (["sequence", "all", "choice", "complexContent", "extension"].includes(
|
|
3444
|
-
if (
|
|
3445
|
-
const
|
|
3439
|
+
const d = u;
|
|
3440
|
+
if (d.namespaceURI === de) {
|
|
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(
|
|
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) : "",
|
|
3465
|
-
o =
|
|
3466
|
-
${
|
|
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
|
-
</${
|
|
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) : "",
|
|
3475
|
-
o = ` <${
|
|
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) =>
|
|
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
|
|
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
|
|
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
|
|
3598
|
+
for (let d = 0; d < s.length; d += 64) {
|
|
3599
3599
|
for (let y = 0; y < 16; y++)
|
|
3600
|
-
p[y] = r.getUint32(
|
|
3601
|
-
let
|
|
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 =
|
|
3606
|
-
|
|
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 +
|
|
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((
|
|
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
|
|
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
|
|
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}`),
|
|
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="${
|
|
3701
|
+
`response="${d}"`
|
|
3702
3702
|
];
|
|
3703
|
-
return i &&
|
|
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("&"),
|
|
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") &&
|
|
3715
|
+
(O.startsWith("x-amz-") || O === "content-type") && d.set(O, w.trim().replace(/\s+/g, " "));
|
|
3716
3716
|
}
|
|
3717
|
-
const
|
|
3718
|
-
`).join(""), m =
|
|
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
|
|
3731
|
-
$ = await
|
|
3732
|
-
const T = xe(await
|
|
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
|
|
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
|
|
3747
|
+
async function At(e, t = {}) {
|
|
3748
3748
|
var m;
|
|
3749
|
-
const n = (k) =>
|
|
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
|
|
3781
|
-
|
|
3782
|
-
const
|
|
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,
|
|
3791
|
-
k && J(
|
|
3792
|
-
} else r.type === "awsSigV4" ? await vs(
|
|
3793
|
-
return
|
|
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
3795
|
async function Vs(e, t, n = {}, s) {
|
|
3796
|
-
let r = await
|
|
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,72 +3806,72 @@ async function Vs(e, t, n = {}, s) {
|
|
|
3806
3806
|
algorithm: a.algorithm,
|
|
3807
3807
|
opaque: a.opaque
|
|
3808
3808
|
};
|
|
3809
|
-
return r = await
|
|
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
|
|
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
3819
|
function Ks(e = (...t) => fetch(...t)) {
|
|
3820
3820
|
return async (t, n) => {
|
|
3821
|
-
var p, u,
|
|
3821
|
+
var p, u, d;
|
|
3822
3822
|
const s = new Headers();
|
|
3823
|
-
for (const [
|
|
3824
|
-
s.append(
|
|
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
|
|
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
|
-
|
|
3833
|
+
f.append(
|
|
3834
3834
|
l.key,
|
|
3835
|
-
m ?
|
|
3835
|
+
m ? xt(m, l.contentType) : new Blob([]),
|
|
3836
3836
|
l.fileName ?? l.key
|
|
3837
3837
|
);
|
|
3838
3838
|
} else
|
|
3839
|
-
|
|
3840
|
-
r =
|
|
3841
|
-
} else ((
|
|
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
|
|
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
|
|
3853
|
-
return
|
|
3854
|
-
status:
|
|
3855
|
-
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 :
|
|
3858
|
+
bodyBase64: k ? void 0 : ut(l),
|
|
3859
3859
|
timeMs: Date.now() - c,
|
|
3860
3860
|
size: l.byteLength,
|
|
3861
|
-
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
|
|
3869
|
-
return
|
|
3868
|
+
function Tt(e) {
|
|
3869
|
+
return ut(e).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
3870
3870
|
}
|
|
3871
3871
|
async function Js() {
|
|
3872
3872
|
const e = new Uint8Array(32);
|
|
3873
3873
|
globalThis.crypto.getRandomValues(e);
|
|
3874
|
-
const t =
|
|
3874
|
+
const t = Tt(e), n = Tt(await Re("SHA-256", t));
|
|
3875
3875
|
return { verifier: t, challenge: n };
|
|
3876
3876
|
}
|
|
3877
3877
|
function Qs(e, t = {}) {
|
|
@@ -4033,14 +4033,14 @@ function Ss(e, t) {
|
|
|
4033
4033
|
return "";
|
|
4034
4034
|
}
|
|
4035
4035
|
}
|
|
4036
|
-
function
|
|
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
|
|
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(
|
|
4077
|
+
a.push(St(oe(u) ?? "", l), "");
|
|
4078
4078
|
}
|
|
4079
|
-
const
|
|
4080
|
-
if (
|
|
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
|
-
...
|
|
4085
|
+
...d.map(
|
|
4086
4086
|
([l, m]) => `| ${l} | ${Ae(m.description)} | ${Ae(m.schema ? it(m.schema) : m.contentType)} |`
|
|
4087
4087
|
),
|
|
4088
4088
|
""
|
|
@@ -4091,8 +4091,8 @@ 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 = ((
|
|
4095
|
-
a.push(`${i}# ${s.example}`, "",
|
|
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
|
}
|
|
@@ -4190,7 +4190,7 @@ function rr(e = {}) {
|
|
|
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 ??
|
|
4193
|
+
endpoints: e.endpoints ?? be({ name: e.name ?? "API" })
|
|
4194
4194
|
};
|
|
4195
4195
|
}
|
|
4196
4196
|
function Xt(e, t) {
|
|
@@ -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
|
|
4272
|
-
ot([p.connection, p.endpoints]).flatMap(
|
|
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
|
|
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
|
|
4282
|
-
|
|
4281
|
+
const f = new Set(
|
|
4282
|
+
me(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 && !
|
|
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,61 @@ 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
|
|
4314
|
-
const
|
|
4315
|
-
|
|
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}: ${
|
|
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
|
|
4323
|
-
|
|
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}: ${
|
|
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 pr(e, t) {
|
|
4332
|
+
var p, u, d;
|
|
4333
|
+
if (!e || !t)
|
|
4334
|
+
return [];
|
|
4335
|
+
const n = (p = me(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 lr(e) {
|
|
4332
4368
|
const t = /* @__PURE__ */ new Map();
|
|
4333
4369
|
for (const s of e) {
|
|
4334
4370
|
const r = s.package ?? "";
|
|
@@ -4342,8 +4378,8 @@ function pr(e) {
|
|
|
4342
4378
|
directions: n.filter((o) => r.has(o)).map((o) => ({ direction: o, integrations: r.get(o) }))
|
|
4343
4379
|
}));
|
|
4344
4380
|
}
|
|
4345
|
-
function
|
|
4346
|
-
const t =
|
|
4381
|
+
function ur(e) {
|
|
4382
|
+
const t = me(e.endpoints.items).map(
|
|
4347
4383
|
({ request: s }) => ({
|
|
4348
4384
|
id: s.id,
|
|
4349
4385
|
label: `${s.method} ${s.name}`,
|
|
@@ -4368,7 +4404,7 @@ export {
|
|
|
4368
4404
|
Ds as apiSecuritySchemes,
|
|
4369
4405
|
Ls as assignedVariableSets,
|
|
4370
4406
|
Ce as bodyContentType,
|
|
4371
|
-
|
|
4407
|
+
jt as bodyFromText,
|
|
4372
4408
|
oe as bodyText,
|
|
4373
4409
|
Qs as buildAuthorizationUrl,
|
|
4374
4410
|
ps as buildGraphqlOperation,
|
|
@@ -4390,16 +4426,16 @@ export {
|
|
|
4390
4426
|
Gs as fetchOAuth2Token,
|
|
4391
4427
|
Ks as fetchTransport,
|
|
4392
4428
|
nn as findApiItem,
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4429
|
+
Ct as findVariables,
|
|
4430
|
+
me as flattenApiRequests,
|
|
4431
|
+
Et as fromBase64,
|
|
4396
4432
|
Cn as generateCode,
|
|
4397
4433
|
qe as graphqlExampleValue,
|
|
4398
4434
|
os as graphqlOperations,
|
|
4399
4435
|
et as graphqlTypeName,
|
|
4400
|
-
|
|
4436
|
+
lr as groupIntegrations,
|
|
4401
4437
|
qs as headerValue,
|
|
4402
|
-
|
|
4438
|
+
he as hmac,
|
|
4403
4439
|
nr as importApiDocument,
|
|
4404
4440
|
ls as importGraphqlIntrospection,
|
|
4405
4441
|
rs as importHar,
|
|
@@ -4408,27 +4444,27 @@ export {
|
|
|
4408
4444
|
Zn as importPostmanEnvironment,
|
|
4409
4445
|
gs as importWsdl,
|
|
4410
4446
|
Ye as inferSchema,
|
|
4411
|
-
|
|
4412
|
-
|
|
4447
|
+
ur as integrationEndpoints,
|
|
4448
|
+
Ut as interpolate,
|
|
4413
4449
|
dn as isCurlCommand,
|
|
4414
4450
|
L as isEnabled,
|
|
4415
4451
|
Vt as isHar,
|
|
4416
4452
|
Ht as isPostmanCollection,
|
|
4417
4453
|
Rs as joinUrl,
|
|
4418
|
-
|
|
4454
|
+
$t as jsonPointer,
|
|
4419
4455
|
Gt as md5Hex,
|
|
4420
4456
|
Rt as mockFromSchema,
|
|
4421
4457
|
Ms as mockResponse,
|
|
4422
4458
|
Kt as namedType,
|
|
4423
|
-
|
|
4459
|
+
be as newApiCollection,
|
|
4424
4460
|
Te as newApiFolder,
|
|
4425
4461
|
Ne as newApiId,
|
|
4426
|
-
|
|
4462
|
+
ge as newApiRequest,
|
|
4427
4463
|
rr as newIntegration,
|
|
4428
4464
|
rn as paramsIn,
|
|
4429
4465
|
$n as parseCurl,
|
|
4430
4466
|
$s as parseDigestChallenge,
|
|
4431
|
-
|
|
4467
|
+
Ot as parseFormEncoded,
|
|
4432
4468
|
is as parseGraphqlIntrospection,
|
|
4433
4469
|
Ge as parseJsonOrYaml,
|
|
4434
4470
|
ms as parseWsdl,
|
|
@@ -4437,12 +4473,13 @@ export {
|
|
|
4437
4473
|
er as pollDeviceToken,
|
|
4438
4474
|
Xs as refreshOAuth2Token,
|
|
4439
4475
|
Es as renameApiSchema,
|
|
4440
|
-
|
|
4476
|
+
_t as requestName,
|
|
4441
4477
|
Xt as resolveEnvironmentSet,
|
|
4442
4478
|
ct as resolvePlainScalar,
|
|
4443
|
-
|
|
4479
|
+
At as resolveRequest,
|
|
4480
|
+
pr as responseFieldPaths,
|
|
4444
4481
|
_s as rowsToRecord,
|
|
4445
|
-
|
|
4482
|
+
pt as schemaResolver,
|
|
4446
4483
|
Vs as sendApiRequest,
|
|
4447
4484
|
un as setRequestUrl,
|
|
4448
4485
|
vs as signAwsV4,
|