@scalar/api-client 2.34.1 → 2.36.1
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 +88 -0
- package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +1 -1
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +88 -80
- package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-body.js +28 -27
- package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.js +6 -4
- package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.d.ts +16 -0
- package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js +17 -0
- 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 +90 -84
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.js +47 -42
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js +76 -50
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +65 -59
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +57 -42
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +44 -41
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts +2 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.js +50 -44
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +41 -35
- package/dist/v2/features/app/app-events.d.ts +5 -2
- package/dist/v2/features/app/app-events.d.ts.map +1 -1
- package/dist/v2/features/app/app-events.js +58 -44
- package/dist/v2/features/app/app-state.d.ts.map +1 -1
- package/dist/v2/features/app/app-state.js +82 -80
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +2 -2
- package/dist/v2/features/app/components/AppSidebar.vue2.js +78 -76
- package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/DesktopTabs.vue.js +34 -30
- package/dist/v2/features/app/components/SidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/SidebarItemMenu.vue.js +73 -45
- package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/DocumentCollection.vue.js +20 -20
- package/dist/v2/features/collection/OperationCollection.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/OperationCollection.vue.js +7 -7
- package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/WorkspaceCollection.vue.js +5 -4
- package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Authentication.vue.js +1 -1
- package/dist/v2/features/collection/components/Authentication.vue2.js +84 -66
- package/dist/v2/features/collection/components/LabelInput.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/LabelInput.vue.js +2 -2
- package/dist/v2/features/collection/components/LabelInput.vue2.js +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts +5 -0
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.js +131 -96
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +25 -0
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +42 -36
- package/dist/v2/features/operation/Operation.vue.js +1 -1
- package/dist/v2/workspace-events.d.ts.map +1 -1
- package/dist/v2/workspace-events.js +8 -5
- package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts.map +1 -1
- package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +44 -45
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +19 -19
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { isDefined as
|
|
1
|
+
import { isDefined as O } from "@scalar/helpers/array/is-defined";
|
|
2
2
|
import { unpackProxyObject as D } from "@scalar/workspace-store/helpers/unpack-proxy";
|
|
3
|
-
import { resolve as
|
|
4
|
-
const T = 10, q = "additionalProperty", j = (/* @__PURE__ */ new Date()).toISOString(),
|
|
3
|
+
import { resolve as s } from "@scalar/workspace-store/resolve";
|
|
4
|
+
const T = 10, q = "additionalProperty", j = (/* @__PURE__ */ new Date()).toISOString(), C = j.split("T")[0], k = j.split("T")[1].split(".")[0], M = {
|
|
5
5
|
"date-time": j,
|
|
6
|
-
date:
|
|
6
|
+
date: C,
|
|
7
7
|
email: "hello@example.com",
|
|
8
8
|
hostname: "example.com",
|
|
9
9
|
// https://tools.ietf.org/html/rfc6531#section-3.3
|
|
@@ -21,14 +21,20 @@ const T = 10, q = "additionalProperty", j = (/* @__PURE__ */ new Date()).toISOSt
|
|
|
21
21
|
// https://tools.ietf.org/html/draft-handrews-relative-json-pointer-01
|
|
22
22
|
"relative-json-pointer": "1/nested/objects",
|
|
23
23
|
// full-time in https://tools.ietf.org/html/rfc3339#section-5.6
|
|
24
|
-
time:
|
|
24
|
+
time: k,
|
|
25
25
|
// either a URI or relative-reference https://tools.ietf.org/html/rfc3986#section-4.1
|
|
26
26
|
"uri-reference": "../folder",
|
|
27
27
|
"uri-template": "https://example.com/{id}",
|
|
28
28
|
uri: "https://example.com",
|
|
29
29
|
uuid: "123e4567-e89b-12d3-a456-426614174000",
|
|
30
30
|
"object-id": "6592008029c8c3e4dc76256c"
|
|
31
|
-
},
|
|
31
|
+
}, I = (e) => {
|
|
32
|
+
if (!("propertyNames" in e) || !e.propertyNames)
|
|
33
|
+
return;
|
|
34
|
+
const i = s.schema(e.propertyNames);
|
|
35
|
+
if (i && "enum" in i && Array.isArray(i.enum) && i.enum.length > 0)
|
|
36
|
+
return i.enum;
|
|
37
|
+
}, S = (e, i = !1, o = "") => "type" in e && e.type === "string" && "format" in e && e.format === "binary" ? "@filename" : i && "format" in e && e.format ? M[e.format] ?? o : o, A = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), N = (e) => D(e, { depth: 1 }), R = (e) => {
|
|
32
38
|
if (!e)
|
|
33
39
|
return;
|
|
34
40
|
const i = P.get(e);
|
|
@@ -37,81 +43,81 @@ const T = 10, q = "additionalProperty", j = (/* @__PURE__ */ new Date()).toISOSt
|
|
|
37
43
|
if ("required" in e) {
|
|
38
44
|
const o = e.required;
|
|
39
45
|
if (Array.isArray(o) && o.length > 0) {
|
|
40
|
-
const
|
|
41
|
-
return P.set(e,
|
|
46
|
+
const a = new Set(o);
|
|
47
|
+
return P.set(e, a), a;
|
|
42
48
|
}
|
|
43
49
|
}
|
|
44
50
|
}, d = (e, i, o) => {
|
|
45
51
|
if (typeof i != "object" || i === null)
|
|
46
52
|
return i;
|
|
47
|
-
const
|
|
48
|
-
return f && f.set(o, i), A.set(
|
|
49
|
-
},
|
|
50
|
-
if (e.deprecated ||
|
|
53
|
+
const a = N(e), f = A.get(a) ?? /* @__PURE__ */ new Map();
|
|
54
|
+
return f && f.set(o, i), A.set(a, f), i;
|
|
55
|
+
}, _ = (e) => !!(e.allOf || e.oneOf || e.anyOf), F = (e, i, o, a) => {
|
|
56
|
+
if (e.deprecated || a?.mode === "write" && e.readOnly || a?.mode === "read" && e.writeOnly)
|
|
51
57
|
return !0;
|
|
52
|
-
if (
|
|
58
|
+
if (a?.omitEmptyAndOptionalProperties !== !0 || "type" in e && (e.type === "object" || e.type === "array") || _(e) || "examples" in e && Array.isArray(e.examples) && e.examples.length > 0 || "example" in e && e.example !== void 0 || "default" in e && e.default !== void 0 || "const" in e && e.const !== void 0 || "enum" in e && Array.isArray(e.enum) && e.enum.length > 0)
|
|
53
59
|
return !1;
|
|
54
|
-
const r = o ?? e.title ?? "", t =
|
|
60
|
+
const r = o ?? e.title ?? "", t = R(i);
|
|
55
61
|
return !(t ? t.has(r) : !1);
|
|
56
|
-
}, E = (e, i) => Array.isArray(e) && Array.isArray(i) ? [...e, ...i] : e && typeof e == "object" && i && typeof i == "object" ? { ...e, ...i } : i,
|
|
62
|
+
}, E = (e, i) => Array.isArray(e) && Array.isArray(i) ? [...e, ...i] : e && typeof e == "object" && i && typeof i == "object" ? { ...e, ...i } : i, L = (e, i, o, a, f) => {
|
|
57
63
|
const r = {};
|
|
58
64
|
if ("properties" in e && e.properties) {
|
|
59
65
|
const t = Object.keys(e.properties), n = t.length;
|
|
60
|
-
for (let
|
|
61
|
-
const
|
|
66
|
+
for (let l = 0; l < n; l++) {
|
|
67
|
+
const c = t[l], u = s.schema(e.properties[c]);
|
|
62
68
|
if (!u)
|
|
63
69
|
continue;
|
|
64
|
-
const
|
|
70
|
+
const y = i?.xml && "xml" in u ? u.xml?.name : void 0, m = g(u, i, {
|
|
65
71
|
level: o + 1,
|
|
66
72
|
parentSchema: e,
|
|
67
|
-
name:
|
|
68
|
-
seen:
|
|
73
|
+
name: c,
|
|
74
|
+
seen: a
|
|
69
75
|
});
|
|
70
|
-
typeof m < "u" && (r[
|
|
76
|
+
typeof m < "u" && (r[y ?? c] = m);
|
|
71
77
|
}
|
|
72
78
|
}
|
|
73
79
|
if ("patternProperties" in e && e.patternProperties)
|
|
74
80
|
for (const t of Object.keys(e.patternProperties)) {
|
|
75
|
-
const n =
|
|
76
|
-
n && (r[t] =
|
|
81
|
+
const n = s.schema(e.patternProperties[t]);
|
|
82
|
+
n && (r[t] = g(n, i, {
|
|
77
83
|
level: o + 1,
|
|
78
84
|
parentSchema: e,
|
|
79
85
|
name: t,
|
|
80
|
-
seen:
|
|
86
|
+
seen: a
|
|
81
87
|
}));
|
|
82
88
|
}
|
|
83
89
|
if ("additionalProperties" in e && e.additionalProperties) {
|
|
84
|
-
const t = typeof e.additionalProperties == "boolean" ? e.additionalProperties :
|
|
85
|
-
r[a] = n ? "anything" : typeof t == "object" ? c(t, i, {
|
|
90
|
+
const t = typeof e.additionalProperties == "boolean" ? e.additionalProperties : s.schema(e.additionalProperties), n = e.additionalProperties === !0 || typeof e.additionalProperties == "object" && Object.keys(e.additionalProperties).length === 0, l = typeof t == "object" && "x-additionalPropertiesName" in t && typeof t["x-additionalPropertiesName"] == "string" && t["x-additionalPropertiesName"].trim().length > 0, c = l ? void 0 : I(e), u = l ? t["x-additionalPropertiesName"].trim() : q, y = n ? "anything" : typeof t == "object" ? g(t, i, {
|
|
86
91
|
level: o + 1,
|
|
87
|
-
seen:
|
|
92
|
+
seen: a
|
|
88
93
|
}) : "anything";
|
|
94
|
+
c && c.length > 0 ? r[String(c[0])] = y : r[u] = y;
|
|
89
95
|
}
|
|
90
96
|
if (e.oneOf?.[0])
|
|
91
97
|
Object.assign(
|
|
92
98
|
r,
|
|
93
|
-
|
|
99
|
+
g(s.schema(e.oneOf[0]), i, {
|
|
94
100
|
level: o + 1,
|
|
95
|
-
seen:
|
|
101
|
+
seen: a
|
|
96
102
|
})
|
|
97
103
|
);
|
|
98
104
|
else if (e.anyOf?.[0])
|
|
99
105
|
Object.assign(
|
|
100
106
|
r,
|
|
101
|
-
|
|
107
|
+
g(s.schema(e.anyOf[0]), i, {
|
|
102
108
|
level: o + 1,
|
|
103
|
-
seen:
|
|
109
|
+
seen: a
|
|
104
110
|
})
|
|
105
111
|
);
|
|
106
112
|
else if (Array.isArray(e.allOf) && e.allOf.length > 0) {
|
|
107
113
|
let t = r;
|
|
108
114
|
for (const n of e.allOf) {
|
|
109
|
-
const
|
|
115
|
+
const l = g(s.schema(n), i, {
|
|
110
116
|
level: o + 1,
|
|
111
117
|
parentSchema: e,
|
|
112
|
-
seen:
|
|
118
|
+
seen: a
|
|
113
119
|
});
|
|
114
|
-
t = E(t,
|
|
120
|
+
t = E(t, l);
|
|
115
121
|
}
|
|
116
122
|
t && typeof t == "object" && Object.assign(r, t);
|
|
117
123
|
}
|
|
@@ -120,54 +126,54 @@ const T = 10, q = "additionalProperty", j = (/* @__PURE__ */ new Date()).toISOSt
|
|
|
120
126
|
return t[e.xml.name] = r, d(e, t, f);
|
|
121
127
|
}
|
|
122
128
|
return d(e, r, f);
|
|
123
|
-
},
|
|
124
|
-
const r = "items" in e ?
|
|
129
|
+
}, U = (e, i, o, a, f) => {
|
|
130
|
+
const r = "items" in e ? s.schema(e.items) : void 0, t = r && typeof r == "object" && "xml" in r ? r.xml?.name : void 0, n = !!(i?.xml && "xml" in e && e.xml?.wrapped && t);
|
|
125
131
|
if (e.example !== void 0)
|
|
126
132
|
return d(e, n ? { [t]: e.example } : e.example, f);
|
|
127
133
|
if (r && typeof r == "object") {
|
|
128
134
|
if (Array.isArray(r.allOf) && r.allOf.length > 0) {
|
|
129
|
-
const
|
|
135
|
+
const y = r.allOf.filter(O), m = s.schema(y[0]);
|
|
130
136
|
if (m && typeof m == "object" && "type" in m && m.type === "object") {
|
|
131
|
-
const b =
|
|
137
|
+
const b = g({ type: "object", allOf: y }, i, {
|
|
132
138
|
level: o + 1,
|
|
133
139
|
parentSchema: e,
|
|
134
|
-
seen:
|
|
140
|
+
seen: a
|
|
135
141
|
});
|
|
136
142
|
return d(e, n ? [{ [t]: b }] : [b], f);
|
|
137
143
|
}
|
|
138
|
-
const
|
|
139
|
-
(p) =>
|
|
144
|
+
const v = y.map(
|
|
145
|
+
(p) => g(s.schema(p), i, {
|
|
140
146
|
level: o + 1,
|
|
141
147
|
parentSchema: e,
|
|
142
|
-
seen:
|
|
148
|
+
seen: a
|
|
143
149
|
})
|
|
144
|
-
).filter(
|
|
150
|
+
).filter(O);
|
|
145
151
|
return d(
|
|
146
152
|
e,
|
|
147
|
-
n ?
|
|
153
|
+
n ? v.map((p) => ({ [t]: p })) : v,
|
|
148
154
|
f
|
|
149
155
|
);
|
|
150
156
|
}
|
|
151
157
|
const u = r.anyOf || r.oneOf;
|
|
152
158
|
if (u && u.length > 0) {
|
|
153
|
-
const
|
|
159
|
+
const y = u[0], m = g(s.schema(y), i, {
|
|
154
160
|
level: o + 1,
|
|
155
161
|
parentSchema: e,
|
|
156
|
-
seen:
|
|
162
|
+
seen: a
|
|
157
163
|
});
|
|
158
164
|
return d(e, n ? [{ [t]: m }] : [m], f);
|
|
159
165
|
}
|
|
160
166
|
}
|
|
161
|
-
const
|
|
162
|
-
if (r && typeof r == "object" && ("type" in r && r.type ||
|
|
163
|
-
const u =
|
|
167
|
+
const l = r && typeof r == "object" && ("type" in r && r.type === "object" || "properties" in r), c = r && typeof r == "object" && ("type" in r && r.type === "array" || "items" in r);
|
|
168
|
+
if (r && typeof r == "object" && ("type" in r && r.type || l || c)) {
|
|
169
|
+
const u = g(r, i, {
|
|
164
170
|
level: o + 1,
|
|
165
|
-
seen:
|
|
171
|
+
seen: a
|
|
166
172
|
});
|
|
167
173
|
return d(e, n ? [{ [t]: u }] : [u], f);
|
|
168
174
|
}
|
|
169
175
|
return d(e, [], f);
|
|
170
|
-
},
|
|
176
|
+
}, W = (e, i, o) => {
|
|
171
177
|
if ("type" in e && e.type && !Array.isArray(e.type))
|
|
172
178
|
switch (e.type) {
|
|
173
179
|
case "string":
|
|
@@ -183,13 +189,13 @@ const T = 10, q = "additionalProperty", j = (/* @__PURE__ */ new Date()).toISOSt
|
|
|
183
189
|
default:
|
|
184
190
|
return;
|
|
185
191
|
}
|
|
186
|
-
},
|
|
192
|
+
}, X = (e, i, o) => {
|
|
187
193
|
if ("type" in e && Array.isArray(e.type)) {
|
|
188
194
|
if (e.type.includes("null"))
|
|
189
195
|
return null;
|
|
190
|
-
const
|
|
191
|
-
if (
|
|
192
|
-
switch (
|
|
196
|
+
const a = e.type[0];
|
|
197
|
+
if (a)
|
|
198
|
+
switch (a) {
|
|
193
199
|
case "string":
|
|
194
200
|
return S(e, i, o ?? "");
|
|
195
201
|
case "boolean":
|
|
@@ -204,93 +210,93 @@ const T = 10, q = "additionalProperty", j = (/* @__PURE__ */ new Date()).toISOSt
|
|
|
204
210
|
return;
|
|
205
211
|
}
|
|
206
212
|
}
|
|
207
|
-
},
|
|
213
|
+
}, z = (e) => JSON.stringify({
|
|
208
214
|
emptyString: e?.emptyString,
|
|
209
215
|
xml: e?.xml,
|
|
210
216
|
mode: e?.mode,
|
|
211
217
|
variables: e?.variables,
|
|
212
218
|
omitEmptyAndOptionalProperties: e?.omitEmptyAndOptionalProperties
|
|
213
|
-
}),
|
|
219
|
+
}), g = (e, i, {
|
|
214
220
|
level: o = 0,
|
|
215
|
-
parentSchema:
|
|
221
|
+
parentSchema: a,
|
|
216
222
|
name: f,
|
|
217
223
|
seen: r = /* @__PURE__ */ new WeakSet()
|
|
218
224
|
} = {}) => {
|
|
219
|
-
const t =
|
|
220
|
-
if (!
|
|
225
|
+
const t = s.schema(e);
|
|
226
|
+
if (!O(t))
|
|
221
227
|
return;
|
|
222
228
|
const n = N(t);
|
|
223
229
|
if (r.has(n))
|
|
224
230
|
return;
|
|
225
231
|
r.add(n);
|
|
226
|
-
const
|
|
227
|
-
if (typeof
|
|
228
|
-
return r.delete(n),
|
|
232
|
+
const l = z(i), c = A.get(n)?.get(l);
|
|
233
|
+
if (typeof c < "u")
|
|
234
|
+
return r.delete(n), c;
|
|
229
235
|
if (o > T)
|
|
230
236
|
return r.delete(n), "[Max Depth Exceeded]";
|
|
231
237
|
const u = !!i?.emptyString;
|
|
232
|
-
if (
|
|
238
|
+
if (F(t, a, f, i)) {
|
|
233
239
|
r.delete(n);
|
|
234
240
|
return;
|
|
235
241
|
}
|
|
236
242
|
if ("x-variable" in t && t["x-variable"]) {
|
|
237
243
|
const p = i?.variables?.[t["x-variable"]];
|
|
238
244
|
if (p !== void 0)
|
|
239
|
-
return "type" in t && (t.type === "number" || t.type === "integer") ? (r.delete(n), d(t, Number(p),
|
|
245
|
+
return "type" in t && (t.type === "number" || t.type === "integer") ? (r.delete(n), d(t, Number(p), l)) : (r.delete(n), d(t, p, l));
|
|
240
246
|
}
|
|
241
247
|
if (Array.isArray(t.examples) && t.examples.length > 0)
|
|
242
|
-
return r.delete(n), d(t, t.examples[0],
|
|
248
|
+
return r.delete(n), d(t, t.examples[0], l);
|
|
243
249
|
if (t.example !== void 0)
|
|
244
|
-
return r.delete(n), d(t, t.example,
|
|
250
|
+
return r.delete(n), d(t, t.example, l);
|
|
245
251
|
if (t.default !== void 0)
|
|
246
|
-
return r.delete(n), d(t, t.default,
|
|
252
|
+
return r.delete(n), d(t, t.default, l);
|
|
247
253
|
if (t.const !== void 0)
|
|
248
|
-
return r.delete(n), d(t, t.const,
|
|
254
|
+
return r.delete(n), d(t, t.const, l);
|
|
249
255
|
if (Array.isArray(t.enum) && t.enum.length > 0)
|
|
250
|
-
return r.delete(n), d(t, t.enum[0],
|
|
256
|
+
return r.delete(n), d(t, t.enum[0], l);
|
|
251
257
|
if ("properties" in t || "type" in t && t.type === "object") {
|
|
252
|
-
const p =
|
|
258
|
+
const p = L(t, i, o, r, l);
|
|
253
259
|
return r.delete(n), p;
|
|
254
260
|
}
|
|
255
261
|
if ("type" in t && t.type === "array" || "items" in t) {
|
|
256
|
-
const p =
|
|
262
|
+
const p = U(t, i, o, r, l);
|
|
257
263
|
return r.delete(n), p;
|
|
258
264
|
}
|
|
259
|
-
const
|
|
260
|
-
if (
|
|
261
|
-
return r.delete(n), d(t,
|
|
265
|
+
const y = W(t, u, i?.emptyString);
|
|
266
|
+
if (y !== void 0)
|
|
267
|
+
return r.delete(n), d(t, y, l);
|
|
262
268
|
const m = t.oneOf || t.anyOf;
|
|
263
269
|
if (Array.isArray(m) && m.length > 0) {
|
|
264
270
|
for (const p of m) {
|
|
265
|
-
const b =
|
|
271
|
+
const b = s.schema(p);
|
|
266
272
|
if (b && (!("type" in b) || b.type !== "null"))
|
|
267
273
|
return r.delete(n), d(
|
|
268
274
|
t,
|
|
269
|
-
|
|
275
|
+
g(b, i, {
|
|
270
276
|
level: o + 1,
|
|
271
277
|
seen: r
|
|
272
278
|
}),
|
|
273
|
-
|
|
279
|
+
l
|
|
274
280
|
);
|
|
275
281
|
}
|
|
276
|
-
return r.delete(n), d(t, null,
|
|
282
|
+
return r.delete(n), d(t, null, l);
|
|
277
283
|
}
|
|
278
284
|
if (Array.isArray(t.allOf) && t.allOf.length > 0) {
|
|
279
285
|
let p;
|
|
280
286
|
const b = t.allOf;
|
|
281
287
|
for (const w of b) {
|
|
282
|
-
const x =
|
|
288
|
+
const x = g(w, i, {
|
|
283
289
|
level: o + 1,
|
|
284
290
|
parentSchema: t,
|
|
285
291
|
seen: r
|
|
286
292
|
});
|
|
287
293
|
p === void 0 ? p = x : p && typeof p == "object" && x && typeof x == "object" ? p = E(p, x) : x !== void 0 && (p = x);
|
|
288
294
|
}
|
|
289
|
-
return r.delete(n), d(t, p ?? null,
|
|
295
|
+
return r.delete(n), d(t, p ?? null, l);
|
|
290
296
|
}
|
|
291
|
-
const
|
|
292
|
-
return
|
|
297
|
+
const v = X(t, u, i?.emptyString);
|
|
298
|
+
return v !== void 0 ? (r.delete(n), d(t, v, l)) : (r.delete(n), d(t, null, l));
|
|
293
299
|
};
|
|
294
300
|
export {
|
|
295
|
-
|
|
301
|
+
g as getExampleFromSchema
|
|
296
302
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-body.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8DAA8D,CAAA;AAErG,OAAO,KAAK,EAAS,QAAQ,EAAE,MAAM,YAAY,CAAA;AAIjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,KAAK,gBAAgB,GAAG,IAAI,CAAC,mBAAmB,EAAE,aAAa,GAAG,SAAS,CAAC,GAAG;IAC7E,WAAW,EAAE,iBAAiB,CAAA;CAC/B,CAAA;AAoDD;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,uCAAuC,gBAAgB,KAAG,QAAQ,GAAG,
|
|
1
|
+
{"version":3,"file":"process-body.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8DAA8D,CAAA;AAErG,OAAO,KAAK,EAAS,QAAQ,EAAE,MAAM,YAAY,CAAA;AAIjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,KAAK,gBAAgB,GAAG,IAAI,CAAC,mBAAmB,EAAE,aAAa,GAAG,SAAS,CAAC,GAAG;IAC7E,WAAW,EAAE,iBAAiB,CAAA;CAC/B,CAAA;AAoDD;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,uCAAuC,gBAAgB,KAAG,QAAQ,GAAG,SA8EhG,CAAA"}
|
|
@@ -1,58 +1,63 @@
|
|
|
1
|
-
import { json2xml as
|
|
2
|
-
import { getResolvedRef as
|
|
3
|
-
import { unpackProxyObject as
|
|
4
|
-
import { getExampleFromSchema as
|
|
5
|
-
import { getExample as
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
for (const [
|
|
1
|
+
import { json2xml as c } from "@scalar/helpers/file/json2xml";
|
|
2
|
+
import { getResolvedRef as u } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
3
|
+
import { unpackProxyObject as s } from "@scalar/workspace-store/helpers/unpack-proxy";
|
|
4
|
+
import { getExampleFromSchema as y } from "../get-example-from-schema.js";
|
|
5
|
+
import { getExample as x } from "../../../operation-block/helpers/get-example.js";
|
|
6
|
+
const f = (a) => {
|
|
7
|
+
const r = [], l = Array.isArray(a) ? a.filter((t) => !t.isDisabled).map((t) => [t.name, t.value]) : Object.entries(a);
|
|
8
|
+
for (const [t, n] of l)
|
|
9
9
|
if (n != null)
|
|
10
10
|
if (n instanceof File) {
|
|
11
|
-
const o =
|
|
12
|
-
|
|
11
|
+
const o = s(n);
|
|
12
|
+
r.push({ name: t, value: `@${o.name}` });
|
|
13
13
|
} else if (Array.isArray(n))
|
|
14
14
|
for (const o of n)
|
|
15
15
|
if (o instanceof File) {
|
|
16
|
-
const
|
|
17
|
-
|
|
16
|
+
const i = s(o);
|
|
17
|
+
r.push({ name: t, value: `@${i.name}` });
|
|
18
18
|
} else
|
|
19
|
-
|
|
19
|
+
r.push({ name: t, value: String(o) });
|
|
20
20
|
else if (typeof n == "object") {
|
|
21
|
-
const o =
|
|
22
|
-
for (const
|
|
23
|
-
|
|
21
|
+
const o = f(n);
|
|
22
|
+
for (const i of o)
|
|
23
|
+
r.push({ name: `${t}.${i.name}`, value: i.value });
|
|
24
24
|
} else
|
|
25
|
-
|
|
26
|
-
return
|
|
27
|
-
}, h = ({ requestBody: a, contentType:
|
|
28
|
-
const
|
|
29
|
-
if (typeof
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
r.push({ name: t, value: String(n) });
|
|
26
|
+
return r;
|
|
27
|
+
}, h = ({ requestBody: a, contentType: r, example: l }) => {
|
|
28
|
+
const t = r || Object.keys(a.content)[0] || "", n = (e) => `@${s(e).name || "filename"}`, o = t === "multipart/form-data" || t === "application/x-www-form-urlencoded", i = t === "application/xml", m = x(a, l, r)?.value;
|
|
29
|
+
if (typeof m < "u") {
|
|
30
|
+
const e = m !== null && typeof m == "object" ? s(m) : m;
|
|
31
|
+
return o && typeof e == "object" && e !== null ? {
|
|
32
|
+
mimeType: t,
|
|
33
|
+
params: f(e)
|
|
34
|
+
} : i && typeof e == "object" && e !== null ? {
|
|
35
|
+
mimeType: t,
|
|
36
|
+
text: c(e)
|
|
37
|
+
} : e instanceof File ? {
|
|
38
|
+
mimeType: t,
|
|
39
|
+
text: n(e)
|
|
36
40
|
} : {
|
|
37
|
-
mimeType:
|
|
38
|
-
text: typeof
|
|
41
|
+
mimeType: t,
|
|
42
|
+
text: typeof e == "string" ? e : JSON.stringify(e)
|
|
39
43
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
}
|
|
45
|
+
const p = u(a.content[t]?.schema);
|
|
46
|
+
if (typeof p < "u") {
|
|
47
|
+
const e = y(p, {
|
|
43
48
|
mode: "write",
|
|
44
|
-
xml:
|
|
49
|
+
xml: i
|
|
45
50
|
});
|
|
46
|
-
if (
|
|
47
|
-
return
|
|
48
|
-
mimeType:
|
|
49
|
-
params:
|
|
50
|
-
} :
|
|
51
|
-
mimeType:
|
|
52
|
-
text:
|
|
51
|
+
if (e !== void 0)
|
|
52
|
+
return o && typeof e == "object" && e !== null ? {
|
|
53
|
+
mimeType: t,
|
|
54
|
+
params: f(e)
|
|
55
|
+
} : i && typeof e == "object" && e !== null ? {
|
|
56
|
+
mimeType: t,
|
|
57
|
+
text: c(e)
|
|
53
58
|
} : {
|
|
54
|
-
mimeType:
|
|
55
|
-
text: typeof
|
|
59
|
+
mimeType: t,
|
|
60
|
+
text: typeof e == "string" ? e : JSON.stringify(e)
|
|
56
61
|
};
|
|
57
62
|
}
|
|
58
63
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { canMethodHaveBody as m } from "@scalar/helpers/http/can-method-have-body";
|
|
2
2
|
import { getResolvedRef as r } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
3
3
|
import { isElectron as y } from "../../../../libs/electron.js";
|
|
4
|
-
const l = "2.
|
|
4
|
+
const l = "2.36.1", T = "application/json", C = "*/*", a = (n, s, o) => ({
|
|
5
5
|
name: n,
|
|
6
6
|
defaultValue: s,
|
|
7
7
|
isOverridden: o.has(n.toLowerCase())
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentSelector.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EnvironmentSelector.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue"],"names":[],"mappings":"AAmOA,KAAK,WAAW,GAAG;IACjB,qCAAqC;IACrC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,qCAAqC;IACrC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAC;AAghBF,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|