@scalar/api-reference 1.32.5 → 1.32.7
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 +50 -0
- package/dist/browser/standalone.js +9924 -9851
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReference.vue.d.ts.map +1 -1
- package/dist/components/ApiReference.vue.js +8 -8
- package/dist/components/Badge/Badge.vue.js +1 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +1 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +28 -26
- package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.js +2 -2
- package/dist/components/Content/Schema/Schema.vue2.js +97 -156
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.d.ts +7 -0
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.d.ts.map +1 -0
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.js +7 -0
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue2.js +25 -0
- package/dist/components/Content/Schema/SchemaEnumValues.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaEnumValues.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaEnumValues.vue2.js +73 -90
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts +21 -0
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -0
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +92 -0
- package/dist/components/Content/Schema/SchemaObjectProperties.vue2.js +4 -0
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +1 -2
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaProperty.vue2.js +54 -55
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue2.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts +0 -2
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +81 -97
- package/dist/components/Content/Schema/helpers/{formatExample.d.ts → format-example.d.ts} +1 -1
- package/dist/components/Content/Schema/helpers/format-example.d.ts.map +1 -0
- package/dist/components/Content/Schema/helpers/is-type-object.d.ts +3 -0
- package/dist/components/Content/Schema/helpers/is-type-object.d.ts.map +1 -0
- package/dist/components/Content/Schema/helpers/is-type-object.js +17 -0
- package/dist/components/Content/Schema/helpers/{optimizeValueForDisplay.d.ts → optimize-value-for-display.d.ts} +1 -1
- package/dist/components/Content/Schema/helpers/optimize-value-for-display.d.ts.map +1 -0
- package/dist/components/Content/Tag/OperationsListItem.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/OperationsListItem.vue.js +2 -2
- package/dist/components/Content/Tag/OperationsListItem.vue2.js +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +4 -2
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ClassicLayout.vue2.js +8 -8
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +4 -2
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +30 -30
- package/dist/features/api-client-modal/useApiClient.d.ts +84 -4
- package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -1
- package/dist/features/download-link/DownloadLink.vue.d.ts.map +1 -1
- package/dist/features/download-link/DownloadLink.vue.js +1 -1
- package/dist/features/example-request/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/features/example-request/ExampleRequest.vue.js +1 -1
- package/dist/features/example-request/ExampleRequest.vue2.js +126 -124
- package/dist/features/example-responses/ExampleResponse.vue.js +2 -2
- package/dist/features/example-responses/ExampleResponses.vue.js +2 -2
- package/dist/features/sidebar/components/SidebarElement.vue.d.ts.map +1 -1
- package/dist/features/sidebar/components/SidebarElement.vue.js +2 -2
- package/dist/features/sidebar/components/SidebarElement.vue2.js +16 -15
- package/dist/helpers/convert-security-scheme.d.ts +9 -0
- package/dist/helpers/convert-security-scheme.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/libs/openapi.d.ts +0 -13
- package/dist/libs/openapi.d.ts.map +1 -1
- package/dist/libs/openapi.js +49 -63
- package/dist/stores/useHttpClientStore.js +20 -20
- package/dist/style.css +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.js +84 -75
- package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue.d.ts +19 -0
- package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts +21 -72
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.d.ts +4 -2
- package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.js +5 -0
- package/dist/v2/blocks/scalar-request-example-block/index.d.ts +1 -0
- package/dist/v2/blocks/scalar-request-example-block/index.d.ts.map +1 -1
- package/dist/v2/events/definitions.d.ts +13 -4
- package/dist/v2/events/definitions.d.ts.map +1 -1
- package/dist/v2/hooks/useStore.d.ts +9 -0
- package/dist/v2/hooks/useStore.d.ts.map +1 -0
- package/package.json +13 -12
- package/dist/components/Content/Schema/helpers/formatExample.d.ts.map +0 -1
- package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.d.ts.map +0 -1
- /package/dist/components/Content/Schema/helpers/{formatExample.js → format-example.js} +0 -0
- /package/dist/components/Content/Schema/helpers/{optimizeValueForDisplay.js → optimize-value-for-display.js} +0 -0
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useWorkspace as
|
|
3
|
-
import { getHarRequest as
|
|
4
|
-
import { filterSecurityRequirements as
|
|
5
|
-
import { ScalarCodeBlock as
|
|
6
|
-
import { freezeElement as
|
|
7
|
-
import { requestSchema as
|
|
8
|
-
import { isDereferenced as
|
|
9
|
-
import
|
|
10
|
-
import { useConfig as
|
|
11
|
-
import { EXAMPLE_CONTEXT as
|
|
12
|
-
import { useHttpClientStore as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
1
|
+
import { defineComponent as ye, useId as ve, ref as w, inject as Y, computed as c, watch as Z, onMounted as ge, createBlock as J, createCommentVNode as U, unref as r, openBlock as g, withCtx as s, createVNode as n, createElementVNode as D, renderSlot as T, createTextVNode as b, createElementBlock as H, Fragment as _, toDisplayString as I } from "vue";
|
|
2
|
+
import { useWorkspace as xe } from "@scalar/api-client/store";
|
|
3
|
+
import { getHarRequest as he, getSnippet as qe } from "@scalar/api-client/views/Components/CodeSnippet";
|
|
4
|
+
import { filterSecurityRequirements as Ee } from "@scalar/api-client/views/Request/RequestSection";
|
|
5
|
+
import { ScalarCodeBlock as Ke } from "@scalar/components";
|
|
6
|
+
import { freezeElement as be } from "@scalar/helpers/dom/freeze-element";
|
|
7
|
+
import { requestSchema as Se, createExampleFromRequest as ke } from "@scalar/oas-utils/entities/spec";
|
|
8
|
+
import { isDereferenced as Ce } from "@scalar/openapi-types/helpers";
|
|
9
|
+
import M from "../../components/ScreenReader.vue.js";
|
|
10
|
+
import { useConfig as Oe } from "../../hooks/useConfig.js";
|
|
11
|
+
import { EXAMPLE_CONTEXT as Ne, DISCRIMINATOR_CONTEXT as $e } from "../../hooks/useDiscriminator.js";
|
|
12
|
+
import { useHttpClientStore as Te } from "../../stores/useHttpClientStore.js";
|
|
13
|
+
import Ve from "./ExamplePicker.vue.js";
|
|
14
|
+
import Re from "./TextSelect.vue.js";
|
|
15
15
|
/* empty css */
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import { useExampleStore as
|
|
22
|
-
const
|
|
16
|
+
import ee from "../../components/Card/Card.vue.js";
|
|
17
|
+
import Be from "../../components/Card/CardHeader.vue.js";
|
|
18
|
+
import te from "../../components/HttpMethod/HttpMethod.vue.js";
|
|
19
|
+
import ae from "../../components/Card/CardContent.vue.js";
|
|
20
|
+
import je from "../../components/Card/CardFooter.vue.js";
|
|
21
|
+
import { useExampleStore as we } from "../../legacy/stores/useExampleStore.js";
|
|
22
|
+
const Je = ["id"], Ue = ["id"], De = {
|
|
23
23
|
key: 0,
|
|
24
24
|
class: "request-card-footer-addon"
|
|
25
|
-
},
|
|
25
|
+
}, He = { class: "request-header" }, nt = /* @__PURE__ */ ye({
|
|
26
26
|
__name: "ExampleRequest",
|
|
27
27
|
props: {
|
|
28
28
|
server: {},
|
|
@@ -34,28 +34,28 @@ const je = ["id"], we = ["id"], Je = {
|
|
|
34
34
|
schemas: {}
|
|
35
35
|
},
|
|
36
36
|
setup(l) {
|
|
37
|
-
const { selectedExampleKey:
|
|
37
|
+
const { selectedExampleKey: A, operationId: le } = we(), { requestExamples: S, securitySchemes: F, requestExampleMutators: V } = xe(), re = Oe(), {
|
|
38
38
|
httpClient: u,
|
|
39
|
-
setHttpClient:
|
|
40
|
-
availableTargets:
|
|
41
|
-
httpTargetTitle:
|
|
42
|
-
httpClientTitle:
|
|
43
|
-
} =
|
|
39
|
+
setHttpClient: oe,
|
|
40
|
+
availableTargets: P,
|
|
41
|
+
httpTargetTitle: se,
|
|
42
|
+
httpClientTitle: ne
|
|
43
|
+
} = Te(), k = ve(), x = w(!1), C = Y(Ne), f = Y($e), R = c(() => {
|
|
44
44
|
var e;
|
|
45
45
|
return (e = f == null ? void 0 : f.value) == null ? void 0 : e.selectedType;
|
|
46
|
-
}),
|
|
46
|
+
}), X = c(
|
|
47
47
|
() => {
|
|
48
48
|
var e;
|
|
49
49
|
return ((e = f == null ? void 0 : f.value) == null ? void 0 : e.hasDiscriminator) || !1;
|
|
50
50
|
}
|
|
51
|
-
), d =
|
|
51
|
+
), d = c(() => {
|
|
52
52
|
var t;
|
|
53
53
|
const e = ["x-custom-examples", "x-codeSamples", "x-code-samples"];
|
|
54
54
|
for (const a of e)
|
|
55
55
|
if ((t = l.operation) != null && t[a])
|
|
56
56
|
return [...l.operation[a]];
|
|
57
57
|
return [];
|
|
58
|
-
}), o =
|
|
58
|
+
}), o = w(
|
|
59
59
|
// Default to first custom example
|
|
60
60
|
d.value.length ? {
|
|
61
61
|
targetKey: "customExamples",
|
|
@@ -68,20 +68,20 @@ const je = ["id"], we = ["id"], Je = {
|
|
|
68
68
|
}
|
|
69
69
|
)
|
|
70
70
|
);
|
|
71
|
-
|
|
71
|
+
Z(u, () => {
|
|
72
72
|
o.value = {
|
|
73
73
|
targetKey: u.targetKey,
|
|
74
74
|
clientKey: u.clientKey
|
|
75
75
|
};
|
|
76
76
|
});
|
|
77
|
-
const
|
|
77
|
+
const z = c(() => {
|
|
78
78
|
const e = O.value;
|
|
79
79
|
return Object.keys(e).length > 1;
|
|
80
|
-
}),
|
|
81
|
-
var q, E,
|
|
80
|
+
}), ue = () => {
|
|
81
|
+
var q, E, K;
|
|
82
82
|
if (o.value.targetKey === "customExamples")
|
|
83
83
|
return ((q = d.value[o.value.clientKey]) == null ? void 0 : q.source) ?? "";
|
|
84
|
-
const e = u.clientKey, t = u.targetKey, a = l.request ||
|
|
84
|
+
const e = u.clientKey, t = u.targetKey, a = l.request || Se.parse({
|
|
85
85
|
uid: l.operation.operationId || "temp-request",
|
|
86
86
|
method: l.method,
|
|
87
87
|
path: l.operation.path,
|
|
@@ -94,35 +94,35 @@ const je = ["id"], we = ["id"], Je = {
|
|
|
94
94
|
servers: [],
|
|
95
95
|
summary: l.operation.summary || "Example Request"
|
|
96
96
|
});
|
|
97
|
-
let i = S[((
|
|
97
|
+
let i = S[((K = (E = l.request) == null ? void 0 : E.examples) == null ? void 0 : K[0]) ?? ""];
|
|
98
98
|
if (!i) {
|
|
99
|
-
const
|
|
100
|
-
i =
|
|
99
|
+
const $ = O.value, m = Object.keys($)[0];
|
|
100
|
+
i = ke(a, m);
|
|
101
101
|
}
|
|
102
|
-
const p =
|
|
102
|
+
const p = Ee(
|
|
103
103
|
l.operation.security || l.collection.security,
|
|
104
104
|
l.collection.selectedSecuritySchemeUids,
|
|
105
|
-
|
|
106
|
-
), y =
|
|
105
|
+
F
|
|
106
|
+
), y = he({
|
|
107
107
|
operation: a,
|
|
108
108
|
example: i,
|
|
109
109
|
server: l.server,
|
|
110
110
|
securitySchemes: p
|
|
111
|
-
}), [h, N] =
|
|
111
|
+
}), [h, N] = qe(t, e, y);
|
|
112
112
|
return h ? h.message ?? "" : N;
|
|
113
|
-
},
|
|
113
|
+
}, L = c(() => {
|
|
114
114
|
try {
|
|
115
|
-
return
|
|
115
|
+
return ue();
|
|
116
116
|
} catch (e) {
|
|
117
117
|
return console.error("[generateSnippet]", e), "";
|
|
118
118
|
}
|
|
119
|
-
}), O =
|
|
119
|
+
}), O = c(() => {
|
|
120
120
|
var a;
|
|
121
|
-
if (!
|
|
121
|
+
if (!Ce(l.operation.requestBody))
|
|
122
122
|
return {};
|
|
123
123
|
const e = ((a = l.operation.requestBody) == null ? void 0 : a.content) ?? {}, t = Object.values(e)[0];
|
|
124
124
|
return (t == null ? void 0 : t.examples) ?? {};
|
|
125
|
-
}),
|
|
125
|
+
}), ie = c(() => {
|
|
126
126
|
var t, a;
|
|
127
127
|
const e = (
|
|
128
128
|
// Specified language
|
|
@@ -131,15 +131,15 @@ const je = ["id"], we = ["id"], Je = {
|
|
|
131
131
|
u.targetKey
|
|
132
132
|
)
|
|
133
133
|
);
|
|
134
|
-
return e === "shell" &&
|
|
135
|
-
}),
|
|
136
|
-
() => Object.values(
|
|
134
|
+
return e === "shell" && L.value.includes("curl") ? "curl" : e === "Objective-C" ? "objc" : e;
|
|
135
|
+
}), ce = c(
|
|
136
|
+
() => Object.values(F).flatMap((e) => e.type === "apiKey" ? e.value : (e == null ? void 0 : e.type) === "http" ? [
|
|
137
137
|
e.token,
|
|
138
138
|
e.password,
|
|
139
139
|
btoa(`${e.username}:${e.password}`)
|
|
140
140
|
] : e.type === "oauth2" ? Object.values(e.flows).map((t) => t.token) : [])
|
|
141
|
-
),
|
|
142
|
-
const e =
|
|
141
|
+
), me = c(() => {
|
|
142
|
+
const e = P.value.map((t) => ({
|
|
143
143
|
value: t.key,
|
|
144
144
|
label: t.title,
|
|
145
145
|
options: t.clients.map((a) => ({
|
|
@@ -161,24 +161,26 @@ const je = ["id"], we = ["id"], Je = {
|
|
|
161
161
|
label: t.label ?? t.lang ?? `Example #${a + 1}`
|
|
162
162
|
}))
|
|
163
163
|
}), e;
|
|
164
|
-
}),
|
|
165
|
-
function
|
|
164
|
+
}), B = w(null);
|
|
165
|
+
function de(e) {
|
|
166
166
|
const t = JSON.parse(e);
|
|
167
|
-
if (
|
|
168
|
-
const a =
|
|
167
|
+
if (B.value) {
|
|
168
|
+
const a = be(B.value.$el);
|
|
169
169
|
setTimeout(() => {
|
|
170
170
|
a();
|
|
171
171
|
}, 300);
|
|
172
172
|
}
|
|
173
|
-
t.targetKey === "customExamples" || o.value.targetKey === "customExamples" && t.targetKey === u.targetKey && t.clientKey === u.clientKey ? o.value = t :
|
|
173
|
+
t.targetKey === "customExamples" || o.value.targetKey === "customExamples" && t.targetKey === u.targetKey && t.clientKey === u.clientKey ? o.value = t : oe(t);
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function pe(e) {
|
|
176
176
|
var i, p;
|
|
177
|
-
|
|
177
|
+
if (!e)
|
|
178
|
+
return;
|
|
179
|
+
A.value = e, le.value = l.operation.operationId;
|
|
178
180
|
const t = S[((p = (i = l.request) == null ? void 0 : i.examples) == null ? void 0 : p[0]) ?? ""], a = O.value[e];
|
|
179
181
|
if (t && (a != null && a.value))
|
|
180
182
|
try {
|
|
181
|
-
|
|
183
|
+
V.edit(
|
|
182
184
|
t.uid,
|
|
183
185
|
"body.raw.value",
|
|
184
186
|
JSON.stringify(a.value, null, 2)
|
|
@@ -187,173 +189,173 @@ const je = ["id"], we = ["id"], Je = {
|
|
|
187
189
|
console.error("[handleExampleUpdate]", y);
|
|
188
190
|
}
|
|
189
191
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
+
ge(() => {
|
|
193
|
+
X.value && R.value && !x.value && W(R.value);
|
|
192
194
|
});
|
|
193
|
-
const
|
|
194
|
-
var t, a, i, p, y, h, N, q, E
|
|
195
|
+
const W = (e) => {
|
|
196
|
+
var t, a, i, p, y, h, N, q, E, K, $;
|
|
195
197
|
if (!x.value)
|
|
196
198
|
try {
|
|
197
199
|
x.value = !0;
|
|
198
|
-
const
|
|
199
|
-
if (
|
|
200
|
-
const
|
|
201
|
-
Array.isArray(
|
|
200
|
+
const m = S[((a = (t = l.request) == null ? void 0 : t.examples) == null ? void 0 : a[0]) ?? ""];
|
|
201
|
+
if (m && (C != null && C.generateExampleValue)) {
|
|
202
|
+
const fe = (p = (i = m.body) == null ? void 0 : i.raw) != null && p.value ? JSON.parse(m.body.raw.value) : void 0, j = C.generateExampleValue(
|
|
203
|
+
Array.isArray(fe)
|
|
202
204
|
);
|
|
203
|
-
if (
|
|
204
|
-
|
|
205
|
+
if (V.edit(
|
|
206
|
+
m.uid,
|
|
205
207
|
"body.raw.value",
|
|
206
|
-
JSON.stringify(
|
|
207
|
-
), (
|
|
208
|
-
const v = S[(
|
|
209
|
-
v &&
|
|
208
|
+
JSON.stringify(j, null, 2)
|
|
209
|
+
), (h = (y = l.request) == null ? void 0 : y.examples) != null && h[0]) {
|
|
210
|
+
const v = S[(q = (N = l.request) == null ? void 0 : N.examples) == null ? void 0 : q[0]];
|
|
211
|
+
v && V.edit(
|
|
210
212
|
v.uid,
|
|
211
213
|
"body.raw.value",
|
|
212
|
-
JSON.stringify(
|
|
214
|
+
JSON.stringify(j, null, 2)
|
|
213
215
|
);
|
|
214
216
|
}
|
|
215
|
-
if ((
|
|
217
|
+
if (($ = (K = (E = l.operation.requestBody) == null ? void 0 : E.content) == null ? void 0 : K["application/json"]) != null && $.examples) {
|
|
216
218
|
const v = l.operation.requestBody.content["application/json"].examples;
|
|
217
|
-
Object.keys(v).forEach((
|
|
218
|
-
var
|
|
219
|
-
(
|
|
219
|
+
Object.keys(v).forEach((G) => {
|
|
220
|
+
var Q;
|
|
221
|
+
(Q = v[G]) != null && Q.value && (v[G].value = j);
|
|
220
222
|
});
|
|
221
223
|
}
|
|
222
224
|
}
|
|
223
|
-
} catch (
|
|
224
|
-
console.error("[handleDiscriminatorChange]",
|
|
225
|
+
} catch (m) {
|
|
226
|
+
console.error("[handleDiscriminatorChange]", m);
|
|
225
227
|
} finally {
|
|
226
228
|
x.value = !1;
|
|
227
229
|
}
|
|
228
230
|
};
|
|
229
|
-
return
|
|
230
|
-
e &&
|
|
231
|
-
}), (e, t) => r(
|
|
231
|
+
return Z(R, (e) => {
|
|
232
|
+
e && X.value && !x.value && W();
|
|
233
|
+
}), (e, t) => r(P).length || d.value.length ? (g(), J(r(ee), {
|
|
232
234
|
key: 0,
|
|
233
235
|
"aria-labelledby": `${r(k)}-header`,
|
|
234
236
|
class: "dark-mode",
|
|
235
237
|
ref_key: "elem",
|
|
236
|
-
ref:
|
|
238
|
+
ref: B,
|
|
237
239
|
role: "region"
|
|
238
240
|
}, {
|
|
239
241
|
default: s(() => [
|
|
240
|
-
n(r(
|
|
242
|
+
n(r(Be), { muted: "" }, {
|
|
241
243
|
actions: s(() => [
|
|
242
|
-
n(
|
|
244
|
+
n(Re, {
|
|
243
245
|
class: "request-client-picker",
|
|
244
246
|
controls: `${r(k)}-example`,
|
|
245
247
|
modelValue: JSON.stringify(o.value),
|
|
246
|
-
options:
|
|
247
|
-
"onUpdate:modelValue":
|
|
248
|
+
options: me.value,
|
|
249
|
+
"onUpdate:modelValue": de
|
|
248
250
|
}, {
|
|
249
251
|
default: s(() => [
|
|
250
|
-
o.value.targetKey === "customExamples" ? (g(),
|
|
251
|
-
n(
|
|
252
|
+
o.value.targetKey === "customExamples" ? (g(), H(_, { key: 0 }, [
|
|
253
|
+
n(M, null, {
|
|
252
254
|
default: s(() => t[1] || (t[1] = [
|
|
253
255
|
b("Selected Example:")
|
|
254
256
|
])),
|
|
255
257
|
_: 1
|
|
256
258
|
}),
|
|
257
|
-
b(" " +
|
|
258
|
-
], 64)) : (g(),
|
|
259
|
-
n(
|
|
259
|
+
b(" " + I(d.value[o.value.clientKey].label ?? "Example"), 1)
|
|
260
|
+
], 64)) : (g(), H(_, { key: 1 }, [
|
|
261
|
+
n(M, null, {
|
|
260
262
|
default: s(() => t[2] || (t[2] = [
|
|
261
263
|
b("Selected HTTP client:")
|
|
262
264
|
])),
|
|
263
265
|
_: 1
|
|
264
266
|
}),
|
|
265
|
-
b(" " +
|
|
267
|
+
b(" " + I(r(se)) + " " + I(r(ne)), 1)
|
|
266
268
|
], 64))
|
|
267
269
|
]),
|
|
268
270
|
_: 1
|
|
269
271
|
}, 8, ["controls", "modelValue", "options"])
|
|
270
272
|
]),
|
|
271
273
|
default: s(() => [
|
|
272
|
-
|
|
274
|
+
D("div", {
|
|
273
275
|
id: `${r(k)}-header`,
|
|
274
276
|
class: "request-header"
|
|
275
277
|
}, [
|
|
276
|
-
n(
|
|
278
|
+
n(M, null, {
|
|
277
279
|
default: s(() => t[0] || (t[0] = [
|
|
278
280
|
b("Request Example for")
|
|
279
281
|
])),
|
|
280
282
|
_: 1
|
|
281
283
|
}),
|
|
282
|
-
n(r(
|
|
284
|
+
n(r(te), {
|
|
283
285
|
as: "span",
|
|
284
286
|
class: "request-method",
|
|
285
287
|
method: e.method
|
|
286
288
|
}, null, 8, ["method"]),
|
|
287
|
-
|
|
288
|
-
], 8,
|
|
289
|
+
T(e.$slots, "header", {}, void 0, !0)
|
|
290
|
+
], 8, Je)
|
|
289
291
|
]),
|
|
290
292
|
_: 3
|
|
291
293
|
}),
|
|
292
|
-
n(r(
|
|
294
|
+
n(r(ae), {
|
|
293
295
|
borderless: "",
|
|
294
296
|
class: "request-editor-section custom-scroll",
|
|
295
297
|
frameless: ""
|
|
296
298
|
}, {
|
|
297
299
|
default: s(() => [
|
|
298
|
-
|
|
300
|
+
D("div", {
|
|
299
301
|
id: `${r(k)}-example`,
|
|
300
302
|
class: "code-snippet"
|
|
301
303
|
}, [
|
|
302
|
-
n(r(
|
|
304
|
+
n(r(Ke), {
|
|
303
305
|
class: "bg-b-2 -outline-offset-2",
|
|
304
|
-
content:
|
|
305
|
-
hideCredentials:
|
|
306
|
-
lang:
|
|
306
|
+
content: L.value,
|
|
307
|
+
hideCredentials: ce.value,
|
|
308
|
+
lang: ie.value,
|
|
307
309
|
lineNumbers: ""
|
|
308
310
|
}, null, 8, ["content", "hideCredentials", "lang"])
|
|
309
|
-
], 8,
|
|
311
|
+
], 8, Ue)
|
|
310
312
|
]),
|
|
311
313
|
_: 1
|
|
312
314
|
}),
|
|
313
|
-
(
|
|
315
|
+
(z.value || !r(re).hideTestRequestButton) && e.$slots.footer ? (g(), J(r(je), {
|
|
314
316
|
key: 0,
|
|
315
317
|
class: "request-card-footer",
|
|
316
318
|
contrast: ""
|
|
317
319
|
}, {
|
|
318
320
|
default: s(() => [
|
|
319
|
-
|
|
320
|
-
n(
|
|
321
|
+
z.value ? (g(), H("div", De, [
|
|
322
|
+
n(Ve, {
|
|
321
323
|
class: "request-example-selector",
|
|
322
324
|
examples: O.value,
|
|
323
|
-
modelValue: r(
|
|
324
|
-
"onUpdate:modelValue":
|
|
325
|
+
modelValue: r(A),
|
|
326
|
+
"onUpdate:modelValue": pe
|
|
325
327
|
}, null, 8, ["examples", "modelValue"])
|
|
326
|
-
])) :
|
|
327
|
-
|
|
328
|
+
])) : U("", !0),
|
|
329
|
+
T(e.$slots, "footer", {}, void 0, !0)
|
|
328
330
|
]),
|
|
329
331
|
_: 3
|
|
330
|
-
})) :
|
|
332
|
+
})) : U("", !0)
|
|
331
333
|
]),
|
|
332
334
|
_: 3
|
|
333
|
-
}, 8, ["aria-labelledby"])) : e.fallback ? (g(),
|
|
335
|
+
}, 8, ["aria-labelledby"])) : e.fallback ? (g(), J(r(ee), {
|
|
334
336
|
key: 1,
|
|
335
337
|
class: "dark-mode"
|
|
336
338
|
}, {
|
|
337
339
|
default: s(() => [
|
|
338
|
-
n(r(
|
|
340
|
+
n(r(ae), { class: "request-card-simple" }, {
|
|
339
341
|
default: s(() => [
|
|
340
|
-
|
|
341
|
-
n(r(
|
|
342
|
+
D("div", He, [
|
|
343
|
+
n(r(te), {
|
|
342
344
|
as: "span",
|
|
343
345
|
class: "request-method",
|
|
344
346
|
method: e.method
|
|
345
347
|
}, null, 8, ["method"]),
|
|
346
|
-
|
|
348
|
+
T(e.$slots, "header", {}, void 0, !0)
|
|
347
349
|
]),
|
|
348
|
-
|
|
350
|
+
T(e.$slots, "footer", {}, void 0, !0)
|
|
349
351
|
]),
|
|
350
352
|
_: 3
|
|
351
353
|
})
|
|
352
354
|
]),
|
|
353
355
|
_: 3
|
|
354
|
-
})) :
|
|
356
|
+
})) : U("", !0);
|
|
355
357
|
}
|
|
356
358
|
});
|
|
357
359
|
export {
|
|
358
|
-
|
|
360
|
+
nt as default
|
|
359
361
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ExampleResponse.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import p from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ p(o, [["__scopeId", "data-v-157f3a0c"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ExampleResponses.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import p from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ p(o, [["__scopeId", "data-v-9c53bbc5"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarElement.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/sidebar/components/SidebarElement.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SidebarElement.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/sidebar/components/SidebarElement.vue"],"names":[],"mappings":"AAgXA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAQhE,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,cAAc,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAC;AAuEF,iBAAS,cAAc;WAwLT,OAAO,IAA6B;;yBATpB,GAAG;+BACG,GAAG;;;;EAatC;AAkBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;4FAQnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SidebarElement.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-fa7fb2b8"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { defineComponent as $, createElementBlock as d, openBlock as n, createElementVNode as a, renderSlot as g, createCommentVNode as r, normalizeClass as A, unref as s, createTextVNode as
|
|
1
|
+
import { defineComponent as $, createElementBlock as d, openBlock as n, createElementVNode as a, renderSlot as g, createCommentVNode as r, normalizeClass as A, unref as s, createTextVNode as m, withModifiers as O, createVNode as b, withCtx as v, toDisplayString as h, createBlock as T, normalizeStyle as E } from "vue";
|
|
2
2
|
import { ScalarSidebarGroupToggle as N } from "@scalar/components";
|
|
3
3
|
import { scrollToId as V } from "@scalar/helpers/dom/scroll-to-id";
|
|
4
4
|
import { getHttpMethodInfo as H } from "@scalar/helpers/http/http-info";
|
|
5
5
|
import { sleep as k } from "@scalar/helpers/testing/sleep";
|
|
6
6
|
import { ScalarIconWebhooksLogo as I } from "@scalar/icons";
|
|
7
|
-
import {
|
|
8
|
-
import { useConfig as
|
|
9
|
-
import { useNavState as
|
|
10
|
-
import { isOperationDeprecated as L } from "../../../libs/openapi.js";
|
|
7
|
+
import { isOperationDeprecated as R, combineUrlAndPath as U } from "@scalar/oas-utils/helpers";
|
|
8
|
+
import { useConfig as D } from "../../../hooks/useConfig.js";
|
|
9
|
+
import { useNavState as L } from "../../../hooks/useNavState.js";
|
|
11
10
|
import M from "./SidebarHttpBadge.vue.js";
|
|
12
11
|
const P = ["id"], z = {
|
|
13
12
|
key: 0,
|
|
@@ -18,7 +17,7 @@ const P = ["id"], z = {
|
|
|
18
17
|
}, q = {
|
|
19
18
|
key: 1,
|
|
20
19
|
class: "action-menu"
|
|
21
|
-
},
|
|
20
|
+
}, oe = /* @__PURE__ */ $({
|
|
22
21
|
__name: "SidebarElement",
|
|
23
22
|
props: {
|
|
24
23
|
id: {},
|
|
@@ -29,11 +28,11 @@ const P = ["id"], z = {
|
|
|
29
28
|
},
|
|
30
29
|
emits: ["toggleOpen"],
|
|
31
30
|
setup(C, { emit: y }) {
|
|
32
|
-
const o = C,
|
|
33
|
-
l.value = !1, o.hasChildren &&
|
|
31
|
+
const o = C, p = y, { getFullHash: u, isIntersectionEnabled: l, replaceUrlState: w } = L(), i = D(), c = async () => {
|
|
32
|
+
l.value = !1, o.hasChildren && p("toggleOpen"), await k(100), l.value = !0;
|
|
34
33
|
}, S = () => {
|
|
35
34
|
if (i.value.pathRouting)
|
|
36
|
-
return
|
|
35
|
+
return U(i.value.pathRouting.basePath, o.item.id);
|
|
37
36
|
if (typeof window < "u") {
|
|
38
37
|
const e = new URL(window.location.href);
|
|
39
38
|
return e.hash = u(o.item.id), `${e.pathname}${e.search}${e.hash}`;
|
|
@@ -41,7 +40,7 @@ const P = ["id"], z = {
|
|
|
41
40
|
return `#${u(o.item.id)}`;
|
|
42
41
|
}, B = async (e) => {
|
|
43
42
|
var t, f;
|
|
44
|
-
(f = (t = i.value).onSidebarClick) == null || f.call(t, o.item.id), i.value.pathRouting && (e.preventDefault(), o.hasChildren &&
|
|
43
|
+
(f = (t = i.value).onSidebarClick) == null || f.call(t, o.item.id), i.value.pathRouting && (e.preventDefault(), o.hasChildren && p("toggleOpen"), p("toggleOpen"), l.value = !1, w(o.item.id), V(o.item.id), await k(100), l.value = !0);
|
|
45
44
|
};
|
|
46
45
|
return (e, t) => (n(), d("li", {
|
|
47
46
|
id: e.id,
|
|
@@ -51,7 +50,9 @@ const P = ["id"], z = {
|
|
|
51
50
|
class: A(["sidebar-heading", {
|
|
52
51
|
"sidebar-group-item__folder": e.hasChildren,
|
|
53
52
|
active_page: e.isActive,
|
|
54
|
-
deprecated: "operation" in e.item && s(
|
|
53
|
+
deprecated: "operation" in e.item && s(R)(
|
|
54
|
+
e.item.operation
|
|
55
|
+
)
|
|
55
56
|
}]),
|
|
56
57
|
onClick: c
|
|
57
58
|
}, [
|
|
@@ -64,12 +65,12 @@ const P = ["id"], z = {
|
|
|
64
65
|
}, [
|
|
65
66
|
b(s(N), { open: e.open }, {
|
|
66
67
|
label: v(() => [
|
|
67
|
-
|
|
68
|
+
m(h(e.open ? "Collapse" : "Expand") + " " + h(e.item.title), 1)
|
|
68
69
|
]),
|
|
69
70
|
_: 1
|
|
70
71
|
}, 8, ["open"])
|
|
71
72
|
], 8, j),
|
|
72
|
-
t[0] || (t[0] =
|
|
73
|
+
t[0] || (t[0] = m(" "))
|
|
73
74
|
])) : r("", !0),
|
|
74
75
|
a("a", {
|
|
75
76
|
class: "sidebar-heading-link",
|
|
@@ -79,7 +80,7 @@ const P = ["id"], z = {
|
|
|
79
80
|
}, [
|
|
80
81
|
a("p", G, h(e.item.title), 1),
|
|
81
82
|
"method" in e.item && !e.hasChildren ? (n(), d("p", W, [
|
|
82
|
-
t[1] || (t[1] =
|
|
83
|
+
t[1] || (t[1] = m(" ")),
|
|
83
84
|
t[2] || (t[2] = a("span", { class: "sr-only" }, "HTTP Method: ", -1)),
|
|
84
85
|
b(M, {
|
|
85
86
|
class: "min-w-9.75 justify-end text-right",
|
|
@@ -108,5 +109,5 @@ const P = ["id"], z = {
|
|
|
108
109
|
}
|
|
109
110
|
});
|
|
110
111
|
export {
|
|
111
|
-
|
|
112
|
+
oe as default
|
|
112
113
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SecurityScheme } from '@scalar/oas-utils/entities/spec';
|
|
2
|
+
import type { SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.1/strict/security-scheme';
|
|
3
|
+
/**
|
|
4
|
+
* Convert the old security scheme to the new one with secret extensions
|
|
5
|
+
*
|
|
6
|
+
* Remove this once we are migrated to the workspace store
|
|
7
|
+
*/
|
|
8
|
+
export declare const convertSecurityScheme: (scheme: SecurityScheme) => SecuritySchemeObject;
|
|
9
|
+
//# sourceMappingURL=convert-security-scheme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-security-scheme.d.ts","sourceRoot":"","sources":["../../src/helpers/convert-security-scheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAA;AAEvG;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,WAAY,cAAc,KAAG,oBAsC9D,CAAA"}
|