@scalar/openapi-to-markdown 0.2.36 → 0.2.38
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
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# @scalar/openapi-to-markdown
|
|
2
2
|
|
|
3
|
+
## 0.2.38
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 02085ef: refactor: use upgrade function from @scalar/openapi-upgrader
|
|
8
|
+
- Updated dependencies [6221e4a]
|
|
9
|
+
- Updated dependencies [005fba9]
|
|
10
|
+
- Updated dependencies [a1f865c]
|
|
11
|
+
- Updated dependencies [a1f865c]
|
|
12
|
+
- Updated dependencies [2d612e4]
|
|
13
|
+
- Updated dependencies [dcf50ef]
|
|
14
|
+
- Updated dependencies [02085ef]
|
|
15
|
+
- @scalar/openapi-upgrader@0.1.0
|
|
16
|
+
- @scalar/types@0.2.16
|
|
17
|
+
- @scalar/openapi-parser@0.21.0
|
|
18
|
+
- @scalar/oas-utils@0.4.30
|
|
19
|
+
- @scalar/snippetz@0.4.10
|
|
20
|
+
- @scalar/components@0.14.35
|
|
21
|
+
|
|
22
|
+
## 0.2.37
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies [498f771]
|
|
27
|
+
- Updated dependencies [bff46e5]
|
|
28
|
+
- Updated dependencies [8f2a2f2]
|
|
29
|
+
- @scalar/components@0.14.34
|
|
30
|
+
- @scalar/helpers@0.0.11
|
|
31
|
+
- @scalar/oas-utils@0.4.29
|
|
32
|
+
- @scalar/openapi-parser@0.20.6
|
|
33
|
+
|
|
3
34
|
## 0.2.36
|
|
4
35
|
|
|
5
36
|
### Patch Changes
|
|
@@ -1,238 +1,229 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarMarkdown as
|
|
3
|
-
import { getExampleFromSchema as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as B, createElementBlock as e, openBlock as t, createElementVNode as l, createBlock as v, createCommentVNode as i, toDisplayString as u, createTextVNode as d, unref as b, Fragment as r, renderList as m, createVNode as f } from "vue";
|
|
2
|
+
import { ScalarMarkdown as j } from "@scalar/components";
|
|
3
|
+
import { getExampleFromSchema as x } from "@scalar/oas-utils/spec-getters";
|
|
4
|
+
import O from "./Schema.vue.js";
|
|
5
|
+
import V from "./XmlOrJson.vue.js";
|
|
6
|
+
const C = { key: 1 }, E = { key: 0 }, w = { key: 1 }, D = { key: 2 }, M = { key: 0 }, N = { key: 1 }, P = { key: 0 }, R = { key: 1 }, U = { key: 3 }, q = { key: 2 }, A = { key: 3 }, F = { key: 0 }, I = { key: 1 }, L = { key: 4 }, K = /* @__PURE__ */ B({
|
|
7
7
|
__name: "MarkdownReference",
|
|
8
8
|
props: {
|
|
9
9
|
content: {}
|
|
10
10
|
},
|
|
11
|
-
setup(
|
|
12
|
-
return (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
l("
|
|
16
|
-
l("
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
]),
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
n[3] || (n[3] = i(" ")),
|
|
26
|
-
l("code", null, u((N = (M = y.content) == null ? void 0 : M.info) == null ? void 0 : N.version), 1)
|
|
27
|
-
])
|
|
28
|
-
])
|
|
29
|
-
]),
|
|
30
|
-
(R = (P = y.content) == null ? void 0 : P.info) != null && R.description ? (t(), j(S(x), {
|
|
31
|
-
key: 0,
|
|
32
|
-
value: (q = (U = y.content) == null ? void 0 : U.info) == null ? void 0 : q.description
|
|
33
|
-
}, null, 8, ["value"])) : r("", !0),
|
|
34
|
-
(F = (A = y.content) == null ? void 0 : A.servers) != null && F.length ? (t(), e("section", Q, [
|
|
35
|
-
n[10] || (n[10] = l("h2", null, "Servers", -1)),
|
|
36
|
-
l("ul", null, [
|
|
37
|
-
(t(!0), e(o, null, b(y.content.servers, (s) => (t(), e("li", {
|
|
38
|
-
key: s.url
|
|
39
|
-
}, [
|
|
40
|
-
n[8] || (n[8] = l("strong", null, "URL:", -1)),
|
|
41
|
-
n[9] || (n[9] = i(" ")),
|
|
42
|
-
l("code", null, u(s.url), 1),
|
|
43
|
-
l("ul", null, [
|
|
44
|
-
s.description ? (t(), e("li", X, [
|
|
45
|
-
n[4] || (n[4] = l("strong", null, "Description:", -1)),
|
|
46
|
-
i(" " + u(s.description), 1)
|
|
47
|
-
])) : r("", !0),
|
|
48
|
-
s.variables && Object.keys(s.variables).length ? (t(), e("li", Y, [
|
|
49
|
-
n[7] || (n[7] = l("strong", null, "Variables:", -1)),
|
|
50
|
-
l("ul", null, [
|
|
51
|
-
(t(!0), e(o, null, b(s.variables, (g, k) => (t(), e("li", { key: k }, [
|
|
52
|
-
l("code", null, u(k), 1),
|
|
53
|
-
n[5] || (n[5] = i(" (default: ")),
|
|
54
|
-
l("code", null, u(g.default), 1),
|
|
55
|
-
n[6] || (n[6] = i(")")),
|
|
56
|
-
g.description ? (t(), e(o, { key: 0 }, [
|
|
57
|
-
i(": " + u(g.description), 1)
|
|
58
|
-
], 64)) : r("", !0)
|
|
59
|
-
]))), 128))
|
|
60
|
-
])
|
|
61
|
-
])) : r("", !0)
|
|
62
|
-
])
|
|
63
|
-
]))), 128))
|
|
11
|
+
setup($) {
|
|
12
|
+
return (k, n) => (t(), e("section", null, [
|
|
13
|
+
l("header", null, [
|
|
14
|
+
l("h1", null, u(k.content?.info?.title), 1),
|
|
15
|
+
l("ul", null, [
|
|
16
|
+
l("li", null, [
|
|
17
|
+
n[0] || (n[0] = l("strong", null, "OpenAPI Version:", -1)),
|
|
18
|
+
n[1] || (n[1] = d(" ")),
|
|
19
|
+
l("code", null, u(k.content?.openapi), 1)
|
|
20
|
+
]),
|
|
21
|
+
l("li", null, [
|
|
22
|
+
n[2] || (n[2] = l("strong", null, "API Version:", -1)),
|
|
23
|
+
n[3] || (n[3] = d(" ")),
|
|
24
|
+
l("code", null, u(k.content?.info?.version), 1)
|
|
64
25
|
])
|
|
65
|
-
])
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
l("
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
l("code", null, u(s), 1)
|
|
98
|
-
]),
|
|
99
|
-
d.tags ? (t(), e("li", h, [
|
|
100
|
-
n[15] || (n[15] = l("strong", null, "Tags:", -1)),
|
|
101
|
-
i(" " + u(d.tags.join(", ")), 1)
|
|
102
|
-
])) : r("", !0),
|
|
103
|
-
d["x-scalar-stability"] ? (t(), e("li", a, [
|
|
104
|
-
n[16] || (n[16] = l("strong", null, "Stability:", -1)),
|
|
105
|
-
i(" " + u(d["x-scalar-stability"]), 1)
|
|
106
|
-
])) : r("", !0)
|
|
107
|
-
]),
|
|
108
|
-
v(S(x), {
|
|
109
|
-
value: d.description
|
|
110
|
-
}, null, 8, ["value"]),
|
|
111
|
-
(J = d.requestBody) != null && J.content ? (t(), e("section", T, [
|
|
112
|
-
n[18] || (n[18] = l("h4", null, "Request Body", -1)),
|
|
113
|
-
(t(!0), e(o, null, b(d.requestBody.content, (p, m) => (t(), e(o, { key: m }, [
|
|
114
|
-
l("h5", null, "Content-Type: " + u(m), 1),
|
|
115
|
-
p.schema ? (t(), e(o, { key: 0 }, [
|
|
116
|
-
v(B, {
|
|
117
|
-
schema: p.schema
|
|
118
|
-
}, null, 8, ["schema"]),
|
|
119
|
-
n[17] || (n[17] = l("p", null, [
|
|
120
|
-
l("strong", null, "Example:")
|
|
121
|
-
], -1)),
|
|
122
|
-
v(C, {
|
|
123
|
-
xml: m == null ? void 0 : m.toString().includes("xml"),
|
|
124
|
-
"model-value": S(V)(p.schema, {
|
|
125
|
-
xml: m == null ? void 0 : m.toString().includes("xml")
|
|
126
|
-
})
|
|
127
|
-
}, null, 8, ["xml", "model-value"])
|
|
128
|
-
], 64)) : r("", !0)
|
|
129
|
-
], 64))), 128))
|
|
130
|
-
])) : r("", !0),
|
|
131
|
-
d.responses ? (t(), e("section", c, [
|
|
132
|
-
n[20] || (n[20] = l("h4", null, "Responses", -1)),
|
|
133
|
-
(t(!0), e(o, null, b(d.responses, (p, m) => (t(), e("section", { key: m }, [
|
|
134
|
-
l("header", null, [
|
|
135
|
-
l("h5", null, [
|
|
136
|
-
i(" Status: " + u(m) + " ", 1),
|
|
137
|
-
p.description ? (t(), e(o, { key: 0 }, [
|
|
138
|
-
i(u(p.description), 1)
|
|
139
|
-
], 64)) : r("", !0)
|
|
140
|
-
])
|
|
141
|
-
]),
|
|
142
|
-
(t(!0), e(o, null, b(p.content, (O, f) => (t(), e("section", { key: f }, [
|
|
143
|
-
l("h6", null, "Content-Type: " + u(f), 1),
|
|
144
|
-
O.schema ? (t(), e(o, { key: 0 }, [
|
|
145
|
-
v(B, {
|
|
146
|
-
schema: O.schema
|
|
147
|
-
}, null, 8, ["schema"]),
|
|
148
|
-
n[19] || (n[19] = l("p", null, [
|
|
149
|
-
l("strong", null, "Example:")
|
|
150
|
-
], -1)),
|
|
151
|
-
v(C, {
|
|
152
|
-
xml: f == null ? void 0 : f.toString().includes("xml"),
|
|
153
|
-
"model-value": S(V)(O.schema, {
|
|
154
|
-
xml: f == null ? void 0 : f.toString().includes("xml")
|
|
155
|
-
})
|
|
156
|
-
}, null, 8, ["xml", "model-value"])
|
|
157
|
-
], 64)) : r("", !0)
|
|
158
|
-
]))), 128))
|
|
159
|
-
]))), 128))
|
|
160
|
-
])) : r("", !0)
|
|
161
|
-
]);
|
|
162
|
-
}), 128))
|
|
163
|
-
], 64);
|
|
164
|
-
}), 128))
|
|
165
|
-
])) : r("", !0),
|
|
166
|
-
Object.keys((($ = y.content) == null ? void 0 : $.webhooks) ?? {}).length ? (t(), e("section", _, [
|
|
167
|
-
n[26] || (n[26] = l("h2", null, "Webhooks", -1)),
|
|
168
|
-
(t(!0), e(o, null, b((W = y.content) == null ? void 0 : W.webhooks, (s, g) => (t(), e(o, { key: g }, [
|
|
169
|
-
(t(!0), e(o, null, b(s, (k, d) => (t(), e("section", { key: k }, [
|
|
170
|
-
l("header", null, [
|
|
171
|
-
l("h3", null, [
|
|
172
|
-
k.summary ? (t(), e(o, { key: 0 }, [
|
|
173
|
-
i(u(k.summary), 1)
|
|
174
|
-
], 64)) : (t(), e(o, { key: 1 }, [
|
|
175
|
-
i(u(g), 1)
|
|
176
|
-
], 64)),
|
|
177
|
-
k["x-scalar-stability"] ? (t(), e("span", ll, "(" + u(k["x-scalar-stability"]) + ")", 1)) : k.deprecated ? (t(), e("span", nl, "⚠️ Deprecated")) : r("", !0)
|
|
26
|
+
])
|
|
27
|
+
]),
|
|
28
|
+
k.content?.info?.description ? (t(), v(b(j), {
|
|
29
|
+
key: 0,
|
|
30
|
+
value: k.content?.info?.description
|
|
31
|
+
}, null, 8, ["value"])) : i("", !0),
|
|
32
|
+
k.content?.servers?.length ? (t(), e("section", C, [
|
|
33
|
+
n[10] || (n[10] = l("h2", null, "Servers", -1)),
|
|
34
|
+
l("ul", null, [
|
|
35
|
+
(t(!0), e(r, null, m(k.content.servers, (o) => (t(), e("li", {
|
|
36
|
+
key: o.url
|
|
37
|
+
}, [
|
|
38
|
+
n[8] || (n[8] = l("strong", null, "URL:", -1)),
|
|
39
|
+
n[9] || (n[9] = d(" ")),
|
|
40
|
+
l("code", null, u(o.url), 1),
|
|
41
|
+
l("ul", null, [
|
|
42
|
+
o.description ? (t(), e("li", E, [
|
|
43
|
+
n[4] || (n[4] = l("strong", null, "Description:", -1)),
|
|
44
|
+
d(" " + u(o.description), 1)
|
|
45
|
+
])) : i("", !0),
|
|
46
|
+
o.variables && Object.keys(o.variables).length ? (t(), e("li", w, [
|
|
47
|
+
n[7] || (n[7] = l("strong", null, "Variables:", -1)),
|
|
48
|
+
l("ul", null, [
|
|
49
|
+
(t(!0), e(r, null, m(o.variables, (s, y) => (t(), e("li", { key: y }, [
|
|
50
|
+
l("code", null, u(y), 1),
|
|
51
|
+
n[5] || (n[5] = d(" (default: ")),
|
|
52
|
+
l("code", null, u(s.default), 1),
|
|
53
|
+
n[6] || (n[6] = d(")")),
|
|
54
|
+
s.description ? (t(), e(r, { key: 0 }, [
|
|
55
|
+
d(": " + u(s.description), 1)
|
|
56
|
+
], 64)) : i("", !0)
|
|
57
|
+
]))), 128))
|
|
178
58
|
])
|
|
59
|
+
])) : i("", !0)
|
|
60
|
+
])
|
|
61
|
+
]))), 128))
|
|
62
|
+
])
|
|
63
|
+
])) : i("", !0),
|
|
64
|
+
Object.keys(k.content?.paths ?? {}).length ? (t(), e("section", D, [
|
|
65
|
+
n[21] || (n[21] = l("h2", null, "Operations", -1)),
|
|
66
|
+
(t(!0), e(r, null, m(Object.keys(k.content?.paths ?? {}), (o) => (t(), e(r, { key: o }, [
|
|
67
|
+
(t(!0), e(r, null, m(k.content?.paths?.[o], (s, y) => (t(), e("section", { key: s }, [
|
|
68
|
+
l("header", null, [
|
|
69
|
+
l("h3", null, [
|
|
70
|
+
s.summary ? (t(), e(r, { key: 0 }, [
|
|
71
|
+
d(u(s.summary), 1)
|
|
72
|
+
], 64)) : (t(), e(r, { key: 1 }, [
|
|
73
|
+
d(u(y.toString().toUpperCase()) + " " + u(o), 1)
|
|
74
|
+
], 64)),
|
|
75
|
+
s["x-scalar-stability"] ? (t(), e(r, { key: 2 }, [
|
|
76
|
+
d(" (" + u(s["x-scalar-stability"]) + ") ", 1)
|
|
77
|
+
], 64)) : s.deprecated ? (t(), e(r, { key: 3 }, [
|
|
78
|
+
d(" ⚠️ Deprecated ")
|
|
79
|
+
], 64)) : i("", !0)
|
|
80
|
+
])
|
|
81
|
+
]),
|
|
82
|
+
l("ul", null, [
|
|
83
|
+
l("li", null, [
|
|
84
|
+
n[11] || (n[11] = l("strong", null, "Method:", -1)),
|
|
85
|
+
n[12] || (n[12] = d(" ")),
|
|
86
|
+
l("code", null, u(y.toString().toUpperCase()), 1)
|
|
179
87
|
]),
|
|
180
|
-
l("
|
|
181
|
-
l("
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
]),
|
|
185
|
-
l("li", null, [
|
|
186
|
-
n[23] || (n[23] = l("strong", null, "Path:", -1)),
|
|
187
|
-
l("code", null, "/webhooks/" + u(g), 1)
|
|
188
|
-
]),
|
|
189
|
-
k.tags ? (t(), e("li", tl, [
|
|
190
|
-
n[24] || (n[24] = l("strong", null, "Tags:", -1)),
|
|
191
|
-
i(" " + u(k.tags.join(", ")), 1)
|
|
192
|
-
])) : r("", !0),
|
|
193
|
-
k.deprecated ? (t(), e("li", el, n[25] || (n[25] = [
|
|
194
|
-
l("strong", null, "Deprecated", -1)
|
|
195
|
-
]))) : r("", !0)
|
|
88
|
+
l("li", null, [
|
|
89
|
+
n[13] || (n[13] = l("strong", null, "Path:", -1)),
|
|
90
|
+
n[14] || (n[14] = d(" ")),
|
|
91
|
+
l("code", null, u(o), 1)
|
|
196
92
|
]),
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
93
|
+
s.tags ? (t(), e("li", M, [
|
|
94
|
+
n[15] || (n[15] = l("strong", null, "Tags:", -1)),
|
|
95
|
+
d(" " + u(s.tags.join(", ")), 1)
|
|
96
|
+
])) : i("", !0),
|
|
97
|
+
s["x-scalar-stability"] ? (t(), e("li", N, [
|
|
98
|
+
n[16] || (n[16] = l("strong", null, "Stability:", -1)),
|
|
99
|
+
d(" " + u(s["x-scalar-stability"]), 1)
|
|
100
|
+
])) : i("", !0)
|
|
101
|
+
]),
|
|
102
|
+
f(b(j), {
|
|
103
|
+
value: s.description
|
|
104
|
+
}, null, 8, ["value"]),
|
|
105
|
+
s.requestBody?.content ? (t(), e("section", P, [
|
|
106
|
+
n[18] || (n[18] = l("h4", null, "Request Body", -1)),
|
|
107
|
+
(t(!0), e(r, null, m(s.requestBody.content, (g, p) => (t(), e(r, { key: p }, [
|
|
108
|
+
l("h5", null, "Content-Type: " + u(p), 1),
|
|
109
|
+
g.schema ? (t(), e(r, { key: 0 }, [
|
|
110
|
+
f(O, {
|
|
111
|
+
schema: g.schema
|
|
112
|
+
}, null, 8, ["schema"]),
|
|
113
|
+
n[17] || (n[17] = l("p", null, [
|
|
114
|
+
l("strong", null, "Example:")
|
|
115
|
+
], -1)),
|
|
116
|
+
f(V, {
|
|
117
|
+
xml: p?.toString().includes("xml"),
|
|
118
|
+
"model-value": b(x)(g.schema, {
|
|
119
|
+
xml: p?.toString().includes("xml")
|
|
120
|
+
})
|
|
121
|
+
}, null, 8, ["xml", "model-value"])
|
|
122
|
+
], 64)) : i("", !0)
|
|
123
|
+
], 64))), 128))
|
|
124
|
+
])) : i("", !0),
|
|
125
|
+
s.responses ? (t(), e("section", R, [
|
|
126
|
+
n[20] || (n[20] = l("h4", null, "Responses", -1)),
|
|
127
|
+
(t(!0), e(r, null, m(s.responses, (g, p) => (t(), e("section", { key: p }, [
|
|
128
|
+
l("header", null, [
|
|
129
|
+
l("h5", null, [
|
|
130
|
+
d(" Status: " + u(p) + " ", 1),
|
|
131
|
+
g.description ? (t(), e(r, { key: 0 }, [
|
|
132
|
+
d(u(g.description), 1)
|
|
133
|
+
], 64)) : i("", !0)
|
|
134
|
+
])
|
|
135
|
+
]),
|
|
136
|
+
(t(!0), e(r, null, m(g.content, (a, S) => (t(), e("section", { key: S }, [
|
|
137
|
+
l("h6", null, "Content-Type: " + u(S), 1),
|
|
138
|
+
a.schema ? (t(), e(r, { key: 0 }, [
|
|
139
|
+
f(O, {
|
|
140
|
+
schema: a.schema
|
|
141
|
+
}, null, 8, ["schema"]),
|
|
142
|
+
n[19] || (n[19] = l("p", null, [
|
|
143
|
+
l("strong", null, "Example:")
|
|
144
|
+
], -1)),
|
|
145
|
+
f(V, {
|
|
146
|
+
xml: S?.toString().includes("xml"),
|
|
147
|
+
"model-value": b(x)(a.schema, {
|
|
148
|
+
xml: S?.toString().includes("xml")
|
|
149
|
+
})
|
|
150
|
+
}, null, 8, ["xml", "model-value"])
|
|
151
|
+
], 64)) : i("", !0)
|
|
152
|
+
]))), 128))
|
|
153
|
+
]))), 128))
|
|
154
|
+
])) : i("", !0)
|
|
155
|
+
]))), 128))
|
|
156
|
+
], 64))), 128))
|
|
157
|
+
])) : i("", !0),
|
|
158
|
+
Object.keys(k.content?.webhooks ?? {}).length ? (t(), e("section", U, [
|
|
159
|
+
n[26] || (n[26] = l("h2", null, "Webhooks", -1)),
|
|
160
|
+
(t(!0), e(r, null, m(k.content?.webhooks, (o, s) => (t(), e(r, { key: s }, [
|
|
161
|
+
(t(!0), e(r, null, m(o, (y, g) => (t(), e("section", { key: y }, [
|
|
206
162
|
l("header", null, [
|
|
207
|
-
l("h3", null,
|
|
163
|
+
l("h3", null, [
|
|
164
|
+
y.summary ? (t(), e(r, { key: 0 }, [
|
|
165
|
+
d(u(y.summary), 1)
|
|
166
|
+
], 64)) : (t(), e(r, { key: 1 }, [
|
|
167
|
+
d(u(s), 1)
|
|
168
|
+
], 64)),
|
|
169
|
+
y["x-scalar-stability"] ? (t(), e("span", q, "(" + u(y["x-scalar-stability"]) + ")", 1)) : y.deprecated ? (t(), e("span", A, "⚠️ Deprecated")) : i("", !0)
|
|
170
|
+
])
|
|
208
171
|
]),
|
|
209
172
|
l("ul", null, [
|
|
210
173
|
l("li", null, [
|
|
211
|
-
n[
|
|
212
|
-
l("code", null, u(
|
|
213
|
-
])
|
|
174
|
+
n[22] || (n[22] = l("strong", null, "Method:", -1)),
|
|
175
|
+
l("code", null, u(g.toString().toUpperCase()), 1)
|
|
176
|
+
]),
|
|
177
|
+
l("li", null, [
|
|
178
|
+
n[23] || (n[23] = l("strong", null, "Path:", -1)),
|
|
179
|
+
l("code", null, "/webhooks/" + u(s), 1)
|
|
180
|
+
]),
|
|
181
|
+
y.tags ? (t(), e("li", F, [
|
|
182
|
+
n[24] || (n[24] = l("strong", null, "Tags:", -1)),
|
|
183
|
+
d(" " + u(y.tags.join(", ")), 1)
|
|
184
|
+
])) : i("", !0),
|
|
185
|
+
y.deprecated ? (t(), e("li", I, n[25] || (n[25] = [
|
|
186
|
+
l("strong", null, "Deprecated", -1)
|
|
187
|
+
]))) : i("", !0)
|
|
214
188
|
]),
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}, null, 8, ["value"])) : r("", !0),
|
|
219
|
-
s.type === "object" ? (t(), j(B, {
|
|
220
|
-
key: 1,
|
|
221
|
-
schema: s
|
|
222
|
-
}, null, 8, ["schema"])) : r("", !0),
|
|
223
|
-
n[28] || (n[28] = l("p", null, [
|
|
224
|
-
l("strong", null, "Example:")
|
|
225
|
-
], -1)),
|
|
226
|
-
s.type === "object" ? (t(), j(C, {
|
|
227
|
-
key: 2,
|
|
228
|
-
"model-value": S(V)(s)
|
|
229
|
-
}, null, 8, ["model-value"])) : r("", !0)
|
|
189
|
+
f(b(j), {
|
|
190
|
+
value: y.description
|
|
191
|
+
}, null, 8, ["value"])
|
|
230
192
|
]))), 128))
|
|
231
|
-
]))
|
|
232
|
-
])
|
|
233
|
-
|
|
193
|
+
], 64))), 128))
|
|
194
|
+
])) : i("", !0),
|
|
195
|
+
k.content?.components?.schemas && Object.keys(k.content.components.schemas).length ? (t(), e("section", L, [
|
|
196
|
+
n[29] || (n[29] = l("h2", null, "Schemas", -1)),
|
|
197
|
+
(t(!0), e(r, null, m(k.content.components.schemas, (o, s) => (t(), e("section", { key: s }, [
|
|
198
|
+
l("header", null, [
|
|
199
|
+
l("h3", null, u(o.title ?? s), 1)
|
|
200
|
+
]),
|
|
201
|
+
l("ul", null, [
|
|
202
|
+
l("li", null, [
|
|
203
|
+
n[27] || (n[27] = l("strong", null, "Type:", -1)),
|
|
204
|
+
l("code", null, u(o.type), 1)
|
|
205
|
+
])
|
|
206
|
+
]),
|
|
207
|
+
o.description ? (t(), v(b(j), {
|
|
208
|
+
key: 0,
|
|
209
|
+
value: o.description
|
|
210
|
+
}, null, 8, ["value"])) : i("", !0),
|
|
211
|
+
o.type === "object" ? (t(), v(O, {
|
|
212
|
+
key: 1,
|
|
213
|
+
schema: o
|
|
214
|
+
}, null, 8, ["schema"])) : i("", !0),
|
|
215
|
+
n[28] || (n[28] = l("p", null, [
|
|
216
|
+
l("strong", null, "Example:")
|
|
217
|
+
], -1)),
|
|
218
|
+
o.type === "object" ? (t(), v(V, {
|
|
219
|
+
key: 2,
|
|
220
|
+
"model-value": b(x)(o)
|
|
221
|
+
}, null, 8, ["model-value"])) : i("", !0)
|
|
222
|
+
]))), 128))
|
|
223
|
+
])) : i("", !0)
|
|
224
|
+
]));
|
|
234
225
|
}
|
|
235
226
|
});
|
|
236
227
|
export {
|
|
237
|
-
|
|
228
|
+
K as default
|
|
238
229
|
};
|
|
@@ -1,132 +1,129 @@
|
|
|
1
|
-
import { defineComponent as O, resolveComponent as g, createElementBlock as t, createCommentVNode as i, openBlock as n, createElementVNode as o, Fragment as
|
|
2
|
-
const j = { key: 0 }, v = { key: 0 }, I = { key: 1 }, b = { key: 2 },
|
|
1
|
+
import { defineComponent as O, resolveComponent as g, createElementBlock as t, createCommentVNode as i, openBlock as n, createElementVNode as o, Fragment as h, renderList as f, createVNode as a, createBlock as p, toDisplayString as u, createTextVNode as d } from "vue";
|
|
2
|
+
const j = { key: 0 }, v = { key: 0 }, I = { key: 1 }, b = { key: 2 }, q = { key: 3 }, N = { key: 4 }, A = { key: 0 }, B = { key: 0 }, C = { key: 1 }, J = { key: 2 }, V = { key: 3 }, E = { key: 1 }, M = { key: 5 }, R = { key: 0 }, D = { key: 0 }, F = { key: 1 }, L = { key: 2 }, P = { key: 6 }, T = { key: 0 }, U = { key: 1 }, w = { key: 2 }, z = { key: 3 }, K = /* @__PURE__ */ O({
|
|
3
3
|
__name: "Schema",
|
|
4
4
|
props: {
|
|
5
5
|
schema: { type: [Object, Boolean] }
|
|
6
6
|
},
|
|
7
|
-
setup(
|
|
8
|
-
const c = (
|
|
9
|
-
const
|
|
10
|
-
const y =
|
|
11
|
-
return y && !
|
|
7
|
+
setup(G) {
|
|
8
|
+
const c = (e, s) => {
|
|
9
|
+
const m = Object.entries(e).sort(([l], [r]) => {
|
|
10
|
+
const y = s?.includes(l), k = s?.includes(r);
|
|
11
|
+
return y && !k ? -1 : !y && k ? 1 : l.localeCompare(r);
|
|
12
12
|
});
|
|
13
|
-
return Object.fromEntries(
|
|
13
|
+
return Object.fromEntries(m);
|
|
14
14
|
};
|
|
15
|
-
return (
|
|
16
|
-
const
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
return (e, s) => {
|
|
16
|
+
const m = g("Schema", !0);
|
|
17
|
+
return e.schema ? (n(), t("section", j, [
|
|
18
|
+
e.schema.allOf ? (n(), t("section", v, [
|
|
19
|
+
s[0] || (s[0] = o("header", null, [
|
|
20
20
|
o("strong", null, "All of:")
|
|
21
21
|
], -1)),
|
|
22
|
-
(n(!0), t(
|
|
23
|
-
|
|
22
|
+
(n(!0), t(h, null, f(e.schema.allOf, (l, r) => (n(), t("section", { key: r }, [
|
|
23
|
+
a(m, { schema: l }, null, 8, ["schema"])
|
|
24
24
|
]))), 128))
|
|
25
|
-
])) :
|
|
26
|
-
|
|
25
|
+
])) : e.schema.anyOf ? (n(), t("section", I, [
|
|
26
|
+
s[1] || (s[1] = o("header", null, [
|
|
27
27
|
o("strong", null, "Any of:")
|
|
28
28
|
], -1)),
|
|
29
|
-
(n(!0), t(
|
|
30
|
-
|
|
29
|
+
(n(!0), t(h, null, f(e.schema.anyOf, (l, r) => (n(), t("section", { key: r }, [
|
|
30
|
+
a(m, { schema: l }, null, 8, ["schema"])
|
|
31
31
|
]))), 128))
|
|
32
|
-
])) :
|
|
33
|
-
|
|
32
|
+
])) : e.schema.oneOf ? (n(), t("section", b, [
|
|
33
|
+
s[2] || (s[2] = o("header", null, [
|
|
34
34
|
o("strong", null, "One of:")
|
|
35
35
|
], -1)),
|
|
36
|
-
(n(!0), t(
|
|
37
|
-
|
|
36
|
+
(n(!0), t(h, null, f(e.schema.oneOf, (l, r) => (n(), t("section", { key: r }, [
|
|
37
|
+
a(m, { schema: l }, null, 8, ["schema"])
|
|
38
38
|
]))), 128))
|
|
39
|
-
])) :
|
|
40
|
-
|
|
39
|
+
])) : e.schema.not ? (n(), t("section", q, [
|
|
40
|
+
s[3] || (s[3] = o("header", null, [
|
|
41
41
|
o("strong", null, "Not:")
|
|
42
42
|
], -1)),
|
|
43
43
|
o("section", null, [
|
|
44
|
-
|
|
45
|
-
schema:
|
|
44
|
+
a(m, {
|
|
45
|
+
schema: e.schema.not
|
|
46
46
|
}, null, 8, ["schema"])
|
|
47
47
|
])
|
|
48
|
-
])) :
|
|
48
|
+
])) : e.schema.type === "object" || e.schema.properties ? (n(), t("section", N, [
|
|
49
49
|
o("ul", null, [
|
|
50
|
-
(n(!0), t(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
), (l,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
]
|
|
66
|
-
l.enum
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
]
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
])) : i("", !0)
|
|
88
|
-
]);
|
|
89
|
-
}), 128))
|
|
50
|
+
(n(!0), t(h, null, f(c(
|
|
51
|
+
e.schema.properties || {},
|
|
52
|
+
e.schema.required
|
|
53
|
+
), (l, r) => (n(), t("li", { key: r }, [
|
|
54
|
+
o("strong", null, [
|
|
55
|
+
o("code", null, u(r), 1),
|
|
56
|
+
e.schema.required?.includes(r) ? (n(), t("span", A, " (required) ")) : i("", !0)
|
|
57
|
+
]),
|
|
58
|
+
o("p", null, [
|
|
59
|
+
o("code", null, u(Array.isArray(l.type) ? l.type.join(" | ") : l.type || "object"), 1),
|
|
60
|
+
l.format ? (n(), t("span", B, [
|
|
61
|
+
s[4] || (s[4] = d(", format: ")),
|
|
62
|
+
o("code", null, u(l.format), 1)
|
|
63
|
+
])) : i("", !0),
|
|
64
|
+
l.enum ? (n(), t("span", C, [
|
|
65
|
+
s[5] || (s[5] = d(", possible values: ")),
|
|
66
|
+
o("code", null, u(l.enum.map((y) => JSON.stringify(y)).join(", ")), 1)
|
|
67
|
+
])) : i("", !0),
|
|
68
|
+
l.default !== void 0 ? (n(), t("span", J, [
|
|
69
|
+
s[6] || (s[6] = d(", default: ")),
|
|
70
|
+
o("code", null, u(JSON.stringify(l.default)), 1)
|
|
71
|
+
])) : i("", !0),
|
|
72
|
+
l.description ? (n(), t("span", V, " — " + u(l.description), 1)) : i("", !0)
|
|
73
|
+
]),
|
|
74
|
+
l.type === "object" || l.properties ? (n(), p(m, {
|
|
75
|
+
key: 0,
|
|
76
|
+
schema: l
|
|
77
|
+
}, null, 8, ["schema"])) : i("", !0),
|
|
78
|
+
l.type === "array" && l.items ? (n(), t("section", E, [
|
|
79
|
+
s[7] || (s[7] = o("header", null, [
|
|
80
|
+
o("strong", null, "Items:")
|
|
81
|
+
], -1)),
|
|
82
|
+
a(m, {
|
|
83
|
+
schema: l.items
|
|
84
|
+
}, null, 8, ["schema"])
|
|
85
|
+
])) : i("", !0)
|
|
86
|
+
]))), 128))
|
|
90
87
|
])
|
|
91
|
-
])) :
|
|
92
|
-
|
|
88
|
+
])) : e.schema.type === "array" && e.schema.items ? (n(), t("section", M, [
|
|
89
|
+
s[11] || (s[11] = o("header", null, [
|
|
93
90
|
o("strong", null, "Array of:")
|
|
94
91
|
], -1)),
|
|
95
92
|
o("section", null, [
|
|
96
|
-
|
|
97
|
-
schema:
|
|
93
|
+
a(m, {
|
|
94
|
+
schema: e.schema.items
|
|
98
95
|
}, null, 8, ["schema"])
|
|
99
96
|
]),
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
o("code", null, u(
|
|
97
|
+
e.schema.minItems !== void 0 || e.schema.maxItems !== void 0 || e.schema.uniqueItems ? (n(), t("ul", R, [
|
|
98
|
+
e.schema.minItems !== void 0 ? (n(), t("li", D, [
|
|
99
|
+
s[8] || (s[8] = d(" Min items: ")),
|
|
100
|
+
o("code", null, u(e.schema.minItems), 1)
|
|
104
101
|
])) : i("", !0),
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
o("code", null, u(
|
|
102
|
+
e.schema.maxItems !== void 0 ? (n(), t("li", F, [
|
|
103
|
+
s[9] || (s[9] = d(" Max items: ")),
|
|
104
|
+
o("code", null, u(e.schema.maxItems), 1)
|
|
108
105
|
])) : i("", !0),
|
|
109
|
-
|
|
110
|
-
|
|
106
|
+
e.schema.uniqueItems ? (n(), t("li", L, s[10] || (s[10] = [
|
|
107
|
+
d("Unique items: "),
|
|
111
108
|
o("code", null, "true", -1)
|
|
112
109
|
]))) : i("", !0)
|
|
113
110
|
])) : i("", !0)
|
|
114
|
-
])) : (n(), t("section",
|
|
111
|
+
])) : (n(), t("section", P, [
|
|
115
112
|
o("p", null, [
|
|
116
|
-
o("code", null, u(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
o("code", null, u(
|
|
113
|
+
o("code", null, u(e.schema.type), 1),
|
|
114
|
+
e.schema.format ? (n(), t("span", T, [
|
|
115
|
+
s[12] || (s[12] = d(", format: ")),
|
|
116
|
+
o("code", null, u(e.schema.format), 1)
|
|
120
117
|
])) : i("", !0),
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
o("code", null, u(
|
|
118
|
+
e.schema.enum ? (n(), t("span", U, [
|
|
119
|
+
s[13] || (s[13] = d(", possible values: ")),
|
|
120
|
+
o("code", null, u(e.schema.enum.map((l) => JSON.stringify(l)).join(", ")), 1)
|
|
124
121
|
])) : i("", !0),
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
o("code", null, u(JSON.stringify(
|
|
122
|
+
e.schema.default !== void 0 ? (n(), t("span", w, [
|
|
123
|
+
s[14] || (s[14] = d(", default: ")),
|
|
124
|
+
o("code", null, u(JSON.stringify(e.schema.default)), 1)
|
|
128
125
|
])) : i("", !0),
|
|
129
|
-
|
|
126
|
+
e.schema.description ? (n(), t("span", z, " — " + u(e.schema.description), 1)) : i("", !0)
|
|
130
127
|
])
|
|
131
128
|
]))
|
|
132
129
|
])) : i("", !0);
|
|
@@ -134,5 +131,5 @@ const j = { key: 0 }, v = { key: 0 }, I = { key: 1 }, b = { key: 2 }, N = { key:
|
|
|
134
131
|
}
|
|
135
132
|
});
|
|
136
133
|
export {
|
|
137
|
-
|
|
134
|
+
K as default
|
|
138
135
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-markdown-from-openapi.d.ts","sourceRoot":"","sources":["../src/create-markdown-from-openapi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"create-markdown-from-openapi.d.ts","sourceRoot":"","sources":["../src/create-markdown-from-openapi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAepD,KAAK,WAAW,GAAG,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAA;AAEtE,wBAAsB,qBAAqB,CAAC,KAAK,EAAE,WAAW,mBAyB7D;AAED,wBAAsB,yBAAyB,CAAC,OAAO,EAAE,WAAW,mBAEnE;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAYpE"}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import p from "
|
|
4
|
-
import s from "rehype-
|
|
5
|
-
import u from "rehype-
|
|
6
|
-
import c from "
|
|
7
|
-
import f from "remark-
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import g from "
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { normalize as n, dereference as i } from "@scalar/openapi-parser";
|
|
2
|
+
import { upgrade as a } from "@scalar/openapi-upgrader";
|
|
3
|
+
import { minify as p } from "html-minifier-terser";
|
|
4
|
+
import s from "rehype-parse";
|
|
5
|
+
import u from "rehype-remark";
|
|
6
|
+
import c from "rehype-sanitize";
|
|
7
|
+
import f from "remark-gfm";
|
|
8
|
+
import l from "remark-stringify";
|
|
9
|
+
import { unified as y } from "unified";
|
|
10
|
+
import { createSSRApp as d } from "vue";
|
|
11
|
+
import { renderToString as g } from "vue/server-renderer";
|
|
12
|
+
import h from "./components/MarkdownReference.vue.js";
|
|
13
|
+
async function w(e) {
|
|
14
|
+
const r = a(n(e), "3.1"), { schema: t } = await i(r), o = d(h, {
|
|
14
15
|
content: t
|
|
15
|
-
}), m = await
|
|
16
|
-
return
|
|
16
|
+
}), m = await g(o);
|
|
17
|
+
return p(m, {
|
|
17
18
|
removeComments: !0,
|
|
18
19
|
removeEmptyElements: !0,
|
|
19
20
|
collapseWhitespace: !0,
|
|
@@ -25,17 +26,17 @@ async function h(e) {
|
|
|
25
26
|
useShortDoctype: !0
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
|
-
async function
|
|
29
|
-
return
|
|
29
|
+
async function R(e) {
|
|
30
|
+
return S(await w(e));
|
|
30
31
|
}
|
|
31
|
-
async function
|
|
32
|
-
const r = await
|
|
32
|
+
async function S(e) {
|
|
33
|
+
const r = await y().use(s, { fragment: !0 }).use(f).use(c).use(u).use(l, {
|
|
33
34
|
bullet: "-"
|
|
34
35
|
}).process(e);
|
|
35
36
|
return String(r);
|
|
36
37
|
}
|
|
37
38
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
w as createHtmlFromOpenApi,
|
|
40
|
+
R as createMarkdownFromOpenApi,
|
|
41
|
+
S as markdownFromHtml
|
|
41
42
|
};
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"llm",
|
|
17
17
|
"swagger"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.2.
|
|
19
|
+
"version": "0.2.38",
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=20"
|
|
22
22
|
},
|
|
@@ -54,21 +54,22 @@
|
|
|
54
54
|
"remark-stringify": "^11.0.0",
|
|
55
55
|
"unified": "^11.0.4",
|
|
56
56
|
"vue": "^3.5.17",
|
|
57
|
-
"@scalar/
|
|
58
|
-
"@scalar/
|
|
59
|
-
"@scalar/oas-utils": "0.4.
|
|
60
|
-
"@scalar/openapi-parser": "0.
|
|
57
|
+
"@scalar/components": "0.14.35",
|
|
58
|
+
"@scalar/helpers": "0.0.11",
|
|
59
|
+
"@scalar/oas-utils": "0.4.30",
|
|
60
|
+
"@scalar/openapi-parser": "0.21.0",
|
|
61
61
|
"@scalar/openapi-types": "0.3.7",
|
|
62
|
-
"@scalar/types": "0.2.
|
|
63
|
-
"@scalar/
|
|
62
|
+
"@scalar/types": "0.2.16",
|
|
63
|
+
"@scalar/openapi-upgrader": "0.1.0",
|
|
64
|
+
"@scalar/snippetz": "0.4.10"
|
|
64
65
|
},
|
|
65
66
|
"devDependencies": {
|
|
66
67
|
"@hono/node-server": "^1.11.0",
|
|
67
68
|
"@types/html-minifier-terser": "^7.0.2",
|
|
68
|
-
"@vitejs/plugin-vue": "
|
|
69
|
+
"@vitejs/plugin-vue": "6.0.1",
|
|
69
70
|
"@vue/test-utils": "^2.4.1",
|
|
70
|
-
"hono": "
|
|
71
|
-
"vite": "
|
|
71
|
+
"hono": "4.9.7",
|
|
72
|
+
"vite": "7.1.5",
|
|
72
73
|
"vue": "^3.5.17",
|
|
73
74
|
"@scalar/galaxy": "0.5.8",
|
|
74
75
|
"@scalar/build-tooling": "0.2.7"
|