@scalar/api-reference 1.25.65 → 1.25.67
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 +30 -0
- package/dist/browser/standalone.js +14164 -14242
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReference.vue.js +21 -21
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js +3 -3
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +7 -10
- package/dist/components/Layouts/ModernLayout.vue.js +2 -2
- package/dist/components/Layouts/ModernLayout.vue2.js +16 -16
- package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/features/ApiClientModal/ApiClientModal.vue.js +25 -22
- package/dist/features/ApiClientModal/useApiClient.d.ts +2 -0
- package/dist/features/ApiClientModal/useApiClient.d.ts.map +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 +71 -70
- package/dist/index.js +1 -1
- package/dist/legacy/stores/index.d.ts +1 -0
- package/dist/legacy/stores/index.d.ts.map +1 -1
- package/dist/legacy/stores/useExampleStore.d.ts +5 -0
- package/dist/legacy/stores/useExampleStore.d.ts.map +1 -0
- package/dist/legacy/stores/useExampleStore.js +8 -0
- package/dist/style.css +1 -1
- package/package.json +11 -11
|
@@ -1,51 +1,52 @@
|
|
|
1
|
-
import { defineComponent as Y,
|
|
2
|
-
import { ScalarCodeBlock as
|
|
3
|
-
import { createHash as
|
|
4
|
-
import { getRequestFromOperation as
|
|
5
|
-
import { asyncComputed as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
1
|
+
import { defineComponent as Y, useId as D, computed as d, ref as z, watch as G, inject as Q, onServerPrefetch as W, useSSRContext as X, unref as r, openBlock as p, createBlock as g, withCtx as a, createVNode as l, createElementBlock as S, Fragment as O, createTextVNode as f, toDisplayString as K, createElementVNode as x, renderSlot as y, createCommentVNode as C } from "vue";
|
|
2
|
+
import { ScalarCodeBlock as Z } from "@scalar/components";
|
|
3
|
+
import { createHash as ee, ssrState as te } from "@scalar/oas-utils/helpers";
|
|
4
|
+
import { getRequestFromOperation as oe } from "@scalar/oas-utils/spec-getters";
|
|
5
|
+
import { asyncComputed as re } from "@vueuse/core";
|
|
6
|
+
import R from "../../components/ScreenReader.vue.js";
|
|
7
|
+
import ae from "./ExamplePicker.vue.js";
|
|
8
|
+
import le from "./TextSelect.vue.js";
|
|
9
9
|
/* empty css */
|
|
10
|
-
import { GLOBAL_SECURITY_SYMBOL as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { getSecretCredentialsFromAuthentication as
|
|
16
|
-
import
|
|
17
|
-
import { getExampleCode as
|
|
10
|
+
import { GLOBAL_SECURITY_SYMBOL as se } from "../../helpers/provideSymbols.js";
|
|
11
|
+
import B from "../../components/Card/Card.vue.js";
|
|
12
|
+
import ne from "../../components/Card/CardHeader.vue.js";
|
|
13
|
+
import N from "../../components/HttpMethod/HttpMethod.vue.js";
|
|
14
|
+
import T from "../../components/Card/CardContent.vue.js";
|
|
15
|
+
import { getSecretCredentialsFromAuthentication as ie, getRequestFromAuthentication as ue } from "../../legacy/helpers/getRequestFromAuthentication.js";
|
|
16
|
+
import me from "../../components/Card/CardFooter.vue.js";
|
|
17
|
+
import { getExampleCode as pe } from "../../helpers/getExampleCode.js";
|
|
18
18
|
import { useHttpClientStore as ce } from "../../stores/useHttpClientStore.js";
|
|
19
|
-
import { useServerStore as
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
|
|
19
|
+
import { useServerStore as de } from "../../legacy/stores/useServerStore.js";
|
|
20
|
+
import { useExampleStore as fe } from "../../legacy/stores/useExampleStore.js";
|
|
21
|
+
import { useAuthenticationStore as ye } from "../../legacy/stores/useAuthenticationStore.js";
|
|
22
|
+
import { getHarRequest as ve } from "../../helpers/getHarRequest.js";
|
|
23
|
+
import { getUrlFromServerState as he } from "../../legacy/helpers/getUrlFromServerState.js";
|
|
24
|
+
const ge = ["id"], Se = ["id"], Ke = {
|
|
24
25
|
key: 0,
|
|
25
26
|
class: "request-card-footer-addon"
|
|
26
|
-
},
|
|
27
|
+
}, xe = { class: "request-header" }, Ye = /* @__PURE__ */ Y({
|
|
27
28
|
__name: "ExampleRequest",
|
|
28
29
|
props: {
|
|
29
30
|
operation: {},
|
|
30
31
|
fallback: { type: Boolean }
|
|
31
32
|
},
|
|
32
|
-
setup(
|
|
33
|
-
const i =
|
|
33
|
+
setup(j) {
|
|
34
|
+
const i = j, k = `components-Content-Operation-Example-Request${ee(
|
|
34
35
|
i.operation.path + i.operation.httpVerb + i.operation.operationId
|
|
35
|
-
)}`, E =
|
|
36
|
+
)}`, { selectedExampleKey: E, operationId: F } = fe(), {
|
|
36
37
|
httpClient: u,
|
|
37
38
|
setHttpClient: w,
|
|
38
39
|
availableTargets: b,
|
|
39
|
-
httpTargetTitle:
|
|
40
|
-
httpClientTitle:
|
|
41
|
-
} = ce(), { server:
|
|
40
|
+
httpTargetTitle: I,
|
|
41
|
+
httpClientTitle: U
|
|
42
|
+
} = ce(), { server: A } = de(), { authentication: q } = ye(), v = D(), m = d(() => {
|
|
42
43
|
var t;
|
|
43
44
|
const e = ["x-custom-examples", "x-codeSamples", "x-code-samples"];
|
|
44
45
|
for (const o of e)
|
|
45
46
|
if ((t = i.operation.information) != null && t[o])
|
|
46
47
|
return [...i.operation.information[o]];
|
|
47
48
|
return [];
|
|
48
|
-
}), s =
|
|
49
|
+
}), s = z(
|
|
49
50
|
// Default to first custom example
|
|
50
51
|
m.value.length ? {
|
|
51
52
|
targetKey: "customExamples",
|
|
@@ -58,7 +59,7 @@ const ve = ["id"], he = ["id"], ge = {
|
|
|
58
59
|
}
|
|
59
60
|
)
|
|
60
61
|
);
|
|
61
|
-
|
|
62
|
+
G(u, () => {
|
|
62
63
|
s.value = {
|
|
63
64
|
targetKey: u.targetKey,
|
|
64
65
|
clientKey: u.clientKey
|
|
@@ -71,16 +72,16 @@ const ve = ["id"], he = ["id"], ge = {
|
|
|
71
72
|
((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
73
|
).length > 1;
|
|
73
74
|
}
|
|
74
|
-
), h =
|
|
75
|
+
), h = Q(se);
|
|
75
76
|
async function V() {
|
|
76
|
-
var n,
|
|
77
|
+
var n, c;
|
|
77
78
|
if (s.value.targetKey === "customExamples")
|
|
78
79
|
return ((n = m.value[s.value.clientKey]) == null ? void 0 : n.source) ?? "";
|
|
79
|
-
const e =
|
|
80
|
+
const e = ve(
|
|
80
81
|
{
|
|
81
|
-
url:
|
|
82
|
+
url: he(A).modifiedUrl
|
|
82
83
|
},
|
|
83
|
-
|
|
84
|
+
oe(
|
|
84
85
|
i.operation,
|
|
85
86
|
{
|
|
86
87
|
replaceVariables: !0
|
|
@@ -88,25 +89,25 @@ const ve = ["id"], he = ["id"], ge = {
|
|
|
88
89
|
E.value,
|
|
89
90
|
!0
|
|
90
91
|
),
|
|
91
|
-
|
|
92
|
+
ue(
|
|
92
93
|
q,
|
|
93
|
-
((
|
|
94
|
+
((c = i.operation.information) == null ? void 0 : c.security) ?? (h == null ? void 0 : h())
|
|
94
95
|
)
|
|
95
96
|
), t = u.clientKey, o = u.targetKey;
|
|
96
|
-
return await
|
|
97
|
+
return await pe(e, o, t) ?? "";
|
|
97
98
|
}
|
|
98
|
-
const $ =
|
|
99
|
+
const $ = re(async () => {
|
|
99
100
|
try {
|
|
100
101
|
return await V();
|
|
101
102
|
} catch (e) {
|
|
102
103
|
return console.error("[generateSnippet]", e), "";
|
|
103
104
|
}
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
const e =
|
|
105
|
+
}, te[k] ?? "");
|
|
106
|
+
W(async () => {
|
|
107
|
+
const e = X();
|
|
107
108
|
e.payload.data[k] = await V();
|
|
108
109
|
});
|
|
109
|
-
const
|
|
110
|
+
const J = d(() => {
|
|
110
111
|
var t, o;
|
|
111
112
|
const e = (
|
|
112
113
|
// Specified language
|
|
@@ -144,14 +145,14 @@ const ve = ["id"], he = ["id"], ge = {
|
|
|
144
145
|
const t = JSON.parse(e);
|
|
145
146
|
t.targetKey === "customExamples" ? s.value = t : w(t);
|
|
146
147
|
}
|
|
147
|
-
return (e, t) => r(b).length || m.value.length ? (
|
|
148
|
+
return (e, t) => r(b).length || m.value.length ? (p(), g(r(B), {
|
|
148
149
|
key: 0,
|
|
149
150
|
class: "dark-mode"
|
|
150
151
|
}, {
|
|
151
152
|
default: a(() => [
|
|
152
|
-
l(r(
|
|
153
|
+
l(r(ne), { muted: "" }, {
|
|
153
154
|
actions: a(() => [
|
|
154
|
-
l(
|
|
155
|
+
l(le, {
|
|
155
156
|
class: "request-client-picker",
|
|
156
157
|
controls: `${r(v)}-example`,
|
|
157
158
|
modelValue: JSON.stringify(s.value),
|
|
@@ -159,22 +160,22 @@ const ve = ["id"], he = ["id"], ge = {
|
|
|
159
160
|
"onUpdate:modelValue": P
|
|
160
161
|
}, {
|
|
161
162
|
default: a(() => [
|
|
162
|
-
s.value.targetKey === "customExamples" ? (
|
|
163
|
-
l(
|
|
163
|
+
s.value.targetKey === "customExamples" ? (p(), S(O, { key: 0 }, [
|
|
164
|
+
l(R, null, {
|
|
164
165
|
default: a(() => t[1] || (t[1] = [
|
|
165
166
|
f("Selected Example:")
|
|
166
167
|
])),
|
|
167
168
|
_: 1
|
|
168
169
|
}),
|
|
169
|
-
f(" " +
|
|
170
|
-
], 64)) : (
|
|
171
|
-
l(
|
|
170
|
+
f(" " + K(m.value[s.value.clientKey].label ?? "Example"), 1)
|
|
171
|
+
], 64)) : (p(), S(O, { key: 1 }, [
|
|
172
|
+
l(R, null, {
|
|
172
173
|
default: a(() => t[2] || (t[2] = [
|
|
173
174
|
f("Selected HTTP client:")
|
|
174
175
|
])),
|
|
175
176
|
_: 1
|
|
176
177
|
}),
|
|
177
|
-
f(" " +
|
|
178
|
+
f(" " + K(r(I)) + " " + K(r(U)), 1)
|
|
178
179
|
], 64))
|
|
179
180
|
]),
|
|
180
181
|
_: 1
|
|
@@ -185,17 +186,17 @@ const ve = ["id"], he = ["id"], ge = {
|
|
|
185
186
|
id: `${r(v)}-header`,
|
|
186
187
|
class: "request-header"
|
|
187
188
|
}, [
|
|
188
|
-
l(r(
|
|
189
|
+
l(r(N), {
|
|
189
190
|
as: "span",
|
|
190
191
|
class: "request-method",
|
|
191
192
|
method: e.operation.httpVerb
|
|
192
193
|
}, null, 8, ["method"]),
|
|
193
194
|
y(e.$slots, "header", {}, void 0, !0)
|
|
194
|
-
], 8,
|
|
195
|
+
], 8, ge)
|
|
195
196
|
]),
|
|
196
197
|
_: 3
|
|
197
198
|
}),
|
|
198
|
-
l(r(
|
|
199
|
+
l(r(T), {
|
|
199
200
|
borderless: "",
|
|
200
201
|
class: "request-editor-section custom-scroll",
|
|
201
202
|
frameless: ""
|
|
@@ -205,30 +206,30 @@ const ve = ["id"], he = ["id"], ge = {
|
|
|
205
206
|
id: `${r(v)}-example`,
|
|
206
207
|
class: "code-snippet"
|
|
207
208
|
}, [
|
|
208
|
-
l(r(
|
|
209
|
+
l(r(Z), {
|
|
209
210
|
class: "bg-b-2",
|
|
210
211
|
content: r($),
|
|
211
|
-
hideCredentials: r(
|
|
212
|
-
lang:
|
|
212
|
+
hideCredentials: r(ie)(r(q)),
|
|
213
|
+
lang: J.value,
|
|
213
214
|
lineNumbers: ""
|
|
214
215
|
}, null, 8, ["content", "hideCredentials", "lang"])
|
|
215
|
-
], 8,
|
|
216
|
+
], 8, Se)
|
|
216
217
|
]),
|
|
217
218
|
_: 1
|
|
218
219
|
}),
|
|
219
|
-
_.value || e.$slots.footer ? (
|
|
220
|
+
_.value || e.$slots.footer ? (p(), g(r(me), {
|
|
220
221
|
key: 0,
|
|
221
222
|
class: "request-card-footer",
|
|
222
223
|
contrast: ""
|
|
223
224
|
}, {
|
|
224
225
|
default: a(() => {
|
|
225
|
-
var o, n,
|
|
226
|
+
var o, n, c, H;
|
|
226
227
|
return [
|
|
227
|
-
_.value ? (
|
|
228
|
-
l(
|
|
228
|
+
_.value ? (p(), S("div", Ke, [
|
|
229
|
+
l(ae, {
|
|
229
230
|
class: "request-example-selector",
|
|
230
|
-
examples: ((H = (
|
|
231
|
-
"onUpdate:modelValue": t[0] || (t[0] = (M) => E.value = M)
|
|
231
|
+
examples: ((H = (c = (n = (o = e.operation.information) == null ? void 0 : o.requestBody) == null ? void 0 : n.content) == null ? void 0 : c["application/json"]) == null ? void 0 : H.examples) ?? [],
|
|
232
|
+
"onUpdate:modelValue": t[0] || (t[0] = (M) => (E.value = M, F.value = e.operation.operationId))
|
|
232
233
|
}, null, 8, ["examples"])
|
|
233
234
|
])) : C("", !0),
|
|
234
235
|
y(e.$slots, "footer", {}, void 0, !0)
|
|
@@ -238,15 +239,15 @@ const ve = ["id"], he = ["id"], ge = {
|
|
|
238
239
|
})) : C("", !0)
|
|
239
240
|
]),
|
|
240
241
|
_: 3
|
|
241
|
-
})) : e.fallback ? (
|
|
242
|
+
})) : e.fallback ? (p(), g(r(B), {
|
|
242
243
|
key: 1,
|
|
243
244
|
class: "dark-mode"
|
|
244
245
|
}, {
|
|
245
246
|
default: a(() => [
|
|
246
|
-
l(r(
|
|
247
|
+
l(r(T), { class: "request-card-simple" }, {
|
|
247
248
|
default: a(() => [
|
|
248
|
-
x("div",
|
|
249
|
-
l(r(
|
|
249
|
+
x("div", xe, [
|
|
250
|
+
l(r(N), {
|
|
250
251
|
as: "span",
|
|
251
252
|
class: "request-method",
|
|
252
253
|
method: e.operation.httpVerb
|
|
@@ -263,5 +264,5 @@ const ve = ["id"], he = ["id"], ge = {
|
|
|
263
264
|
}
|
|
264
265
|
});
|
|
265
266
|
export {
|
|
266
|
-
|
|
267
|
+
Ye as default
|
|
267
268
|
};
|