@scalar/api-client 2.23.2 → 2.23.3
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 +22 -0
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js +54 -53
- package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +78 -78
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +63 -51
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.js +2 -2
- package/dist/v2/features/operation/Operation.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-request-parameters.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/build-request-parameters.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-request-parameters.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/build-request-parameters.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,qEAAqE,CAAA;AAE5E,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAA;AAoBlH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB;AACjC,qBAAqB;AACrB,aAAY,aAAa,CAAC,eAAe,CAAC,EAAO;AACjD,8DAA8D;AAC9D,MAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM;AAChC,qCAAqC;AACrC,aAAY,MAAkB,KAC7B;IACD,OAAO,EAAE,aAAa,EAAE,CAAA;IACxB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACrC,SAAS,EAAE,eAAe,CAAA;CAiF3B,CAAA"}
|
|
@@ -1,106 +1,107 @@
|
|
|
1
|
-
import { isDefined as
|
|
1
|
+
import { isDefined as g } from "@scalar/helpers/array/is-defined";
|
|
2
|
+
import { isObject as h } from "@scalar/helpers/object/is-object";
|
|
2
3
|
import { replaceEnvVariables as u } from "@scalar/helpers/regex/replace-variables";
|
|
3
|
-
import { getResolvedRef as
|
|
4
|
-
import { xScalarCookieSchema as
|
|
5
|
-
import { coerceValue as
|
|
6
|
-
import { deSerializeParameter as
|
|
7
|
-
import { isParamDisabled as
|
|
8
|
-
import { getExample as
|
|
9
|
-
import { serializeSimpleStyle as
|
|
10
|
-
const d = (
|
|
11
|
-
const
|
|
4
|
+
import { getResolvedRef as k } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
5
|
+
import { xScalarCookieSchema as m } from "@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies";
|
|
6
|
+
import { coerceValue as S } from "@scalar/workspace-store/schemas/typebox-coerce";
|
|
7
|
+
import { deSerializeParameter as z } from "./de-serialize-parameter.js";
|
|
8
|
+
import { isParamDisabled as x } from "../../request-block/helpers/is-param-disabled.js";
|
|
9
|
+
import { getExample as v } from "./get-example.js";
|
|
10
|
+
import { serializeSimpleStyle as b, serializeFormStyleForCookies as j, serializeContentValue as C, serializeDeepObjectStyle as D, serializeSpaceDelimitedStyle as O, serializePipeDelimitedStyle as P, serializeFormStyle as $ } from "./serialize-parameter.js";
|
|
11
|
+
const d = (e, o) => "explode" in e && e.explode !== void 0 ? e.explode : o, G = (e = [], o = {}, l = "default") => {
|
|
12
|
+
const t = {
|
|
12
13
|
cookies: [],
|
|
13
14
|
headers: {},
|
|
14
15
|
pathVariables: {},
|
|
15
16
|
urlParams: new URLSearchParams()
|
|
16
17
|
};
|
|
17
|
-
if (
|
|
18
|
-
return
|
|
19
|
-
for (const c of
|
|
20
|
-
const
|
|
21
|
-
if (!n ||
|
|
18
|
+
if (e.length === 0)
|
|
19
|
+
return t;
|
|
20
|
+
for (const c of e) {
|
|
21
|
+
const r = k(c), n = v(r, l, void 0);
|
|
22
|
+
if (!n || x(r, n))
|
|
22
23
|
continue;
|
|
23
|
-
const s = typeof n.value == "string" ? u(n.value,
|
|
24
|
-
switch (
|
|
24
|
+
const s = typeof n.value == "string" ? u(n.value, o) : n.value, i = z(s, r), a = u(r.name, o);
|
|
25
|
+
switch (r.in) {
|
|
25
26
|
case "header": {
|
|
26
27
|
if (a.toLowerCase() === "content-type" && i === "multipart/form-data")
|
|
27
28
|
break;
|
|
28
|
-
const p =
|
|
29
|
-
if (!
|
|
29
|
+
const p = b(i, d(r, !1));
|
|
30
|
+
if (!g(p))
|
|
30
31
|
break;
|
|
31
32
|
const y = String(p);
|
|
32
|
-
|
|
33
|
+
t.headers[a] ? t.headers[a] = `${t.headers[a]},${y}` : t.headers[a] = y;
|
|
33
34
|
break;
|
|
34
35
|
}
|
|
35
36
|
case "path": {
|
|
36
|
-
const f =
|
|
37
|
-
|
|
37
|
+
const f = b(i, d(r, !1));
|
|
38
|
+
t.pathVariables[a] = encodeURIComponent(String(f));
|
|
38
39
|
break;
|
|
39
40
|
}
|
|
40
41
|
case "query": {
|
|
41
|
-
|
|
42
|
+
R(r, a, i, t.urlParams);
|
|
42
43
|
break;
|
|
43
44
|
}
|
|
44
45
|
case "cookie": {
|
|
45
|
-
|
|
46
|
+
V(a, i, d(r, !0), t.cookies);
|
|
46
47
|
break;
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
|
-
return
|
|
51
|
-
}, w = (
|
|
52
|
-
const c = "explode" in
|
|
53
|
-
if ("content" in
|
|
54
|
-
const s = Object.keys(
|
|
55
|
-
|
|
51
|
+
return t;
|
|
52
|
+
}, w = (e, o) => !("style" in e) || !e.style ? "form" : e.style === "deepObject" ? h(o) ? "deepObject" : "form" : e.style, R = (e, o, l, t) => {
|
|
53
|
+
const c = "explode" in e && e.explode !== void 0 ? e.explode : !0, r = w(e, l);
|
|
54
|
+
if ("content" in e && e.content) {
|
|
55
|
+
const s = Object.keys(e.content)[0] ?? "application/json", i = C(l, s);
|
|
56
|
+
t.set(o, i);
|
|
56
57
|
return;
|
|
57
58
|
}
|
|
58
|
-
if (
|
|
59
|
-
const s = D(
|
|
59
|
+
if (r === "deepObject" && c) {
|
|
60
|
+
const s = D(o, l);
|
|
60
61
|
for (const i of s)
|
|
61
|
-
|
|
62
|
+
t.append(i.key, i.value);
|
|
62
63
|
return;
|
|
63
64
|
}
|
|
64
|
-
if (
|
|
65
|
-
const s =
|
|
66
|
-
|
|
65
|
+
if (r === "spaceDelimited") {
|
|
66
|
+
const s = O(l), i = t.get(o);
|
|
67
|
+
t.set(o, i ? `${i} ${s}` : s);
|
|
67
68
|
return;
|
|
68
69
|
}
|
|
69
|
-
if (
|
|
70
|
-
const s =
|
|
71
|
-
|
|
70
|
+
if (r === "pipeDelimited") {
|
|
71
|
+
const s = P(l), i = t.get(o);
|
|
72
|
+
t.set(o, i ? `${i}|${s}` : s);
|
|
72
73
|
return;
|
|
73
74
|
}
|
|
74
75
|
const n = $(l, c);
|
|
75
76
|
if (Array.isArray(n))
|
|
76
77
|
for (const s of n) {
|
|
77
|
-
const i = s.key ||
|
|
78
|
-
|
|
78
|
+
const i = s.key || o;
|
|
79
|
+
t.append(i, String(s.value));
|
|
79
80
|
}
|
|
80
81
|
else
|
|
81
|
-
|
|
82
|
-
},
|
|
83
|
-
const c =
|
|
82
|
+
t.append(o, String(n));
|
|
83
|
+
}, V = (e, o, l, t) => {
|
|
84
|
+
const c = j(o, l);
|
|
84
85
|
if (Array.isArray(c))
|
|
85
|
-
for (const
|
|
86
|
-
const n =
|
|
87
|
-
|
|
88
|
-
m
|
|
86
|
+
for (const r of c) {
|
|
87
|
+
const n = r.key || e;
|
|
88
|
+
t.push(
|
|
89
|
+
S(m, {
|
|
89
90
|
name: n,
|
|
90
|
-
value: String(
|
|
91
|
+
value: String(r.value),
|
|
91
92
|
path: "/"
|
|
92
93
|
})
|
|
93
94
|
);
|
|
94
95
|
}
|
|
95
96
|
else
|
|
96
|
-
|
|
97
|
-
m
|
|
98
|
-
name:
|
|
97
|
+
t.push(
|
|
98
|
+
S(m, {
|
|
99
|
+
name: e,
|
|
99
100
|
value: String(c),
|
|
100
101
|
path: "/"
|
|
101
102
|
})
|
|
102
103
|
);
|
|
103
104
|
};
|
|
104
105
|
export {
|
|
105
|
-
|
|
106
|
+
G as buildRequestParameters
|
|
106
107
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-example-from-schema.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/helpers/get-example-from-schema.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;
|
|
1
|
+
{"version":3,"file":"get-example-from-schema.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/helpers/get-example-from-schema.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAochG,KAAK,2BAA2B,GAAG;IACjC,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4CAA4C;IAC5C,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IACvB,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACnC,qDAAqD;IACrD,8BAA8B,CAAC,EAAE,OAAO,CAAA;CACzC,CAAA;AAYD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,YAAY,EACpB,UAAU,2BAA2B,EACrC,uCAKG,OAAO,CAAC;IACT,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,YAAY,CAAA;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;CACtB,CAAM,KACN,OAuJF,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isDefined as v } from "@scalar/helpers/array/is-defined";
|
|
2
2
|
import { getRaw as E } from "@scalar/json-magic/magic-proxy";
|
|
3
|
-
import { getResolvedRef as m } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
4
3
|
import { unpackOverridesProxy as N } from "@scalar/workspace-store/helpers/overrides-proxy";
|
|
5
|
-
|
|
4
|
+
import { resolve as y } from "@scalar/workspace-store/resolve";
|
|
5
|
+
const M = 10, P = 10, R = "additionalProperty", j = (/* @__PURE__ */ new Date()).toISOString(), q = j.split("T")[0], k = j.split("T")[1].split(".")[0], I = {
|
|
6
6
|
"date-time": j,
|
|
7
7
|
date: q,
|
|
8
8
|
email: "hello@example.com",
|
|
@@ -42,11 +42,11 @@ const D = 10, P = 10, M = "additionalProperty", j = (/* @__PURE__ */ new Date())
|
|
|
42
42
|
return S.set(t, l), l;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
},
|
|
45
|
+
}, d = (t, i, o) => {
|
|
46
46
|
if (typeof i != "object" || i === null)
|
|
47
47
|
return i;
|
|
48
|
-
const l = E(N(t)),
|
|
49
|
-
return
|
|
48
|
+
const l = E(N(t)), f = A.get(l) ?? /* @__PURE__ */ new Map();
|
|
49
|
+
return f && f.set(o, i), A.set(l, f), i;
|
|
50
50
|
}, C = (t) => !!(t.allOf || t.oneOf || t.anyOf), F = (t, i, o, l) => {
|
|
51
51
|
if (t.deprecated || l?.mode === "write" && t.readOnly || l?.mode === "read" && t.writeOnly)
|
|
52
52
|
return !0;
|
|
@@ -54,28 +54,28 @@ const D = 10, P = 10, M = "additionalProperty", j = (/* @__PURE__ */ new Date())
|
|
|
54
54
|
return !1;
|
|
55
55
|
const r = o ?? t.title ?? "", e = _(i);
|
|
56
56
|
return !(e ? e.has(r) : !1);
|
|
57
|
-
},
|
|
57
|
+
}, T = (t, i) => Array.isArray(t) && Array.isArray(i) ? [...t, ...i] : t && typeof t == "object" && i && typeof i == "object" ? { ...t, ...i } : i, L = (t, i, o, l, f) => {
|
|
58
58
|
const r = {};
|
|
59
59
|
if ("properties" in t && t.properties) {
|
|
60
60
|
const e = Object.keys(t.properties), n = o > 3 ? Math.min(P, e.length) : e.length;
|
|
61
|
-
for (let
|
|
62
|
-
const
|
|
61
|
+
for (let a = 0; a < n; a++) {
|
|
62
|
+
const b = e[a], u = y.schema(t.properties[b]);
|
|
63
63
|
if (!u)
|
|
64
64
|
continue;
|
|
65
|
-
const
|
|
65
|
+
const c = i?.xml && "xml" in u ? u.xml?.name : void 0, m = s(u, i, {
|
|
66
66
|
level: o + 1,
|
|
67
67
|
parentSchema: t,
|
|
68
|
-
name:
|
|
68
|
+
name: b,
|
|
69
69
|
seen: l
|
|
70
70
|
});
|
|
71
|
-
typeof
|
|
71
|
+
typeof m < "u" && (r[c ?? b] = m);
|
|
72
72
|
}
|
|
73
73
|
o > 3 && e.length > P && (r["..."] = "[Additional Properties Truncated]");
|
|
74
74
|
}
|
|
75
75
|
if ("patternProperties" in t && t.patternProperties)
|
|
76
76
|
for (const e of Object.keys(t.patternProperties)) {
|
|
77
|
-
const n =
|
|
78
|
-
n && (r[e] =
|
|
77
|
+
const n = y.schema(t.patternProperties[e]);
|
|
78
|
+
n && (r[e] = s(n, i, {
|
|
79
79
|
level: o + 1,
|
|
80
80
|
parentSchema: t,
|
|
81
81
|
name: e,
|
|
@@ -83,8 +83,8 @@ const D = 10, P = 10, M = "additionalProperty", j = (/* @__PURE__ */ new Date())
|
|
|
83
83
|
}));
|
|
84
84
|
}
|
|
85
85
|
if ("additionalProperties" in t && t.additionalProperties) {
|
|
86
|
-
const e =
|
|
87
|
-
r[
|
|
86
|
+
const e = typeof t.additionalProperties == "boolean" ? t.additionalProperties : y.schema(t.additionalProperties), n = t.additionalProperties === !0 || typeof t.additionalProperties == "object" && Object.keys(t.additionalProperties).length === 0, a = typeof e == "object" && "x-additionalPropertiesName" in e && typeof e["x-additionalPropertiesName"] == "string" && e["x-additionalPropertiesName"].trim().length > 0 ? e["x-additionalPropertiesName"].trim() : R;
|
|
87
|
+
r[a] = n ? "anything" : typeof e == "object" ? s(e, i, {
|
|
88
88
|
level: o + 1,
|
|
89
89
|
seen: l
|
|
90
90
|
}) : "anything";
|
|
@@ -92,7 +92,7 @@ const D = 10, P = 10, M = "additionalProperty", j = (/* @__PURE__ */ new Date())
|
|
|
92
92
|
if (t.oneOf?.[0])
|
|
93
93
|
Object.assign(
|
|
94
94
|
r,
|
|
95
|
-
|
|
95
|
+
s(y.schema(t.oneOf[0]), i, {
|
|
96
96
|
level: o + 1,
|
|
97
97
|
seen: l
|
|
98
98
|
})
|
|
@@ -100,7 +100,7 @@ const D = 10, P = 10, M = "additionalProperty", j = (/* @__PURE__ */ new Date())
|
|
|
100
100
|
else if (t.anyOf?.[0])
|
|
101
101
|
Object.assign(
|
|
102
102
|
r,
|
|
103
|
-
|
|
103
|
+
s(y.schema(t.anyOf[0]), i, {
|
|
104
104
|
level: o + 1,
|
|
105
105
|
seen: l
|
|
106
106
|
})
|
|
@@ -108,67 +108,67 @@ const D = 10, P = 10, M = "additionalProperty", j = (/* @__PURE__ */ new Date())
|
|
|
108
108
|
else if (Array.isArray(t.allOf) && t.allOf.length > 0) {
|
|
109
109
|
let e = r;
|
|
110
110
|
for (const n of t.allOf) {
|
|
111
|
-
const
|
|
111
|
+
const a = s(y.schema(n), i, {
|
|
112
112
|
level: o + 1,
|
|
113
113
|
parentSchema: t,
|
|
114
114
|
seen: l
|
|
115
115
|
});
|
|
116
|
-
e =
|
|
116
|
+
e = T(e, a);
|
|
117
117
|
}
|
|
118
118
|
e && typeof e == "object" && Object.assign(r, e);
|
|
119
119
|
}
|
|
120
120
|
if (i?.xml && "xml" in t && t.xml?.name && o === 0) {
|
|
121
121
|
const e = {};
|
|
122
|
-
return e[t.xml.name] = r,
|
|
122
|
+
return e[t.xml.name] = r, d(t, e, f);
|
|
123
123
|
}
|
|
124
|
-
return
|
|
125
|
-
}, X = (t, i, o, l,
|
|
126
|
-
const r = "items" in t ?
|
|
124
|
+
return d(t, r, f);
|
|
125
|
+
}, X = (t, i, o, l, f) => {
|
|
126
|
+
const r = "items" in t ? y.schema(t.items) : void 0, e = r && typeof r == "object" && "xml" in r ? r.xml?.name : void 0, n = !!(i?.xml && "xml" in t && t.xml?.wrapped && e);
|
|
127
127
|
if (t.example !== void 0)
|
|
128
|
-
return
|
|
128
|
+
return d(t, n ? { [e]: t.example } : t.example, f);
|
|
129
129
|
if (r && typeof r == "object") {
|
|
130
130
|
if (Array.isArray(r.allOf) && r.allOf.length > 0) {
|
|
131
|
-
const
|
|
132
|
-
if (
|
|
133
|
-
const g =
|
|
131
|
+
const c = r.allOf.filter(v), m = y.schema(c[0]);
|
|
132
|
+
if (m && typeof m == "object" && "type" in m && m.type === "object") {
|
|
133
|
+
const g = s({ type: "object", allOf: c }, i, {
|
|
134
134
|
level: o + 1,
|
|
135
135
|
parentSchema: t,
|
|
136
136
|
seen: l
|
|
137
137
|
});
|
|
138
|
-
return
|
|
138
|
+
return d(t, n ? [{ [e]: g }] : [g], f);
|
|
139
139
|
}
|
|
140
|
-
const O =
|
|
141
|
-
(
|
|
140
|
+
const O = c.map(
|
|
141
|
+
(p) => s(y.schema(p), i, {
|
|
142
142
|
level: o + 1,
|
|
143
143
|
parentSchema: t,
|
|
144
144
|
seen: l
|
|
145
145
|
})
|
|
146
146
|
).filter(v);
|
|
147
|
-
return
|
|
147
|
+
return d(
|
|
148
148
|
t,
|
|
149
|
-
n ? O.map((
|
|
150
|
-
|
|
149
|
+
n ? O.map((p) => ({ [e]: p })) : O,
|
|
150
|
+
f
|
|
151
151
|
);
|
|
152
152
|
}
|
|
153
153
|
const u = r.anyOf || r.oneOf;
|
|
154
154
|
if (u && u.length > 0) {
|
|
155
|
-
const
|
|
155
|
+
const c = u[0], m = s(y.schema(c), i, {
|
|
156
156
|
level: o + 1,
|
|
157
157
|
parentSchema: t,
|
|
158
158
|
seen: l
|
|
159
159
|
});
|
|
160
|
-
return
|
|
160
|
+
return d(t, n ? [{ [e]: m }] : [m], f);
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
const
|
|
164
|
-
if (r && typeof r == "object" && ("type" in r && r.type ||
|
|
165
|
-
const u =
|
|
163
|
+
const a = r && typeof r == "object" && ("type" in r && r.type === "object" || "properties" in r), b = r && typeof r == "object" && ("type" in r && r.type === "array" || "items" in r);
|
|
164
|
+
if (r && typeof r == "object" && ("type" in r && r.type || a || b)) {
|
|
165
|
+
const u = s(r, i, {
|
|
166
166
|
level: o + 1,
|
|
167
167
|
seen: l
|
|
168
168
|
});
|
|
169
|
-
return
|
|
169
|
+
return d(t, n ? [{ [e]: u }] : [u], f);
|
|
170
170
|
}
|
|
171
|
-
return
|
|
171
|
+
return d(t, [], f);
|
|
172
172
|
}, U = (t, i, o) => {
|
|
173
173
|
if ("type" in t && t.type && !Array.isArray(t.type))
|
|
174
174
|
switch (t.type) {
|
|
@@ -212,87 +212,87 @@ const D = 10, P = 10, M = "additionalProperty", j = (/* @__PURE__ */ new Date())
|
|
|
212
212
|
mode: t?.mode,
|
|
213
213
|
variables: t?.variables,
|
|
214
214
|
omitEmptyAndOptionalProperties: t?.omitEmptyAndOptionalProperties
|
|
215
|
-
}),
|
|
215
|
+
}), s = (t, i, {
|
|
216
216
|
level: o = 0,
|
|
217
217
|
parentSchema: l,
|
|
218
|
-
name:
|
|
218
|
+
name: f,
|
|
219
219
|
seen: r = /* @__PURE__ */ new WeakSet()
|
|
220
220
|
} = {}) => {
|
|
221
|
-
const e =
|
|
221
|
+
const e = y.schema(t);
|
|
222
222
|
if (!v(e))
|
|
223
223
|
return;
|
|
224
224
|
const n = E(N(e));
|
|
225
225
|
if (r.has(n))
|
|
226
226
|
return;
|
|
227
227
|
r.add(n);
|
|
228
|
-
const
|
|
229
|
-
if (typeof
|
|
230
|
-
return r.delete(n),
|
|
231
|
-
if (o >
|
|
228
|
+
const a = z(i), b = A.get(n)?.get(a);
|
|
229
|
+
if (typeof b < "u")
|
|
230
|
+
return r.delete(n), b;
|
|
231
|
+
if (o > M)
|
|
232
232
|
return r.delete(n), "[Max Depth Exceeded]";
|
|
233
233
|
const u = !!i?.emptyString;
|
|
234
|
-
if (F(e, l,
|
|
234
|
+
if (F(e, l, f, i)) {
|
|
235
235
|
r.delete(n);
|
|
236
236
|
return;
|
|
237
237
|
}
|
|
238
238
|
if ("x-variable" in e && e["x-variable"]) {
|
|
239
|
-
const
|
|
240
|
-
if (
|
|
241
|
-
return "type" in e && (e.type === "number" || e.type === "integer") ? (r.delete(n),
|
|
239
|
+
const p = i?.variables?.[e["x-variable"]];
|
|
240
|
+
if (p !== void 0)
|
|
241
|
+
return "type" in e && (e.type === "number" || e.type === "integer") ? (r.delete(n), d(e, Number(p), a)) : (r.delete(n), d(e, p, a));
|
|
242
242
|
}
|
|
243
243
|
if (Array.isArray(e.examples) && e.examples.length > 0)
|
|
244
|
-
return r.delete(n),
|
|
244
|
+
return r.delete(n), d(e, e.examples[0], a);
|
|
245
245
|
if (e.example !== void 0)
|
|
246
|
-
return r.delete(n),
|
|
246
|
+
return r.delete(n), d(e, e.example, a);
|
|
247
247
|
if (e.default !== void 0)
|
|
248
|
-
return r.delete(n),
|
|
248
|
+
return r.delete(n), d(e, e.default, a);
|
|
249
249
|
if (e.const !== void 0)
|
|
250
|
-
return r.delete(n),
|
|
250
|
+
return r.delete(n), d(e, e.const, a);
|
|
251
251
|
if (Array.isArray(e.enum) && e.enum.length > 0)
|
|
252
|
-
return r.delete(n),
|
|
252
|
+
return r.delete(n), d(e, e.enum[0], a);
|
|
253
253
|
if ("properties" in e || "type" in e && e.type === "object") {
|
|
254
|
-
const
|
|
255
|
-
return r.delete(n),
|
|
254
|
+
const p = L(e, i, o, r, a);
|
|
255
|
+
return r.delete(n), p;
|
|
256
256
|
}
|
|
257
257
|
if ("type" in e && e.type === "array" || "items" in e) {
|
|
258
|
-
const
|
|
259
|
-
return r.delete(n),
|
|
258
|
+
const p = X(e, i, o, r, a);
|
|
259
|
+
return r.delete(n), p;
|
|
260
260
|
}
|
|
261
|
-
const
|
|
262
|
-
if (
|
|
263
|
-
return r.delete(n),
|
|
264
|
-
const
|
|
265
|
-
if (Array.isArray(
|
|
266
|
-
for (const
|
|
267
|
-
const g =
|
|
261
|
+
const c = U(e, u, i?.emptyString);
|
|
262
|
+
if (c !== void 0)
|
|
263
|
+
return r.delete(n), d(e, c, a);
|
|
264
|
+
const m = e.oneOf || e.anyOf;
|
|
265
|
+
if (Array.isArray(m) && m.length > 0) {
|
|
266
|
+
for (const p of m) {
|
|
267
|
+
const g = y.schema(p);
|
|
268
268
|
if (g && (!("type" in g) || g.type !== "null"))
|
|
269
|
-
return r.delete(n),
|
|
269
|
+
return r.delete(n), d(
|
|
270
270
|
e,
|
|
271
|
-
|
|
271
|
+
s(g, i, {
|
|
272
272
|
level: o + 1,
|
|
273
273
|
seen: r
|
|
274
274
|
}),
|
|
275
|
-
|
|
275
|
+
a
|
|
276
276
|
);
|
|
277
277
|
}
|
|
278
|
-
return r.delete(n),
|
|
278
|
+
return r.delete(n), d(e, null, a);
|
|
279
279
|
}
|
|
280
280
|
if (Array.isArray(e.allOf) && e.allOf.length > 0) {
|
|
281
|
-
let
|
|
281
|
+
let p;
|
|
282
282
|
const g = e.allOf;
|
|
283
|
-
for (const
|
|
284
|
-
const
|
|
283
|
+
for (const D of g) {
|
|
284
|
+
const x = s(D, i, {
|
|
285
285
|
level: o + 1,
|
|
286
286
|
parentSchema: e,
|
|
287
287
|
seen: r
|
|
288
288
|
});
|
|
289
|
-
|
|
289
|
+
p === void 0 ? p = x : p && typeof p == "object" && x && typeof x == "object" ? p = T(p, x) : x !== void 0 && (p = x);
|
|
290
290
|
}
|
|
291
|
-
return r.delete(n),
|
|
291
|
+
return r.delete(n), d(e, p ?? null, a);
|
|
292
292
|
}
|
|
293
293
|
const O = W(e, u, i?.emptyString);
|
|
294
|
-
return O !== void 0 ? (r.delete(n),
|
|
294
|
+
return O !== void 0 ? (r.delete(n), d(e, O, a)) : (r.delete(n), d(e, null, a));
|
|
295
295
|
};
|
|
296
296
|
export {
|
|
297
|
-
|
|
297
|
+
s as getExampleFromSchema
|
|
298
298
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestTableRow.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestTableRow.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestTableRow.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestTableRow.vue"],"names":[],"mappings":"AAiTA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACb,MAAM,8DAA8D,CAAA;AAcrE,MAAM,MAAM,QAAQ,GAAG;IACrB,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ,0DAA0D;IAC1D,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;IAC3B,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,mFAAmF;IACnF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,iDAAiD;IACjD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,wEAAwE;IACxE,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,wCAAwC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,mDAAmD;IACnD,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,uDAAuD;IACvD,iBAAiB,CAAC,EAAE,eAAe,CAAA;CACpC,CAAA;AAED,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,QAAQ,CAAA;IACd,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,kBAAkB,CAAA;IAC/B,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAC;;;;;;;cAYmB,MAAM;eAAS,MAAM,GAAG,IAAI;oBAAc,OAAO;;;;;;;;cAAjD,MAAM;eAAS,MAAM,GAAG,IAAI;oBAAc,OAAO;;;AAsiBtE,wBAOG"}
|