@scalar/api-reference 1.25.53 → 1.25.55
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 +25 -0
- package/dist/browser/standalone.js +4611 -4584
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.js +2 -2
- package/dist/features/ExampleRequest/ExampleRequest.vue2.js +62 -62
- package/dist/features/ExampleRequest/TextSelect.vue.d.ts.map +1 -1
- package/dist/features/ExampleRequest/TextSelect.vue.js +27 -24
- package/dist/index.js +1 -1
- package/dist/stores/useHttpClientStore.d.ts.map +1 -1
- package/dist/stores/useHttpClientStore.js +11 -11
- package/dist/style.css +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleRequest.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ExampleRequest/ExampleRequest.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExampleRequest.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ExampleRequest/ExampleRequest.vue"],"names":[],"mappings":"AAmYA,OAAO,KAAK,EAGV,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;AAuO7B,iBAAS,cAAc;oBAyRM,GAAG;oBAEH,GAAG;oBADH,GAAG;oBAEH,GAAG;EAqC/B;AACD,QAAA,MAAM,eAAe;eAzgBR,oBAAoB;IAC/B,yDAAyD;eAC9C,OAAO;;eAFP,oBAAoB;IAC/B,yDAAyD;eAC9C,OAAO;iGA6gBlB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ExampleRequest.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-cd795a2e"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as Y, ref as O, useId as D, computed as d, watch as z, inject as G, onServerPrefetch as Q, useSSRContext as W, unref as
|
|
1
|
+
import { defineComponent as Y, ref as O, useId as D, computed as d, watch as z, inject as G, onServerPrefetch as Q, useSSRContext as W, unref as a, openBlock as c, createBlock as g, withCtx as r, createVNode as l, createElementBlock as K, Fragment as R, createTextVNode as f, toDisplayString as S, createElementVNode as x, renderSlot as y, createCommentVNode as C } from "vue";
|
|
2
2
|
import { ScalarCodeBlock as X } from "@scalar/components";
|
|
3
3
|
import { createHash as Z, ssrState as ee } from "@scalar/oas-utils/helpers";
|
|
4
4
|
import { getRequestFromOperation as te } from "@scalar/oas-utils/spec-getters";
|
|
5
5
|
import { asyncComputed as oe } from "@vueuse/core";
|
|
6
6
|
import B from "../../components/ScreenReader.vue.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import ae from "./ExamplePicker.vue.js";
|
|
8
|
+
import re from "./TextSelect.vue.js";
|
|
9
9
|
/* empty css */
|
|
10
10
|
import { GLOBAL_SECURITY_SYMBOL as le } from "../../helpers/provideSymbols.js";
|
|
11
11
|
import N from "../../components/Card/Card.vue.js";
|
|
@@ -14,8 +14,8 @@ import T from "../../components/HttpMethod/HttpMethod.vue.js";
|
|
|
14
14
|
import j from "../../components/Card/CardContent.vue.js";
|
|
15
15
|
import { getSecretCredentialsFromAuthentication as ne, getRequestFromAuthentication as ie } from "../../legacy/helpers/getRequestFromAuthentication.js";
|
|
16
16
|
import ue from "../../components/Card/CardFooter.vue.js";
|
|
17
|
-
import { getExampleCode as
|
|
18
|
-
import { useHttpClientStore as
|
|
17
|
+
import { getExampleCode as me } from "../../helpers/getExampleCode.js";
|
|
18
|
+
import { useHttpClientStore as ce } from "../../stores/useHttpClientStore.js";
|
|
19
19
|
import { useServerStore as pe } from "../../legacy/stores/useServerStore.js";
|
|
20
20
|
import { useAuthenticationStore as de } from "../../legacy/stores/useAuthenticationStore.js";
|
|
21
21
|
import { getHarRequest as fe } from "../../helpers/getHarRequest.js";
|
|
@@ -30,58 +30,58 @@ const ve = ["id"], he = ["id"], ge = {
|
|
|
30
30
|
fallback: { type: Boolean }
|
|
31
31
|
},
|
|
32
32
|
setup(F) {
|
|
33
|
-
const
|
|
34
|
-
|
|
33
|
+
const i = F, k = `components-Content-Operation-Example-Request${Z(
|
|
34
|
+
i.operation.path + i.operation.httpVerb + i.operation.operationId
|
|
35
35
|
)}`, E = O(), {
|
|
36
|
-
httpClient:
|
|
36
|
+
httpClient: u,
|
|
37
37
|
setHttpClient: w,
|
|
38
38
|
availableTargets: b,
|
|
39
39
|
httpTargetTitle: A,
|
|
40
40
|
httpClientTitle: J
|
|
41
|
-
} =
|
|
41
|
+
} = ce(), { server: U } = pe(), { authentication: q } = de(), v = D(), m = d(() => {
|
|
42
42
|
var t;
|
|
43
43
|
const e = ["x-custom-examples", "x-codeSamples", "x-code-samples"];
|
|
44
44
|
for (const o of e)
|
|
45
|
-
if ((t =
|
|
46
|
-
return
|
|
45
|
+
if ((t = i.operation.information) != null && t[o])
|
|
46
|
+
return [...i.operation.information[o]];
|
|
47
47
|
return [];
|
|
48
48
|
}), s = O(
|
|
49
49
|
// Default to first custom example
|
|
50
|
-
|
|
50
|
+
m.value.length ? {
|
|
51
51
|
targetKey: "customExamples",
|
|
52
52
|
clientKey: 0
|
|
53
53
|
} : (
|
|
54
54
|
// Otherwise use the globally selected HTTP client
|
|
55
55
|
{
|
|
56
|
-
targetKey:
|
|
57
|
-
clientKey:
|
|
56
|
+
targetKey: u.targetKey,
|
|
57
|
+
clientKey: u.clientKey
|
|
58
58
|
}
|
|
59
59
|
)
|
|
60
60
|
);
|
|
61
|
-
z(
|
|
61
|
+
z(u, () => {
|
|
62
62
|
s.value = {
|
|
63
|
-
targetKey:
|
|
64
|
-
clientKey:
|
|
63
|
+
targetKey: u.targetKey,
|
|
64
|
+
clientKey: u.clientKey
|
|
65
65
|
};
|
|
66
66
|
});
|
|
67
67
|
const _ = d(
|
|
68
68
|
() => {
|
|
69
|
-
var e, t, o,
|
|
69
|
+
var e, t, o, n;
|
|
70
70
|
return Object.keys(
|
|
71
|
-
((
|
|
71
|
+
((n = (o = (t = (e = i.operation.information) == null ? void 0 : e.requestBody) == null ? void 0 : t.content) == null ? void 0 : o["application/json"]) == null ? void 0 : n.examples) ?? {}
|
|
72
72
|
).length > 1;
|
|
73
73
|
}
|
|
74
74
|
), h = G(le);
|
|
75
75
|
async function V() {
|
|
76
|
-
var
|
|
76
|
+
var n, p;
|
|
77
77
|
if (s.value.targetKey === "customExamples")
|
|
78
|
-
return ((
|
|
78
|
+
return ((n = m.value[s.value.clientKey]) == null ? void 0 : n.source) ?? "";
|
|
79
79
|
const e = fe(
|
|
80
80
|
{
|
|
81
81
|
url: ye(U)
|
|
82
82
|
},
|
|
83
83
|
te(
|
|
84
|
-
|
|
84
|
+
i.operation,
|
|
85
85
|
{
|
|
86
86
|
replaceVariables: !0
|
|
87
87
|
},
|
|
@@ -89,10 +89,10 @@ const ve = ["id"], he = ["id"], ge = {
|
|
|
89
89
|
),
|
|
90
90
|
ie(
|
|
91
91
|
q,
|
|
92
|
-
((p =
|
|
92
|
+
((p = i.operation.information) == null ? void 0 : p.security) ?? (h == null ? void 0 : h())
|
|
93
93
|
)
|
|
94
|
-
), t =
|
|
95
|
-
return await
|
|
94
|
+
), t = u.clientKey, o = u.targetKey;
|
|
95
|
+
return await me(e, o, t) ?? "";
|
|
96
96
|
}
|
|
97
97
|
const $ = oe(async () => {
|
|
98
98
|
try {
|
|
@@ -109,9 +109,9 @@ const ve = ["id"], he = ["id"], ge = {
|
|
|
109
109
|
var t, o;
|
|
110
110
|
const e = (
|
|
111
111
|
// Specified language
|
|
112
|
-
((t = s.value) == null ? void 0 : t.targetKey) === "customExamples" ? ((o =
|
|
112
|
+
((t = s.value) == null ? void 0 : t.targetKey) === "customExamples" ? ((o = m.value[s.value.clientKey]) == null ? void 0 : o.lang) ?? "plaintext" : (
|
|
113
113
|
// Or language for the globally selected HTTP client
|
|
114
|
-
|
|
114
|
+
u.targetKey
|
|
115
115
|
)
|
|
116
116
|
);
|
|
117
117
|
return e === "shell" && $.value.includes("curl") ? "curl" : e === "Objective-C" ? "objc" : e;
|
|
@@ -127,10 +127,10 @@ const ve = ["id"], he = ["id"], ge = {
|
|
|
127
127
|
label: o.title
|
|
128
128
|
}))
|
|
129
129
|
}));
|
|
130
|
-
return
|
|
130
|
+
return m.value.length && e.unshift({
|
|
131
131
|
value: "customExamples",
|
|
132
132
|
label: "Examples",
|
|
133
|
-
options:
|
|
133
|
+
options: m.value.map((t, o) => ({
|
|
134
134
|
value: JSON.stringify({
|
|
135
135
|
targetKey: "customExamples",
|
|
136
136
|
clientKey: o
|
|
@@ -143,48 +143,48 @@ const ve = ["id"], he = ["id"], ge = {
|
|
|
143
143
|
const t = JSON.parse(e);
|
|
144
144
|
t.targetKey === "customExamples" ? s.value = t : w(t);
|
|
145
145
|
}
|
|
146
|
-
return (e, t) =>
|
|
146
|
+
return (e, t) => a(b).length || m.value.length ? (c(), g(a(N), {
|
|
147
147
|
key: 0,
|
|
148
148
|
class: "dark-mode"
|
|
149
149
|
}, {
|
|
150
|
-
default:
|
|
151
|
-
l(
|
|
152
|
-
actions:
|
|
153
|
-
l(
|
|
150
|
+
default: r(() => [
|
|
151
|
+
l(a(se), { muted: "" }, {
|
|
152
|
+
actions: r(() => [
|
|
153
|
+
l(re, {
|
|
154
154
|
class: "request-client-picker",
|
|
155
|
-
controls: `${
|
|
155
|
+
controls: `${a(v)}-example`,
|
|
156
156
|
modelValue: JSON.stringify(s.value),
|
|
157
157
|
options: L.value,
|
|
158
158
|
"onUpdate:modelValue": P
|
|
159
159
|
}, {
|
|
160
|
-
default:
|
|
161
|
-
s.value.targetKey === "customExamples" ? (
|
|
160
|
+
default: r(() => [
|
|
161
|
+
s.value.targetKey === "customExamples" ? (c(), K(R, { key: 0 }, [
|
|
162
162
|
l(B, null, {
|
|
163
|
-
default:
|
|
163
|
+
default: r(() => t[1] || (t[1] = [
|
|
164
164
|
f("Selected Example:")
|
|
165
165
|
])),
|
|
166
166
|
_: 1
|
|
167
167
|
}),
|
|
168
|
-
f(" " + S(
|
|
169
|
-
], 64)) : (
|
|
168
|
+
f(" " + S(m.value[s.value.clientKey].label ?? "Example"), 1)
|
|
169
|
+
], 64)) : (c(), K(R, { key: 1 }, [
|
|
170
170
|
l(B, null, {
|
|
171
|
-
default:
|
|
171
|
+
default: r(() => t[2] || (t[2] = [
|
|
172
172
|
f("Selected HTTP client:")
|
|
173
173
|
])),
|
|
174
174
|
_: 1
|
|
175
175
|
}),
|
|
176
|
-
f(" " + S(
|
|
176
|
+
f(" " + S(a(A)) + " " + S(a(J)), 1)
|
|
177
177
|
], 64))
|
|
178
178
|
]),
|
|
179
179
|
_: 1
|
|
180
180
|
}, 8, ["controls", "modelValue", "options"])
|
|
181
181
|
]),
|
|
182
|
-
default:
|
|
182
|
+
default: r(() => [
|
|
183
183
|
x("div", {
|
|
184
|
-
id: `${
|
|
184
|
+
id: `${a(v)}-header`,
|
|
185
185
|
class: "request-header"
|
|
186
186
|
}, [
|
|
187
|
-
l(
|
|
187
|
+
l(a(T), {
|
|
188
188
|
as: "span",
|
|
189
189
|
class: "request-method",
|
|
190
190
|
method: e.operation.httpVerb
|
|
@@ -194,20 +194,20 @@ const ve = ["id"], he = ["id"], ge = {
|
|
|
194
194
|
]),
|
|
195
195
|
_: 3
|
|
196
196
|
}),
|
|
197
|
-
l(
|
|
197
|
+
l(a(j), {
|
|
198
198
|
borderless: "",
|
|
199
199
|
class: "request-editor-section custom-scroll",
|
|
200
200
|
frameless: ""
|
|
201
201
|
}, {
|
|
202
|
-
default:
|
|
202
|
+
default: r(() => [
|
|
203
203
|
x("div", {
|
|
204
|
-
id: `${
|
|
204
|
+
id: `${a(v)}-example`,
|
|
205
205
|
class: "code-snippet"
|
|
206
206
|
}, [
|
|
207
|
-
l(
|
|
207
|
+
l(a(X), {
|
|
208
208
|
class: "bg-b-2",
|
|
209
|
-
content:
|
|
210
|
-
hideCredentials:
|
|
209
|
+
content: a($),
|
|
210
|
+
hideCredentials: a(ne)(a(q)),
|
|
211
211
|
lang: I.value,
|
|
212
212
|
lineNumbers: ""
|
|
213
213
|
}, null, 8, ["content", "hideCredentials", "lang"])
|
|
@@ -215,18 +215,18 @@ const ve = ["id"], he = ["id"], ge = {
|
|
|
215
215
|
]),
|
|
216
216
|
_: 1
|
|
217
217
|
}),
|
|
218
|
-
_.value || e.$slots.footer ? (
|
|
218
|
+
_.value || e.$slots.footer ? (c(), g(a(ue), {
|
|
219
219
|
key: 0,
|
|
220
220
|
class: "request-card-footer",
|
|
221
221
|
contrast: ""
|
|
222
222
|
}, {
|
|
223
|
-
default:
|
|
224
|
-
var o,
|
|
223
|
+
default: r(() => {
|
|
224
|
+
var o, n, p, H;
|
|
225
225
|
return [
|
|
226
|
-
_.value ? (
|
|
227
|
-
l(
|
|
226
|
+
_.value ? (c(), K("div", ge, [
|
|
227
|
+
l(ae, {
|
|
228
228
|
class: "request-example-selector",
|
|
229
|
-
examples: ((H = (p = (
|
|
229
|
+
examples: ((H = (p = (n = (o = e.operation.information) == null ? void 0 : o.requestBody) == null ? void 0 : n.content) == null ? void 0 : p["application/json"]) == null ? void 0 : H.examples) ?? [],
|
|
230
230
|
"onUpdate:modelValue": t[0] || (t[0] = (M) => E.value = M)
|
|
231
231
|
}, null, 8, ["examples"])
|
|
232
232
|
])) : C("", !0),
|
|
@@ -237,15 +237,15 @@ const ve = ["id"], he = ["id"], ge = {
|
|
|
237
237
|
})) : C("", !0)
|
|
238
238
|
]),
|
|
239
239
|
_: 3
|
|
240
|
-
})) : e.fallback ? (
|
|
240
|
+
})) : e.fallback ? (c(), g(a(N), {
|
|
241
241
|
key: 1,
|
|
242
242
|
class: "dark-mode"
|
|
243
243
|
}, {
|
|
244
|
-
default:
|
|
245
|
-
l(
|
|
246
|
-
default:
|
|
244
|
+
default: r(() => [
|
|
245
|
+
l(a(j), { class: "request-card-simple" }, {
|
|
246
|
+
default: r(() => [
|
|
247
247
|
x("div", Ke, [
|
|
248
|
-
l(
|
|
248
|
+
l(a(T), {
|
|
249
249
|
as: "span",
|
|
250
250
|
class: "request-method",
|
|
251
251
|
method: e.operation.httpVerb
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextSelect.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ExampleRequest/TextSelect.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextSelect.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ExampleRequest/TextSelect.vue"],"names":[],"mappings":"AA0JA,iBAAS,cAAc;qBA6CM,GAAG;EAkB/B;AACD,QAAA,MAAM,eAAe;gBA7FP,GAAG;aACN;QACP,KAAK,EAAE,MAAM,CAAA;QACb,KAAK,EAAE,MAAM,CAAA;QACb,OAAO,CAAC,EAAE;YACR,KAAK,EAAE,MAAM,CAAA;YACb,KAAK,EAAE,MAAM,CAAA;SACd,EAAE,CAAA;KACJ,EAAE;eACQ,MAAM;;;;gBATL,GAAG;aACN;QACP,KAAK,EAAE,MAAM,CAAA;QACb,KAAK,EAAE,MAAM,CAAA;QACb,OAAO,CAAC,EAAE;YACR,KAAK,EAAE,MAAM,CAAA;YACb,KAAK,EAAE,MAAM,CAAA;SACd,EAAE,CAAA;KACJ,EAAE;eACQ,MAAM;;;kFA6FjB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as m, computed as v, openBlock as l, createElementBlock as o, normalizeClass as b, createElementVNode as u, renderSlot as _, Fragment as s, renderList as r, toDisplayString as p } from "vue";
|
|
2
|
+
const g = { class: "text-select-label" }, f = ["aria-controls", "tabindex", "value"], k = ["label"], y = ["value"], V = ["value"], S = /* @__PURE__ */ m({
|
|
3
3
|
__name: "TextSelect",
|
|
4
4
|
props: {
|
|
5
5
|
modelValue: {},
|
|
@@ -7,39 +7,42 @@ const c = { class: "text-select-label" }, v = ["aria-controls", "tabindex", "val
|
|
|
7
7
|
controls: {}
|
|
8
8
|
},
|
|
9
9
|
emits: ["update:modelValue"],
|
|
10
|
-
setup(
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
setup(i) {
|
|
11
|
+
const d = i, c = v(
|
|
12
|
+
() => d.options.flatMap((e) => e.options ?? e).length
|
|
13
|
+
);
|
|
14
|
+
return (e, n) => (l(), o("label", {
|
|
15
|
+
class: b(["text-select", c.value === 1 ? "text-select--single-option" : ""])
|
|
13
16
|
}, [
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
u("span", g, [
|
|
18
|
+
_(e.$slots, "default")
|
|
16
19
|
]),
|
|
17
|
-
|
|
18
|
-
"aria-controls":
|
|
19
|
-
tabindex:
|
|
20
|
-
value:
|
|
21
|
-
onInput: n[0] || (n[0] = (
|
|
20
|
+
u("select", {
|
|
21
|
+
"aria-controls": e.controls,
|
|
22
|
+
tabindex: e.options.length === 1 ? -1 : 0,
|
|
23
|
+
value: e.modelValue,
|
|
24
|
+
onInput: n[0] || (n[0] = (t) => e.$emit("update:modelValue", t.target.value))
|
|
22
25
|
}, [
|
|
23
|
-
(
|
|
24
|
-
key:
|
|
26
|
+
(l(!0), o(s, null, r(e.options, (t) => (l(), o(s, {
|
|
27
|
+
key: t.value
|
|
25
28
|
}, [
|
|
26
|
-
|
|
29
|
+
t.options ? (l(), o("optgroup", {
|
|
27
30
|
key: 0,
|
|
28
|
-
label:
|
|
31
|
+
label: t.label
|
|
29
32
|
}, [
|
|
30
|
-
(
|
|
33
|
+
(l(!0), o(s, null, r(t.options, (a) => (l(), o("option", {
|
|
31
34
|
key: a.value,
|
|
32
35
|
value: a.value
|
|
33
|
-
},
|
|
34
|
-
], 8,
|
|
35
|
-
key:
|
|
36
|
-
value:
|
|
37
|
-
},
|
|
36
|
+
}, p(a.label), 9, y))), 128))
|
|
37
|
+
], 8, k)) : (l(), o("option", {
|
|
38
|
+
key: t.value,
|
|
39
|
+
value: t.value
|
|
40
|
+
}, p(t.label), 9, V))
|
|
38
41
|
], 64))), 128))
|
|
39
|
-
], 40,
|
|
42
|
+
], 40, f)
|
|
40
43
|
], 2));
|
|
41
44
|
}
|
|
42
45
|
});
|
|
43
46
|
export {
|
|
44
|
-
|
|
47
|
+
S as default
|
|
45
48
|
};
|