@scalar/api-reference 1.28.9 → 1.28.10
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 +10 -0
- package/dist/browser/standalone.js +1191 -1149
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +2 -2
- package/dist/components/ApiReferenceLayout.vue2.js +1 -1
- package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/Models.vue.js +2 -2
- package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.js +4 -4
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue2.js +96 -114
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.d.ts +8 -0
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.d.ts.map +1 -0
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +7 -0
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue2.js +71 -0
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts +2 -0
- 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 +139 -130
- package/dist/features/ApiClientModal/useApiClient.d.ts +40 -14
- package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
- package/dist/features/ExampleResponses/ExampleResponses.vue.d.ts.map +1 -1
- package/dist/features/ExampleResponses/ExampleResponses.vue.js +2 -2
- package/dist/features/ExampleResponses/ExampleResponses.vue2.js +86 -85
- package/dist/helpers/get-request.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +7 -7
|
@@ -1,175 +1,176 @@
|
|
|
1
|
-
import { defineComponent as M, useId as N, ref as
|
|
2
|
-
import { ScalarIcon as D, ScalarCodeBlock as
|
|
3
|
-
import { normalizeMimeTypeObject as H } from "@scalar/oas-utils/helpers";
|
|
1
|
+
import { defineComponent as M, useId as N, ref as E, computed as v, openBlock as o, createBlock as r, unref as s, withCtx as u, createVNode as x, createElementBlock as f, createCommentVNode as k, createTextVNode as g, withDirectives as O, createElementVNode as R, vModelCheckbox as F, Fragment as C, renderList as I, toDisplayString as A } from "vue";
|
|
2
|
+
import { ScalarIcon as D, ScalarCodeBlock as K, ScalarMarkdown as P } from "@scalar/components";
|
|
3
|
+
import { normalizeMimeTypeObject as U, getObjectKeys as H } from "@scalar/oas-utils/helpers";
|
|
4
4
|
import { useClipboard as J } from "@scalar/use-hooks/useClipboard";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
const
|
|
5
|
+
import L from "../../components/ScreenReader.vue.js";
|
|
6
|
+
import T from "./ExampleResponse.vue.js";
|
|
7
|
+
import W from "../../components/Card/Card.vue.js";
|
|
8
|
+
import q from "../../components/Card/CardTabHeader.vue.js";
|
|
9
|
+
import G from "../../components/Card/CardTab.vue.js";
|
|
10
|
+
import Q from "../../components/Card/CardContent.vue.js";
|
|
11
|
+
import X from "../../components/Card/CardFooter.vue.js";
|
|
12
|
+
import Y from "../ExampleRequest/ExamplePicker.vue.js";
|
|
13
|
+
const Z = {
|
|
14
14
|
key: 1,
|
|
15
15
|
class: "scalar-card-checkbox"
|
|
16
|
-
},
|
|
16
|
+
}, $ = ["aria-controls"], z = { class: "scalar-card-container custom-scroll" }, ee = {
|
|
17
17
|
key: 1,
|
|
18
18
|
class: "response-description"
|
|
19
|
-
},
|
|
19
|
+
}, de = /* @__PURE__ */ M({
|
|
20
20
|
__name: "ExampleResponses",
|
|
21
21
|
props: {
|
|
22
22
|
responses: {}
|
|
23
23
|
},
|
|
24
|
-
setup(
|
|
25
|
-
const
|
|
26
|
-
() => !!
|
|
27
|
-
),
|
|
24
|
+
setup(w) {
|
|
25
|
+
const n = N(), { copyToClipboard: V } = J(), p = E(), h = v(() => Object.keys(w.responses ?? {}).sort()), y = v(
|
|
26
|
+
() => !!l.value.examples
|
|
27
|
+
), j = E(0), i = v(() => {
|
|
28
28
|
var a;
|
|
29
|
-
const e =
|
|
30
|
-
return (a =
|
|
31
|
-
}),
|
|
32
|
-
var
|
|
33
|
-
const e =
|
|
34
|
-
(
|
|
35
|
-
);
|
|
29
|
+
const e = h.value[j.value];
|
|
30
|
+
return (a = w.responses) == null ? void 0 : a[e];
|
|
31
|
+
}), l = v(() => {
|
|
32
|
+
var m;
|
|
33
|
+
const e = U(
|
|
34
|
+
(m = i.value) == null ? void 0 : m.content
|
|
35
|
+
), a = H(e ?? {});
|
|
36
36
|
return (
|
|
37
37
|
// OpenAPI 3.x
|
|
38
|
-
(e == null ? void 0 : e["application/json"]) ?? (e == null ? void 0 : e["application/xml"]) ?? (e == null ? void 0 : e["text/plain"]) ?? (e == null ? void 0 : e["text/html"]) ?? (e == null ? void 0 : e["*/*"]) ?? //
|
|
38
|
+
(e == null ? void 0 : e["application/json"]) ?? (e == null ? void 0 : e["application/xml"]) ?? (e == null ? void 0 : e["text/plain"]) ?? (e == null ? void 0 : e["text/html"]) ?? (e == null ? void 0 : e["*/*"]) ?? // Take the first key - in the future we may want to use the selected content type
|
|
39
|
+
(e == null ? void 0 : e[a[0]]) ?? // Swagger 2.0
|
|
39
40
|
i.value
|
|
40
41
|
);
|
|
41
|
-
}),
|
|
42
|
-
if (!
|
|
43
|
-
return
|
|
44
|
-
if (Array.isArray(
|
|
45
|
-
return
|
|
46
|
-
const e = Object.keys(
|
|
47
|
-
return
|
|
48
|
-
},
|
|
49
|
-
...
|
|
50
|
-
example:
|
|
42
|
+
}), _ = () => {
|
|
43
|
+
if (!y.value)
|
|
44
|
+
return l.value.example;
|
|
45
|
+
if (Array.isArray(l.value.examples))
|
|
46
|
+
return l.value.examples[0];
|
|
47
|
+
const e = Object.keys(l.value.examples)[0];
|
|
48
|
+
return l.value.examples[e];
|
|
49
|
+
}, b = v(() => ({
|
|
50
|
+
...l.value,
|
|
51
|
+
example: y.value && p.value ? l.value.examples[p.value].value ?? l.value.examples[p.value] : _()
|
|
51
52
|
})), B = (e) => {
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
return (e, a) =>
|
|
53
|
+
j.value = e, p.value = void 0;
|
|
54
|
+
}, S = E(!1);
|
|
55
|
+
return (e, a) => h.value.length ? (o(), r(s(W), {
|
|
55
56
|
key: 0,
|
|
56
57
|
"aria-label": "Example Responses",
|
|
57
58
|
role: "region"
|
|
58
59
|
}, {
|
|
59
60
|
default: u(() => {
|
|
60
|
-
var
|
|
61
|
+
var m;
|
|
61
62
|
return [
|
|
62
|
-
|
|
63
|
+
x(s(q), {
|
|
63
64
|
muted: "",
|
|
64
65
|
x: "as",
|
|
65
66
|
onChange: B
|
|
66
67
|
}, {
|
|
67
68
|
actions: u(() => {
|
|
68
|
-
var
|
|
69
|
+
var t, d;
|
|
69
70
|
return [
|
|
70
|
-
(
|
|
71
|
+
(t = l.value) != null && t.example ? (o(), f("button", {
|
|
71
72
|
key: 0,
|
|
72
73
|
class: "code-copy",
|
|
73
74
|
type: "button",
|
|
74
75
|
onClick: a[0] || (a[0] = () => {
|
|
75
|
-
var
|
|
76
|
-
return
|
|
76
|
+
var c;
|
|
77
|
+
return s(V)((c = l.value) == null ? void 0 : c.example);
|
|
77
78
|
})
|
|
78
79
|
}, [
|
|
79
|
-
|
|
80
|
+
x(s(D), {
|
|
80
81
|
icon: "Clipboard",
|
|
81
82
|
width: "12px"
|
|
82
83
|
})
|
|
83
|
-
])) :
|
|
84
|
-
(
|
|
85
|
-
a[4] || (a[4] =
|
|
86
|
-
|
|
87
|
-
"onUpdate:modelValue": a[1] || (a[1] = (
|
|
88
|
-
"aria-controls":
|
|
84
|
+
])) : k("", !0),
|
|
85
|
+
(d = l.value) != null && d.schema ? (o(), f("label", Z, [
|
|
86
|
+
a[4] || (a[4] = g(" Show Schema ")),
|
|
87
|
+
O(R("input", {
|
|
88
|
+
"onUpdate:modelValue": a[1] || (a[1] = (c) => S.value = c),
|
|
89
|
+
"aria-controls": s(n),
|
|
89
90
|
class: "scalar-card-checkbox-input",
|
|
90
91
|
type: "checkbox"
|
|
91
|
-
}, null, 8,
|
|
92
|
-
[
|
|
92
|
+
}, null, 8, $), [
|
|
93
|
+
[F, S.value]
|
|
93
94
|
]),
|
|
94
95
|
a[5] || (a[5] = R("span", { class: "scalar-card-checkbox-checkmark" }, null, -1))
|
|
95
|
-
])) :
|
|
96
|
+
])) : k("", !0)
|
|
96
97
|
];
|
|
97
98
|
}),
|
|
98
99
|
default: u(() => [
|
|
99
|
-
(o(!0),
|
|
100
|
-
key:
|
|
101
|
-
"aria-controls":
|
|
100
|
+
(o(!0), f(C, null, I(h.value, (t) => (o(), r(s(G), {
|
|
101
|
+
key: t,
|
|
102
|
+
"aria-controls": s(n)
|
|
102
103
|
}, {
|
|
103
104
|
default: u(() => [
|
|
104
|
-
|
|
105
|
+
x(L, null, {
|
|
105
106
|
default: u(() => a[3] || (a[3] = [
|
|
106
|
-
|
|
107
|
+
g("Status:")
|
|
107
108
|
])),
|
|
108
109
|
_: 1
|
|
109
110
|
}),
|
|
110
|
-
|
|
111
|
+
g(" " + A(t), 1)
|
|
111
112
|
]),
|
|
112
113
|
_: 2
|
|
113
114
|
}, 1032, ["aria-controls"]))), 128))
|
|
114
115
|
]),
|
|
115
116
|
_: 1
|
|
116
117
|
}),
|
|
117
|
-
R("div",
|
|
118
|
-
|
|
118
|
+
R("div", z, [
|
|
119
|
+
x(s(Q), { muted: "" }, {
|
|
119
120
|
default: u(() => {
|
|
120
|
-
var
|
|
121
|
+
var t;
|
|
121
122
|
return [
|
|
122
|
-
(
|
|
123
|
-
|
|
123
|
+
(t = l.value) != null && t.schema ? (o(), f(C, { key: 0 }, [
|
|
124
|
+
S.value && b.value ? (o(), r(s(K), {
|
|
124
125
|
key: 0,
|
|
125
|
-
id:
|
|
126
|
+
id: s(n),
|
|
126
127
|
class: "-outline-offset-2",
|
|
127
|
-
content:
|
|
128
|
+
content: b.value,
|
|
128
129
|
lang: "json"
|
|
129
|
-
}, null, 8, ["id", "content"])) : (o(),
|
|
130
|
+
}, null, 8, ["id", "content"])) : (o(), r(T, {
|
|
130
131
|
key: 1,
|
|
131
|
-
id:
|
|
132
|
-
response:
|
|
132
|
+
id: s(n),
|
|
133
|
+
response: b.value
|
|
133
134
|
}, null, 8, ["id", "response"]))
|
|
134
|
-
], 64)) : (o(),
|
|
135
|
+
], 64)) : (o(), r(T, {
|
|
135
136
|
key: 1,
|
|
136
|
-
id:
|
|
137
|
-
response:
|
|
137
|
+
id: s(n),
|
|
138
|
+
response: b.value
|
|
138
139
|
}, null, 8, ["id", "response"]))
|
|
139
140
|
];
|
|
140
141
|
}),
|
|
141
142
|
_: 1
|
|
142
143
|
})
|
|
143
144
|
]),
|
|
144
|
-
(
|
|
145
|
+
(m = i.value) != null && m.description || y.value ? (o(), r(s(X), {
|
|
145
146
|
key: 0,
|
|
146
147
|
class: "response-card-footer",
|
|
147
148
|
muted: ""
|
|
148
149
|
}, {
|
|
149
150
|
default: u(() => {
|
|
150
|
-
var
|
|
151
|
+
var t, d;
|
|
151
152
|
return [
|
|
152
|
-
|
|
153
|
+
y.value ? (o(), r(s(Y), {
|
|
153
154
|
key: 0,
|
|
154
155
|
class: "response-example-selector",
|
|
155
|
-
examples: (
|
|
156
|
-
"onUpdate:modelValue": a[2] || (a[2] = (
|
|
157
|
-
}, null, 8, ["examples"])) : (
|
|
158
|
-
|
|
156
|
+
examples: (t = l.value) == null ? void 0 : t.examples,
|
|
157
|
+
"onUpdate:modelValue": a[2] || (a[2] = (c) => p.value = c)
|
|
158
|
+
}, null, 8, ["examples"])) : (d = i.value) != null && d.description ? (o(), f("div", ee, [
|
|
159
|
+
x(s(P), {
|
|
159
160
|
class: "markdown",
|
|
160
161
|
value: i.value.description
|
|
161
162
|
}, null, 8, ["value"])
|
|
162
|
-
])) :
|
|
163
|
+
])) : k("", !0)
|
|
163
164
|
];
|
|
164
165
|
}),
|
|
165
166
|
_: 1
|
|
166
|
-
})) :
|
|
167
|
+
})) : k("", !0)
|
|
167
168
|
];
|
|
168
169
|
}),
|
|
169
170
|
_: 1
|
|
170
|
-
})) :
|
|
171
|
+
})) : k("", !0);
|
|
171
172
|
}
|
|
172
173
|
});
|
|
173
174
|
export {
|
|
174
|
-
|
|
175
|
+
de as default
|
|
175
176
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-request.d.ts","sourceRoot":"","sources":["../../src/helpers/get-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAE9D,6CAA6C;AAC7C,eAAO,MAAM,UAAU,aAAc,cAAc,CAAC,UAAU,CAAC,QAAQ,MAAM,UAAU,MAAM;
|
|
1
|
+
{"version":3,"file":"get-request.d.ts","sourceRoot":"","sources":["../../src/helpers/get-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAE9D,6CAA6C;AAC7C,eAAO,MAAM,UAAU,aAAc,cAAc,CAAC,UAAU,CAAC,QAAQ,MAAM,UAAU,MAAM;yBAEoyT,KAAK;;;kDAA2H,KAAK,8CAA8C,KAAK;wCAA6E,KAAK;8BAA6D,KAAK;+BAAyD,KAAK;;;;;;mBAAwR,CAAC;;;;;;;;;;;;;mBAA8f,CAAC;eAAyC,CAAC;cAA6B,CAAC;eAA8B,CAAC;aAA4B,CAAC;gBAA8H,CAAC;iBAAoD,CAAC;mBAAkC,CAAC;;;;;kCAAiM,eAAe;aADr+W,CAAA"}
|