@scalar/api-reference 1.25.10 → 1.25.11
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 +14612 -14611
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Content/Operation/Operation.vue.js +2 -2
- package/dist/components/Content/Operation/Operation.vue2.js +14 -14
- package/dist/components/Content/Operation/OperationAccordion.vue.js +1 -1
- package/dist/components/Content/Operation/OperationAccordion.vue2.js +24 -24
- package/dist/components/Content/Operation/ParameterHeaders.vue.d.ts +21 -0
- package/dist/components/Content/Operation/ParameterHeaders.vue.d.ts.map +1 -0
- package/dist/components/Content/Operation/ParameterHeaders.vue.js +7 -0
- package/dist/components/Content/Operation/ParameterHeaders.vue2.js +62 -0
- package/dist/components/Content/Operation/ParameterItem.vue.d.ts.map +1 -1
- package/dist/components/Content/Operation/ParameterItem.vue.js +2 -2
- package/dist/components/Content/Operation/ParameterItem.vue2.js +34 -30
- package/dist/components/Content/Tag/Endpoints.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/Endpoints.vue.js +2 -2
- package/dist/components/Content/Tag/Endpoints.vue2.js +10 -8
- package/dist/components/Content/Tag/Tag.vue.js +3 -3
- package/dist/components/Content/Tag/Tag.vue2.js +1 -1
- package/dist/{components/Content/Operation/PathResponses/ExampleResponse.vue.d.ts → embeds/ExampleResponses/ExampleResponses.vue.d.ts} +4 -9
- package/dist/embeds/ExampleResponses/ExampleResponses.vue.d.ts.map +1 -0
- package/dist/embeds/ExampleResponses/index.d.ts +2 -0
- package/dist/embeds/ExampleResponses/index.d.ts.map +1 -0
- package/dist/embeds/OpenApiDocument/OpenApiDocument.vue.d.ts +8 -1
- package/dist/embeds/OpenApiDocument/OpenApiDocument.vue.d.ts.map +1 -1
- package/dist/embeds/index.d.ts +1 -0
- package/dist/embeds/index.d.ts.map +1 -1
- package/dist/features/BaseUrl/ServerForm.vue.d.ts.map +1 -1
- package/dist/features/BaseUrl/ServerForm.vue.js +2 -2
- package/dist/features/BaseUrl/ServerForm.vue2.js +5 -5
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.js +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue2.js +118 -129
- package/dist/{components/Content/Operation/PathResponses/Headers.vue.d.ts → features/ExampleResponses/ExampleResponse.vue.d.ts} +4 -4
- package/dist/features/ExampleResponses/ExampleResponse.vue.d.ts.map +1 -0
- package/dist/features/ExampleResponses/ExampleResponse.vue.js +7 -0
- package/dist/features/ExampleResponses/ExampleResponse.vue2.js +37 -0
- package/dist/{components/Content/Operation/PathResponses/PathResponses.vue.d.ts → features/ExampleResponses/ExampleResponses.vue.d.ts} +1 -1
- package/dist/features/ExampleResponses/ExampleResponses.vue.d.ts.map +1 -0
- package/dist/features/ExampleResponses/ExampleResponses.vue.js +7 -0
- package/dist/{components/Content/Operation/PathResponses/PathResponses.vue2.js → features/ExampleResponses/ExampleResponses.vue2.js} +18 -18
- package/dist/features/ExampleResponses/index.d.ts +2 -0
- package/dist/features/ExampleResponses/index.d.ts.map +1 -0
- package/dist/helpers/createRequest.d.ts +6 -0
- package/dist/helpers/createRequest.d.ts.map +1 -0
- package/dist/helpers/createRequest.js +16 -0
- package/dist/helpers/getExampleCode.d.ts +9 -0
- package/dist/helpers/getExampleCode.d.ts.map +1 -0
- package/dist/helpers/getExampleCode.js +27 -0
- package/dist/helpers/index.d.ts +2 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/mergeAllObjects.d.ts +3 -0
- package/dist/helpers/mergeAllObjects.d.ts.map +1 -1
- package/dist/hooks/useReactiveSpec.d.ts +7 -1
- package/dist/hooks/useReactiveSpec.d.ts.map +1 -1
- package/dist/hooks/useResponses.d.ts +4 -0
- package/dist/hooks/useResponses.d.ts.map +1 -1
- package/dist/hooks/useResponses.js +11 -10
- package/dist/index.js +72 -68
- package/dist/legacy/helpers/index.d.ts +1 -0
- package/dist/legacy/helpers/index.d.ts.map +1 -1
- package/dist/legacy/helpers/normalizeHeaderName.d.ts +5 -0
- package/dist/legacy/helpers/normalizeHeaderName.d.ts.map +1 -0
- package/dist/legacy/helpers/normalizeHeaderName.js +6 -0
- package/dist/legacy/helpers/normalizeHeaders.d.ts.map +1 -1
- package/dist/legacy/helpers/normalizeHeaders.js +15 -17
- package/dist/legacy/stores/useOpenApiStore.d.ts +7 -1
- package/dist/legacy/stores/useOpenApiStore.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +0 -8
- package/dist/types.d.ts.map +1 -1
- package/package.json +11 -11
- package/dist/components/Content/Operation/PathResponses/ExampleResponse.vue.d.ts.map +0 -1
- package/dist/components/Content/Operation/PathResponses/ExampleResponse.vue.js +0 -7
- package/dist/components/Content/Operation/PathResponses/ExampleResponse.vue2.js +0 -101
- package/dist/components/Content/Operation/PathResponses/Headers.vue.d.ts.map +0 -1
- package/dist/components/Content/Operation/PathResponses/PathResponses.vue.d.ts.map +0 -1
- package/dist/components/Content/Operation/PathResponses/PathResponses.vue.js +0 -7
- package/dist/components/Content/Operation/PathResponses/index.d.ts +0 -2
- package/dist/components/Content/Operation/PathResponses/index.d.ts.map +0 -1
- package/dist/components/SimpleTable/SimpleCell.vue.d.ts +0 -50
- package/dist/components/SimpleTable/SimpleCell.vue.d.ts.map +0 -1
- package/dist/components/SimpleTable/SimpleHeader.vue.d.ts +0 -12
- package/dist/components/SimpleTable/SimpleHeader.vue.d.ts.map +0 -1
- package/dist/components/SimpleTable/SimpleRow.vue.d.ts +0 -12
- package/dist/components/SimpleTable/SimpleRow.vue.d.ts.map +0 -1
- package/dist/components/SimpleTable/SimpleTable.stories.d.ts +0 -7
- package/dist/components/SimpleTable/SimpleTable.stories.d.ts.map +0 -1
- package/dist/components/SimpleTable/SimpleTable.vue.d.ts +0 -12
- package/dist/components/SimpleTable/SimpleTable.vue.d.ts.map +0 -1
- package/dist/components/SimpleTable/index.d.ts +0 -5
- package/dist/components/SimpleTable/index.d.ts.map +0 -1
|
@@ -3,7 +3,7 @@ import { ScalarMarkdown as V } from "@scalar/components";
|
|
|
3
3
|
import B from "./ServerUrl.vue.js";
|
|
4
4
|
import R from "./ServerUrlSelect.vue.js";
|
|
5
5
|
import g from "./ServerVariablesForm.vue.js";
|
|
6
|
-
const y = (r) => (N("data-v-
|
|
6
|
+
const y = (r) => (N("data-v-465cec21"), r = r(), U(), r), E = { key: 0 }, F = /* @__PURE__ */ y(() => /* @__PURE__ */ t("span", { class: "server-form-title" }, "Base URL", -1)), L = { class: "server-form" }, M = { class: "server-form-container" }, $ = { class: "server-item" }, j = {
|
|
7
7
|
key: 0,
|
|
8
8
|
muted: ""
|
|
9
9
|
}, q = { class: "description" }, H = /* @__PURE__ */ S({
|
|
@@ -23,8 +23,8 @@ const y = (r) => (N("data-v-da7210d5"), r = r(), U(), r), E = { key: 0 }, F = /*
|
|
|
23
23
|
return (e = i.servers) == null ? void 0 : e[l.value];
|
|
24
24
|
});
|
|
25
25
|
return (e, s) => {
|
|
26
|
-
var
|
|
27
|
-
return (
|
|
26
|
+
var v, n, d;
|
|
27
|
+
return (v = e.servers) != null && v.length ? (c(), u("div", E, [
|
|
28
28
|
F,
|
|
29
29
|
t("div", L, [
|
|
30
30
|
t("div", M, [
|
|
@@ -45,12 +45,12 @@ const y = (r) => (N("data-v-da7210d5"), r = r(), U(), r), E = { key: 0 }, F = /*
|
|
|
45
45
|
]),
|
|
46
46
|
o(g, {
|
|
47
47
|
values: e.variables,
|
|
48
|
-
variables: (
|
|
48
|
+
variables: (n = a.value) == null ? void 0 : n.variables,
|
|
49
49
|
"onUpdate:variable": s[0] || (s[0] = (b, h) => e.$emit("update:variable", b, h))
|
|
50
50
|
}, null, 8, ["values", "variables"])
|
|
51
51
|
])
|
|
52
52
|
]),
|
|
53
|
-
(
|
|
53
|
+
(d = a.value) != null && d.description ? (c(), u("div", j, [
|
|
54
54
|
t("div", q, [
|
|
55
55
|
o(C(V), {
|
|
56
56
|
value: a.value.description
|
|
@@ -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":"AA4XA,OAAO,KAAK,EAGV,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;AA8P7B,iBAAS,cAAc;oBAiNM,GAAG;oBACH,GAAG;EAmC/B;AACD,QAAA,MAAM,eAAe;eArdR,oBAAoB;;eAApB,oBAAoB;aA2d/B,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;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,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 p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-292a80da"]]);
|
|
5
5
|
export {
|
|
6
6
|
p as default
|
|
7
7
|
};
|
|
@@ -1,51 +1,50 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarCodeBlock as
|
|
3
|
-
import { createHash as D, ssrState as
|
|
4
|
-
import { getRequestFromOperation as
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import G from "./ExamplePicker.vue.js";
|
|
9
|
-
import ee from "./TextSelect.vue.js";
|
|
1
|
+
import { defineComponent as U, ref as b, computed as d, watch as L, inject as I, onServerPrefetch as M, useSSRContext as P, unref as r, openBlock as f, createBlock as V, withCtx as u, createVNode as m, createElementBlock as v, Fragment as O, createTextVNode as R, toDisplayString as g, createElementVNode as H, renderSlot as N, createCommentVNode as h } from "vue";
|
|
2
|
+
import { ScalarCodeBlock as Y } from "@scalar/components";
|
|
3
|
+
import { createHash as D, ssrState as z } from "@scalar/oas-utils/helpers";
|
|
4
|
+
import { getRequestFromOperation as Q } from "@scalar/oas-utils/spec-getters";
|
|
5
|
+
import { asyncComputed as W } from "@vueuse/core";
|
|
6
|
+
import X from "./ExamplePicker.vue.js";
|
|
7
|
+
import Z from "./TextSelect.vue.js";
|
|
10
8
|
/* empty css */
|
|
11
|
-
import { GLOBAL_SECURITY_SYMBOL as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { getSecretCredentialsFromAuthentication as
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
9
|
+
import { GLOBAL_SECURITY_SYMBOL as G } from "../../helpers/provideSymbols.js";
|
|
10
|
+
import ee from "../../components/Card/Card.vue.js";
|
|
11
|
+
import te from "../../components/Card/CardHeader.vue.js";
|
|
12
|
+
import oe from "../../components/HttpMethod/HttpMethod.vue.js";
|
|
13
|
+
import re from "../../components/Card/CardContent.vue.js";
|
|
14
|
+
import { getSecretCredentialsFromAuthentication as ae, getRequestFromAuthentication as ne } from "../../legacy/helpers/getRequestFromAuthentication.js";
|
|
15
|
+
import se from "../../components/Card/CardFooter.vue.js";
|
|
16
|
+
import { getExampleCode as le } from "../../helpers/getExampleCode.js";
|
|
17
|
+
import { useHttpClientStore as ie } from "../../stores/useHttpClientStore.js";
|
|
18
|
+
import { useServerStore as ce } from "../../legacy/stores/useServerStore.js";
|
|
20
19
|
import { getApiClientRequest as ue } from "../../helpers/getApiClientRequest.js";
|
|
21
20
|
import { useAuthenticationStore as me } from "../../legacy/stores/useAuthenticationStore.js";
|
|
22
|
-
import { getHarRequest as
|
|
23
|
-
import { getUrlFromServerState as
|
|
24
|
-
const
|
|
21
|
+
import { getHarRequest as pe } from "../../helpers/getHarRequest.js";
|
|
22
|
+
import { getUrlFromServerState as de } from "../../legacy/helpers/getUrlFromServerState.js";
|
|
23
|
+
const fe = { class: "request-header" }, ye = { class: "code-snippet" }, ve = {
|
|
25
24
|
key: 0,
|
|
26
25
|
class: "request-card-footer-addon"
|
|
27
|
-
},
|
|
26
|
+
}, Je = /* @__PURE__ */ U({
|
|
28
27
|
__name: "ExampleRequest",
|
|
29
28
|
props: {
|
|
30
29
|
operation: {}
|
|
31
30
|
},
|
|
32
|
-
setup(
|
|
33
|
-
const n =
|
|
31
|
+
setup(B) {
|
|
32
|
+
const n = B, K = `components-Content-Operation-Example-Request${D(
|
|
34
33
|
n.operation.path + n.operation.httpVerb + n.operation.operationId
|
|
35
|
-
)}`,
|
|
36
|
-
httpClient:
|
|
34
|
+
)}`, x = b(), {
|
|
35
|
+
httpClient: a,
|
|
37
36
|
setHttpClient: $,
|
|
38
|
-
availableTargets:
|
|
39
|
-
httpTargetTitle:
|
|
37
|
+
availableTargets: C,
|
|
38
|
+
httpTargetTitle: j,
|
|
40
39
|
httpClientTitle: F
|
|
41
|
-
} =
|
|
42
|
-
var
|
|
43
|
-
const
|
|
44
|
-
for (const o of
|
|
45
|
-
if ((
|
|
40
|
+
} = ie(), { server: S } = ce(), { authentication: y } = me(), i = d(() => {
|
|
41
|
+
var t;
|
|
42
|
+
const e = ["x-custom-examples", "x-codeSamples", "x-code-samples"];
|
|
43
|
+
for (const o of e)
|
|
44
|
+
if ((t = n.operation.information) != null && t[o])
|
|
46
45
|
return n.operation.information[o] ?? [];
|
|
47
46
|
return [];
|
|
48
|
-
}), s =
|
|
47
|
+
}), s = b(
|
|
49
48
|
// Default to first custom example
|
|
50
49
|
i.value.length ? {
|
|
51
50
|
targetKey: "customExamples",
|
|
@@ -53,189 +52,179 @@ const ye = { class: "request-header" }, ve = { class: "code-snippet" }, ge = {
|
|
|
53
52
|
} : (
|
|
54
53
|
// Otherwise use the globally selected HTTP client
|
|
55
54
|
{
|
|
56
|
-
targetKey:
|
|
57
|
-
clientKey:
|
|
55
|
+
targetKey: a.targetKey,
|
|
56
|
+
clientKey: a.clientKey
|
|
58
57
|
}
|
|
59
58
|
)
|
|
60
59
|
);
|
|
61
|
-
|
|
60
|
+
L(a, () => {
|
|
62
61
|
s.value = {
|
|
63
|
-
targetKey:
|
|
64
|
-
clientKey:
|
|
62
|
+
targetKey: a.targetKey,
|
|
63
|
+
clientKey: a.clientKey
|
|
65
64
|
};
|
|
66
65
|
});
|
|
67
|
-
const
|
|
66
|
+
const E = d(
|
|
68
67
|
() => {
|
|
69
|
-
var
|
|
68
|
+
var e, t, o, l;
|
|
70
69
|
return Object.keys(
|
|
71
|
-
((l = (o = (
|
|
70
|
+
((l = (o = (t = (e = n.operation.information) == null ? void 0 : e.requestBody) == null ? void 0 : t.content) == null ? void 0 : o["application/json"]) == null ? void 0 : l.examples) ?? {}
|
|
72
71
|
).length > 1;
|
|
73
72
|
}
|
|
74
|
-
), c =
|
|
75
|
-
async function
|
|
76
|
-
var l,
|
|
73
|
+
), c = I(G);
|
|
74
|
+
async function k() {
|
|
75
|
+
var l, p;
|
|
77
76
|
if (s.value.targetKey === "customExamples")
|
|
78
77
|
return ((l = i.value[s.value.clientKey]) == null ? void 0 : l.source) ?? "";
|
|
79
|
-
const
|
|
78
|
+
const e = pe(
|
|
80
79
|
{
|
|
81
|
-
url:
|
|
80
|
+
url: de(S)
|
|
82
81
|
},
|
|
83
|
-
|
|
82
|
+
Q(
|
|
84
83
|
n.operation,
|
|
85
84
|
{
|
|
86
85
|
replaceVariables: !0
|
|
87
86
|
},
|
|
88
|
-
|
|
87
|
+
x.value
|
|
89
88
|
),
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
((
|
|
89
|
+
ne(
|
|
90
|
+
y,
|
|
91
|
+
((p = n.operation.information) == null ? void 0 : p.security) ?? (c == null ? void 0 : c())
|
|
93
92
|
)
|
|
94
|
-
),
|
|
95
|
-
|
|
96
|
-
return B().print(o, e, t) ?? "";
|
|
97
|
-
try {
|
|
98
|
-
const g = await new Z(t).convert(
|
|
99
|
-
r.targetKey,
|
|
100
|
-
r.clientKey
|
|
101
|
-
);
|
|
102
|
-
return decodeURIComponent(g);
|
|
103
|
-
} catch (d) {
|
|
104
|
-
return console.error("[ExampleRequest]", d), "";
|
|
105
|
-
}
|
|
93
|
+
), t = a.clientKey === "undici" || a.clientKey === "fetch" || a.clientKey === "ofetch" ? a.clientKey : null, o = a.targetKey;
|
|
94
|
+
return await le(e, o, t) ?? "";
|
|
106
95
|
}
|
|
107
|
-
const
|
|
96
|
+
const q = W(async () => {
|
|
108
97
|
try {
|
|
109
|
-
return await
|
|
110
|
-
} catch (
|
|
111
|
-
return console.error("[generateSnippet]",
|
|
98
|
+
return await k();
|
|
99
|
+
} catch (e) {
|
|
100
|
+
return console.error("[generateSnippet]", e), "";
|
|
112
101
|
}
|
|
113
|
-
},
|
|
102
|
+
}, z[K] ?? "");
|
|
114
103
|
M(async () => {
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
}),
|
|
118
|
-
serverState:
|
|
119
|
-
authenticationState:
|
|
104
|
+
const e = P();
|
|
105
|
+
e.payload.data[K] = await k();
|
|
106
|
+
}), d(() => ue({
|
|
107
|
+
serverState: S,
|
|
108
|
+
authenticationState: y,
|
|
120
109
|
operation: n.operation,
|
|
121
110
|
globalSecurity: c == null ? void 0 : c()
|
|
122
111
|
}));
|
|
123
|
-
const
|
|
124
|
-
var
|
|
125
|
-
const
|
|
112
|
+
const T = d(() => {
|
|
113
|
+
var t, o;
|
|
114
|
+
const e = (
|
|
126
115
|
// Specified language
|
|
127
|
-
((
|
|
116
|
+
((t = s.value) == null ? void 0 : t.targetKey) === "customExamples" ? ((o = i.value[s.value.clientKey]) == null ? void 0 : o.lang) ?? "plaintext" : (
|
|
128
117
|
// Or language for the globally selected HTTP client
|
|
129
|
-
|
|
118
|
+
a.targetKey
|
|
130
119
|
)
|
|
131
120
|
);
|
|
132
|
-
return
|
|
133
|
-
}),
|
|
134
|
-
const
|
|
135
|
-
value:
|
|
136
|
-
label:
|
|
137
|
-
options:
|
|
121
|
+
return e === "shell" && q.value.includes("curl") ? "curl" : e === "Objective-C" ? "objc" : e;
|
|
122
|
+
}), w = d(() => {
|
|
123
|
+
const e = C.value.map((t) => ({
|
|
124
|
+
value: t.key,
|
|
125
|
+
label: t.title,
|
|
126
|
+
options: t.clients.map((o) => ({
|
|
138
127
|
value: JSON.stringify({
|
|
139
|
-
targetKey:
|
|
128
|
+
targetKey: t.key,
|
|
140
129
|
clientKey: o.key
|
|
141
130
|
}),
|
|
142
131
|
label: o.title
|
|
143
132
|
}))
|
|
144
133
|
}));
|
|
145
|
-
return i.value.length &&
|
|
134
|
+
return i.value.length && e.unshift({
|
|
146
135
|
value: "customExamples",
|
|
147
136
|
label: "Examples",
|
|
148
|
-
options: i.value.map((
|
|
137
|
+
options: i.value.map((t, o) => ({
|
|
149
138
|
value: JSON.stringify({
|
|
150
139
|
targetKey: "customExamples",
|
|
151
140
|
clientKey: o
|
|
152
141
|
}),
|
|
153
|
-
label:
|
|
142
|
+
label: t.label ?? t.lang ?? `Example #${o + 1}`
|
|
154
143
|
}))
|
|
155
|
-
}),
|
|
144
|
+
}), e;
|
|
156
145
|
});
|
|
157
|
-
function
|
|
158
|
-
const
|
|
159
|
-
|
|
146
|
+
function A(e) {
|
|
147
|
+
const t = JSON.parse(e);
|
|
148
|
+
t.targetKey === "customExamples" ? s.value = t : $(t);
|
|
160
149
|
}
|
|
161
|
-
return (
|
|
150
|
+
return (e, t) => r(C).length || i.value.length ? (f(), V(r(ee), {
|
|
162
151
|
key: 0,
|
|
163
152
|
class: "dark-mode"
|
|
164
153
|
}, {
|
|
165
|
-
default:
|
|
166
|
-
|
|
167
|
-
actions:
|
|
168
|
-
|
|
154
|
+
default: u(() => [
|
|
155
|
+
m(r(te), { muted: "" }, {
|
|
156
|
+
actions: u(() => [
|
|
157
|
+
m(Z, {
|
|
169
158
|
class: "request-client-picker",
|
|
170
159
|
modelValue: JSON.stringify(s.value),
|
|
171
|
-
options:
|
|
172
|
-
"onUpdate:modelValue":
|
|
160
|
+
options: w.value,
|
|
161
|
+
"onUpdate:modelValue": A
|
|
173
162
|
}, {
|
|
174
|
-
default:
|
|
175
|
-
s.value.targetKey === "customExamples" ? (
|
|
176
|
-
|
|
177
|
-
], 64)) : (
|
|
178
|
-
|
|
163
|
+
default: u(() => [
|
|
164
|
+
s.value.targetKey === "customExamples" ? (f(), v(O, { key: 0 }, [
|
|
165
|
+
R(g(i.value[s.value.clientKey].label ?? "Example"), 1)
|
|
166
|
+
], 64)) : (f(), v(O, { key: 1 }, [
|
|
167
|
+
R(g(r(j)) + " " + g(r(F)), 1)
|
|
179
168
|
], 64))
|
|
180
169
|
]),
|
|
181
170
|
_: 1
|
|
182
171
|
}, 8, ["modelValue", "options"])
|
|
183
172
|
]),
|
|
184
|
-
default:
|
|
185
|
-
|
|
186
|
-
|
|
173
|
+
default: u(() => [
|
|
174
|
+
H("div", fe, [
|
|
175
|
+
m(r(oe), {
|
|
187
176
|
as: "span",
|
|
188
177
|
class: "request-method",
|
|
189
|
-
method:
|
|
178
|
+
method: e.operation.httpVerb
|
|
190
179
|
}, null, 8, ["method"]),
|
|
191
|
-
|
|
180
|
+
N(e.$slots, "header", {}, void 0, !0)
|
|
192
181
|
])
|
|
193
182
|
]),
|
|
194
183
|
_: 3
|
|
195
184
|
}),
|
|
196
|
-
|
|
185
|
+
m(r(re), {
|
|
197
186
|
borderless: "",
|
|
198
187
|
class: "request-editor-section custom-scroll",
|
|
199
188
|
frameless: ""
|
|
200
189
|
}, {
|
|
201
|
-
default:
|
|
202
|
-
|
|
203
|
-
|
|
190
|
+
default: u(() => [
|
|
191
|
+
H("div", ye, [
|
|
192
|
+
m(r(Y), {
|
|
204
193
|
class: "bg-b-2",
|
|
205
|
-
content:
|
|
206
|
-
hideCredentials:
|
|
207
|
-
lang:
|
|
194
|
+
content: r(q),
|
|
195
|
+
hideCredentials: r(ae)(r(y)),
|
|
196
|
+
lang: T.value,
|
|
208
197
|
lineNumbers: ""
|
|
209
198
|
}, null, 8, ["content", "hideCredentials", "lang"])
|
|
210
199
|
])
|
|
211
200
|
]),
|
|
212
201
|
_: 1
|
|
213
202
|
}),
|
|
214
|
-
|
|
203
|
+
E.value || e.$slots.footer ? (f(), V(r(se), {
|
|
215
204
|
key: 0,
|
|
216
205
|
class: "request-card-footer",
|
|
217
206
|
contrast: ""
|
|
218
207
|
}, {
|
|
219
|
-
default:
|
|
220
|
-
var o, l,
|
|
208
|
+
default: u(() => {
|
|
209
|
+
var o, l, p, _;
|
|
221
210
|
return [
|
|
222
|
-
|
|
223
|
-
|
|
211
|
+
E.value ? (f(), v("div", ve, [
|
|
212
|
+
m(X, {
|
|
224
213
|
class: "request-example-selector",
|
|
225
|
-
examples: ((
|
|
226
|
-
"onUpdate:modelValue":
|
|
214
|
+
examples: ((_ = (p = (l = (o = e.operation.information) == null ? void 0 : o.requestBody) == null ? void 0 : l.content) == null ? void 0 : p["application/json"]) == null ? void 0 : _.examples) ?? [],
|
|
215
|
+
"onUpdate:modelValue": t[0] || (t[0] = (J) => x.value = J)
|
|
227
216
|
}, null, 8, ["examples"])
|
|
228
|
-
])) :
|
|
229
|
-
|
|
217
|
+
])) : h("", !0),
|
|
218
|
+
N(e.$slots, "footer", {}, void 0, !0)
|
|
230
219
|
];
|
|
231
220
|
}),
|
|
232
221
|
_: 3
|
|
233
|
-
})) :
|
|
222
|
+
})) : h("", !0)
|
|
234
223
|
]),
|
|
235
224
|
_: 3
|
|
236
|
-
})) :
|
|
225
|
+
})) : h("", !0);
|
|
237
226
|
}
|
|
238
227
|
});
|
|
239
228
|
export {
|
|
240
|
-
|
|
229
|
+
Je as default
|
|
241
230
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { OpenAPI } from '@scalar/openapi-types';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
3
|
-
|
|
3
|
+
response: OpenAPI.ResponseObject;
|
|
4
4
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
5
|
-
|
|
5
|
+
response: OpenAPI.ResponseObject;
|
|
6
6
|
}>>>, {}, {}>;
|
|
7
7
|
export default _default;
|
|
8
8
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -14,4 +14,4 @@ type __VLS_TypePropsToOption<T> = {
|
|
|
14
14
|
required: true;
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=
|
|
17
|
+
//# sourceMappingURL=ExampleResponse.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleResponse.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ExampleResponses/ExampleResponse.vue"],"names":[],"mappings":"AAsGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;;cAKxC,OAAO,CAAC,cAAc;;cAAtB,OAAO,CAAC,cAAc;;AA2GlC,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineComponent as c, openBlock as n, createBlock as a, unref as e, createElementBlock as i } from "vue";
|
|
2
|
+
import { ScalarCodeBlock as m } from "@scalar/components";
|
|
3
|
+
import { prettyPrintJson as l } from "@scalar/oas-utils/helpers";
|
|
4
|
+
import { getExampleFromSchema as d } from "@scalar/oas-utils/spec-getters";
|
|
5
|
+
const f = {
|
|
6
|
+
key: 2,
|
|
7
|
+
class: "empty-state"
|
|
8
|
+
}, B = /* @__PURE__ */ c({
|
|
9
|
+
__name: "ExampleResponse",
|
|
10
|
+
props: {
|
|
11
|
+
response: {}
|
|
12
|
+
},
|
|
13
|
+
setup(k) {
|
|
14
|
+
return (o, u) => {
|
|
15
|
+
var s, t, r, p;
|
|
16
|
+
return (s = o.response) != null && s.example ? (n(), a(e(m), {
|
|
17
|
+
key: 0,
|
|
18
|
+
class: "bg-b-2",
|
|
19
|
+
content: e(l)((t = o.response) == null ? void 0 : t.example),
|
|
20
|
+
lang: "json"
|
|
21
|
+
}, null, 8, ["content"])) : (r = o.response) != null && r.schema ? (n(), a(e(m), {
|
|
22
|
+
key: 1,
|
|
23
|
+
class: "bg-b-2",
|
|
24
|
+
content: e(l)(
|
|
25
|
+
e(d)((p = o.response) == null ? void 0 : p.schema, {
|
|
26
|
+
emptyString: "…",
|
|
27
|
+
mode: "read"
|
|
28
|
+
})
|
|
29
|
+
),
|
|
30
|
+
lang: "json"
|
|
31
|
+
}, null, 8, ["content"])) : (n(), i("div", f, " No Body "));
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
export {
|
|
36
|
+
B as default
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleResponses.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ExampleResponses/ExampleResponses.vue"],"names":[],"mappings":"AAqTA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;;eAoB7B,oBAAoB;;eAApB,oBAAoB;;AAoXvD,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { defineComponent as B, ref as S, computed as v, openBlock as t, createBlock as r, unref as s, withCtx as c, createVNode as b, createElementBlock as x, createCommentVNode as f, createTextVNode as g, withDirectives as M, createElementVNode as
|
|
2
|
-
import { ScalarIcon as
|
|
1
|
+
import { defineComponent as B, ref as S, computed as v, openBlock as t, createBlock as r, unref as s, withCtx as c, createVNode as b, createElementBlock as x, createCommentVNode as f, createTextVNode as g, withDirectives as M, createElementVNode as E, vModelCheckbox as N, Fragment as R, renderList as F, toDisplayString as O, pushScopeId as A, popScopeId as D } from "vue";
|
|
2
|
+
import { ScalarIcon as P, ScalarCodeBlock as U, ScalarMarkdown as H } from "@scalar/components";
|
|
3
3
|
import { normalizeMimeTypeObject as J } from "@scalar/oas-utils/helpers";
|
|
4
4
|
import T from "./ExampleResponse.vue.js";
|
|
5
|
-
import K from "
|
|
6
|
-
import L from "
|
|
7
|
-
import W from "
|
|
8
|
-
import q from "
|
|
9
|
-
import G from "
|
|
10
|
-
import Q from "
|
|
11
|
-
import { useClipboard as X } from "
|
|
12
|
-
const Y = (u) => (
|
|
5
|
+
import K from "../../components/Card/Card.vue.js";
|
|
6
|
+
import L from "../../components/Card/CardTabHeader.vue.js";
|
|
7
|
+
import W from "../../components/Card/CardTab.vue.js";
|
|
8
|
+
import q from "../../components/Card/CardContent.vue.js";
|
|
9
|
+
import G from "../../components/Card/CardFooter.vue.js";
|
|
10
|
+
import Q from "../ExampleRequest/ExamplePicker.vue.js";
|
|
11
|
+
import { useClipboard as X } from "../../hooks/useClipboard.js";
|
|
12
|
+
const Y = (u) => (A("data-v-0696399e"), u = u(), D(), u), Z = {
|
|
13
13
|
key: 1,
|
|
14
14
|
class: "scalar-card-checkbox"
|
|
15
|
-
}, $ = /* @__PURE__ */ Y(() => /* @__PURE__ */
|
|
15
|
+
}, $ = /* @__PURE__ */ Y(() => /* @__PURE__ */ E("span", { class: "scalar-card-checkbox-checkmark" }, null, -1)), z = { class: "scalar-card-container custom-scroll" }, ee = {
|
|
16
16
|
key: 1,
|
|
17
17
|
class: "response-description"
|
|
18
18
|
}, ie = /* @__PURE__ */ B({
|
|
19
|
-
__name: "
|
|
19
|
+
__name: "ExampleResponses",
|
|
20
20
|
props: {
|
|
21
21
|
operation: {}
|
|
22
22
|
},
|
|
@@ -28,9 +28,9 @@ const Y = (u) => (P("data-v-b976599a"), u = u(), A(), u), Z = {
|
|
|
28
28
|
}
|
|
29
29
|
), y = v(
|
|
30
30
|
() => !!o.value.examples
|
|
31
|
-
),
|
|
31
|
+
), w = S(0), m = v(() => {
|
|
32
32
|
var a, i;
|
|
33
|
-
const e = C.value[
|
|
33
|
+
const e = C.value[w.value];
|
|
34
34
|
return (i = (a = k.operation.information) == null ? void 0 : a.responses) == null ? void 0 : i[e];
|
|
35
35
|
}), o = v(() => {
|
|
36
36
|
var a;
|
|
@@ -55,7 +55,7 @@ const Y = (u) => (P("data-v-b976599a"), u = u(), A(), u), Z = {
|
|
|
55
55
|
...o.value,
|
|
56
56
|
example: y.value && p.value ? o.value.examples[p.value].value ?? o.value.examples[p.value] : j()
|
|
57
57
|
})), I = (e) => {
|
|
58
|
-
|
|
58
|
+
w.value = e, p.value = void 0;
|
|
59
59
|
}, _ = S(!1);
|
|
60
60
|
return (e, a) => C.value.length ? (t(), r(s(K), { key: 0 }, {
|
|
61
61
|
default: c(() => {
|
|
@@ -78,7 +78,7 @@ const Y = (u) => (P("data-v-b976599a"), u = u(), A(), u), Z = {
|
|
|
78
78
|
return s(V)((n = o.value) == null ? void 0 : n.example);
|
|
79
79
|
})
|
|
80
80
|
}, [
|
|
81
|
-
b(s(
|
|
81
|
+
b(s(P), {
|
|
82
82
|
icon: "Clipboard",
|
|
83
83
|
width: "12px",
|
|
84
84
|
x: "asd"
|
|
@@ -86,7 +86,7 @@ const Y = (u) => (P("data-v-b976599a"), u = u(), A(), u), Z = {
|
|
|
86
86
|
])) : f("", !0),
|
|
87
87
|
(d = o.value) != null && d.schema ? (t(), x("label", Z, [
|
|
88
88
|
g(" Show Schema "),
|
|
89
|
-
M(
|
|
89
|
+
M(E("input", {
|
|
90
90
|
"onUpdate:modelValue": a[1] || (a[1] = (n) => _.value = n),
|
|
91
91
|
class: "scalar-card-checkbox-input",
|
|
92
92
|
type: "checkbox"
|
|
@@ -107,7 +107,7 @@ const Y = (u) => (P("data-v-b976599a"), u = u(), A(), u), Z = {
|
|
|
107
107
|
]),
|
|
108
108
|
_: 1
|
|
109
109
|
}),
|
|
110
|
-
|
|
110
|
+
E("div", z, [
|
|
111
111
|
b(s(q), { muted: "" }, {
|
|
112
112
|
default: c(() => {
|
|
113
113
|
var l;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/ExampleResponses/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createRequest.d.ts","sourceRoot":"","sources":["../../src/helpers/createRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAE/C;;GAEG;AACH,wBAAgB,aAAa,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAYxE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Request, type ClientId as SnippetzClientId, type TargetId as SnippetzTargetId } from '@scalar/snippetz';
|
|
2
|
+
import { type ClientId as HttpSnippetLiteClientId, type TargetId as HttpSnippetLiteTargetId } from 'httpsnippet-lite';
|
|
3
|
+
export type TargetId = HttpSnippetLiteTargetId | SnippetzTargetId;
|
|
4
|
+
export type ClientId = HttpSnippetLiteClientId | SnippetzClientId;
|
|
5
|
+
/**
|
|
6
|
+
* Returns a code example for given HAR request
|
|
7
|
+
*/
|
|
8
|
+
export declare function getExampleCode(request: Request, target: TargetId, client: ClientId): Promise<string>;
|
|
9
|
+
//# sourceMappingURL=getExampleCode.d.ts.map
|