@scalar/api-reference 1.25.115 → 1.25.116
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 +24 -0
- package/dist/browser/standalone.js +10903 -10880
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
- package/dist/components/Content/Lazy/Loading.vue.js +58 -60
- package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/TagList.vue.js +36 -38
- package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarElement.vue.js +1 -1
- package/dist/components/Sidebar/SidebarElement.vue2.js +59 -55
- package/dist/features/ApiClientModal/useApiClient.d.ts +18 -18
- package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts +6 -4
- 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 +138 -119
- package/dist/features/ExampleRequest/helpers/filter-security-requirements.d.ts +6 -0
- package/dist/features/ExampleRequest/helpers/filter-security-requirements.d.ts.map +1 -0
- package/dist/features/ExampleRequest/helpers/filter-security-requirements.js +17 -0
- package/dist/features/Operation/Operation.vue.d.ts +4 -5
- package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
- package/dist/features/Operation/Operation.vue.js +34 -41
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +6 -6
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +4 -4
- package/dist/features/Operation/layouts/ClassicLayout.vue2.js +52 -51
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +6 -6
- 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 +70 -70
- package/dist/helpers/convert-to-har-request.d.ts +28 -0
- package/dist/helpers/convert-to-har-request.d.ts.map +1 -0
- package/dist/helpers/convert-to-har-request.js +64 -0
- package/dist/helpers/get-example-code.d.ts +9 -0
- package/dist/helpers/get-example-code.d.ts.map +1 -0
- package/dist/helpers/get-example-code.js +51 -0
- package/dist/helpers/index.d.ts +0 -3
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/hooks/useNavState.d.ts.map +1 -1
- package/dist/hooks/useNavState.js +26 -24
- package/dist/hooks/useReactiveSpec.d.ts +1 -1
- package/dist/index.js +66 -72
- package/dist/style.css +1 -1
- package/package.json +10 -10
- package/dist/features/Operation/hooks/useRequestExample.d.ts +0 -17
- package/dist/features/Operation/hooks/useRequestExample.d.ts.map +0 -1
- package/dist/features/Operation/hooks/useRequestExample.js +0 -68
- package/dist/helpers/convertRequestToHarRequest.d.ts +0 -7
- package/dist/helpers/convertRequestToHarRequest.d.ts.map +0 -1
- package/dist/helpers/convertRequestToHarRequest.js +0 -64
- package/dist/helpers/get-request.js +0 -6
- package/dist/helpers/getExampleCode.d.ts +0 -8
- package/dist/helpers/getExampleCode.d.ts.map +0 -1
- package/dist/helpers/getExampleCode.js +0 -16
- package/dist/helpers/joinWithSlash.d.ts +0 -5
- package/dist/helpers/joinWithSlash.d.ts.map +0 -1
- package/dist/helpers/joinWithSlash.js +0 -4
|
@@ -1,49 +1,50 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import { defineComponent as A, useId as N, computed as d, ref as G, watch as L, onServerPrefetch as Q, useSSRContext as X, unref as a, openBlock as m, createBlock as g, withCtx as r, createVNode as l, createElementBlock as x, Fragment as w, createTextVNode as f, toDisplayString as K, createElementVNode as k, renderSlot as y, createCommentVNode as C } from "vue";
|
|
2
|
+
import { filterSecurityRequirements as Y } from "./helpers/filter-security-requirements.js";
|
|
3
|
+
import { getExampleCode as Z } from "../../helpers/get-example-code.js";
|
|
4
|
+
import { useWorkspace as _ } from "@scalar/api-client/store";
|
|
5
|
+
import { ScalarCodeBlock as ee } from "@scalar/components";
|
|
6
|
+
import { ssrState as te } from "@scalar/oas-utils/helpers";
|
|
7
|
+
import { asyncComputed as oe } from "@vueuse/core";
|
|
8
|
+
import V from "../../components/ScreenReader.vue.js";
|
|
9
|
+
import ae from "./ExamplePicker.vue.js";
|
|
10
|
+
import re from "./TextSelect.vue.js";
|
|
8
11
|
/* empty css */
|
|
9
|
-
import
|
|
10
|
-
import
|
|
12
|
+
import j from "../../components/Card/Card.vue.js";
|
|
13
|
+
import le from "../../components/Card/CardHeader.vue.js";
|
|
11
14
|
import B from "../../components/HttpMethod/HttpMethod.vue.js";
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
const re = ["id"], se = ["id"], ne = {
|
|
15
|
+
import T from "../../components/Card/CardContent.vue.js";
|
|
16
|
+
import ne from "../../components/Card/CardFooter.vue.js";
|
|
17
|
+
import { useHttpClientStore as se } from "../../stores/useHttpClientStore.js";
|
|
18
|
+
import { useExampleStore as ie } from "../../legacy/stores/useExampleStore.js";
|
|
19
|
+
const ue = ["id"], ce = ["id"], me = {
|
|
18
20
|
key: 0,
|
|
19
21
|
class: "request-card-footer-addon"
|
|
20
|
-
},
|
|
22
|
+
}, pe = { class: "request-header" }, je = /* @__PURE__ */ A({
|
|
21
23
|
__name: "ExampleRequest",
|
|
22
24
|
props: {
|
|
23
25
|
operation: {},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
fallback: { type: Boolean }
|
|
26
|
+
server: {},
|
|
27
|
+
collection: {},
|
|
28
|
+
fallback: { type: Boolean },
|
|
29
|
+
transformedOperation: {}
|
|
27
30
|
},
|
|
28
31
|
setup(n) {
|
|
29
|
-
const
|
|
30
|
-
n.operation.path + n.operation.httpVerb + n.operation.operationId
|
|
31
|
-
)}`, { selectedExampleKey: T, operationId: j } = le(), {
|
|
32
|
+
const S = `components-Content-Operation-Example-Request${N()}`, { selectedExampleKey: H, operationId: R } = ie(), { requestExamples: I, securitySchemes: h } = _(), {
|
|
32
33
|
httpClient: i,
|
|
33
|
-
setHttpClient:
|
|
34
|
-
availableTargets:
|
|
35
|
-
httpTargetTitle:
|
|
36
|
-
httpClientTitle:
|
|
37
|
-
} =
|
|
34
|
+
setHttpClient: J,
|
|
35
|
+
availableTargets: E,
|
|
36
|
+
httpTargetTitle: D,
|
|
37
|
+
httpClientTitle: P
|
|
38
|
+
} = se(), v = N(), c = d(() => {
|
|
38
39
|
var t;
|
|
39
40
|
const e = ["x-custom-examples", "x-codeSamples", "x-code-samples"];
|
|
40
|
-
for (const
|
|
41
|
-
if ((t = n.
|
|
42
|
-
return [...n.
|
|
41
|
+
for (const o of e)
|
|
42
|
+
if ((t = n.transformedOperation.information) != null && t[o])
|
|
43
|
+
return [...n.transformedOperation.information[o]];
|
|
43
44
|
return [];
|
|
44
|
-
}), s =
|
|
45
|
+
}), s = G(
|
|
45
46
|
// Default to first custom example
|
|
46
|
-
|
|
47
|
+
c.value.length ? {
|
|
47
48
|
targetKey: "customExamples",
|
|
48
49
|
clientKey: 0
|
|
49
50
|
} : (
|
|
@@ -54,193 +55,211 @@ const re = ["id"], se = ["id"], ne = {
|
|
|
54
55
|
}
|
|
55
56
|
)
|
|
56
57
|
);
|
|
57
|
-
|
|
58
|
+
L(i, () => {
|
|
58
59
|
s.value = {
|
|
59
60
|
targetKey: i.targetKey,
|
|
60
61
|
clientKey: i.clientKey
|
|
61
62
|
};
|
|
62
63
|
});
|
|
63
|
-
const
|
|
64
|
+
const b = d(
|
|
64
65
|
() => {
|
|
65
|
-
var e, t,
|
|
66
|
+
var e, t, o, u;
|
|
66
67
|
return Object.keys(
|
|
67
|
-
((
|
|
68
|
+
((u = (o = (t = (e = n.transformedOperation.information) == null ? void 0 : e.requestBody) == null ? void 0 : t.content) == null ? void 0 : o["application/json"]) == null ? void 0 : u.examples) ?? {}
|
|
68
69
|
).length > 1;
|
|
69
70
|
}
|
|
70
|
-
),
|
|
71
|
-
var
|
|
71
|
+
), q = async () => {
|
|
72
|
+
var p;
|
|
72
73
|
if (s.value.targetKey === "customExamples")
|
|
73
|
-
return ((
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
return ((p = c.value[s.value.clientKey]) == null ? void 0 : p.source) ?? "";
|
|
75
|
+
const e = i.clientKey, t = i.targetKey, o = I[n.operation.examples[0]];
|
|
76
|
+
if (!o) return "";
|
|
77
|
+
const u = Y(
|
|
78
|
+
n.operation.security || n.collection.security,
|
|
79
|
+
n.collection.selectedSecuritySchemeUids,
|
|
80
|
+
h
|
|
81
|
+
);
|
|
82
|
+
return await Z(
|
|
83
|
+
n.operation,
|
|
84
|
+
o,
|
|
85
|
+
t,
|
|
86
|
+
e,
|
|
87
|
+
n.server,
|
|
88
|
+
u
|
|
89
|
+
) ?? "";
|
|
90
|
+
}, O = oe(async () => {
|
|
78
91
|
try {
|
|
79
|
-
return await
|
|
92
|
+
return await q();
|
|
80
93
|
} catch (e) {
|
|
81
94
|
return console.error("[generateSnippet]", e), "";
|
|
82
95
|
}
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
const e =
|
|
86
|
-
e.payload.data[
|
|
96
|
+
}, te[S] ?? "");
|
|
97
|
+
Q(async () => {
|
|
98
|
+
const e = X();
|
|
99
|
+
e.payload.data[S] = await q();
|
|
87
100
|
});
|
|
88
|
-
const
|
|
89
|
-
var t,
|
|
101
|
+
const U = d(() => {
|
|
102
|
+
var t, o;
|
|
90
103
|
const e = (
|
|
91
104
|
// Specified language
|
|
92
|
-
((t = s.value) == null ? void 0 : t.targetKey) === "customExamples" ? ((
|
|
105
|
+
((t = s.value) == null ? void 0 : t.targetKey) === "customExamples" ? ((o = c.value[s.value.clientKey]) == null ? void 0 : o.lang) ?? "plaintext" : (
|
|
93
106
|
// Or language for the globally selected HTTP client
|
|
94
107
|
i.targetKey
|
|
95
108
|
)
|
|
96
109
|
);
|
|
97
|
-
return e === "shell" &&
|
|
98
|
-
}),
|
|
99
|
-
|
|
110
|
+
return e === "shell" && O.value.includes("curl") ? "curl" : e === "Objective-C" ? "objc" : e;
|
|
111
|
+
}), F = d(
|
|
112
|
+
() => Object.values(h).flatMap((e) => e.type === "apiKey" ? e.value : (e == null ? void 0 : e.type) === "http" ? [
|
|
113
|
+
e.token,
|
|
114
|
+
e.password,
|
|
115
|
+
btoa(`${e.username}:${e.password}`)
|
|
116
|
+
] : e.type === "oauth2" ? Object.values(e.flows).map((t) => t.token) : [])
|
|
117
|
+
), M = d(() => {
|
|
118
|
+
const e = E.value.map((t) => ({
|
|
100
119
|
value: t.key,
|
|
101
120
|
label: t.title,
|
|
102
|
-
options: t.clients.map((
|
|
121
|
+
options: t.clients.map((o) => ({
|
|
103
122
|
value: JSON.stringify({
|
|
104
123
|
targetKey: t.key,
|
|
105
|
-
clientKey:
|
|
124
|
+
clientKey: o.client
|
|
106
125
|
}),
|
|
107
|
-
label:
|
|
126
|
+
label: o.title
|
|
108
127
|
}))
|
|
109
128
|
}));
|
|
110
|
-
return
|
|
129
|
+
return c.value.length && e.unshift({
|
|
111
130
|
value: "customExamples",
|
|
112
131
|
label: "Examples",
|
|
113
|
-
options:
|
|
132
|
+
options: c.value.map((t, o) => ({
|
|
114
133
|
value: JSON.stringify({
|
|
115
134
|
targetKey: "customExamples",
|
|
116
|
-
clientKey:
|
|
135
|
+
clientKey: o
|
|
117
136
|
}),
|
|
118
|
-
label: t.label ?? t.lang ?? `Example #${
|
|
137
|
+
label: t.label ?? t.lang ?? `Example #${o + 1}`
|
|
119
138
|
}))
|
|
120
139
|
}), e;
|
|
121
140
|
});
|
|
122
|
-
function
|
|
141
|
+
function W(e) {
|
|
123
142
|
const t = JSON.parse(e);
|
|
124
|
-
t.targetKey === "customExamples" ? s.value = t :
|
|
143
|
+
t.targetKey === "customExamples" ? s.value = t : J(t);
|
|
125
144
|
}
|
|
126
|
-
return (e, t) =>
|
|
145
|
+
return (e, t) => a(E).length || c.value.length ? (m(), g(a(j), {
|
|
127
146
|
key: 0,
|
|
128
147
|
class: "dark-mode"
|
|
129
148
|
}, {
|
|
130
|
-
default:
|
|
131
|
-
|
|
132
|
-
actions:
|
|
133
|
-
|
|
149
|
+
default: r(() => [
|
|
150
|
+
l(a(le), { muted: "" }, {
|
|
151
|
+
actions: r(() => [
|
|
152
|
+
l(re, {
|
|
134
153
|
class: "request-client-picker",
|
|
135
|
-
controls: `${
|
|
154
|
+
controls: `${a(v)}-example`,
|
|
136
155
|
modelValue: JSON.stringify(s.value),
|
|
137
|
-
options:
|
|
138
|
-
"onUpdate:modelValue":
|
|
156
|
+
options: M.value,
|
|
157
|
+
"onUpdate:modelValue": W
|
|
139
158
|
}, {
|
|
140
|
-
default:
|
|
141
|
-
s.value.targetKey === "customExamples" ? (m(),
|
|
142
|
-
|
|
143
|
-
default:
|
|
144
|
-
|
|
159
|
+
default: r(() => [
|
|
160
|
+
s.value.targetKey === "customExamples" ? (m(), x(w, { key: 0 }, [
|
|
161
|
+
l(V, null, {
|
|
162
|
+
default: r(() => t[1] || (t[1] = [
|
|
163
|
+
f("Selected Example:")
|
|
145
164
|
])),
|
|
146
165
|
_: 1
|
|
147
166
|
}),
|
|
148
|
-
|
|
149
|
-
], 64)) : (m(),
|
|
150
|
-
|
|
151
|
-
default:
|
|
152
|
-
|
|
167
|
+
f(" " + K(c.value[s.value.clientKey].label ?? "Example"), 1)
|
|
168
|
+
], 64)) : (m(), x(w, { key: 1 }, [
|
|
169
|
+
l(V, null, {
|
|
170
|
+
default: r(() => t[2] || (t[2] = [
|
|
171
|
+
f("Selected HTTP client:")
|
|
153
172
|
])),
|
|
154
173
|
_: 1
|
|
155
174
|
}),
|
|
156
|
-
|
|
175
|
+
f(" " + K(a(D)) + " " + K(a(P)), 1)
|
|
157
176
|
], 64))
|
|
158
177
|
]),
|
|
159
178
|
_: 1
|
|
160
179
|
}, 8, ["controls", "modelValue", "options"])
|
|
161
180
|
]),
|
|
162
|
-
default:
|
|
163
|
-
|
|
164
|
-
id: `${
|
|
181
|
+
default: r(() => [
|
|
182
|
+
k("div", {
|
|
183
|
+
id: `${a(v)}-header`,
|
|
165
184
|
class: "request-header"
|
|
166
185
|
}, [
|
|
167
|
-
|
|
186
|
+
l(a(B), {
|
|
168
187
|
as: "span",
|
|
169
188
|
class: "request-method",
|
|
170
|
-
method: e.operation.
|
|
189
|
+
method: e.operation.method
|
|
171
190
|
}, null, 8, ["method"]),
|
|
172
|
-
|
|
173
|
-
], 8,
|
|
191
|
+
y(e.$slots, "header", {}, void 0, !0)
|
|
192
|
+
], 8, ue)
|
|
174
193
|
]),
|
|
175
194
|
_: 3
|
|
176
195
|
}),
|
|
177
|
-
|
|
196
|
+
l(a(T), {
|
|
178
197
|
borderless: "",
|
|
179
198
|
class: "request-editor-section custom-scroll",
|
|
180
199
|
frameless: ""
|
|
181
200
|
}, {
|
|
182
|
-
default:
|
|
183
|
-
|
|
184
|
-
id: `${
|
|
201
|
+
default: r(() => [
|
|
202
|
+
k("div", {
|
|
203
|
+
id: `${a(v)}-example`,
|
|
185
204
|
class: "code-snippet"
|
|
186
205
|
}, [
|
|
187
|
-
|
|
206
|
+
l(a(ee), {
|
|
188
207
|
class: "bg-b-2",
|
|
189
|
-
content:
|
|
190
|
-
hideCredentials:
|
|
191
|
-
lang:
|
|
208
|
+
content: a(O),
|
|
209
|
+
hideCredentials: F.value,
|
|
210
|
+
lang: U.value,
|
|
192
211
|
lineNumbers: ""
|
|
193
212
|
}, null, 8, ["content", "hideCredentials", "lang"])
|
|
194
|
-
], 8,
|
|
213
|
+
], 8, ce)
|
|
195
214
|
]),
|
|
196
215
|
_: 1
|
|
197
216
|
}),
|
|
198
|
-
|
|
217
|
+
b.value || e.$slots.footer ? (m(), g(a(ne), {
|
|
199
218
|
key: 0,
|
|
200
219
|
class: "request-card-footer",
|
|
201
220
|
contrast: ""
|
|
202
221
|
}, {
|
|
203
|
-
default:
|
|
204
|
-
var
|
|
222
|
+
default: r(() => {
|
|
223
|
+
var o, u, p, $;
|
|
205
224
|
return [
|
|
206
|
-
|
|
207
|
-
|
|
225
|
+
b.value ? (m(), x("div", me, [
|
|
226
|
+
l(ae, {
|
|
208
227
|
class: "request-example-selector",
|
|
209
|
-
examples: (($ = (
|
|
210
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
228
|
+
examples: (($ = (p = (u = (o = e.transformedOperation.information) == null ? void 0 : o.requestBody) == null ? void 0 : u.content) == null ? void 0 : p["application/json"]) == null ? void 0 : $.examples) ?? [],
|
|
229
|
+
"onUpdate:modelValue": t[0] || (t[0] = (z) => (H.value = z, R.value = e.operation.operationId))
|
|
211
230
|
}, null, 8, ["examples"])
|
|
212
|
-
])) :
|
|
213
|
-
|
|
231
|
+
])) : C("", !0),
|
|
232
|
+
y(e.$slots, "footer", {}, void 0, !0)
|
|
214
233
|
];
|
|
215
234
|
}),
|
|
216
235
|
_: 3
|
|
217
|
-
})) :
|
|
236
|
+
})) : C("", !0)
|
|
218
237
|
]),
|
|
219
238
|
_: 3
|
|
220
|
-
})) : e.fallback ? (m(),
|
|
239
|
+
})) : e.fallback ? (m(), g(a(j), {
|
|
221
240
|
key: 1,
|
|
222
241
|
class: "dark-mode"
|
|
223
242
|
}, {
|
|
224
|
-
default:
|
|
225
|
-
|
|
226
|
-
default:
|
|
227
|
-
|
|
228
|
-
|
|
243
|
+
default: r(() => [
|
|
244
|
+
l(a(T), { class: "request-card-simple" }, {
|
|
245
|
+
default: r(() => [
|
|
246
|
+
k("div", pe, [
|
|
247
|
+
l(a(B), {
|
|
229
248
|
as: "span",
|
|
230
249
|
class: "request-method",
|
|
231
|
-
method: e.operation.
|
|
250
|
+
method: e.operation.method
|
|
232
251
|
}, null, 8, ["method"]),
|
|
233
|
-
|
|
252
|
+
y(e.$slots, "header", {}, void 0, !0)
|
|
234
253
|
]),
|
|
235
|
-
|
|
254
|
+
y(e.$slots, "footer", {}, void 0, !0)
|
|
236
255
|
]),
|
|
237
256
|
_: 3
|
|
238
257
|
})
|
|
239
258
|
]),
|
|
240
259
|
_: 3
|
|
241
|
-
})) :
|
|
260
|
+
})) : C("", !0);
|
|
242
261
|
}
|
|
243
262
|
});
|
|
244
263
|
export {
|
|
245
|
-
|
|
264
|
+
je as default
|
|
246
265
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Collection, SecurityScheme } from '@scalar/oas-utils/entities/spec';
|
|
2
|
+
/**
|
|
3
|
+
* Takes in selected security and filters it with the requirements
|
|
4
|
+
*/
|
|
5
|
+
export declare const filterSecurityRequirements: (securityRequirements: Collection["security"], selectedSecuritySchemeUids?: Collection["selectedSecuritySchemeUids"], securitySchemes?: Record<string, SecurityScheme>) => SecurityScheme[];
|
|
6
|
+
//# sourceMappingURL=filter-security-requirements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-security-requirements.d.ts","sourceRoot":"","sources":["../../../../src/features/ExampleRequest/helpers/filter-security-requirements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACf,MAAM,iCAAiC,CAAA;AAExC;;GAEG;AACH,eAAO,MAAM,0BAA0B,yBACf,UAAU,CAAC,UAAU,CAAC,+BAChB,UAAU,CAAC,4BAA4B,CAAC,oBACnD,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,KAC9C,cAAc,EAwBhB,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const y = (i, a = [], n = {}) => {
|
|
2
|
+
const m = new Set(
|
|
3
|
+
i.map(
|
|
4
|
+
(e) => Object.keys(e).sort().join(",")
|
|
5
|
+
)
|
|
6
|
+
);
|
|
7
|
+
return a.reduce((e, r) => {
|
|
8
|
+
const o = Array.isArray(r) ? r : [r], p = o.map((t) => {
|
|
9
|
+
var s;
|
|
10
|
+
return (s = n[t]) == null ? void 0 : s.nameKey;
|
|
11
|
+
}).sort().join(",");
|
|
12
|
+
return m.has(p) && e.push(...o.map((t) => n[t])), e;
|
|
13
|
+
}, []);
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
y as filterSecurityRequirements
|
|
17
|
+
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Collection, Server } from '@scalar/oas-utils/entities/spec';
|
|
2
2
|
import type { TransformedOperation } from '@scalar/types/legacy';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
id?: string;
|
|
5
5
|
layout?: 'modern' | 'classic';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
securitySchemes: WorkspaceStore['securitySchemes'];
|
|
6
|
+
transformedOperation: TransformedOperation;
|
|
7
|
+
collection: Collection | undefined;
|
|
8
|
+
server: Server | undefined;
|
|
10
9
|
};
|
|
11
10
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
11
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Operation/Operation.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Operation/Operation.vue"],"names":[],"mappings":"AAqEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAOhE,KAAK,WAAW,GAAG;IACjB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;IAC7B,oBAAoB,EAAE,oBAAoB,CAAA;IAC1C,UAAU,EAAE,UAAU,GAAG,SAAS,CAAA;IAClC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;CAC3B,CAAC;;AAmGF,wBAMG"}
|
|
@@ -1,53 +1,46 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { getPointer as
|
|
3
|
-
import { useBlockProps as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
const M = /* @__PURE__ */ m({
|
|
1
|
+
import { defineComponent as s, unref as r, openBlock as t, createElementBlock as l, Fragment as p, createBlock as a, createCommentVNode as m } from "vue";
|
|
2
|
+
import { getPointer as c } from "../../blocks/helpers/getPointer.js";
|
|
3
|
+
import { useBlockProps as d } from "../../blocks/hooks/useBlockProps.js";
|
|
4
|
+
import { useWorkspace as f } from "@scalar/api-client/store";
|
|
5
|
+
import u from "./layouts/ClassicLayout.vue.js";
|
|
6
|
+
import O from "./layouts/ModernLayout.vue.js";
|
|
7
|
+
const g = /* @__PURE__ */ s({
|
|
9
8
|
__name: "Operation",
|
|
10
9
|
props: {
|
|
11
10
|
id: {},
|
|
12
11
|
layout: { default: "modern" },
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
securitySchemes: {}
|
|
12
|
+
transformedOperation: {},
|
|
13
|
+
collection: {},
|
|
14
|
+
server: {}
|
|
17
15
|
},
|
|
18
|
-
setup(
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
requests: e.requests,
|
|
23
|
-
requestExamples: e.requestExamples,
|
|
24
|
-
securitySchemes: e.securitySchemes,
|
|
25
|
-
server: c
|
|
26
|
-
}), l = p(f), { operation: i } = q({
|
|
27
|
-
store: l,
|
|
28
|
-
location: d([
|
|
16
|
+
setup(n) {
|
|
17
|
+
const i = f(), { operation: o } = d({
|
|
18
|
+
store: i,
|
|
19
|
+
location: c([
|
|
29
20
|
"paths",
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
n.transformedOperation.path,
|
|
22
|
+
n.transformedOperation.httpVerb.toLowerCase()
|
|
32
23
|
])
|
|
33
24
|
});
|
|
34
|
-
return (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
25
|
+
return (e, k) => e.collection && r(o) ? (t(), l(p, { key: 0 }, [
|
|
26
|
+
e.layout === "classic" ? (t(), a(u, {
|
|
27
|
+
key: 0,
|
|
28
|
+
id: e.id,
|
|
29
|
+
collection: e.collection,
|
|
30
|
+
operation: r(o),
|
|
31
|
+
server: e.server,
|
|
32
|
+
transformedOperation: e.transformedOperation
|
|
33
|
+
}, null, 8, ["id", "collection", "operation", "server", "transformedOperation"])) : (t(), a(O, {
|
|
34
|
+
key: 1,
|
|
35
|
+
id: e.id,
|
|
36
|
+
collection: e.collection,
|
|
37
|
+
operation: r(o),
|
|
38
|
+
server: e.server,
|
|
39
|
+
transformedOperation: e.transformedOperation
|
|
40
|
+
}, null, 8, ["id", "collection", "operation", "server", "transformedOperation"]))
|
|
41
|
+
], 64)) : m("", !0);
|
|
49
42
|
}
|
|
50
43
|
});
|
|
51
44
|
export {
|
|
52
|
-
|
|
45
|
+
g as default
|
|
53
46
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Collection, Operation, Server } from '@scalar/oas-utils/entities/spec';
|
|
2
2
|
import type { TransformedOperation } from '@scalar/types/legacy';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
id?: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
operation:
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
collection: Collection;
|
|
6
|
+
server: Server | undefined;
|
|
7
|
+
operation: Operation;
|
|
8
|
+
/** @deprecated Use `operation` instead */
|
|
9
|
+
transformedOperation: TransformedOperation;
|
|
10
10
|
};
|
|
11
11
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
12
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClassicLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/layouts/ClassicLayout.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ClassicLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/layouts/ClassicLayout.vue"],"names":[],"mappings":"AAiUA,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAQhE,KAAK,WAAW,GAAG;IACjB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;IACpB,0CAA0C;IAC1C,oBAAoB,EAAE,oBAAoB,CAAA;CAC3C,CAAC;;AAsQF,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from "./ClassicLayout.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import o from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const c = /* @__PURE__ */ o(a, [["__scopeId", "data-v-ac9aa830"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
c as default
|
|
7
7
|
};
|